/* ============================================================
   hiyalhu sales console — "atelier" theme
   dark plum glass · old gold · Space Grotesk numerals
   ============================================================ */
@font-face {
  font-family: 'Space Grotesk';
  src: url('fonts/space-grotesk.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0f0b15;
  --panel: rgba(255, 255, 255, 0.028);
  --panel-solid: #1a1522;
  --panel-raised: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.075);
  --border-strong: rgba(255, 255, 255, 0.13);
  --text: #ece7f5;
  --muted: #a49bb8;
  --faint: #736a8c;
  --gold: #c9a962;
  --gold-bright: #e8cd8c;
  --gold-deep: #9a7c3f;
  --gold-dim: rgba(201, 169, 98, 0.12);
  --green: #64c98d;
  --green-dim: rgba(100, 201, 141, 0.12);
  --red: #e5737f;
  --red-dim: rgba(229, 115, 127, 0.12);
  --blue: #7aa5e8;
  --blue-dim: rgba(122, 165, 232, 0.12);
  --purple: #b48de0;
  --purple-dim: rgba(180, 141, 224, 0.12);
  --orange: #e0a06a;
  --orange-dim: rgba(224, 160, 106, 0.12);
  --radius: 14px;
  --radius-sm: 9px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1100px 480px at 12% -8%, rgba(201, 169, 98, 0.055), transparent 60%),
    radial-gradient(900px 620px at 108% 112%, rgba(122, 84, 178, 0.10), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
/* fine grain over everything — kills the flat "AI gradient" look */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
#app, .login-screen { position: relative; z-index: 1; }

.hidden { display: none !important; }
a { color: var(--gold-bright); text-decoration: none; }
::selection { background: rgba(201, 169, 98, 0.35); }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 6px;
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(201, 169, 98, 0.4); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- entrance motion ---------------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes pop {
  from { opacity: 0; transform: scale(0.965) translateY(6px); }
  to { opacity: 1; transform: none; }
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
.kpi, .card { animation: rise 0.45s var(--ease-out) both; }
.card { animation-delay: 50ms; }
.kpi:nth-child(2) { animation-delay: 40ms; } .kpi:nth-child(3) { animation-delay: 80ms; }
.kpi:nth-child(4) { animation-delay: 120ms; } .kpi:nth-child(5) { animation-delay: 160ms; }
.kpi:nth-child(6) { animation-delay: 200ms; } .kpi:nth-child(7) { animation-delay: 240ms; }
.kpi:nth-child(8) { animation-delay: 280ms; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------- login ---------------- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 384px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 38px 34px 26px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: pop 0.4s var(--ease-out) both;
}
.login-brand { text-align: center; margin-bottom: 30px; }
.login-star {
  color: var(--gold);
  display: inline-block;
  animation: star-pulse 5s ease-in-out infinite;
}
@keyframes star-pulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(201, 169, 98, 0)); }
  50% { transform: scale(1.08); filter: drop-shadow(0 0 14px rgba(201, 169, 98, 0.45)); }
}
.login-brand h1 {
  margin: 10px 0 4px;
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.login-brand h1 em {
  font-style: normal;
  font-weight: 400;
  background: linear-gradient(120deg, var(--gold-bright), var(--gold), var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.login-brand p { margin: 0; color: var(--faint); font-size: 12.5px; letter-spacing: 0.04em; }
.login-error {
  color: var(--red);
  background: var(--red-dim);
  border: 1px solid rgba(229, 115, 127, 0.3);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}
.login-error.show { display: block; }
.login-foot {
  margin-top: 22px;
  text-align: center;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faint);
  opacity: 0.65;
}

/* ---------------- fields & buttons ---------------- */
.field { display: block; margin-bottom: 14px; }
.field > span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--faint);
  margin-bottom: 6px;
}
input[type="text"], input[type="password"], input[type="number"], input[type="date"],
input[type="month"], input[type="email"], input[type="tel"], input[type="search"],
select, textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  background: rgba(0, 0, 0, 0.36);
  box-shadow: 0 0 0 3px rgba(201, 169, 98, 0.13);
}
input[type="date"], input[type="month"] { color-scheme: dark; }
select { cursor: pointer; }
textarea { resize: vertical; min-height: 64px; }
input[type="checkbox"] { accent-color: var(--gold); width: 16px; height: 16px; cursor: pointer; }
.check-row { display: flex; align-items: center; gap: 8px; margin: 10px 0; color: var(--muted); font-size: 13px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--panel-raised);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.1s;
  white-space: nowrap;
}
.btn:hover { border-color: rgba(201, 169, 98, 0.55); color: var(--gold-bright); }
.btn:active { transform: scale(0.975); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, #ddbd77, #b89752);
  color: #211806;
  border-color: #a4843f;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(201, 169, 98, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-primary:hover { background: linear-gradient(180deg, #e8ca85, #c6a45c); color: #211806; }
.btn-primary:active { transform: scale(0.975); }
.btn-danger:hover { border-color: var(--red); color: var(--red); background: var(--red-dim); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); border-color: var(--border); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; }

/* ---------------- layout ---------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 226px;
  flex-shrink: 0;
  background: rgba(16, 12, 22, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
}
.brand-star { color: var(--gold); display: inline-flex; }
.brand-text strong {
  display: block;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.brand-text small {
  color: var(--faint);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.nav { flex: 1; padding: 10px 12px; overflow-y: auto; }
.nav-group { margin-bottom: 6px; }
.nav-label {
  display: block;
  padding: 10px 12px 4px;
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--faint);
  opacity: 0.7;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 1px;
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  position: relative;
  transition: color 0.13s, background 0.13s;
}
.nav a .ic {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.75;
  transition: opacity 0.13s, transform 0.13s;
}
.nav a .ic svg { width: 17px; height: 17px; }
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.045); }
.nav a:hover .ic { opacity: 1; transform: translateY(-1px); }
.nav a.active { color: var(--gold-bright); background: var(--gold-dim); }
.nav a.active .ic { opacity: 1; }
.nav a.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 20%;
  height: 60%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold-deep));
}
.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  border-radius: 99px;
  font-size: 10.5px;
  padding: 1px 7px;
  font-weight: 600;
}
.sidebar-foot { padding: 14px; border-top: 1px solid var(--border); }
.whoami { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.whoami b { color: var(--text); font-family: var(--font-display); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 11, 21, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.topbar-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 15px;
  cursor: pointer;
}
.content { padding: 24px 28px 70px; max-width: 1500px; width: 100%; }

/* ---------------- cards & grids ---------------- */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.038), rgba(255, 255, 255, 0.02));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--border-strong); }
.card h3 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.card h3 .right { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 12px; color: var(--faint); }

.grid { display: grid; gap: 14px; }
.kpi-grid { grid-template-columns: repeat(auto-fit, minmax(195px, 1fr)); margin-bottom: 18px; }
.two-col { grid-template-columns: 1fr 1fr; }
.three-col { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1100px) { .two-col, .three-col { grid-template-columns: 1fr; } }

.kpi {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.038), rgba(255, 255, 255, 0.02));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 17px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
  transition: border-color 0.18s, transform 0.18s;
}
.kpi:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.kpi .k-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-weight: 600;
  color: var(--faint);
}
.kpi .k-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  margin: 4px 0 3px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.kpi .k-sub { font-size: 12px; color: var(--faint); }
.kpi .k-delta { font-size: 12px; font-weight: 600; font-family: var(--font-display); }
.k-delta.up { color: var(--green); }
.k-delta.down { color: var(--red); }
.k-delta.flat { color: var(--faint); font-weight: 400; }
.kpi.kpi-gold { border-color: rgba(201, 169, 98, 0.4); }
.kpi.kpi-gold::after {
  content: '';
  position: absolute;
}
.kpi { position: relative; }
.kpi.kpi-gold .k-value {
  background: linear-gradient(120deg, #f0d99c, var(--gold) 55%, #a8894a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.kpi.kpi-gold { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 0 34px rgba(201, 169, 98, 0.07); }

/* ---------------- tables ---------------- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.16);
}
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left;
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--faint);
  background: rgba(255, 255, 255, 0.035);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  backdrop-filter: blur(8px);
}
.tbl td { padding: 9px 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); vertical-align: middle; }
.tbl tbody tr { transition: background 0.12s; }
.tbl tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.tbl tbody tr:hover td:first-child { box-shadow: inset 2px 0 0 var(--gold); }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-display); }
.tbl tfoot td { background: rgba(255, 255, 255, 0.035); font-weight: 600; border-top: 1px solid var(--border-strong); }
.empty-state {
  text-align: center;
  color: var(--faint);
  padding: 44px 16px;
  font-size: 13px;
}
.empty-state .big { font-size: 30px; margin-bottom: 10px; display: inline-flex; }
.empty-state .big svg { width: 34px; height: 34px; opacity: 0.55; }
.empty-state a, .empty-state .btn { margin-top: 6px; display: inline-block; }

/* badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px 2px 8px;
  border-radius: 99px;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 99px;
  background: currentColor;
  opacity: 0.9;
}
.badge.gold { background: var(--gold-dim); color: var(--gold-bright); }
.badge.green { background: var(--green-dim); color: var(--green); }
.badge.red { background: var(--red-dim); color: var(--red); }
.badge.blue { background: var(--blue-dim); color: var(--blue); }
.badge.purple { background: var(--purple-dim); color: var(--purple); }
.badge.orange { background: var(--orange-dim); color: var(--orange); }
.badge.grey { background: rgba(164, 155, 184, 0.12); color: var(--muted); }

/* filters row */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  align-items: center;
}
.filters input, .filters select { width: auto; min-width: 130px; }
.filters input[type="search"] { min-width: 210px; }
.filters .spacer { flex: 1; }

/* ---------------- modal ---------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 5, 12, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 16px 16px;
  z-index: 100;
  overflow-y: auto;
  animation: rise 0.18s var(--ease-out) both;
}
.modal {
  width: 100%;
  max-width: 540px;
  background: linear-gradient(180deg, rgba(38, 32, 52, 0.96), rgba(28, 23, 39, 0.96));
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  padding: 22px 24px;
  animation: pop 0.2s var(--ease-out) both;
}
.modal.modal-lg { max-width: 760px; }
.modal h3 { margin: 0 0 18px; font-family: var(--font-display); font-size: 17px; font-weight: 600; }
.modal .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.modal .form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .modal .form-grid { grid-template-columns: 1fr; } }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.form-total {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--gold-bright);
  background: var(--gold-dim);
  border: 1px solid rgba(201, 169, 98, 0.2);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-top: 4px;
}

/* ---------------- kanban ---------------- */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.kanban-col {
  --rail: var(--faint);
  min-width: 252px;
  width: 252px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.022);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  transition: border-color 0.15s, background 0.15s;
}
.kanban-col.drag-over { border-color: var(--gold); background: var(--gold-dim); }
.kanban-col h4 {
  margin: 2px 4px 10px;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
}
.kanban-col h4::before {
  content: '';
  width: 7px; height: 7px; border-radius: 99px;
  background: var(--rail);
  box-shadow: 0 0 8px color-mix(in srgb, var(--rail) 55%, transparent);
}
.kanban-col h4 .sum { color: var(--faint); font-weight: 400; margin-left: auto; letter-spacing: 0; }
.kanban-col[data-stage="lead"] { --rail: #8a80a0; }
.kanban-col[data-stage="qualified"] { --rail: #7aa5e8; }
.kanban-col[data-stage="proposal"] { --rail: #b48de0; }
.kanban-col[data-stage="negotiation"] { --rail: #e0a06a; }
.kanban-col[data-stage="won"] { --rail: #64c98d; }
.kanban-col[data-stage="lost"] { --rail: #e5737f; }
.deal-card[data-stage="lead"] { --rail: #8a80a0; }
.deal-card[data-stage="qualified"] { --rail: #7aa5e8; }
.deal-card[data-stage="proposal"] { --rail: #b48de0; }
.deal-card[data-stage="negotiation"] { --rail: #e0a06a; }
.deal-card[data-stage="won"] { --rail: #64c98d; }
.deal-card[data-stage="lost"] { --rail: #e5737f; }
.deal-card {
  --rail: var(--faint);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.022));
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 11px 13px;
  margin-bottom: 8px;
  cursor: grab;
  position: relative;
  overflow: hidden;
  transition: border-color 0.13s, transform 0.13s;
  animation: rise 0.3s var(--ease-out) both;
}
.deal-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--rail), transparent 70%);
  opacity: 0.85;
}
.deal-card:hover { border-color: rgba(201, 169, 98, 0.5); transform: translateY(-1px); }
.deal-card.dragging { opacity: 0.45; transform: rotate(1.5deg); }
.deal-card .d-title { font-family: var(--font-display); font-weight: 600; font-size: 13px; margin-bottom: 5px; }
.deal-card .d-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.deal-card .d-client { font-size: 12px; color: var(--faint); margin-top: 3px; }
.deal-card .d-value { color: var(--gold-bright); font-weight: 600; font-family: var(--font-display); }

/* ---------------- misc ---------------- */
.progress {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}
.progress > div {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #a8894a, #e0c47e);
  box-shadow: 0 0 10px rgba(201, 169, 98, 0.25);
  transition: width 0.5s var(--ease-out);
}
.progress.green > div { background: linear-gradient(90deg, #3f9e6c, #7ddba2); box-shadow: 0 0 10px rgba(100, 201, 141, 0.25); }
.goal-row { margin-bottom: 14px; }
.goal-row .goal-top { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 13px; font-family: var(--font-display); }

.stat-row { display: flex; gap: 28px; flex-wrap: wrap; }
.stat-row .stat .s-label {
  font-size: 10.5px;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
}
.stat-row .stat .s-value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  transition: background 0.12s;
}
.task-item:hover { background: rgba(255, 255, 255, 0.025); }
.task-item:last-child { border-bottom: 0; }
.task-item.done .t-title { text-decoration: line-through; color: var(--faint); }
.task-item .t-title { font-size: 13.5px; }
.task-item .t-due { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.task-item .t-due.overdue { color: var(--red); font-weight: 600; }
.task-item .t-actions { margin-left: auto; display: flex; gap: 4px; }

.activity-item {
  display: flex;
  gap: 12px;
  padding: 9px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 13px;
}
.activity-item:last-child { border-bottom: 0; }
.activity-item .a-time { color: var(--faint); font-size: 12px; white-space: nowrap; min-width: 110px; font-variant-numeric: tabular-nums; }
.a-action { font-family: var(--font-display); font-weight: 600; }
.a-action.created { color: var(--green); }
.a-action.updated { color: var(--blue); }
.a-action.deleted { color: var(--red); }
.a-action.login, .a-action.logout { color: var(--purple); }
.a-action.imported { color: var(--orange); }

.chart-box { position: relative; height: 260px; }
.chart-box.tall { height: 320px; }

.toast-root { position: fixed; bottom: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(38, 32, 52, 0.92);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--gold);
  border-radius: 11px;
  padding: 10px 16px;
  font-size: 13.5px;
  font-family: var(--font-display);
  box-shadow: var(--shadow);
  animation: toast-in 0.22s var(--ease-out) both;
  max-width: 400px;
}
.toast svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--gold); }
.toast.error { border-left-color: var(--red); }
.toast.error svg { color: var(--red); }
.toast.success { border-left-color: var(--green); }
.toast.success svg { color: var(--green); }

.client-detail {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 8px 0 16px;
  animation: rise 0.25s var(--ease-out) both;
}
.client-detail h3 { margin: 14px 0 8px; }

.quick-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }

.link-btn {
  background: none;
  border: none;
  color: var(--gold-bright);
  cursor: pointer;
  font-size: 12.5px;
  padding: 3px 5px;
  font-family: var(--font);
  border-radius: 5px;
  transition: background 0.12s;
}
.link-btn:hover { background: var(--gold-dim); text-decoration: underline; }

.import-sample {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11.5px;
  color: var(--faint);
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  overflow-x: auto;
  white-space: nowrap;
}

/* ---------------- responsive ---------------- */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: -240px;
    transition: left 0.22s var(--ease-out);
    box-shadow: var(--shadow);
    background: rgba(14, 10, 20, 0.97);
  }
  .sidebar.open { left: 0; }
  .menu-toggle { display: inline-flex; }
  .content { padding: 16px 14px 60px; }
  .topbar { padding: 12px 14px; }
  .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .stat-row { gap: 18px; }
}
