/* Ozvia Admin Panel — Modern dashboard UI (Linear/Vercel vibe) */
:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f1f4f8;
  --surface-3: #e9edf3;
  --border: #e4e8ee;
  --border-strong: #d0d6de;
  --text: #111827;
  --text-muted: #6b7280;
  --text-dim: #9ca3af;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --success: #10b981;
  --success-soft: rgba(16,185,129,.1);
  --warning: #f59e0b;
  --warning-soft: rgba(245,158,11,.1);
  --danger: #ef4444;
  --danger-soft: rgba(239,68,68,.1);
  --info: #06b6d4;
  --info-soft: rgba(6,182,212,.1);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 14px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.12);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --sidebar-w: 240px;
  --topbar-h: 56px;
  --duration: .18s;
  --ease: cubic-bezier(.4,0,.2,1);
}

/* Dark mode — sistem + manual override */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0e14;
    --surface: #11151c;
    --surface-2: #1a1f28;
    --surface-3: #242a35;
    --border: #242a35;
    --border-strong: #313844;
    --text: #e6e9ef;
    --text-muted: #9aa3b2;
    --text-dim: #6b7382;
    --primary-soft: rgba(37,99,235,.12);
    --success-soft: rgba(16,185,129,.15);
    --warning-soft: rgba(245,158,11,.15);
    --danger-soft: rgba(239,68,68,.15);
    --info-soft: rgba(6,182,212,.15);
  }
}
:root[data-theme="dark"] {
  --bg: #0b0e14;
  --surface: #11151c;
  --surface-2: #1a1f28;
  --surface-3: #242a35;
  --border: #242a35;
  --border-strong: #313844;
  --text: #e6e9ef;
  --text-muted: #9aa3b2;
  --text-dim: #6b7382;
  --primary-soft: rgba(37,99,235,.12);
  --success-soft: rgba(16,185,129,.15);
  --warning-soft: rgba(245,158,11,.15);
  --danger-soft: rgba(239,68,68,.15);
  --info-soft: rgba(6,182,212,.15);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { margin: 0; font-weight: 600; }
h1 { font-size: 22px; letter-spacing: -.02em; }
h2 { font-size: 18px; letter-spacing: -.01em; }
h3 { font-size: 15px; }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
input, textarea, select {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 12px; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
textarea { resize: vertical; min-height: 80px; }
label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--text); }

/* ── Buttons (modern, smooth) ─────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); cursor: pointer;
  font-weight: 500; font-size: 13.5px; line-height: 1.4;
  transition: transform .12s ease, box-shadow .15s ease,
              border-color .15s ease, background .15s ease, color .15s ease;
  user-select: none;
  white-space: nowrap;
}
.btn:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
}
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn-primary {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 2px 8px -2px rgba(59,130,246,.35);
}
.btn-primary:hover {
  background: var(--primary-hover); border-color: var(--primary-hover);
  box-shadow: 0 4px 14px -2px rgba(59,130,246,.45);
}
.btn-danger { color: var(--danger); border-color: var(--border); }
.btn-danger:hover {
  background: var(--danger); color: #fff; border-color: var(--danger);
  box-shadow: 0 4px 14px -2px rgba(239,68,68,.35);
}
.btn-ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; box-shadow: none; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; gap: 5px; }
.btn:disabled {
  opacity: .5; cursor: not-allowed;
  transform: none !important; box-shadow: none !important;
}
.btn svg { width: 15px; height: 15px; }

/* ── Login ──────────────────────────────────────── */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 380px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 32px; box-shadow: var(--shadow-lg);
}
.login-card h1 { margin-bottom: 4px; }
.login-card .sub { color: var(--text-muted); margin-bottom: 24px; font-size: 13px; }
.login-card .form-row { margin-bottom: 14px; }
.login-card .btn { width: 100%; justify-content: center; padding: 10px; }

/* ── Layout (modern spacing) ────────────────────────── */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 22px 16px 18px; display: flex; flex-direction: column;
  gap: 4px; flex-shrink: 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  /* Subtle scrollbar */
  scrollbar-width: thin;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 4px 10px 22px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.brand-logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), #06b6d4);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px;
  box-shadow: 0 4px 14px -2px rgba(59,130,246,.4);
}
.brand-name { font-weight: 700; font-size: 15.5px; letter-spacing: -.01em; }

.nav-section { margin-top: 14px; }
.nav-section:first-of-type { margin-top: 0; }
.nav-title {
  font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .08em; font-weight: 600;
  color: var(--text-dim); padding: 4px 12px;
  margin-bottom: 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 8px;
  color: var(--text-muted); cursor: pointer;
  font-size: 13.5px; font-weight: 500;
  transition: background .12s ease, color .12s ease, transform .12s ease;
  position: relative;
}
.nav-item:hover {
  background: var(--surface-2); color: var(--text); text-decoration: none;
}
.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}
.nav-item.active::before {
  content: ""; position: absolute; left: -16px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--primary);
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .9; }
.nav-item.active svg { opacity: 1; }

.sidebar-footer {
  margin-top: auto; padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px; font-size: 12.5px;
}
.user-row {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-muted);
  line-height: 1.4;
}
.user-row > div:first-child {
  color: var(--text); font-weight: 500;
  font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky; top: 0; z-index: 10;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.page-title {
  font-size: 17px; font-weight: 600;
  letter-spacing: -.01em;
}

/* Content area — biraz daha nefes alan */
.content {
  padding: 28px 32px;
  max-width: 1400px;
  width: 100%;
}
@media (max-width: 768px) {
  .content { padding: 18px 16px; }
  .topbar { padding: 12px 16px; }
}

/* Card iyileştirme — modern shadow */
.card {
  border-radius: 12px;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.card:hover { box-shadow: 0 4px 16px -4px rgba(0,0,0,.06); }

/* Input/textarea polish */
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="url"], input[type="search"],
select, textarea {
  transition: border-color .15s ease, box-shadow .15s ease;
}
input[type="text"]:focus, input[type="email"]:focus,
input[type="password"]:focus, input[type="number"]:focus,
input[type="url"]:focus, input[type="search"]:focus,
select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* Page heading — daha nefes alan */
h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 4px; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 8px; }
h3 { font-size: 15px; font-weight: 600; margin: 0 0 6px; }
.tenant-select { min-width: 180px; }

.content { padding: 28px; max-width: 1400px; width: 100%; }

/* ── Cards / Grid ──────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-xs);
}
.card h3 { margin-bottom: 12px; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px)  { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* KPI card */
.kpi { display: flex; flex-direction: column; gap: 6px; }
.kpi-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.kpi-value { font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
.kpi-delta { font-size: 12px; color: var(--success); }
.kpi-delta.down { color: var(--danger); }

/* ── Table ─────────────────────────────────────── */
.table {
  width: 100%; border-collapse: collapse; font-size: 13.5px;
}
.table th, .table td {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.table th {
  background: var(--surface-2); font-weight: 500; color: var(--text-muted);
  font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  position: sticky; top: 0;
}
.table tr:hover td { background: var(--surface-2); cursor: pointer; }

/* ── Badge / Chip ──────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: 999px; font-size: 11.5px; font-weight: 500;
  background: var(--surface-2); color: var(--text-muted);
  border: 1px solid var(--border);
}
.badge-success { background: rgba(16,185,129,.1); color: var(--success); border-color: transparent; }
.badge-danger  { background: rgba(239,68,68,.1); color: var(--danger); border-color: transparent; }
.badge-primary { background: var(--primary-soft); color: var(--primary); border-color: transparent; }

/* ── Tabs ──────────────────────────────────────── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab {
  padding: 9px 14px; cursor: pointer; border-bottom: 2px solid transparent;
  color: var(--text-muted); font-weight: 500; font-size: 13.5px;
  transition: all .12s ease;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── Drawer / Modal ────────────────────────────── */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40;
  animation: fade .2s ease;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 560px; max-width: 100vw;
  background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg); z-index: 41; display: flex; flex-direction: column;
  animation: slideIn .24s ease;
}
.drawer-head { padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Toast ─────────────────────────────────────── */
.toast-stack {
  position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px;
  z-index: 100;
}
.toast {
  background: var(--surface); border: 1px solid var(--border);
  padding: 10px 14px; border-radius: var(--radius); box-shadow: var(--shadow);
  min-width: 240px; animation: slideIn .2s ease; font-size: 13px;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }

/* ── Utility ───────────────────────────────────── */
.row { display: flex; align-items: center; gap: 10px; }
.space { flex: 1; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.small { font-size: 12.5px; }
.mono { font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; font-size: 12.5px; }
.hidden { display: none !important; }

/* Chat bubble in conversation detail */
.cb-msg { margin-bottom: 12px; }
.cb-msg-head { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.cb-msg-bubble {
  padding: 10px 14px; border-radius: 12px; white-space: pre-wrap;
  background: var(--surface-2); display: inline-block; max-width: 100%;
}
.cb-msg.user .cb-msg-bubble { background: var(--primary-soft); color: var(--primary); }

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  padding: 32px; text-align: center; color: var(--text-muted);
  cursor: pointer; transition: all .15s ease;
}
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }

/* Code block for prompt preview */
.code-block {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12.5px; white-space: pre-wrap; word-break: break-word;
  max-height: 400px; overflow-y: auto;
}

/* Simple bars for charts */
.bar-chart { display: flex; gap: 4px; align-items: flex-end; height: 140px; }
.bar {
  flex: 1; background: var(--primary); border-radius: 4px 4px 0 0;
  position: relative; min-height: 2px;
  transition: opacity .15s ease;
}
.bar:hover { opacity: .8; }
.bar-label { font-size: 10px; color: var(--text-muted); text-align: center; margin-top: 4px; }

/* Switch */
.switch { position: relative; display: inline-block; width: 38px; height: 22px; }
.switch input { display: none; }
.switch-slider {
  position: absolute; inset: 0; background: var(--border-strong);
  border-radius: 999px; cursor: pointer; transition: background .15s ease;
}
.switch-slider::before {
  content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform .15s ease;
}
.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider::before { transform: translateX(16px); }


/* ═══════════════════════════════════════════════════
   MODERN UX COMPONENTS (2026 revamp)
   ═══════════════════════════════════════════════════ */

/* ── Top progress bar (sayfa yükleniyor) ───────────── */
.top-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 200;
  pointer-events: none; overflow: hidden;
}
.top-progress::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  width: 40%; animation: topLoad 1.2s infinite ease-in-out;
}
@keyframes topLoad {
  0% { transform: translateX(-40%); }
  100% { transform: translateX(250%); }
}
.top-progress.hidden { display: none; }

/* ── Skeleton loader ───────────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-2) 0%,
    var(--surface-3) 50%,
    var(--surface-2) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
  display: inline-block;
}
.skeleton-line { height: 14px; width: 100%; margin: 6px 0; }
.skeleton-line.w-20 { width: 20%; }
.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-80 { width: 80%; }
.skeleton-card { height: 100px; width: 100%; margin-bottom: 12px; }
.skeleton-circle { width: 40px; height: 40px; border-radius: 50%; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Empty state ──────────────────────────────────── */
.empty {
  text-align: center; padding: 48px 24px;
  color: var(--text-muted);
}
.empty-icon {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--surface-2); display: inline-flex;
  align-items: center; justify-content: center; margin-bottom: 14px;
  color: var(--text-dim);
}
.empty-icon svg { width: 24px; height: 24px; }
.empty-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.empty-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; max-width: 380px; margin-left: auto; margin-right: auto; }
.empty .btn { margin-top: 4px; }

/* ── Status pill (canlı göstergesi) ───────────────── */
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500;
  background: var(--surface-2); color: var(--text-muted);
}
.status-pill::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.status-pill.ok { background: var(--success-soft); color: var(--success); }
.status-pill.warn { background: var(--warning-soft); color: var(--warning); }
.status-pill.err { background: var(--danger-soft); color: var(--danger); }
.status-pill.ok::before { animation: pulse 2s infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

/* ── Spinner ───────────────────────────────────────── */
.spinner {
  width: 18px; height: 18px; border: 2px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  display: inline-block; animation: spin .6s linear infinite;
  vertical-align: middle;
}
.spinner.lg { width: 28px; height: 28px; border-width: 3px; }
.spinner.sm { width: 14px; height: 14px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Search input (Cmd+K modal) ───────────────────── */
.cmdk-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 100; display: flex; align-items: flex-start;
  justify-content: center; padding-top: 15vh;
  animation: fade .15s ease;
}
.cmdk-panel {
  width: min(600px, 92vw); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); overflow: hidden;
  animation: slideDown .2s var(--ease);
}
.cmdk-input {
  width: 100%; border: 0; padding: 16px 18px; font-size: 15px;
  background: transparent; outline: none; border-bottom: 1px solid var(--border);
}
.cmdk-list { max-height: 50vh; overflow-y: auto; padding: 6px; }
.cmdk-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13.5px; color: var(--text);
}
.cmdk-item:hover, .cmdk-item.active {
  background: var(--primary-soft); color: var(--primary);
}
.cmdk-item svg { width: 16px; height: 16px; opacity: .7; }
.cmdk-kbd {
  font-family: var(--mono); font-size: 11px; padding: 1px 6px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 4px; color: var(--text-muted); margin-left: auto;
}
.cmdk-foot {
  padding: 8px 14px; border-top: 1px solid var(--border);
  display: flex; gap: 12px; font-size: 11px; color: var(--text-dim);
}
.cmdk-foot span { display: inline-flex; align-items: center; gap: 4px; }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: none; }
}

/* ── Confirm dialog ───────────────────────────────── */
.confirm-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9000;
  animation: fade .15s ease;
}
.confirm-panel {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9001;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: calc(100% - 32px);
  max-width: 480px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.18);
  animation: confirmIn .22s cubic-bezier(.2,.9,.3,1.15);
}
@keyframes confirmIn {
  from { opacity: 0; transform: translate(-50%, -48%) scale(.95); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.confirm-panel h3 { margin: 0 0 6px; font-size: 17px; line-height: 1.3; }
.confirm-panel p { color: var(--text-muted); font-size: 14px; margin: 0; line-height: 1.5; }
.confirm-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 22px; flex-wrap: wrap;
}
.confirm-actions .btn {
  min-width: 90px;
}
.confirm-actions .btn:focus-visible {
  outline: 2px solid var(--primary, #3b82f6);
  outline-offset: 2px;
}
@media (max-width: 480px) {
  .confirm-panel { padding: 20px 18px; }
  .confirm-actions { justify-content: stretch; }
  .confirm-actions .btn { flex: 1; }
}

/* ── Toast (geliştirilmiş — 4 tip + icon + action) ─── */
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  padding: 12px 14px; border-radius: var(--radius); box-shadow: var(--shadow);
  min-width: 260px; max-width: 400px;
  animation: toastIn .24s var(--ease); font-size: 13px;
}
.toast-icon {
  width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
}
.toast-icon svg { width: 18px; height: 18px; }
.toast.success { border-left: 3px solid var(--success); }
.toast.success .toast-icon { color: var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info { border-left: 3px solid var(--info); }
.toast.info .toast-icon { color: var(--info); }
.toast-body { flex: 1; min-width: 0; }
.toast-action {
  background: transparent; border: 0; color: var(--primary);
  cursor: pointer; font-size: 12.5px; font-weight: 500;
  padding: 0; margin-left: 10px;
}
.toast-close {
  background: transparent; border: 0; color: var(--text-dim);
  cursor: pointer; padding: 0; font-size: 18px; line-height: 1;
  margin-left: 6px;
}
.toast-close:hover { color: var(--text); }
@keyframes toastIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* ── Search/filter input w/ icon ───────────────────── */
.search-box {
  position: relative; display: inline-flex; align-items: center;
}
.search-box svg {
  position: absolute; left: 10px; width: 14px; height: 14px;
  color: var(--text-dim); pointer-events: none;
}
.search-box input { padding-left: 32px; }

/* ── Segmented control ─────────────────────────────── */
.segmented {
  display: inline-flex; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 2px; gap: 2px;
}
.segmented button {
  border: 0; background: transparent; padding: 5px 12px;
  border-radius: calc(var(--radius-sm) - 2px);
  font-size: 12.5px; color: var(--text-muted); cursor: pointer;
  transition: all var(--duration) var(--ease);
}
.segmented button.active {
  background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-xs);
}

/* ── Sparkline (mini chart) ────────────────────────── */
.sparkline {
  display: flex; align-items: flex-end; gap: 2px;
  height: 28px; width: 100%;
}
.sparkline span {
  flex: 1; background: var(--primary-soft);
  border-radius: 2px 2px 0 0; min-height: 2px;
  transition: background var(--duration) var(--ease);
}
.sparkline:hover span { background: var(--primary); }

/* ── Enhanced KPI card ─────────────────────────────── */
.kpi-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-xs);
  position: relative; transition: all var(--duration) var(--ease);
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.kpi-card .kpi-label {
  font-size: 12px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em; font-weight: 500;
}
.kpi-card .kpi-icon {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.kpi-card .kpi-icon svg { width: 15px; height: 15px; }
.kpi-card .kpi-value { font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.kpi-card .kpi-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 6px; font-size: 11.5px; color: var(--text-muted);
}
.kpi-card.ok .kpi-icon { background: var(--success-soft); color: var(--success); }
.kpi-card.warn .kpi-icon { background: var(--warning-soft); color: var(--warning); }
.kpi-card.danger .kpi-icon { background: var(--danger-soft); color: var(--danger); }

/* ── Mobile Burger + Responsive Sidebar ──────────── */
.burger-btn {
  display: none; background: transparent; border: 0; padding: 4px;
  color: var(--text); cursor: pointer;
}
.burger-btn svg { width: 22px; height: 22px; }

.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.4); z-index: 49;
  animation: fade .15s ease;
}

/* Keyboard focus — a11y */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: none; /* focus border'ı yeter */
}

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

/* ── Responsive (mobile < 900px) ──────────────────── */
@media (max-width: 900px) {
  .burger-btn { display: inline-flex; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 50;
    transform: translateX(-100%); transition: transform .25s var(--ease);
    width: 280px; height: 100vh;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar.open + .sidebar-overlay { display: block; }
  .content { padding: 18px; }
  .topbar { padding: 12px 16px; gap: 8px; }
  .tenant-select { min-width: 140px; max-width: 200px; }
  .drawer { width: 100vw; }
  .table th, .table td { padding: 8px 10px; font-size: 12.5px; }
}
@media (max-width: 500px) {
  .topbar { flex-wrap: wrap; }
  .page-title { font-size: 15px; }
  .kpi-card .kpi-value { font-size: 22px; }
}

/* Responsive utilities */
@media (max-width: 700px) {
  .hidden-sm { display: none; }
}

/* ── Theme toggle button ───────────────────────────── */
.theme-toggle {
  background: transparent; border: 1px solid var(--border);
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-muted);
  transition: all var(--duration) var(--ease);
}
.theme-toggle:hover { color: var(--text); background: var(--surface-2); }
.theme-toggle svg { width: 16px; height: 16px; }
