/* === FONTS (Faz 6.N — Geist Sans + Geist Mono variable, Vercel premium SaaS vibe) === */
@font-face {
  font-family: 'Geist';
  src: url('/static/fonts/Geist-Variable.woff2') format('woff2-variations'),
       url('/static/fonts/Geist-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  font-feature-settings: 'ss01','tnum','calt';
}
@font-face {
  font-family: 'Geist Mono';
  src: url('/static/fonts/GeistMono-Variable.woff2') format('woff2-variations'),
       url('/static/fonts/GeistMono-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
/* Inter + JetBrains Mono kept as fallback (woff2 still on disk); switch via CSS var */

/* === CSS VARIABLES (LIGHT) === */
:root {
  --bg-0: #fafafa;
  --bg-1: #ffffff;
  --bg-2: #f5f5f5;
  --fg-0: #0a0a0a;
  --fg-1: #525252;
  --fg-2: #a3a3a3;
  --border: #e5e5e5;
  --accent: #0078d4;            /* Faz 6.Q — Microsoft Office 365 Fluent blue */
  --accent-dark: #106ebe;
  --accent-darker: #005a9e;
  --accent-soft: rgba(0, 120, 212, 0.10);
  --accent-glow: rgba(0, 120, 212, 0.18);
  --brand-grad: linear-gradient(135deg, #50b0e8 0%, #0078d4 50%, #005a9e 100%);
  --brand-grad-deep: linear-gradient(135deg, #003e74 0%, #005a9e 50%, #0078d4 100%);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);

  /* === LAYOUT === */
  --sidebar-w: 240px;
  --sidebar-w-collapsed: 56px;
  --topbar-h: 48px;
  --drawer-w: 480px;
  --drawer-w-min: 400px;
  --drawer-w-max: 720px;

  /* === SPACING === */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;

  /* === TYPOGRAPHY === */
  --font-mono: 'Geist Mono', 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  --text-xs: 11px;
  --text-sm: 12px;
  --text-base: 13px;
  --text-md: 14px;
  --text-lg: 16px;
  --text-xl: 18px;
  --text-2xl: 24px;

  /* === Z-INDEX === */
  --z-drawer: 100;
  --z-cmdk: 200;
  --z-modal: 300;
  --z-toast: 400;
}

/* === CSS VARIABLES (DARK) === */
[data-theme="dark"] {
  --bg-0: #0a0a0a;
  --bg-1: #141414;
  --bg-2: #1f1f1f;
  --fg-0: #fafafa;
  --fg-1: #a3a3a3;
  --fg-2: #525252;
  --border: #262626;
  --accent: #2899f5;            /* Faz 6.Q — Office 365 Fluent blue (dark mode) */
  --accent-dark: #0078d4;
  --accent-darker: #106ebe;
  --accent-soft: rgba(40, 153, 245, 0.16);
  --accent-glow: rgba(40, 153, 245, 0.28);
  --brand-grad: linear-gradient(135deg, #50b0e8 0%, #2899f5 50%, #005a9e 100%);
  --brand-grad-deep: linear-gradient(135deg, #003e74 0%, #005a9e 50%, #50b0e8 100%);
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,.5);
}

/* === ACCENT VARIANTS (Faz 6.R — K15 v2.3) ===
   3 Office 365 blue palettes. Default (no [data-accent]) = Fluent (#0078d4).
   Override via JS cycleAccent() → localStorage.mail-admin-accent. */
[data-accent="royal"] {
  --accent: #0050a0;            /* koyu kraliyet mavisi */
  --accent-dark: #003a7a;
  --accent-darker: #002654;
  --accent-soft: rgba(0, 80, 160, 0.10);
  --accent-glow: rgba(0, 80, 160, 0.20);
  --brand-grad: linear-gradient(135deg, #1976d2 0%, #0050a0 50%, #002654 100%);
  --brand-grad-deep: linear-gradient(135deg, #001b3a 0%, #002654 50%, #0050a0 100%);
}
[data-accent="bright"] {
  --accent: #2A8FFB;            /* parlak Microsoft mavi */
  --accent-dark: #1a7ed4;
  --accent-darker: #1565c0;
  --accent-soft: rgba(42, 143, 251, 0.10);
  --accent-glow: rgba(42, 143, 251, 0.22);
  --brand-grad: linear-gradient(135deg, #64b5f6 0%, #2A8FFB 50%, #1565c0 100%);
  --brand-grad-deep: linear-gradient(135deg, #0d47a1 0%, #1565c0 50%, #2A8FFB 100%);
}
[data-theme="dark"][data-accent="royal"] {
  --accent: #4288e0;
  --accent-dark: #1976d2;
  --accent-darker: #0050a0;
  --accent-soft: rgba(66, 136, 224, 0.18);
  --accent-glow: rgba(66, 136, 224, 0.30);
  --brand-grad: linear-gradient(135deg, #4288e0 0%, #1976d2 50%, #0050a0 100%);
  --brand-grad-deep: linear-gradient(135deg, #001b3a 0%, #0050a0 50%, #4288e0 100%);
}
[data-theme="dark"][data-accent="bright"] {
  --accent: #5BA8FC;
  --accent-dark: #2A8FFB;
  --accent-darker: #1565c0;
  --accent-soft: rgba(91, 168, 252, 0.18);
  --accent-glow: rgba(91, 168, 252, 0.30);
  --brand-grad: linear-gradient(135deg, #90caf9 0%, #5BA8FC 50%, #1976d2 100%);
  --brand-grad-deep: linear-gradient(135deg, #0d47a1 0%, #1565c0 50%, #5BA8FC 100%);
}

/* Accent picker button — palette icon, current swatch as background dot */
.accent-toggle-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg-1); color: var(--fg-1);
  cursor: pointer; transition: background .12s, border-color .12s;
  position: relative;
}
.accent-toggle-btn:hover { background: var(--bg-2); color: var(--fg-0); }
.accent-toggle-btn::after {
  content: ""; position: absolute; right: 3px; bottom: 3px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  border: 1.5px solid var(--bg-1);
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Geist', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg-0);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv11','ss01','ss03','calt';
}
/* Numeric tabular alignment for KPI / counters / metrics */
.kpi-value, .ht-value, .td-count, .dhs-bar-segment,
.list-item-meta, .panel-meta, .domain-cell,
input[type=number], .breadcrumb, .badge {
  font-variant-numeric: tabular-nums;
}
/* Headings — tighter tracking for crispness */
h1, h2, h3, h4, .page-title {
  letter-spacing: -0.011em;
  font-weight: 600;
}

/* === LOGIN PAGE (ilk Faz 1 sayfası) === */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
}
.login-title {
  margin: 0 0 24px 0;
  font-size: 24px;
  font-weight: 600;
}
.login-hint {
  color: var(--fg-1);
  font-size: 13px;
  margin: 0 0 16px 0;
}
.login-card label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-1);
  margin: 12px 0 4px 0;
}
.login-card input {
  width: 100%;
  padding: 8px 12px;
  font: inherit;
  background: var(--bg-0);
  color: var(--fg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .15s;
}
.login-card input:focus { border-color: var(--accent); }
.login-card button {
  width: 100%;
  padding: 10px 16px;
  margin-top: 16px;
  font: inherit;
  font-weight: 500;
  color: white;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: opacity .15s;
}
.login-card button:hover { opacity: .9; }
.alert {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 12px;
}
.alert-danger {
  background: rgba(239, 68, 68, .1);
  color: #b91c1c; /* WCAG AA fix: light bg üzerinde 4.5:1+ */
  border: 1px solid rgba(239, 68, 68, .3);
}
[data-theme="dark"] .alert-danger {
  color: var(--danger); /* dark mode #f87171 zaten yeterli */
}

/* === FOCUS (a11y) === */
.login-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,120,212,.25); }
.login-card button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* === ADMIN SHELL LAYOUT === */
.admin-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar main";
  min-height: 100vh;
  transition: grid-template-columns .2s ease;
}
.admin-shell[data-sidebar=collapsed] {
  grid-template-columns: var(--sidebar-w-collapsed) 1fr;
}
.admin-sidebar { grid-area: sidebar; }
.admin-topbar { grid-area: topbar; }
.admin-main {
  grid-area: main;
  padding: var(--space-6);
  overflow-y: auto;
}

/* === PAGE HEADER === */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
}
.page-title {
  font-size: var(--text-2xl);
  font-weight: 600;
  margin: 0;
}
.breadcrumb {
  display: flex;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--fg-1);
}
.breadcrumb a { color: var(--fg-1); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep { color: var(--fg-2); }

/* === SIDEBAR === */
.admin-sidebar {
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  padding: var(--space-4);
  font-weight: 600;
  font-size: var(--text-md);
  border-bottom: 1px solid var(--border);
}
.sidebar-nav { flex: 1; padding: var(--space-2); list-style: none; margin: 0; }
.sidebar-nav li { margin: 0; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  color: var(--fg-1);
  text-decoration: none;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  font-size: var(--text-base);
}
.sidebar-nav a:hover { background: var(--bg-2); color: var(--fg-0); }
.sidebar-nav a[aria-current=page] {
  background: var(--bg-2);
  color: var(--fg-0);
  border-left-color: var(--accent);
}
.sidebar-nav .lucide { width: 16px; height: 16px; flex-shrink: 0; }
.sidebar-footer {
  padding: var(--space-3);
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
}
.admin-shell[data-sidebar=collapsed] .sidebar-nav span,
.admin-shell[data-sidebar=collapsed] .sidebar-brand-text,
.admin-shell[data-sidebar=collapsed] .sidebar-footer-text { display: none; }

/* === TOPBAR === */
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: var(--space-3); }
.cmdk-trigger {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--fg-1);
  cursor: pointer;
  font: inherit;
}
.cmdk-trigger kbd {
  font-family: var(--font-mono);
  background: var(--bg-1);
  padding: 0 4px;
  border-radius: 2px;
}
.last-updated { color: var(--fg-2); font-variant-numeric: tabular-nums; }

/* === EMPTY STATE === */
.empty-state {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  color: var(--fg-1);
}
.empty-state-icon { color: var(--fg-2); margin-bottom: var(--space-3); }
.empty-state-title { font-size: var(--text-xl); margin: 0 0 var(--space-2); color: var(--fg-0); }
.empty-state-desc { font-size: var(--text-base); margin: 0 0 var(--space-4); }
.btn-primary {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  background: var(--accent);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: 500;
}

/* === STAT CARD === */
.stat-card { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4); }
.stat-label { font-size: var(--text-sm); color: var(--fg-1); margin-bottom: var(--space-2); }
.stat-value { font-size: var(--text-2xl); font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-unit { font-size: var(--text-md); color: var(--fg-1); margin-left: 4px; }
.stat-delta { font-size: var(--text-sm); margin-top: var(--space-2); font-variant-numeric: tabular-nums; }
.stat-delta.delta-up { color: var(--success); }
.stat-delta.delta-down { color: var(--danger); }

/* === GAUGE === */
.gauge { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); }
.gauge-label { font-size: var(--text-sm); color: var(--fg-1); }

/* === STATUS BADGE === */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: var(--text-xs); font-weight: 500; line-height: 1.4; margin-right: 4px; }
.badge-success { background: rgba(16,185,129,.12); color: var(--success); }
.badge-warning { background: rgba(245,158,11,.12); color: var(--warning); }
.badge-danger  { background: rgba(239,68,68,.12); color: #b91c1c; }
[data-theme=dark] .badge-danger { color: var(--danger); }
.badge-info    { background: rgba(0,120,212,.12); color: var(--accent); }
.badge-neutral { background: var(--bg-2); color: var(--fg-1); }

/* === TABLE === */
.data-table { width: 100%; border-collapse: collapse; font-size: var(--text-base); }
.data-table th { text-align: left; padding: var(--space-2) var(--space-3); background: var(--bg-2); position: sticky; top: 0; border-bottom: 1px solid var(--border); font-weight: 500; color: var(--fg-1); }
.data-table th[data-sortable] { cursor: pointer; user-select: none; }
.data-table th[data-sortable]:hover { color: var(--fg-0); }
.data-table th[data-sortable]::after { content:  ↕; color: var(--fg-2); font-size: var(--text-xs); }
.data-table th[data-sort-dir=asc]::after { content:  ↑; color: var(--accent); }
.data-table th[data-sort-dir=desc]::after { content:  ↓; color: var(--accent); }
.data-table td { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border); }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: var(--bg-2); }
.table-empty { text-align: center; color: var(--fg-2); padding: var(--space-6); }

/* === DRAWER === */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: var(--z-drawer); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: var(--drawer-w); background: var(--bg-1); border-left: 1px solid var(--border); box-shadow: var(--shadow-md); z-index: var(--z-drawer); display: flex; flex-direction: column; transform: translateX(0); transition: transform .2s ease; }
.drawer[hidden] { display: none; }
.drawer-resize-handle { position: absolute; top: 0; left: -3px; width: 6px; height: 100%; cursor: col-resize; }
.drawer-header { display: flex; justify-content: space-between; align-items: center; padding: var(--space-4); border-bottom: 1px solid var(--border); }
.drawer-title { font-size: var(--text-lg); margin: 0; }
.drawer-close { background: none; border: 0; font-size: 24px; cursor: pointer; color: var(--fg-1); }
.drawer-tabs { display: flex; border-bottom: 1px solid var(--border); }
.drawer-tabs button { flex: 1; padding: var(--space-3); background: none; border: 0; cursor: pointer; color: var(--fg-1); font: inherit; border-bottom: 2px solid transparent; }
.drawer-tabs button[aria-selected=true] { color: var(--fg-0); border-bottom-color: var(--accent); }
.drawer-body { flex: 1; padding: var(--space-4); overflow-y: auto; }

/* === CMDK === */
.cmdk-modal { position: fixed; inset: 0; z-index: var(--z-cmdk); display: flex; align-items: flex-start; justify-content: center; padding-top: 15vh; }
.cmdk-modal[hidden] { display: none; }
.cmdk-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.4); }
.cmdk-panel { position: relative; background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); width: 100%; max-width: 600px; overflow: hidden; }
.cmdk-search { width: 100%; padding: var(--space-3) var(--space-4); font-size: var(--text-md); background: transparent; color: var(--fg-0); border: 0; border-bottom: 1px solid var(--border); outline: none; box-sizing: border-box; }
.cmdk-results { max-height: 60vh; overflow-y: auto; padding: var(--space-2); }
.cmdk-group-header { padding: var(--space-2) var(--space-3); font-size: var(--text-xs); color: var(--fg-2); text-transform: uppercase; letter-spacing: .5px; }
.cmdk-item { display: flex; justify-content: space-between; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); cursor: pointer; }
.cmdk-item[aria-selected=true], .cmdk-item:hover { background: var(--bg-2); }
.cmdk-item[disabled] { opacity: .5; cursor: not-allowed; }
.cmdk-footer { display: flex; gap: var(--space-3); padding: var(--space-2) var(--space-3); background: var(--bg-2); font-size: var(--text-xs); color: var(--fg-1); }
.cmdk-footer kbd { font-family: var(--font-mono); padding: 0 4px; background: var(--bg-1); border-radius: 2px; }

/* === TOAST === */
.toast-stack { position: fixed; top: var(--space-4); right: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); z-index: var(--z-toast); pointer-events: none; }
.toast { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-3); box-shadow: var(--shadow-md); min-width: 280px; pointer-events: auto; cursor: pointer; }
.toast-success { border-left: 3px solid var(--success); }
.toast-error   { border-left: 3px solid var(--danger); }
.toast-info    { border-left: 3px solid var(--accent); }

/* === FILTER BAR === */
.filter-bar { display: flex; gap: var(--space-3); align-items: end; padding: var(--space-3); background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: var(--space-4); flex-wrap: wrap; }
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-group label { font-size: var(--text-xs); color: var(--fg-1); }
.filter-group select, .filter-group input { padding: var(--space-1) var(--space-2); font: inherit; background: var(--bg-0); color: var(--fg-0); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.filter-clear { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: var(--text-sm); padding: var(--space-2); }

/* === SKELETON === */
.skeleton-row { height: 12px; margin: var(--space-2) 0; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--bg-2), var(--bg-1), var(--bg-2)); background-size: 200% 100%; animation: skeleton-shimmer 1.5s infinite; }
@keyframes skeleton-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* === TABS === */
.tabs { display: flex; gap: var(--space-3); border-bottom: 1px solid var(--border); margin-bottom: var(--space-4); }
.tabs button,
.tabs a[role=tab] { background: none; border: 0; padding: var(--space-2) 4px; cursor: pointer; color: var(--fg-1); font: inherit; border-bottom: 2px solid transparent; text-decoration: none; }
.tabs button:hover,
.tabs a[role=tab]:hover { color: var(--fg-0); }
.tabs button[aria-selected=true],
.tabs a[role=tab][aria-selected=true] { color: var(--fg-0); border-bottom-color: #0078d4; }

/* === JSON VIEWER === */
.json-viewer { font-family: var(--font-mono); font-size: var(--text-sm); background: var(--bg-2); padding: var(--space-3); border-radius: var(--radius-md); overflow-x: auto; }

/* === CODE BLOCK === */
.code-block { position: relative; background: var(--bg-2); border-radius: var(--radius-md); padding: var(--space-3); }
.code-block pre { margin: 0; font-family: var(--font-mono); font-size: var(--text-sm); overflow-x: auto; }
.code-copy { position: absolute; top: var(--space-2); right: var(--space-2); background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 2px 8px; font-size: var(--text-xs); cursor: pointer; }

/* === CONFIRM MODAL === */
.confirm-modal { position: fixed; inset: 0; z-index: var(--z-modal); display: flex; align-items: center; justify-content: center; }
.confirm-modal[hidden] { display: none; }
.confirm-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.4); }
.confirm-panel { position: relative; background: var(--bg-1); border-radius: var(--radius-lg); padding: var(--space-6); max-width: 400px; box-shadow: var(--shadow-md); }
.confirm-actions { display: flex; gap: var(--space-2); justify-content: flex-end; margin-top: var(--space-4); }
.btn-danger { background: var(--danger); color: white; border: 0; padding: var(--space-2) var(--space-4); border-radius: var(--radius-md); cursor: pointer; }

/* === SHOWCASE === */
.showcase-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--space-4); }
.showcase-card { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4); }
.showcase-card h3 { margin: 0 0 var(--space-2); font-size: var(--text-md); color: var(--fg-1); }

/* ====================================================================
   FAZ 6 — Exchange-style multi-domain UI (2026-04-30)
   Append-only: extends Faz 1+ design system without overrides.
   ==================================================================== */

/* ---- Sidebar enhancements ---- */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.sidebar-brand-mark {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0078d4 0%, #106ebe 100%);
  color: #fff;
  flex-shrink: 0;
}
.sidebar-brand-version {
  color: var(--fg-2);
  font-weight: 400;
  font-size: var(--text-xs);
  margin-left: 4px;
  letter-spacing: 0.5px;
}
.sidebar-section-label {
  padding: var(--space-3) var(--space-4) var(--space-1);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--fg-2);
}
.admin-shell[data-sidebar=collapsed] .sidebar-section-label { display: none; }

.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.sidebar-footer-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fg-1);
}
.sidebar-footer-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.sidebar-footer .theme-toggle-btn,
.sidebar-footer .logout-btn,
.sidebar-footer .lang-toggle-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--fg-1);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.12s;
  font: inherit;
  font-size: 10px;
  font-weight: 600;
}
.sidebar-footer .theme-toggle-btn:hover,
.sidebar-footer .logout-btn:hover,
.sidebar-footer .lang-toggle-btn:hover {
  background: var(--bg-2);
  color: var(--fg-0);
  border-color: var(--fg-2);
}
/* Brand mark slot — hosts SVG logo */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-brand-mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sidebar-brand-mark svg { display: block; }
.sidebar-brand-text { line-height: 1.1; }
.sidebar-brand-version { opacity: .55; font-weight: 500; margin-left: 2px; }

/* ---- Topbar 3-column with domain selector ---- */
.admin-topbar { gap: var(--space-4); }
.topbar-center {
  flex: 1;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  min-width: 0;
}

.domain-selector { position: relative; }
.domain-selector-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 12px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--fg-0);
  cursor: pointer;
  font-size: var(--text-base);
  font-family: inherit;
  font-weight: 500;
  min-width: 220px;
  max-width: 320px;
  transition: all 0.12s;
}
.domain-selector-trigger:hover {
  border-color: #0078d4;
  background: var(--bg-2);
}
.domain-selector-trigger[aria-expanded=true] {
  border-color: #0078d4;
  box-shadow: 0 0 0 3px rgba(0,120,212,0.12);
}
.domain-selector-label {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.domain-selector-trigger svg:first-child {
  color: #0078d4;
  flex-shrink: 0;
}
.domain-selector-trigger svg:last-child {
  color: var(--fg-2);
  flex-shrink: 0;
}

.domain-selector-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 320px;
  max-height: 420px;
  overflow-y: auto;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 50;
  padding: 4px;
}
.domain-selector-search {
  padding: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.domain-selector-search input {
  width: 100%;
  padding: 7px 10px;
  font-size: var(--text-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-0);
  color: var(--fg-0);
  font-family: inherit;
}
.domain-selector-search input:focus {
  outline: none;
  border-color: #0078d4;
}
.domain-selector-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--text-base);
  font-family: inherit;
  color: var(--fg-0);
  text-align: left;
  border-radius: var(--radius-sm);
  transition: background 0.1s;
}
.domain-selector-option:hover { background: var(--bg-2); }
.domain-selector-option.is-active {
  background: rgba(0,120,212,0.10);
  color: #0078d4;
  font-weight: 500;
}
.domain-selector-option-icon {
  width: 18px;
  text-align: center;
  color: var(--fg-2);
  font-size: 11px;
}
.domain-selector-option.is-active .domain-selector-option-icon { color: #0078d4; }
.domain-selector-option-meta {
  margin-left: auto;
  font-size: var(--text-xs);
  color: var(--fg-2);
}
.domain-selector-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}
.domain-selector-loading,
.domain-selector-empty {
  padding: 14px 10px;
  text-align: center;
  color: var(--fg-2);
  font-size: var(--text-base);
}

/* ---- Domain health matrix table ---- */
.domain-health-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-base);
}
.domain-health-matrix thead th {
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--fg-2);
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}
.domain-health-matrix tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.domain-health-matrix tbody tr:hover td { background: var(--bg-2); }
.domain-health-matrix .domain-cell {
  font-weight: 500;
  color: var(--fg-0);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.health-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 1;
}
.health-pill::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.health-pill.is-ok       { background: rgba(34,197,94,.12);  color: #16a34a; }
.health-pill.is-ok::before       { background: #22c55e; }
.health-pill.is-warn     { background: rgba(234,179,8,.12);  color: #b45309; }
.health-pill.is-warn::before     { background: #eab308; }
.health-pill.is-critical { background: rgba(239,68,68,.12);  color: #dc2626; }
.health-pill.is-critical::before { background: #ef4444; }
.health-pill.is-missing  { background: rgba(148,163,184,.18); color: #64748b; }
.health-pill.is-missing::before  { background: #94a3b8; }

/* Responsive: stack topbar on small screens */
@media (max-width: 900px) {
  .admin-topbar { flex-wrap: wrap; padding: 8px 16px; }
  .topbar-center { order: 3; flex-basis: 100%; padding-top: 8px; }
  .domain-selector-trigger { min-width: 0; width: 100%; }
  .domain-selector-menu { width: 100%; }
}

/* ===========================================================
   Faz 6 — Kompakt 2. Tur (2026-04-30)
   Sayfa scroll'unu azalt: padding/gap/font-size sıkılaştırma.
   ÖNEMLİ: login-card / .modal-dialog / sidebar etkilenmez.
   =========================================================== */
.admin-main {
  padding: 12px 18px 18px;
}
.admin-main .page-header {
  margin-bottom: 10px;
  align-items: flex-end;
}
.admin-main .page-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.admin-main .breadcrumb {
  font-size: 11.5px;
}

/* KPI strip — globally tighter */
.admin-main .kpi-strip {
  gap: 10px;
  margin-bottom: 12px;
}
.admin-main .kpi-card {
  padding: 8px 12px;
}
.admin-main .kpi-card .kpi-label,
.admin-main .kpi-card .ks-label {
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-2);
  margin: 0;
}
.admin-main .kpi-card .kpi-value,
.admin-main .kpi-card .ks-value {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
  font-feature-settings: "tnum";
  margin: 2px 0 0;
}
.admin-main .kpi-card .kpi-sub,
.admin-main .kpi-card .ks-sub {
  font-size: 10.5px;
  color: var(--fg-2);
  margin: 1px 0 0;
}

/* Panel — outer container density */
.admin-main .panel {
  padding: 12px 14px;
  border-radius: 8px;
}
.admin-main .panel + .panel,
.admin-main .panel-stack > * + * {
  margin-top: 10px;
}
.admin-main .panel-header {
  padding: 8px 14px 6px;
  margin: -12px -14px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.admin-main .panel-title {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--fg-1);
  margin: 0;
}
.admin-main .panel-meta {
  font-size: 11px;
  color: var(--fg-2);
}

/* Tables — denser rows */
.admin-main .admin-table th {
  padding: 6px 10px;
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg-2);
  background: var(--bg-2);
}
.admin-main .admin-table td {
  padding: 6px 10px;
  font-size: 12px;
  vertical-align: middle;
}
.admin-main .admin-table tbody tr + tr td {
  border-top: 1px solid var(--border);
}

/* Filter bar — inline compact */
.admin-main .filter-bar,
.admin-main .toolbar {
  padding: 8px 10px;
  gap: 8px;
  border-radius: 8px;
}
.admin-main .filter-bar input,
.admin-main .filter-bar select,
.admin-main .toolbar input,
.admin-main .toolbar select {
  height: 28px;
  font-size: 12px;
  padding: 0 10px;
}

/* Pagination + footers — tighter */
.admin-main .pagination,
.admin-main .table-footer {
  padding: 6px 0 0;
  font-size: 11.5px;
}

/* Per-page-header padding scope */
.admin-shell .admin-main {
  padding-top: 12px;
}
@media (max-width: 900px) {
  .admin-main { padding: 10px 12px 14px; }
  .admin-main .kpi-strip { gap: 8px; }
  .admin-main .kpi-card .kpi-value,
  .admin-main .kpi-card .ks-value { font-size: 18px; }
}

/* ============================================================
   Faz 6.L — Office 365 Style Components (2026-05-01)
   Reusable: .ms-cmdbar, .ms-pivot, .ms-hero, .ms-cmd-btn
   Inspired by Microsoft 365 Defender + Exchange Admin Center
   ============================================================ */

/* --- Command Bar (top action toolbar) --- */
.ms-cmdbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 4px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.ms-cmdbar-left,
.ms-cmdbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.ms-cmdbar-right { gap: 10px; }

.ms-cmd-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--fg-1);
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background .12s, color .12s, border-color .12s;
  white-space: nowrap;
}
.ms-cmd-btn:hover:not([disabled]) {
  background: var(--bg-2);
  color: var(--fg-0);
}
.ms-cmd-btn[disabled] {
  opacity: .4;
  cursor: not-allowed;
}
.ms-cmd-btn.is-primary {
  background: #0078d4;
  color: #fff;
}
.ms-cmd-btn.is-primary:hover:not([disabled]) {
  background: #106ebe;
  color: #fff;
}
.ms-cmd-btn.is-danger { color: #dc2626; }
.ms-cmd-btn.is-danger:hover:not([disabled]) {
  background: rgba(239,68,68,.08);
  color: #b91c1c;
}
.ms-cmd-btn.is-toggled {
  background: rgba(0,120,212,.10);
  color: #0078d4;
  border-color: rgba(0,120,212,.25);
}
.ms-cmd-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.ms-cmd-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 4px;
}
.ms-cmd-meta {
  font-size: 11.5px;
  color: var(--fg-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.ms-cmd-meta b {
  font-weight: 600;
  color: var(--fg-1);
  font-variant-numeric: tabular-nums;
}

/* --- Inline search box in cmdbar --- */
.ms-search {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.ms-search input {
  height: 28px;
  width: 220px;
  padding: 0 10px 0 30px;
  border: 1px solid var(--border);
  background: var(--bg-1);
  color: var(--fg-0);
  border-radius: 4px;
  font: inherit;
  font-size: 12.5px;
  transition: border-color .12s, box-shadow .12s;
}
.ms-search input:focus {
  outline: none;
  border-color: #0078d4;
  box-shadow: 0 0 0 2px rgba(0,120,212,.16);
}
.ms-search svg {
  position: absolute;
  left: 9px;
  width: 14px;
  height: 14px;
  color: var(--fg-2);
  pointer-events: none;
}

/* --- Pivot (segmented tab pill, Microsoft 365 style) --- */
.ms-pivot {
  display: inline-flex;
  gap: 0;
  padding: 0;
  margin: 0 0 10px;
  border-bottom: 1px solid var(--border);
  align-items: stretch;
}
.ms-pivot-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px 9px;
  background: transparent;
  border: none;
  color: var(--fg-2);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .12s, border-color .12s;
}
.ms-pivot-btn:hover { color: var(--fg-0); }
.ms-pivot-btn.is-active {
  color: #0078d4;
  border-bottom-color: #0078d4;
  font-weight: 600;
}
.ms-pivot-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--fg-2);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.ms-pivot-btn.is-active .ms-pivot-badge {
  background: rgba(0,120,212,.14);
  color: #0078d4;
}

/* --- Hero Status Card (big icon + status + action) --- */
.ms-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  margin-bottom: 12px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-left: 4px solid #0078d4;
  border-radius: 10px;
}
.ms-hero.is-clean    { border-left-color: #22c55e; background: linear-gradient(90deg, rgba(34,197,94,.06) 0%, var(--bg-1) 32%); }
.ms-hero.is-warning  { border-left-color: #eab308; background: linear-gradient(90deg, rgba(234,179,8,.07) 0%, var(--bg-1) 32%); }
.ms-hero.is-critical { border-left-color: #ef4444; background: linear-gradient(90deg, rgba(239,68,68,.07) 0%, var(--bg-1) 32%); }

.ms-hero-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(0,120,212,.10);
  color: #0078d4;
}
.ms-hero.is-clean    .ms-hero-icon { background: rgba(34,197,94,.12);  color: #16a34a; }
.ms-hero.is-warning  .ms-hero-icon { background: rgba(234,179,8,.14);  color: #b45309; }
.ms-hero.is-critical .ms-hero-icon { background: rgba(239,68,68,.12);  color: #dc2626; }
.ms-hero-icon svg { width: 24px; height: 24px; }

.ms-hero-body {
  flex: 1 1 auto;
  min-width: 0;
}
.ms-hero-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--fg-0);
  letter-spacing: -.1px;
  margin: 0 0 2px;
}
.ms-hero-sub {
  font-size: 12px;
  color: var(--fg-2);
  line-height: 1.45;
}
.ms-hero-sub b {
  color: var(--fg-1);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.ms-hero-action { flex-shrink: 0; }

/* --- Bulk action sticky bar (selection tray) --- */
.ms-bulkbar {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  margin-bottom: 8px;
  background: rgba(0,120,212,.08);
  border: 1px solid rgba(0,120,212,.25);
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--fg-0);
}
.ms-bulkbar.is-visible { display: flex; }
.ms-bulkbar-count {
  font-weight: 600;
  color: #0078d4;
  font-variant-numeric: tabular-nums;
}
.ms-bulkbar-spacer { flex: 1; }
.ms-bulkbar .ms-cmd-btn { height: 26px; padding: 0 8px; font-size: 12px; }

/* --- Sticky table header & checkbox column --- */
.ms-table-wrap {
  position: relative;
  overflow: auto;
  max-height: calc(100vh - 360px);
  min-height: 240px;
}
.ms-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ms-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-2);
  text-align: left;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--fg-2);
  border-bottom: 1px solid var(--border);
  user-select: none;
}
.ms-table tbody td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.ms-table tbody tr:last-child td { border-bottom: none; }
.ms-table tbody tr.is-selected td { background: rgba(0,120,212,.06); }
.ms-table tbody tr:hover td { background: rgba(0,120,212,.04); }

.ms-check-col {
  width: 36px;
  padding: 0 8px 0 14px !important;
}
.ms-check-col input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
  accent-color: #0078d4;
}

/* --- Empty state (illustration + msg) --- */
.ms-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
  text-align: center;
  color: var(--fg-2);
}
.ms-empty-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--fg-2);
}
.ms-empty-icon svg { width: 28px; height: 28px; }
.ms-empty-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fg-1);
  margin-bottom: 4px;
}
.ms-empty-sub { font-size: 12px; color: var(--fg-2); max-width: 360px; line-height: 1.5; }

/* --- Status pill (reusable) --- */
.ms-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}
.ms-pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
}
.ms-pill.is-ok       { background: rgba(34,197,94,.14); color: #16a34a; }
.ms-pill.is-ok::before       { background: #22c55e; }
.ms-pill.is-warn     { background: rgba(234,179,8,.14); color: #b45309; }
.ms-pill.is-warn::before     { background: #eab308; }
.ms-pill.is-danger   { background: rgba(239,68,68,.14); color: #dc2626; }
.ms-pill.is-danger::before   { background: #ef4444; }
.ms-pill.is-info     { background: rgba(0,120,212,.14); color: #0078d4; }
.ms-pill.is-info::before     { background: #0078d4; }
.ms-pill.is-purple   { background: rgba(139,92,246,.14); color: #7c3aed; }
.ms-pill.is-purple::before   { background: #8b5cf6; }
.ms-pill.is-neutral  { background: rgba(148,163,184,.18); color: #64748b; }
.ms-pill.is-neutral::before  { background: #94a3b8; }

@media (max-width: 900px) {
  .ms-cmdbar { flex-direction: column; align-items: stretch; }
  .ms-cmdbar-right { justify-content: space-between; }
  .ms-search input { width: 100%; }
  .ms-hero { flex-wrap: wrap; }
  .ms-hero-action { width: 100%; }
}

/* ===========================================================
   Faz 6.X — Compact Viewport (2026-05-01) — K22 ANAYASA
   Pattern: html/body height 100% + admin-shell height 100vh +
            admin-main flex column + son scroll-fill child
            ([data-fill] | .ms-table-wrap | .dash-cards | .panel:last-child)
            flex:1 + min-height:0 + overflow:auto.
   Modal/toast/script flex flow'dan çıkar (position:fixed/absolute).
   Login muaf.
   =========================================================== */

html, body { height: 100%; }
body:not(:has(.login-page)) { overflow: hidden; }

.admin-shell {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.admin-main {
  display: flex;
  flex-direction: column;
  padding: 12px 18px 0;
  overflow: hidden;
  min-height: 0;
}

.admin-main > * { flex-shrink: 0; min-width: 0; }

/* Modal/toast/script flex flow'dan çıkarılır */
.admin-main > dialog,
.admin-main > script,
.admin-main > template,
.admin-main > [class$="-toast"],
.admin-main > .toast {
  position: fixed;
  flex: 0 0 0;
  margin: 0;
}
.admin-main > dialog:not([open]) { display: none; }

/* Last fill child: kalan dikey alanı al + iç scroll */
.admin-main > [data-fill],
.admin-main > .ms-table-wrap,
.admin-main > .dash-cards,
.admin-main > .overview-grid,
.admin-main > #overview-grid,
.admin-main > .panel-stack:last-child,
.admin-main > .panel:last-child {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  margin-bottom: 12px;
}

/* Override Faz 6.L'deki magic max-height — flex zaten yapıyor */
.ms-table-wrap {
  max-height: none;
  min-height: 0;
}

/* Sidebar tam yükseklik + iç scroll */
.admin-sidebar {
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

/* Login page sayfa-spesifik scroll açık */
.login-page { min-height: 100vh; height: auto; overflow: auto; }

/* Modal kendi scroll'unu yapar */
dialog.modal-dialog { max-height: 90vh; }
dialog.modal-dialog .modal-body { max-height: calc(90vh - 120px); overflow-y: auto; }
/* Multi-section sayfalar için fallback: admin-main kendisi scroll'lar (deliverability/reports) */
.admin-main[data-scroll-self] {
  display: block;
  overflow-y: auto;
  padding: 12px 18px 18px;
}

/* === Faz Y.1 (2026-05-02) — Mailboxes Office 365 cloud panel revamp === */
.mb-section-flex {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.mb-section-flex > .mb-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  margin-top: 8px;
}
.mb-section-flex > .ms-cmdbar { margin-bottom: 6px; }
.mb-section-flex > .ms-pivot { margin-bottom: 6px; }
.mb-section-flex > .ms-bulkbar { margin-bottom: 6px; }
.mb-table th.sortable { cursor: pointer; user-select: none; }
.mb-table th.sortable:hover { color: var(--accent); }

/* === Faz Y.2 — Mailbox Drawer (K18 pattern) === */
.mb-drawer { position: fixed; inset: 0; z-index: 100; }
.mb-drawer[hidden] { display: none !important; }
.mb-drawer-overlay {
  position: absolute; inset: 0;
  background: rgba(15,23,42,.45);
  animation: mb-fade-in .18s ease-out;
}
.mb-drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 520px; max-width: 96vw;
  background: var(--bg-1);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  box-shadow: -4px 0 20px rgba(0,0,0,.15);
  animation: mb-slide-in .22s cubic-bezier(.2,.8,.2,1);
}
@keyframes mb-fade-in { from {opacity:0;} to {opacity:1;} }
@keyframes mb-slide-in { from {transform:translateX(100%);} to {transform:translateX(0);} }
.mb-drawer-head {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}
.mb-drawer-title-wrap { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mb-drawer-title { font-size: 14px; font-weight: 600; color: var(--fg-0); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-drawer-subtitle { font-size: 11px; color: var(--fg-2); }
.mb-drawer-close {
  background: transparent; border: 0; cursor: pointer;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 4px; color: var(--fg-1);
}
.mb-drawer-close:hover { background: var(--bg-3, rgba(0,0,0,.06)); color: var(--fg-0); }

.mb-drawer-tabs {
  flex: 0 0 auto;
  display: flex; gap: 0;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-1);
  overflow-x: auto;
}
.mb-drawer-tabs button {
  background: transparent; border: 0;
  padding: 9px 12px;
  font-size: 12px; font-weight: 500;
  color: var(--fg-2); cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  font-family: inherit;
}
.mb-drawer-tabs button:hover { color: var(--fg-0); }
.mb-drawer-tabs button.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.mb-drawer-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px;
  min-height: 0;
}
.mb-drawer-section { animation: mb-fade-in .15s ease-out; }
.mb-drawer-section[hidden] { display: none; }
.mb-drawer-section-title {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--fg-2); margin: 0 0 8px 0;
}
.mb-drawer-section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.mb-drawer-section-head .mb-drawer-section-title { margin: 0; }

.mb-drawer-dl {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 4px 12px;
  margin: 0; padding: 0;
  font-size: 12px;
}
.mb-drawer-dl dt { color: var(--fg-2); font-weight: 500; }
.mb-drawer-dl dd { margin: 0; color: var(--fg-0); font-variant-numeric: tabular-nums; }

.mb-drawer-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.mb-drawer-list {
  list-style: none; margin: 0; padding: 0;
  border: 1px solid var(--border); border-radius: 6px;
  overflow: hidden;
}
.mb-drawer-list li {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  background: var(--bg-1);
}
.mb-drawer-list li:last-child { border-bottom: 0; }
.mb-drawer-list li.mb-drawer-list-empty {
  justify-content: center; color: var(--fg-2); font-style: italic;
  padding: 16px;
}
.mb-drawer-list-action {
  background: transparent; border: 0; cursor: pointer;
  color: var(--fg-2); padding: 2px 6px;
  font-size: 11px;
}
.mb-drawer-list-action:hover { color: #dc2626; }

.mb-drawer-meta-row { margin-top: 10px; font-size: 12px; }
.mb-drawer-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer;
  font-size: 12px; color: var(--fg-1);
}
.mb-drawer-toggle input { cursor: pointer; }

.mb-drawer-textarea {
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 4px;
  background: var(--bg-1); color: var(--fg-0);
  font-family: inherit; font-size: 12px;
  resize: vertical; min-height: 100px;
}

.mb-drawer-usage-card {
  padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg-2);
}
.mb-drawer-usage-bar {
  height: 6px; border-radius: 3px;
  background: var(--border);
  overflow: hidden;
}
.mb-drawer-usage-fill {
  height: 100%; background: var(--accent);
  transition: width .3s ease, background .3s ease;
}
.mb-drawer-usage-fill.is-warn { background: #f59e0b; }
.mb-drawer-usage-fill.is-danger { background: #dc2626; }
.mb-drawer-usage-text {
  margin-top: 6px; font-size: 12px;
  color: var(--fg-1); font-variant-numeric: tabular-nums;
}

.mb-drawer-danger-card {
  padding: 12px;
  border: 1px solid #fecaca; border-radius: 6px;
  background: #fef2f2;
  color: #7f1d1d;
}
[data-theme="dark"] .mb-drawer-danger-card {
  border-color: #7f1d1d; background: rgba(127, 29, 29, .12); color: #fca5a5;
}

/* Mailbox row hover indicator (drawer açar) */
.mb-table tbody tr[data-email] { cursor: pointer; }
.mb-table tbody tr[data-email]:hover td { background: rgba(0,120,212,.04); }
