/* =========================================================================
   KodexCrm tasarım sistemi
   Tüm renkler anlamsal jetonlar üzerinden tanımlanır. Koyu tema yalnızca
   bu jetonları yeniden atar; bileşen kuralları iki temada da aynıdır.
   ========================================================================= */
:root {
  color-scheme: light;

  /* Marka */
  --wine-950: #32050f;
  --wine-900: #460815;
  --wine-800: #5c0d20;
  --wine-700: #74182c;
  --wine-600: #913047;
  --rose-500: #a94456;
  --gold-600: #a87c20;
  --gold-500: #c79b35;
  --gold-400: #d9b95f;
  --cream-100: #f4eee3;

  /* Yüzeyler */
  --canvas: #f2f2f0;
  --surface: #ffffff;
  --surface-2: #f8f7f5;
  --surface-3: #efedea;
  --paper: #fbfaf8;
  --sidebar-from: #32050f;
  --sidebar-to: #4c0b1a;

  /* Metin */
  --ink: #1d1819;
  --ink-2: #5b5455;
  --muted: #7b7475;
  --muted-2: #97908f;
  --on-accent: #ffffff;

  /* Çizgiler */
  --line: #e7e3de;
  --line-strong: #d8d2cb;
  --focus: #74182c;

  /* Durum */
  --success: #268765;
  --warning: #bd7c1c;
  --danger: #b33447;
  --info: #2f6bb0;

  /* Durum arka planları */
  --tint-accent: #f7eef0;
  --tint-danger: #fbeced;
  --tint-warning: #fbf2dc;
  --tint-success: #e9f5f0;
  --tint-neutral: #efedeb;
  --on-tint-danger: #a2263c;
  --on-tint-warning: #8b641d;
  --on-tint-success: #2c6a55;
  --on-tint-neutral: #5f5859;

  /* Yükseklik */
  --shadow-xs: 0 1px 2px rgba(38, 20, 24, .06);
  --shadow-sm: 0 4px 14px rgba(56, 29, 34, .07);
  --shadow-md: 0 14px 36px rgba(56, 29, 34, .12);
  --shadow-lg: 0 26px 60px rgba(38, 20, 24, .18);

  /* Ölçü */
  --radius-xs: 7px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 22px;
  --sidebar-width: 252px;
  --topbar-bg: rgba(251, 250, 248, .9);
  --drawer-head-bg: rgba(255, 255, 255, .95);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

[data-theme="dark"] {
  color-scheme: dark;

  --wine-950: #240610;
  --wine-900: #43101f;
  --wine-800: #8e2138;
  --wine-700: #a53148;
  --wine-600: #bf5069;
  --rose-500: #cf6a7d;
  --gold-600: #d7b358;
  --gold-500: #cfa844;
  --gold-400: #e3c576;
  --cream-100: #2a2e38;

  --canvas: #101318;
  --surface: #191d24;
  --surface-2: #1f242d;
  --surface-3: #262c37;
  --paper: #191d24;
  --sidebar-from: #14171d;
  --sidebar-to: #221019;

  --ink: #e9ebef;
  --ink-2: #c3c8d1;
  --muted: #8d95a3;
  --muted-2: #79818f;
  --on-accent: #ffffff;

  --line: #2a303b;
  --line-strong: #38404e;
  --focus: #cf6a7d;

  --success: #3fbd8d;
  --warning: #dda13a;
  --danger: #e05a72;
  --info: #5b9be0;

  --tint-accent: rgba(207, 106, 125, .14);
  --tint-danger: rgba(224, 90, 114, .15);
  --tint-warning: rgba(221, 161, 58, .15);
  --tint-success: rgba(63, 189, 141, .14);
  --tint-neutral: rgba(255, 255, 255, .06);
  --on-tint-danger: #f0929f;
  --on-tint-warning: #e6b96a;
  --on-tint-success: #6fd6ab;
  --on-tint-neutral: #b3bac6;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, .38);
  --shadow-md: 0 16px 40px rgba(0, 0, 0, .5);
  --shadow-lg: 0 30px 70px rgba(0, 0, 0, .6);
  --topbar-bg: rgba(20, 24, 30, .88);
  --drawer-head-bg: rgba(25, 29, 36, .96);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--canvas); font: 14px/1.5 "Segoe UI", Arial, sans-serif; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 6px; color: var(--gold-600); font-size: 10px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; }
.eyebrow.light { color: var(--gold-400); }

.login-view { min-height: 100vh; display: grid; grid-template-columns: minmax(520px, 1.18fr) minmax(420px, .82fr); background: var(--surface); }
.login-art { position: relative; min-height: 100vh; overflow: hidden; display: grid; place-items: center; padding: 70px; color: var(--on-accent); background: linear-gradient(145deg, var(--wine-950), var(--wine-800)); }
.art-orbit { position: absolute; border-radius: 50%; pointer-events: none; }
.orbit-one { width: 620px; height: 620px; right: -270px; top: -220px; background: #6e182c; }
.orbit-two { width: 410px; height: 410px; right: -180px; bottom: -150px; background: #a33b4e; box-shadow: -100px -100px 0 20px rgba(255,255,255,.04); }
.art-content { position: relative; z-index: 1; width: min(670px, 100%); }
.brand-mark { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 12px 12px 12px 4px; color: var(--on-accent); background: linear-gradient(145deg, var(--gold-400), var(--gold-600)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.brand-mark span { font: 900 23px/1 Georgia, serif; transform: skew(-8deg); }
.brand-mark-large { width: 58px; height: 58px; margin-bottom: 46px; border-radius: 16px 16px 16px 5px; }
.brand-mark-large span { font-size: 32px; }
.art-content h1 { margin: 12px 0 22px; max-width: 650px; font: 700 clamp(42px, 5vw, 68px)/1.08 Georgia, serif; letter-spacing: -.045em; }
.art-copy { max-width: 560px; color: rgba(255,255,255,.72); font-size: 17px; line-height: 1.75; }
.art-metrics { display: flex; gap: 46px; margin-top: 70px; padding-top: 26px; border-top: 1px solid rgba(255,255,255,.13); }
.art-metrics div { display: grid; gap: 3px; }
.art-metrics strong { color: var(--gold-400); font: 700 24px/1.2 Georgia, serif; }
.art-metrics span { color: rgba(255,255,255,.6); font-size: 12px; }
.login-panel { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 28px; padding: 50px; background: var(--paper); }
.login-card { width: min(410px, 100%); }
.mobile-brand { display: none; }
.login-card h2 { margin: 4px 0 6px; font: 700 34px/1.2 Georgia, serif; letter-spacing: -.03em; }
.login-card > .muted { margin: 0 0 34px; }
.field { display: grid; gap: 8px; margin: 18px 0; color: var(--ink-2); font-size: 12px; font-weight: 700; }
.field input, .field select, .field textarea, .filter-control { width: 100%; border: 1px solid var(--line-strong); border-radius: 10px; outline: 0; color: var(--ink); background: var(--surface); transition: .2s border, .2s box-shadow; }
.field input, .field select { height: 46px; padding: 0 14px; }
.field textarea { min-height: 105px; padding: 12px 14px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .filter-control:focus { border-color: var(--gold-500); box-shadow: 0 0 0 3px rgba(199,155,53,.15); }
.password-field { position: relative; }
.password-field input { padding-right: 70px; }
.text-button { border: 0; background: transparent; color: var(--wine-700); font-size: 12px; font-weight: 700; }
.password-field .text-button { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); }
.checkbox-row { display: flex; align-items: center; gap: 9px; margin: 12px 0 20px; color: var(--muted); font-size: 12px; }
.checkbox-row input { accent-color: var(--wine-700); }
.primary-button, .secondary-button, .ghost-button, .danger-button { min-height: 42px; border: 0; border-radius: 10px; padding: 0 17px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-weight: 750; transition: .18s transform, .18s box-shadow, .18s background; }
.primary-button { color: var(--on-accent); background: var(--wine-800); box-shadow: 0 7px 18px rgba(92,13,32,.2); }
.primary-button:hover { background: var(--wine-700); transform: translateY(-1px); }
.primary-button:disabled { opacity: .55; cursor: wait; transform: none; }
.secondary-button { border: 1px solid var(--line-strong); color: var(--wine-800); background: var(--surface); }
.secondary-button:hover { border-color: var(--gold-500); }
.ghost-button { min-height: 36px; color: var(--wine-700); background: var(--surface-2); }
.danger-button { color: var(--on-accent); background: var(--danger); }
.full { width: 100%; }
.form-error { min-height: 20px; margin-top: 10px; color: var(--danger); font-size: 12px; text-align: center; }
.demo-note { margin-top: 22px; padding: 13px 15px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-2); }
.demo-note div { display: grid; }
.demo-note strong { font-size: 12px; }
.demo-note small { color: var(--muted); font-size: 11px; }
.status-dot, .live-pulse { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(38,135,101,.12); }
.login-footer { margin: 0; color: var(--muted-2); font-size: 11px; }

.app-shell { min-height: 100vh; display: block; }
.sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; width: var(--sidebar-width); display: flex; flex-direction: column; color: rgba(255,255,255,.76); background: linear-gradient(180deg, var(--sidebar-from), var(--sidebar-to)); transition: .2s width, .2s transform; }
.sidebar-brand { height: 82px; padding: 0 23px; display: flex; align-items: center; gap: 13px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-brand strong { display: block; color: var(--on-accent); font: 700 19px/1.2 Georgia, serif; }
.sidebar-brand small { display: block; margin-top: 3px; color: var(--gold-400); font-size: 10px; letter-spacing: .08em; }
.main-nav { flex: 1; padding: 22px 13px; overflow-y: auto; }
.nav-label { margin: 0 12px 9px; color: rgba(255,255,255,.32); font-size: 9px; font-weight: 800; letter-spacing: .17em; }
.nav-label.spaced { margin-top: 26px; }
.nav-item { width: 100%; height: 44px; margin: 3px 0; padding: 0 11px; display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 7px; border: 0; border-radius: 10px; color: inherit; background: transparent; text-align: left; font-size: 13px; }
.nav-item:hover { color: var(--on-accent); background: rgba(255,255,255,.07); }
.nav-item.active { color: var(--on-accent); background: rgba(255,255,255,.11); box-shadow: inset 3px 0 var(--gold-400); }
.nav-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--gold-400); background: rgba(255,255,255,.06); font-weight: 800; }
.nav-count { min-width: 24px; height: 20px; padding: 0 6px; display: grid; place-items: center; border-radius: 99px; color: rgba(255,255,255,.7); background: rgba(255,255,255,.09); font-size: 10px; }
.nav-count.alert { color: var(--on-accent); background: var(--rose-500); }
.sidebar-foot { padding: 16px; display: flex; align-items: center; gap: 8px; border-top: 1px solid rgba(255,255,255,.08); }
.system-card { min-width: 0; flex: 1; display: flex; align-items: center; gap: 10px; }
.system-card div { min-width: 0; display: grid; }
.system-card strong { color: rgba(255,255,255,.85); font-size: 10px; }
.system-card small { color: rgba(255,255,255,.38); font-size: 9px; }
.live-pulse { width: 7px; height: 7px; flex-basis: 7px; background: #48c28d; animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(72,194,141,0); } }
.collapse-button { width: 30px; height: 30px; border: 1px solid rgba(255,255,255,.11); border-radius: 8px; color: rgba(255,255,255,.5); background: transparent; }
.sidebar.collapsed { width: 78px; }
.sidebar.collapsed .sidebar-brand > div:last-child, .sidebar.collapsed .nav-item > span:not(.nav-icon), .sidebar.collapsed .nav-label, .sidebar.collapsed .system-card div { display: none; }
.sidebar.collapsed .sidebar-brand { padding: 0 18px; }
.sidebar.collapsed .main-nav { padding-inline: 10px; }
.sidebar.collapsed .nav-item { grid-template-columns: 1fr; justify-items: center; padding: 0; }
.sidebar.collapsed .sidebar-foot { justify-content: center; }
.sidebar.collapsed .system-card { display: none; }
.sidebar.collapsed + .workspace { margin-left: 78px; }

.workspace { min-width: 0; min-height: 100vh; margin-left: var(--sidebar-width); transition: .2s margin; }
.topbar { position: sticky; z-index: 20; top: 0; height: 82px; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); background: var(--topbar-bg); backdrop-filter: blur(16px) saturate(1.4); }
.title-block { display: flex; align-items: center; gap: 12px; }
.title-block h1 { margin: 0; font: 700 25px/1.1 Georgia, serif; letter-spacing: -.025em; }
.title-block .eyebrow { margin-bottom: 4px; }
.topbar-actions { position: relative; display: flex; align-items: center; gap: 10px; }
.global-search { width: min(315px, 25vw); height: 40px; padding: 0 10px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.global-search > span { color: var(--muted); font-size: 19px; }
.global-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; font-size: 12px; }
kbd { padding: 2px 5px; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--muted-2); background: var(--surface-2); font: 9px/1.2 inherit; }
.branch-picker { height: 40px; padding: 0 10px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: var(--surface); font-size: 10px; }
.branch-picker select { max-width: 135px; border: 0; outline: 0; color: var(--ink); background: var(--surface); font-size: 12px; font-weight: 650; }
.icon-button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; display: grid; place-items: center; color: var(--wine-700); background: var(--surface); }
.notification-button { position: relative; }
.notification-dot { position: absolute; right: 8px; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--danger); }
.profile-button { height: 44px; padding: 0 7px 0 5px; display: flex; align-items: center; gap: 8px; border: 0; border-radius: 11px; background: transparent; text-align: left; }
.profile-button:hover { background: var(--surface-2); }
.profile-button > span:first-child { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--on-accent); background: var(--wine-700); font-size: 10px; font-weight: 800; }
.profile-copy { display: grid; }
.profile-copy strong { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.profile-copy small { color: var(--muted); font-size: 9px; }
.profile-menu { position: absolute; right: 0; top: 52px; width: 220px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-md); }
.profile-menu p { margin: 0; padding: 8px; display: grid; }
.profile-menu small { color: var(--muted); }
.profile-menu button { width: 100%; padding: 9px; border: 0; border-radius: 8px; color: var(--danger); background: var(--tint-danger); text-align: left; }
.mobile-only { display: none; }

.page-content { width: 100%; max-width: 1680px; margin: 0 auto; padding: 28px 32px 50px; outline: 0; }
.page-loading { min-height: 55vh; display: grid; place-items: center; align-content: center; gap: 12px; color: var(--muted); }
.loader { width: 30px; height: 30px; border: 3px solid var(--line-strong); border-top-color: var(--wine-700); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.page-hero { margin-bottom: 22px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.page-hero h2 { margin: 0 0 5px; font: 700 24px/1.2 Georgia, serif; letter-spacing: -.025em; }
.page-hero p { margin: 0; color: var(--muted); }
.action-row { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.date-chip { padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: var(--surface); font-size: 11px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { position: relative; min-height: 134px; overflow: hidden; padding: 19px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.metric-card.accent { color: var(--on-accent); border-color: var(--wine-800); background: linear-gradient(140deg, var(--wine-900), var(--wine-700)); }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.metric-label { color: var(--muted); font-size: 11px; font-weight: 650; }
.metric-card.accent .metric-label { color: rgba(255,255,255,.67); }
.metric-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--wine-700); background: var(--cream-100); font-weight: 800; }
.metric-card.accent .metric-icon { color: var(--gold-400); background: rgba(255,255,255,.1); }
.metric-value { margin: 13px 0 3px; font: 700 27px/1 Georgia, serif; }
.metric-foot { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.metric-card.accent .metric-foot { color: rgba(255,255,255,.62); }
.trend-up { color: var(--success); font-weight: 750; }
.trend-warn { color: var(--warning); font-weight: 750; }
.accent .trend-up { color: #8de0bd; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(330px, .85fr); gap: 16px; margin-bottom: 16px; }
.content-grid.equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.panel.flush { padding: 0; overflow: hidden; }
.panel-header { margin-bottom: 17px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel-header h3 { margin: 0 0 3px; font: 700 16px/1.3 Georgia, serif; }
.panel-header p { margin: 0; color: var(--muted); font-size: 10px; }
.panel-header select, .compact-select { height: 32px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--surface); font-size: 10px; }
.chart-area { position: relative; min-height: 260px; }
.bar-chart { height: 240px; display: flex; align-items: stretch; gap: 11px; padding: 13px 5px 0 34px; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to top, transparent 0, transparent 47px, var(--surface-3) 48px); }
.bar-item { min-width: 26px; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 8px; }
.bar-value { width: min(42px, 80%); min-height: 5px; border-radius: 7px 7px 2px 2px; background: linear-gradient(180deg, var(--rose-500), var(--wine-800)); transition: height .5s ease; position: relative; }
.bar-value:hover::after { content: attr(data-label); position: absolute; left: 50%; top: -34px; transform: translateX(-50%); padding: 5px 7px; border-radius: 6px; color: var(--on-accent); background: var(--wine-950); font-size: 9px; white-space: nowrap; }
.bar-item span:last-child { color: var(--muted); font-size: 9px; text-transform: capitalize; }
.donut-wrap { display: grid; grid-template-columns: 178px 1fr; align-items: center; gap: 22px; }
.donut { width: 174px; height: 174px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--wine-700) 0 18%, var(--gold-500) 18% 45%, var(--gold-400) 45% 66%, var(--rose-500) 66% 90%, #9a8e82 90% 100%); }
.donut::after { content: ''; width: 104px; height: 104px; border-radius: 50%; background: var(--surface); }
.donut-center { position: absolute; z-index: 1; text-align: center; }
.donut-shell { position: relative; display: grid; place-items: center; }
.donut-center strong { display: block; font: 700 21px/1.2 Georgia, serif; }
.donut-center span { color: var(--muted); font-size: 9px; }
.legend-list { display: grid; gap: 9px; }
.legend-row { display: grid; grid-template-columns: 9px 1fr auto; align-items: center; gap: 8px; font-size: 10px; }
.legend-swatch { width: 8px; height: 8px; border-radius: 3px; }
.legend-row strong { font-size: 11px; }

.activity-list { display: grid; gap: 4px; }
.activity-item { padding: 10px 5px; display: grid; grid-template-columns: 35px 1fr auto; align-items: center; gap: 10px; border-bottom: 1px solid var(--surface-3); }
.activity-item:last-child { border: 0; }
.activity-kind { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: var(--wine-700); background: var(--tint-accent); font-weight: 800; }
.activity-copy { min-width: 0; }
.activity-copy strong, .activity-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-copy strong { font-size: 11px; }
.activity-copy small { color: var(--muted); font-size: 9px; }
.activity-item time { color: var(--muted-2); font-size: 9px; }

.score-list { display: grid; gap: 13px; }
.score-row { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(100px, 2fr) 38px; align-items: center; gap: 11px; font-size: 10px; }
.score-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-track { height: 7px; overflow: hidden; border-radius: 99px; background: var(--surface-3); }
.score-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold-500), var(--wine-700)); }
.score-value { color: var(--wine-700); font-weight: 800; text-align: right; }

.toolbar { margin-bottom: 14px; padding: 10px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.toolbar-search { min-width: 200px; flex: 1; position: relative; }
.toolbar-search input, .filter-control { height: 38px; padding: 0 12px; font-size: 11px; }
.toolbar select.filter-control { width: auto; min-width: 145px; }
.toolbar-summary { margin-right: auto; color: var(--muted); font-size: 10px; }
.table-shell { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.data-table { width: 100%; border-collapse: collapse; min-width: 920px; }
.data-table th { height: 42px; padding: 0 14px; color: var(--muted-2); background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 9px; letter-spacing: .07em; text-align: left; text-transform: uppercase; }
.data-table td { height: 60px; padding: 8px 14px; border-bottom: 1px solid var(--surface-3); font-size: 11px; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .15s; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr[data-id] { cursor: pointer; }
.cell-main { display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border-radius: 10px; color: var(--on-accent); background: linear-gradient(145deg, var(--wine-600), var(--wine-800)); font-size: 9px; font-weight: 800; }
.cell-copy { min-width: 0; display: grid; }
.cell-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.cell-copy small { color: var(--muted); font-size: 9px; }
.tag, .status-badge, .priority-badge { display: inline-flex; align-items: center; gap: 5px; min-height: 23px; padding: 3px 8px; border-radius: 99px; font-size: 9px; font-weight: 750; white-space: nowrap; }
.tag { color: var(--wine-700); background: var(--tint-accent); }
.status-badge { color: var(--on-tint-success); background: var(--tint-success); }
.status-badge.pending { color: var(--on-tint-warning); background: var(--tint-warning); }
.status-badge.closed { color: var(--on-tint-neutral); background: var(--surface-3); }
.status-badge.danger { color: var(--on-tint-danger); background: var(--tint-danger); }
.priority-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.priority-badge.critical { color: var(--on-tint-danger); background: var(--tint-danger); }
.priority-badge.high { color: var(--on-tint-warning); background: var(--tint-warning); }
.priority-badge.normal { color: var(--on-tint-warning); background: var(--tint-warning); }
.priority-badge.low { color: var(--muted); background: var(--surface-3); }
.money { font-weight: 750; font-variant-numeric: tabular-nums; }
.risk { font-weight: 750; }
.risk.high { color: var(--danger); }
.risk.medium { color: var(--warning); }
.pagination { padding: 14px 4px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10px; }
.pagination-buttons { display: flex; gap: 6px; }
.pagination button { min-width: 32px; height: 30px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); font-size: 10px; }
.pagination button.active { color: var(--on-accent); border-color: var(--wine-700); background: var(--wine-700); }

.branch-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.branch-card { padding: 19px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); transition: .2s transform, .2s box-shadow; cursor: pointer; }
.branch-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.branch-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.branch-symbol { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--wine-700); background: var(--cream-100); font: 700 16px Georgia, serif; }
.branch-card h3 { margin: 14px 0 2px; font: 700 16px Georgia, serif; }
.branch-card p { margin: 0; color: var(--muted); font-size: 10px; }
.branch-stats { margin-top: 16px; padding-top: 14px; display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line); }
.branch-stats div { display: grid; }
.branch-stats div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.branch-stats strong { font: 700 17px Georgia, serif; }
.branch-stats span { color: var(--muted); font-size: 9px; }

.social-layout { display: grid; grid-template-columns: 235px minmax(0, 1fr); min-height: 620px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.channel-sidebar { padding: 18px 12px; border-right: 1px solid var(--line); background: var(--surface-2); }
.channel-sidebar h3 { margin: 0 8px 14px; font: 700 15px Georgia, serif; }
.channel-filter { width: 100%; height: 38px; margin: 3px 0; padding: 0 10px; display: flex; align-items: center; justify-content: space-between; border: 0; border-radius: 9px; color: var(--ink-2); background: transparent; font-size: 10px; text-align: left; }
.channel-filter:hover, .channel-filter.active { color: var(--wine-800); background: var(--tint-accent); }
.social-feed { padding: 17px; }
.social-summary { margin-bottom: 14px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.social-summary div { padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.social-summary strong { display: block; font: 700 18px Georgia, serif; }
.social-summary span { color: var(--muted); font-size: 9px; }
.social-list { display: grid; gap: 10px; }
.social-item { padding: 15px; display: grid; grid-template-columns: 38px 1fr auto; gap: 11px; border: 1px solid var(--line); border-radius: 12px; }
.social-item.negative { border-left: 3px solid var(--danger); }
.social-platform { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--wine-700); background: var(--tint-accent); font-weight: 800; }
.social-body { min-width: 0; }
.social-head { display: flex; align-items: center; gap: 8px; }
.social-head strong { font-size: 11px; }
.social-head time { color: var(--muted); font-size: 9px; }
.social-body p { margin: 7px 0; color: var(--ink-2); font-size: 11px; }
.social-meta { display: flex; gap: 6px; flex-wrap: wrap; }

.campaign-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.campaign-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.campaign-card-head { min-height: 102px; padding: 17px; color: var(--on-accent); background: linear-gradient(135deg, var(--wine-900), var(--wine-600)); }
.campaign-card-head .status-badge { float: right; color: var(--on-accent); background: rgba(255,255,255,.14); }
.campaign-card-head h3 { margin: 23px 0 3px; font: 700 15px Georgia, serif; }
.campaign-card-head p { margin: 0; color: rgba(255,255,255,.65); font-size: 9px; }
.campaign-card-body { padding: 15px 17px 17px; }
.campaign-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.campaign-kpis div { display: grid; padding: 9px; border-radius: 9px; background: var(--surface-2); }
.campaign-kpis strong { font: 700 15px Georgia, serif; }
.campaign-kpis span { color: var(--muted); font-size: 8px; }
.campaign-progress { margin-top: 13px; }
.campaign-progress > div { height: 6px; overflow: hidden; border-radius: 99px; background: var(--surface-3); }
.campaign-progress i { display: block; height: 100%; border-radius: inherit; background: var(--gold-500); }
.campaign-progress p { margin: 6px 0 0; display: flex; justify-content: space-between; color: var(--muted); font-size: 8px; }

.report-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.report-kpi { padding: 15px; display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.report-kpi > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--wine-700); background: var(--cream-100); }
.report-kpi div { display: grid; }
.report-kpi strong { font: 700 17px Georgia, serif; }
.report-kpi small { color: var(--muted); font-size: 9px; }
.line-chart { height: 230px; display: flex; align-items: flex-end; gap: 2px; padding: 15px 8px 26px; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to top, transparent 0, transparent 44px, var(--surface-3) 45px); }
.line-point { position: relative; flex: 1; height: var(--height); min-width: 24px; border-top: 3px solid var(--wine-700); }
.line-point::before { content: ''; position: absolute; top: -6px; left: 50%; width: 9px; height: 9px; transform: translateX(-50%); border: 2px solid var(--surface); border-radius: 50%; background: var(--wine-700); box-shadow: 0 0 0 2px var(--wine-700); }
.line-point span { position: absolute; top: -24px; left: 50%; transform: translateX(-50%); font-size: 9px; font-weight: 750; }
.line-point small { position: absolute; bottom: calc(var(--height) * -1 - 22px); left: 50%; transform: translateX(-50%); color: var(--muted); font-size: 8px; }
.horizontal-bars { display: grid; gap: 11px; }
.horizontal-bar { display: grid; grid-template-columns: 120px 1fr 44px; align-items: center; gap: 10px; }
.horizontal-bar label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.horizontal-bar div { height: 9px; overflow: hidden; border-radius: 99px; background: var(--surface-3); }
.horizontal-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--wine-700), var(--gold-500)); }
.horizontal-bar strong { color: var(--wine-700); font-size: 10px; text-align: right; }

.management-kpis { margin-bottom: 18px; }
.management-table { min-width: 1180px; }
.management-table td { vertical-align: middle; }
.management-table .sentiment-meter { min-width: 150px; }
.inactive-row { opacity: .58; background: var(--surface-2); }
.card-actions { display: flex; align-items: center; gap: 7px; }
.icon-action { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--wine-700); background: var(--surface); font-weight: 800; }
.icon-action:hover { border-color: var(--line-strong); background: var(--tint-accent); }
.branch-stats-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.branch-stats-four div { min-width: 0; padding-right: 8px; }
.branch-stats-four strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.sentiment-meter { margin-top: 12px; }
.sentiment-meter > div { height: 7px; overflow: hidden; display: flex; border-radius: 99px; background: var(--surface-3); }
.sentiment-meter i { display: block; height: 100%; }
.sentiment-meter i.positive { background: var(--success); }
.sentiment-meter i.negative { background: var(--danger); }
.sentiment-meter p { margin: 6px 0 0; display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 8px; }
.sentiment-meter p span { white-space: nowrap; }
.dot { width: 6px; height: 6px; margin-right: 4px; display: inline-block; border-radius: 50%; }
.dot.positive { background: var(--success); }
.dot.negative { background: var(--danger); }
.card-footer-line { margin-top: 12px; padding-top: 10px; display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--surface-3); color: var(--muted); font-size: 9px; }
.card-footer-line strong { color: var(--wine-700); }
.performance-score { min-width: 48px; height: 32px; padding: 0 9px; display: inline-grid; place-items: center; border-radius: 9px; color: var(--wine-700); background: var(--tint-accent); font-weight: 800; }
.performance-score.good { color: var(--success); background: var(--tint-success); }
.product-symbol { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: 10px; color: var(--wine-700); background: var(--cream-100); font: 700 12px Georgia, serif; }
.complaint-count { min-width: 34px; height: 28px; padding: 0 8px; display: inline-grid; place-items: center; border-radius: 8px; color: var(--muted); background: var(--surface-2); font-weight: 800; }
.complaint-count.high { color: var(--danger); background: var(--tint-danger); }
.integration-banner { margin-bottom: 16px; padding: 14px 16px; display: grid; grid-template-columns: 42px minmax(220px, 1fr) auto auto; align-items: center; gap: 13px; border: 1px solid var(--line-strong); border-radius: 13px; background: linear-gradient(90deg, var(--surface-2), var(--surface)); box-shadow: var(--shadow-sm); }
.integration-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; color: var(--on-accent); background: var(--gold-600); font-size: 20px; }
.integration-banner strong { font: 700 14px Georgia, serif; }
.integration-banner p { margin: 2px 0 0; color: var(--muted); font-size: 9px; }
.integration-banner small { color: var(--muted); font-size: 9px; }
.module-tabs { margin-bottom: 16px; padding: 5px; display: inline-flex; gap: 4px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.module-tabs button { min-height: 34px; padding: 0 14px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 700; }
.module-tabs button.active { color: var(--on-accent); background: var(--wine-800); box-shadow: 0 5px 12px rgba(92,13,32,.15); }
.section-heading { margin: 6px 0 14px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.section-heading h3 { margin: 0 0 3px; font: 700 18px Georgia, serif; }
.section-heading p { margin: 0; color: var(--muted); font-size: 10px; }
.channel-management-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.integration-card { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.integration-card.inactive { opacity: .6; }
.integration-card-head { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 10px; }
.channel-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: var(--wine-700); background: var(--tint-accent); font-weight: 800; }
.integration-card h3 { margin: 0; font: 700 14px Georgia, serif; }
.integration-card-head p { margin: 2px 0 0; color: var(--muted); font-size: 8px; }
.integration-meta { margin: 13px 0; display: flex; flex-wrap: wrap; gap: 5px; }
.integration-meta span { padding: 4px 7px; border-radius: 7px; color: var(--ink-2); background: var(--surface-2); font-size: 8px; }
.integration-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.integration-stats div { padding: 9px; display: grid; border-radius: 9px; background: var(--surface-2); }
.integration-stats strong { font: 700 14px Georgia, serif; }
.integration-stats span { color: var(--muted); font-size: 8px; }
.endpoint-hint { min-height: 30px; margin: 11px 0; color: var(--muted); font-size: 9px; overflow-wrap: anywhere; }
.inline-management-form { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.sla-status-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 9px; }
.sla-status { padding: 12px; display: grid; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.sla-status > span, .sla-status small { color: var(--muted); font-size: 8px; }
.sla-status strong { margin: 3px 0; color: var(--warning); font-size: 11px; }
.sla-status.success strong { color: var(--success); }
.sla-status.danger strong { color: var(--danger); }
.feedback-list { margin-top: 12px; }
.feedback-list .compact-item span { white-space: normal; }
.sentiment-score { color: var(--wine-700) !important; font-weight: 800; white-space: nowrap !important; }
.form-help { margin-top: 12px; padding: 12px 14px; display: grid; border-radius: 10px; color: var(--ink-2); background: var(--surface-2); }
.form-help strong { font-size: 10px; }
.form-help span { margin-top: 2px; color: var(--muted); font-size: 9px; }

.empty-state { min-height: 260px; display: grid; place-items: center; align-content: center; gap: 8px; color: var(--muted); text-align: center; }
.empty-state span { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; color: var(--wine-700); background: var(--cream-100); font-size: 20px; }
.empty-state h3 { margin: 7px 0 0; color: var(--ink); font: 700 17px Georgia, serif; }
.empty-state p { margin: 0; font-size: 11px; }

.drawer-overlay, .modal-overlay { position: fixed; z-index: 80; inset: 0; background: rgba(32,16,20,.38); backdrop-filter: blur(2px); }
.detail-drawer { position: fixed; z-index: 90; top: 5vh; left: 50%; width: min(1180px, calc(100vw - 48px)); height: 90vh; overflow-y: auto; border: 1px solid rgba(255,255,255,.7); border-radius: 18px; background: var(--surface); box-shadow: 0 32px 100px rgba(38,16,21,.32); transform: translateX(-50%); animation: window-in .22s ease; }
@keyframes window-in { from { transform: translateX(-50%) translateY(12px) scale(.985); opacity: .45; } }
.drawer-head { position: sticky; z-index: 2; top: 0; padding: 21px 23px; display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); background: var(--drawer-head-bg); backdrop-filter: blur(12px) saturate(1.4); }
.drawer-head h2 { margin: 4px 0 2px; font: 700 21px Georgia, serif; }
.drawer-head p { margin: 0; color: var(--muted); font-size: 10px; }
.drawer-close { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.drawer-body { padding: 22px 23px 35px; }
.drawer-actions { display: flex; align-items: center; gap: 8px; }
.window-grid { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(320px,.8fr); gap: 16px; align-items: start; }
.window-column { min-width: 0; }
.customer-hero { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 15px; }
.customer-hero .hero-tags { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 5px; }
.customer-hero .hero-score { min-width: 120px; padding-left: 16px; border-left: 1px solid rgba(255,255,255,.22); text-align: right; }
.customer-hero .hero-score strong { display: block; font: 700 24px Georgia,serif; }
.customer-hero .hero-score span { color: rgba(255,255,255,.7); font-size: 9px; }
.mini-kpis.five { grid-template-columns: repeat(5,minmax(0,1fr)); }
.analytics-card { padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow-sm); }
.analytics-card + .analytics-card { margin-top: 12px; }
.analytics-head { margin-bottom: 12px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.analytics-head h4 { margin: 0; font: 700 14px Georgia,serif; }
.analytics-head p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.product-affinity { display: grid; gap: 9px; }
.affinity-row { display: grid; grid-template-columns: minmax(130px,1.2fr) minmax(100px,1fr) auto; align-items: center; gap: 10px; }
.affinity-row label { min-width: 0; display: grid; font-size: 10px; }
.affinity-row label small { color: var(--muted); font-size: 8px; }
.affinity-track { height: 7px; overflow: hidden; border-radius: 99px; background: var(--surface-3); }
.affinity-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--gold-500),var(--wine-700)); }
.affinity-row strong { font-size: 10px; white-space: nowrap; }
.micro-chart { min-height: 125px; display: flex; align-items: end; gap: 6px; padding-top: 22px; }
.micro-bar { min-width: 0; flex: 1; display: grid; justify-items: center; align-items: end; gap: 5px; }
.micro-bar i { width: 100%; max-width: 30px; min-height: 4px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg,var(--wine-600),var(--wine-900)); }
.micro-bar span { color: var(--wine-700); font-size: 8px; font-weight: 700; }
.micro-bar small { color: var(--muted); font-size: 7px; }
.address-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.address-card { padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.address-card strong,.address-card span { display: block; }
.address-card strong { font-size: 10px; }
.address-card span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.message-tabs,.settings-tabs,.report-tabs { margin-bottom: 16px; padding: 4px; display: flex; gap: 4px; width: max-content; max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.message-tabs button,.settings-tabs button,.report-tabs button { padding: 9px 14px; border-radius: 8px; color: var(--ink-2); background: transparent; font-size: 10px; font-weight: 700; white-space: nowrap; }
.message-tabs button.active,.settings-tabs button.active,.report-tabs button.active { color: var(--on-accent); background: var(--wine-800); box-shadow: 0 5px 13px rgba(86,14,34,.18); }
.inbox-layout { display: grid; grid-template-columns: minmax(260px,.72fr) minmax(0,1.28fr); gap: 14px; }
.message-list { max-height: 620px; overflow-y: auto; display: grid; gap: 7px; }
.message-item { padding: 12px; display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-align: left; }
.message-item.unread { border-left: 3px solid var(--wine-700); background: var(--tint-danger); }
.message-item strong { font-size: 10px; }
.message-item span,.message-item time { color: var(--muted); font-size: 8px; }
.settings-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.settings-card { padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow:var(--shadow-sm); }
.settings-card-head { display:flex; align-items:flex-start; justify-content:space-between; gap:8px; }
.settings-card h3 { margin:0; font:700 14px Georgia,serif; }
.settings-card p { min-height:30px; color:var(--muted); font-size:9px; }
.settings-meta { display:grid; grid-template-columns:1fr 1fr; gap:7px; }
.settings-meta div { padding:8px; border-radius:8px; background:var(--surface-2); }
.settings-meta span,.settings-meta strong { display:block; }
.settings-meta span { color:var(--muted); font-size:7px; text-transform:uppercase; }
.settings-meta strong { margin-top:2px; font-size:9px; }
.report-filter-bar { margin-bottom:14px; padding:12px; display:grid; grid-template-columns:1fr 1fr 1.4fr auto; gap:9px; border:1px solid var(--line); border-radius:12px; background: var(--surface); }
.report-table td strong { font-size:10px; }
.report-table td small { display:block; color:var(--muted); font-size:8px; }
.geo-rank { display:inline-grid; width:25px; height:25px; place-items:center; border-radius:7px; color:var(--wine-700); background:var(--cream-100); font-weight:800; }
.profile-hero { padding: 17px; display: flex; align-items: center; gap: 13px; border-radius: 14px; color: var(--on-accent); background: linear-gradient(135deg, var(--wine-900), var(--wine-700)); }
.profile-hero .avatar { width: 52px; height: 52px; flex-basis: 52px; color: var(--wine-800); background: var(--gold-400); font-size: 14px; }
.profile-hero h3 { margin: 0 0 3px; font: 700 18px Georgia, serif; }
.profile-hero p { margin: 0; color: rgba(255,255,255,.68); font-size: 10px; }
.mini-kpis { margin: 13px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.mini-kpis div { padding: 12px; display: grid; border: 1px solid var(--line); border-radius: 11px; }
.mini-kpis strong { font: 700 17px Georgia, serif; }
.mini-kpis span { color: var(--muted); font-size: 8px; }
.detail-section { margin-top: 22px; }
.detail-section-head { margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.detail-section h4 { margin: 0; font: 700 14px Georgia, serif; }
.definition-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.definition-grid div { padding: 10px; border-radius: 9px; background: var(--surface-2); }
.definition-grid span { display: block; color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .07em; }
.definition-grid strong { display: block; margin-top: 3px; overflow-wrap: anywhere; font-size: 10px; }
.timeline { position: relative; display: grid; gap: 12px; padding-left: 20px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 7px; bottom: 7px; width: 1px; background: var(--surface-3); }
.timeline-item { position: relative; }
.timeline-item::before { content: ''; position: absolute; left: -19px; top: 5px; width: 9px; height: 9px; border: 2px solid var(--surface); border-radius: 50%; background: var(--gold-500); box-shadow: 0 0 0 1px var(--gold-500); }
.timeline-item strong { display: block; font-size: 10px; }
.timeline-item p { margin: 2px 0; color: var(--ink-2); font-size: 10px; }
.timeline-item time { color: var(--muted); font-size: 8px; }
.compact-list { display: grid; gap: 7px; }
.compact-item { padding: 10px; display: flex; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 9px; }
.compact-item div { min-width: 0; display: grid; }
.compact-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.compact-item span { color: var(--muted); font-size: 8px; }
.compact-item > strong { flex: 0 0 auto; }

.modal-overlay { display: grid; place-items: center; padding: 25px; }
.modal { width: min(620px, 100%); max-height: 92vh; overflow-y: auto; border-radius: var(--radius-lg); background: var(--surface); box-shadow: 0 28px 80px rgba(39,14,20,.3); animation: pop-in .18s ease; }
@keyframes pop-in { from { transform: translateY(8px) scale(.98); opacity: .5; } }
.modal-head { padding: 21px 23px 15px; display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 3px 0 0; font: 700 21px Georgia, serif; }
.modal-body { padding: 19px 23px; }
.modal-actions { padding: 15px 23px 21px; display: flex; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 13px; }
.form-grid .field.full-span { grid-column: 1 / -1; }

.toast-region { position: fixed; z-index: 120; right: 24px; bottom: 24px; display: grid; gap: 8px; }
.toast { min-width: 280px; max-width: 380px; padding: 13px 15px; display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow-md); animation: toast-in .2s ease; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
.toast-mark { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; color: var(--on-accent); background: var(--success); font-weight: 800; }
.toast.error .toast-mark { background: var(--danger); }
.toast div { display: grid; }
.toast strong { font-size: 10px; }
.toast span { color: var(--muted); font-size: 9px; }

@media (max-width: 1220px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .branch-grid, .campaign-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .channel-management-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .global-search { width: 220px; }
  .profile-copy { display: none; }
  .settings-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .mini-kpis.five { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (max-width: 960px) {
  .login-view { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-panel { padding: 28px; }
  .mobile-brand { margin-bottom: 35px; display: flex; align-items: center; gap: 12px; font: 700 20px Georgia, serif; }
  .sidebar { transform: translateX(-100%); box-shadow: 16px 0 40px rgba(34,11,17,.22); }
  .sidebar.mobile-open { transform: translateX(0); }
  .workspace, .sidebar.collapsed + .workspace { margin-left: 0; }
  .mobile-only { display: grid; }
  .topbar { padding: 0 18px; }
  .global-search { display: none; }
  .content-grid, .content-grid.equal { grid-template-columns: 1fr; }
  .report-kpis { grid-template-columns: repeat(2, 1fr); }
  .integration-banner { grid-template-columns: 42px 1fr auto; }
  .integration-banner > small { grid-column: 2 / -1; }
  .window-grid,.inbox-layout { grid-template-columns: 1fr; }
  .report-filter-bar { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  .topbar { height: 72px; }
  .title-block h1 { font-size: 19px; }
  .title-block .eyebrow, .notification-button, .profile-button > span:last-child { display: none; }
  .branch-picker span { display: none; }
  .branch-picker select { max-width: 105px; }
  .page-content { padding: 20px 14px 38px; }
  .page-hero { align-items: flex-start; flex-direction: column; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card { min-height: 120px; padding: 14px; }
  .metric-value { font-size: 21px; }
  .panel { padding: 15px; }
  .donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar select.filter-control { width: 100%; }
  .branch-grid, .campaign-grid { grid-template-columns: 1fr; }
  .channel-management-grid { grid-template-columns: 1fr; }
  .module-tabs { width: 100%; display: grid; grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .integration-banner { grid-template-columns: 42px 1fr; }
  .integration-banner > .status-badge, .integration-banner > small { grid-column: 2; justify-self: start; }
  .inline-management-form { grid-template-columns: 1fr; }
  .sla-status-grid { grid-template-columns: 1fr; }
  .branch-stats-four { grid-template-columns: repeat(2,1fr); gap: 9px; }
  .social-layout { grid-template-columns: 1fr; }
  .channel-sidebar { padding: 10px; display: flex; gap: 5px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .channel-sidebar h3 { display: none; }
  .channel-filter { width: auto; min-width: max-content; }
  .social-item { grid-template-columns: 34px 1fr; }
  .social-item > .ghost-button { grid-column: 2; justify-self: start; }
  .report-kpis { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .field.full-span { grid-column: auto; }
  .definition-grid { grid-template-columns: 1fr; }
  .detail-drawer { top: 8px; width: calc(100vw - 12px); height: calc(100vh - 16px); border-radius: 13px; }
  .drawer-head,.drawer-body { padding-left: 15px; padding-right: 15px; }
  .drawer-head { align-items:flex-start; }
  .drawer-actions { flex-wrap:wrap; justify-content:flex-end; }
  .drawer-actions .ghost-button { display:none; }
  .customer-hero { grid-template-columns:auto 1fr; }
  .customer-hero .hero-score { grid-column:1/-1; padding:10px 0 0; border-top:1px solid rgba(255,255,255,.2); border-left:0; text-align:left; }
  .mini-kpis.five { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .address-grid,.settings-grid { grid-template-columns:1fr; }
  .affinity-row { grid-template-columns:minmax(100px,1fr) minmax(80px,1fr); }
  .affinity-row > strong { grid-column:2; }
  .report-filter-bar { grid-template-columns:1fr; }
  .toast-region { right: 12px; bottom: 12px; left: 12px; }
  .toast { min-width: 0; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* =========================================================================
   Kurumsal rafinasyon — tipografi, odak, tablo ve etkileşim iyileştirmeleri
   ========================================================================= */

html { -webkit-text-size-adjust: 100%; }
body {
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body, .sidebar, .workspace, .table-shell, .panel, .metric-card, .modal, .detail-drawer {
  transition: background-color .22s var(--ease), color .22s var(--ease), border-color .22s var(--ease);
}
::selection { background: color-mix(in srgb, var(--wine-700) 26%, transparent); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* Sayısal hizalama: rakamlar tablolarda ve metriklerde sabit genişlikte olmalı */
table, .metric-card strong, .stat-tile strong, .kpi-value, .confidence-value, .mono-num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* Kaydırma çubukları */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border: 3px solid var(--canvas); border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }

/* Tablo başlığı sabitlensin, satır geçişleri yumuşasın */
.table-shell { position: relative; }
.table-shell thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-2);
  backdrop-filter: saturate(1.2);
}
.table-shell tbody tr { transition: background-color .14s var(--ease); }

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

/* =========================================================================
   Tema anahtarı
   ========================================================================= */

.theme-toggle {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 10px;
  color: var(--wine-700); background: var(--surface);
  font-size: 15px; line-height: 1;
  transition: .18s var(--ease);
}
.theme-toggle:hover { border-color: var(--line-strong); background: var(--surface-2); }
.theme-toggle .icon-dark { display: none; }
[data-theme="dark"] .theme-toggle .icon-dark { display: block; }
[data-theme="dark"] .theme-toggle .icon-light { display: none; }

/* =========================================================================
   Yapay zekâ bileşenleri
   ========================================================================= */

.ai-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 16px; padding: 12px 16px;
  border: 1px solid var(--line); border-left: 3px solid var(--wine-700);
  border-radius: var(--radius-sm);
  background: var(--surface); box-shadow: var(--shadow-xs);
}
.ai-banner.warn { border-left-color: var(--warning); }
.ai-banner.off { border-left-color: var(--muted-2); }
.ai-banner p { margin: 0; color: var(--ink-2); font-size: 12px; }
.ai-banner strong { font-size: 13px; }
.ai-banner .spacer { flex: 1; }

.ai-dot {
  width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%;
  background: var(--success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 22%, transparent);
}
.ai-dot.warn { background: var(--warning); box-shadow: 0 0 0 4px color-mix(in srgb, var(--warning) 22%, transparent); }
.ai-dot.off { background: var(--muted-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--muted-2) 20%, transparent); }

.ai-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--wine-700) 26%, transparent);
  color: var(--wine-700); background: var(--tint-accent);
  font-size: 10px; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
}
.ai-chip::before { content: '✦'; font-size: 9px; opacity: .8; }
.ai-chip.plain::before { content: none; }
.ai-chip.success { color: var(--on-tint-success); background: var(--tint-success); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.ai-chip.warn { color: var(--on-tint-warning); background: var(--tint-warning); border-color: color-mix(in srgb, var(--warning) 30%, transparent); }
.ai-chip.danger { color: var(--on-tint-danger); background: var(--tint-danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.ai-chip.neutral { color: var(--on-tint-neutral); background: var(--tint-neutral); border-color: var(--line-strong); }

.ai-panel {
  margin-top: 16px; padding: 16px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-xs);
}
.ai-panel + .ai-panel { margin-top: 12px; }
.ai-panel-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.ai-panel-head h4 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: -.01em; }
.ai-panel-head .spacer { flex: 1; }
.ai-panel-body { display: grid; gap: 10px; }
.ai-output {
  padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink);
  font-size: 12.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-word;
}
.ai-output.empty { color: var(--muted); font-style: italic; white-space: normal; }
.ai-meta { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 10px; }

.confidence { display: flex; align-items: center; gap: 8px; min-width: 128px; }
.confidence-track { flex: 1; height: 6px; border-radius: 999px; background: var(--line-strong); overflow: hidden; }
.confidence-fill { height: 100%; border-radius: 999px; background: var(--wine-700); }
.confidence-fill.high { background: var(--success); }
.confidence-fill.mid { background: var(--wine-700); }
.confidence-fill.low { background: var(--warning); opacity: .75; }
.confidence-value { color: var(--muted); font-size: 10px; font-weight: 700; min-width: 30px; text-align: right; }

.suggestion-list { display: grid; gap: 10px; }
.suggestion-card {
  padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); box-shadow: var(--shadow-xs);
  transition: .18s var(--ease);
}
.suggestion-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.suggestion-card header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.suggestion-card header .spacer { flex: 1; }
.suggestion-value { margin: 0 0 6px; color: var(--ink); font-size: 13px; font-weight: 650; line-height: 1.5; }
.suggestion-value.long { font-weight: 450; font-size: 12.5px; white-space: pre-wrap; }
.suggestion-why { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.suggestion-actions { display: flex; gap: 7px; margin-top: 11px; }
.mini-button {
  height: 28px; padding: 0 11px; border-radius: 8px;
  border: 1px solid var(--line-strong); color: var(--ink-2); background: var(--surface);
  font-size: 11px; font-weight: 650; transition: .16s var(--ease);
}
.mini-button:hover { border-color: var(--wine-700); color: var(--wine-700); background: var(--tint-accent); }
.mini-button.approve { border-color: color-mix(in srgb, var(--success) 42%, transparent); color: var(--on-tint-success); }
.mini-button.approve:hover { background: var(--tint-success); }
.mini-button.reject { border-color: color-mix(in srgb, var(--danger) 38%, transparent); color: var(--on-tint-danger); }
.mini-button.reject:hover { background: var(--tint-danger); }
.mini-button:disabled { opacity: .5; cursor: not-allowed; }

/* Segmentli sekmeler */
.segmented {
  display: inline-flex; padding: 3px; gap: 2px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2);
}
.segmented button {
  height: 28px; padding: 0 13px; border: 0; border-radius: 8px;
  color: var(--muted); background: transparent;
  font-size: 11px; font-weight: 650; transition: .16s var(--ease);
}
.segmented button:hover { color: var(--ink); }
.segmented button.active { color: var(--on-accent); background: var(--wine-800); box-shadow: var(--shadow-xs); }

/* Boş durum */
.empty-state {
  display: grid; place-items: center; gap: 8px;
  padding: 46px 20px; text-align: center;
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  color: var(--muted); background: var(--surface-2);
}
.empty-state strong { color: var(--ink-2); font-size: 13px; }
.empty-state p { margin: 0; max-width: 420px; font-size: 12px; line-height: 1.7; }

/* İskelet yükleme */
.skeleton {
  border-radius: 8px;
  background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 37%, var(--surface-3) 63%);
  background-size: 400% 100%;
  animation: skeleton 1.3s ease-in-out infinite;
}
@keyframes skeleton { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* İstatistik döşemesi */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-tile {
  padding: 14px 15px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-xs);
}
.stat-tile span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.stat-tile strong { display: block; color: var(--ink); font: 700 24px/1.15 Georgia, serif; letter-spacing: -.02em; }
.stat-tile small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }

/* Bilgi bankası */
.kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.kb-card {
  display: grid; gap: 8px; padding: 15px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-xs);
  transition: .18s var(--ease); cursor: pointer;
}
.kb-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.kb-card h4 { margin: 0; font-size: 13.5px; font-weight: 700; line-height: 1.4; }
.kb-card p { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.65; }
.kb-card footer { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 10px; }

/* Sohbet */
.chat-shell {
  display: grid; grid-template-rows: 1fr auto auto;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden;
}
.chat-log { padding: 18px; display: grid; gap: 12px; align-content: start; overflow-y: auto; min-height: 240px; max-height: 52vh; }
.chat-msg { max-width: 78%; padding: 11px 14px; border-radius: 14px; font-size: 12.5px; line-height: 1.7; white-space: pre-wrap; }
.chat-msg.user { justify-self: end; color: var(--on-accent); background: var(--wine-800); border-bottom-right-radius: 5px; }
.chat-msg.assistant { justify-self: start; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.chat-cite { margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.chat-input { display: flex; gap: 9px; padding: 12px; border-top: 1px solid var(--line); background: var(--surface-2); }
.chat-input textarea {
  flex: 1; min-height: 42px; max-height: 130px; padding: 10px 12px; resize: vertical;
  border: 1px solid var(--line-strong); border-radius: 10px;
  color: var(--ink); background: var(--surface); font-size: 12.5px; outline: 0;
}
.chat-input textarea:focus { border-color: var(--wine-700); box-shadow: 0 0 0 3px color-mix(in srgb, var(--wine-700) 15%, transparent); }
.chat-suggestions { display: flex; gap: 7px; flex-wrap: wrap; padding: 0 12px 12px; background: var(--surface-2); }

/* Risk listeleri */
.risk-list { display: grid; gap: 8px; }
.risk-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 132px 92px; align-items: center; gap: 12px;
  padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); transition: .16s var(--ease);
}
.risk-row:hover { border-color: var(--line-strong); background: var(--surface-2); }
.risk-row .title { display: grid; gap: 3px; min-width: 0; }
.risk-row .title strong { font-size: 12.5px; font-weight: 650; }
.risk-row .title small { color: var(--muted); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.band-badge { padding: 4px 9px; border-radius: 999px; font-size: 10px; font-weight: 750; text-align: center; }
.band-badge.kritik { color: var(--on-tint-danger); background: var(--tint-danger); }
.band-badge.yuksek { color: var(--on-tint-warning); background: var(--tint-warning); }
.band-badge.orta { color: var(--on-tint-neutral); background: var(--tint-neutral); }
.band-badge.dusuk { color: var(--on-tint-success); background: var(--tint-success); }

/* Grafik yüzeyi */
.chart-card {
  padding: 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-xs);
}
.chart-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.chart-head h4 { margin: 0; font-size: 13px; font-weight: 700; }
.chart-head p { margin: 0; color: var(--muted); font-size: 11px; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; margin: 10px 0 0; color: var(--muted); font-size: 10.5px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 11px; height: 3px; border-radius: 2px; background: currentColor; font-style: normal; }
.chart-legend i.dashed { background: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 7px); }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-svg .grid-line { stroke: var(--line); stroke-width: 1; }
.chart-svg .axis-text { fill: var(--muted); font-size: 10px; }
.chart-svg .band { fill: var(--series-1); opacity: .13; }
.chart-svg .line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart-svg .line.forecast { stroke-dasharray: 5 4; }
.chart-svg .dot { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
.chart-svg .bar { fill: var(--series-1); rx: 4; }
.chart-tooltip {
  position: fixed; z-index: 60; pointer-events: none;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); box-shadow: var(--shadow-md);
  color: var(--ink); font-size: 11px; line-height: 1.6; white-space: nowrap;
}

/* Doğrulanmış kategorik dizi renkleri (açık ve koyu tema ayrı ayrı seçilmiştir) */
:root {
  --series-1: #a3324a;
  --series-2: #2f6bb0;
  --series-3: #1f8a70;
  --series-4: #c08419;
  --series-5: #7b57c9;
  --series-other: #8a8f98;
}
[data-theme="dark"] {
  --series-1: #c94a63;
  --series-2: #4787d6;
  --series-3: #199f7d;
  --series-4: #b0821c;
  --series-5: #7c5ccd;
  --series-other: #7f8794;
}

/* Kod / SQL gösterimi */
.code-block {
  padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--ink-2);
  font: 11.5px/1.65 "Cascadia Mono", Consolas, "Courier New", monospace;
  white-space: pre-wrap; word-break: break-word; overflow-x: auto;
}

.callout {
  display: flex; gap: 10px; padding: 11px 13px;
  border: 1px solid var(--line); border-left: 3px solid var(--info);
  border-radius: var(--radius-sm); background: var(--surface-2);
  color: var(--ink-2); font-size: 11.5px; line-height: 1.65;
}
.callout.warn { border-left-color: var(--warning); }
.callout.danger { border-left-color: var(--danger); }

/* Ayarlar formu ızgarası */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.settings-grid .field { display: grid; gap: 5px; }
.settings-grid .field span { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.settings-grid .field small { color: var(--muted-2); font-size: 10.5px; line-height: 1.5; }
.switch-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.switch-row label { flex: 1; font-size: 12px; font-weight: 600; }
.switch-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; font-weight: 400; }

@media (max-width: 900px) {
  .risk-row { grid-template-columns: minmax(0, 1fr) 90px; }
  .risk-row .confidence { display: none; }
  .chat-msg { max-width: 92%; }
}

.profile-menu-link {
  display: block; width: 100%; padding: 9px; margin-bottom: 4px;
  border-radius: 8px; color: var(--wine-700); background: var(--tint-accent);
  font-size: 12px; font-weight: 600; text-decoration: none;
}
.profile-menu-link:hover { background: color-mix(in srgb, var(--wine-700) 14%, transparent); }

/* Sınıflandırma satırları: sağdaki rozet uzun olabilir */
.risk-row.wide { grid-template-columns: minmax(0, 1fr) 132px minmax(96px, 172px); }
.risk-row > .ai-chip, .risk-row > .band-badge {
  justify-self: end; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (max-width: 900px) { .risk-row.wide { grid-template-columns: minmax(0, 1fr) 110px; } }
