/* Echoterra CRM — internal tool styles */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --sky: #0284c7; --sky-dark: #0369a1; --slate: #1e293b;
  --bg: #f1f5f9; --border: #e2e8f0; --muted: #64748b;
  --red: #ef4444; --green: #10b981; --amber: #f59e0b;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--slate); font-size: 14px; line-height: 1.5;
}
a { color: var(--sky); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; background: var(--slate); color: #cbd5e1;
  display: flex; flex-direction: column; position: fixed; height: 100vh;
}
.brand { font-size: 17px; font-weight: 700; color: #fff; padding: 20px 18px; letter-spacing: .3px; }
.sidebar nav { flex: 1; display: flex; flex-direction: column; padding: 6px; }
.sidebar nav a {
  color: #cbd5e1; padding: 10px 14px; border-radius: 7px; margin-bottom: 2px;
  font-weight: 500;
}
.sidebar nav a:hover { background: #334155; color: #fff; text-decoration: none; }
.sidebar nav a.active { background: var(--sky); color: #fff; }
.sidebar-foot { padding: 14px 18px; border-top: 1px solid #334155; }
.who { font-weight: 600; color: #fff; }
.who span { display: block; font-size: 11px; color: #94a3b8; text-transform: uppercase; font-weight: 500; }
.logout { display: inline-block; margin-top: 8px; font-size: 13px; color: #94a3b8; }
.main { margin-left: 220px; flex: 1; padding: 26px 32px; max-width: 1300px; }

/* Page header */
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.page-head h1 { font-size: 22px; font-weight: 700; }
.page-actions { display: flex; gap: 8px; }

/* Flash */
.flash { padding: 11px 16px; border-radius: 8px; margin-bottom: 18px; font-weight: 500; }
.flash-success { background: #dcfce7; color: #166534; }
.flash-error { background: #fee2e2; color: #991b1b; }
.flash-info { background: #dbeafe; color: #1e40af; }

/* Cards */
.card { background: #fff; border: 1px solid var(--border); border-radius: 11px; padding: 20px; margin-bottom: 18px; }
.card h2 { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.card-grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Stat tiles */
.stat { background: #fff; border: 1px solid var(--border); border-radius: 11px; padding: 18px; }
.stat .n { font-size: 28px; font-weight: 800; }
.stat .l { color: var(--muted); font-size: 13px; font-weight: 500; }

/* Tables */
table { width: 100%; border-collapse: collapse; background: #fff; }
.table-wrap { background: #fff; border: 1px solid var(--border); border-radius: 11px; overflow: hidden; }
th { text-align: left; font-size: 12px; text-transform: uppercase; color: var(--muted);
     padding: 11px 14px; border-bottom: 1px solid var(--border); font-weight: 600; }
td { padding: 11px 14px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }

/* Badges */
.badge { display: inline-block; color: #fff; font-size: 11px; font-weight: 600;
         padding: 2px 9px; border-radius: 11px; text-transform: capitalize; }

/* Buttons */
.btn { display: inline-block; background: var(--sky); color: #fff; border: none;
       padding: 9px 16px; border-radius: 8px; font-weight: 600; font-size: 13px;
       cursor: pointer; }
.btn:hover { background: var(--sky-dark); text-decoration: none; color: #fff; }
.btn-light { background: #fff; color: var(--slate); border: 1px solid var(--border); }
.btn-light:hover { background: #f8fafc; color: var(--slate); }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* Forms */
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=time], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit;
}
textarea { resize: vertical; min-height: 80px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Pipeline board */
.board { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.board-col { background: #e9eef3; border-radius: 10px; padding: 10px; min-height: 120px; }
.board-col h3 { font-size: 12px; text-transform: uppercase; color: var(--muted);
                margin-bottom: 9px; display: flex; justify-content: space-between; }
.deal-card { background: #fff; border: 1px solid var(--border); border-radius: 8px;
             padding: 10px; margin-bottom: 8px; cursor: grab; }
.deal-card.dragging { opacity: .45; }
.deal-card .t { font-weight: 600; }
.deal-card .v { color: var(--green); font-weight: 700; }
.deal-card .c { color: var(--muted); font-size: 12px; }
.board-col.drop-target { outline: 2px dashed var(--sky); outline-offset: -4px; }

/* Timeline */
.timeline { list-style: none; }
.timeline li { display: flex; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.timeline li:last-child { border-bottom: none; }
.timeline .ico { font-size: 18px; }
.timeline .meta { color: var(--muted); font-size: 12px; }

/* Misc */
.muted { color: var(--muted); }
.right { text-align: right; }
.empty { text-align: center; color: var(--muted); padding: 36px; }
.overdue { color: var(--red); font-weight: 600; }
.done-row td { text-decoration: line-through; color: var(--muted); }
.tag { display: inline-block; background: #e2e8f0; color: #475569; font-size: 11px;
       padding: 2px 8px; border-radius: 6px; }
.toolbar { display: flex; gap: 8px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.toolbar input[type=text], .toolbar select { width: auto; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; }
.kv dt { color: var(--muted); font-weight: 500; }
.dlist { display: flex; flex-direction: column; gap: 10px; }

/* Login */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { background: #fff; border: 1px solid var(--border); border-radius: 14px;
             padding: 34px; width: 360px; }
.login-box h1 { font-size: 20px; margin-bottom: 6px; }
.login-box p.sub { color: var(--muted); margin-bottom: 20px; }
