/* ============================================================
   CADENCE ANCHOR — design system v3
   Elevated: editorial serif display, warm ink palette, frosted
   glass, full dark mode, deliberate motion. Sibling to
   family.cadenceplan.com — one Cadence family, pro-tool tier.
   ============================================================ */

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

:root {
  /* Type */
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --mono:  'JetBrains Mono', 'SF Mono', ui-monospace, Monaco, monospace;

  /* Radii */
  --r-sm: 6px;
  --r:    9px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  /* Transitions */
  --t-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
  --t:      200ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* ---------- LIGHT THEME (default) ---------- */
:root, [data-theme="light"] {
  --bg:         #fafaf9;
  --bg2:        #f4f4f2;
  --bg3:        #ebebe8;
  --card:       #ffffff;
  --border:     #e8e6e3;
  --border2:    #d8d5d1;
  --border3:    #b4afa9;

  --text:       #1c1917;
  --text2:      #46413c;
  --text3:      #7a736b;
  --text4:      #a8a29a;

  --accent:        #0d7d68;
  --accent-dark:   #075248;
  --accent-soft:   #d6f3ec;
  --accent-softer: #ecfbf6;
  --accent-ring:   rgba(13,125,104,0.16);

  --red:    #c0392b; --red-soft:    #fdecea;
  --amber:  #b45309; --amber-soft:  #fef3c7;
  --blue:   #2563eb; --blue-soft:   #e3edfe;
  --green:  #047857; --green-soft:  #d8f3e6;
  --slate:  #51606f; --slate-soft:  #eef1f4;
  --purple: #7c3aed; --purple-soft: #efe9fd;

  --shadow-sm: 0 1px 2px rgba(28,25,23,0.05);
  --shadow:    0 1px 3px rgba(28,25,23,0.07), 0 1px 2px rgba(28,25,23,0.04);
  --shadow-md: 0 4px 12px rgba(28,25,23,0.07), 0 2px 4px rgba(28,25,23,0.04);
  --shadow-lg: 0 12px 32px rgba(28,25,23,0.12), 0 4px 8px rgba(28,25,23,0.05);

  --glass:        rgba(255,255,255,0.72);
  --glass-border: rgba(232,230,227,0.9);
  --overlay:      rgba(28,25,23,0.32);
}

/* ---------- DARK THEME ---------- */
[data-theme="dark"] {
  --bg:         #0c0a09;
  --bg2:        #211e1c;
  --bg3:        #2c2825;
  --card:       #1a1714;
  --border:     #2a2522;
  --border2:    #3b3531;
  --border3:    #57514b;

  --text:       #f5f4f2;
  --text2:      #cbc5bd;
  --text3:      #8f877d;
  --text4:      #6b645b;

  --accent:        #2dd4bf;
  --accent-dark:   #14b8a6;
  --accent-soft:   rgba(45,212,191,0.16);
  --accent-softer: rgba(45,212,191,0.08);
  --accent-ring:   rgba(45,212,191,0.22);

  --red:    #f87171; --red-soft:    rgba(248,113,113,0.16);
  --amber:  #fbbf24; --amber-soft:  rgba(251,191,36,0.16);
  --blue:   #60a5fa; --blue-soft:   rgba(96,165,250,0.16);
  --green:  #34d399; --green-soft:  rgba(52,211,153,0.16);
  --slate:  #94a3b8; --slate-soft:  rgba(148,163,184,0.16);
  --purple: #a78bfa; --purple-soft: rgba(167,139,250,0.16);

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow:    0 1px 3px rgba(0,0,0,0.5), 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.5);
  --shadow-lg: 0 16px 40px rgba(0,0,0,0.6);

  --glass:        rgba(26,23,20,0.7);
  --glass-border: rgba(58,53,49,0.7);
  --overlay:      rgba(0,0,0,0.6);
}

html { color-scheme: light dark; }

body {
  font-family: var(--sans);
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--t), color var(--t);
}

a { color: var(--accent-dark); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--accent); text-decoration: underline; }

::selection { background: var(--accent-soft); color: var(--accent-dark); }

/* ===================== SIDEBAR ===================== */
.sidebar {
  width: 244px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  backdrop-filter: blur(16px) saturate(180%);
  border-right: 1px solid var(--glass-border);
  padding: 22px 14px 16px;
  flex-shrink: 0;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 2px 6px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.brand-mark {
  width: 34px; height: 34px; border-radius: var(--r);
  background: linear-gradient(140deg, var(--accent) 0%, var(--accent-dark) 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 2px 8px var(--accent-ring);
  flex-shrink: 0;
}
.brand-mark svg { width: 18px; height: 18px; stroke: #fff; stroke-width: 2; fill: none; }
.brand-name {
  font-family: var(--serif);
  font-weight: 400; font-size: 23px; line-height: 1;
  letter-spacing: 0.01em;
  color: var(--text);
}
.brand-sub {
  font-size: 9.5px; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.16em; font-weight: 600;
  margin-top: 3px;
}
.nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  font-size: 9.5px; font-weight: 700; color: var(--text4);
  text-transform: uppercase; letter-spacing: 0.13em;
  padding: 12px 10px 4px;
}
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--text2); text-decoration: none; font-size: 13.5px;
  font-weight: 500;
  transition: background var(--t-fast), color var(--t-fast);
}
.nav a:hover { background: var(--bg2); color: var(--text); text-decoration: none; }
.nav a.active {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 600;
}
.nav svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

.sidebar-foot {
  border-top: 1px solid var(--border);
  padding-top: 12px; margin-top: 8px;
  font-size: 11.5px; color: var(--text3);
  display: flex; flex-direction: column; gap: 9px;
}
.sidebar-foot .who { display: flex; align-items: center; gap: 8px; }
.sidebar-foot .avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(140deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  text-transform: uppercase; flex-shrink: 0;
}
.sidebar-foot strong { color: var(--text2); font-weight: 600; }
.sidebar-foot form { display: inline; }
.foot-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.foot-btn {
  background: none; border: none; color: var(--text3); font-size: 11.5px;
  cursor: pointer; padding: 0; font-family: inherit; text-align: left;
  transition: color var(--t-fast);
  display: inline-flex; align-items: center; gap: 5px;
}
.foot-btn:hover { color: var(--text); }
.foot-btn.danger:hover { color: var(--red); }
.foot-btn svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; }
.theme-toggle {
  background: var(--bg2); border: 1px solid var(--border);
  width: 30px; height: 30px; border-radius: var(--r-sm);
  cursor: pointer; color: var(--text2);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.theme-toggle:hover { color: var(--text); border-color: var(--border2); }
.theme-toggle svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }
[data-theme="dark"]  .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun  { display: none; }
kbd {
  background: var(--bg2);
  padding: 1.5px 5px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 10px;
  border: 1px solid var(--border);
  color: var(--text2);
}

/* ===================== MAIN ===================== */
.main { flex: 1; padding: 30px 40px; min-width: 0; animation: page-in 0.4s ease-out; }
@keyframes page-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  margin-bottom: 26px;
}
.page-header h1 {
  font-family: var(--serif);
  font-size: 31px; font-weight: 400; line-height: 1.05;
  letter-spacing: 0.005em;
  color: var(--text);
}
.page-header .sub {
  color: var(--text3); font-size: 13px;
  margin-top: 5px; font-weight: 400;
}

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7.5px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--border2);
  background: var(--card); color: var(--text);
  font-size: 13px; font-weight: 500; font-family: inherit;
  cursor: pointer; text-decoration: none;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--bg2); border-color: var(--border3); text-decoration: none; }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 8px var(--accent-ring);
}
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
[data-theme="dark"] .btn-primary { color: #06201c; }
[data-theme="dark"] .btn-primary:hover { color: #06201c; }
.btn-danger { color: var(--red); border-color: var(--border2); }
.btn-danger:hover { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.btn-sm { padding: 4.5px 10px; font-size: 12px; }
.btn-lg { padding: 9.5px 19px; font-size: 14px; }

/* ===================== CARDS ===================== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 19px 21px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t), border-color var(--t);
}
.card:hover { box-shadow: var(--shadow); }
.card h3 {
  font-size: 11px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.09em;
  margin-bottom: 13px;
}

.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ===================== KPI TILES ===================== */
.kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.kpi-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 15px 16px 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t), border-color var(--t), transform var(--t);
  position: relative;
  overflow: hidden;
}
.kpi-tile:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border2);
  transform: translateY(-2px);
}
.kpi-tile::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--stage-color, var(--accent));
}
.kpi-tile .label {
  font-size: 10px; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 700;
  display: flex; align-items: center; gap: 5px;
}
.kpi-tile .value {
  font-family: var(--serif);
  font-size: 36px; font-weight: 400; line-height: 1;
  letter-spacing: 0.01em;
  color: var(--text); margin-top: 8px;
}
.kpi-tile .dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%;
}

/* ===================== PIPELINE KANBAN ===================== */
.kanban {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px; align-items: start;
}
.kanban-col {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 11px;
  min-height: 260px;
  min-width: 0;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.kanban-col.drag-over, .kanban-drop.drag-over {
  background: var(--accent-softer);
  border-color: var(--accent);
}
.kanban-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 2px 4px 11px;
}
.kanban-head .name { font-size: 12px; font-weight: 700; letter-spacing: 0.01em; }
.kanban-head .count {
  background: var(--card); padding: 2px 8px; border-radius: 999px;
  font-size: 11px; color: var(--text3); border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.kanban-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 13px;
  margin-bottom: 7px;
  cursor: grab;
  text-decoration: none;
  color: inherit; display: block;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}
.kanban-card:hover {
  transform: translateY(-2px);
  border-color: var(--border2);
  box-shadow: var(--shadow-md);
}
.kanban-card.dragging { opacity: 0.4; cursor: grabbing; transform: scale(0.98); }
.kanban-card { overflow-wrap: break-word; }
.kanban-card .name { font-weight: 600; font-size: 13.5px; color: var(--text); }
.kanban-card .industry { font-size: 11px; color: var(--text3); margin-top: 2px; }
.kanban-card .next-step { font-size: 11.5px; color: var(--text2); margin-top: 8px; line-height: 1.45; }
.kanban-empty { font-size: 11.5px; color: var(--text4); text-align: center; padding: 14px 0; }

/* ===================== TABLE ===================== */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
th, td {
  padding: 12px 15px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
th {
  font-size: 10px; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.09em;
  font-weight: 700;
  background: var(--bg2);
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--t-fast); }
tbody tr:hover td { background: var(--bg2); }

/* ===================== FORMS ===================== */
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="tel"], input[type="date"],
input[type="file"], textarea, select {
  width: 100%;
  padding: 8.5px 12px;
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 13.5px;
  background: var(--card);
  color: var(--text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
input:hover, textarea:hover, select:hover { border-color: var(--border3); }
input::placeholder, textarea::placeholder { color: var(--text4); }
textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
label {
  display: block;
  font-size: 10.5px; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.06em;
  font-weight: 700;
  margin-bottom: 6px;
  margin-top: 15px;
}
label:first-child { margin-top: 0; }
.form-row { display: grid; gap: 14px; }
.form-row.two { grid-template-columns: 1fr 1fr; }

/* ===================== TABS ===================== */
.tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.tab-btn {
  padding: 10px 15px;
  background: none; border: none;
  cursor: pointer;
  font-family: inherit; font-size: 13px;
  color: var(--text3); font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: var(--accent-dark);
  border-color: var(--accent);
  font-weight: 600;
}
.tab-content { display: none; animation: fade-in 220ms ease-out; }
.tab-content.active { display: block; }
@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===================== PILLS / CHIPS ===================== */
.stage-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
}
.status-pill {
  display: inline-block;
  padding: 2.5px 9px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.status-todo        { background: var(--slate-soft);  color: var(--slate); }
.status-in_progress { background: var(--blue-soft);   color: var(--blue); }
.status-done        { background: var(--green-soft);  color: var(--green); }
.priority-high   { color: var(--red); font-weight: 600; }
.priority-normal { color: var(--text3); }

/* ===================== NOTES (WHITEBOARD) ===================== */
.note {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 17px 19px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t), border-color var(--t);
}
.note:hover { box-shadow: var(--shadow); }
.note.pinned { border-left: 3px solid var(--accent); }
.note-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 8px;
}
.note-title { font-weight: 600; font-size: 14px; }
.note-meta { font-size: 11px; color: var(--text3); }
.note-body {
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  color: var(--text2);
}

/* ===================== LOGIN ===================== */
.login-bg {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(900px 500px at 78% -8%, var(--accent-softer), transparent 60%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg2) 100%);
  padding: 24px;
}
.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 38px 40px;
  width: 410px; max-width: 100%;
  box-shadow: var(--shadow-lg);
  animation: page-in 0.45s ease-out;
}
.login-card .brand { padding-bottom: 20px; margin-bottom: 18px; }
.login-card h1 {
  font-family: var(--serif);
  font-size: 27px; font-weight: 400; margin-bottom: 5px;
  letter-spacing: 0.01em;
}
.login-card .sub { color: var(--text3); font-size: 13px; margin-bottom: 24px; }
.login-card .err {
  color: var(--red); font-size: 12.5px;
  margin-top: 12px;
  background: var(--red-soft);
  padding: 9px 12px;
  border-radius: var(--r-sm);
}
.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  padding: 10.5px 14px;
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
  margin-bottom: 6px;
}
.google-btn:hover { box-shadow: var(--shadow-md); border-color: var(--border3); transform: translateY(-1px); }
.login-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 20px 0 14px;
  color: var(--text4);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}
.login-divider::before, .login-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ===================== MISC ===================== */
.muted { color: var(--text3); }
.empty {
  text-align: center; padding: 56px 24px;
  background: var(--card);
  border: 1px dashed var(--border2);
  border-radius: var(--r-md);
}
.empty-icon {
  width: 48px; height: 48px; margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--bg2);
  display: flex; align-items: center; justify-content: center;
  color: var(--text3);
}
.empty-icon svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.75; }
.empty-title { font-size: 14.5px; font-weight: 600; color: var(--text2); }
.empty-sub { font-size: 12.5px; color: var(--text3); margin-top: 4px; }

/* Segmented filter control */
.filter-label {
  font-size: 10.5px; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.07em; font-weight: 700;
}
.segmented {
  display: inline-flex;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 3px;
  gap: 2px;
}
.segmented a {
  padding: 5px 13px;
  border-radius: 5px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text2);
  text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast);
}
.segmented a:hover { color: var(--text); text-decoration: none; }
.segmented a.active {
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.note-pin { width: 13px; height: 13px; stroke: var(--accent); fill: none; vertical-align: -1px; }

/* ===================== FILES ===================== */
.dropzone {
  border: 1.5px dashed var(--border2);
  border-radius: var(--r-md);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--bg2);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.dropzone:hover { border-color: var(--accent); }
.dropzone.dragover { border-color: var(--accent); background: var(--accent-softer); }
.dropzone.has-file { border-style: solid; border-color: var(--accent); background: var(--accent-softer); }
.dropzone-icon {
  width: 44px; height: 44px; margin: 0 auto 10px;
  border-radius: 50%; background: var(--card);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}
.dropzone-icon svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.9; }
.dropzone-text { font-size: 13.5px; color: var(--text2); }
.dropzone-link { color: var(--accent-dark); font-weight: 600; }
.dropzone-hint { font-size: 11.5px; color: var(--text3); margin-top: 4px; }

.file-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.file-row:hover { border-color: var(--border2); box-shadow: var(--shadow); }
.file-ico {
  width: 40px; height: 40px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.file-ico svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.9; }
.file-ico.tint-blue   { background: var(--blue-soft);   color: var(--blue); }
.file-ico.tint-green  { background: var(--green-soft);  color: var(--green); }
.file-ico.tint-red    { background: var(--red-soft);    color: var(--red); }
.file-ico.tint-amber  { background: var(--amber-soft);  color: var(--amber); }
.file-ico.tint-purple { background: var(--purple-soft); color: var(--purple); }
.file-ico.tint-slate  { background: var(--slate-soft);  color: var(--slate); }
.file-main { flex: 1; min-width: 0; }
.file-name {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-meta { font-size: 11.5px; color: var(--text3); margin-top: 2px; line-height: 1.5; }
.file-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.file-actions form { display: inline; }
.file-actions .btn { padding: 6px 8px; }
.file-actions .btn svg { width: 14px; height: 14px; }
hr.dashed { border: none; border-top: 1px dashed var(--border2); margin: 18px 0; }
.flex-row { display: flex; align-items: center; gap: 10px; }
.flex-row.between { justify-content: space-between; }
.gap-sm { gap: 6px; }
.gap-md { gap: 12px; }
.mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.text-sm { font-size: 12.5px; }
.text-xs { font-size: 11px; }
.bold { font-weight: 600; }
.right { text-align: right; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===================== COMMAND PALETTE ===================== */
.cmdk-item { transition: background var(--t-fast); }
.cmdk-item:hover { background: var(--bg2); }

/* ===================== TOAST NOTIFICATIONS ===================== */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  display: flex; flex-direction: column;
  gap: 9px;
  z-index: 1000;
  pointer-events: none;
}
.toast {
  background: var(--card);
  color: var(--text);
  padding: 12px 15px;
  border-radius: var(--r);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  pointer-events: auto;
  min-width: 280px;
  max-width: 440px;
  animation: toast-in 220ms cubic-bezier(0.2, 0.7, 0.3, 1);
}
.toast .toast-icon {
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 12px; font-weight: 700;
  color: #fff;
}
.toast.toast-success .toast-icon { background: var(--green); }
.toast.toast-error   .toast-icon { background: var(--red); }
.toast.toast-info    .toast-icon { background: var(--slate); }
.toast.toast-success { border-left: 3px solid var(--green); }
.toast.toast-error   { border-left: 3px solid var(--red); }
.toast.toast-info    { border-left: 3px solid var(--slate); }
.toast.fading-out { animation: toast-out 250ms cubic-bezier(0.4, 0, 0.2, 1) forwards; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(10px); }
}

/* ===================== TIMELINE (customer detail) ===================== */
.timeline-row {
  display: flex; gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.timeline-row:last-child { border-bottom: none; }
.timeline-marker {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--bg2);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.timeline-content { flex: 1; min-width: 0; }

/* ===================== PIPELINE FUNNEL (dashboard) ===================== */
.funnel { display: flex; flex-direction: column; gap: 4px; }
.funnel-row {
  display: grid;
  grid-template-columns: 168px 1fr 132px;
  align-items: center;
  gap: 16px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  transition: background var(--t);
}
.funnel-row:hover { background: var(--bg2); }
.funnel-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500; color: var(--text);
}
.funnel-label .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.funnel-bar-wrap { position: relative; height: 26px; display: flex; align-items: center; }
.funnel-bar {
  height: 22px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 9px;
  transition: width 500ms cubic-bezier(0.2, 0.7, 0.3, 1);
  box-shadow: inset 0 -1px 0 rgba(0,0,0,0.08);
}
.funnel-bar-count {
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}
.funnel-bar-count-outer {
  margin-left: 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text2);
}
.funnel-meta {
  text-align: right;
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
}
.funnel-arr {
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.funnel-threads {
  display: flex; gap: 7px;
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.funnel-threads span { letter-spacing: -0.02em; }

/* ===================== ANIMATIONS ===================== */
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.spin { animation: spin 800ms linear infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kanban { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .sidebar { width: 64px; padding: 18px 8px; }
  .sidebar .brand-name, .sidebar .brand-sub, .sidebar .brand > div:last-child,
  .nav a span, .nav-label, .sidebar-foot .who span, .foot-btn span { display: none; }
  .sidebar .brand { justify-content: center; }
  .nav a { justify-content: center; }
  .foot-actions { flex-direction: column; gap: 6px; }
  .main { padding: 22px 18px; }
  .kpis, .kanban, .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
