/* OTOMATİK KOPYA — düzenlemeyin. Kaynak: src/styles/apple.css (scripts/sync-ui-css.mjs) */
/*
 * Dispologic — görsel kabuk (Apple İnsan Arayüzü Yönergeleri'nden esinlenen tasarım sistemi)
 *
 * Tek kaynak: renkler, yazı ölçeği, köşe yarıçapları, gölgeler, malzemeler (buzlu cam) ve bileşen sınıfları burada.
 * Görünüm: varsayılan olarak cihaz ayarını izler (prefers-color-scheme); <html data-theme="light|dark"> ile elle seçilir.
 * Bileşenler satır içi stil yerine bu sınıfları ve var(--…) değişkenlerini kullanır; sabit renk yazılmaz.
 * Veri anlamı taşıyan renkler (durak, ülke, sevkiyat, ADR, aşım) --data-* ve --status-* değişkenlerinden okunur.
 *
 * Yazı tipi: Apple cihazlarda sistem yazı tipi (SF Pro). SF Pro'nun web'e gömülmesi lisansla yasak; diğer cihazlarda Inter.
 */

/* ============================================================================================================
   1. DEĞİŞKENLER — açık görünüm
   ============================================================================================================ */
:root {
  color-scheme: light;

  /* yazı */
  --font-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  /* yazı ölçeği (macOS: gövde 13 pt) */
  --fs-large-title: 26px; --lh-large-title: 32px;
  --fs-title1: 22px;      --lh-title1: 28px;
  --fs-title2: 17px;      --lh-title2: 22px;
  --fs-title3: 15px;      --lh-title3: 20px;
  --fs-headline: 13px;    --lh-headline: 16px;
  --fs-body: 13px;        --lh-body: 18px;
  --fs-callout: 12px;     --lh-callout: 16px;
  --fs-subhead: 11px;     --lh-subhead: 14px;
  --fs-footnote: 10px;    --lh-footnote: 13px;

  /* sistem renkleri (light) */
  --blue: #007aff;   --green: #34c759;  --indigo: #5856d6; --orange: #ff9500; --pink: #ff2d55;
  --purple: #af52de; --red: #ff3b30;    --teal: #30b0c7;   --yellow: #ffcc00; --mint: #00c7be;
  --cyan: #32ade6;   --brown: #a2845e;  --gray: #8e8e93;

  --accent: var(--blue);
  --green-fill: #248a3d;        /* beyaz yazılı yeşil düğme (açıkta karşıtlık için koyu) */
  --brand: #0096d6;            /* DispoLogic logosundaki mavi (yalnız logo) */
  --accent-hover: #0068d9;
  --accent-pressed: #0058b8;
  --accent-tint: rgba(0, 122, 255, 0.12);
  --accent-contrast: #ffffff;
  --focus-ring: 0 0 0 3px rgba(0, 122, 255, 0.35);
  --focus-color: rgba(0, 122, 255, 0.5);

  /* etiketler */
  --label: #1d1d1f;
  --label-secondary: rgba(60, 60, 67, 0.72);
  --label-tertiary: rgba(60, 60, 67, 0.45);
  --label-quaternary: rgba(60, 60, 67, 0.22);
  --link: var(--blue);

  /* zeminler */
  --bg-window: #f5f5f7;          /* pencere / sayfa */
  --bg-content: #ffffff;         /* içerik alanı, kart */
  --bg-elevated: #ffffff;        /* açılır pencere, menü */
  --bg-grouped: #f2f2f7;         /* gruplu listelerin zemini */
  --bg-inset: #f5f5f7;           /* kart içindeki alt alan */
  --bg-hover: rgba(0, 0, 0, 0.04);
  --bg-pressed: rgba(0, 0, 0, 0.08);
  --bg-selected: var(--accent-tint);
  --bg-row-alt: rgba(0, 0, 0, 0.022);

  /* dolgular (denetimler) */
  --fill: rgba(120, 120, 128, 0.20);
  --fill-secondary: rgba(120, 120, 128, 0.16);
  --fill-tertiary: rgba(118, 118, 128, 0.12);
  --fill-quaternary: rgba(116, 116, 128, 0.08);
  --control-bg: #ffffff;
  --control-border: rgba(0, 0, 0, 0.14);
  --control-shadow: 0 0.5px 1px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.06);

  /* ayraçlar */
  --separator: rgba(60, 60, 67, 0.18);
  --separator-opaque: #d8d8dc;

  /* malzemeler (buzlu cam) */
  --material-ultrathin: rgba(255, 255, 255, 0.45);
  --material-thin: rgba(250, 250, 252, 0.62);
  --material-regular: rgba(246, 246, 248, 0.78);
  --material-thick: rgba(244, 244, 246, 0.90);
  --material-sidebar: rgba(236, 236, 240, 0.72);
  --material-blur: saturate(180%) blur(24px);

  /* gölgeler */
  --shadow-xs: 0 0.5px 1px rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-sheet: 0 24px 64px rgba(0, 0, 0, 0.22), 0 0 0 0.5px rgba(0, 0, 0, 0.10);

  /* köşe yarıçapları */
  --r-xs: 4px; --r-sm: 6px; --r-md: 8px; --r-lg: 10px; --r-xl: 14px; --r-2xl: 20px; --r-pill: 999px;

  /* aralıklar (4 pt ızgara) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;

  /* ölçüler */
  --toolbar-h: 52px;
  --sidebar-w: 248px;
  --control-h: 28px;
  --control-h-sm: 22px;
  --control-h-lg: 34px;

  /* katman sırası: açılır pencere < kipli pencere < bildirim */
  --z-sticky: 10; --z-toolbar: 20; --z-popover: 100; --z-modal: 1000; --z-toast: 1100;

  /* hareket */
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-spring: cubic-bezier(0.34, 1.36, 0.64, 1);
  --dur-fast: 120ms; --dur: 200ms; --dur-slow: 320ms;

  /* durum renkleri (anlam taşır) */
  --status-success: var(--green);
  --status-warning: var(--orange);
  --status-danger: var(--red);
  --status-info: var(--blue);
  --status-success-tint: rgba(52, 199, 89, 0.14);
  --status-warning-tint: rgba(255, 149, 0, 0.14);
  --status-danger-tint: rgba(255, 59, 48, 0.12);
  --status-info-tint: rgba(0, 122, 255, 0.12);
  --status-success-text: #1e7d36;
  --status-warning-text: #a65c00;
  --status-danger-text: #c4271d;
  --status-info-text: #0058b8;

  /* veri paleti (durak, ülke, sevkiyat renkleri — sırayla) */
  --data-1: #007aff; --data-2: #ff9500; --data-3: #34c759; --data-4: #af52de; --data-5: #ff2d55;
  --data-6: #30b0c7; --data-7: #ffcc00; --data-8: #5856d6; --data-9: #a2845e; --data-10: #00c7be;

  /* 3B sahne */
  --scene-bg: #eef0f4;
  --scene-grid: #c9ced8;
  --scene-grid-sub: #dde1e8;
  --scene-wall: rgba(0, 122, 255, 0.06);
  --scene-edge: #8a94a6;
  --scene-text: #3a3f4b;

  /* eski değişken adları (geçiş dönemi; dönüştürülmemiş satır içi stiller de temaya uysun) */
  --bg-primary: var(--bg-window);
  --bg-card: var(--bg-content);
  --text-main: var(--label);
  --text-muted: var(--label-secondary);
  --accent-blue: var(--blue);
  --accent-red: var(--red);
  --accent-orange: var(--orange);
  --accent-green: var(--green);
  --border-color: var(--separator);
}

/* ============================================================================================================
   2. DEĞİŞKENLER — koyu görünüm (cihaz ayarı ya da data-theme="dark")
   ============================================================================================================ */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --blue: #0a84ff;   --green: #30d158;  --indigo: #5e5ce6; --orange: #ff9f0a; --pink: #ff375f;
    --purple: #bf5af2; --red: #ff453a;    --teal: #40c8e0;   --yellow: #ffd60a; --mint: #63e6e2;
    --cyan: #64d2ff;   --brown: #ac8e68;  --gray: #98989d;
    --accent-hover: #3b9bff; --accent-pressed: #0070e0; --accent-tint: rgba(10, 132, 255, 0.20); --brand: #2ec4ff; --green-fill: #248a3d;
    --focus-ring: 0 0 0 3px rgba(10, 132, 255, 0.45); --focus-color: rgba(10, 132, 255, 0.6);
    --label: #f5f5f7; --label-secondary: rgba(235, 235, 245, 0.66); --label-tertiary: rgba(235, 235, 245, 0.40); --label-quaternary: rgba(235, 235, 245, 0.20);
    --bg-window: #161618; --bg-content: #1f1f22; --bg-elevated: #2a2a2e; --bg-grouped: #111113; --bg-inset: #18181b;
    --bg-hover: rgba(255, 255, 255, 0.06); --bg-pressed: rgba(255, 255, 255, 0.10); --bg-row-alt: rgba(255, 255, 255, 0.025);
    --fill: rgba(120, 120, 128, 0.36); --fill-secondary: rgba(120, 120, 128, 0.32); --fill-tertiary: rgba(118, 118, 128, 0.24); --fill-quaternary: rgba(118, 118, 128, 0.18);
    --control-bg: rgba(255, 255, 255, 0.08); --control-border: rgba(255, 255, 255, 0.12);
    --control-shadow: 0 0.5px 0 rgba(255, 255, 255, 0.06) inset, 0 0 0 0.5px rgba(0, 0, 0, 0.4);
    --separator: rgba(84, 84, 88, 0.60); --separator-opaque: #38383a;
    --material-ultrathin: rgba(40, 40, 44, 0.40); --material-thin: rgba(36, 36, 40, 0.58); --material-regular: rgba(30, 30, 34, 0.74);
    --material-thick: rgba(26, 26, 30, 0.88); --material-sidebar: rgba(34, 34, 38, 0.70);
    --shadow-xs: 0 0.5px 1px rgba(0, 0, 0, 0.4); --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4); --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
    --shadow-sheet: 0 28px 72px rgba(0, 0, 0, 0.6), 0 0 0 0.5px rgba(255, 255, 255, 0.10);
    --status-success-tint: rgba(48, 209, 88, 0.18); --status-warning-tint: rgba(255, 159, 10, 0.18);
    --status-danger-tint: rgba(255, 69, 58, 0.18); --status-info-tint: rgba(10, 132, 255, 0.20);
    --status-success-text: #4ade80; --status-warning-text: #ffb340; --status-danger-text: #ff7369; --status-info-text: #5eb0ff;
    --data-1: #0a84ff; --data-2: #ff9f0a; --data-3: #30d158; --data-4: #bf5af2; --data-5: #ff375f;
    --data-6: #40c8e0; --data-7: #ffd60a; --data-8: #5e5ce6; --data-9: #ac8e68; --data-10: #63e6e2;
    --scene-bg: #121214; --scene-grid: #2c2f36; --scene-grid-sub: #1f2126; --scene-wall: rgba(10, 132, 255, 0.07);
    --scene-edge: #5b6375; --scene-text: #c7cbd4;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --blue: #0a84ff;   --green: #30d158;  --indigo: #5e5ce6; --orange: #ff9f0a; --pink: #ff375f;
  --purple: #bf5af2; --red: #ff453a;    --teal: #40c8e0;   --yellow: #ffd60a; --mint: #63e6e2;
  --cyan: #64d2ff;   --brown: #ac8e68;  --gray: #98989d;
  --accent-hover: #3b9bff; --accent-pressed: #0070e0; --accent-tint: rgba(10, 132, 255, 0.20); --brand: #2ec4ff; --green-fill: #248a3d;
  --focus-ring: 0 0 0 3px rgba(10, 132, 255, 0.45); --focus-color: rgba(10, 132, 255, 0.6);
  --label: #f5f5f7; --label-secondary: rgba(235, 235, 245, 0.66); --label-tertiary: rgba(235, 235, 245, 0.40); --label-quaternary: rgba(235, 235, 245, 0.20);
  --bg-window: #161618; --bg-content: #1f1f22; --bg-elevated: #2a2a2e; --bg-grouped: #111113; --bg-inset: #18181b;
  --bg-hover: rgba(255, 255, 255, 0.06); --bg-pressed: rgba(255, 255, 255, 0.10); --bg-row-alt: rgba(255, 255, 255, 0.025);
  --fill: rgba(120, 120, 128, 0.36); --fill-secondary: rgba(120, 120, 128, 0.32); --fill-tertiary: rgba(118, 118, 128, 0.24); --fill-quaternary: rgba(118, 118, 128, 0.18);
  --control-bg: rgba(255, 255, 255, 0.08); --control-border: rgba(255, 255, 255, 0.12);
  --control-shadow: 0 0.5px 0 rgba(255, 255, 255, 0.06) inset, 0 0 0 0.5px rgba(0, 0, 0, 0.4);
  --separator: rgba(84, 84, 88, 0.60); --separator-opaque: #38383a;
  --material-ultrathin: rgba(40, 40, 44, 0.40); --material-thin: rgba(36, 36, 40, 0.58); --material-regular: rgba(30, 30, 34, 0.74);
  --material-thick: rgba(26, 26, 30, 0.88); --material-sidebar: rgba(34, 34, 38, 0.70);
  --shadow-xs: 0 0.5px 1px rgba(0, 0, 0, 0.4); --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4); --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-sheet: 0 28px 72px rgba(0, 0, 0, 0.6), 0 0 0 0.5px rgba(255, 255, 255, 0.10);
  --status-success-tint: rgba(48, 209, 88, 0.18); --status-warning-tint: rgba(255, 159, 10, 0.18);
  --status-danger-tint: rgba(255, 69, 58, 0.18); --status-info-tint: rgba(10, 132, 255, 0.20);
  --status-success-text: #4ade80; --status-warning-text: #ffb340; --status-danger-text: #ff7369; --status-info-text: #5eb0ff;
  --data-1: #0a84ff; --data-2: #ff9f0a; --data-3: #30d158; --data-4: #bf5af2; --data-5: #ff375f;
  --data-6: #40c8e0; --data-7: #ffd60a; --data-8: #5e5ce6; --data-9: #ac8e68; --data-10: #63e6e2;
  --scene-bg: #121214; --scene-grid: #2c2f36; --scene-grid-sub: #1f2126; --scene-wall: rgba(10, 132, 255, 0.07);
  --scene-edge: #5b6375; --scene-text: #c7cbd4;
}

/* ============================================================================================================
   3. TEMEL
   ============================================================================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0;
  background: var(--bg-window);
  color: var(--label);
  font-family: var(--font-text);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";   /* Inter: SF'ye yakın karakterler */
  height: 100vh;
  overflow: hidden;
}

h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); color: var(--label); }
p { margin: 0; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
::selection { background: var(--accent-tint); }

/* odak halkası: outline ile (bileşenlerin kendi gölgeleri ezemesin); metin alanları kendi halkasını :focus'ta çizer */
:focus-visible { outline: 3px solid var(--focus-color); outline-offset: 1px; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: none; }

/* kaydırma çubukları: ince, macOS gibi kenara yapışmayan */
* { scrollbar-width: thin; scrollbar-color: var(--fill) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--fill); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--label-tertiary); border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-corner { background: transparent; }

.theme-switching, .theme-switching *, .theme-switching *::before, .theme-switching *::after { transition: none !important; }

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

/* ============================================================================================================
   4. YAZI
   ============================================================================================================ */
.t-large-title { font-family: var(--font-display); font-size: var(--fs-large-title); line-height: var(--lh-large-title); font-weight: 700; letter-spacing: -0.022em; }
.t-title1 { font-family: var(--font-display); font-size: var(--fs-title1); line-height: var(--lh-title1); font-weight: 700; letter-spacing: -0.018em; }
.t-title2 { font-family: var(--font-display); font-size: var(--fs-title2); line-height: var(--lh-title2); font-weight: 600; letter-spacing: -0.012em; }
.t-title3 { font-size: var(--fs-title3); line-height: var(--lh-title3); font-weight: 600; letter-spacing: -0.008em; }
.t-headline { font-size: var(--fs-headline); line-height: var(--lh-headline); font-weight: 600; }
.t-body { font-size: var(--fs-body); line-height: var(--lh-body); }
.t-callout { font-size: var(--fs-callout); line-height: var(--lh-callout); }
.t-subhead { font-size: var(--fs-subhead); line-height: var(--lh-subhead); }
.t-footnote { font-size: var(--fs-footnote); line-height: var(--lh-footnote); }
.t-section { font-size: var(--fs-subhead); line-height: var(--lh-subhead); font-weight: 600; color: var(--label-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.t-mono { font-family: var(--font-mono); }
.tabular { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.text-secondary { color: var(--label-secondary); }
.text-tertiary { color: var(--label-tertiary); }
.text-accent { color: var(--accent); }
.text-success { color: var(--status-success-text); }
.text-warning { color: var(--status-warning-text); }
.text-danger { color: var(--status-danger-text); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================================================================
   5. MALZEMELER VE YÜZEYLER
   DİKKAT: backdrop-filter alan öğe (toolbar, sidebar, material*, hud, popover, toast) içindeki position:fixed öğelerin
   kapsayıcısı olur. Kipli pencereyi bunların İÇİNDE çizmeyin; createPortal(…, document.body) kullanın.
   ============================================================================================================ */
.material, .material-regular { background: var(--material-regular); -webkit-backdrop-filter: var(--material-blur); backdrop-filter: var(--material-blur); }
.material-thin { background: var(--material-thin); -webkit-backdrop-filter: var(--material-blur); backdrop-filter: var(--material-blur); }
.material-thick { background: var(--material-thick); -webkit-backdrop-filter: var(--material-blur); backdrop-filter: var(--material-blur); }
.material-ultrathin { background: var(--material-ultrathin); -webkit-backdrop-filter: var(--material-blur); backdrop-filter: var(--material-blur); }

.card {
  background: var(--bg-content);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  border: 0.5px solid var(--separator);
}
.card-pad { padding: var(--sp-4); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-bottom: 0.5px solid var(--separator); }
.card-body { padding: var(--sp-4); }
.card-interactive { transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease); cursor: pointer; }
.card-interactive:hover { box-shadow: var(--shadow-md); }
.card-interactive:active { transform: scale(0.995); }

.inset { background: var(--bg-inset); border-radius: var(--r-lg); }
.grouped { background: var(--bg-grouped); }
.divider { height: 0.5px; background: var(--separator); border: 0; margin: 0; }
.divider-v { width: 0.5px; align-self: stretch; background: var(--separator); }

/* ============================================================================================================
   6. PENCERE İSKELETİ: araç çubuğu, kenar çubuğu, içerik, denetçi paneli
   ============================================================================================================ */
.app-window { display: flex; flex-direction: column; height: 100vh; overflow: hidden; background: var(--bg-window); }
.app-body { flex: 1; min-height: 0; display: flex; overflow: hidden; }

.toolbar {
  position: relative; z-index: var(--z-toolbar);
  display: flex; align-items: center; gap: var(--sp-3);
  min-height: var(--toolbar-h); padding: 0 var(--sp-4);
  background: var(--material-regular);
  -webkit-backdrop-filter: var(--material-blur); backdrop-filter: var(--material-blur);
  border-bottom: 0.5px solid var(--separator);
}
.toolbar-title { font-size: var(--fs-title3); font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.toolbar-subtitle { font-size: var(--fs-subhead); color: var(--label-secondary); white-space: nowrap; }
.toolbar-spacer { flex: 1; }
.toolbar-group { display: flex; align-items: center; gap: var(--sp-2); }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; overflow-y: auto;
  background: var(--material-sidebar);
  -webkit-backdrop-filter: var(--material-blur); backdrop-filter: var(--material-blur);
  border-right: 0.5px solid var(--separator);
  padding: var(--sp-2) var(--sp-2) var(--sp-4);
}
.sidebar-section { padding: var(--sp-3) var(--sp-2) var(--sp-1); font-size: var(--fs-subhead); font-weight: 600; color: var(--label-tertiary); }
.sidebar-item {
  display: flex; align-items: center; gap: var(--sp-2);
  width: 100%; min-height: 28px; padding: 4px var(--sp-2);
  border: 0; border-radius: var(--r-sm); background: transparent;
  color: var(--label); text-align: left; cursor: pointer;
  font-size: var(--fs-body);
  transition: background var(--dur-fast) var(--ease);
}
.sidebar-item:hover { background: var(--bg-hover); }
.sidebar-item.is-selected, .sidebar-item[aria-current="page"], .sidebar-item[aria-selected="true"] { background: var(--accent); color: var(--accent-contrast); }
.sidebar-item.is-selected .text-secondary, .sidebar-item[aria-current="page"] .text-secondary { color: rgba(255, 255, 255, 0.78); }
.sidebar-item-count { margin-left: auto; font-size: var(--fs-subhead); color: var(--label-secondary); font-variant-numeric: tabular-nums; }
.sidebar-item.is-selected .sidebar-item-count { color: rgba(255, 255, 255, 0.85); }

.content { flex: 1; min-width: 0; overflow-y: auto; padding: var(--sp-6); }
.content-narrow { max-width: 1120px; margin: 0 auto; }

.inspector {
  width: 320px; flex-shrink: 0; overflow-y: auto;
  background: var(--bg-content);
  border-left: 0.5px solid var(--separator);
}

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-5); }
.page-title { font-family: var(--font-display); font-size: var(--fs-large-title); line-height: var(--lh-large-title); font-weight: 700; letter-spacing: -0.022em; }
.page-subtitle { margin-top: 2px; font-size: var(--fs-body); color: var(--label-secondary); }

/* ============================================================================================================
   7. DÜĞMELER
   ============================================================================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--control-h); padding: 0 12px;
  border-radius: var(--r-sm); border: 0;
  background: var(--control-bg); color: var(--label);
  box-shadow: var(--control-shadow);
  font-size: var(--fs-body); font-weight: 500; line-height: 1; white-space: nowrap;
  cursor: pointer; user-select: none;
  transition: background var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.btn:hover { background: color-mix(in srgb, var(--control-bg), var(--label) 5%); }
.btn:active { transform: scale(0.98); background: color-mix(in srgb, var(--control-bg), var(--label) 10%); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.4; cursor: default; pointer-events: none; }

.btn-primary { background: var(--accent); color: var(--accent-contrast); box-shadow: 0 0.5px 1px rgba(0, 0, 0, 0.18); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { background: var(--accent-pressed); }

.btn-tinted { background: var(--accent-tint); color: var(--accent); box-shadow: none; }
.btn-tinted:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }

.btn-plain { background: transparent; box-shadow: none; color: var(--accent); }
.btn-plain:hover { background: var(--bg-hover); }

.btn-ghost { background: transparent; box-shadow: none; color: var(--label); }
.btn-ghost:hover { background: var(--bg-hover); }

.btn-danger { background: var(--red); color: #fff; box-shadow: 0 0.5px 1px rgba(0, 0, 0, 0.18); }
.btn-danger:hover { background: color-mix(in srgb, var(--red), #000 10%); }
.btn-danger-plain { background: transparent; box-shadow: none; color: var(--red); }
.btn-danger-plain:hover { background: var(--status-danger-tint); }

.btn-success { background: var(--green-fill); color: #fff; box-shadow: 0 0.5px 1px rgba(0, 0, 0, 0.18); }
.btn-success:hover { background: color-mix(in srgb, var(--green-fill), #000 10%); }

.btn-sm { height: var(--control-h-sm); padding: 0 8px; font-size: var(--fs-callout); border-radius: 5px; }
.btn-lg { height: var(--control-h-lg); padding: 0 16px; font-size: var(--fs-title3); border-radius: var(--r-md); }
.btn-block { width: 100%; }
.btn-pill { border-radius: var(--r-pill); }
.btn-icon { width: var(--control-h); padding: 0; }
.btn-icon.btn-sm { width: var(--control-h-sm); }

/* ============================================================================================================
   8. BÖLÜMLÜ DENETİM (segmented control) ve SEKMELER
   ============================================================================================================ */
.segmented {
  display: inline-flex; align-items: stretch; gap: 2px;
  padding: 2px; border-radius: 8px;
  background: var(--fill-tertiary);
}
.segmented > button, .segmented > a {
  border: 0; background: transparent; color: var(--label);
  height: calc(var(--control-h) - 4px); padding: 0 12px; border-radius: 6px;
  font-size: var(--fs-body); font-weight: 500; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.segmented > button:hover, .segmented > a:hover { background: var(--bg-hover); text-decoration: none; }
.segmented > .is-active, .segmented > [aria-pressed="true"], .segmented > [aria-selected="true"] {
  background: var(--bg-elevated); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
}
.segmented-sm > button, .segmented-sm > a { height: calc(var(--control-h-sm) - 2px); padding: 0 8px; font-size: var(--fs-callout); }

.tabs { display: flex; gap: var(--sp-5); border-bottom: 0.5px solid var(--separator); }
.tab { position: relative; padding: var(--sp-2) 0; border: 0; background: none; cursor: pointer; color: var(--label-secondary); font-weight: 500; }
.tab:hover { color: var(--label); }
.tab.is-active, .tab[aria-selected="true"] { color: var(--label); }
.tab.is-active::after, .tab[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -0.5px; height: 2px; border-radius: 2px; background: var(--accent); }

/* ============================================================================================================
   9. FORM DENETİMLERİ
   ============================================================================================================ */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: var(--fs-callout); font-weight: 500; color: var(--label-secondary); }
.field-hint { font-size: var(--fs-subhead); color: var(--label-tertiary); }
.field-row { display: grid; grid-template-columns: 160px 1fr; align-items: center; gap: var(--sp-3); }

.input, .select, .textarea {
  width: 100%; min-height: var(--control-h);
  padding: 4px 10px;
  background: var(--control-bg); color: var(--label);
  border: 0.5px solid var(--control-border); border-radius: var(--r-sm);
  box-shadow: inset 0 0.5px 1px rgba(0, 0, 0, 0.06);
  font-size: var(--fs-body); line-height: 18px;
  transition: box-shadow var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
  outline: none;
}
.input::placeholder, .textarea::placeholder { color: var(--label-tertiary); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: var(--focus-ring); }
.input:disabled, .select:disabled, .textarea:disabled { opacity: 0.5; cursor: not-allowed; }
.input.is-invalid, .select.is-invalid { border-color: var(--red); box-shadow: 0 0 0 3px var(--status-danger-tint); }
.input-sm, .select-sm { min-height: var(--control-h-sm); padding: 2px 8px; font-size: var(--fs-callout); }
.textarea { min-height: 72px; resize: vertical; padding: 6px 10px; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 28px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='14' viewBox='0 0 10 14'%3E%3Cpath d='M1.5 5L5 1.5 8.5 5M1.5 9L5 12.5 8.5 9' fill='none' stroke='%238e8e93' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
.search {
  padding-left: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Ccircle cx='6' cy='6' r='4.5' fill='none' stroke='%238e8e93' stroke-width='1.5'/%3E%3Cpath d='M9.5 9.5L13 13' stroke='%238e8e93' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 9px center;
  background-color: var(--fill-tertiary); border-color: transparent; box-shadow: none; border-radius: var(--r-md);
}

input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; }

/* anahtar (toggle) — <input type="checkbox" class="switch"> */
.switch {
  appearance: none; -webkit-appearance: none; position: relative; flex-shrink: 0;
  width: 38px !important; height: 22px !important; border-radius: 999px; margin: 0;
  background: var(--fill); cursor: pointer; transition: background var(--dur) var(--ease);
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
  transition: transform var(--dur) var(--ease-spring);
}
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(16px); }
.switch:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================================================================================================
   10. ROZETLER, ETİKETLER, GÖSTERGELER
   ============================================================================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 18px; padding: 0 7px; border-radius: var(--r-pill);
  font-size: var(--fs-subhead); font-weight: 600; line-height: 1; white-space: nowrap;
  background: var(--fill-tertiary); color: var(--label-secondary);
}
.badge-accent, .badge-info { background: var(--status-info-tint); color: var(--status-info-text); }
.badge-success { background: var(--status-success-tint); color: var(--status-success-text); }
.badge-warning { background: var(--status-warning-tint); color: var(--status-warning-text); }
.badge-danger { background: var(--status-danger-tint); color: var(--status-danger-text); }
.badge-solid { background: var(--accent); color: #fff; }
.badge-lg { height: 22px; padding: 0 9px; font-size: var(--fs-callout); }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gray); flex-shrink: 0; }
.dot-success { background: var(--green); } .dot-warning { background: var(--orange); } .dot-danger { background: var(--red); } .dot-info { background: var(--blue); }

.kbd { display: inline-flex; align-items: center; padding: 1px 5px; border-radius: 4px; font-size: var(--fs-subhead); font-family: var(--font-text); color: var(--label-secondary); background: var(--fill-quaternary); border: 0.5px solid var(--separator); }

/* ilerleme / doluluk çubuğu — genişlik satır içi (veri) verilir */
.progress { position: relative; height: 6px; border-radius: 999px; background: var(--fill-tertiary); overflow: hidden; }
.progress > span, .progress-bar { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--accent); transition: width var(--dur-slow) var(--ease); }
.progress-success > span { background: var(--green); } .progress-warning > span { background: var(--orange); } .progress-danger > span { background: var(--red); }

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--fill); border-top-color: var(--label-secondary);
  animation: spin 0.8s linear infinite;
}
.spinner-lg { width: 32px; height: 32px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================================================================
   11. LİSTELER VE TABLOLAR
   ============================================================================================================ */
.list { background: var(--bg-content); border-radius: var(--r-lg); border: 0.5px solid var(--separator); overflow: hidden; }
.list-row {
  display: flex; align-items: center; gap: var(--sp-3);
  min-height: 36px; padding: 6px var(--sp-3);
  border-bottom: 0.5px solid var(--separator);
  transition: background var(--dur-fast) var(--ease);
}
.list-row:last-child { border-bottom: 0; }
.list-row-interactive { cursor: pointer; }
.list-row-interactive:hover { background: var(--bg-hover); }
.list-row.is-selected { background: var(--bg-selected); }

.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-body); }
.table th {
  position: sticky; top: 0; z-index: 1;
  padding: 6px 10px; text-align: left; white-space: nowrap;
  font-size: var(--fs-subhead); font-weight: 600; color: var(--label-secondary);
  background: var(--material-thick); -webkit-backdrop-filter: var(--material-blur); backdrop-filter: var(--material-blur);
  border-bottom: 0.5px solid var(--separator);
}
.table td { padding: 6px 10px; border-bottom: 0.5px solid var(--separator); vertical-align: middle; }
.table tbody tr:nth-child(even) td { background: var(--bg-row-alt); }
.table tbody tr:hover td { background: var(--bg-hover); }
.table tbody tr.is-selected td { background: var(--bg-selected); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow: auto; border-radius: var(--r-lg); border: 0.5px solid var(--separator); background: var(--bg-content); }

/* ============================================================================================================
   12. İSTATİSTİK KUTUCUKLARI, BOŞ DURUM
   ============================================================================================================ */
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-label { font-size: var(--fs-subhead); font-weight: 500; color: var(--label-secondary); }
.stat-value { font-family: var(--font-display); font-size: var(--fs-title1); line-height: var(--lh-title1); font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-unit { font-size: var(--fs-callout); font-weight: 500; color: var(--label-secondary); margin-left: 3px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--sp-3); }

.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-2); padding: var(--sp-10) var(--sp-6); text-align: center; color: var(--label-secondary); }
.empty-state-icon { font-size: 40px; line-height: 1; opacity: 0.5; }
.empty-state-title { font-size: var(--fs-title3); font-weight: 600; color: var(--label); }

.dropzone { border: 1.5px dashed var(--separator-opaque); border-radius: var(--r-xl); background: var(--bg-inset); transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease); }
.dropzone.is-over, .dropzone:hover { border-color: var(--accent); background: var(--accent-tint); }

/* ============================================================================================================
   13. KATMANLAR: kipli pencere (sheet), açılır pencere, bildirim, ipucu
   ============================================================================================================ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: flex; align-items: center; justify-content: center; padding: var(--sp-6);
  background: rgba(0, 0, 0, 0.28);
  animation: fade-in var(--dur) var(--ease);
}
.sheet {
  position: relative; display: flex; flex-direction: column;
  width: min(560px, 100%); max-height: calc(100vh - 48px);
  background: var(--bg-elevated); color: var(--label);
  border-radius: var(--r-2xl); box-shadow: var(--shadow-sheet);
  overflow: hidden;
  animation: sheet-in var(--dur-slow) var(--ease-spring);
}
.sheet-lg { width: min(880px, 100%); }
.sheet-xl { width: min(1180px, 100%); }
.sheet-header { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5) var(--sp-3); }
.sheet-title { font-size: var(--fs-title2); line-height: var(--lh-title2); font-weight: 600; letter-spacing: -0.01em; }
.sheet-body { padding: 0 var(--sp-5) var(--sp-4); overflow-y: auto; }
.sheet-footer { display: flex; justify-content: flex-end; gap: var(--sp-2); padding: var(--sp-3) var(--sp-5); border-top: 0.5px solid var(--separator); background: var(--bg-elevated); }

.popover { z-index: var(--z-popover); background: var(--material-thick); -webkit-backdrop-filter: var(--material-blur); backdrop-filter: var(--material-blur); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); border: 0.5px solid var(--separator); padding: var(--sp-1); }
.menu-item { display: flex; align-items: center; gap: var(--sp-2); width: 100%; min-height: 24px; padding: 3px var(--sp-2); border: 0; border-radius: 5px; background: none; color: var(--label); text-align: left; cursor: pointer; }
.menu-item:hover { background: var(--accent); color: #fff; }

.toast {
  z-index: var(--z-toast);
  display: flex; align-items: center; gap: var(--sp-2);
  padding: 10px 14px; border-radius: var(--r-xl);
  background: var(--material-thick); -webkit-backdrop-filter: var(--material-blur); backdrop-filter: var(--material-blur);
  box-shadow: var(--shadow-lg); border: 0.5px solid var(--separator);
  font-weight: 500; animation: toast-in var(--dur-slow) var(--ease-spring);
}
.toast-danger { color: var(--status-danger-text); }
.toast-warning { color: var(--status-warning-text); }
.toast-success { color: var(--status-success-text); }

.callout { display: flex; gap: var(--sp-2); padding: var(--sp-3); border-radius: var(--r-lg); background: var(--fill-quaternary); font-size: var(--fs-callout); }
.callout-info { background: var(--status-info-tint); color: var(--status-info-text); }
.callout-success { background: var(--status-success-tint); color: var(--status-success-text); }
.callout-warning { background: var(--status-warning-tint); color: var(--status-warning-text); }
.callout-danger { background: var(--status-danger-tint); color: var(--status-danger-text); }

.tooltip { padding: 4px 8px; border-radius: var(--r-sm); background: var(--material-thick); -webkit-backdrop-filter: var(--material-blur); backdrop-filter: var(--material-blur); box-shadow: var(--shadow-md); font-size: var(--fs-callout); color: var(--label); border: 0.5px solid var(--separator); }

/* 3B görünüm üstündeki bilgi panelleri (HUD) */
.hud { background: var(--material-regular); -webkit-backdrop-filter: var(--material-blur); backdrop-filter: var(--material-blur); border: 0.5px solid var(--separator); border-radius: var(--r-xl); box-shadow: var(--shadow-md); color: var(--label); }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ============================================================================================================
   14. YARDIMCILAR
   ============================================================================================================ */
.row { display: flex; align-items: center; gap: var(--sp-2); }
.col { display: flex; flex-direction: column; gap: var(--sp-2); }
.gap-1 { gap: var(--sp-1); } .gap-2 { gap: var(--sp-2); } .gap-3 { gap: var(--sp-3); } .gap-4 { gap: var(--sp-4); } .gap-6 { gap: var(--sp-6); }
.grow { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.center { align-items: center; justify-content: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.no-select { user-select: none; }
