/* ==========================================================================
   AIVA Design System v1.0
   Premium dark theme — tokens + base components.
   Loaded BEFORE style.css. style.css and admin.css use these tokens.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Color — backgrounds */
  --color-bg:           #0a0c11;
  --color-surface:      #11151d;
  --color-surface-2:    #1a1f2b;
  --color-surface-hi:   #232a3a;
  --color-border:       #252b3a;
  --color-border-hi:    #3a4359;

  /* Color — content */
  --color-text:         #eef0f5;
  --color-text-soft:    #c4cbd9;
  --color-muted:        #8a93a8;
  --color-faint:        #5a6275;

  /* Color — accents */
  --color-accent:       #7aa9ff;
  --color-accent-hi:    #92baff;
  --color-accent-soft:  rgba(122, 169, 255, 0.12);
  --color-violet:       #a78bfa;

  /* Gradient */
  --grad-accent:        linear-gradient(135deg, #7aa9ff 0%, #a78bfa 100%);
  --grad-soft:          linear-gradient(180deg, rgba(122,169,255,0.05), rgba(167,139,250,0.0));

  /* Color — semantic */
  --color-ok:           #4ade80;
  --color-warn:         #fbbf24;
  --color-hot:          #f87171;
  --color-cold:         #60a5fa;
  --color-error:        #f87171;

  /* Soft tints (badges) */
  --tint-ok:            rgba(74, 222, 128, 0.15);
  --tint-warn:          rgba(251, 191, 36, 0.18);
  --tint-hot:           rgba(248, 113, 113, 0.18);
  --tint-cold:          rgba(96, 165, 250, 0.18);
  --tint-accent:        rgba(122, 169, 255, 0.18);
  --tint-violet:        rgba(167, 139, 250, 0.18);

  /* Radii */
  --r-xs:  4px;
  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  14px;
  --r-xl:  20px;
  --r-pill: 999px;

  /* Spacing scale (8-grid + tight steps) */
  --s-1:  4px;
  --s-2:  8px;
  --s-3:  12px;
  --s-4:  16px;
  --s-5:  20px;
  --s-6:  24px;
  --s-7:  32px;
  --s-8:  48px;
  --s-9:  64px;

  /* Type */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --font-mono: 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  --fs-xs:   11px;
  --fs-sm:   12px;
  --fs-base: 13px;
  --fs-md:   14px;
  --fs-lg:   16px;
  --fs-xl:   20px;
  --fs-2xl:  26px;
  --fs-3xl:  34px;

  /* Shadows */
  --sh-sm:  0 1px 2px rgba(0,0,0,.35);
  --sh-md:  0 1px 2px rgba(0,0,0,.4), 0 6px 16px rgba(0,0,0,.25);
  --sh-lg:  0 2px 4px rgba(0,0,0,.4), 0 16px 36px rgba(0,0,0,.35);
  --sh-glow: 0 0 0 3px rgba(122, 169, 255, .25);

  /* Motion */
  --t-fast: 120ms cubic-bezier(.2,.7,.4,1);
  --t-base: 180ms cubic-bezier(.2,.7,.4,1);
  --t-slow: 280ms cubic-bezier(.2,.7,.4,1);

  /* Legacy aliases (back-compat for older template/CSS code) */
  --bg:        var(--color-bg);
  --panel:     var(--color-surface);
  --panel-2:   var(--color-surface-2);
  --border:    var(--color-border);
  --text:      var(--color-text);
  --muted:     var(--color-muted);
  --accent:    var(--color-accent);
  --accent-2:  var(--color-accent);
  --warn:      var(--color-warn);
  --hot:       var(--color-hot);
  --warm:      var(--color-warn);
  --cold:      var(--color-cold);
  --ok:        var(--color-ok);
}

/* --------------------------------------------------------------------------
   2. RESET / BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-size-adjust: 100%; }
html, body {
  margin: 0; padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.005em;
}
body { min-height: 100vh; }
img, svg { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
a { color: var(--color-accent); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--color-accent-hi); }
code, pre, .mono { font-family: var(--font-mono); font-size: 0.92em; }
hr { border: none; border-top: 1px solid var(--color-border); margin: var(--s-5) 0; }

/* --------------------------------------------------------------------------
   3. TYPOGRAPHY
   -------------------------------------------------------------------------- */
h1 { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin: 0 0 var(--s-5); }
h2 { font-size: var(--fs-md); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-muted); margin: var(--s-6) 0 var(--s-3); }
h3 { font-size: var(--fs-lg); font-weight: 600; margin: var(--s-4) 0 var(--s-2); }
p { margin: 0 0 var(--s-3); }
.muted { color: var(--color-muted); }
.faint { color: var(--color-faint); }
.success { color: var(--color-ok); }
.error { color: var(--color-error); }

/* --------------------------------------------------------------------------
   4. BUTTONS
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  background: var(--grad-accent);
  color: #0a0c11;
  border: none;
  border-radius: var(--r-md);
  padding: 8px 16px;
  font-size: var(--fs-base);
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--t-fast), box-shadow var(--t-fast), filter var(--t-fast);
  box-shadow: var(--sh-sm);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--sh-md); filter: brightness(1.08); text-decoration: none; }
.btn:active { transform: translateY(0); filter: brightness(.95); }
.btn:focus-visible { outline: none; box-shadow: var(--sh-glow); }

.btn.ghost {
  background: transparent;
  color: var(--color-text-soft);
  border: 1px solid var(--color-border);
  box-shadow: none;
}
.btn.ghost:hover { background: var(--color-surface-2); border-color: var(--color-border-hi); color: var(--color-text); filter: none; }

.btn.subtle {
  background: var(--color-surface-2);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  box-shadow: none;
}
.btn.subtle:hover { background: var(--color-surface-hi); }

.btn.danger {
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
  color: #0a0c11;
}

.btn.btn-success { background: var(--color-ok); color: #052e10; }

.btn.sm { padding: 5px 10px; font-size: var(--fs-sm); }
.btn.lg { padding: 11px 20px; font-size: var(--fs-md); }
.btn.full { width: 100%; }
.btn.icon { width: 32px; height: 32px; padding: 0; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.active { background: var(--color-accent); color: #0a0c11; }

/* --------------------------------------------------------------------------
   5. CARDS / SECTIONS
   -------------------------------------------------------------------------- */
.card, .section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  padding: var(--s-4) var(--s-5);
}
.section { margin-bottom: var(--s-4); }
.card { padding: var(--s-4); }
.card.hi { background: var(--color-surface-2); }
.card.padded { padding: var(--s-6); }
.card-label { color: var(--color-muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; margin-bottom: var(--s-2); }
.card-title { font-weight: 600; font-size: var(--fs-md); margin-bottom: var(--s-2); }

/* --------------------------------------------------------------------------
   6. FORMS
   -------------------------------------------------------------------------- */
input[type=text], input[type=password], input[type=email], input[type=tel],
input[type=number], input[type=search], textarea, select {
  width: 100%;
  background: var(--color-surface-2);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-size: var(--fs-md);
  font-family: inherit;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: var(--sh-glow);
}
input::placeholder, textarea::placeholder { color: var(--color-faint); }

label { display: block; color: var(--color-muted); margin-bottom: 6px; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.field { margin-bottom: var(--s-4); }
.field-row { display: flex; gap: var(--s-3); }
.field-row .field { flex: 1; }

/* --------------------------------------------------------------------------
   7. TABLES
   -------------------------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; vertical-align: top; font-size: var(--fs-base); }
thead th {
  color: var(--color-muted);
  font-weight: 600;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer; user-select: none;
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid rgba(255,255,255,0.04); transition: background var(--t-fast); }
tbody tr:hover { background: var(--color-surface-2); cursor: pointer; }
tbody tr.empty:hover, tbody tr.empty { background: transparent; cursor: default; }
tbody tr.empty td { color: var(--color-muted); font-style: italic; padding: var(--s-6); text-align: center; }

/* --------------------------------------------------------------------------
   8. BADGES (pill-style)
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--color-surface-hi);
  color: var(--color-text-soft);
  border: 1px solid var(--color-border);
  white-space: nowrap;
}
.badge.ok        { background: var(--tint-ok); color: var(--color-ok); border-color: rgba(74,222,128,.3); }
.badge.warn,
.badge.warm     { background: var(--tint-warn); color: var(--color-warn); border-color: rgba(251,191,36,.3); }
.badge.hot,
.badge.high     { background: var(--tint-hot); color: var(--color-hot); border-color: rgba(248,113,113,.3); }
.badge.cold     { background: var(--tint-cold); color: var(--color-cold); border-color: rgba(96,165,250,.3); }
.badge.accent   { background: var(--tint-accent); color: var(--color-accent-hi); border-color: rgba(122,169,255,.3); }
.badge.violet   { background: var(--tint-violet); color: var(--color-violet); border-color: rgba(167,139,250,.3); }
.badge.normal,
.badge.low,
.badge.muted    { background: var(--color-surface-2); color: var(--color-muted); border-color: var(--color-border); }
.badge.aktif    { background: var(--tint-ok); color: var(--color-ok); border-color: rgba(74,222,128,.3); }
.badge.satıldı,
.badge.kiralandı { background: var(--color-surface-2); color: var(--color-muted); border-color: var(--color-border); }
.badge.iptal    { background: var(--tint-hot); color: var(--color-hot); border-color: rgba(248,113,113,.3); }
.badge.pending  { background: var(--tint-cold); color: var(--color-cold); border-color: rgba(96,165,250,.3); }
.badge.lg       { font-size: var(--fs-sm); padding: 4px 12px; }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: var(--r-xs);
  background: var(--color-surface-2); border: 1px solid var(--color-border);
  font-size: var(--fs-xs); font-weight: 500;
}
.tag.danger { background: var(--tint-hot); color: var(--color-hot); border-color: rgba(248,113,113,.3); }

/* --------------------------------------------------------------------------
   9. KPI cards (premium)
   -------------------------------------------------------------------------- */
.kpi {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  padding: var(--s-4) var(--s-5);
  transition: transform var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
  overflow: hidden;
}
.kpi::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--grad-soft);
  pointer-events: none;
}
.kpi:hover { transform: translateY(-1px); border-color: var(--color-border-hi); box-shadow: var(--sh-md); }
.kpi .kpi-head { display: flex; justify-content: space-between; align-items: center; }
.kpi .kpi-icon {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  background: var(--tint-accent);
  color: var(--color-accent);
}
.kpi .label { color: var(--color-muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.kpi .value { font-size: var(--fs-3xl); font-weight: 700; letter-spacing: -0.02em; margin-top: var(--s-2); line-height: 1; }
.kpi .sub { font-size: var(--fs-xs); color: var(--color-muted); margin-top: var(--s-2); }
.kpi .delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; }
.kpi .delta.up { color: var(--color-ok); }
.kpi .delta.down { color: var(--color-hot); }

/* --------------------------------------------------------------------------
   10. ICON system (SVG sprite)
   -------------------------------------------------------------------------- */
.icon {
  display: inline-block;
  width: 1em; height: 1em;
  vertical-align: -0.125em;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 0;
}
.icon.sm { font-size: var(--fs-base); }
.icon.md { font-size: var(--fs-lg); }
.icon.lg { font-size: var(--fs-xl); }

/* --------------------------------------------------------------------------
   11. TOPBAR / NAV
   -------------------------------------------------------------------------- */
.topbar {
  display: flex; align-items: center;
  background: rgba(17, 21, 29, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  padding: var(--s-3) var(--s-5);
  gap: var(--s-5);
  position: sticky; top: 0; z-index: 50;
}
.brand {
  font-weight: 700;
  font-size: var(--fs-md);
  letter-spacing: 0.02em;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-flex; align-items: center; gap: var(--s-2);
}
.brand-logo {
  width: 26px; height: 26px;
  border-radius: var(--r-sm);
  background: var(--grad-accent);
  display: inline-flex; align-items: center; justify-content: center;
  color: #0a0c11; font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}
.nav { display: flex; gap: var(--s-1); flex: 1; align-items: center; }
.nav a {
  color: var(--color-text-soft);
  padding: 6px 12px;
  border-radius: var(--r-sm);
  font-weight: 500;
  font-size: var(--fs-base);
  transition: background var(--t-fast), color var(--t-fast);
}
.nav a:hover { background: var(--color-surface-2); color: var(--color-text); text-decoration: none; }
.nav a.active {
  background: var(--tint-accent);
  color: var(--color-accent-hi);
}
.who { color: var(--color-muted); font-size: var(--fs-sm); }

/* --------------------------------------------------------------------------
   12. WARNING / DEV BANNER
   -------------------------------------------------------------------------- */
.warning-banner {
  background: var(--tint-warn);
  color: var(--color-warn);
  border-bottom: 1px solid rgba(251,191,36,.3);
  padding: 8px var(--s-5);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-align: center;
}

.success-banner {
  background: var(--tint-ok);
  color: var(--color-ok);
  border: 1px solid rgba(74,222,128,.3);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  margin-bottom: var(--s-4);
  font-size: var(--fs-base);
}

/* --------------------------------------------------------------------------
   13. CHIPS / FILTERS
   -------------------------------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  color: var(--color-text-soft);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: all var(--t-fast);
}
.chip:hover { border-color: var(--color-border-hi); }
.chip.active { background: var(--tint-accent); color: var(--color-accent-hi); border-color: rgba(122,169,255,.3); }
.chip .x { color: var(--color-faint); cursor: pointer; margin-left: 4px; }
.chip .x:hover { color: var(--color-text); }

/* --------------------------------------------------------------------------
   14. SEGMENTED CONTROL
   -------------------------------------------------------------------------- */
.segmented {
  display: inline-flex;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  padding: 2px;
  gap: 2px;
}
.segmented > * {
  padding: 5px 12px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--color-text-soft);
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.segmented > *.active,
.segmented > *:hover {
  background: var(--color-surface-hi);
  color: var(--color-text);
}
.segmented > *.active { background: var(--color-accent); color: #0a0c11; }

/* --------------------------------------------------------------------------
   15. FOOTER
   -------------------------------------------------------------------------- */
.footer { padding: var(--s-5); text-align: center; color: var(--color-faint); font-size: var(--fs-xs); }

/* --------------------------------------------------------------------------
   16. ACTIVATION CARD (admin)
   -------------------------------------------------------------------------- */
.activation-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  margin: var(--s-4) 0;
  background-image: var(--grad-soft);
}
.activation-card-label, .card-label { color: var(--color-muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.activation-code {
  font-family: var(--font-mono);
  font-size: var(--fs-3xl);
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: var(--s-3) 0;
  padding: var(--s-3) 0;
  user-select: all;
}
.activation-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-3); }
.activation-meta { font-size: var(--fs-xs); color: var(--color-muted); margin-top: var(--s-3); }

.message-template-card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  padding: var(--s-5);
  margin: var(--s-4) 0;
}
.message-template {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  white-space: pre-wrap;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-sm);
  padding: var(--s-3);
  color: var(--color-text-soft);
  margin: var(--s-3) 0;
}
.msg-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }

.next-steps { margin: var(--s-6) 0; }
.next-steps ol { padding-left: var(--s-6); }
.next-steps li { margin-bottom: var(--s-2); color: var(--color-text-soft); }
.next-steps code {
  background: var(--color-surface-2);
  padding: 1px 6px;
  border-radius: var(--r-xs);
  font-size: 0.92em;
  color: var(--color-accent-hi);
  border: 1px solid var(--color-border);
}

.footer-actions { display: flex; gap: var(--s-2); margin-top: var(--s-5); }

.empty-state { padding: var(--s-6); text-align: center; }
.meta-row { display: flex; gap: var(--s-4); flex-wrap: wrap; font-size: var(--fs-sm); margin-bottom: var(--s-4); }
.meta-row code { background: var(--color-surface-2); padding: 1px 6px; border-radius: var(--r-xs); border: 1px solid var(--color-border); }
.meta-row .warn { color: var(--color-warn); }

/* --------------------------------------------------------------------------
   17. UTILITY
   -------------------------------------------------------------------------- */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--s-1); }
.gap-2 { gap: var(--s-2); }
.gap-3 { gap: var(--s-3); }
.gap-4 { gap: var(--s-4); }
.mt-1 { margin-top: var(--s-1); }
.mt-2 { margin-top: var(--s-2); }
.mt-3 { margin-top: var(--s-3); }
.mt-4 { margin-top: var(--s-4); }
.mb-1 { margin-bottom: var(--s-1); }
.mb-2 { margin-bottom: var(--s-2); }
.mb-3 { margin-bottom: var(--s-3); }
.mb-4 { margin-bottom: var(--s-4); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.full { width: 100%; }
.hidden { display: none; }

/* --------------------------------------------------------------------------
   18. ANIMATIONS
   -------------------------------------------------------------------------- */
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn var(--t-base); }

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.6; } }
.pulse { animation: pulse 1.5s infinite; }

@keyframes typing-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Alpine.js — hide elements until Alpine boots */
[x-cloak] { display: none !important; }

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

/* --------------------------------------------------------------------------
   18b. SHELL LAYOUT (sidebar + topbar + main)
   -------------------------------------------------------------------------- */
:root {
  --sidebar-w: 240px;
  --sidebar-w-collapsed: 64px;
  --topbar-h: 56px;
  --dock-w: 380px;
  --dock-h: 600px;
}

body.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}
body.app[data-sidebar="collapsed"] { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }

.shell {
  display: flex;
  flex-direction: column;
  min-width: 0;  /* prevent overflow in grid */
}

/* sidebar ------------------------------------------------------------------ */
.sidebar {
  position: sticky; top: 0;
  align-self: start;
  height: 100vh;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex; flex-direction: column;
  padding: var(--s-3) 0;
  z-index: 40;
  transition: width var(--t-base);
}
body.app[data-sidebar="collapsed"] .sidebar { width: var(--sidebar-w-collapsed); }
body.app[data-sidebar="collapsed"] .sidebar-label,
body.app[data-sidebar="collapsed"] .sidebar-brand-text,
body.app[data-sidebar="collapsed"] .sidebar-collapse-icon { display: none; }
body.app[data-sidebar="collapsed"] .sidebar-link,
body.app[data-sidebar="collapsed"] .sidebar-brand,
body.app[data-sidebar="collapsed"] .sidebar-collapse-btn { justify-content: center; padding-left: 0; padding-right: 0; }

.sidebar-brand {
  display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-3) var(--s-4) var(--s-5);
  font-weight: 700; font-size: var(--fs-md);
}
.sidebar-brand-text {
  background: var(--grad-accent);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  letter-spacing: 0.04em;
}
.sidebar-nav, .sidebar-foot { display: flex; flex-direction: column; gap: 2px; padding: 0 var(--s-2); }
.sidebar-nav { flex: 1; overflow-y: auto; }
.sidebar-foot { border-top: 1px solid var(--color-border); padding-top: var(--s-2); padding-bottom: var(--s-2); }

.sidebar-link {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 9px 12px;
  color: var(--color-text-soft);
  border-radius: var(--r-sm);
  font-size: var(--fs-base);
  font-weight: 500;
  text-decoration: none;
  position: relative;
  transition: background var(--t-fast), color var(--t-fast);
  white-space: nowrap;
}
.sidebar-link .icon { font-size: var(--fs-lg); flex-shrink: 0; }
.sidebar-link:hover { background: var(--color-surface-2); color: var(--color-text); text-decoration: none; }
.sidebar-link.active {
  background: var(--tint-accent);
  color: var(--color-accent-hi);
}
.sidebar-link.active::before {
  content: ''; position: absolute; left: -8px; top: 8px; bottom: 8px; width: 3px;
  background: var(--grad-accent); border-radius: 0 var(--r-xs) var(--r-xs) 0;
}
body.app[data-sidebar="collapsed"] .sidebar-link {
  position: relative;
}
body.app[data-sidebar="collapsed"] .sidebar-link:hover::after {
  content: attr(data-tip);
  position: absolute; left: 56px; top: 50%; transform: translateY(-50%);
  background: var(--color-surface-hi);
  border: 1px solid var(--color-border);
  border-radius: var(--r-sm);
  padding: 4px 8px;
  font-size: var(--fs-xs);
  z-index: 50;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--sh-sm);
}
.sidebar-collapse-btn {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-muted);
  padding: 6px 12px; margin: var(--s-1) var(--s-2);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: var(--fs-sm);
  display: flex; align-items: center; justify-content: center;
}
.sidebar-collapse-btn:hover { background: var(--color-surface-2); color: var(--color-text); }
body.app[data-sidebar="collapsed"] .sidebar-collapse-icon { display: none; }
body.app[data-sidebar="collapsed"] .sidebar-collapse-btn::before { content: '›'; }

/* topbar (slim) ------------------------------------------------------------ */
.topbar {
  position: sticky; top: 0;
  display: flex; align-items: center;
  gap: var(--s-3);
  padding: 0 var(--s-5);
  height: var(--topbar-h);
  background: rgba(17, 21, 29, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  z-index: 30;
}
.topbar-burger {
  display: none;
  background: var(--color-surface-2); color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--r-sm);
  width: 36px; height: 36px;
  cursor: pointer;
  align-items: center; justify-content: center;
}
.topbar-spacer { flex: 1; }

.topbar-logout {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: 0 var(--s-3); height: 36px;
  border: 1px solid var(--color-border);
  border-radius: var(--r-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 13px;
  transition: background 0.15s, color 0.15s;
}
.topbar-logout:hover { background: var(--color-surface-2); color: var(--color-text); }
.topbar-logout .icon { width: 16px; height: 16px; }
@media (max-width: 720px) {
  .topbar-logout-text { display: none; }
  .topbar-logout { padding: 0; width: 36px; justify-content: center; }
}

/* main area ---------------------------------------------------------------- */
.main {
  padding: var(--s-6) var(--s-7) var(--s-9);
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
}
.footer { padding: var(--s-5); text-align: center; color: var(--color-faint); font-size: var(--fs-xs); }

/* --------------------------------------------------------------------------
   18c. CHAT DOCK (sticky left-bottom)
   -------------------------------------------------------------------------- */
.chat-dock {
  position: fixed;
  left: var(--s-5);
  bottom: var(--s-5);
  z-index: 60;
}
.chat-dock-bubble {
  display: flex; align-items: center; gap: var(--s-2);
  background: var(--grad-accent);
  color: #0a0c11;
  border: none;
  border-radius: var(--r-pill);
  padding: 12px 18px 12px 14px;
  cursor: pointer;
  font-weight: 600; font-size: var(--fs-base);
  box-shadow: var(--sh-md);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.chat-dock-bubble:hover { transform: translateY(-2px); box-shadow: var(--sh-lg); }
.chat-dock-bubble-icon { font-size: 18px; line-height: 1; }
.chat-dock-bubble-label { letter-spacing: 0.02em; }

.chat-dock-panel {
  display: none;
  position: absolute;
  left: 0; bottom: 64px;
  width: var(--dock-w);
  height: var(--dock-h);
  max-height: calc(100vh - 100px);
  background: var(--color-surface);
  border: 1px solid var(--color-border-hi);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  overflow: hidden;
  flex-direction: column;
}
.chat-dock[data-state="expanded"] .chat-dock-panel { display: flex; }
.chat-dock[data-state="expanded"] .chat-dock-bubble { box-shadow: 0 0 0 3px var(--color-accent-soft), var(--sh-md); }

/* override old chat-panel styles inside the dock */
.chat-dock-panel .chat-widget { height: 100%; }

/* mobile drawer behaviour -------------------------------------------------- */
@media (max-width: 1024px) {
  body.app { grid-template-columns: 1fr !important; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: var(--sidebar-w);
    transform: translateX(-100%);
    transition: transform var(--t-base);
  }
  body.app.nav-open .sidebar { transform: translateX(0); box-shadow: var(--sh-lg); }
  .topbar-burger { display: inline-flex; }
  .chat-dock-panel { width: calc(100vw - 32px); height: calc(100vh - 100px); }
}

/* --------------------------------------------------------------------------
   18d. AI HERO (homepage)
   -------------------------------------------------------------------------- */
.hero {
  max-width: 760px;
  margin: var(--s-8) auto var(--s-7);
  text-align: center;
}
.hero-greeting {
  font-size: 32px; font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: var(--s-2);
}
.hero-greeting strong {
  background: var(--grad-accent);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-date { color: var(--color-muted); font-size: var(--fs-base); margin-bottom: var(--s-6); }
.hero-form {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border-hi);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-md);
  padding: var(--s-3) var(--s-4) var(--s-3) var(--s-5);
  display: flex; flex-direction: column;
  text-align: left;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.hero-form:focus-within { border-color: var(--color-accent); box-shadow: var(--sh-glow), var(--sh-md); }
.hero-textarea {
  background: transparent !important;
  border: none !important;
  padding: var(--s-3) 0 !important;
  font-size: 17px !important;
  font-family: inherit;
  color: var(--color-text);
  resize: none;
  min-height: 64px;
  outline: none !important;
  box-shadow: none !important;
}
.hero-textarea::placeholder { color: var(--color-muted); }
.hero-actions { display: flex; align-items: center; gap: var(--s-2); }
.hero-actions .hint { color: var(--color-faint); font-size: var(--fs-xs); flex: 1; }
.hero-actions .btn { padding: 7px 14px; }

.suggestions {
  display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2);
  margin-top: var(--s-4);
}
.suggestion-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--r-pill);
  color: var(--color-text-soft);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.suggestion-chip:hover { background: var(--color-surface-hi); border-color: var(--color-border-hi); color: var(--color-text); transform: translateY(-1px); }
.suggestion-chip-emoji { font-size: 14px; }

/* --------------------------------------------------------------------------
   18e. INSIGHT CARDS (richer KPI on home)
   -------------------------------------------------------------------------- */
.insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s-3);
  margin: var(--s-7) 0 var(--s-5);
}
.insight-card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  padding: var(--s-4) var(--s-5);
  overflow: hidden;
  transition: transform var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
  text-decoration: none;
  color: inherit;
  display: block;
}
.insight-card:hover { transform: translateY(-1px); border-color: var(--color-border-hi); box-shadow: var(--sh-md); text-decoration: none; }
.insight-card-head { display: flex; justify-content: space-between; align-items: flex-start; }
.insight-card-label { color: var(--color-muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.insight-card-icon {
  width: 28px; height: 28px; border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--tint-accent); color: var(--color-accent);
}
.insight-card-icon.warn { background: var(--tint-warn); color: var(--color-warn); }
.insight-card-icon.hot  { background: var(--tint-hot);  color: var(--color-hot); }
.insight-card-icon.violet { background: var(--tint-violet); color: var(--color-violet); }
.insight-card-value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin: var(--s-2) 0 0; line-height: 1; }
.insight-card-sub { color: var(--color-muted); font-size: var(--fs-xs); margin-top: var(--s-2); }
.insight-card-delta { display: inline-flex; align-items: center; gap: 2px; font-size: var(--fs-xs); font-weight: 600; }
.insight-card-delta.up { color: var(--color-ok); }
.insight-card-delta.down { color: var(--color-hot); }

.smart-insights {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  padding: var(--s-4) var(--s-5);
  margin-bottom: var(--s-5);
}
.smart-insights h3 { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-muted); font-weight: 600; margin: 0 0 var(--s-3); }
.smart-insights ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.smart-insights li {
  display: flex; gap: var(--s-3); align-items: flex-start;
  padding: var(--s-2) 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.smart-insights li:last-child { border-bottom: none; }
.smart-insights .si-bullet {
  font-size: 14px; color: var(--color-accent); margin-top: 2px;
}

/* --------------------------------------------------------------------------
   18f. PAGINATION
   -------------------------------------------------------------------------- */
.pagination {
  display: flex; gap: var(--s-2); align-items: center;
  padding: var(--s-3) 0;
  border-top: 1px solid var(--color-border);
  font-size: var(--fs-sm);
}
.pagination .pg-info { color: var(--color-muted); }
.pagination .pg-spacer { flex: 1; }
.pagination .pg-btn,
.pagination .pg-num {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  color: var(--color-text-soft);
  padding: 5px 10px;
  border-radius: var(--r-sm);
  text-decoration: none;
  font-size: var(--fs-sm);
  min-width: 28px; text-align: center;
  cursor: pointer;
}
.pagination .pg-btn:hover,
.pagination .pg-num:hover { background: var(--color-surface-hi); color: var(--color-text); border-color: var(--color-border-hi); }
.pagination .pg-num.current { background: var(--color-accent); color: #0a0c11; border-color: var(--color-accent); font-weight: 600; }
.pagination .pg-btn:disabled,
.pagination .pg-btn.disabled { opacity: 0.4; pointer-events: none; }
.pagination .pg-size {
  background: var(--color-surface-2);
  color: var(--color-text-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--r-sm);
  padding: 5px 8px;
  font-size: var(--fs-sm);
  width: auto;
}

/* --------------------------------------------------------------------------
   18g. KANBAN PIPELINE
   -------------------------------------------------------------------------- */
.kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: var(--s-3);
  align-items: start;
  margin-bottom: var(--s-7);
}
.kanban-col {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  padding: var(--s-3);
  min-height: 320px;
  display: flex; flex-direction: column;
}
.kanban-col h3 {
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--color-muted);
  margin: 0 0 var(--s-3);
  display: flex; align-items: center; justify-content: space-between;
}
.kanban-col h3 .count {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--r-pill);
  padding: 1px 8px;
  font-size: 10px;
  color: var(--color-text-soft);
  font-weight: 600;
}
.kanban-cards {
  display: flex; flex-direction: column;
  gap: var(--s-2);
  flex: 1;
  min-height: 60px;
}
.kanban-card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-left-width: 3px;
  border-radius: var(--r-sm);
  padding: var(--s-3);
  cursor: grab;
  transition: transform var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}
.kanban-card:hover { border-color: var(--color-border-hi); box-shadow: var(--sh-sm); }
.kanban-card:active { cursor: grabbing; }
.kanban-card[data-temp="sıcak"]  { border-left-color: var(--color-hot); }
.kanban-card[data-temp="ılık"]   { border-left-color: var(--color-warn); }
.kanban-card[data-temp="soğuk"]  { border-left-color: var(--color-cold); }
.kanban-card-name { font-weight: 600; margin-bottom: 2px; }
.kanban-card-meta { font-size: var(--fs-xs); color: var(--color-muted); }
.kanban-card-foot { display: flex; justify-content: space-between; margin-top: var(--s-2); font-size: var(--fs-xs); color: var(--color-faint); }
.sortable-ghost { opacity: 0.4; }
.sortable-drag { box-shadow: var(--sh-lg); transform: rotate(2deg); }

@media (max-width: 1280px) {
  .kanban { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .kanban { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   18h. TABS (detail panel)
   -------------------------------------------------------------------------- */
.tabs {
  display: flex; gap: 2px;
  border-bottom: 1px solid var(--color-border);
  margin: var(--s-3) 0 var(--s-4);
}
.tabs button {
  background: transparent;
  border: none;
  color: var(--color-muted);
  padding: 8px 14px;
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.tabs button:hover { color: var(--color-text); }
.tabs button.active { color: var(--color-accent-hi); border-bottom-color: var(--color-accent); }

/* --------------------------------------------------------------------------
   18i. BULK ACTION BAR
   -------------------------------------------------------------------------- */
.bulk-bar {
  position: fixed; bottom: var(--s-5); left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--color-surface-hi);
  border: 1px solid var(--color-border-hi);
  border-radius: var(--r-pill);
  padding: 8px 14px;
  display: flex; align-items: center; gap: var(--s-3);
  box-shadow: var(--sh-lg);
  font-size: var(--fs-sm);
  z-index: 70;
  transition: transform var(--t-base);
  pointer-events: none;
}
.bulk-bar.show { transform: translateX(-50%) translateY(0); pointer-events: auto; }
.bulk-bar .bulk-count { color: var(--color-accent-hi); font-weight: 600; }
.bulk-bar .bulk-actions { display: flex; gap: var(--s-2); }
.bulk-bar .btn.sm { padding: 4px 10px; font-size: var(--fs-xs); }

/* --------------------------------------------------------------------------
   19. AVATAR (gradient initials)
   -------------------------------------------------------------------------- */
.avatar-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--grad-accent);
  color: #0a0c11;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: var(--fs-sm);
  letter-spacing: 0.02em;
  flex-shrink: 0;
  user-select: none;
  box-shadow: var(--sh-sm);
}

/* --------------------------------------------------------------------------
   20. PALETTE TRIGGER (search-like topbar button)
   -------------------------------------------------------------------------- */
.palette-trigger {
  display: inline-flex; align-items: center; gap: var(--s-2);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  color: var(--color-muted);
  padding: 5px 10px 5px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: var(--fs-sm);
  min-width: 220px;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.palette-trigger:hover { border-color: var(--color-border-hi); background: var(--color-surface-hi); color: var(--color-text-soft); }
.palette-trigger-text { flex: 1; text-align: left; }
.palette-trigger-kbd, kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: var(--r-xs);
  background: var(--color-surface-hi);
  border: 1px solid var(--color-border);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-soft);
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   21. PALETTE OVERLAY
   -------------------------------------------------------------------------- */
.palette {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  align-items: flex-start; justify-content: center;
  padding-top: 12vh;
  animation: fadeIn var(--t-fast);
}
.palette.open { display: flex; }
.palette-card {
  width: min(620px, 92vw);
  background: var(--color-surface);
  border: 1px solid var(--color-border-hi);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
  max-height: 70vh;
}
.palette-header {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}
.palette-header .icon { color: var(--color-muted); font-size: var(--fs-lg); }
.palette-input {
  flex: 1;
  background: transparent !important;
  border: none !important;
  color: var(--color-text);
  font-size: var(--fs-lg);
  padding: 0 !important;
  outline: none;
  box-shadow: none !important;
}
.palette-results {
  list-style: none; padding: var(--s-1) 0; margin: 0;
  overflow-y: auto;
  flex: 1;
}
.palette-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-5);
  cursor: pointer;
  border-left: 2px solid transparent;
}
.palette-item.active { background: var(--color-surface-2); border-left-color: var(--color-accent); }
.palette-kind { color: var(--color-muted); font-size: 14px; }
.palette-label { color: var(--color-text); font-weight: 500; }
.palette-hint { font-size: var(--fs-xs); }
.palette-empty { padding: var(--s-5); text-align: center; }
.palette-footer {
  padding: var(--s-3) var(--s-5);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: var(--fs-xs);
  display: flex; gap: var(--s-2); align-items: center;
}

/* --------------------------------------------------------------------------
   22. SHORTCUTS MODAL
   -------------------------------------------------------------------------- */
.shortcuts-modal .modal-card { width: min(440px, 92vw); }
.shortcuts-table { width: 100%; }
.shortcuts-table td { padding: 6px 0; vertical-align: top; font-size: var(--fs-base); }
.shortcuts-table td:first-child { width: 40%; white-space: nowrap; }
.shortcuts-table td:last-child { color: var(--color-text-soft); }

/* --------------------------------------------------------------------------
   23. TOAST STACK
   -------------------------------------------------------------------------- */
.toast-stack {
  position: fixed; right: 24px; bottom: 24px;
  display: flex; flex-direction: column; gap: var(--s-2);
  z-index: 300;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: var(--s-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border-hi);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  min-width: 240px; max-width: 380px;
  box-shadow: var(--sh-lg);
  font-size: var(--fs-sm);
  color: var(--color-text);
  transform: translateX(20px);
  opacity: 0;
  transition: transform var(--t-base), opacity var(--t-base);
  pointer-events: auto;
  border-left-width: 3px;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast-ok    { border-left-color: var(--color-ok); }
.toast-warn  { border-left-color: var(--color-warn); }
.toast-err   { border-left-color: var(--color-hot); }
.toast-msg { flex: 1; }
.toast-close {
  background: transparent; border: none; color: var(--color-muted);
  font-size: 18px; cursor: pointer; padding: 0; line-height: 1;
}
.toast-close:hover { color: var(--color-text); }

/* --------------------------------------------------------------------------
   24. EMPTY STATE
   -------------------------------------------------------------------------- */
.empty-state {
  padding: var(--s-9) var(--s-5);
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: var(--s-2);
}
.empty-state .empty-icon {
  width: 56px; height: 56px;
  border-radius: var(--r-lg);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--color-muted);
  font-size: 22px;
  margin-bottom: var(--s-2);
}
.empty-state .empty-headline { font-weight: 600; font-size: var(--fs-md); color: var(--color-text); }
.empty-state .empty-sub { color: var(--color-muted); font-size: var(--fs-sm); max-width: 480px; }
.empty-state .empty-cta { margin-top: var(--s-3); display: flex; gap: var(--s-2); flex-wrap: wrap; justify-content: center; }
tbody tr.empty td { padding: 0; background: transparent; }
tbody tr.empty .empty-state { padding: var(--s-7) var(--s-4); }

/* --------------------------------------------------------------------------
   25. SKELETON LOADER
   -------------------------------------------------------------------------- */
@keyframes shimmer {
  0%   { background-position: -240px 0; }
  100% { background-position: 240px 0; }
}
.skeleton {
  display: inline-block;
  background: linear-gradient(90deg,
    var(--color-surface) 0px,
    var(--color-surface-hi) 80px,
    var(--color-surface) 160px);
  background-size: 240px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: var(--r-xs);
}
.skeleton.line { display: block; height: 12px; margin: 6px 0; width: 100%; }
.skeleton.line.short { width: 40%; }
.skeleton.line.med   { width: 70%; }
.htmx-request.section { opacity: 0.55; transition: opacity var(--t-fast); pointer-events: none; }
.htmx-request .palette-input { opacity: 0.6; }

/* --------------------------------------------------------------------------
   26. PHONE / WHATSAPP / EMAIL LINKS
   -------------------------------------------------------------------------- */
.link-phone, .link-mail {
  color: var(--color-text-soft);
  border-bottom: 1px dashed var(--color-border-hi);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.link-phone:hover, .link-mail:hover { color: var(--color-accent-hi); border-bottom-color: var(--color-accent); text-decoration: none; }
.link-wa {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  margin-left: 4px;
  border-radius: 50%;
  background: rgba(37, 211, 102, 0.12);
  color: #25d366;
  font-size: 13px;
  vertical-align: middle;
  text-decoration: none;
  border: 1px solid rgba(37, 211, 102, 0.35);
}
.link-wa:hover { background: rgba(37, 211, 102, 0.22); color: #25d366; text-decoration: none; }

/* --------------------------------------------------------------------------
   27. BRIEFING ACTIONS
   -------------------------------------------------------------------------- */
.briefing-actions {
  display: flex; gap: var(--s-2);
  margin-top: var(--s-3);
  flex-wrap: wrap;
}
.briefing-actions .btn { padding: 5px 10px; font-size: var(--fs-xs); }

/* --------------------------------------------------------------------------
   28. INLINE FOLLOW-UP ACTIONS
   -------------------------------------------------------------------------- */
.fu-actions { display: inline-flex; gap: 4px; }
.fu-actions .btn.icon { width: 26px; height: 26px; font-size: var(--fs-sm); }
.fu-done-mark { color: var(--color-ok); font-size: var(--fs-sm); font-weight: 600; }

/* --------------------------------------------------------------------------
   29. DENSITY MODE (compact)
   -------------------------------------------------------------------------- */
[data-density="compact"] .main { padding: var(--s-4) var(--s-5) var(--s-7); }
[data-density="compact"] th,
[data-density="compact"] td { padding: 6px 8px; font-size: var(--fs-sm); }
[data-density="compact"] .section { padding: var(--s-3) var(--s-4); }
[data-density="compact"] h1 { font-size: var(--fs-xl); }
[data-density="compact"] .kpi { padding: var(--s-3) var(--s-4); }
[data-density="compact"] .kpi .value { font-size: var(--fs-2xl); }
[data-density="compact"] .activity-feed li { padding: 4px 0; }
[data-density="compact"] .grid-card { padding: var(--s-3); }

/* --------------------------------------------------------------------------
   30. LIGHT THEME (token override)
   -------------------------------------------------------------------------- */
[data-theme="light"] {
  --color-bg:           #f5f7fb;
  --color-surface:      #ffffff;
  --color-surface-2:    #f1f4f9;
  --color-surface-hi:   #e6ebf3;
  --color-border:       #e1e6ee;
  --color-border-hi:    #c4cdda;

  --color-text:         #111623;
  --color-text-soft:    #2c354a;
  --color-muted:        #5a6478;
  --color-faint:        #8d97a8;

  --color-accent:       #3673ff;
  --color-accent-hi:    #2655d4;
  --color-accent-soft:  rgba(54, 115, 255, 0.10);
  --color-violet:       #7a58e8;

  --grad-accent:        linear-gradient(135deg, #3673ff 0%, #7a58e8 100%);
  --grad-soft:          linear-gradient(180deg, rgba(54,115,255,0.04), rgba(122,88,232,0.0));

  --tint-ok:            rgba(34, 160, 90, 0.12);
  --tint-warn:          rgba(202, 132, 14, 0.14);
  --tint-hot:           rgba(220, 60, 60, 0.12);
  --tint-cold:          rgba(54, 115, 255, 0.12);
  --tint-accent:        rgba(54, 115, 255, 0.12);
  --tint-violet:        rgba(122, 88, 232, 0.12);

  --color-ok:           #1f9b58;
  --color-warn:         #b67900;
  --color-hot:          #d32f2f;
  --color-cold:         #2655d4;

  --sh-sm:  0 1px 2px rgba(20, 30, 60, .08);
  --sh-md:  0 1px 2px rgba(20, 30, 60, .08), 0 6px 16px rgba(20, 30, 60, .08);
  --sh-lg:  0 2px 4px rgba(20, 30, 60, .08), 0 16px 36px rgba(20, 30, 60, .12);
  --sh-glow: 0 0 0 3px rgba(54, 115, 255, .22);
}
[data-theme="light"] body { background: var(--color-bg); color: var(--color-text); }
[data-theme="light"] .topbar { background: rgba(255,255,255,0.85); }
[data-theme="light"] .chat-panel { background: rgba(255,255,255,0.7); }
[data-theme="light"] .chat-msg.user .chat-bubble { color: #fff; }
[data-theme="light"] .btn { color: #fff; }
[data-theme="light"] .btn.subtle, [data-theme="light"] .btn.ghost { color: var(--color-text); }
[data-theme="light"] .activation-code,
[data-theme="light"] .stat-big,
[data-theme="light"] .brand { -webkit-background-clip: text; background-clip: text; color: transparent; }
[data-theme="light"] .brand-logo, [data-theme="light"] .avatar-circle { color: #fff; }


