/* ==========================================================================
   Zey Kasa — tasarım sistemi
   Renkler token olarak tanımlı; koyu tema [data-theme="dark"] ile değişir.
   ========================================================================== */

:root {
  --bg: #f4f5f9;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-3: #f1f3f8;
  --border: #e5e8f0;
  --border-strong: #d4d9e4;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #8590a5;

  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef0ff;
  --primary-ring: rgba(79, 70, 229, .18);

  --green: #059669;   --green-soft: #e8f8f1;
  --red: #e11d48;     --red-soft: #fff0f3;
  --amber: #c2410c;   --amber-soft: #fff5e8;
  --blue: #0369a1;    --blue-soft: #eaf5fd;
  --violet: #7c3aed;  --violet-soft: #f4f0ff;
  --gray: #475569;    --gray-soft: #f1f5f9;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .05);
  --shadow: 0 6px 20px rgba(16, 24, 40, .06);
  --shadow-lg: 0 24px 60px rgba(16, 24, 40, .20);

  --sidebar-w: 256px;
  --topbar-h: 64px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0b0e17;
  --surface: #131826;
  --surface-2: #171d2d;
  --surface-3: #1d2436;
  --border: #252d42;
  --border-strong: #323b54;
  --text: #e7eaf2;
  --text-2: #b4bccd;
  --muted: #7d879d;

  --primary: #7c74ff;
  --primary-hover: #918aff;
  --primary-soft: rgba(124, 116, 255, .14);
  --primary-ring: rgba(124, 116, 255, .28);

  --green: #34d399;   --green-soft: rgba(52, 211, 153, .12);
  --red: #fb7185;     --red-soft: rgba(251, 113, 133, .12);
  --amber: #fbbf24;   --amber-soft: rgba(251, 191, 36, .12);
  --blue: #38bdf8;    --blue-soft: rgba(56, 189, 248, .12);
  --violet: #a78bfa;  --violet-soft: rgba(167, 139, 250, .14);
  --gray: #a3acbf;    --gray-soft: rgba(148, 163, 184, .12);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 8px 24px rgba(0, 0, 0, .3);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

/* ---------- Temel ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
[x-cloak] { display: none !important; }
.icon { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 2; }
svg.lucide { width: 18px; height: 18px; flex-shrink: 0; }
.tabular, .money { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Uygulama iskeleti ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 40;
  transition: transform .25s ease;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 18px 20px; height: var(--topbar-h); }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 55%, #ec4899 100%);
  color: #fff; font-weight: 800; font-size: 17px;
  box-shadow: 0 6px 16px rgba(99, 102, 241, .35);
}
.brand b { display: block; font-size: 15px; letter-spacing: -.01em; }
.brand small { display: block; color: var(--muted); font-size: 12px; margin-top: -1px; }

.nav { flex: 1; overflow-y: auto; padding: 8px 12px 16px; }
.nav-section { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 16px 10px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--surface-3); color: var(--text); }
.nav-link.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-link .icon, .nav-link svg { width: 18px; height: 18px; opacity: .9; }
.nav-count { margin-left: auto; font-size: 11px; font-weight: 600; background: var(--red-soft); color: var(--red); padding: 1px 7px; border-radius: 99px; }

.sidebar-footer { border-top: 1px solid var(--border); padding: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); color: var(--text); }
.user-chip:hover { background: var(--surface-3); color: var(--text); }
.user-chip b { display: block; font-size: 13px; font-weight: 600; line-height: 1.2; }
.user-chip small { color: var(--muted); font-size: 12px; }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.search-trigger {
  display: flex; align-items: center; gap: 10px;
  width: min(420px, 100%); height: 40px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--muted);
  font: inherit; cursor: pointer; text-align: left;
}
.search-trigger:hover { border-color: var(--border-strong); }
.search-trigger span { flex: 1; }
kbd { font: 600 11px/1 var(--font); padding: 4px 6px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.content { padding: 28px; max-width: 1480px; width: 100%; margin: 0 auto; }

.sidebar-backdrop { display: none; }
.menu-toggle { display: none; }

/* ---------- Sayfa başlığı ---------- */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-header p { color: var(--muted); margin-top: 4px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb .icon, .breadcrumb svg { width: 14px; height: 14px; }

/* ---------- Kart ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); min-width: 0; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-header h2 { font-size: 15px; }
.card-header p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card-body { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.card-flush .card-body { padding: 0; }
.card-link { font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }

/* ---------- KPI ---------- */
.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.kpi-label { color: var(--text-2); font-weight: 500; font-size: 13px; }
.kpi-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
.kpi-icon svg, .kpi-icon .icon { width: 18px; height: 18px; }
.kpi-value { font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-sub { color: var(--muted); font-size: 12.5px; margin-top: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.trend { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-size: 12px; padding: 1px 6px; border-radius: 99px; }
.trend.up { color: var(--green); background: var(--green-soft); }
.trend.down { color: var(--red); background: var(--red-soft); }
.trend svg { width: 13px; height: 13px; }

.tone-green { background: var(--green-soft); color: var(--green); }
.tone-red { background: var(--red-soft); color: var(--red); }
.tone-amber { background: var(--amber-soft); color: var(--amber); }
.tone-blue { background: var(--blue-soft); color: var(--blue); }
.tone-violet { background: var(--violet-soft); color: var(--violet); }
.tone-primary { background: var(--primary-soft); color: var(--primary); }
.tone-gray { background: var(--gray-soft); color: var(--gray); }

/* ---------- Grid ---------- */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid-side { grid-template-columns: minmax(0, 1fr) 340px; }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 18px; } .mt-4 { margin-top: 24px; }
.mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 18px; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 4px; } .gap-3 { gap: 16px; }
.grow { flex: 1; min-width: 0; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.fw-600 { font-weight: 600; }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-amber { color: var(--amber); }
.text-blue { color: var(--blue); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- Buton ---------- */
.btn {
  --btn-bg: var(--surface); --btn-color: var(--text); --btn-border: var(--border);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  font: 600 13.5px/1 var(--font);
  color: var(--btn-color); background: var(--btn-bg);
  border: 1px solid var(--btn-border); border-radius: var(--radius-sm);
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--surface-3); color: var(--btn-color); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--primary-ring); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg, .btn .icon { width: 17px; height: 17px; }
.btn-primary { --btn-bg: var(--primary); --btn-color: #fff; --btn-border: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-success { --btn-bg: #059669; --btn-color: #fff; --btn-border: #059669; }
.btn-success:hover { background: #047857; border-color: #047857; color: #fff; }
.btn-danger { --btn-bg: #e11d48; --btn-color: #fff; --btn-border: #e11d48; }
.btn-danger:hover { background: #be123c; border-color: #be123c; color: #fff; }
.btn-soft-danger { --btn-bg: var(--red-soft); --btn-color: var(--red); --btn-border: transparent; box-shadow: none; }
.btn-soft-danger:hover { background: var(--red-soft); filter: brightness(.97); color: var(--red); border-color: transparent; }
.btn-ghost { --btn-bg: transparent; --btn-border: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; gap: 6px; }
.btn-sm svg, .btn-sm .icon { width: 15px; height: 15px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn-block { width: 100%; }
.icon-btn { position: relative; }
.dot { position: absolute; top: 7px; right: 7px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }

/* ---------- Rozet ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 99px;
  font-size: 12px; font-weight: 600; line-height: 1.35; white-space: nowrap;
}
.badge svg, .badge .icon { width: 13px; height: 13px; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-violet { background: var(--violet-soft); color: var(--violet); }
.badge-gray { background: var(--gray-soft); color: var(--gray); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.color-dot { width: 9px; height: 9px; border-radius: 99px; display: inline-block; flex-shrink: 0; background: var(--dot, #94a3b8); }

/* ---------- Avatar ---------- */
.avatar {
  --avatar: #6366f1;
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: inline-grid; place-items: center;
  background: color-mix(in srgb, var(--avatar) 16%, transparent);
  color: var(--avatar); font-weight: 700; font-size: 12.5px;
}
.avatar.sm { width: 28px; height: 28px; font-size: 11px; border-radius: 8px; }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; border-radius: 14px; }

/* ---------- Tablo ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
  padding: 11px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .1s; }
.table-hover tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 0; }
.table-sm td { padding: 9px 14px; }
.table-sm th { padding: 9px 14px; }
.row-link { cursor: pointer; }
.cell-main { font-weight: 600; color: var(--text); display: block; }
.cell-sub { color: var(--muted); font-size: 12.5px; display: block; margin-top: 1px; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
tr.is-muted td { opacity: .6; }

/* ---------- Liste (dashboard) ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); color: var(--text); }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover { background: var(--surface-2); color: var(--text); }
.list-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.list-icon svg, .list-icon .icon { width: 17px; height: 17px; }
.list-title { font-weight: 600; font-size: 13.5px; }
.list-sub { color: var(--muted); font-size: 12.5px; }

/* ---------- Form ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-label { font-weight: 600; font-size: 13px; color: var(--text); display: flex; align-items: center; gap: 6px; }
.form-label .opt { color: var(--muted); font-weight: 400; }
.form-hint { color: var(--muted); font-size: 12.5px; }
.field-error { color: var(--red); font-size: 12.5px; font-weight: 500; }
.form-control, .form-select {
  width: 100%; height: 42px; padding: 0 13px;
  font: 400 14px var(--font); color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
  appearance: none; -webkit-appearance: none;
}
textarea.form-control { height: auto; min-height: 92px; padding: 11px 13px; resize: vertical; line-height: 1.5; }
.form-select {
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238590a5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.form-control:focus, .form-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.form-control::placeholder { color: var(--muted); }
.form-control[readonly] { background: var(--surface-2); }
.form-control.is-invalid { border-color: var(--red); }
.form-control-lg { height: 54px; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.input-icon { position: relative; }
.input-icon > svg, .input-icon > .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon .form-control { padding-left: 38px; }
.input-suffix { position: relative; }
.input-suffix .suffix { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; }
.input-suffix .form-control { padding-right: 40px; }
.form-section { padding: 22px 24px; border-bottom: 1px solid var(--border); }
.form-section:last-child { border-bottom: 0; }
.form-section-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.form-section-title svg { width: 16px; height: 16px; color: var(--muted); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.form-actions .left { margin-right: auto; }

input[type="color"].form-control { padding: 4px; width: 56px; cursor: pointer; }
input[type="file"].form-control { padding: 8px 10px; height: auto; }
input[type="date"].form-control { min-width: 0; }

/* Segment seçici (Gelir / Gider, Ödendi / Bekliyor) */
.segmented { display: inline-flex; padding: 4px; gap: 4px; background: var(--surface-3); border-radius: 12px; border: 1px solid var(--border); }
.segmented.block { display: flex; width: 100%; }
.segmented.block label { flex: 1; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: 9px; cursor: pointer;
  font-weight: 600; font-size: 13.5px; color: var(--text-2);
  transition: background .15s, color .15s, box-shadow .15s;
}
.segmented label:hover { color: var(--text); }
.segmented label svg { width: 16px; height: 16px; }
.segmented input:checked + label { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented input:checked + label.is-income { color: var(--green); }
.segmented input:checked + label.is-expense { color: var(--red); }
.segmented input:focus-visible + label { box-shadow: 0 0 0 3px var(--primary-ring); }

/* Anahtar (switch) */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 38px; height: 22px; border-radius: 99px; background: var(--border-strong); position: relative; transition: background .2s; flex-shrink: 0; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 99px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 4px var(--primary-ring); }

.checkbox { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; padding: 6px 0; }
.checkbox input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--primary); flex-shrink: 0; cursor: pointer; }

/* KDV özeti kutusu */
.vat-preview { display: flex; gap: 18px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px dashed var(--border-strong); font-size: 13px; flex-wrap: wrap; }
.vat-preview div { display: flex; flex-direction: column; }
.vat-preview span { color: var(--muted); font-size: 12px; }
.vat-preview b { font-variant-numeric: tabular-nums; }

/* ---------- Filtre çubuğu ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.filters .form-group { min-width: 150px; flex: 1; }
.filters .form-control, .filters .form-select { height: 38px; font-size: 13.5px; }
.filters .btn { height: 38px; }
.filters-actions { display: flex; gap: 8px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); font-weight: 500; font-size: 13px;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active { background: var(--text); color: var(--surface); border-color: var(--text); }
.chip .count { font-size: 11.5px; opacity: .7; }
.chip svg { width: 14px; height: 14px; }

/* ---------- Sekmeler ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 12px; overflow-x: auto; }
.tab { padding: 13px 12px; color: var(--text-2); font-weight: 600; font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab .count { background: var(--surface-3); color: var(--text-2); font-size: 11.5px; padding: 1px 7px; border-radius: 99px; }

/* ---------- Açılır menü ---------- */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50;
  min-width: 220px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg);
}
.dropdown-menu.left { right: auto; left: 0; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border-radius: 8px; border: 0; background: none;
  color: var(--text); font: 500 13.5px var(--font); text-align: left; cursor: pointer;
}
.dropdown-item:hover { background: var(--surface-3); color: var(--text); }
.dropdown-item svg, .dropdown-item .icon { width: 17px; height: 17px; color: var(--muted); }
.dropdown-item.danger { color: var(--red); }
.dropdown-item.danger svg { color: var(--red); }
.dropdown-item .di-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; }
.dropdown-item .di-icon svg { color: inherit; width: 16px; height: 16px; }
.dropdown-item small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.dropdown-divider { height: 1px; background: var(--border); margin: 6px 0; }
.dropdown-header { padding: 8px 10px 6px; font-size: 12px; color: var(--muted); font-weight: 600; }

.notif-menu { width: 360px; padding: 0; }
.notif-head { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.notif-item { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text); }
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--surface-2); color: var(--text); }
.notif-item b { font-size: 13.5px; display: block; }
.notif-item small { color: var(--muted); font-size: 12.5px; }
.notif-empty { padding: 32px 16px; text-align: center; color: var(--muted); }

/* ---------- Dialog / modal ---------- */
dialog.modal {
  width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  padding: 0; border: 1px solid var(--border); border-radius: 18px;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
dialog.modal.wide { width: min(720px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(15, 23, 42, .45); backdrop-filter: blur(3px); }
dialog.modal[open] { animation: modal-in .18s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 0; }
.modal-header p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.modal-body { padding: 18px 22px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); }
.modal-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 12px; }

/* ---------- Komut paleti ---------- */
.palette-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(15, 23, 42, .45); backdrop-filter: blur(3px); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.palette { width: min(620px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.palette-input svg { color: var(--muted); }
.palette-input input { flex: 1; height: 56px; border: 0; outline: 0; background: transparent; font: 400 16px var(--font); color: var(--text); }
.palette-results { max-height: 420px; overflow-y: auto; padding: 6px; }
.palette-group { padding: 10px 10px 4px; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; color: var(--text); cursor: pointer; }
.palette-item.active { background: var(--primary-soft); }
.palette-item .pi-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); flex-shrink: 0; }
.palette-item .pi-icon svg { width: 16px; height: 16px; }
.palette-item b { font-weight: 600; font-size: 13.5px; display: block; }
.palette-item small { color: var(--muted); font-size: 12.5px; }
.palette-item .pi-meta { margin-left: auto; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.palette-empty { padding: 28px; text-align: center; color: var(--muted); }
.palette-foot { display: flex; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; background: var(--surface-2); }

/* ---------- Toast ---------- */
.toasts { position: fixed; bottom: 24px; right: 24px; z-index: 90; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  animation: toast-in .25s ease-out;
}
.toast .t-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; }
.toast .t-icon svg { width: 16px; height: 16px; }
.toast b { display: block; font-size: 13.5px; }
.toast p, .toast ul { color: var(--text-2); font-size: 13px; margin: 2px 0 0; }
.toast ul { padding-left: 16px; }
.toast .t-close { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px; }
@keyframes toast-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* ---------- Uyarı kutusu ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; font-size: 13.5px; }
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-info { background: var(--blue-soft); color: var(--blue); }
.alert-warning { background: var(--amber-soft); color: var(--amber); }
.alert-danger { background: var(--red-soft); color: var(--red); }
.alert-success { background: var(--green-soft); color: var(--green); }
.alert b { font-weight: 700; }
.alert .alert-text { color: var(--text-2); }

/* ---------- Boş durum ---------- */
.empty { text-align: center; padding: 48px 20px; }
.empty-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; margin: 0 auto 14px; background: var(--surface-3); color: var(--muted); }
.empty-icon svg { width: 26px; height: 26px; }
.empty h3 { font-size: 15px; margin-bottom: 4px; }
.empty p { color: var(--muted); max-width: 360px; margin: 0 auto 16px; }

/* ---------- İlerleme çubuğu ---------- */
.progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.progress.green > span { background: var(--green); }
.progress.red > span { background: var(--red); }
.progress.amber > span { background: #f59e0b; }

/* ---------- Detay listesi ---------- */
.dl { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px 16px; font-size: 13.5px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 500; word-break: break-word; }

.hero-amount { font-size: 32px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* ---------- Zaman çizelgesi ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 26px; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: -4px; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; left: 1px; top: 4px; width: 12px; height: 12px; border-radius: 99px; background: var(--surface); border: 3px solid var(--primary); }
.timeline b { font-size: 13.5px; }
.timeline small { color: var(--muted); display: block; font-size: 12.5px; }

/* ---------- Hesap kartları ---------- */
.account-card { padding: 18px 20px; position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 14px; color: var(--text); }
.account-card:hover { border-color: var(--border-strong); color: var(--text); }
.account-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--acc, var(--primary)); }
.account-card .acc-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--acc) 14%, transparent); color: var(--acc); }
.account-card .acc-balance { font-size: 22px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }

/* ---------- Grafik ---------- */
.chart-box { position: relative; height: 300px; }
.chart-box.sm { height: 230px; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-list { display: flex; flex-direction: column; gap: 10px; }
.legend-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.legend-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.legend-row .val { font-weight: 600; font-variant-numeric: tabular-nums; }
.legend-row .pct { color: var(--muted); width: 44px; text-align: right; font-size: 12px; }

/* ---------- Sayfalama ---------- */
.pagination { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.pagination a, .pagination span { display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 8px; border-radius: 8px; color: var(--text-2); font-weight: 600; font-size: 13px; border: 1px solid transparent; }
.pagination a:hover { background: var(--surface-3); color: var(--text); }
.pagination .active span { background: var(--primary); color: #fff; }
.pagination svg { width: 16px; height: 16px; }
.table-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; color: var(--muted); font-size: 13px; }

/* ---------- Yetki matrisi ---------- */
.perm-group { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.perm-group-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-weight: 600; }
.perm-group-head svg { width: 17px; height: 17px; color: var(--muted); }
.perm-group-body { padding: 6px 14px; }

/* ---------- Giriş ekranı ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--surface); }
.auth-visual {
  position: relative; overflow: hidden; color: #fff; padding: 48px;
  display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(1000px 600px at 0% 0%, rgba(168, 85, 247, .55), transparent 60%),
    radial-gradient(800px 600px at 100% 100%, rgba(236, 72, 153, .45), transparent 60%),
    linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%);
}
.auth-visual::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px); background-size: 22px 22px; pointer-events: none; }
.auth-visual > * { position: relative; z-index: 1; }
.auth-visual h2 { font-size: 34px; font-weight: 750; line-height: 1.15; letter-spacing: -.02em; max-width: 460px; }
.auth-visual p { color: rgba(255,255,255,.75); margin-top: 14px; max-width: 420px; font-size: 15px; }
.auth-features { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 480px; }
.auth-feature { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); font-weight: 500; font-size: 13.5px; }
.auth-feature svg { width: 18px; height: 18px; }
.auth-form-wrap { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-form { width: min(400px, 100%); }
.auth-form h1 { font-size: 26px; }
.auth-form > p { color: var(--muted); margin: 6px 0 28px; }

/* ---------- 403 ---------- */
.error-page { min-height: 70vh; display: grid; place-items: center; text-align: center; }

/* ---------- Duyarlı tasarım ---------- */
@media (max-width: 1280px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .grid-main, .grid-side { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .sidebar-backdrop.open { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(15,23,42,.45); }
  .main { margin-left: 0; }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .content { padding: 20px 16px; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
}
@media (max-width: 680px) {
  .grid-2, .grid-3, .form-grid, .form-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .grid-4 .kpi { padding: 14px; }
  .grid-4 .kpi-icon { display: none; }
  .grid-4 .kpi-top { margin-bottom: 6px; }
  .grid-4 .kpi-value { font-size: 17px !important; }
  .grid-4 .kpi-label { font-size: 12px; }
  .grid-4 .kpi-sub { font-size: 11.5px; }
  .grid.mb-3 { margin-bottom: 12px; }
  .span-2 { grid-column: auto; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .search-trigger { width: 40px; padding: 0; justify-content: center; }
  .hide-sm { display: none !important; }
  .page-header { align-items: flex-start; }
  .kpi-value { font-size: 21px; }
  .page-header h1 { font-size: 20px; }
  .page-actions .btn { height: 38px; padding: 0 12px; }
  .dl { grid-template-columns: 1fr; gap: 2px 0; }
  .dl dd { margin-bottom: 10px; }
  .notif-menu { width: calc(100vw - 32px); right: -60px; }
  .form-section { padding: 18px 16px; }
  .form-actions { padding: 14px 16px; }
  .toasts { right: 16px; }
}

/* ---------- Yazdırma ---------- */
@media print {
  .sidebar, .topbar, .page-actions, .filters, .no-print, .toasts, .row-actions, .table-footer { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; font-size: 12px; }
  .card { box-shadow: none; border-color: #ddd; break-inside: avoid; }
  .print-only { display: block !important; }
}
.print-only { display: none; }

/* ---------- Tom Select uyarlaması ---------- */
.ts-wrapper .ts-control {
  min-height: 42px; padding: 9px 36px 9px 13px !important;
  border: 1px solid var(--border-strong) !important; border-radius: var(--radius-sm) !important;
  background: var(--surface) !important; color: var(--text) !important;
  font: 400 14px var(--font) !important; box-shadow: none !important;
}
.ts-wrapper.focus .ts-control { border-color: var(--primary) !important; box-shadow: 0 0 0 4px var(--primary-ring) !important; }
.ts-wrapper .ts-control input { color: var(--text) !important; font: inherit !important; }
.ts-wrapper .ts-control input::placeholder { color: var(--muted); }
.ts-dropdown { border: 1px solid var(--border) !important; border-radius: 12px !important; background: var(--surface) !important; color: var(--text) !important; box-shadow: var(--shadow-lg) !important; margin-top: 6px !important; overflow: hidden; z-index: 60 !important; }
.ts-dropdown .option { padding: 9px 12px !important; }
.ts-dropdown .active { background: var(--primary-soft) !important; color: var(--text) !important; }
.ts-dropdown .create { padding: 9px 12px !important; color: var(--primary) !important; }
.ts-wrapper.single .ts-control::after { border-color: var(--muted) transparent transparent !important; right: 14px !important; }
.filters .ts-wrapper .ts-control { min-height: 38px; padding-top: 7px !important; padding-bottom: 7px !important; font-size: 13.5px !important; }
.ts-wrapper.plugin-clear_button .clear { right: 30px !important; color: var(--muted); }
/* Tom Select, orijinal select'in sınıflarını sarmalayıcıya kopyalar; sarmalayıcıdaki form stilini sıfırla */
.ts-wrapper.form-select, .ts-wrapper.form-control {
  padding: 0 !important; border: 0 !important; background: none !important;
  height: auto !important; box-shadow: none !important; min-height: 0;
}
.ts-wrapper.single .ts-control { background-image: none !important; }
.ts-wrapper .ts-control > .item { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ts-wrapper.single.input-active .ts-control { cursor: text; }
.kpi-sub .badge { white-space: normal; }
