/* ==========================================================================
   Defterim — panel tasarım sistemi
   Derleme gerektirmez. Renkler :root değişkenleriyle, koyu tema
   [data-theme="dark"] ile tanımlıdır.
   ========================================================================== */

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #eef0f3;
  --border: #e3e6ea;
  --border-strong: #cfd4da;
  --text: #121826;
  --text-2: #3d4554;
  --muted: #6b7382;
  --faint: #9aa1ad;

  --primary: #0f766e;
  --primary-hover: #0b5f58;
  --primary-soft: #e3f4f1;
  --primary-text: #0b5f58;
  --on-primary: #ffffff;

  --success: #15803d;
  --success-soft: #e5f5ea;
  --warning: #b45309;
  --warning-soft: #fdf1e2;
  --danger: #c2261d;
  --danger-soft: #fdeceb;
  --info: #1d5fd1;
  --info-soft: #e8f0fd;

  --sidebar-bg: #ffffff;
  --sidebar-text: #3d4554;
  --sidebar-strong: #121826;
  --sidebar-muted: #8a92a0;
  --sidebar-hover: #f1f3f6;
  --sidebar-active: #e3f4f1;
  --sidebar-active-text: #0b5f58;
  --sidebar-border: #e3e6ea;
  --sidebar-btn-bg: #f6f7f9;
  --sidebar-menu-bg: #ffffff;
  --admin-active: rgba(109, 91, 208, 0.12);
  --admin-active-text: #5b49c9;

  --admin-accent: #6d5bd0;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.14);
  --ring: 0 0 0 3px rgba(15, 118, 110, 0.22);

  --sidebar-w: 264px;
  --topbar-h: 60px;
  --bottomnav-h: 64px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0b111b;
  --surface: #121a27;
  --surface-2: #161f2e;
  --surface-3: #1c2637;
  --border: #243044;
  --border-strong: #33415a;
  --text: #e8ecf2;
  --text-2: #c2c9d5;
  --muted: #8d97a8;
  --faint: #667185;

  --primary: #2bb5a6;
  --primary-hover: #3fcabb;
  --primary-soft: rgba(43, 181, 166, 0.14);
  --primary-text: #5fd6c8;
  --on-primary: #06231f;

  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, 0.12);
  --warning: #f5b34a;
  --warning-soft: rgba(245, 179, 74, 0.13);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.13);
  --info: #74a7ff;
  --info-soft: rgba(116, 167, 255, 0.13);

  --sidebar-bg: #0a0f18;
  --sidebar-text: #c3cad6;
  --sidebar-strong: #ffffff;
  --sidebar-muted: #7c8696;
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-active: rgba(45, 212, 191, 0.14);
  --sidebar-active-text: #5eead4;
  --sidebar-border: rgba(255, 255, 255, 0.07);
  --sidebar-btn-bg: rgba(255, 255, 255, 0.04);
  --sidebar-menu-bg: #172133;
  --admin-active: rgba(157, 141, 250, 0.16);
  --admin-active-text: #c4baff;
  --admin-accent: #9d8dfa;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --ring: 0 0 0 3px rgba(43, 181, 166, 0.3);

  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: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; color: var(--text); }
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 0.75rem; }
p:last-child { margin-bottom: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.25rem 0; }
code, .mono { font-family: var(--mono); font-size: 0.9em; }
[x-cloak] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 0.85rem; }
.xsmall { font-size: 0.78rem; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-right { text-align: right; }
.icon { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }

/* ---- Yerleşim ---------------------------------------------------------- */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
  background: var(--sidebar-bg); color: var(--sidebar-text); border-right: 1px solid var(--sidebar-border);
  display: flex; flex-direction: column; z-index: 40;
  transition: transform 0.22s ease;
}
.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left 0.22s ease; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px; padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-title { font-weight: 650; font-size: 1rem; min-width: 0; }
.topbar-spacer { flex: 1; }
.content { padding: 24px; width: 100%; max-width: 1240px; margin: 0 auto; flex: 1; }
.content-narrow { max-width: 760px; }


/* ---- Daraltılmış kenar menü (masaüstü) --------------------------------- */
@media (min-width: 901px) {
  .sidebar { transition: width 0.22s ease, transform 0.22s ease; }
  html[data-sidebar="collapsed"] .sidebar { width: 72px; }
  html[data-sidebar="collapsed"] .main { margin-left: 72px; }
  html[data-sidebar="collapsed"] .brand { justify-content: center; padding-left: 0; padding-right: 0; }
  html[data-sidebar="collapsed"] .brand > span:not(.brand-mark),
  html[data-sidebar="collapsed"] .nav-label,
  html[data-sidebar="collapsed"] .nav-soon,
  html[data-sidebar="collapsed"] .book-switcher-name,
  html[data-sidebar="collapsed"] .book-switcher-btn > .icon,
  html[data-sidebar="collapsed"] .user-chip-text,
  html[data-sidebar="collapsed"] .admin-ribbon { display: none; }
  html[data-sidebar="collapsed"] .sidebar-scroll { padding-left: 10px; padding-right: 10px; overflow: visible; }
  html[data-sidebar="collapsed"] .nav-section { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--sidebar-border); }
  html[data-sidebar="collapsed"] .nav-link { font-size: 0; justify-content: center; padding: 10px 0; gap: 0; }
  html[data-sidebar="collapsed"] .nav-link .badge { display: none; }
  html[data-sidebar="collapsed"] .book-switcher-btn { justify-content: center; padding: 8px 0; }
  html[data-sidebar="collapsed"] .book-switcher-menu { right: auto; width: 260px; left: calc(100% + 8px); top: 0; }
  html[data-sidebar="collapsed"] .sidebar-footer { padding: 10px 6px; }
  html[data-sidebar="collapsed"] .sidebar-footer .row { flex-direction: column; gap: 4px; }
  html[data-sidebar="collapsed"] .user-chip { justify-content: center; }
}

/* ---- Kenar menü -------------------------------------------------------- */
.brand {
  display: flex; align-items: center; gap: 10px; padding: 18px 20px 14px;
  color: var(--sidebar-strong); font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, #2dd4bf, #0f766e); color: #04211e;
}
.brand-mark .icon { stroke-width: 2.2; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 4px 12px 16px; }
.nav-section { margin-top: 18px; }
.nav-label { padding: 0 10px 6px; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sidebar-muted); }
.nav-link {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px;
  color: var(--sidebar-text); font-size: 0.92rem; font-weight: 500;
}
.nav-link:hover { background: var(--sidebar-hover); color: var(--sidebar-strong); text-decoration: none; }
.nav-link.active { background: var(--sidebar-active); color: var(--sidebar-active-text); }
.nav-link .badge { margin-left: auto; }
.nav-link.disabled { opacity: 0.45; pointer-events: none; }
.nav-soon { margin-left: auto; font-size: 0.68rem; color: var(--sidebar-muted); border: 1px solid var(--sidebar-border); border-radius: 999px; padding: 0 7px; }

.book-switcher { position: relative; margin: 2px 0 4px; }
.book-switcher-btn {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px;
  background: var(--sidebar-btn-bg); border: 1px solid var(--sidebar-border); border-radius: 10px;
  color: var(--sidebar-strong); cursor: pointer; text-align: left; font: inherit;
}
.book-switcher-btn:hover { background: var(--sidebar-hover); }
.book-switcher-name { flex: 1; min-width: 0; font-weight: 600; font-size: 0.9rem; }
.book-switcher-sub { display: block; font-size: 0.74rem; color: var(--sidebar-muted); font-weight: 400; }
.book-switcher-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 50;
  background: var(--sidebar-menu-bg); border: 1px solid var(--sidebar-border); border-radius: 10px;
  box-shadow: var(--shadow-lg); padding: 6px; max-height: 320px; overflow-y: auto;
}
.book-switcher-menu a { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 7px; color: var(--sidebar-text); font-size: 0.88rem; }
.book-switcher-menu a:hover { background: var(--sidebar-hover); color: var(--sidebar-strong); text-decoration: none; }
.book-switcher-menu a.current { color: var(--sidebar-active-text); }

.sidebar-footer { border-top: 1px solid var(--sidebar-border); padding: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 9px; color: var(--sidebar-text); }
.user-chip:hover { background: var(--sidebar-hover); text-decoration: none; color: var(--sidebar-strong); }
.user-chip-text { flex: 1; min-width: 0; line-height: 1.25; }
.user-chip-name { font-size: 0.88rem; font-weight: 600; color: var(--sidebar-strong); }
.user-chip-mail { font-size: 0.75rem; color: var(--sidebar-muted); }

.sidebar.admin-mode .brand-mark { background: linear-gradient(135deg, #a89bff, #5b49c9); color: #fff; }
.sidebar.admin-mode .nav-link.active { background: var(--admin-active); color: var(--admin-active-text); }
.admin-ribbon { margin: 0 12px 4px; padding: 6px 10px; border-radius: 8px; font-size: 0.75rem; font-weight: 600; color: var(--admin-active-text); background: var(--admin-active); display: flex; gap: 8px; align-items: center; }

.overlay { display: none; }

/* ---- Alt menü (mobil) -------------------------------------------------- */
.bottom-nav { display: none; }

/* ---- Avatar ------------------------------------------------------------ */
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; flex-shrink: 0;
  font-size: 0.8rem; font-weight: 700; color: #fff; background: var(--primary);
}
.avatar-sm { width: 28px; height: 28px; font-size: 0.72rem; }
.avatar-lg { width: 52px; height: 52px; font-size: 1.05rem; }

/* Defter renkleri */
.book-dot { width: 34px; height: 34px; border-radius: 9px; display: inline-grid; place-items: center; flex-shrink: 0; color: #fff; }
.book-dot-sm { width: 26px; height: 26px; border-radius: 7px; }
.book-dot-sm .icon { width: 15px; height: 15px; }
.c-teal { background: #0f9488; } .c-blue { background: #2563eb; } .c-indigo { background: #4f46e5; }
.c-violet { background: #7c3aed; } .c-rose { background: #e11d48; } .c-orange { background: #ea580c; }
.c-amber { background: #d97706; } .c-green { background: #16a34a; } .c-slate { background: #475569; }

/* ---- Sayfa başlığı ----------------------------------------------------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head-text { min-width: 0; }
.page-head p { color: var(--muted); margin-top: 4px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb { display: flex; gap: 6px; align-items: center; font-size: 0.82rem; color: var(--muted); margin-bottom: 6px; }
.breadcrumb a { color: var(--muted); }

/* ---- Kart -------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 16px; }
.grid > .card { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head p { color: var(--muted); font-size: 0.86rem; margin: 2px 0 0; }
.card-body { padding: 20px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.card-danger { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.card-danger .card-head h2 { color: var(--danger); }

.grid { display: grid; gap: 16px; }
.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); align-items: start; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mt-4 { margin-top: 28px; }
.mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; }

/* ---- İstatistik -------------------------------------------------------- */
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.stat-label { font-size: 0.8rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.stat-value { font-size: 1.6rem; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat-sub { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.stat-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); }
.stat-icon.warn { background: var(--warning-soft); color: var(--warning); }
.stat-icon.danger { background: var(--danger-soft); color: var(--danger); }
.stat-icon.info { background: var(--info-soft); color: var(--info); }

/* ---- Düğmeler ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 15px; border-radius: 9px; border: 1px solid transparent;
  font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  text-decoration: none !important; user-select: none;
}
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled, .btn.disabled { opacity: 0.55; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(0.93); }
.btn-danger-ghost { background: transparent; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 0.84rem; border-radius: 8px; }
.btn-icon { width: 38px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn-block { width: 100%; }
.btn-admin { background: var(--admin-accent); color: #fff; }

/* ---- Formlar ----------------------------------------------------------- */
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.label { display: block; font-size: 0.86rem; font-weight: 600; margin-bottom: 6px; color: var(--text-2); }
.label .optional { font-weight: 400; color: var(--faint); }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 9px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-size: 0.93rem; transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7382' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--danger); }
.help { font-size: 0.8rem; color: var(--muted); margin-top: 5px; }
.error { font-size: 0.82rem; color: var(--danger); margin-top: 5px; }
.input-group { display: flex; }
.input-group .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; height: 40px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 0.92rem; }
.check input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--primary); flex-shrink: 0; }
.check-sub { display: block; font-size: 0.8rem; color: var(--muted); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.code-input { font-family: var(--mono); font-size: 1.4rem; letter-spacing: 0.35em; text-align: center; height: 52px; }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid var(--border-strong); border-radius: 9px; cursor: pointer; font-size: 0.88rem; background: var(--surface); }
.choice input:checked + span { border-color: var(--primary); box-shadow: var(--ring); background: var(--primary-soft); }
.choice input:focus-visible + span { box-shadow: var(--ring); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch input { position: absolute; opacity: 0; }
.swatch span { width: 32px; height: 32px; border-radius: 50%; display: block; cursor: pointer; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border-strong); }
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--text); }

.role-option { display: block; padding: 11px 13px; border: 1px solid var(--border-strong); border-radius: 10px; cursor: pointer; }
.role-option + .role-option { margin-top: 8px; }
.role-option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.role-option input { accent-color: var(--primary); }

.perm-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.perm-table th, .perm-table td { padding: 8px 6px; border-bottom: 1px solid var(--border); text-align: left; }
.perm-table td .select { height: 34px; font-size: 0.85rem; }

/* ---- Rozet ------------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 0.74rem; font-weight: 600; white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-primary { background: var(--primary-soft); color: var(--primary-text); }
.badge-admin { background: color-mix(in srgb, var(--admin-accent) 16%, transparent); color: var(--admin-accent); }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---- Uyarı ------------------------------------------------------------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); font-size: 0.9rem; border: 1px solid transparent; margin-bottom: 16px; }
.alert .icon { margin-top: 1px; }
.alert-body { flex: 1; min-width: 0; }
.alert-title { font-weight: 650; }
.alert-success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.alert-danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.alert-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.alert .alert-body p, .alert .alert-body { color: var(--text-2); }
.alert .alert-title { color: inherit; }
.alert-close { background: none; border: 0; color: inherit; cursor: pointer; padding: 2px; opacity: 0.7; }
.alert-close:hover { opacity: 1; }

/* ---- Tablo ------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th { text-align: left; font-size: 0.76rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .actions { text-align: right; white-space: nowrap; }
.table-link { color: var(--text); font-weight: 600; }

/* ---- Liste ------------------------------------------------------------- */
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 13px 20px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item-main { flex: 1; min-width: 0; }
.list-item-title { font-weight: 600; }
.list-item-sub { font-size: 0.82rem; color: var(--muted); }
a.list-item { color: var(--text); }
a.list-item:hover { background: var(--surface-2); text-decoration: none; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline-item { display: flex; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.timeline-item:last-child { border-bottom: 0; }
.timeline-text { flex: 1; min-width: 0; font-size: 0.9rem; }
.timeline-meta { font-size: 0.78rem; color: var(--muted); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; }
.changes { margin-top: 6px; font-size: 0.8rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.changes div + div { margin-top: 2px; }
.changes del { color: var(--danger); text-decoration-color: color-mix(in srgb, var(--danger) 60%, transparent); }
.changes ins { color: var(--success); text-decoration: none; }

/* ---- Defter kartları --------------------------------------------------- */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.book-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); color: var(--text); box-shadow: var(--shadow-sm); transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s; }
a.book-card:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.book-card-head { display: flex; gap: 12px; align-items: center; }
.book-card-name { font-weight: 650; font-size: 1rem; }
.book-card-desc { font-size: 0.85rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.book-card-foot { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--muted); margin-top: auto; }
.book-card.new { border-style: dashed; align-items: center; justify-content: center; color: var(--muted); min-height: 150px; box-shadow: none; }
.book-card.new:hover { color: var(--primary-text); border-color: var(--primary); }

.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.module-tile { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px dashed var(--border-strong); border-radius: 10px; color: var(--muted); font-size: 0.86rem; }
.module-tile .icon { color: var(--faint); }

/* ---- Sekmeler ---------------------------------------------------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 10px 14px; font-size: 0.9rem; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: flex; align-items: center; gap: 7px; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--primary-text); border-bottom-color: var(--primary); }

.seg { display: inline-flex; background: var(--surface-3); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button, .seg a { border: 0; background: none; font: inherit; font-size: 0.82rem; font-weight: 600; color: var(--muted); padding: 5px 10px; border-radius: 7px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.seg .on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---- Açılır menü ------------------------------------------------------- */
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; z-index: 60; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; box-shadow: var(--shadow-lg); padding: 6px; }
.dropdown-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 7px; border: 0; background: none; font: inherit; font-size: 0.88rem; color: var(--text); text-align: left; cursor: pointer; }
.dropdown-item:hover { background: var(--surface-3); text-decoration: none; }
.dropdown-item.danger { color: var(--danger); }
.dropdown-sep { height: 1px; background: var(--border); margin: 6px 0; }
.dropdown-head { padding: 8px 10px; font-size: 0.8rem; color: var(--muted); }

/* ---- Pencere (modal) --------------------------------------------------- */
.modal { border: 0; padding: 0; border-radius: var(--radius-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 40px); }
.modal::backdrop { background: rgba(8, 12, 20, 0.55); backdrop-filter: blur(2px); }
.modal-head { padding: 18px 20px 0; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.modal-body { padding: 14px 20px 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); }
.modal-wide { width: min(720px, calc(100vw - 24px)); }

/* ---- Boş durum --------------------------------------------------------- */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--surface-3); display: inline-grid; place-items: center; margin-bottom: 12px; color: var(--muted); }
.empty h3 { color: var(--text); margin-bottom: 4px; }

/* ---- Duyuru şeridi ----------------------------------------------------- */
.announce { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius); margin-bottom: 12px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm); border-left: 4px solid var(--info); }
.announce-success { border-left-color: var(--success); }
.announce-warning { border-left-color: var(--warning); }
.announce-danger { border-left-color: var(--danger); }

/* ---- Grafik (CSS çubuk) ------------------------------------------------ */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding-top: 8px; }
.bar { flex: 1; background: var(--primary); border-radius: 3px 3px 0 0; min-height: 2px; opacity: 0.85; position: relative; }
.bar:hover { opacity: 1; }
.bar.zero { background: var(--surface-3); }
.bars-axis { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--faint); margin-top: 6px; }

/* ---- Sayfalama --------------------------------------------------------- */
.pagination { display: flex; gap: 4px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 14px; }
.pagination a, .pagination span { min-width: 34px; height: 34px; padding: 0 8px; display: inline-grid; place-items: center; border-radius: 8px; font-size: 0.86rem; font-weight: 600; color: var(--text-2); border: 1px solid var(--border); background: var(--surface); }
.pagination a:hover { background: var(--surface-3); text-decoration: none; }
.pagination .current { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.pagination .disabled { opacity: 0.45; }

/* ---- Kimlik doğrulama sayfaları --------------------------------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.auth-side {
  background: radial-gradient(1200px 600px at -10% -10%, #155e57 0%, transparent 60%),
              radial-gradient(800px 500px at 110% 110%, #1e3a5f 0%, transparent 60%), #0b1220;
  color: #d5dce6; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-side h2 { color: #fff; font-size: 1.9rem; line-height: 1.2; letter-spacing: -0.02em; max-width: 420px; }
.auth-side p { color: #9fb0c3; max-width: 420px; }
.auth-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.auth-points li { display: flex; gap: 12px; align-items: flex-start; color: #c9d3df; font-size: 0.94rem; }
.auth-points .icon { color: #5eead4; margin-top: 2px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 410px; }
.auth-card h1 { margin-bottom: 6px; }
.auth-card .lead { color: var(--muted); margin-bottom: 24px; }
.auth-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 1.1rem; }
.auth-foot { margin-top: 22px; text-align: center; font-size: 0.9rem; color: var(--muted); }
.auth-mobile-brand { display: none; }
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 0.8rem; margin: 18px 0; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; font-family: var(--mono); font-size: 0.98rem; padding: 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.codes span { text-align: center; padding: 4px; }
.qr-box { display: inline-block; padding: 12px; background: #fff; border-radius: 12px; border: 1px solid var(--border); line-height: 0; }
.qr-box img, .qr-box svg { width: 184px; height: 184px; }
.secret { font-family: var(--mono); font-size: 0.95rem; letter-spacing: 0.08em; padding: 10px 12px; background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: 9px; word-break: break-all; }

.copy-field { display: flex; gap: 8px; }
.copy-field .input { font-family: var(--mono); font-size: 0.82rem; }

.legal-content { white-space: pre-line; line-height: 1.7; color: var(--text-2); }

/* ---- Duyarlı ----------------------------------------------------------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-mobile-brand { display: flex; justify-content: center; margin-bottom: 26px; }
  .auth-mobile-brand .auth-brand { color: var(--text); }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: none; width: min(300px, 86vw); }
  .app.menu-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .app.menu-open .overlay { display: block; position: fixed; inset: 0; background: rgba(8, 12, 20, 0.5); z-index: 35; }
  .main { margin-left: 0; padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom)); }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 0 12px; }
  .content { padding: 16px 14px 24px; }
  .grid-3, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .page-head { margin-bottom: 16px; }
  h1 { font-size: 1.3rem; }

  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface); border-top: 1px solid var(--border);
    box-shadow: 0 -4px 16px rgba(16, 24, 40, 0.06);
  }
  .bottom-nav a, .bottom-nav button {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    font: inherit; font-size: 0.68rem; font-weight: 600; color: var(--muted); background: none; border: 0; cursor: pointer;
  }
  .bottom-nav a:hover { text-decoration: none; }
  .bottom-nav .active { color: var(--primary-text); }
  .bottom-nav .icon { width: 22px; height: 22px; }

  /* Tablolar mobilde kart görünümüne geçer */
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr { padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .table-cards tr:last-child { border-bottom: 0; }
  .table-cards td { padding: 3px 0; border: 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table-cards td::before { content: attr(data-label); font-size: 0.78rem; color: var(--muted); text-align: left; font-weight: 600; }
  .table-cards td.primary-cell { text-align: left; display: block; margin-bottom: 4px; }
  .table-cards td.primary-cell::before { display: none; }
  .table-cards td.actions { justify-content: flex-end; padding-top: 8px; }
  .table-cards td.actions::before { display: none; }

  .card-head, .card-body { padding-left: 16px; padding-right: 16px; }
  .list-item, .timeline-item { padding-left: 16px; padding-right: 16px; }
  .hide-mobile { display: none !important; }
}

@media (min-width: 901px) {
  .show-mobile { display: none !important; }
}

@media (max-width: 520px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 13px 14px; }
  .stat-value { font-size: 1.3rem; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .page-actions .btn-icon { flex: 0 0 38px; }
  .book-grid { grid-template-columns: minmax(0, 1fr); }
}

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

/* ==========================================================================
   Finans ekranları (2. aşama)
   ========================================================================== */
.amt-pos { color: var(--success); }
.amt-neg { color: var(--danger); }
.amt-zero { color: var(--muted); }
.amt { font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
.amt-lg { font-size: 1.6rem; font-weight: 750; letter-spacing: -0.02em; }

.hero-stat { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-end; }
.hero-stat .label { margin-bottom: 2px; font-weight: 500; color: var(--muted); font-size: 0.82rem; }

/* Hesap listesi */
.acc-group + .acc-group { margin-top: 16px; }
.acc-row { display: flex; align-items: center; gap: 12px; padding: 13px 20px; border-bottom: 1px solid var(--border); color: var(--text); }
.acc-row:last-child { border-bottom: 0; }
a.acc-row:hover { background: var(--surface-2); text-decoration: none; }
.acc-row-main { flex: 1; min-width: 0; }
.acc-row-title { font-weight: 600; display: flex; gap: 8px; align-items: center; }
.acc-row-sub { font-size: 0.8rem; color: var(--muted); }
.acc-row-right { text-align: right; }
.acc-row-right .acc-row-sub { margin-top: 1px; }

.meter { height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.meter > span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.meter.warn > span { background: var(--warning); }
.meter.danger > span { background: var(--danger); }

/* İşlem listesi */
.tx-day { display: flex; justify-content: space-between; align-items: center; padding: 8px 20px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 0.8rem; font-weight: 600; color: var(--muted); position: sticky; top: var(--topbar-h); z-index: 2; }
.tx-row { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--border); }
.tx-row:hover { background: var(--surface-2); }
.tx-row:last-child { border-bottom: 0; }
.tx-check { width: 18px; height: 18px; accent-color: var(--primary); flex-shrink: 0; }
.tx-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; color: #fff; }
.tx-icon.transfer { background: var(--surface-3); color: var(--text-2); }
.tx-main { flex: 1; min-width: 0; }
.tx-title { font-weight: 600; color: var(--text); display: block; }
a.tx-title:hover { text-decoration: none; color: var(--primary-text); }
.tx-meta { font-size: 0.78rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 2px; align-items: center; }
.tx-meta .dot::before { content: "·"; margin-right: 6px; }
.tx-right { text-align: right; flex-shrink: 0; }
.tx-by { font-size: 0.72rem; color: var(--faint); margin-top: 2px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 0 7px; height: 20px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; background: var(--surface-3); color: var(--text-2); }
.chip-pending { background: var(--warning-soft); color: var(--warning); }

.totals-bar { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.totals-bar .t-label { font-size: 0.75rem; color: var(--muted); }
.totals-bar .t-value { font-weight: 700; font-variant-numeric: tabular-nums; }

.period-nav { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.period-nav .period-label { min-width: 130px; text-align: center; font-weight: 650; font-size: 0.92rem; padding: 0 6px; }

.filter-panel { padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 12px; }
.filter-grid .field { margin-bottom: 10px; }
.filter-grid .input, .filter-grid .select { height: 36px; font-size: 0.88rem; }

.bulk-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 20px; border-bottom: 1px solid var(--border); background: var(--primary-soft); }
.bulk-bar .select, .bulk-bar .input { height: 32px; font-size: 0.85rem; width: auto; min-width: 160px; }

/* İşlem formu */
.type-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: var(--surface-3); padding: 4px; border-radius: 12px; margin-bottom: 18px; }
.type-switch label { position: relative; }
.type-switch input { position: absolute; opacity: 0; pointer-events: none; }
.type-switch span { display: flex; align-items: center; justify-content: center; gap: 6px; height: 40px; border-radius: 9px; font-weight: 650; font-size: 0.92rem; color: var(--muted); cursor: pointer; }
.type-switch input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.type-switch input:checked + span.t-expense { color: var(--danger); }
.type-switch input:checked + span.t-income { color: var(--success); }
.type-switch input:checked + span.t-transfer { color: var(--info); }
.type-switch input:focus-visible + span { box-shadow: var(--ring); }

.amount-input { font-size: 1.6rem; font-weight: 700; height: 56px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.amount-wrap { position: relative; }
.amount-wrap .unit { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }

.split-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.5fr) 36px; gap: 8px; align-items: start; margin-bottom: 8px; }
.split-row .input, .split-row .select { height: 38px; font-size: 0.88rem; }
.split-sum { font-size: 0.85rem; margin-top: 4px; }

.attach-list { display: flex; flex-wrap: wrap; gap: 8px; }
.attach-item { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); font-size: 0.84rem; max-width: 100%; }
.attach-item img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }

.detail-list { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 10px 16px; font-size: 0.92rem; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; }

/* Kategoriler */
.cat-tree { list-style: none; margin: 0; padding: 0; }
.cat-item { display: flex; align-items: center; gap: 10px; padding: 10px 20px; border-bottom: 1px solid var(--border); }
.cat-item.child { padding-left: 52px; }
.cat-item:last-child { border-bottom: 0; }
.cat-item.archived { opacity: 0.55; }
.cat-dot { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.cat-dot .icon { width: 15px; height: 15px; }

.cond-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr) 36px; gap: 8px; margin-bottom: 8px; }

/* İçe aktarma önizleme */
.preview-table { font-size: 0.8rem; }
.preview-table td, .preview-table th { padding: 6px 10px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }

/* Mobil hızlı ekleme düğmesi */
.fab { display: none; }

@media (max-width: 1100px) {
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .tx-row, .acc-row, .cat-item { padding-left: 14px; padding-right: 14px; }
  .cat-item.child { padding-left: 40px; }
  .tx-day { padding-left: 14px; padding-right: 14px; }
  .tx-icon { width: 32px; height: 32px; }
  .filter-panel, .totals-bar, .bulk-bar { padding-left: 14px; padding-right: 14px; }
  .split-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px; }
  .split-row .split-note { grid-column: 1 / 3; }
  .cond-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px; }
  .cond-row .cond-value { grid-column: 1 / 3; }
  .detail-list { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .detail-list dd { margin-bottom: 10px; }
  .fab {
    display: grid; place-items: center; position: fixed; right: 16px; z-index: 31;
    bottom: calc(var(--bottomnav-h) + 16px + env(safe-area-inset-bottom));
    width: 56px; height: 56px; border-radius: 50%; background: var(--primary); color: var(--on-primary);
    box-shadow: var(--shadow-lg);
  }
  .fab .icon { width: 26px; height: 26px; }
  .tx-check { display: none; }
}

@media (max-width: 520px) {
  .filter-grid { grid-template-columns: minmax(0, 1fr); }
  .amt-lg { font-size: 1.35rem; }
  .period-nav .period-label { min-width: 100px; }
}

/* ===================== Aşama 2b ===================== */

/* Üst çubuk: arama, hızlı düğmeler, tutar gizleme */
.topbar-search { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px; min-width: 220px; max-width: 360px; flex: 1;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; color: var(--muted); }
.topbar-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.topbar-search input { border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 0.9rem; flex: 1; min-width: 0; }
.topbar-search kbd { font: 600 0.72rem/1 inherit; padding: 3px 6px; border-radius: 5px; border: 1px solid var(--border-strong); color: var(--muted); }
.btn-soft { background: var(--primary-soft); color: var(--primary-text); }
.btn-soft:hover { background: color-mix(in srgb, var(--primary) 18%, var(--surface)); }
@media (max-width: 1180px) { .hide-tablet { display: none !important; } }

.privacy-on { display: none; }
html[data-privacy="on"] .privacy-on { display: inline-flex; }
html[data-privacy="on"] .privacy-off { display: none; }
html[data-privacy="on"] .amt, html[data-privacy="on"] .stat-value, html[data-privacy="on"] .money,
html[data-privacy="on"] .tx-by.num { filter: blur(7px); user-select: none; }
html[data-privacy="on"] .amount-input input { filter: none; }

/* İşlem türü etiketi (defter.net tarzı) */
.tx-type { font-size: 0.68rem; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; padding: 2px 6px; border-radius: 5px; white-space: nowrap; }
.tx-type.t-income, .tx-type.t-collection { color: var(--success); background: var(--success-soft); }
.tx-type.t-expense, .tx-type.t-payment { color: var(--danger); background: var(--danger-soft); }
.tx-type.t-transfer { color: var(--info); background: var(--info-soft); }
.tx-type.t-debit, .tx-type.t-credit { color: var(--warning); background: var(--warning-soft); }
.tx-time { font-size: 0.74rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.tx-meta a { color: var(--primary-text); }

/* Aylık özet satırı */
.tx-month { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 10px 20px;
  background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 0.82rem; color: var(--muted); }
.tx-month strong { color: var(--text); }
.tx-total { display: flex; justify-content: flex-end; gap: 14px; align-items: baseline; padding: 14px 20px; font-size: 0.88rem; color: var(--muted); }
.tx-total .amt { font-size: 1.15rem; font-weight: 750; }

/* Hesap grubu toplamı */
.group-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.group-total { font-weight: 650; font-size: 0.9rem; }

/* Yan yana hesap görünümü (masaüstü) */
.acc-split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.acc-split-list { position: sticky; top: calc(var(--topbar-h) + 16px); max-height: calc(100vh - var(--topbar-h) - 32px); overflow: auto; margin: 0; }
.acc-split-list .acc-group { padding: 8px 14px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted);
  background: var(--surface-2); border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 8px; }
.acc-mini { display: flex; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text); font-size: 0.88rem; }
.acc-mini:hover { background: var(--surface-2); text-decoration: none; }
.acc-mini.active { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.acc-mini small { display: block; color: var(--muted); font-size: 0.74rem; }
@media (max-width: 1100px) { .acc-split { grid-template-columns: minmax(0, 1fr); } .acc-split-list { display: none; } }

/* Hızlı işlem satırı */
.quick-add { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 150px; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }
.quick-add .qa-row2 { grid-column: 1 / -1; display: grid; grid-template-columns: 150px 100px minmax(0, 1fr) auto auto; gap: 8px; }
.quick-add .input, .quick-add .select { height: 40px; }
.quick-add .btn-in { background: var(--success-soft); color: var(--success); font-weight: 700; }
.quick-add .btn-out { background: var(--danger-soft); color: var(--danger); font-weight: 700; }
.quick-add .qa-error { grid-column: 1 / -1; color: var(--danger); font-size: 0.82rem; }
@media (max-width: 700px) {
  .quick-add { grid-template-columns: minmax(0, 1fr) 120px; padding: 12px 14px; }
  .quick-add .qa-desc { grid-column: 1 / -1; }
  .quick-add .qa-row2 { grid-template-columns: minmax(0, 1fr) 90px; }
  .quick-add .qa-row2 .qa-cat { grid-column: 1 / -1; }
}

/* Cari */
.contact-avatar { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 0.85rem; flex-shrink: 0; }
.contact-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); color: var(--text); }
.contact-row:hover { background: var(--surface-2); text-decoration: none; }
.contact-row:last-child { border-bottom: 0; }
.contact-row-main { flex: 1; min-width: 0; }
.contact-row-title { font-weight: 600; display: flex; gap: 8px; align-items: center; }
.contact-row-sub { font-size: 0.8rem; color: var(--muted); }
.contact-row-right { text-align: right; }
.bal-label { font-size: 0.74rem; font-weight: 600; }
.bal-label.pos { color: var(--success); } .bal-label.neg { color: var(--danger); } .bal-label.zero { color: var(--muted); }
.action-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.action-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; text-align: left; font: inherit; color: var(--text); box-shadow: var(--shadow-sm); }
.action-tile:hover { border-color: var(--primary); }
.action-tile strong { font-size: 0.92rem; }
.action-tile span { font-size: 0.76rem; color: var(--muted); line-height: 1.35; }
.action-tile .icon { color: var(--primary-text); }
@media (max-width: 760px) { .action-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.due-chip { font-size: 0.72rem; padding: 2px 7px; border-radius: 999px; background: var(--warning-soft); color: var(--warning); font-weight: 600; white-space: nowrap; }
.due-chip.late { background: var(--danger-soft); color: var(--danger); }

/* Ekstre (yazdırma) */
.statement { background: var(--surface); }
.statement-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.statement table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.statement th, .statement td { padding: 7px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.statement th { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.statement .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.statement tfoot td { font-weight: 700; border-top: 2px solid var(--border-strong); }

/* Arama sonuçları */
.search-group-title { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 18px 0 8px; }

@media print {
  .sidebar, .topbar, .bottom-nav, .fab, .page-actions, .no-print, .quick-add, .announce, .alert-close, .overlay { display: none !important; }
  .main { margin-left: 0 !important; }
  .content { padding: 0 !important; max-width: none !important; }
  .card { box-shadow: none !important; border-color: #ccc !important; break-inside: avoid; }
  html[data-privacy="on"] .amt, html[data-privacy="on"] .stat-value { filter: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .acc-split { grid-template-columns: 1fr !important; }
  .acc-split-list { display: none !important; }
}
.type-switch-sm { grid-template-columns: repeat(4, 1fr); margin-bottom: 4px; }
.type-switch-sm span { height: 34px; font-size: 0.84rem; }
.type-switch input:checked + span.t-collection { color: var(--success); }
.type-switch input:checked + span.t-payment { color: var(--danger); }
.type-switch input:checked + span.t-debit, .type-switch input:checked + span.t-credit { color: var(--warning); }
@media (max-width: 520px) { .type-switch-sm { grid-template-columns: repeat(2, 1fr); } }
.seg { flex-wrap: wrap; }

/* Aşama 3: bütçe, hedef */
.text-warning { color: var(--warning); }
.budget-card { margin-bottom: 12px; }
.cat-picker { max-height: 340px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; background: var(--surface); }
.goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.goal-card { display: block; color: var(--text); padding: 18px; }
.goal-card:hover { text-decoration: none; border-color: var(--primary); }
.goal-ring { --p: 0; width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto;
  background: conic-gradient(var(--primary) calc(var(--p) * 1%), var(--surface-3) 0); }
.goal-ring > div { width: 94px; height: 94px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 750; font-size: 1.3rem; }
.goal-ring.done { background: conic-gradient(var(--success) 100%, var(--surface-3) 0); }
.text-center { text-align: center; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 0.72rem; font-weight: 700; display: inline-grid; place-items: center; }
html[data-sidebar="collapsed"] .nav-badge { position: absolute; top: 4px; right: 6px; margin: 0; min-width: 16px; height: 16px; font-size: 0.62rem; padding: 0 4px; }
.nav-link { position: relative; }

/* Aşama 4: araç, gayrimenkul, belge */
.validity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.validity-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--surface); box-shadow: var(--shadow-sm); border-left-width: 4px; }
.validity-card.v-ok { border-left-color: var(--success); }
.validity-card.v-soon { border-left-color: var(--warning); background: color-mix(in srgb, var(--warning-soft) 50%, var(--surface)); }
.validity-card.v-expired { border-left-color: var(--danger); background: color-mix(in srgb, var(--danger-soft) 50%, var(--surface)); }
.validity-card.v-none { border-left-color: var(--border-strong); }
.chip-on { background: var(--primary); color: var(--on-primary); }
a.chip { text-decoration: none; }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.asset-card { display: block; color: var(--text); margin: 0; }
.asset-card:hover { text-decoration: none; border-color: var(--primary); }
.asset-card .badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.vbadge { font-size: 0.72rem; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--surface-3); color: var(--muted); }
.vbadge.v-ok { background: var(--success-soft); color: var(--success); }
.vbadge.v-soon { background: var(--warning-soft); color: var(--warning); }
.vbadge.v-expired { background: var(--danger-soft); color: var(--danger); }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.doc-card { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.doc-thumb { height: 120px; background: var(--surface-3); display: grid; place-items: center; color: var(--muted); }
.doc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.doc-body { padding: 10px 12px; flex: 1; }
.doc-body .title { font-weight: 600; font-size: 0.9rem; }
.doc-actions { display: flex; gap: 4px; padding: 6px 8px; border-top: 1px solid var(--border); justify-content: flex-end; }

/* Aşama 5: bildirimler */
.bell-btn { position: relative; }
.bell-count { position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 0.66rem; font-weight: 700; display: grid; place-items: center; }
.notif-menu { width: 340px; max-width: calc(100vw - 24px); max-height: 70vh; overflow: auto; }
.notif-row { display: flex; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); color: var(--text); }
.notif-row:hover { background: var(--surface-2); text-decoration: none; }
.notif-row.unread { background: color-mix(in srgb, var(--primary-soft) 55%, var(--surface)); }
.notif-row:last-child { border-bottom: 0; }
.notif-items { margin: 6px 0 0; padding-left: 18px; font-size: 0.84rem; }

/* Grafikler (raporlar) */
:root { --series-1: #2a78d6; --series-2: #eb6834; --viz-grid: #e7e6e2; --viz-axis: #6b6a66; }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) { --series-1: #3987e5; --series-2: #d95926; --viz-grid: #2c2c2a; --viz-axis: #a3a29a; } }
:root[data-theme="dark"] { --series-1: #3987e5; --series-2: #d95926; --viz-grid: #2c2c2a; --viz-axis: #a3a29a; }
.viz { width: 100%; }
.viz-svg { width: 100%; height: auto; display: block; overflow: visible; }
.viz-svg .grid { stroke: var(--viz-grid); stroke-width: 1; }
.viz-svg .grid.base { stroke: var(--viz-axis); opacity: .5; }
.viz-svg .axis { fill: var(--viz-axis); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz-svg .mark.s1, .viz-svg .dot.s1 { fill: var(--series-1); }
.viz-svg .mark.s2 { fill: var(--series-2); }
.viz-svg .line.s1 { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz-svg .area.s1 { fill: var(--series-1); opacity: .08; }
.viz-svg .dot { stroke: var(--surface); stroke-width: 2; }
.viz-svg .hit { fill: transparent; }
.viz-svg .viz-hit:hover .hit, .viz-svg .viz-hit:focus .hit { fill: var(--viz-grid); opacity: .45; }
.viz-svg .viz-hit:focus { outline: none; }
.viz-legend { display: flex; gap: 16px; font-size: 0.82rem; color: var(--text-2); margin-bottom: 6px; flex-wrap: wrap; }
.viz-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.viz-legend .sw.s1 { background: var(--series-1); } .viz-legend .sw.s2 { background: var(--series-2); }
.viz-tip { position: fixed; z-index: 200; pointer-events: none; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: var(--shadow-lg); padding: 8px 10px; font-size: 0.8rem; white-space: pre-line; max-width: 260px; font-variant-numeric: tabular-nums; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 8px 0; }
.hbar .meter { grid-column: 1 / -1; margin-top: 0; height: 8px; }
.hbar .meter > span { background: var(--series-1); }
.hbar.sub { padding: 4px 0 4px 18px; font-size: 0.85rem; }
.hbar.sub .meter { height: 5px; }
.hbar.sub .meter > span { background: color-mix(in srgb, var(--series-1) 55%, var(--surface)); }
.report-table td, .report-table th { text-align: right; }
.report-table td:first-child, .report-table th:first-child { text-align: left; }

/* Notlar */
.note-grid { columns: 280px; column-gap: 14px; }
.note-card { break-inside: avoid; margin-bottom: 14px; border-radius: 12px; padding: 14px 16px 8px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm); border-top: 4px solid var(--nc, var(--border-strong)); }
.note-card.focus { box-shadow: 0 0 0 3px var(--primary-soft), var(--shadow-sm); }
.note-body { white-space: pre-wrap; word-break: break-word; font-size: 0.92rem; margin-top: 6px; color: var(--text-2); max-height: 420px; overflow: auto; }
.note-remind { margin-top: 8px; font-size: 0.78rem; color: var(--warning); display: flex; gap: 6px; align-items: center; }
.note-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 8px; border-top: 1px dashed var(--border); padding-top: 4px; }
.nc-teal { --nc: #14b8a6; } .nc-blue { --nc: #3b82f6; } .nc-indigo { --nc: #6366f1; } .nc-violet { --nc: #8b5cf6; } .nc-rose { --nc: #f43f5e; }
.nc-orange { --nc: #f97316; } .nc-amber { --nc: #f59e0b; } .nc-green { --nc: #22c55e; } .nc-slate { --nc: #64748b; }

/* Randevular */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.cal-h { padding: 6px 8px; font-size: 0.72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.cal-d { min-height: 96px; padding: 4px 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: 0.78rem; }
.cal-d.out { background: var(--surface-2); color: var(--faint); }
.cal-d.today .cal-n { background: var(--primary); color: var(--on-primary); border-radius: 999px; }
.cal-n { display: inline-grid; place-items: center; min-width: 22px; height: 22px; font-weight: 600; }
.cal-ev { display: block; margin-top: 3px; padding: 2px 5px; border-radius: 5px; background: var(--primary-soft); color: var(--primary-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev:hover { text-decoration: none; filter: brightness(.97); }
.cal-ev.st-done { opacity: .55; } .cal-ev.st-cancelled { text-decoration: line-through; opacity: .5; }
@media (max-width: 700px) { .cal-d { min-height: 64px; padding: 2px 3px; } .cal-ev { font-size: 0.66rem; padding: 1px 3px; } }
.appt-time { text-align: center; min-width: 58px; flex-shrink: 0; }
.appt-time .d { font-size: 1.3rem; font-weight: 750; line-height: 1; }
.appt-time .m { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; }
.appt-time .t { font-size: 0.78rem; font-weight: 600; margin-top: 3px; }
.remind-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.remind-chips label { position: relative; }
.remind-chips input { position: absolute; opacity: 0; }
.remind-chips span { display: inline-block; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border-strong); font-size: 0.82rem; cursor: pointer; }
.remind-chips input:checked + span { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.remind-chips input:focus-visible + span { box-shadow: var(--ring); }

/* Anlık bildirim daveti */
.push-banner { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px; margin-bottom: 16px; border-radius: var(--radius); background: var(--primary-soft, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--primary, #14b8a6) 30%, transparent); font-size: 0.9rem; }
.push-banner[hidden] { display: none; }
.push-banner > svg { flex: none; color: var(--primary, currentColor); }
.push-banner-text { flex: 1; min-width: 0; }
@media (max-width: 560px) { .push-banner { flex-wrap: wrap; } .push-banner-text { flex-basis: calc(100% - 70px); } }

/* ==========================================================================
   Renk temaları (data-accent), gece siyahı (data-black), sıkı görünüm (data-density)
   ========================================================================== */
:root[data-accent="blue"] {
  --primary: #1d4ed8; --primary-hover: #1e40af; --primary-soft: #e7eefc; --primary-text: #1e40af; --on-primary: #ffffff;
  --sidebar-active: #e7eefc; --sidebar-active-text: #1e40af; --ring: 0 0 0 3px rgba(29, 78, 216, 0.22);
}
:root[data-theme="dark"][data-accent="blue"] {
  --primary: #5b8def; --primary-hover: #7aa4f5; --primary-soft: rgba(91, 141, 239, 0.15); --primary-text: #93b6ff; --on-primary: #071a3d;
  --sidebar-active: rgba(91, 141, 239, 0.15); --sidebar-active-text: #93b6ff; --ring: 0 0 0 3px rgba(91, 141, 239, 0.3);
}
:root[data-accent="violet"] {
  --primary: #6d28d9; --primary-hover: #5b21b6; --primary-soft: #efe9fc; --primary-text: #5b21b6; --on-primary: #ffffff;
  --sidebar-active: #efe9fc; --sidebar-active-text: #5b21b6; --ring: 0 0 0 3px rgba(109, 40, 217, 0.22);
}
:root[data-theme="dark"][data-accent="violet"] {
  --primary: #a78bfa; --primary-hover: #c4b5fd; --primary-soft: rgba(167, 139, 250, 0.15); --primary-text: #c4b5fd; --on-primary: #1d0f3d;
  --sidebar-active: rgba(167, 139, 250, 0.15); --sidebar-active-text: #c4b5fd; --ring: 0 0 0 3px rgba(167, 139, 250, 0.3);
}
:root[data-accent="rose"] {
  --primary: #be185d; --primary-hover: #9d174d; --primary-soft: #fce8f1; --primary-text: #9d174d; --on-primary: #ffffff;
  --sidebar-active: #fce8f1; --sidebar-active-text: #9d174d; --ring: 0 0 0 3px rgba(190, 24, 93, 0.22);
}
:root[data-theme="dark"][data-accent="rose"] {
  --primary: #f472b6; --primary-hover: #f9a8d4; --primary-soft: rgba(244, 114, 182, 0.14); --primary-text: #f9a8d4; --on-primary: #3b0820;
  --sidebar-active: rgba(244, 114, 182, 0.14); --sidebar-active-text: #f9a8d4; --ring: 0 0 0 3px rgba(244, 114, 182, 0.3);
}
:root[data-accent="forest"] {
  --primary: #15803d; --primary-hover: #166534; --primary-soft: #e5f4ea; --primary-text: #166534; --on-primary: #ffffff;
  --sidebar-active: #e5f4ea; --sidebar-active-text: #166534; --ring: 0 0 0 3px rgba(21, 128, 61, 0.22);
}
:root[data-theme="dark"][data-accent="forest"] {
  --primary: #4ade80; --primary-hover: #86efac; --primary-soft: rgba(74, 222, 128, 0.13); --primary-text: #86efac; --on-primary: #052e14;
  --sidebar-active: rgba(74, 222, 128, 0.13); --sidebar-active-text: #86efac; --ring: 0 0 0 3px rgba(74, 222, 128, 0.3);
}
:root[data-accent="amber"] {
  --primary: #b45309; --primary-hover: #92400e; --primary-soft: #fdf0e1; --primary-text: #92400e; --on-primary: #ffffff;
  --sidebar-active: #fdf0e1; --sidebar-active-text: #92400e; --ring: 0 0 0 3px rgba(180, 83, 9, 0.22);
}
:root[data-theme="dark"][data-accent="amber"] {
  --primary: #f5a524; --primary-hover: #fbbf4d; --primary-soft: rgba(245, 165, 36, 0.14); --primary-text: #fcc96b; --on-primary: #2d1a02;
  --sidebar-active: rgba(245, 165, 36, 0.14); --sidebar-active-text: #fcc96b; --ring: 0 0 0 3px rgba(245, 165, 36, 0.3);
}
:root[data-accent="graphite"] {
  --primary: #334155; --primary-hover: #1e293b; --primary-soft: #eceff3; --primary-text: #1e293b; --on-primary: #ffffff;
  --sidebar-active: #eceff3; --sidebar-active-text: #1e293b; --ring: 0 0 0 3px rgba(51, 65, 85, 0.22);
}
:root[data-theme="dark"][data-accent="graphite"] {
  --primary: #94a3b8; --primary-hover: #cbd5e1; --primary-soft: rgba(148, 163, 184, 0.15); --primary-text: #cbd5e1; --on-primary: #0f172a;
  --sidebar-active: rgba(148, 163, 184, 0.15); --sidebar-active-text: #cbd5e1; --ring: 0 0 0 3px rgba(148, 163, 184, 0.3);
}
:root[data-theme="dark"][data-black="on"] {
  --bg: #000000; --surface: #0b0b0c; --surface-2: #111113; --surface-3: #18181b;
  --border: #222226; --border-strong: #303036;
  --sidebar-bg: #000000; --sidebar-menu-bg: #141416; --sidebar-border: rgba(255, 255, 255, 0.08);
}

/* Sıkı görünüm: daha az boşluk, ekrana daha çok satır */
:root[data-density="compact"] body { font-size: 14px; }
:root[data-density="compact"] .content { padding: 16px 18px; }
:root[data-density="compact"] .card-head { padding: 11px 16px; }
:root[data-density="compact"] .card-body { padding: 14px 16px; }
:root[data-density="compact"] .list-item, :root[data-density="compact"] .acc-row { padding: 9px 16px; }
:root[data-density="compact"] .tx-row { padding: 7px 16px; }
:root[data-density="compact"] .field { margin-bottom: 12px; }
:root[data-density="compact"] .nav-link { padding-top: 6px; padding-bottom: 6px; }
:root[data-density="compact"] .nav-section { margin-top: 12px; }
:root[data-density="compact"] .card + .card, :root[data-density="compact"] .mt-3 { margin-top: 12px; }

/* Görünüm ayarları */
.swatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; font-size: 0.85rem; color: var(--text-2); }
.swatch:hover { border-color: var(--border-strong); }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch-dot { width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35); display: grid; place-items: center; color: #fff; }
.swatch-dot .icon { opacity: 0; width: 16px; height: 16px; }
.swatch:has(input:checked) { border-color: var(--primary); box-shadow: var(--ring); color: var(--text); }
.swatch:has(input:checked) .swatch-dot .icon { opacity: 1; }
.swatch:has(input:focus-visible) { box-shadow: var(--ring); }
.mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mode-card { position: relative; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; cursor: pointer; background: var(--surface); font-size: 0.88rem; text-align: center; }
.mode-card input { position: absolute; opacity: 0; pointer-events: none; }
.mode-card:has(input:checked) { border-color: var(--primary); box-shadow: var(--ring); }
.mode-prev { height: 54px; border-radius: 8px; margin-bottom: 8px; display: flex; overflow: hidden; border: 1px solid var(--border); }
.mode-prev i { display: block; }
.mode-prev .p-side { width: 30%; }
.mode-prev .p-main { flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 5px; }
.mode-prev .p-main b { display: block; height: 7px; border-radius: 4px; }
.mode-light .p-side { background: #f1f3f6; } .mode-light .p-main { background: #fff; } .mode-light b { background: #e3e6ea; } .mode-light b:first-child { background: var(--primary); width: 50%; }
.mode-dark .p-side { background: #0a0f18; } .mode-dark .p-main { background: #121a27; } .mode-dark b { background: #243044; } .mode-dark b:first-child { background: var(--primary); width: 50%; }
.mode-system .p-side { background: linear-gradient(180deg, #f1f3f6 50%, #0a0f18 50%); } .mode-system .p-main { background: linear-gradient(180deg, #fff 50%, #121a27 50%); } .mode-system b { background: #8d97a8; } .mode-system b:first-child { background: var(--primary); width: 50%; }

/* Menü düzenleyici */
.nav-edit-link { display: flex; align-items: center; gap: 8px; margin: 14px 10px 4px; font-size: 0.78rem; color: var(--sidebar-muted); }
.nav-edit-link:hover { color: var(--sidebar-strong); text-decoration: none; }
html[data-sidebar="collapsed"] .nav-edit-link { font-size: 0; justify-content: center; }
.menu-editor { display: grid; gap: 12px; }
.me-group { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.me-group-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.me-group-head .input { height: 34px; font-weight: 600; max-width: 280px; }
.me-list { list-style: none; margin: 0; padding: 6px; min-height: 46px; display: grid; gap: 4px; }
.me-list:empty::after { content: attr(data-empty); display: block; padding: 10px; text-align: center; font-size: 0.82rem; color: var(--faint); border: 1px dashed var(--border-strong); border-radius: 8px; }
.me-item { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.me-item .input { height: 32px; font-size: 0.88rem; border-color: transparent; background: transparent; padding-left: 6px; }
.me-item .input:hover, .me-item .input:focus { border-color: var(--border); background: var(--surface); }
.me-handle { cursor: grab; touch-action: none; display: grid; place-items: center; width: 30px; height: 32px; color: var(--faint); border-radius: 6px; flex: none; }
.me-handle:hover { background: var(--surface-3); color: var(--text-2); }
.me-item > .icon { flex: none; color: var(--muted); }
.me-ghost { opacity: 0.4; }
.me-chosen { box-shadow: var(--shadow-lg); }
.me-hidden { background: transparent; border-style: dashed; }
.me-hidden .me-item { opacity: 0.7; }
.me-bottom { display: flex; flex-wrap: wrap; gap: 8px; }
.me-bottom label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 0.85rem; cursor: pointer; background: var(--surface); }
.me-bottom label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-text); }
.me-bottom input { accent-color: var(--primary); }

.accent-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 12px 8px; }
.accent-dot { width: 24px; height: 24px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: linear-gradient(135deg, var(--c1) 50%, var(--c2) 50%); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.3); }
.accent-dot:hover { transform: scale(1.12); }
.accent-dot:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-link { background: none; border: 0; padding: 0; height: auto; color: var(--primary-text); font: inherit; font-size: 0.9rem; cursor: pointer; }
.btn-link:hover { text-decoration: underline; }
.otp-row { display: flex; gap: 8px; align-items: flex-end; }
.otp-row .field { flex: 1; margin-bottom: 0; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); padding: 3px; background: var(--surface-2); gap: 3px; width: 100%; }
.seg label { flex: 1; text-align: center; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 0.9rem; font-weight: 500; color: var(--text-2); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* Abonelik */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.plan-card { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.plan-card.current { border-color: var(--primary); box-shadow: var(--ring); }
.plan-card h3 { font-size: 1.05rem; }
.plan-price { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; }
.plan-price span { font-size: 0.85rem; font-weight: 500; color: var(--muted); margin-left: 2px; }
.plan-features { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: 0.86rem; color: var(--text-2); flex: 1; }
.plan-features li { display: flex; gap: 6px; align-items: flex-start; }
.plan-features .icon { color: var(--success); flex: none; margin-top: 3px; }
.plan-actions { display: grid; gap: 6px; margin-top: 6px; }
.sms-packs { display: grid; gap: 8px; margin-top: 10px; }
.sms-pack { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); }
.pay-frame { width: 100%; min-height: 640px; border: 0; }
.summary-list { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; font-size: 0.92rem; }
.summary-list .total { font-size: 1.1rem; font-weight: 700; border-top: 1px solid var(--border); padding-top: 8px; }
.text-right { text-align: right; }
.legal-box { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; background: var(--surface-2); }
.legal-box summary { cursor: pointer; padding: 10px 14px; font-weight: 600; font-size: 0.9rem; }
.legal-box-body { max-height: 260px; overflow: auto; padding: 0 14px 12px; font-size: 0.85rem; color: var(--text-2); }
.legal-box-body h2 { font-size: 0.95rem; margin: 12px 0 4px; }
.card.is-off { opacity: .6; }

/* Destek talepleri */
.ticket-row { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); color: var(--text); }
.ticket-row:last-child { border-bottom: 0; }
.ticket-row:hover { background: var(--surface-2); text-decoration: none; }
.ticket-row.unread .strong { font-weight: 700; }
.dot-new { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-right: 6px; vertical-align: middle; }
.thread { display: flex; flex-direction: column; gap: 14px; }
.thread-msg { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; max-width: 92%; }
.thread-msg.from-user { align-self: flex-end; background: var(--surface-2); }
.thread-msg.from-staff { align-self: flex-start; background: var(--primary-soft); border-color: transparent; }
.thread-meta { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 0.82rem; margin-bottom: 6px; }
.thread-body { white-space: normal; overflow-wrap: anywhere; line-height: 1.55; }
.thread-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip-file { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); font-size: 0.8rem; color: var(--text-2); }

/* Yardım merkezi (uygulama içi) */
.help-search { display: flex; gap: 8px; margin-bottom: 20px; }
.help-search .input { flex: 1; }
.help-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.help-cat h2 { display: flex; align-items: center; gap: 8px; font-size: 1rem; margin: 0 0 8px; }
.help-cat ul { list-style: none; margin: 0; padding: 0; }
.help-cat li { padding: 6px 0; border-bottom: 1px dashed var(--border); }
.help-cat li:last-child { border-bottom: 0; }
.help-cat li span { display: block; font-size: 0.8rem; color: var(--muted); }
.help-start { display: flex; gap: 14px; align-items: center; padding: 18px; border-radius: 14px; background: var(--primary-soft); margin-bottom: 20px; color: var(--text); }
.help-start:hover { text-decoration: none; filter: brightness(0.98); }
.help-article { line-height: 1.7; }
.help-article h2 { font-size: 1.15rem; margin: 1.4em 0 0.5em; }
.help-article h3 { font-size: 1rem; margin: 1.2em 0 0.4em; }
.help-article ol, .help-article ul { padding-left: 1.4em; }
.help-article li { margin: 0.3em 0; }
.help-article .tip { padding: 10px 14px; border-radius: 10px; background: var(--surface-2); border-left: 3px solid var(--primary); margin: 1em 0; }
.help-nav { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.help-more { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 0.92rem; }
.perm-table th.perm-group { background: var(--surface-2); font-size: 0.75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

/* İşletme: personel, kasa, stok */
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 0.82rem; color: #fff; flex-shrink: 0; }
.avatar-lg { width: 52px; height: 52px; font-size: 1.05rem; }
.staff-row { color: var(--text); }
.staff-row:hover { background: var(--surface-2); text-decoration: none; }
.stats-row .stat { min-width: 0; }
.stats-row a.stat:hover { text-decoration: none; border-color: var(--border-strong); }
@media (max-width: 900px) { .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.att-wrap { overflow-x: auto; }
.att-table { border-collapse: separate; border-spacing: 0; font-size: 0.78rem; min-width: 100%; }
.att-table th, .att-table td { border-bottom: 1px solid var(--border); padding: 3px 2px; text-align: center; white-space: nowrap; }
.att-table th.name, .att-table td.name { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; padding: 6px 10px; min-width: 150px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.att-table th.off { color: var(--muted); background: var(--surface-2); }
.att-table th.today { color: var(--primary-text); }
.att-cell { width: 34px; height: 30px; border: 1px solid transparent; border-radius: 6px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 0.72rem; font-weight: 700; text-align: center; padding: 0; appearance: none; -webkit-appearance: none; cursor: pointer; }
.att-cell:focus { outline: 2px solid var(--primary); }
.att-cell[data-s="present"] { background: var(--success-soft); color: var(--success); }
.att-cell[data-s="half"] { background: color-mix(in srgb, var(--success-soft) 60%, var(--surface-2)); color: var(--success); }
.att-cell[data-s="absent"] { background: var(--danger-soft); color: var(--danger); }
.att-cell[data-s="annual"], .att-cell[data-s="excuse"], .att-cell[data-s="maternity"] { background: var(--info-soft); color: var(--info); }
.att-cell[data-s="sick"] { background: var(--warning-soft); color: var(--warning); }
.att-cell[data-s="unpaid"] { background: var(--surface-3); color: var(--text-2); }
.att-cell[data-s="weekly_off"], .att-cell[data-s="holiday"] { background: transparent; color: var(--muted); border-color: var(--border); }
.att-cell[data-s="holiday_work"] { background: var(--primary-soft); color: var(--primary-text); }
.att-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.78rem; color: var(--muted); }
.att-legend b { display: inline-block; min-width: 24px; text-align: center; border-radius: 5px; padding: 1px 4px; margin-right: 4px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-grid .dow { font-size: 0.72rem; color: var(--muted); text-align: center; }
.cal-day { border: 1px solid var(--border); border-radius: 8px; padding: 6px; min-height: 52px; font-size: 0.75rem; }
.cal-day .n { font-weight: 700; }
.cal-day.off { background: var(--surface-2); color: var(--muted); }
.cal-day .lbl { display: block; margin-top: 4px; font-size: 0.7rem; font-weight: 600; }
.money-input { text-align: right; font-variant-numeric: tabular-nums; }
.table-compact td, .table-compact th { padding: 6px 8px; }
.table-compact .input { height: 32px; font-size: 0.85rem; padding: 0 8px; }
.pos-search { position: relative; }
.pos-search .input { height: 46px; font-size: 1rem; }
.pos-results { position: absolute; z-index: 20; left: 0; right: 0; top: 48px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); max-height: 320px; overflow: auto; }
.pos-result { display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: none; text-align: left; font: inherit; color: var(--text); cursor: pointer; }
.pos-result:hover, .pos-result.on { background: var(--primary-soft); }
.pos-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.pos-quick .chip { height: 30px; padding: 0 12px; font-size: 0.82rem; border: 0; cursor: pointer; }
.pos-lines { margin-top: 10px; }
.pos-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.pos-method { display: flex; align-items: center; justify-content: center; gap: 8px; height: 48px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--surface); font: inherit; font-weight: 600; color: var(--text); cursor: pointer; }
.pos-method.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-text); }
.list-item.highlight { background: var(--success-soft); }
.z-report { font-variant-numeric: tabular-nums; }
.z-report h3 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 16px 0 6px; }
@media print {
  .sidebar, .topbar, .tabs, .page-actions, .no-print, .bottom-nav, .alert { display: none !important; }
  .content { padding: 0 !important; max-width: none !important; }
  .card { box-shadow: none !important; border: 0 !important; }
}
.btn-lg { height: 48px; padding: 0 20px; font-size: 1rem; }
/* Genel bakış: hızlı işlemler ve modül kartları */
.quick-actions { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.quick-actions::-webkit-scrollbar { display: none; }
.quick-action { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600; font-size: 0.88rem; white-space: nowrap; }
.quick-action:hover { border-color: var(--primary); color: var(--primary-text); text-decoration: none; }
.quick-action.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.quick-action.primary:hover { background: var(--primary-hover); color: #fff; }
.module-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.module-card { display: flex; flex-direction: column; }
.module-card-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 6px; color: var(--text); }
.module-card-head strong { flex: 1; }
.module-card-head:hover { text-decoration: none; color: var(--primary-text); }
.module-card-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; padding: 6px 16px 10px; }
.module-card-stats div { display: flex; flex-direction: column; min-width: 0; }
.module-card-stats strong { font-size: 1.02rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.module-card-lines { list-style: none; margin: 0; padding: 0 16px 10px; font-size: 0.84rem; }
.module-card-lines li { padding: 5px 0; border-top: 1px dashed var(--border); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.module-card-foot { margin-top: auto; padding: 0 16px 14px; }

/* ---------- Genel Bakış: Yaklaşan ödemeler paneli ---------- */
.upc-panel { padding: 0; overflow: hidden; }
.upc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; padding: 18px 20px 14px; border-bottom: 1px solid var(--border); }
.upc-title { margin: 0 0 2px; font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.upc-head-side { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.upc-total { display: flex; gap: 14px; flex-wrap: wrap; }
.upc-total-item { display: inline-flex; align-items: baseline; gap: 6px; }
.upc-strip { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 20px 0; }
.upc-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: inherit; text-decoration: none; font-size: 0.85rem; }
.upc-chip:hover { border-color: currentColor; }
.upc-chip-label { font-weight: 600; }
.upc-chip-count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 0.75rem; font-weight: 700; background: var(--surface-2, rgba(127,127,127,.12)); }
.upc-chip-amt { font-size: 0.8rem; opacity: .85; }
.upc-chip.tone-danger { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.upc-chip.tone-warning { color: var(--warning); background: var(--warning-soft); border-color: transparent; }
.upc-chip.tone-primary { color: var(--primary); }
.upc-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; padding: 14px 20px 20px; }
.upc-group { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; border-top: 3px solid var(--border); }
.upc-group.tone-danger { border-top-color: var(--danger); }
.upc-group.tone-warning { border-top-color: var(--warning); }
.upc-group.tone-primary { border-top-color: var(--primary); }
.upc-group-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; font-weight: 600; font-size: 0.9rem; }
.upc-group.tone-danger .upc-group-head { color: var(--danger); }
.upc-group.tone-warning .upc-group-head { color: var(--warning); }
.upc-group-count { font-size: 0.75rem; color: var(--muted); font-weight: 600; }
.upc-list { list-style: none; margin: 0; padding: 0; }
.upc-list li + li { border-top: 1px solid var(--border); }
.upc-item { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 14px; color: inherit; text-decoration: none; }
.upc-item:hover { background: var(--surface-2, rgba(127,127,127,.06)); }
.upc-date { width: 44px; height: 44px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; background: var(--primary-soft, rgba(127,127,127,.1)); color: var(--primary); }
.upc-item.is-late .upc-date { background: var(--danger-soft); color: var(--danger); }
.upc-day { font-size: 1.05rem; font-weight: 700; }
.upc-mon { font-size: 0.68rem; text-transform: uppercase; margin-top: 2px; letter-spacing: .03em; }
.upc-body { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.upc-name { font-weight: 600; font-size: 0.92rem; }
.upc-sub { font-size: 0.78rem; color: var(--muted); }
.upc-flag { display: inline-block; font-size: 0.7rem; font-weight: 600; padding: 1px 6px; border-radius: 999px; background: var(--surface-2, rgba(127,127,127,.12)); color: var(--muted); margin-right: 4px; }
.upc-flag.late { background: var(--danger-soft); color: var(--danger); }
.upc-flag.today { background: var(--warning-soft); color: var(--warning); }
.upc-amount { text-align: right; white-space: nowrap; font-weight: 600; font-size: 0.92rem; }
.upc-more { display: block; padding: 9px 14px; font-size: 0.82rem; border-top: 1px solid var(--border); margin-top: auto; text-align: center; }
.upc-empty { display: flex; gap: 12px; align-items: center; padding: 20px; color: var(--success, inherit); }
.upc-empty > div { color: var(--text, inherit); }
@media (max-width: 640px) {
    .upc-head, .upc-strip, .upc-groups { padding-left: 14px; padding-right: 14px; }
    .upc-groups { grid-template-columns: 1fr; }
}
