/* ═══════════════════════════════════════════════════════════════
   EOM-Ops Design System — Obsidian Dark + Yellow
   ═══════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  /* Core palette */
  --yellow:        #FACC14;
  --yellow-glow:   rgba(250,204,20,0.12);
  --yellow-border: rgba(250,204,20,0.22);
  --yellow-hover:  #fde047;

  /* Backgrounds — layered dark */
  --bg:            #0a0a0a;
  --surface:       #111111;
  --surface-2:     #161616;
  --surface-3:     #1c1c1c;
  --surface-4:     #222222;

  /* Borders */
  --border:        rgba(255,255,255,0.055);
  --border-2:      rgba(255,255,255,0.09);
  --border-3:      rgba(255,255,255,0.14);

  /* Text */
  --text:          #ebebeb;
  --text-2:        #999999;
  --text-3:        #555555;
  --text-4:        #333333;

  /* Semantic */
  --green:         #22c55e;
  --red:           #ef4444;
  --orange:        #f97316;

  /* Skeuomorphic surface shader */
  --shine:         rgba(255,255,255,0.05);
  --inset-dark:    rgba(0,0,0,0.4);
}

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

html { font-size: 14px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

/* ── Scrollbar ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-4); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ── Focus ─────────────────────────────────────────────────────── */
*:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Links ─────────────────────────────────────────────────────── */
a { color: var(--yellow); text-decoration: none; transition: opacity 0.12s; }
a:hover { opacity: 0.8; }

/* ══════════════════════════════════════════════════════════════════
   BUTTONS — Skeuomorphic with depth
   ══════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.12s ease;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
  letter-spacing: -0.01em;
  position: relative;
}
.btn:disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }
.btn:active:not(:disabled) { transform: scale(0.98); }

/* Primary — gold button with shine */
.btn-primary {
  background: linear-gradient(180deg, #fef08a 0%, var(--yellow) 45%, #ca8a04 100%);
  color: #1a0f00;
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.4) inset,
    0 -1px 0 rgba(0,0,0,0.2) inset,
    0 2px 8px rgba(250,204,20,0.25),
    0 1px 2px rgba(0,0,0,0.4);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #fef9c3 0%, #fde047 45%, #eab308 100%);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.5) inset,
    0 -1px 0 rgba(0,0,0,0.2) inset,
    0 4px 16px rgba(250,204,20,0.35),
    0 2px 4px rgba(0,0,0,0.3);
}

/* Ghost */
.btn-ghost {
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border-2);
  box-shadow: 0 1px 0 var(--shine) inset, 0 1px 3px rgba(0,0,0,0.3);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface-3);
  color: var(--text);
  border-color: var(--border-3);
}

/* Danger */
.btn-danger {
  background: rgba(239,68,68,0.08);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.2);
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(239,68,68,0.15);
  border-color: rgba(239,68,68,0.3);
}

/* Success */
.btn-success {
  background: rgba(34,197,94,0.08);
  color: #4ade80;
  border: 1px solid rgba(34,197,94,0.2);
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.btn-success:hover:not(:disabled) {
  background: rgba(34,197,94,0.15);
  border-color: rgba(34,197,94,0.3);
}

.btn-sm  { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-lg  { padding: 10px 22px; font-size: 14px; border-radius: 10px; }
.btn-xl  { padding: 13px 28px; font-size: 15px; border-radius: 12px; }
.btn-icon { width: 30px; height: 30px; padding: 0; flex-shrink: 0; }


/* ══════════════════════════════════════════════════════════════════
   CARDS — Skeuomorphic layered surface
   ══════════════════════════════════════════════════════════════════ */
.card {
  background: linear-gradient(160deg, var(--surface-2) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-top-color: var(--border-2);
  border-radius: 12px;
  padding: 20px;
  box-shadow:
    0 1px 0 var(--shine) inset,
    0 0 0 1px rgba(0,0,0,0.5),
    0 4px 16px rgba(0,0,0,0.25);
}

.card-sm { padding: 14px 16px; border-radius: 10px; }

.card-yellow {
  background: linear-gradient(160deg, rgba(250,204,20,0.08) 0%, rgba(250,204,20,0.03) 100%);
  border: 1px solid var(--yellow-border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.5), 0 4px 16px rgba(0,0,0,0.2);
}


/* ══════════════════════════════════════════════════════════════════
   STATUS BADGES
   ══════════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
  cursor: default;
}
.badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-new              { background: rgba(255,255,255,0.06); color: #aaaaaa; border: 1px solid rgba(255,255,255,0.1); }
.badge-new::before      { background: #aaaaaa; }
.badge-approved         { background: rgba(168,85,247,0.1);  color: #c084fc; border: 1px solid rgba(168,85,247,0.2); }
.badge-approved::before { background: #c084fc; }
.badge-meeting_done         { background: rgba(249,115,22,0.1);  color: #fb923c; border: 1px solid rgba(249,115,22,0.2); }
.badge-meeting_done::before { background: #fb923c; }
.badge-payment_asked         { background: rgba(250,204,20,0.1);  color: #fde047; border: 1px solid rgba(250,204,20,0.25); }
.badge-payment_asked::before { background: #fde047; }
.badge-invoice_submitted         { background: rgba(20,184,166,0.1); color: #2dd4bf; border: 1px solid rgba(20,184,166,0.2); }
.badge-invoice_submitted::before { background: #2dd4bf; }
.badge-pdf_sent         { background: rgba(99,102,241,0.1);  color: #a5b4fc; border: 1px solid rgba(99,102,241,0.2); }
.badge-pdf_sent::before { background: #a5b4fc; }
.badge-payment_done         { background: rgba(34,197,94,0.1);  color: #4ade80; border: 1px solid rgba(34,197,94,0.2); }
.badge-payment_done::before { background: #4ade80; }
.badge-completed         { background: rgba(250,204,20,0.12); color: var(--yellow); border: 1px solid var(--yellow-border); }
.badge-completed::before { background: var(--yellow); }


/* ══════════════════════════════════════════════════════════════════
   FORM ELEMENTS
   ══════════════════════════════════════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: 5px; }

.form-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.12s, box-shadow 0.12s;
  -webkit-appearance: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3) inset;
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-4); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--yellow-border);
  box-shadow: 0 0 0 3px rgba(250,204,20,0.08), 0 1px 2px rgba(0,0,0,0.3) inset;
}
.form-select option { background: var(--surface-2); color: var(--text); }
.form-textarea { resize: vertical; min-height: 80px; line-height: 1.6; }


/* ── Inline edit styles ─────────────────────────────────────────── */
.inline-input {
  width: 100%;
  background: var(--surface-3);
  border: 1.5px solid var(--yellow-border);
  border-radius: 5px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  padding: 4px 8px;
  outline: none;
  box-shadow: 0 0 0 3px rgba(250,204,20,0.07);
  min-width: 80px;
}
.inline-select {
  width: 100%;
  background: var(--surface-3);
  border: 1.5px solid var(--yellow-border);
  border-radius: 5px;
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  padding: 3px 6px;
  outline: none;
  box-shadow: 0 0 0 3px rgba(250,204,20,0.07);
  cursor: pointer;
  -webkit-appearance: none;
}
.inline-select option { background: var(--surface-2); }

td.editable-cell { cursor: text; }
td.editable-cell:hover:not(.is-editing)::after {
  content: '✎';
  font-size: 10px;
  color: var(--text-3);
  margin-left: 5px;
  opacity: 0.5;
}

/* ── Status dropdown popover ────────────────────────────────────── */
.status-popover {
  position: fixed;
  z-index: 9999;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  padding: 5px;
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.6),
    0 8px 32px rgba(0,0,0,0.5),
    0 2px 8px rgba(0,0,0,0.3);
  min-width: 180px;
  animation: popIn 0.1s ease;
}
@keyframes popIn { from { opacity: 0; transform: scale(0.96) translateY(-4px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.status-popover-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.08s;
  font-size: 12px;
  color: var(--text);
}
.status-popover-item:hover { background: var(--surface-3); }
.status-popover-item.current { background: var(--yellow-glow); }
.status-popover-sep {
  height: 1px;
  background: var(--border);
  margin: 3px 0;
}


/* ══════════════════════════════════════════════════════════════════
   TABLE — Notion-style
   ══════════════════════════════════════════════════════════════════ */
.table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.5), 0 4px 20px rgba(0,0,0,0.2);
  background: var(--surface);
}

table { width: 100%; border-collapse: collapse; font-size: 13px; }

thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-3);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}
thead th:first-child { border-radius: 12px 0 0 0; }
thead th:last-child  { border-radius: 0 12px 0 0; }

tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: background 0.08s;
  cursor: default;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.018); }
tbody tr.row-selected { background: rgba(250,204,20,0.04); }

tbody td {
  padding: 10px 14px;
  color: var(--text);
  vertical-align: middle;
  border-right: 1px solid rgba(255,255,255,0.02);
}
tbody td:last-child { border-right: none; }

/* Row actions column — shown on hover */
.row-actions {
  display: flex;
  gap: 5px;
  align-items: center;
  opacity: 0;
  transition: opacity 0.12s;
}
tbody tr:hover .row-actions { opacity: 1; }

/* ── Quick action chips (in table) ──────────────────────────────── */
.action-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.1s;
  white-space: nowrap;
}
.action-chip:hover { transform: translateY(-1px); }
.chip-approve { background: rgba(34,197,94,0.1); color: #4ade80; border-color: rgba(34,197,94,0.2); }
.chip-approve:hover { background: rgba(34,197,94,0.18); }
.chip-meeting { background: rgba(249,115,22,0.1); color: #fb923c; border-color: rgba(249,115,22,0.2); }
.chip-meeting:hover { background: rgba(249,115,22,0.18); }
.chip-payment { background: var(--yellow-glow); color: var(--yellow); border-color: var(--yellow-border); }
.chip-payment:hover { background: rgba(250,204,20,0.2); }
.chip-final { background: var(--yellow-glow); color: var(--yellow); border-color: var(--yellow-border); }
.chip-final:hover { background: rgba(250,204,20,0.2); }
.chip-pdf { background: rgba(99,102,241,0.1); color: #a5b4fc; border-color: rgba(99,102,241,0.2); }
.chip-pdf:hover { background: rgba(99,102,241,0.18); }


/* ══════════════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════════════ */
.sidebar {
  width: 216px;
  min-height: 100vh;
  background: linear-gradient(180deg, #0e0e0e 0%, #0a0a0a 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px 10px;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  box-shadow: 1px 0 0 rgba(255,255,255,0.03);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}
.sidebar-logo .logo-mark {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, #fde047 0%, var(--yellow) 60%, #ca8a04 100%);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 900; color: #1a0f00;
  box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset, 0 2px 6px rgba(250,204,20,0.3);
  flex-shrink: 0;
}
.sidebar-logo .logo-text {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}
.sidebar-logo .logo-sub {
  font-size: 10px;
  color: var(--text-3);
  margin-top: 1px;
  letter-spacing: 0.3px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-4);
  padding: 8px 10px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.1s;
  text-decoration: none;
  margin-bottom: 1px;
  position: relative;
}
.nav-item:hover { background: var(--surface-2); color: var(--text-2); }
.nav-item.active {
  background: var(--yellow-glow);
  color: var(--yellow);
  border: 1px solid rgba(250,204,20,0.12);
}
.nav-item svg { width: 15px; height: 15px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--surface-3);
  color: var(--text-3);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
  border: 1px solid var(--border);
}

/* ── Layout ─────────────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }
.main-content {
  margin-left: 216px;
  flex: 1;
  padding: 28px 32px;
  max-width: calc(100vw - 216px);
  min-width: 0;
}

/* ── Page header ─────────────────────────────────────────────────── */
.page-header { margin-bottom: 24px; }
.page-header h1 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
}
.page-header p { font-size: 13px; color: var(--text-3); margin-top: 3px; }


/* ══════════════════════════════════════════════════════════════════
   STAT CARDS
   ══════════════════════════════════════════════════════════════════ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: linear-gradient(160deg, var(--surface-2) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-top-color: var(--border-2);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 0 var(--shine) inset, 0 2px 8px rgba(0,0,0,0.2);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-2), transparent);
}
.stat-card .stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-3);
  margin-bottom: 8px;
}
.stat-card .stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.04em;
  line-height: 1;
}
.stat-card .stat-sub { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.stat-card.accent { border-color: rgba(250,204,20,0.15); }
.stat-card.accent .stat-value { color: var(--yellow); }
.stat-card.accent::before { background: linear-gradient(90deg, transparent, rgba(250,204,20,0.2), transparent); }


/* ══════════════════════════════════════════════════════════════════
   TAB BAR
   ══════════════════════════════════════════════════════════════════ */
.tab-bar {
  display: flex;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }

.tab {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  color: var(--text-3);
  transition: all 0.12s;
  user-select: none;
}
.tab:hover:not(.active) { color: var(--text-2); background: var(--surface-2); }
.tab.active {
  background: var(--surface-3);
  color: var(--text);
  box-shadow: 0 1px 0 var(--shine) inset, 0 1px 3px rgba(0,0,0,0.3);
  border: 1px solid var(--border-2);
}


/* ══════════════════════════════════════════════════════════════════
   FILTER BAR
   ══════════════════════════════════════════════════════════════════ */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}
.filter-bar .form-input,
.filter-bar .form-select {
  width: auto;
  padding: 7px 11px;
  font-size: 12px;
  text-align: center;
}
.filter-bar .search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.filter-bar .search-wrap svg {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--text-3); pointer-events: none;
}
.filter-bar .search-wrap .form-input {
  padding-left: 32px;
  width: 100%;
  text-align: left;  /* search has left-aligned text, icon sits left */
}


/* ══════════════════════════════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 11px 15px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  max-width: 300px;
  pointer-events: auto;
  animation: toastIn 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.5), 0 8px 24px rgba(0,0,0,0.4);
}
@keyframes toastIn { from { opacity:0; transform: translateY(6px) scale(0.98); } to { opacity:1; transform: translateY(0) scale(1); } }
.toast-success { background: #0f1f0f; border: 1px solid rgba(34,197,94,0.25); color: #4ade80; }
.toast-error   { background: #1f0f0f; border: 1px solid rgba(239,68,68,0.25);  color: #f87171; }
.toast-info    { background: #1a1600; border: 1px solid rgba(250,204,20,0.25); color: var(--yellow); }


/* ══════════════════════════════════════════════════════════════════
   COMMAND PALETTE
   ══════════════════════════════════════════════════════════════════ */
#cmd-overlay {
  position: fixed; inset: 0; z-index: 8888;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(12px) saturate(0.8);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14vh;
}
#cmd-overlay.open { display: flex; }

#cmd-box {
  width: 560px;
  max-width: calc(100vw - 32px);
  background: var(--surface-2);
  border: 1px solid var(--border-3);
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.7),
    0 32px 80px rgba(0,0,0,0.7),
    0 0 60px rgba(250,204,20,0.03);
}

#cmd-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
#cmd-input-wrap svg { color: var(--yellow); flex-shrink: 0; width: 17px; height: 17px; }
#cmd-input {
  flex: 1;
  background: transparent;
  border: none; outline: none;
  font-size: 15px; color: var(--text);
  font-family: inherit; letter-spacing: -0.01em;
}
#cmd-input::placeholder { color: var(--text-4); }

#cmd-results { max-height: 340px; overflow-y: auto; padding: 5px; }

.cmd-section-label {
  padding: 8px 10px 3px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--text-4);
}
.cmd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.08s;
}
.cmd-item:hover, .cmd-item.selected { background: var(--surface-3); }
.cmd-item.selected { border: 1px solid var(--border-2); }
.cmd-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0;
  background: var(--surface-3);
}
.cmd-label { font-size: 13px; font-weight: 500; color: var(--text); }
.cmd-sub { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.cmd-badge {
  margin-left: auto;
  font-size: 10px; padding: 2px 7px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--text-3);
  border: 1px solid var(--border);
  white-space: nowrap;
}
#cmd-footer {
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  display: flex; gap: 14px;
  font-size: 11px; color: var(--text-4);
}
.cmd-key { display: inline-flex; align-items: center; gap: 4px; }
.cmd-key kbd {
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 10px; font-family: inherit;
  color: var(--text-3);
}


/* ══════════════════════════════════════════════════════════════════
   TIMELINE
   ══════════════════════════════════════════════════════════════════ */
.timeline { display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 12px; position: relative; }
.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 13px; top: 28px;
  width: 2px; height: calc(100% - 4px);
  background: var(--border-2);
}
.timeline-item.done::before { background: rgba(250,204,20,0.25); }
.timeline-dot {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid var(--border-2);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 10px; font-weight: 700;
  z-index: 1; color: var(--text-3);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.timeline-item.done .timeline-dot {
  border-color: rgba(250,204,20,0.4);
  background: rgba(250,204,20,0.1);
  color: var(--yellow);
}
.timeline-item.active .timeline-dot {
  border-color: var(--yellow);
  background: var(--yellow);
  color: #1a0f00;
  box-shadow: 0 0 12px rgba(250,204,20,0.3);
}
.timeline-content { padding-bottom: 20px; flex: 1; }
.timeline-content h4 { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.timeline-content span { font-size: 11px; color: var(--text-3); }


/* ══════════════════════════════════════════════════════════════════
   SPINNER
   ══════════════════════════════════════════════════════════════════ */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--surface-3);
  border-top-color: var(--yellow);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ══════════════════════════════════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-3);
}
.empty-state .empty-icon { font-size: 36px; margin-bottom: 12px; opacity: 0.3; }
.empty-state h3 { font-size: 15px; font-weight: 600; color: var(--text-3); margin-bottom: 4px; }
.empty-state p { font-size: 13px; }


/* ══════════════════════════════════════════════════════════════════
   MODALS
   ══════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }

/* New lead modal — taller, scrollable */
#new-lead-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  z-index: 9000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
  overflow-y: auto;
}
#new-lead-modal-overlay.open { display: flex; }

.modal-box {
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-top-color: var(--border-3);
  border-radius: 16px;
  padding: 28px;
  width: 640px;
  max-width: 100%;
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.6),
    0 24px 60px rgba(0,0,0,0.5),
    0 1px 0 var(--shine) inset;
  position: relative;
}
.modal-box h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 20px; }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: 7px; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-3);
  transition: all 0.1s;
}
.modal-close:hover { background: var(--surface-4); color: var(--text); }

/* WA modal */
#wa-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
}
#wa-modal-overlay.open { display: flex; }
#wa-modal {
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 16px;
  padding: 28px;
  width: 420px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.6), 0 24px 60px rgba(0,0,0,0.5);
}
#wa-modal h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.02em; }
#wa-modal p { font-size: 13px; color: var(--text-2); margin-bottom: 18px; line-height: 1.6; }
#wa-modal .wa-actions { display: flex; gap: 8px; justify-content: flex-end; }


/* ══════════════════════════════════════════════════════════════════
   LINK TRACKER ITEMS
   ══════════════════════════════════════════════════════════════════ */
.link-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 6px;
  transition: border-color 0.1s;
}
.link-item:hover { border-color: var(--border-2); }
.link-item .link-icon {
  width: 28px; height: 28px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0;
}
.link-icon-schedule { background: rgba(168,85,247,0.1); }
.link-icon-payment  { background: var(--yellow-glow); }
.link-icon-pdf      { background: rgba(99,102,241,0.1); }
.link-icon-group    { background: rgba(34,197,94,0.1); }
.link-icon-custom   { background: var(--surface-3); }
.link-item .link-info { flex: 1; min-width: 0; }
.link-item .link-label { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-item .link-url   { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-clicks {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  white-space: nowrap;
  flex-shrink: 0;
}
.link-clicks.has-clicks { color: var(--yellow); }
.link-copy-btn {
  background: none; border: 1px solid var(--border); border-radius: 5px;
  padding: 4px 7px; cursor: pointer; color: var(--text-3);
  font-size: 11px; transition: all 0.1s; white-space: nowrap;
}
.link-copy-btn:hover { border-color: var(--border-2); color: var(--text); }


/* ══════════════════════════════════════════════════════════════════
   PUBLIC PAGES (Landing, Payment)
   ══════════════════════════════════════════════════════════════════ */
.public-form-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 32px 16px;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(250,204,20,0.04) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 20%, rgba(250,204,20,0.03) 0%, transparent 50%);
}
.public-form-card {
  width: 100%; max-width: 680px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-top-color: var(--border-3);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 1px 0 var(--shine) inset, 0 0 0 1px rgba(0,0,0,0.5), 0 24px 60px rgba(0,0,0,0.3);
}
.public-form-card .brand {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 28px;
}
.public-form-card .brand .mark {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, #fde047, var(--yellow), #ca8a04);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 900; color: #1a0f00;
  box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset, 0 2px 6px rgba(250,204,20,0.3);
}
.public-form-card .brand h1 { font-size: 18px; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }
.public-form-card .brand p  { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } .public-form-card { padding: 24px; } }


/* ══════════════════════════════════════════════════════════════════
   MISC HELPERS
   ══════════════════════════════════════════════════════════════════ */
.section-div { grid-column: 1/-1; border: none; border-top: 1px solid var(--border); margin: 4px 0; }
.section-title-sm {
  font-size: 10px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; color: rgba(250,204,20,0.5);
  grid-column: 1/-1; margin-top: 4px;
}

/* Lead detail field rows */
.field-row { display: flex; flex-direction: column; gap: 3px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.field-row:last-child { border-bottom: none; }
.field-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-4); }
.field-value { font-size: 13px; color: var(--text); line-height: 1.5; }
.field-value.muted { color: var(--text-3); font-style: italic; }

/* Two-col layout (lead detail) */
.two-col { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

/* Right column sticky panels */
.right-col { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 24px; }
.action-panel {
  background: linear-gradient(160deg, var(--surface-2) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-top-color: var(--border-2);
  border-radius: 12px; padding: 16px;
  box-shadow: 0 1px 0 var(--shine) inset, 0 2px 8px rgba(0,0,0,0.2);
}
.action-panel h3 {
  font-size: 10px; font-weight: 700; color: var(--text-4);
  text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 12px;
}
.action-btn-full { width: 100%; justify-content: center; margin-bottom: 6px; }
.notes-status { font-size: 10px; color: var(--text-4); margin-top: 5px; }

/* Lead hero */
.lead-hero {
  background: linear-gradient(160deg, var(--surface-2) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-top-color: var(--border-2);
  border-radius: 12px; padding: 18px;
  display: flex; gap: 14px; align-items: center;
  margin-bottom: 14px;
  box-shadow: 0 1px 0 var(--shine) inset, 0 2px 8px rgba(0,0,0,0.2);
}
.lead-avatar {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--yellow-glow);
  border: 1px solid var(--yellow-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: var(--yellow);
  flex-shrink: 0;
}
.lead-hero h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.lead-hero .sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* Back link */
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-3);
  margin-bottom: 18px; transition: color 0.1s;
}
.back-link:hover { color: var(--text); }

/* Tooltip */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  background: var(--surface-3); border: 1px solid var(--border-2);
  color: var(--text); padding: 4px 9px; border-radius: 6px;
  font-size: 11px; white-space: nowrap;
  pointer-events: none; opacity: 0; transition: opacity 0.12s;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
[data-tip]:hover::after { opacity: 1; }

/* QR preview */
.qr-preview {
  background: var(--surface-2); border: 2px dashed var(--border-2);
  border-radius: 12px; padding: 28px; text-align: center; margin-bottom: 16px;
}
.qr-preview.has-image { border-style: solid; border-color: var(--yellow-border); }
.qr-preview img { max-width: 200px; border-radius: 8px; }
.drop-zone {
  background: var(--surface-2); border: 2px dashed var(--border);
  border-radius: 10px; padding: 24px; text-align: center;
  cursor: pointer; transition: all 0.12s; margin-bottom: 14px;
}
.drop-zone:hover, .drop-zone.drag-over { border-color: var(--yellow-border); background: var(--yellow-glow); }
.drop-zone svg { width: 28px; height: 28px; color: var(--text-3); margin-bottom: 8px; }
.drop-zone p { font-size: 13px; color: var(--text-3); }

/* Charts */
.chart-card {
  background: linear-gradient(160deg, var(--surface-2) 0%, var(--surface) 100%);
  border: 1px solid var(--border); border-top-color: var(--border-2);
  border-radius: 12px; padding: 18px;
  box-shadow: 0 1px 0 var(--shine) inset, 0 2px 8px rgba(0,0,0,0.2);
}
.chart-card h3 {
  font-size: 11px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 14px;
}
.chart-wrap { position: relative; height: 220px; }
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .charts-grid { grid-template-columns: 1fr; } }

/* Funnel bars */
.funnel-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.funnel-bar .bar-label { font-size: 11px; width: 120px; color: var(--text-2); flex-shrink: 0; }
.funnel-bar .bar-track { flex:1; height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.funnel-bar .bar-fill  { height: 100%; border-radius: 99px; background: var(--yellow); transition: width 0.5s ease; }
.funnel-bar .bar-count { font-size: 12px; font-weight: 700; color: var(--text); width: 24px; text-align: right; }

/* Login page */
.login-card {
  width: 100%; max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border-2); border-top-color: var(--border-3);
  border-radius: 18px; padding: 36px 32px;
  box-shadow: 0 1px 0 var(--shine) inset, 0 0 0 1px rgba(0,0,0,0.5), 0 24px 60px rgba(0,0,0,0.4);
}
