/* ═══════════════════════════════════════════════════════════════
   VENTRO CONSOLE — dashboard tasarim katmani
   Landing (index.html) ile ayni token dilini konusur.
   Tailwind CDN'den bagimsizdir: CDN yuklenmeden once de kabuk dogru gorunur.
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Marka — landing ile birebir */
  --void:       #050A14;
  --ink:        #091324;
  --ink-800:    #142744;
  --paper:      #F4F7FB;
  --signal:     #56CCFF;
  --signal-dim: #2FA8E0;
  --pulse:      #2E7FFD;
  --pulse-deep: #1A5CC4;
  --ember:      #FFAE5B;

  /* Konsol yuzeyleri */
  --surface:      #FFFFFF;
  --surface-sunk: #EDF2FA;
  --surface-mute: #F7FAFE;

  /* Metin */
  --text:       #091324;
  --text-mute:  rgba(9, 19, 36, .60);
  --text-faint: rgba(9, 19, 36, .40);
  --on-dark:       #EEF4FC;
  --on-dark-mute:  rgba(238, 244, 252, .60);
  --on-dark-faint: rgba(238, 244, 252, .36);

  /* Cizgi */
  --line:      rgba(9, 19, 36, .09);
  --line-soft: rgba(9, 19, 36, .05);
  --line-dark: rgba(238, 244, 252, .10);

  /* Durum */
  --ok:   #0E9F6E;
  --warn: #D97706;
  --risk: #DC2626;

  /* Golge — notr siyah degil, marka lacivertinin tonu (premium detay) */
  --shadow-1: 0 1px 2px rgba(9, 19, 36, .04), 0 1px 3px rgba(9, 19, 36, .05);
  --shadow-2: 0 2px 4px rgba(9, 19, 36, .04), 0 8px 20px -6px rgba(9, 19, 36, .10);
  --shadow-3: 0 4px 8px rgba(9, 19, 36, .05), 0 24px 48px -12px rgba(9, 19, 36, .18);
  --shadow-rail: 0 0 0 1px rgba(5, 10, 20, .6), 24px 0 48px -24px rgba(5, 10, 20, .45);

  /* Tipografi */
  --display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --body:    'Instrument Sans', 'Segoe UI', system-ui, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, 'Cascadia Mono', monospace;

  --radius:    14px;
  --radius-lg: 20px;
  --radius-sm: 9px;

  --ease-out:    cubic-bezier(.22, .61, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);

  --rail-w:           248px;
  --rail-w-collapsed: 76px;
}

/* ─── TEMEL ──────────────────────────────────────────────────── */

body {
  font-family: var(--body);
  background: var(--paper);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.font-display, .u-display {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -.035em;
}

/* Sayilar zipplamasin: sabit genislikli rakamlar */
.u-num, .count-up, .metric-value, .font-mono, code, kbd {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  letter-spacing: -.02em;
}

.u-eyebrow {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--text-faint);
}

/* Klavye erisimi — her yerde gorunur odak halkasi */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible,
.nav-item:focus-visible {
  outline: 2px solid var(--pulse);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ─── RAIL (sidebar) ─────────────────────────────────────────── */

.sidebar {
  width: var(--rail-w);
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(46, 127, 253, .22), transparent 60%),
    linear-gradient(180deg, #0B1729 0%, var(--void) 100%);
  box-shadow: var(--shadow-rail);
  transition: width .32s var(--ease-out);
}
.sidebar.collapsed { width: var(--rail-w-collapsed); }
.sidebar.collapsed .nav-label,
.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .sidebar-section-label,
.sidebar.collapsed .sidebar-footer-content { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding-inline: 0; }
.sidebar.collapsed .sidebar-toggle svg { transform: rotate(180deg); }

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  color: var(--on-dark-mute);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  transition: background .18s var(--ease-out), color .18s var(--ease-out);
}
.nav-item:hover { background: rgba(238, 244, 252, .06); color: var(--on-dark); }
.nav-item svg { flex-shrink: 0; }

/* Aktif oge: sol kenarda isik cizgisi — gradient dolgu degil */
.nav-item.active {
  background: rgba(46, 127, 253, .14);
  color: #fff;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  width: 3px; height: 18px;
  border-radius: 0 3px 3px 0;
  background: var(--signal);
  box-shadow: 0 0 12px rgba(86, 204, 255, .8);
  transform: translateY(-50%);
}
.sidebar.collapsed .nav-item.active::before { left: -3px; }

.nav-tooltip {
  position: absolute;
  left: calc(100% + 12px);
  background: var(--void);
  color: var(--on-dark);
  padding: 6px 11px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s var(--ease-out);
  box-shadow: var(--shadow-3);
  z-index: 50;
}
.sidebar.collapsed .nav-item:hover .nav-tooltip { opacity: 1; }

/* ─── TOPBAR ─────────────────────────────────────────────────── */

.topbar {
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

/* Icerik alani: ustte cok hafif isik, dibe dogru duz kagit */
.canvas {
  background:
    radial-gradient(90% 42% at 50% 0%, rgba(46, 127, 253, .045), transparent 62%),
    var(--paper);
}

/* ─── PANEL (kart) ───────────────────────────────────────────── */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  transition: box-shadow .22s var(--ease-out), border-color .22s var(--ease-out);
}
.panel-hover:hover { box-shadow: var(--shadow-2); border-color: rgba(46, 127, 253, .22); }

.panel-dark {
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(46, 127, 253, .26), transparent 62%),
    linear-gradient(155deg, var(--ink) 0%, var(--void) 100%);
  border: 1px solid rgba(86, 204, 255, .14);
  border-radius: var(--radius-lg);
  color: var(--on-dark);
  box-shadow: var(--shadow-2);
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-soft);
}
.panel-title { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.panel-sub   { font-size: 12px; color: var(--text-mute); margin-top: 2px; }

/* ─── METRIK ─────────────────────────────────────────────────── */

.metric {
  padding: 18px 20px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  transition: transform .22s var(--ease-out), box-shadow .22s var(--ease-out);
}
.metric:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.metric-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .09em; color: var(--text-mute);
}
.metric-value {
  font-family: var(--display);
  font-variant-numeric: tabular-nums;
  font-size: 38px;
  line-height: 1;
  letter-spacing: -.045em;
  margin-top: 12px;
}
.metric-delta {
  display: inline-flex; align-items: center; gap: 3px;
  margin-top: 8px;
  font-size: 11.5px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.metric-delta.up   { color: var(--ok); }
.metric-delta.down { color: var(--risk); }
.metric-delta.flat { color: var(--text-faint); }

/* ─── DAYBAR — imza ogesi ────────────────────────────────────── */
/* Bugunun gonderim kotasi: her segment bir mesaj grubu, tavan cizgisi gercek kisit */

.daybar {
  position: relative;
  display: flex;
  gap: 3px;
  height: 44px;
  padding: 4px;
  background: rgba(5, 10, 20, .45);
  border: 1px solid rgba(86, 204, 255, .13);
  border-radius: 12px;
  overflow: hidden;
}
.daybar-cell {
  flex: 1;
  min-width: 2px;
  border-radius: 3px;
  background: rgba(238, 244, 252, .06);
  transform-origin: bottom;
  transition: background .3s var(--ease-out), transform .2s var(--ease-out);
  animation: cell-rise .5s var(--ease-out) both;
}
@keyframes cell-rise { from { transform: scaleY(.12); opacity: 0; } to { transform: none; opacity: 1; } }
.daybar-cell.sent    { background: linear-gradient(180deg, var(--pulse), var(--pulse-deep)); }
.daybar-cell.opened  { background: linear-gradient(180deg, var(--signal), var(--signal-dim)); }
.daybar-cell.replied { background: linear-gradient(180deg, #34D399, var(--ok)); box-shadow: 0 0 10px rgba(16, 185, 129, .5); }
.daybar-cell:hover   { transform: scaleY(1.06); }

.daybar-legend {
  display: flex; flex-wrap: wrap; gap: 16px;
  margin-top: 14px;
  font-size: 11.5px; color: var(--on-dark-mute);
}
.daybar-legend b { color: var(--on-dark); font-family: var(--mono); font-variant-numeric: tabular-nums; }
.legend-key { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 6px; }

/* ─── CHIP / ROZET ───────────────────────────────────────────── */

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}
.chip-live { background: rgba(14, 159, 110, .10); color: var(--ok);   border-color: rgba(14, 159, 110, .22); }
.chip-lock { background: rgba(217, 119, 6, .10);  color: var(--warn); border-color: rgba(217, 119, 6, .24); }
.chip-info { background: rgba(46, 127, 253, .09); color: var(--pulse-deep); border-color: rgba(46, 127, 253, .20); }
.chip-mute { background: var(--surface-sunk); color: var(--text-mute); border-color: var(--line); }

.dot { width: 6px; height: 6px; border-radius: 999px; display: inline-block; }
.dot-live { background: var(--ok); animation: pulse-dot 2.4s var(--ease-out) infinite; }

/* ─── BUTON ──────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--body);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: background .18s var(--ease-out), border-color .18s var(--ease-out), transform .18s var(--ease-out);
}
.btn:hover  { background: var(--surface-mute); border-color: rgba(46, 127, 253, .34); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, var(--pulse), var(--pulse-deep));
  border-color: transparent; color: #fff;
  box-shadow: 0 1px 2px rgba(26, 92, 196, .4), 0 6px 16px -6px rgba(46, 127, 253, .6);
}
.btn-primary:hover { background: linear-gradient(180deg, #4A91FF, var(--pulse)); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-mute); }
.btn-ghost:hover { background: var(--surface-sunk); color: var(--text); }
.btn-sm { padding: 5px 11px; font-size: 12px; }

/* ─── SATIR / AKIS ───────────────────────────────────────────── */

.row-item {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 22px;
  border-bottom: 1px solid var(--line-soft);
  transition: background .16s var(--ease-out);
}
.row-item:last-child { border-bottom: 0; }
.row-item:hover { background: var(--surface-mute); }

.row-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.row-icon-in  { background: rgba(14, 159, 110, .10); color: var(--ok); }
.row-icon-out { background: rgba(46, 127, 253, .09); color: var(--pulse); }

.row-time { font-family: var(--mono); font-size: 11.5px; color: var(--text-faint); font-variant-numeric: tabular-nums; }

/* ─── TREND (7 gun) ──────────────────────────────────────────── */

.trend-col { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; }
/* Sayı çubuğun tepesine yapışır: yükseklik değişse de hizada kalır */
.trend-stack { width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; }
.trend-num {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 11px; font-weight: 600; color: var(--text-mute); line-height: 1;
}
.trend-col.today .trend-num { color: var(--pulse); }
.trend-bar {
  width: min(100%, 46px);
  height: 0;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, rgba(46, 127, 253, .95), rgba(46, 127, 253, .35));
  transition: height .9s var(--ease-out), background .2s;
  min-height: 3px;
}
.trend-col:hover .trend-bar { background: linear-gradient(180deg, var(--signal), var(--pulse)); }
.trend-col.today .trend-bar { background: linear-gradient(180deg, var(--signal), var(--pulse)); box-shadow: 0 0 16px rgba(86, 204, 255, .35); }
.trend-label { font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); }
.trend-col.today .trend-label { color: var(--pulse); }

/* ─── ESKI SAYFALARLA UYUM ───────────────────────────────────
   Ic sayfalar hala Tailwind kart kalibini kullaniyor (bg-white + rounded-*).
   Onlari .panel yuzeyiyle ayni cizgi/golge diline cekiyoruz ki kabuk ile
   icerik ayni urunmus gibi dursun. Sayfa sayfa yeniden yazmaya gerek kalmaz. */

.canvas .bg-white.rounded-2xl,
.canvas .bg-white.rounded-xl,
.canvas .bg-white.rounded-lg {
  border-color: var(--line);
  box-shadow: var(--shadow-1);
}
.canvas table th {
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-mute);
}
.canvas td.u-num, .canvas .tabular { font-variant-numeric: tabular-nums; }

/* ─── SKELETON (HTMX yukleme) ────────────────────────────────── */

.skeleton {
  background: linear-gradient(90deg, var(--surface-sunk) 25%, #F8FBFF 50%, var(--surface-sunk) 75%);
  background-size: 200% 100%;
  animation: skeleton-slide 1.3s linear infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-slide { to { background-position: -200% 0; } }

/* ─── DRAWER ─────────────────────────────────────────────────── */

.drawer-scrim { background: rgba(5, 10, 20, .55); backdrop-filter: blur(3px); }
.drawer-panel {
  background: var(--surface);
  box-shadow: -24px 0 60px -20px rgba(9, 19, 36, .35);
  animation: drawer-slide .32s var(--ease-out) both;
}

/* ─── ANIMASYON ──────────────────────────────────────────────── */

@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes drawer-slide { from { transform: translateX(100%); } to { transform: none; } }
@keyframes mascot-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes logo-glow {
  0%, 100% { filter: drop-shadow(0 0 12px rgba(86, 204, 255, .35)); }
  50%      { filter: drop-shadow(0 0 22px rgba(86, 204, 255, .65)); }
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(14, 159, 110, .55); }
  50%      { box-shadow: 0 0 0 7px rgba(14, 159, 110, 0); }
}

.animate-fade-in { animation: fade-in .45s var(--ease-out) both; }
.mascot-bob { animation: mascot-bob 4.5s ease-in-out infinite; }
.logo-glow  { animation: logo-glow 4s ease-in-out infinite; }
.pulse-dot  { animation: pulse-dot 2.4s ease-in-out infinite; }
.logo-hover { transition: transform .3s var(--ease-spring); }
.logo-hover:hover { transform: scale(1.06) rotate(-3deg); }

.htmx-indicator { opacity: 0; transition: opacity .18s; }
.htmx-request .htmx-indicator { opacity: 1; }

/* ─── SCROLLBAR ──────────────────────────────────────────────── */

.canvas::-webkit-scrollbar, .drawer-body::-webkit-scrollbar { width: 9px; }
.canvas::-webkit-scrollbar-track, .drawer-body::-webkit-scrollbar-track { background: transparent; }
.canvas::-webkit-scrollbar-thumb, .drawer-body::-webkit-scrollbar-thumb {
  background: rgba(9, 19, 36, .14); border-radius: 5px; border: 2px solid transparent; background-clip: padding-box;
}
.canvas::-webkit-scrollbar-thumb:hover { background: rgba(46, 127, 253, .4); background-clip: padding-box; }

.sidebar nav::-webkit-scrollbar { width: 5px; }
.sidebar nav::-webkit-scrollbar-thumb { background: rgba(238, 244, 252, .14); border-radius: 3px; }

/* ─── HAREKET DUYARLILIGI ────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .trend-bar { transition: none; }
}

/* ─── MOBIL ──────────────────────────────────────────────────── */

@media (max-width: 1023px) {
  /* Menü içeriğin üstüne kayar; daraltma davranışı masaüstüne özgüdür. */
  .sidebar {
    position: fixed; inset-block: 0; left: 0; z-index: 40;
    width: var(--rail-w);
    transform: translateX(-100%);
    transition: transform .3s var(--ease-out);
  }
  .sidebar.open { transform: none; }
  .sidebar.collapsed .nav-label,
  .sidebar.collapsed .sidebar-brand-text,
  .sidebar.collapsed .sidebar-section-label,
  .sidebar.collapsed .sidebar-footer-content { display: revert; }
  .sidebar.collapsed .nav-item { justify-content: flex-start; padding-inline: 13px; }
  .nav-tooltip { display: none; }

  .metric-value { font-size: 32px; }
  .panel-head { padding: 15px 17px; }
  .row-item { padding: 12px 17px; gap: 11px; }
  .daybar { height: 38px; }
}
