/* ═══ MEDUTI CRM — Stylesheet ═══ */

:root {
  /* Palette */
  --bg: #0A0A0A;
  --bg-elev: #121212;
  --surface: #161616;
  --surface-hi: #1C1C1C;
  --border: #1F1F1F;
  --border-strong: #2A2A2A;
  --text: #F5F5F5;
  --text-dim: #9A9A9A;
  --text-mute: #6A6A6A;
  --accent: #C8FF00;
  --accent-soft: rgba(200, 255, 0, 0.12);
  --accent-line: rgba(200, 255, 0, 0.3);
  --danger: #FF4D5E;
  --warning: #FFB020;
  --success: #4ADE80;
  --info: #5BB5FF;

  /* Type */
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Layout */
  --sidebar-w: 240px;
  --topbar-h: 60px;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; }
input, select, textarea { background: none; border: 0; color: inherit; font: inherit; outline: none; }
svg { width: 18px; height: 18px; }
.accent { color: var(--accent); }

/* ═══ Demo banner ═══ */
.demo-banner {
  position: relative;
  background: linear-gradient(90deg, rgba(200,255,0,0.08), rgba(200,255,0,0.02));
  border-bottom: 1px solid var(--accent-line);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.demo-banner__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 1.6s ease-in-out infinite;
}
.demo-banner__text { color: var(--text-dim); flex: 1; }
.demo-banner__text strong { color: var(--accent); font-weight: 600; }
.demo-banner__text a { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; }
.demo-banner__text a:hover { color: var(--accent); }
.demo-banner__close {
  width: 24px; height: 24px;
  border-radius: 50%;
  color: var(--text-mute);
  display: grid; place-items: center;
  font-size: 12px;
  transition: all 0.15s;
}
.demo-banner__close:hover { background: var(--surface); color: var(--text); }
.demo-banner.is-hidden { display: none; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ═══ App shell ═══ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: calc(100vh - 41px);
}

/* ═══ Sidebar ═══ */
.sidebar {
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: calc(100vh - 41px);
  overflow-y: auto;
}
.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  margin-bottom: 28px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.sidebar__brand-mark {
  width: 22px; height: 22px;
  background: var(--accent);
  border-radius: 5px;
  position: relative;
  box-shadow: 0 0 16px rgba(200,255,0,0.4);
}
.sidebar__brand-mark::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 2px solid var(--bg);
  border-radius: 2px;
  border-bottom: 0;
  border-right: 0;
}

.sidebar__nav { flex: 1; }
.sidebar__group-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-mute);
  padding: 14px 8px 6px;
}
.sidebar__nav ul { list-style: none; display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
  position: relative;
}
.nav-item svg { width: 16px; height: 16px; opacity: 0.85; }
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.is-active {
  background: var(--surface-hi);
  color: var(--text);
}
.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 8px; bottom: 8px;
  width: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.nav-item.is-active svg { color: var(--accent); opacity: 1; }
.nav-item__badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 6px;
  background: var(--surface);
  color: var(--text-dim);
  border-radius: 999px;
  border: 1px solid var(--border-strong);
}
.nav-item.is-active .nav-item__badge { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.nav-item__dot {
  margin-left: auto;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.sidebar__foot {
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.user-chip:hover { background: var(--surface); }
.user-chip__avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8FBA00);
  color: var(--bg);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 11px;
}
.user-chip__name { font-size: 13px; font-weight: 600; }
.user-chip__role { font-size: 11px; color: var(--text-mute); font-family: var(--font-mono); letter-spacing: 0.04em; }

/* ═══ Topbar ═══ */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  height: var(--topbar-h);
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar__search {
  flex: 1;
  max-width: 480px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s;
}
.topbar__search:focus-within { border-color: var(--accent-line); }
.topbar__search svg { color: var(--text-mute); }
.topbar__search input { flex: 1; font-size: 13px; }
.topbar__search input::placeholder { color: var(--text-mute); }
.topbar__search kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 6px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  color: var(--text-mute);
}
.topbar__actions { display: flex; align-items: center; gap: 10px; }
.topbar__icon {
  position: relative;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  display: grid; place-items: center;
  transition: all 0.15s;
}
.topbar__icon:hover { background: var(--surface); color: var(--text); }
.topbar__icon-dot {
  position: absolute;
  top: 8px; right: 9px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--bg-elev);
}

.btn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn--primary { background: var(--accent); color: var(--bg); }
.btn--primary:hover { background: #D4FF33; transform: translateY(-1px); }
.btn--ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.btn--ghost:hover { background: var(--surface-hi); }
.btn--sm { padding: 5px 10px; font-size: 12px; }

/* ═══ View container ═══ */
.view {
  padding: 28px;
  flex: 1;
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 20px;
  flex-wrap: wrap;
}
.view-head__title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.view-head__sub {
  font-size: 13px;
  color: var(--text-mute);
  margin-top: 4px;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.view-head__actions { display: flex; gap: 8px; }

/* ═══ KPI cards (dashboard) ═══ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.kpi {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.kpi__label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-mute);
  margin-bottom: 10px;
}
.kpi__value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.kpi__delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  margin-top: 6px;
  padding: 2px 6px;
  border-radius: 4px;
}
.kpi__delta--up { background: rgba(74, 222, 128, 0.12); color: var(--success); }
.kpi__delta--down { background: rgba(255, 77, 94, 0.12); color: var(--danger); }
.kpi__sparkline {
  position: absolute;
  right: 16px; bottom: 16px;
  width: 80px; height: 32px;
  opacity: 0.8;
}

/* ═══ Dashboard split ═══ */
.dash-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
}
.panel {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.panel__title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.panel__action {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}
.panel__action:hover { color: var(--accent); }

/* Activity feed */
.activity { display: flex; flex-direction: column; }
.activity__item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.activity__item:last-child { border-bottom: 0; }
.activity__icon {
  width: 28px; height: 28px;
  background: var(--surface);
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--text-dim);
}
.activity__icon svg { width: 13px; height: 13px; }
.activity__icon--success { background: rgba(74, 222, 128, 0.14); color: var(--success); }
.activity__icon--warning { background: rgba(255, 176, 32, 0.14); color: var(--warning); }
.activity__icon--info { background: rgba(91, 181, 255, 0.14); color: var(--info); }
.activity__icon--accent { background: var(--accent-soft); color: var(--accent); }
.activity__body { font-size: 13px; }
.activity__body strong { font-weight: 600; }
.activity__body em { color: var(--accent); font-style: normal; }
.activity__time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-mute);
  white-space: nowrap;
}

/* Revenue chart */
.chart {
  width: 100%; height: 180px;
  margin-top: 8px;
}
.chart__legend {
  display: flex;
  gap: 14px;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}
.chart__legend-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: 1px;
}

/* ═══ Tables ═══ */
.table-wrap {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.table-tools {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.table-tools input {
  flex: 1;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.table-tools input::placeholder { color: var(--text-mute); }
.filter-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 5px 10px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
}
.filter-chip:hover { color: var(--text); }
.filter-chip.is-active {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table thead th {
  text-align: left;
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-mute);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.table tbody tr { transition: background 0.12s; cursor: pointer; }
.table tbody tr:hover { background: var(--surface); }
.table tbody tr.is-selected { background: var(--surface-hi); }
.table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { font-family: var(--font-mono); }
.table .right { text-align: right; }

.cell-client {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cell-client__avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--surface-hi);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}
.cell-client__name { font-weight: 600; }
.cell-client__sub { font-size: 11px; color: var(--text-mute); font-family: var(--font-mono); }

/* ═══ Status pills ═══ */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 9px;
  border-radius: 999px;
  font-weight: 500;
}
.pill::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
}
.pill--draft { background: rgba(106, 106, 106, 0.18); color: var(--text-dim); }
.pill--draft::before { background: var(--text-dim); }
.pill--sent { background: rgba(91, 181, 255, 0.16); color: var(--info); }
.pill--sent::before { background: var(--info); }
.pill--accepted, .pill--paid { background: rgba(74, 222, 128, 0.16); color: var(--success); }
.pill--accepted::before, .pill--paid::before { background: var(--success); }
.pill--declined, .pill--overdue { background: rgba(255, 77, 94, 0.16); color: var(--danger); }
.pill--declined::before, .pill--overdue::before { background: var(--danger); }
.pill--pending { background: rgba(255, 176, 32, 0.16); color: var(--warning); }
.pill--pending::before { background: var(--warning); }

/* ═══ Pipeline kanban ═══ */
.kanban {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.kanban__col {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  min-height: 400px;
}
.kanban__col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.kanban__col-title {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}
.kanban__col-count {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--surface);
  padding: 1px 7px;
  border-radius: 999px;
  color: var(--text-dim);
}
.kanban__col-total {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 10px;
}
.kanban__col--prospects { border-top: 2px solid var(--text-mute); }
.kanban__col--qualified { border-top: 2px solid var(--info); }
.kanban__col--proposal { border-top: 2px solid var(--warning); }
.kanban__col--won { border-top: 2px solid var(--accent); }

.deal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
  cursor: grab;
  transition: all 0.15s;
}
.deal:hover { background: var(--surface-hi); border-color: var(--border-strong); transform: translateY(-1px); }
.deal__client { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.deal__title { font-size: 12px; color: var(--text-dim); margin-bottom: 8px; }
.deal__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.deal__value {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}
.deal__date {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-mute);
}
.deal__tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  padding: 2px 6px;
  background: var(--bg);
  border-radius: 3px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

/* ═══ Tasks ═══ */
.tasks {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.task {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.task:last-child { border-bottom: 0; }
.task:hover { background: var(--surface); }
.task__check {
  width: 18px; height: 18px;
  border: 1.5px solid var(--border-strong);
  border-radius: 5px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: all 0.15s;
}
.task__check:hover { border-color: var(--accent); }
.task.is-done .task__check {
  background: var(--accent);
  border-color: var(--accent);
}
.task.is-done .task__check::after {
  content: "";
  position: absolute;
  left: 4px; top: 1px;
  width: 5px; height: 9px;
  border-right: 2px solid var(--bg);
  border-bottom: 2px solid var(--bg);
  transform: rotate(45deg);
}
.task__body { min-width: 0; }
.task__title { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.task.is-done .task__title { color: var(--text-mute); text-decoration: line-through; }
.task__meta {
  font-size: 11px;
  color: var(--text-mute);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.priority {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.06em;
}
.priority--high { background: rgba(255, 77, 94, 0.16); color: var(--danger); }
.priority--med { background: rgba(255, 176, 32, 0.16); color: var(--warning); }
.priority--low { background: var(--surface); color: var(--text-dim); }

.task__date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
}
.task__date.is-overdue { color: var(--danger); }

/* ═══ Calendar ═══ */
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.cal-month {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}
.cal-nav { display: flex; gap: 6px; }
.cal-nav button {
  width: 32px; height: 32px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  display: grid; place-items: center;
  transition: all 0.15s;
}
.cal-nav button:hover { background: var(--surface-hi); color: var(--text); }

.cal {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.cal__weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.cal__weekday {
  padding: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-mute);
  text-align: center;
}
.cal__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: minmax(96px, 1fr);
}
.cal__day {
  padding: 8px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
  cursor: pointer;
  transition: background 0.12s;
}
.cal__day:hover { background: var(--surface); }
.cal__day--out { color: var(--text-mute); background: rgba(0,0,0,0.2); }
.cal__day--today { background: var(--accent-soft); }
.cal__day--today .cal__day-num { color: var(--accent); font-weight: 700; }
.cal__day-num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 4px;
}
.cal__event {
  display: block;
  font-size: 10.5px;
  padding: 2px 6px;
  margin-bottom: 2px;
  border-radius: 3px;
  background: var(--surface);
  border-left: 2px solid var(--accent);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-mono);
}
.cal__event--meeting { border-left-color: var(--info); }
.cal__event--deadline { border-left-color: var(--danger); }
.cal__event--task { border-left-color: var(--warning); }

/* ═══ Settings ═══ */
.settings {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
}
.settings__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.settings__nav-item {
  text-align: left;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-dim);
}
.settings__nav-item.is-active { background: var(--surface); color: var(--accent); }

.settings__group {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}
.settings__group h3 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}
.settings__group-sub {
  font-size: 12px;
  color: var(--text-mute);
  font-family: var(--font-mono);
  margin-bottom: 18px;
}
.field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.field:last-child { border-bottom: 0; }
.field__label { font-size: 13px; font-weight: 500; }
.field__sub { font-size: 11px; color: var(--text-mute); margin-top: 2px; }
.field input[type="text"] {
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 240px;
  font-size: 13px;
}

.toggle {
  position: relative;
  width: 36px; height: 20px;
  background: var(--surface-hi);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s;
}
.toggle::after {
  content: "";
  position: absolute;
  left: 2px; top: 2px;
  width: 16px; height: 16px;
  background: var(--text-dim);
  border-radius: 50%;
  transition: transform 0.18s;
}
.toggle.is-on { background: var(--accent); }
.toggle.is-on::after { transform: translateX(16px); background: var(--bg); }

/* ═══ Toasts ═══ */
.toast-stack {
  position: fixed;
  bottom: 20px; right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
}
.toast {
  background: var(--surface-hi);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  min-width: 260px;
  animation: toastIn 0.22s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ═══ Client drawer (detail) ═══ */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.drawer-backdrop.is-open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed;
  top: 0; right: 0;
  height: 100vh;
  width: min(520px, 100vw);
  background: var(--bg-elev);
  border-left: 1px solid var(--border);
  z-index: 101;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(.2,.7,.2,1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.drawer.is-open { transform: translateX(0); }
.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.drawer__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}
.drawer__close {
  width: 30px; height: 30px;
  border-radius: 50%;
  color: var(--text-dim);
  display: grid; place-items: center;
  font-size: 16px;
}
.drawer__close:hover { background: var(--surface); color: var(--text); }
.drawer__body { padding: 22px 24px; overflow-y: auto; flex: 1; }
.drawer__section { margin-bottom: 22px; }
.drawer__section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-mute);
  margin-bottom: 8px;
}
.client-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.client-stat {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.client-stat__label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-mute);
}
.client-stat__value {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin-top: 4px;
}

/* ═══ Responsive ═══ */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: repeat(2, 1fr); }
  .settings { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    transform: translateX(-100%);
    z-index: 50;
    width: 240px;
    transition: transform 0.25s;
  }
  .sidebar.is-open { transform: translateX(0); }
  .topbar__search { display: none; }
  .view { padding: 16px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kanban { grid-template-columns: 1fr; }
  .cal__grid { grid-auto-rows: minmax(60px, 1fr); }
}

/* ═══ Scrollbars ═══ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #333; }
