/* ==========================================================================
   Maks Muhasebe — Premium Design System v4
   Renk paleti: Indigo / Violet / Emerald. Dark sidebar + light content.
   Glassmorphism · Micro-animations · SaaS-grade polish.
   ========================================================================== */

/* ──────────────────────────────────────────────────────────────────────────
   KEYFRAME ANIMATIONS
   ────────────────────────────────────────────────────────────────────────── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes glow {
  0%, 100% { box-shadow: 0 0 8px rgba(99,102,241,.25); }
  50%      { box-shadow: 0 0 22px rgba(99,102,241,.55); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(.92) translateY(14px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(42px) scale(.96); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
@keyframes borderGlow {
  0%, 100% { border-color: rgba(99,102,241,.3); }
  50%      { border-color: rgba(139,92,246,.6); }
}

/* ──────────────────────────────────────────────────────────────────────────
   DESIGN TOKENS — LIGHT THEME
   ────────────────────────────────────────────────────────────────────────── */
:root {
  /* Palet */
  --indigo-50:  #eef2ff;
  --indigo-100: #e0e7ff;
  --indigo-200: #c7d2fe;
  --indigo-500: #6366f1;
  --indigo-600: #4f46e5;
  --indigo-700: #4338ca;
  --indigo-900: #1e1b4b;

  /* Semantik */
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
  --primary-glow: 0 4px 24px rgba(99,102,241,.35), 0 1px 6px rgba(139,92,246,.2);
  --primary-soft: rgba(99,102,241,.1);

  /* Yüzeyler */
  --bg: #f5f6fc;
  --surface: #ffffff;
  --surface-2: #f1f3f9;
  --surface-3: #e8ebf4;
  --border: #e2e4ef;
  --border-light: #eff0f8;

  /* Metin */
  --text: #1e1b4b;
  --text-secondary: #374151;
  --text-muted: #6b7280;
  --text-soft: #9ca3af;

  /* Gölgeler */
  --shadow-xs: 0 1px 2px rgba(31,41,55,.05);
  --shadow-sm: 0 2px 8px rgba(99,102,241,.06), 0 1px 3px rgba(0,0,0,.04);
  --shadow:    0 4px 24px rgba(99,102,241,.09), 0 2px 8px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 40px rgba(99,102,241,.13), 0 4px 14px rgba(0,0,0,.06);
  --shadow-xl: 0 24px 68px rgba(99,102,241,.18), 0 8px 24px rgba(0,0,0,.08);

  /* Durum */
  --success: #059669; --success-light: #10b981; --success-soft: #d1fae5;
  --danger:  #dc2626; --danger-light:  #ef4444; --danger-soft:  #fee2e2;
  --warning: #d97706; --warning-light: #f59e0b; --warning-soft: #fef3c7;
  --info:    #0284c7; --info-light:    #0ea5e9; --info-soft:    #e0f2fe;

  /* Layout */
  --sidebar-w: 272px;
  --sidebar-collapsed-w: 82px;
  --header-h: 72px;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Sidebar */
  --sb-bg1: #0f0a2e;
  --sb-bg2: #1a1550;
  --sb-text: rgba(255,255,255,.55);
  --sb-text-hover: rgba(255,255,255,.92);
  --sb-active: rgba(99,102,241,.22);

  /* Extended palette */
  --color-navy-900: #0f0a2e;
  --color-navy-800: #1a1550;
  --color-navy-700: #261f6e;
  --color-blue-600: #4f46e5;
  --color-blue-500: #6366f1;
  --color-turquoise-500: #8b5cf6;
  --color-green-600: #059669;
  --color-orange-500: #d97706;
  --color-red-600: #dc2626;
  --color-gray-950: #1e1b4b;
  --color-gray-700: #374151;
  --color-gray-500: #6b7280;
  --color-gray-100: #f5f6fc;
  --color-white: #ffffff;

  --primary-hover: var(--indigo-700);
  --secondary: var(--indigo-600);
  --accent: var(--color-turquoise-500);
  --accent-soft: rgba(139,92,246,.12);
  --info-soft: rgba(2,132,199,.10);
  --primary-soft: rgba(99,102,241,.1);
  --success-soft: rgba(5,150,105,.1);
  --warning-soft: rgba(217,119,6,.1);
  --danger-soft: rgba(220,38,38,.1);

  --focus-ring: 0 0 0 4px rgba(99,102,241,.18);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ──────────────────────────────────────────────────────────────────────────
   DARK THEME
   ────────────────────────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg: #080d1c;
  --surface: #111827;
  --surface-2: #1a2035;
  --surface-3: #1f2849;
  --border: #1f2937;
  --border-light: #1a2035;
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #6b7280;
  --text-soft: #374151;
  --shadow-xs: 0 1px 3px rgba(0,0,0,.35);
  --shadow-sm: 0 2px 10px rgba(0,0,0,.38);
  --shadow: 0 4px 24px rgba(0,0,0,.5);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.55);
  --shadow-xl: 0 24px 68px rgba(0,0,0,.65);
  --primary: #818cf8;
  --primary-dark: #6366f1;
  --primary-hover: #6366f1;
  --primary-gradient: linear-gradient(135deg, #818cf8 0%, #a78bfa 50%, #c4b5fd 100%);
  --primary-soft: rgba(129,140,248,.12);
  --primary-glow: 0 4px 24px rgba(129,140,248,.3);
  --accent: #a78bfa;
  --accent-soft: rgba(167,139,250,.15);
  --secondary: #818cf8;
  --success: #10b981; --success-soft: #022c22;
  --danger:  #ef4444; --danger-soft:  #2d1010;
  --warning: #f59e0b; --warning-soft: #291d05;
  --info:    #0ea5e9; --info-soft:    #031e2f;
  --sb-bg1: #050810;
  --sb-bg2: #0f172a;
  --focus-ring: 0 0 0 4px rgba(129,140,248,.16);
}

/* ──────────────────────────────────────────────────────────────────────────
   RESET & BASE
   ────────────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background .35s ease, color .35s ease;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(ellipse 1200px 600px at 20% -5%, rgba(99,102,241,.06) 0%, transparent 70%),
    linear-gradient(180deg, rgba(255,255,255,.5) 0%, transparent 300px),
    var(--bg);
  color: var(--text);
  letter-spacing: 0;
}

a { color: inherit; text-decoration: none; transition: color .15s ease; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }

/* Scrollbar global */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(99,102,241,.18); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,.3); }

/* ──────────────────────────────────────────────────────────────────────────
   LAYOUT SHELL
   ────────────────────────────────────────────────────────────────────────── */
.app { display: flex; min-height: 100vh; background: var(--bg); }

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
  min-width: 0; max-width: 100%;
  transition: margin-left .25s cubic-bezier(.4,0,.2,1);
}
body.sidebar-collapsed .main { margin-left: var(--sidebar-collapsed-w); }

/* ══════════════════════════════════════════════════════════════════════════
   SIDEBAR — Premium Dark Indigo with Radial Glow
   ══════════════════════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  background:
    radial-gradient(ellipse 300px 400px at 20% 5%, rgba(99,102,241,.18) 0%, transparent 70%),
    radial-gradient(ellipse 200px 300px at 80% 90%, rgba(139,92,246,.12) 0%, transparent 70%),
    linear-gradient(175deg, var(--sb-bg1) 0%, var(--sb-bg2) 55%, #0c0828 100%);
  border-right: 1px solid rgba(255,255,255,.06);
  position: fixed; top: 0; left: 0; bottom: 0;
  display: flex; flex-direction: column;
  padding: 16px 12px;
  z-index: 40;
  transition: width .25s cubic-bezier(.4,0,.2,1), transform .25s cubic-bezier(.4,0,.2,1);
  box-shadow: 4px 0 30px rgba(15,10,46,.3);
  overflow: hidden;
}
body.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed-w); }

/* Subtle radial glow overlay */
.sidebar::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 180px 200px at 50% 0%, rgba(99,102,241,.2) 0%, transparent 65%),
    radial-gradient(ellipse 120px 120px at 15% 50%, rgba(139,92,246,.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Sidebar scrollbar */
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 10px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.16); }

/* ── Brand ── */
.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px 18px;
  min-height: 58px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  position: relative; z-index: 1;
}
.brand-logo {
  width: 36px; height: 36px; border-radius: 11px;
  background: var(--primary-gradient);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 18px;
  box-shadow: 0 4px 14px rgba(99,102,241,.35);
  border: 1px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
  transition: all .3s cubic-bezier(0.4,0,0.2,1);
}
.brand-logo:hover {
  transform: scale(1.08) rotate(-3deg);
  box-shadow: 0 4px 18px rgba(99,102,241,.5), 0 0 0 2px rgba(99,102,241,.15);
}
.brand-name { font-weight: 800; font-size: 15px; color: #fff; letter-spacing: -.2px; }
.brand-sub { font-size: 10px; color: rgba(255,255,255,.4); letter-spacing: .02em; margin-top: 1px; }
body.sidebar-collapsed .brand { justify-content: center; padding-left: 0; padding-right: 0; }
body.sidebar-collapsed .brand-name,
body.sidebar-collapsed .brand-sub,
body.sidebar-collapsed .nav-section,
body.sidebar-collapsed .nav-item span,
body.sidebar-collapsed .submenu-arrow { display: none; }

/* ── Nav ── */
.nav {
  display: flex; flex-direction: column; gap: 2px;
  margin-top: 4px; flex: 1;
  overflow-y: auto; padding: 6px 0;
  position: relative; z-index: 1;
}
.nav-section {
  font-size: 10.5px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase;
  color: rgba(255,255,255,.3); padding: 18px 14px 6px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  transition: all .2s ease;
}
.nav-section:hover {
  color: rgba(255,255,255,.7);
}
.section-arrow {
  font-size: 9px;
  transition: transform .2s ease;
  display: inline-block;
  opacity: 0.7;
}
.nav-section-group:not(.open) .section-arrow {
  transform: rotate(-90deg);
}
.nav-section-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: max-height .3s cubic-bezier(0.4, 0, 0.2, 1), opacity .25s ease;
  max-height: 800px;
  opacity: 1;
}
.nav-section-group:not(.open) .nav-section-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}
.nav-section::after {
  content: '';
  position: absolute; bottom: 0; left: 14px; right: 14px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,.04), transparent);
}

.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 14px; min-height: 40px;
  border-radius: 10px;
  color: rgba(255,255,255,.65); font-weight: 500; font-size: 13.5px;
  transition: all .2s cubic-bezier(.4,0,.2,1);
  position: relative; cursor: pointer;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; transition: transform .2s ease; }
.nav-item:hover {
  background: rgba(255,255,255,.06);
  box-shadow: 0 4px 12px rgba(99,102,241,0.06), inset 0 1px 0 rgba(255,255,255,0.03);
  color: #fff;
  transform: translateX(4px);
}
.nav-item:hover svg { transform: scale(1.08); }

.nav-item.active {
  background: linear-gradient(135deg, rgba(99,102,241,.24), rgba(139,92,246,.18));
  color: #ffffff; font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 4px 16px rgba(99,102,241,.18);
  border: 1px solid rgba(99, 102, 241, 0.25);
}
.nav-item.active::before {
  content: ''; position: absolute;
  left: 0; top: 6px; bottom: 6px; width: 3.5px;
  background: linear-gradient(180deg, #6366f1, #a78bfa);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 12px rgba(99,102,241,.6);
}
.nav-item.is-disabled { opacity: .42; cursor: default; }
.nav-item.is-disabled:hover { background: transparent; color: rgba(255,255,255,.65); transform: none; }

body.sidebar-collapsed .nav-item { justify-content: center; padding-left: 0; padding-right: 0; }
body.sidebar-collapsed .nav-item::after {
  content: attr(data-tooltip);
  position: fixed;
  left: calc(var(--sidebar-collapsed-w) + 10px);
  background: var(--color-navy-900);
  color: #fff;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-6px);
  transition: all .18s cubic-bezier(.4,0,.2,1);
  box-shadow: var(--shadow-lg);
  z-index: 999;
}
body.sidebar-collapsed .nav-item:hover::after { opacity: 1; transform: translateX(0); }

/* ── Nav submenu ── */
.nav-submenu {
  display: grid; gap: 2px; margin: 4px 0 6px 12px;
  padding-left: 10px;
  border-left: 1.5px solid rgba(255, 255, 255, 0.05);
  transition: max-height .25s cubic-bezier(0.4, 0, 0.2, 1), opacity .2s ease;
  max-height: 300px;
  opacity: 1;
  position: relative;
}
.nav-group:not(.open) .nav-submenu {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}
.nav-submenu .nav-item {
  min-height: 34px;
  padding: 6px 12px;
  padding-left: 14px;
  font-size: 12.5px;
  border-radius: 8px;
}
.nav-submenu .nav-item::before {
  content: '';
  position: absolute;
  left: -11.5px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  transition: background 0.2s ease, transform 0.2s ease;
}
.nav-submenu .nav-item:hover::before {
  background: var(--primary);
  transform: translateY(-50%) scale(1.4);
}
.nav-submenu .nav-item.active::before {
  background: var(--primary);
  transform: translateY(-50%) scale(1.4);
  box-shadow: 0 0 6px var(--primary);
}

body.sidebar-collapsed .nav-submenu { display: none; }
.submenu-arrow { margin-left: auto; font-size: 11px; color: rgba(255,255,255,.4); transition: transform .2s ease; }
.nav-group.open .submenu-arrow {
  transform: rotate(180deg);
}

/* ── Sidebar footer ── */
.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,.06);
  padding-top: 10px;
  margin-top: 6px;
  position: relative; z-index: 1;
}
.sidebar-footer .nav-item { color: rgba(255,255,255,.45); }
.sidebar-footer .nav-item:hover { color: var(--danger-light); background: rgba(239,68,68,.1); transform: translateX(3px); }

/* ══════════════════════════════════════════════════════════════════════════
   HEADER — Frosted Glass
   ══════════════════════════════════════════════════════════════════════════ */
.header {
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border-bottom: 1px solid rgba(226, 228, 239, 0.4);
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px; padding: 0 20px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.02);
  transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
}
[data-theme="dark"] .header {
  background: rgba(15, 23, 42, 0.45);
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

.header-title-block { min-width: 190px; display: grid; gap: 3px; }
.page-title {
  font-size: 20px; font-weight: 750; letter-spacing: -.4px; color: var(--text);
  background: linear-gradient(135deg, var(--text) 0%, var(--indigo-700) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
[data-theme="dark"] .page-title {
  background: linear-gradient(135deg, #f1f5f9 0%, #a5b4fc 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex; align-items: center; gap: 7px;
  color: var(--text-muted); font-size: 12px;
}
.breadcrumb span:last-child { color: var(--text-secondary); font-weight: 600; }

/* ── Search ── */
.search-box { position: relative; flex: 1; max-width: 440px; }
.search-box svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--text-soft);
  transition: color .2s ease;
}
.search-box input {
  width: 100%; height: 38px; padding: 0 16px 0 38px;
  border-radius: 10px; border: 1.5px solid var(--border);
  background: rgba(255, 255, 255, 0.5); color: var(--text); font-size: 13px;
  outline: none; transition: all .25s cubic-bezier(.4,0,.2,1);
}
[data-theme="dark"] .search-box input {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}
.search-box input:focus {
  border-color: var(--primary); background: var(--surface);
  box-shadow: 0 0 0 3px var(--primary-soft), 0 4px 12px rgba(99,102,241,.08);
}
.search-box input:focus ~ svg { color: var(--primary); }

.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-xl); overflow: hidden; z-index: 50;
  max-height: 380px; overflow-y: auto;
  animation: slideUp .2s ease;
}
.search-results .sr-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 16px;
  cursor: pointer; transition: background .15s ease;
}
.search-results .sr-item:hover { background: var(--surface-2); }
.sr-tag {
  font-size: 10px; padding: 3px 9px; border-radius: 20px;
  background: var(--primary-soft); color: var(--primary); font-weight: 700;
}

/* ── Header actions ── */
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border-light);
  transition: all .2s cubic-bezier(.4,0,.2,1); position: relative;
  cursor: pointer;
}
.icon-btn:hover {
  background: var(--surface-3); color: var(--text); border-color: var(--border);
  transform: translateY(-2px); box-shadow: var(--shadow-sm);
}
.icon-btn:active { transform: translateY(0); }
.icon-btn svg { width: 17px; height: 17px; }

.icon-btn.quick-action {
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  box-shadow: 0 4px 12px rgba(99,102,241,0.25);
}
.icon-btn.quick-action:hover {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 6px 16px rgba(99,102,241,0.4);
  transform: translateY(-2px) scale(1.04);
}

.icon-btn .notification-dot {
  position: absolute; top: 6px; right: 6px; width: 8px; height: 8px;
  border-radius: 999px; background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  animation: pulse 1.8s ease-in-out infinite;
}

.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 12px 5px 6px; border-radius: 13px;
  background: var(--surface-2); border: 1px solid var(--border-light);
  transition: all .2s ease;
}
.user-chip:hover { box-shadow: var(--shadow-sm); border-color: var(--border); }

.avatar {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #a78bfa 0%, #6366f1 100%);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px;
  box-shadow: 0 4px 12px rgba(99,102,241,0.18);
  border: 1.5px solid rgba(255,255,255,0.25);
  transition: all 0.2s ease;
}
.avatar:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 16px rgba(99,102,241,0.3);
}
.user-chip:hover .avatar { transform: scale(1.06); }
.user-chip .u-name { font-size: 13px; font-weight: 600; line-height: 1.1; }
.user-chip .u-role { font-size: 11px; color: var(--text-soft); display: flex; align-items: center; gap: 4px; }

.company-chip,
.date-chip {
  height: 40px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text-secondary);
  font-size: 12.5px; font-weight: 600;
  transition: all .15s ease;
}
.company-chip:hover, .date-chip:hover { border-color: var(--primary); background: var(--primary-soft); }

.quick-action {
  background: var(--primary-gradient); color: #fff;
  box-shadow: var(--primary-glow);
  transition: all .2s ease;
}
.quick-action:hover { color: #fff; filter: brightness(1.06); transform: translateY(-1px); }

/* ══════════════════════════════════════════════════════════════════════════
   CONTENT
   ══════════════════════════════════════════════════════════════════════════ */
.content { padding: 28px; flex: 1; min-width: 0; max-width: 100%; }
.content > h1,
.page-heading {
  font-size: 25px; line-height: 1.2; font-weight: 800;
  color: var(--text); margin-bottom: 6px;
}

/* ══════════════════════════════════════════════════════════════════════════
   CARDS — Refined shadows & radius
   ══════════════════════════════════════════════════════════════════════════ */
.card,
.summary-card,
.filter-panel {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .25s ease, transform .25s ease;
  min-width: 0;
}
.card:hover,
.stat-card:hover { box-shadow: var(--shadow); }

.card-pad { padding: 22px; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border-light);
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
}
.card-header h3 { font-size: 15px; font-weight: 700; color: var(--text); }

.hero-card {
  background:
    radial-gradient(900px 220px at 0% 0%, var(--primary-soft) 0%, transparent 60%),
    var(--surface);
}

.metric-card {
  border-left: 3px solid color-mix(in srgb, var(--primary) 50%, transparent);
}

/* Inline icon+text pairs */
.info-strip { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--text-muted); }
.info-strip span { display: inline-flex; align-items: center; gap: 5px; }
.info-strip svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════════════════════
   STAT CARDS — Gradient accent bar + decorative circles + hover lift
   ══════════════════════════════════════════════════════════════════════════ */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(218px, 1fr)); gap: 16px; }

.stat-card {
  background: linear-gradient(180deg, rgba(255,255,255,.97), rgba(255,255,255,1)), var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 22px 22px 20px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .25s cubic-bezier(.4,0,.2,1), box-shadow .25s ease;
}
[data-theme="dark"] .stat-card,
[data-theme="dark"] .summary-card { background: var(--surface); }

/* Gradient top accent bar */
.stat-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #a78bfa);
  border-radius: var(--radius) var(--radius) 0 0;
}
/* Decorative circles */
.stat-card::before {
  content: ''; position: absolute; top: -45px; right: -45px;
  width: 130px; height: 130px; border-radius: 50%;
  background: radial-gradient(circle, var(--primary-soft) 0%, transparent 70%);
  pointer-events: none;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.stat-icon {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  margin-bottom: 16px; position: relative;
  transition: transform .2s ease;
}
.stat-card:hover .stat-icon { transform: scale(1.05); }
.stat-icon svg { width: 22px; height: 22px; }
.stat-label { font-size: 12.5px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.stat-value { font-size: 27px; font-weight: 800; letter-spacing: -.7px; margin-top: 5px; color: var(--text); }
.stat-sub { font-size: 12px; color: var(--text-soft); margin-top: 4px; }

/* Stat card tone sistemi — zengin degradeler */
.tone-primary { background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%); color: #4338ca; }
.tone-success { background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%); color: #065f46; }
.tone-danger  { background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%); color: #991b1b; }
.tone-warning { background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); color: #92400e; }
.tone-info    { background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%); color: #0c4a6e; }
[data-theme="dark"] .tone-primary { background: rgba(99,102,241,.2);  color: #a5b4fc; }
[data-theme="dark"] .tone-success { background: rgba(16,185,129,.18); color: #6ee7b7; }
[data-theme="dark"] .tone-danger  { background: rgba(239,68,68,.18);  color: #fca5a5; }
[data-theme="dark"] .tone-warning { background: rgba(245,158,11,.18); color: #fcd34d; }
[data-theme="dark"] .tone-info    { background: rgba(14,165,233,.18); color: #7dd3fc; }

/* ══════════════════════════════════════════════════════════════════════════
   GRID HELPERS
   ══════════════════════════════════════════════════════════════════════════ */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.section-gap { margin-top: 20px; }
.flex { display: flex; }
.between { justify-content: space-between; }
.center { align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.wrap { flex-wrap: wrap; }

/* ══════════════════════════════════════════════════════════════════════════
   BUTTONS — Gradient primary, ghost borders, danger soft
   ══════════════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; min-height: 40px; padding: 0 18px; border-radius: 11px;
  font-weight: 600; font-size: 13.5px; border: 1px solid transparent;
  white-space: nowrap; cursor: pointer;
  transition: all .2s cubic-bezier(.4,0,.2,1);
  position: relative; overflow: hidden;
}
.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: var(--primary-gradient); color: #fff; border-color: transparent;
  box-shadow: var(--primary-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(99,102,241,.5), 0 2px 8px rgba(139,92,246,.3);
  filter: brightness(1.08);
}
.btn-primary:active { transform: translateY(0); box-shadow: var(--primary-glow); }

.btn-ghost {
  background: var(--surface); color: var(--text-secondary);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--surface-3); border-color: var(--border);
  transform: translateY(-1px); box-shadow: var(--shadow-xs);
}

.btn-danger {
  background: var(--danger-soft); color: var(--danger); border-color: transparent;
}
.btn-danger:hover {
  background: var(--danger); color: #fff;
  box-shadow: 0 4px 16px rgba(220,38,38,.3);
}

.btn-sm { height: 34px; padding: 0 12px; font-size: 12.5px; border-radius: 9px; }
.btn-icon { width: 34px; height: 34px; padding: 0; justify-content: center; flex-shrink: 0; }

.export-buttons { display: inline-flex; gap: 8px; flex-wrap: wrap; }

/* ══════════════════════════════════════════════════════════════════════════
   TABLES — Header bg, hover rows, rounded corners
   ══════════════════════════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; }
.project-finance-table { overflow: hidden !important; }

table.data { width: 100%; border-collapse: separate; border-spacing: 0; }
table.data th {
  text-align: left; font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; color: var(--text-soft); padding: 13px 18px;
  border-bottom: 2px solid var(--border-light);
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  white-space: nowrap;
  position: relative;
}
table.data th:first-child { border-radius: 12px 0 0 0; }
table.data th:last-child  { border-radius: 0 12px 0 0; }
table.data td {
  padding: 14px 18px; border-bottom: 1px solid var(--border-light);
  font-size: 13.5px; transition: background .12s ease;
}
table.data tbody tr { transition: background .12s ease; }
table.data tbody tr:hover { background: rgba(99,102,241,.04); }
[data-theme="dark"] table.data tbody tr:hover { background: rgba(99,102,241,.06); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tfoot td {
  background: var(--surface-2);
  border-top: 2px solid var(--border);
  font-weight: 700;
}
table.data .row-check { width: 38px; text-align: center; }

.data-table {
  border: 1px solid var(--border-light); border-radius: var(--radius);
  overflow: hidden; background: var(--surface);
}

/* ══════════════════════════════════════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 700; padding: 4px 12px; border-radius: 20px;
  letter-spacing: .1px;
  transition: transform .15s ease;
}
.badge:hover { transform: scale(1.04); }
.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-muted   { background: var(--surface-2);    color: var(--text-muted); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }

/* ══════════════════════════════════════════════════════════════════════════
   FORMS — Better focus states
   ══════════════════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 7px;
  color: var(--text-secondary);
}
.form-control {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 11px;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 13.5px; outline: none;
  transition: all .25s cubic-bezier(.4,0,.2,1);
}
textarea.form-control { height: auto; padding: 11px 14px; resize: vertical; min-height: 88px; }
.form-control:focus {
  border-color: var(--primary); background: var(--surface);
  box-shadow: 0 0 0 4px var(--primary-soft), 0 2px 12px rgba(99,102,241,.08);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mb-0 { margin-bottom: 0 !important; }

/* ══════════════════════════════════════════════════════════════════════════
   MODAL — Backdrop blur + scale animation
   ══════════════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 10, 46, .55);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  display: none; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
}
.modal-overlay.open { display: flex; animation: fadeIn .22s ease; }

.modal {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(99,102,241,.08);
  border: 1px solid var(--border-light);
  width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto;
  animation: popIn .28s cubic-bezier(.175,.885,.32,1.2);
}
.modal.wide { max-width: 740px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border-light);
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
}
.modal-header h3 { font-size: 16.5px; font-weight: 700; }
.modal-body { padding: 22px 24px; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border-light);
  display: flex; gap: 10px; justify-content: flex-end;
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ══════════════════════════════════════════════════════════════════════════
   TABS
   ══════════════════════════════════════════════════════════════════════════ */
.tabs {
  display: flex; gap: 2px; border-bottom: 2px solid var(--border-light);
  margin-bottom: 20px; overflow-x: auto;
}
.tab {
  padding: 10px 14px; font-weight: 600; font-size: 13.5px;
  color: var(--text-muted); border-bottom: 2.5px solid transparent;
  white-space: nowrap; cursor: pointer;
  transition: all .2s ease;
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
}
.tab svg { width: 14px; height: 14px; opacity: .7; }
.tab.active svg { opacity: 1; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }

/* ══════════════════════════════════════════════════════════════════════════
   PROJECT DETAIL — compact hero, horizontal metric strip, dense info rows.
   Tuned for "everything above the fold": vertical rhythm is tight, but no
   font-size is reduced. Prefixed proj- to avoid clashing with the unrelated
   legacy .detail-hero panel used on the cari/stock detail pages.
   ══════════════════════════════════════════════════════════════════════════ */
.proj-hero { padding: 16px 20px; }
.proj-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 16px 28px; flex-wrap: wrap; }
.proj-hero-main { flex: 1; min-width: 300px; display: flex; align-items: center; gap: 14px; }
.proj-avatar {
  width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--primary-gradient); color: #fff;
  box-shadow: var(--primary-glow);
}
.proj-avatar svg { width: 22px; height: 22px; }
.proj-hero-body { min-width: 0; }
.proj-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.proj-title h2 { font-size: 21px; font-weight: 800; margin: 0; line-height: 1.2; }

/* One wrapping line for owner/phone/address/dates/counts — replaces the old
   separate info-strip + chip row, which cost two extra rows of height. */
.proj-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px 14px;
  margin-top: 6px; font-size: 13px; color: var(--text-muted);
}
.proj-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.proj-meta svg { width: 14px; height: 14px; flex-shrink: 0; }
.proj-meta a { color: inherit; text-decoration: none; }
.proj-meta a:hover { color: var(--primary); }
.proj-meta .proj-flag { font-weight: 700; }
.proj-meta .proj-flag.tone-primary { color: var(--primary); }
.proj-meta .proj-flag.tone-warning { color: var(--warning); }
.proj-meta .proj-flag.tone-danger { color: var(--danger); }

.proj-hero-side {
    display: flex;
    flex-direction: row;
    gap: 9px;
    flex-wrap: wrap;
}
  .proj-gauge-head {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 10px;
        font-size: 12.5px;
        font-weight: 600;
        color: var(--text-muted);
        margin-bottom: 4px;
    }
.proj-gauge-head strong { font-size: 15px; font-weight: 800; color: var(--text); }
.proj-gauge-foot { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.proj-bar { height: 7px; border-radius: 4px; background: var(--border); overflow: hidden; }
.proj-bar i { display: block; height: 100%; border-radius: 4px; background: var(--primary-gradient); transition: width .4s ease; }

/* Icon-left metric cards: same type sizes as the stacked .stat-card, roughly
   half the height. */
.proj-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.proj-metric {
  display: flex; align-items: center; gap: 12px; min-width: 0;
  padding: 13px 15px; background: var(--surface);
  border: 1px solid var(--border-light); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.proj-metric .stat-icon { width: 38px; height: 38px; border-radius: 11px; margin: 0; flex-shrink: 0; }
.proj-metric .stat-icon svg { width: 18px; height: 18px; }
.proj-metric-body { min-width: 0; }
.proj-metric .stat-value { font-size: 22px; margin-top: 1px; }

.info-rows { display: grid; }
.info-row {
  display: flex; align-items: center; gap: 12px; padding: 7px 0;
  border-bottom: 1px solid var(--border-light);
}
.info-row:last-child { border-bottom: none; }
.info-row .info-icon {
  width: 28px; height: 28px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center; background: var(--surface-2); color: var(--text-muted);
}
.info-row .info-icon svg { width: 15px; height: 15px; }
.info-row .info-key { font-size: 11.5px; color: var(--text-soft); font-weight: 600; min-width: 92px; }
.info-row .info-val { font-size: 13.5px; font-weight: 600; color: var(--text); word-break: break-word; flex: 1; }
.info-row .info-val a { color: var(--primary); text-decoration: none; }
.info-row .info-val a:hover { text-decoration: underline; }

.compare-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.compare-row .compare-label { min-width: 52px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.compare-row .compare-value { min-width: 118px; text-align: right; font-size: 13.5px; }

@media (max-width: 900px) {
  .proj-hero-side { width: 100%; min-width: 0; }
}
.tab-panel.active { display: block; animation: slideUp .25s ease; }

/* ══════════════════════════════════════════════════════════════════════════
   PAGINATION
   ══════════════════════════════════════════════════════════════════════════ */
.pagination { display: flex; gap: 5px; align-items: center; justify-content: flex-end; margin-top: 16px; }
.pagination button {
  min-width: 36px; height: 36px; border-radius: 9px;
  background: var(--surface-2); color: var(--text-muted);
  font-weight: 600; padding: 0 8px; border: 1px solid var(--border-light);
  transition: all .18s ease;
}
.pagination button:hover:not(:disabled) { background: var(--surface-3); transform: translateY(-1px); }
.pagination button.active {
  background: var(--primary-gradient); color: #fff; border-color: transparent;
  box-shadow: 0 2px 12px rgba(99,102,241,.4);
}
.pagination button:disabled { opacity: .4; cursor: default; }

/* ══════════════════════════════════════════════════════════════════════════
   EMPTY & LOADING — Skeleton with shimmer
   ══════════════════════════════════════════════════════════════════════════ */
.empty,
.empty-state {
  text-align: center; padding: 52px 20px;
  color: var(--text-soft); border-radius: var(--radius);
}
.empty svg { width: 48px; height: 48px; margin-bottom: 14px; opacity: .3; display: block; margin-left: auto; margin-right: auto; }
.empty div { font-size: 14px; color: var(--text-muted); }

.spinner {
  width: 36px; height: 36px; margin: 44px auto;
  border: 3px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .7s linear infinite;
}

.loading-skeleton {
  position: relative; overflow: hidden; min-height: 18px;
  border-radius: 8px; background: var(--surface-3);
}
.loading-skeleton::after {
  content: ""; position: absolute; inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.5) 50%, transparent 100%);
  animation: shimmer 1.5s ease-in-out infinite;
}

/* ══════════════════════════════════════════════════════════════════════════
   TOAST — Slide-in animation
   ══════════════════════════════════════════════════════════════════════════ */
.toast-wrap { position: fixed; top: 18px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-xl);
  padding: 14px 18px; min-width: 260px; max-width: 380px;
  font-weight: 500; font-size: 13.5px;
  display: flex; align-items: center; gap: 10px;
  animation: toastIn .3s cubic-bezier(.175,.885,.32,1.275);
  border-left-width: 5px;
}
.toast span:first-child {
  display: grid; place-items: center; width: 24px; height: 24px;
  border-radius: 999px; background: var(--surface-2); flex-shrink: 0;
}
.toast.success { border-left: 5px solid var(--success); }
.toast.error   { border-left: 5px solid var(--danger); }
.toast.warning { border-left: 5px solid var(--warning); }

/* ══════════════════════════════════════════════════════════════════════════
   CHARTS
   ══════════════════════════════════════════════════════════════════════════ */
.chart-box { position: relative; height: 300px; }
.chart-box.sm { height: 240px; }

/* ══════════════════════════════════════════════════════════════════════════
   REPORTS PAGE
   ══════════════════════════════════════════════════════════════════════════ */
.report-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 18px;
}
.report-filter-card { margin-bottom: 18px; border: 1px solid var(--border-light); }
.report-tabs-card { border: 1px solid var(--border-light); margin-bottom: 18px; }
.report-tabs { margin-bottom: 0; padding: 0 10px; }
.report-tabs .tab { border-bottom-width: 2px; font-size: 13px; color: var(--text-secondary); }
.report-tabs .tab.active { color: var(--primary-dark); border-bottom-color: var(--primary-dark); }
.report-summary-wrap { margin-top: 14px; }
.report-tip-card { border: 1px solid var(--border-light); }
.report-table-card { border: 1px solid var(--border-light); box-shadow: var(--shadow-xs); }
.report-chart-wrap {
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: 12px; padding: 16px;
  min-height: 90px; margin: 14px 0;
}
.report-chart-list { display: grid; gap: 12px; }
.report-chart-row { display: grid; gap: 7px; }
.report-chart-top {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; font-size: 12.5px; color: var(--text-secondary);
}
.report-chart-top strong { color: var(--text); font-size: 13px; }
.report-chart-track {
  width: 100%; height: 9px; border-radius: 999px;
  background: var(--surface-3); overflow: hidden;
}
.report-chart-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, rgba(99,102,241,.9) 0%, rgba(139,92,246,.65) 100%);
  transition: width .6s cubic-bezier(.4,0,.2,1);
}

/* ══════════════════════════════════════════════════════════════════════════
   LOGIN PAGE — Animated gradient background
   ══════════════════════════════════════════════════════════════════════════ */
.login-page {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(ellipse 800px 400px at 20% 20%, rgba(99,102,241,.15) 0%, transparent 60%),
    radial-gradient(ellipse 600px 400px at 80% 80%, rgba(139,92,246,.12) 0%, transparent 60%),
    linear-gradient(135deg, #0f0a2e 0%, #1a1550 40%, #261f6e 70%, #0f0a2e 100%);
  background-size: 100% 100%, 100% 100%, 300% 300%;
  animation: gradientShift 12s ease infinite;
}
.login-card {
  width: 100%; max-width: 400px;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(99,102,241,.08);
  padding: 40px 36px;
  animation: slideUp .5s ease;
}
[data-theme="dark"] .login-card { background: rgba(17,24,39,.9); }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 30px; }
.login-brand .brand-logo { width: 60px; height: 60px; font-size: 28px; border-radius: 18px; animation: float 3s ease-in-out infinite; }
.login-brand h1 { font-size: 22px; font-weight: 800; letter-spacing: -.4px; }
.login-brand p { font-size: 13px; color: var(--text-soft); }
.login-hint { text-align: center; margin-top: 16px; font-size: 12px; color: var(--text-soft); }
.login-hint code { background: var(--surface-2); padding: 2px 7px; border-radius: 6px; font-family: monospace; }

/* ══════════════════════════════════════════════════════════════════════════
   INFO CARD
   ══════════════════════════════════════════════════════════════════════════ */
.info-card {
  border-radius: 12px; padding: 14px 16px; border: 1px solid;
  display: flex; gap: 12px; align-items: flex-start;
  transition: transform .15s ease;
}
.info-card:hover { transform: translateY(-1px); }
.info-card.info    { background: var(--info-soft); border-color: rgba(14,165,233,.25); color: var(--info); }
.info-card.warning { background: var(--warning-soft); border-color: rgba(245,158,11,.25); color: var(--warning); }
.info-card.success { background: var(--success-soft); border-color: rgba(16,185,129,.25); color: var(--success); }

/* ══════════════════════════════════════════════════════════════════════════
   DISTRIBUTION TABLE
   ══════════════════════════════════════════════════════════════════════════ */
.dist-row {
  display: grid; grid-template-columns: 1fr auto auto;
  gap: 8px 16px; align-items: center; padding: 8px 0;
  border-bottom: 1px solid var(--border-light); font-size: 13px;
  transition: background .1s ease;
}
.dist-row:hover { background: var(--surface-2); }
.dist-row:last-child { border-bottom: none; }
.dist-bar { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.dist-bar-fill { height: 100%; background: var(--primary-gradient); border-radius: 3px; transition: width .6s cubic-bezier(.4,0,.2,1); }

/* ══════════════════════════════════════════════════════════════════════════
   CHART OF ACCOUNTS TREE
   ══════════════════════════════════════════════════════════════════════════ */
.account-tree ul { list-style: none; margin: 0; padding-left: 24px; }
.account-tree .tree-root { padding-left: 0; }
.tree-node { position: relative; }
.tree-node.collapsed > ul { display: none; }
.tree-row {
  display: grid;
  grid-template-columns: 32px 86px minmax(180px, 1fr) 76px 112px 112px 112px auto auto 104px;
  gap: 8px; align-items: center; min-height: 42px; padding: 6px 0;
  border-bottom: 1px solid var(--border-light);
  transition: background .1s ease;
}
.tree-row:hover { background: var(--surface-2); }
.tree-row.muted { opacity: .62; }
.tree-toggle { width: 28px; height: 28px; font-weight: 800; transition: transform .15s ease; }
.code-pill {
  display: inline-flex; min-width: 66px; justify-content: center;
  padding: 5px 9px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border-light);
  font-weight: 800; font-variant-numeric: tabular-nums;
}
.tree-title { font-weight: 650; }
.coa-tree-row { cursor: pointer; }
.coa-tree-count { color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.coa-tree-debit { color: var(--danger); font-size: 11.5px; text-align: right; }
.coa-tree-credit { color: var(--success); font-size: 11.5px; text-align: right; }
.coa-tree-balance { font-size: 11.5px; text-align: right; }
.coa-tree-actions { display: flex; justify-content: flex-end; gap: 3px; }
.coa-tree-columns { display: grid; grid-template-columns: 32px 86px minmax(180px, 1fr) 76px 112px 112px 112px auto auto 104px; gap: 8px; align-items: center; padding: 0 0 8px; border-bottom: 1px solid var(--border); color: var(--text-muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }

.coa-detail-modal { width: min(1400px, 96vw); max-width: min(1400px, 96vw); max-height: 92vh; overflow: hidden; }
.coa-detail-modal > .modal-body { max-height: 92vh; padding: 0; overflow: hidden; }
.coa-detail { height: min(92vh, 860px); display: flex; flex-direction: column; background: var(--surface); }
.coa-detail-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--border-light); }
.coa-detail-identity { display: flex; align-items: center; gap: 13px; min-width: 0; }
.coa-detail-code { min-width: 72px; min-height: 44px; display: grid; place-items: center; padding: 0 12px; border-radius: 7px; background: var(--primary-soft); color: var(--primary); font-size: 15px; font-weight: 850; }
.coa-detail-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.coa-detail-title h2 { margin: 0; color: var(--text); font-size: 19px; }
.coa-detail-identity p { margin: 4px 0 0; color: var(--text-muted); font-size: 11.5px; }
.coa-detail-summary { flex: 0 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--border-light); background: var(--surface-2); }
.coa-detail-summary > div { min-width: 0; padding: 13px 18px; border-right: 1px solid var(--border-light); }
.coa-detail-summary > div:last-child { border-right: 0; }
.coa-detail-summary span { display: block; color: var(--text-muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.coa-detail-summary strong { display: block; margin-top: 4px; color: var(--text); font-size: 17px; white-space: nowrap; }
.coa-detail-summary small { display: block; margin-top: 3px; color: var(--text-muted); font-size: 10.5px; }
.coa-ledger-toolbar { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--border-light); }
.coa-ledger-toolbar > div:first-child { display: grid; gap: 2px; }
.coa-ledger-toolbar > div:first-child strong { color: var(--text); font-size: 13px; }
.coa-ledger-toolbar > div:first-child span { color: var(--text-muted); font-size: 10.5px; }
.coa-ledger-toolbar > div:last-child { display: flex; gap: 8px; }
.coa-ledger-toolbar input { width: 260px; }
.coa-ledger-toolbar select { width: 160px; }
.coa-ledger-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; }
.coa-ledger-table { min-width: 1220px; }
.coa-ledger-table thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); box-shadow: inset 0 -1px var(--border-light); }
.coa-ledger-table td { vertical-align: middle; }
.coa-ledger-table td small { display: block; margin-top: 3px; color: var(--text-muted); font-size: 10.5px; }
.coa-ledger-table tbody tr:hover { background: var(--surface-2); }
.coa-ledger-table tr[hidden] { display: none; }
.coa-source-badge { display: inline-flex; align-items: center; min-height: 23px; padding: 0 7px; border-radius: 5px; background: var(--surface-3); color: var(--text-secondary); font-size: 10.5px; font-weight: 750; white-space: nowrap; }
.coa-ledger-empty { min-height: 280px; place-items: center; }
.coa-ledger-empty:not([hidden]) { display: grid; }
.check-line { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); }

@media (max-width: 1100px) {
  .coa-tree-columns { display: none; }
  .tree-row { grid-template-columns: 32px 82px minmax(160px, 1fr) auto auto 100px; }
  .coa-tree-count, .coa-tree-debit, .coa-tree-credit, .coa-tree-balance { display: none; }
}

@media (max-width: 760px) {
  .coa-detail-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .coa-detail-summary > div:nth-child(2) { border-right: 0; }
  .coa-detail-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--border-light); }
  .coa-ledger-toolbar { align-items: stretch; flex-direction: column; }
  .coa-ledger-toolbar > div:last-child { flex-direction: column; }
  .coa-ledger-toolbar input, .coa-ledger-toolbar select { width: 100%; }
}

/* ══════════════════════════════════════════════════════════════════════════
   UTILITIES
   ══════════════════════════════════════════════════════════════════════════ */
.text-muted   { color: var(--text-muted) !important; }
.text-soft    { color: var(--text-soft) !important; }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-primary { color: var(--primary) !important; }
.fw-700 { font-weight: 700; }
.fw-600 { font-weight: 600; }
.fs-13 { font-size: 13px; } .fs-12 { font-size: 12px; } .fs-11 { font-size: 11px; }
.money { font-variant-numeric: tabular-nums; font-weight: 700; }
.money-display { font-variant-numeric: tabular-nums; font-weight: 700; }
.hide { display: none !important; }

/* ══════════════════════════════════════════════════════════════════════════
   MENU TOGGLE
   ══════════════════════════════════════════════════════════════════════════ */
.menu-toggle { display: none; }

/* ══════════════════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .header-title-block,
  .company-chip { display: none; }
}
@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .sidebar {
    width: min(88vw, var(--sidebar-w));
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 40px rgba(15,10,46,.4);
  }
  body.sidebar-collapsed .main,
  .main { margin-left: 0; }
  body.sidebar-collapsed .sidebar { width: min(88vw, var(--sidebar-w)); }
  body.sidebar-collapsed .brand-name,
  body.sidebar-collapsed .brand-sub,
  body.sidebar-collapsed .nav-section,
  body.sidebar-collapsed .nav-item span,
  body.sidebar-collapsed .submenu-arrow { display: initial; }
  body.sidebar-collapsed .nav-item { justify-content: flex-start; padding-left: 14px; padding-right: 14px; }
  body.sidebar-collapsed .nav-submenu { display: grid; }
  .header { padding: 0 14px; }
  .search-box { max-width: none; }
  .date-chip,
  .quick-action,
  .notification-btn { display: none; }
}

/* Date range filter */
.date-range-filter { display: inline-grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; }
.filter-panel { padding: 16px; margin-bottom: 16px; }
.read-only-badge { font-size: 10px; padding: 2px 6px; }

/* ══════════════════════════════════════════════════════════════════════════
   DASHBOARD v3
   ══════════════════════════════════════════════════════════════════════════ */
.dashboard-shell { display: grid; gap: 14px; }
.dashboard-skeleton { display: grid; gap: 10px; }

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(360px, .8fr);
  gap: 16px; align-items: center;
  padding: 18px 24px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(ellipse 400px 250px at 10% 20%, rgba(99,102,241,.25), transparent 60%),
    radial-gradient(ellipse 300px 200px at 90% 80%, rgba(139,92,246,.15), transparent 60%),
    linear-gradient(135deg, #0f0a2e 0%, #1a1550 45%, #261f6e 75%, #0f0a2e 100%);
  color: #fff;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(99,102,241,.15);
  overflow: hidden; position: relative;
}
.dashboard-hero::after {
  content: "";
  position: absolute; inset: auto -80px -140px auto;
  width: 300px; height: 300px; border-radius: 999px;
  background: rgba(255,255,255,.05);
}
.dashboard-hero > * { position: relative; z-index: 1; }
.dashboard-hero .eyebrow {
  display: inline-flex; margin-bottom: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(255,255,255,.1); color: rgba(255,255,255,.8);
  font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  backdrop-filter: blur(8px);
}
.dashboard-hero h1 { font-size: 26px; line-height: 1.1; margin-bottom: 6px; letter-spacing: -.02em; }
.dashboard-hero p { max-width: 680px; color: rgba(255,255,255,.7); font-size: 13px; }

.hero-kpis { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.hero-kpis span {
  display: inline-flex; gap: 6px; align-items: center;
  padding: 6px 12px; border-radius: 8px;
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.8);
  font-size: 11.5px;
  backdrop-filter: blur(6px);
  transition: background .15s ease;
}
.hero-kpis span:hover { background: rgba(255,255,255,.14); }
.hero-kpis strong { color: #fff; }

.dashboard-filter {
  display: grid; gap: 10px;
  padding: 12px; border: 1px solid rgba(255,255,255,.14); border-radius: 10px;
  background: rgba(255,255,255,.06);
  backdrop-filter: blur(12px);
}

.segmented {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px;
}
.segmented button {
  min-height: 30px; border-radius: 6px;
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.7);
  font-weight: 700; font-size: 11.5px;
  transition: all .15s ease;
}
.segmented button:hover { background: rgba(255,255,255,.15); }
.segmented button.active { background: #fff; color: var(--color-navy-900); box-shadow: var(--shadow-sm); }
.custom-range { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; }

/* Dashboard Tabs Navigation */
.dashboard-tabs {
  display: flex;
  gap: 6px;
  padding: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.dashboard-tabs::-webkit-scrollbar {
  display: none;
}
.tab-btn {
  flex: 1;
  min-width: 110px;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.tab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.5);
}
[data-theme="dark"] .tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}
.tab-btn.active {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.tab-pane {
  display: grid;
  gap: 14px;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.tab-pane.hide {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 100%;
  height: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
}

.dashboard-metric-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px; min-width: 0;
}
.dashboard-summary-card {
  grid-column: span 3;
  min-height: 120px; display: grid; gap: 4px; padding: 12px 14px;
  border: 1px solid var(--border-light); border-radius: 12px;
  background: var(--surface); box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 0;
}
.dashboard-summary-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.dashboard-summary-card:has(.tone-primary):hover {
  box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.15), 0 8px 10px -6px rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.35);
}
.dashboard-summary-card:has(.tone-success):hover {
  box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.15), 0 8px 10px -6px rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.35);
}
.dashboard-summary-card:has(.tone-danger):hover {
  box-shadow: 0 10px 25px -5px rgba(239, 68, 68, 0.15), 0 8px 10px -6px rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.35);
}
.dashboard-summary-card:has(.tone-warning):hover {
  box-shadow: 0 10px 25px -5px rgba(245, 158, 11, 0.15), 0 8px 10px -6px rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.35);
}
.dashboard-summary-card:has(.tone-info):hover {
  box-shadow: 0 10px 25px -5px rgba(14, 165, 233, 0.15), 0 8px 10px -6px rgba(14, 165, 233, 0.1);
  border-color: rgba(14, 165, 233, 0.35);
}

.summary-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.summary-icon {
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px;
  transition: transform .2s ease;
}
.dashboard-summary-card:hover .summary-icon { transform: scale(1.06); }
.summary-icon svg { width: 16px; height: 16px; }
.summary-change {
  padding: 2px 6px; border-radius: 999px; font-size: 10px; font-weight: 800;
}
.summary-change.positive { color: var(--success); background: var(--success-soft); }
.summary-change.negative { color: var(--danger); background: var(--danger-soft); }
.summary-title { color: var(--text-muted); font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.summary-value { color: var(--text); font-size: 18px; font-weight: 850; letter-spacing: -.02em; }
.summary-desc { color: var(--text-muted); font-size: 11px; margin-bottom: 2px; }
.summary-link { display: none; }

.sparkline { height: 26px; display: flex; align-items: end; gap: 3px; }
.sparkline span {
  width: 100%; max-width: 10px; border-radius: 3px 3px 1px 1px;
  background: linear-gradient(180deg, var(--accent), var(--secondary)); opacity: .85;
  transition: opacity .15s ease;
}
.sparkline span:hover { opacity: 1; }
.sparkline.empty-line { background: var(--surface-2); border-radius: 6px; }

/* ── Quick actions ── */
.dashboard-quick { display: grid; gap: 10px; }
.dashboard-section-title { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.dashboard-section-title h3 { font-size: 14.5px; margin-bottom: 2px; }
.dashboard-section-title p { color: var(--text-muted); font-size: 11.5px; }

.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; min-width: 0; }
.quick-action-tile {
  min-height: 52px; display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border: 1px solid var(--border-light); border-radius: 10px;
  background: var(--surface-2); color: var(--text);
  transition: all .2s cubic-bezier(.4,0,.2,1);
}
.quick-action-tile span {
  width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 8px; color: var(--secondary); background: var(--primary-soft);
  transition: transform .2s ease;
}
.quick-action-tile svg { width: 14px; height: 14px; }
.quick-action-tile strong { font-size: 11.5px; line-height: 1.2; font-weight: 700; }
.quick-action-tile:hover {
  background: var(--surface); box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.2);
}
.quick-action-tile:hover span { transform: scale(1.08); }

.dashboard-grid { display: grid; gap: 12px; min-width: 0; }
.dashboard-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dashboard-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dashboard-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.dashboard-shell .card-pad { padding: 12px 14px; }
.dashboard-shell .card-header { padding: 12px 14px; }
.dashboard-shell .chart-box { height: 210px; }
.dashboard-shell .chart-box.sm { height: 160px; }

.dashboard-chart-card .card-header,
.dashboard-table-card .card-header { align-items: start; }
.dashboard-chart-card .card-header p {
  color: var(--text-muted); font-size: 11px; margin-top: 1px;
}
.dashboard-chart-card .card-header a,
.dashboard-table-card .card-header a {
  color: var(--secondary); font-size: 11px; font-weight: 800;
  transition: color .15s ease;
}
.dashboard-chart-card .card-header a:hover,
.dashboard-table-card .card-header a:hover { color: var(--primary); }

.dashboard-mini-table,
.dashboard-alerts { display: grid; }

.mini-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px; padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: background .12s ease;
}
.mini-row:hover { background: var(--surface-2); }
.mini-row:last-child { border-bottom: none; }
.mini-row strong,
.alert-row strong {
  display: block; color: var(--text); font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mini-row span,
.alert-row span { display: block; color: var(--text-muted); font-size: 12px; }
.mini-meta { display: grid; justify-items: end; gap: 2px; font-size: 11.5px; color: var(--text-muted); }
.mini-meta b { color: var(--text); font-size: 12.5px; }
.mini-meta em { font-style: normal; color: var(--secondary); font-weight: 800; }

.alert-row {
  display: grid; gap: 4px; padding: 13px 16px;
  border-bottom: 1px solid var(--border-light);
  border-left: 4px solid var(--info);
  transition: background .12s ease;
}
.alert-row:last-child { border-bottom: none; }
.alert-row.warning { border-left-color: var(--warning); background: var(--warning-soft); }
.alert-row.danger { border-left-color: var(--danger); background: var(--danger-soft); }
.alert-row.success { border-left-color: var(--success); background: var(--success-soft); }

/* ── Dashboard responsive ── */
@media (max-width: 1500px) {
  .dashboard-summary-card { grid-column: span 4; }
  .quick-grid { grid-template-columns: repeat(6, minmax(118px, 1fr)); }
  .dashboard-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1050px) {
  .dashboard-hero,
  .dashboard-grid-2,
  .dashboard-grid-4 { grid-template-columns: 1fr; }
  .dashboard-summary-card { grid-column: span 6; }
  .quick-grid { grid-template-columns: repeat(3, minmax(118px, 1fr)); }
}
@media (max-width: 680px) {
  .dashboard-hero { padding: 18px; }
  .dashboard-hero h1 { font-size: 26px; }
  .dashboard-summary-card { grid-column: span 12; }
  .segmented { grid-template-columns: repeat(2, 1fr); }
  .custom-range { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mini-row { grid-template-columns: 1fr; }
  .mini-meta { justify-items: start; }
}

/* ══════════════════════════════════════════════════════════════════════════
   LIST, FORM & DETAIL SYSTEM
   ══════════════════════════════════════════════════════════════════════════ */
.module-shell { display: grid; gap: 18px; animation: slideUp .3s ease; }

/* ── Page head — large title + description ── */
.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px; align-items: start; margin-bottom: 18px;
}
.page-head-main { display: grid; gap: 5px; }
.page-head-title {
  font-size: 26px; line-height: 1.16; font-weight: 850;
  color: var(--text); letter-spacing: -.02em;
}
.page-head-desc { color: var(--text-muted); font-size: 13.5px; max-width: 760px; }
.page-actions { display: inline-flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ── Summary strip — mini stat blocks ── */
.summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 12px;
}
.summary-mini {
  min-height: 108px; display: grid; gap: 5px; padding: 18px;
  border: 1px solid var(--border-light); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
  position: relative; overflow: hidden;
}
.summary-mini::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--primary-gradient);
  opacity: 0; transition: opacity .2s ease;
}
.summary-mini:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.summary-mini:hover::before { opacity: 1; }
.summary-mini .label { color: var(--text-muted); font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.summary-mini .value { color: var(--text); font-size: 22px; font-weight: 850; }
.summary-mini .sub { color: var(--text-muted); font-size: 12px; }

/* ── List toolbar ── */
.list-toolbar {
  display: grid; gap: 12px; padding: 16px;
  border: 1px solid var(--border-light); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.toolbar-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.toolbar-row .form-control { width: auto; min-width: 170px; }
.toolbar-row .search-control { min-width: min(100%, 280px); }
.toolbar-tools { margin-left: auto; display: inline-flex; gap: 8px; flex-wrap: wrap; }

.page-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 28px;
  border-bottom: 1px solid var(--border-light);
  background: var(--surface);
}
.page-filter-box {
  position: relative;
  display: flex;
  align-items: center;
  width: min(520px, 100%);
}
.page-filter-box svg {
  position: absolute;
  left: 12px;
  width: 17px;
  height: 17px;
  color: var(--text-muted);
  pointer-events: none;
}
.page-filter-box input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  padding: 0 42px 0 38px;
  font-size: 13px;
  outline: none;
}
.page-filter-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.page-filter-box .icon-btn {
  position: absolute;
  right: 3px;
  width: 30px;
  height: 30px;
}
.page-filter-count {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.advanced-filter {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px; padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.bulk-bar {
  display: none; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 12px; border-radius: 10px;
  background: var(--primary-soft); color: var(--text-secondary);
}
.bulk-bar.active { display: flex; animation: slideUp .2s ease; }

/* ── Sticky table head ── */
.table-wrap.sticky-head {
  max-height: min(68vh, 760px);
  min-height: 0;
}
.table-wrap.sticky-head table.data thead th {
  position: sticky; top: 0; z-index: 3;
}

.table-wrap {
  overflow: visible;
  min-height: 250px;
}
@media (max-width: 820px) {
  .table-wrap {
    overflow-x: auto;
    min-height: 250px;
  }
}

/* Beyanname detay modalı */
.declaration-detail-modal {
  width: min(960px, 96vw);
  max-width: 960px;
  max-height: 94vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.declaration-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 26px;
  border-bottom: 1px solid var(--border-light);
  background:
    radial-gradient(circle at 12% 0%, rgba(99, 102, 241, .13), transparent 34%),
    linear-gradient(180deg, var(--surface-2), var(--surface));
}

.declaration-detail-heading,
.declaration-detail-head-actions,
.declaration-panel-title,
.declaration-description-panel {
  display: flex;
  align-items: center;
}

.declaration-detail-heading { gap: 14px; min-width: 0; }
.declaration-detail-head-actions { gap: 12px; flex-shrink: 0; }
.declaration-detail-icon {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  font-size: 23px;
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, .14);
}
.declaration-detail-eyebrow {
  color: var(--primary);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.declaration-detail-head h3 { font-size: 21px; line-height: 1.25; letter-spacing: -.02em; }
.declaration-detail-head p { color: var(--text-muted); font-size: 12.5px; margin-top: 3px; }

.declaration-detail-body { overflow-y: auto; padding: 24px 26px 26px; }
.declaration-detail-loading {
  min-height: 330px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
}

.declaration-detail-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  gap: 16px;
  padding: 22px;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 52%, #8b5cf6 100%);
  box-shadow: 0 14px 30px rgba(79, 70, 229, .18);
}
.declaration-detail-hero > div:first-child { display: flex; flex-direction: column; justify-content: center; }
.declaration-detail-label { font-size: 12px; font-weight: 700; opacity: .82; text-transform: uppercase; letter-spacing: .06em; }
.declaration-detail-hero > div:first-child strong { font-size: 32px; line-height: 1.1; margin: 7px 0 5px; letter-spacing: -.04em; }
.declaration-detail-hero small { font-size: 11.5px; opacity: .78; }
.declaration-due-card {
  min-width: 190px;
  padding: 14px 16px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(255, 255, 255, .13);
  border: 1px solid rgba(255, 255, 255, .2);
  backdrop-filter: blur(8px);
}
.declaration-due-card span { font-size: 11px; opacity: .8; }
.declaration-due-card strong { font-size: 17px; margin: 4px 0 2px; }
.declaration-due-card.danger { background: rgba(127, 29, 29, .38); }
.declaration-due-card.warning { background: rgba(146, 64, 14, .3); }
.declaration-due-card.success { background: rgba(6, 95, 70, .32); }
.declaration-due-card.muted { background: rgba(51, 65, 85, .3); }

.declaration-amount-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.declaration-amount-card {
  position: relative;
  overflow: hidden;
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.declaration-amount-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--primary);
}
.declaration-amount-card.calculated::before { background: var(--info); }
.declaration-amount-card.deduction::before { background: var(--warning); }
.declaration-amount-card.payable::before { background: var(--success); }
.declaration-amount-card span { color: var(--text-muted); font-size: 11.5px; font-weight: 700; }
.declaration-amount-card strong { color: var(--text); font-size: 17px; letter-spacing: -.02em; }

.declaration-detail-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.declaration-detail-panel {
  border: 1px solid var(--border-light);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
}
.declaration-panel-title {
  gap: 11px;
  padding: 15px 17px;
  border-bottom: 1px solid var(--border-light);
  background: var(--surface-2);
}
.declaration-panel-title > span {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
}
.declaration-panel-title svg { width: 16px; height: 16px; }
.declaration-panel-title div { display: flex; flex-direction: column; gap: 2px; }
.declaration-panel-title strong { font-size: 13.5px; }
.declaration-panel-title small { color: var(--text-muted); font-size: 10.5px; }
.declaration-detail-list { padding: 4px 17px; }
.declaration-detail-list > div {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 12px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px dashed var(--border-light);
}
.declaration-detail-list > div:last-child { border-bottom: 0; }
.declaration-detail-list dt { color: var(--text-muted); font-size: 11.5px; font-weight: 600; }
.declaration-detail-list dd {
  margin: 0;
  min-width: 0;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.declaration-detail-list dd > span:not(.badge):not(.declaration-cari-code) { color: var(--text-muted); font-weight: 500; }
.declaration-detail-list a { color: var(--primary); font-weight: 800; text-decoration: none; }
.declaration-detail-list a:hover { text-decoration: underline; }
.declaration-cari-code {
  padding: 3px 7px;
  border-radius: 6px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 10.5px;
  font-weight: 800;
}

.declaration-description-panel {
  align-items: flex-start;
  gap: 11px;
  margin-top: 16px;
  padding: 15px 17px;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  background: var(--surface-2);
}
.declaration-description-panel > span { color: var(--text-muted); padding-top: 1px; }
.declaration-description-panel svg { width: 17px; height: 17px; }
.declaration-description-panel strong { display: block; font-size: 12px; margin-bottom: 4px; }
.declaration-description-panel p { color: var(--text-muted); font-size: 12.5px; line-height: 1.55; }
.declaration-detail-footer { flex-wrap: wrap; }

@media (max-width: 760px) {
  .declaration-detail-modal { width: 100vw; max-width: 100vw; max-height: 100vh; border-radius: 0; }
  .declaration-detail-head { padding: 17px 16px; align-items: flex-start; }
  .declaration-detail-icon { width: 40px; height: 40px; border-radius: 12px; font-size: 19px; }
  .declaration-detail-head h3 { font-size: 18px; }
  .declaration-detail-head-actions { gap: 7px; }
  .declaration-detail-body { padding: 16px; }
  .declaration-detail-hero { grid-template-columns: 1fr; padding: 18px; }
  .declaration-detail-hero > div:first-child strong { font-size: 27px; }
  .declaration-due-card { min-width: 0; }
  .declaration-amount-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .declaration-detail-columns { grid-template-columns: 1fr; }
  .declaration-detail-list > div { grid-template-columns: 112px 1fr; }
  .declaration-detail-footer .btn { flex: 1 1 auto; justify-content: center; }
}

@media (max-width: 430px) {
  .declaration-detail-heading { gap: 9px; }
  .declaration-detail-head-actions .badge { display: none; }
  .declaration-amount-grid { grid-template-columns: 1fr; }
  .declaration-amount-card { min-height: 76px; }
  .declaration-detail-list > div { grid-template-columns: 1fr; gap: 5px; }
}

/* ── Action menu (dropdown) — shadow + animation ── */
.action-menu { position: relative; display: inline-grid; place-items: center; }
.action-menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--primary-dark);
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: background .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.action-menu-button:hover,
.action-menu.open .action-menu-button {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff;
  box-shadow: var(--primary-glow);
}
.action-menu-panel {
  position: absolute; right: 0; top: calc(100% + 6px);
  min-width: 168px; display: none;
  padding: 6px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(99,102,241,.04);
  z-index: 20;
  animation: slideUp .15s ease;
}
.action-menu.open .action-menu-panel { display: grid; }
.action-menu.open {
  z-index: 90 !important;
}
tr:has(.action-menu.open),
td:has(.action-menu.open) {
  position: relative !important;
  z-index: 90 !important;
}

.action-menu-panel button,
.action-menu-panel a {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  min-height: 36px !important;
  height: auto !important;
  padding: 7px 10px !important;
  border-radius: 8px !important;
  color: var(--text-secondary) !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  text-align: left !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  transition: all .12s ease !important;
}
.action-menu-panel button:hover,
.action-menu-panel a:hover {
  background: var(--primary-soft) !important;
  color: var(--text) !important;
  transform: translateX(2px) !important;
}
.action-menu-panel button svg,
.action-menu-panel a svg {
  width: 16px !important;
  height: 16px !important;
  flex-shrink: 0 !important;
}

/* ── Column picker/popover ── */
.column-popover {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 220px; display: none; gap: 6px;
  padding: 12px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(99,102,241,.04);
  z-index: 25;
  animation: slideUp .15s ease;
}
.column-picker { position: relative; }
.column-picker.open .column-popover { display: grid; }
.column-popover label {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-secondary); font-size: 12.5px;
  padding: 4px 6px; border-radius: 6px;
  transition: background .1s ease;
}
.column-popover label:hover { background: var(--surface-2); }

/* ── Due badges — color-coded urgency ── */
.due-badge {
  display: inline-flex; align-items: center;
  border-radius: 999px; padding: 4px 11px;
  font-size: 11.5px; font-weight: 800;
  transition: transform .15s ease;
}
.due-badge:hover { transform: scale(1.05); }
.due-overdue { color: var(--danger); background: var(--danger-soft); }
.due-today { color: var(--warning); background: var(--warning-soft); }
.due-3 { color: #b45309; background: var(--warning-soft); }
.due-7 { color: var(--info); background: var(--info-soft); }
.due-30 { color: var(--success); background: var(--success-soft); }
.due-normal { color: var(--text-muted); background: var(--surface-2); }

/* ── Form sections ── */
.form-section {
  padding: 18px; margin-bottom: 14px;
  border: 1px solid var(--border-light); border-radius: var(--radius);
  background: var(--surface-2);
  transition: border-color .2s ease;
}
.form-section:focus-within { border-color: var(--primary); }
.form-section-title {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px; color: var(--text); font-size: 14px; font-weight: 850;
}
.form-section-desc { margin: -7px 0 12px; color: var(--text-muted); font-size: 12px; }
.form-section-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.required-mark::after { content: " *"; color: var(--danger); }
.field-help { margin-top: 5px; color: var(--text-muted); font-size: 11.5px; }
.validation-message { margin-top: 5px; color: var(--danger); font-size: 11.5px; font-weight: 700; }
.unsaved-indicator { color: var(--warning); font-size: 12px; font-weight: 800; animation: pulse 1.5s ease-in-out infinite; }
.is-saving { opacity: .72; pointer-events: none; }

/* Cash transaction modal */
.cash-transaction-modal { max-width: 820px; }
.cash-transaction-modal .cash-primary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.company-expense-panel {
  border-color: color-mix(in srgb, var(--primary) 28%, var(--border-light));
  background: color-mix(in srgb, var(--primary) 5%, var(--surface));
  box-shadow: inset 3px 0 0 var(--primary);
}
.company-expense-panel:not([hidden]) {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  animation: slideUp .2s ease-out;
}
.company-expense-heading {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.company-expense-heading .form-section-title { margin: 0; }
.company-expense-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 8px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
}
.company-expense-icon svg { width: 19px; height: 19px; }
.company-expense-kicker {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11.5px;
}
.company-expense-controls {
  display: grid;
  grid-template-columns: minmax(180px, .9fr) minmax(230px, 1.1fr);
  align-items: end;
  gap: 14px;
}
.company-expense-toggle {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.company-expense-toggle:hover,
.company-expense-toggle:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.company-expense-toggle-copy { min-width: 0; flex: 1; }
.company-expense-toggle-copy strong,
.company-expense-toggle-copy small { display: block; }
.company-expense-toggle-copy strong { color: var(--text); font-size: 12.5px; }
.company-expense-toggle-copy small { margin-top: 1px; color: var(--text-muted); font-size: 10.5px; }
.company-expense-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.toggle-track {
  width: 36px;
  height: 20px;
  flex: 0 0 36px;
  padding: 2px;
  border-radius: 10px;
  background: var(--surface-3);
  transition: background .18s ease;
}
.toggle-track span {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: transform .18s ease;
}
.company-expense-toggle input:checked + .toggle-track { background: var(--primary); }
.company-expense-toggle input:checked + .toggle-track span { transform: translateX(16px); }
.project-cari-grid { grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr); align-items: start; }
.project-cari-toggle { min-height: 76px; margin: 0; }
.project-cari-select-group { min-width: 0; }
.company-expense-personnel label { color: var(--primary); font-weight: 800; }
.company-expense-personnel .form-control {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* Stock invoices and orders */
.stock-document-modal {
  width: min(1480px, 98vw);
  max-width: 1480px;
  max-height: 96vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.stock-document-modal .modal-body {
  overflow-y: auto;
  max-height: calc(96vh - 118px);
}
.stock-document-header-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stock-document-lines-section { padding: 0; overflow: hidden; }
.stock-document-lines-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
}
.stock-document-lines-head .form-section-title { margin: 0; }
.stock-document-lines-head .btn[hidden],
.stock-document-import-bar[hidden] { display: none; }
.stock-document-import-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  background: var(--primary-soft);
}
.stock-document-import-summary { display: grid; gap: 3px; min-width: 0; }
.stock-document-import-summary strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stock-document-import-summary span { color: var(--text-muted); font-size: 12px; }
.stock-document-project-assign { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.stock-document-project-assign .form-control { width: 220px; }
.stock-document-lines-table {
  min-width: 1380px;
  table-layout: fixed;
}
.stock-document-lines-section .table-wrap {
  max-height: min(54vh, 620px);
  min-height: 0;
  overflow: auto;
}
.stock-document-lines-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}
.stock-document-lines-table th,
.stock-document-lines-table td {
  padding: 10px 10px;
  vertical-align: top;
}
.stock-document-lines-table th {
  padding: 10px;
  vertical-align: middle;
}
.stock-document-lines-table th:first-child,
.stock-document-lines-table td:first-child { padding-left: 18px; }
.stock-document-lines-table th:last-child,
.stock-document-lines-table td:last-child { padding-right: 18px; width: 44px; }
.stock-document-lines-table th:nth-child(1) { width: 52px; }
.stock-document-lines-table th:nth-child(2) { width: 112px; }
.stock-document-lines-table th:nth-child(3) { width: 330px; }
.stock-document-lines-table th:nth-child(4) { width: 180px; }
.stock-document-lines-table th:nth-child(5) { width: 112px; }
.stock-document-lines-table th:nth-child(6) { width: 76px; }
.stock-document-lines-table th:nth-child(7) { width: 138px; }
.stock-document-lines-table th:nth-child(8) { width: 94px; }
.stock-document-lines-table th:nth-child(9) { width: 128px; }
.stock-document-lines-table .invoice-line-item {
  display: grid;
  gap: 7px;
  min-width: 0;
}
.stock-document-lines-table .sd-line-item,
.stock-document-lines-table .sd-line-desc,
.stock-document-lines-table .sd-line-project { width: 100%; }
.stock-document-lines-table .sd-line-qty,
.stock-document-lines-table .sd-line-price,
.stock-document-lines-table .sd-line-vat { width: 100%; }
.stock-document-lines-table .sd-line-unit {
  color: var(--text-muted);
  line-height: 42px;
  white-space: nowrap;
}
.stock-document-lines-table .sd-line-total {
  line-height: 42px;
  white-space: nowrap;
}
.stock-document-lines-table .sd-line-remove { margin-top: 4px; }
.stock-document-lines-table .sd-line-date { color: var(--text-secondary); white-space: nowrap; }
.stock-document-lines-table .sd-line-date small { display: block; margin-top: 3px; color: var(--text-muted); }
.sd-stock-match { display: block; font-size: 11px; font-weight: 700; }
.sd-stock-match.is-match { color: var(--success); }
.sd-stock-match.is-new { color: var(--warning); }
.stock-document-totals {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  padding: 14px 18px;
  border-top: 1px solid var(--border-light);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
}
.stock-document-totals span { display: flex; align-items: baseline; gap: 7px; white-space: nowrap; }
.stock-document-totals strong { color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; }
.stock-document-totals span:last-child strong { color: var(--primary); font-size: 16px; }
.stock-document-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.stock-document-detail-head h2 { margin: 7px 0 3px; font-size: 22px; }
.stock-document-detail-head p { margin: 0; color: var(--text-muted); font-size: 12.5px; }
.detail-totals { margin-top: 14px; border: 1px solid var(--border-light); border-radius: 8px; }
.document-description {
  margin-top: 14px;
  padding: 12px 14px;
  border-left: 3px solid var(--primary);
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 13px;
}

.stock-detail-panel {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 82px;
}
.stock-detail-modal {
  width: min(1280px, 94vw);
  max-width: min(1280px, 94vw);
  max-height: 94vh;
}
.stock-detail-modal .modal-body {
  padding: 0;
}
.stock-detail-modal .stock-detail-panel {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.stock-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border-light);
}
.stock-detail-title {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.stock-detail-avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 850;
}
.stock-detail-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.stock-detail-title-row h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}
.stock-detail-title p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 12.5px;
}
.stock-detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.stock-detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--border-light);
  background: var(--surface-2);
}
.stock-detail-metric {
  min-width: 0;
  padding: 16px 20px;
  border-right: 1px solid var(--border-light);
}
.stock-detail-metric:last-child { border-right: 0; }
.stock-detail-metric > span {
  display: block;
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.stock-detail-metric strong {
  display: block;
  color: var(--text);
  font-size: 19px;
  font-weight: 850;
  white-space: nowrap;
}
.stock-detail-metric small {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 11.5px;
}
.stock-detail-metric.tone-success strong { color: var(--success); }
.stock-detail-metric.tone-warning strong { color: var(--warning); }
.stock-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  padding: 18px 22px;
}
.stock-detail-info {
  overflow: hidden;
  border: 1px solid var(--border-light);
  border-radius: 8px;
}
.stock-detail-info .card-header {
  padding: 13px 16px;
  background: var(--surface-2);
}
.stock-detail-info dl {
  margin: 0;
  padding: 4px 16px;
}
.stock-detail-info dl > div {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-light);
}
.stock-detail-info dl > div:last-child { border-bottom: 0; }
.stock-detail-info dt {
  color: var(--text-muted);
  font-size: 12px;
}
.stock-detail-info dd {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.stock-health-body {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 18px 16px;
}
.stock-health-ring {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  font-weight: 850;
}
.stock-health-ring.is-warning {
  background: var(--warning-soft);
  color: var(--warning);
}
.stock-health-body strong {
  display: block;
  color: var(--text);
  font-size: 14px;
}
.stock-health-body p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 12.5px;
}
.stock-detail-note {
  margin: 0 16px 16px;
  padding: 12px 13px;
  border-left: 3px solid var(--primary);
  background: var(--surface-2);
}
.stock-detail-note strong { font-size: 12px; }
.stock-detail-note p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}
.stock-detail-statement {
  border-top: 1px solid var(--border-light);
}
.stock-detail-statement .card-header p {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}
.stock-detail-table { min-width: 980px; }
.stock-movement-type {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 750;
}
.stock-movement-in {
  background: var(--success-soft);
  color: var(--success);
}
.stock-movement-out {
  background: var(--danger-soft);
  color: var(--danger);
}

/* ── Detail hero ── */
.detail-hero {
  display: grid; gap: 14px; padding: 22px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(ellipse 300px 200px at 10% 20%, rgba(99,102,241,.25), transparent),
    linear-gradient(135deg, #0f0a2e 0%, #1a1550 50%, #261f6e 80%, rgba(139,92,246,.5) 100%);
  color: #fff; box-shadow: var(--shadow-lg);
}
.detail-hero h1 { font-size: 28px; line-height: 1.15; letter-spacing: -.02em; }
.detail-hero p { color: rgba(255,255,255,.75); }
.detail-hero .summary-mini {
  background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.16); box-shadow: none;
  backdrop-filter: blur(8px);
}
.detail-hero .summary-mini .label,
.detail-hero .summary-mini .sub { color: rgba(255,255,255,.72); }
.detail-hero .summary-mini .value { color: #fff; }
.detail-tabs { margin-top: 6px; }
.section-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }

/* Cari accounts workspace */
.cari-page > *,
#cariDetailHost { min-width: 0; }
.cari-list-card { overflow: hidden; }
.cari-row { cursor: pointer; transition: background-color .16s ease; }
.cari-row:hover { background: var(--surface-2); }
.cari-title-cell { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.cari-title-cell > span:last-child { display: grid; gap: 2px; min-width: 0; }
.cari-title-cell strong { color: var(--text); font-size: 13.5px; }
.cari-title-cell small { color: var(--text-muted); font-size: 11.5px; max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cari-avatar,
.cari-detail-avatar { display: grid; place-items: center; flex: 0 0 auto; background: var(--primary-soft); color: var(--primary); font-weight: 850; }
.cari-avatar { width: 34px; height: 34px; border-radius: 7px; font-size: 11px; }
.cari-detail-modal {
  width: min(1240px, 94vw);
  max-width: min(1240px, 94vw);
  max-height: 90vh;
  overflow: hidden;
}
.cari-detail-modal .modal-body {
  padding: 0;
  max-height: 90vh;
  overflow: hidden;
}
.cari-detail-loading { min-height: 180px; display: grid; place-items: center; }
.cari-detail-error { min-height: 260px; display: grid; place-items: center; padding: 24px; }
.cari-detail { width: 100%; min-width: 0; overflow: hidden; border: 1px solid var(--border-light); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-sm); scroll-margin-top: 80px; }
.cari-detail-modal .cari-detail {
  height: min(90vh, 820px);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
}
.cari-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 22px; border-bottom: 1px solid var(--border-light); background: var(--surface); }
.cari-detail-modal .cari-detail-head { flex: 0 0 auto; }
.cari-detail-identity { display: flex; align-items: center; gap: 14px; min-width: 0; }
.cari-detail-avatar { width: 48px; height: 48px; border-radius: 8px; font-size: 15px; }
.cari-detail-title-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.cari-detail-title-row h2 { margin: 0; font-size: 20px; line-height: 1.25; }
.cari-detail-identity p { margin: 4px 0 0; color: var(--text-muted); font-size: 12.5px; }
.cari-detail-actions { display: flex; align-items: center; gap: 8px; }
.cari-overview { flex: 0 0 auto; display: grid; grid-template-columns: minmax(260px, .9fr) minmax(0, 2.1fr); gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border-light); background: var(--surface-2); }
.cari-balance-highlight { min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: 12px 15px; border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: 7px; background: var(--surface); }
.cari-balance-highlight > span { color: var(--text-muted); font-size: 10.5px; font-weight: 800; text-transform: uppercase; }
.cari-balance-highlight strong { margin-top: 3px; color: var(--text); font-size: 22px; line-height: 1.2; white-space: nowrap; }
.cari-balance-highlight small { margin-top: 3px; color: var(--text-muted); font-size: 11px; }
.cari-balance-highlight.tone-success { border-left-color: var(--success); }
.cari-balance-highlight.tone-success strong { color: var(--success); }
.cari-balance-highlight.tone-danger { border-left-color: var(--danger); }
.cari-balance-highlight.tone-danger strong { color: var(--danger); }
.cari-overview-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); }
.cari-overview-stats > div { min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: 12px 16px; border-right: 1px solid var(--border-light); }
.cari-overview-stats > div:last-child { border-right: 0; }
.cari-overview-stats span { color: var(--text-muted); font-size: 10.5px; font-weight: 800; text-transform: uppercase; }
.cari-overview-stats strong { margin-top: 5px; color: var(--text); font-size: 16px; white-space: nowrap; }
.cari-risk { height: 5px; margin-top: 8px; overflow: hidden; border-radius: 3px; background: var(--border); }
.cari-risk i { display: block; height: 100%; border-radius: inherit; background: var(--warning); }
.cari-detail .detail-tabs { margin: 0; padding: 0 16px; background: var(--surface); }
.cari-detail .detail-tabs .tab { min-height: 48px; border: 0; border-bottom: 2px solid transparent; background: transparent; }
.cari-detail .detail-tabs .tab.active { border-bottom-color: var(--primary); }
.cari-detail-modal .detail-tabs {
  flex: 0 0 auto;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-light);
}
.tab-count { min-width: 20px; height: 20px; display: inline-grid; place-items: center; padding: 0 6px; border-radius: 10px; background: var(--surface-3); color: var(--text-muted); font-size: 10.5px; }
.tab.active .tab-count { background: var(--primary-soft); color: var(--primary); }
.cari-tab-panel { display: none; padding: 20px 22px 22px; }
.cari-detail-modal .cari-tab-panel { flex: 1 1 auto; min-height: 0; }
.cari-tab-panel.active { display: block; animation: slideUp .2s ease; }
.cari-tab-panel:has(.cari-detail-table) { padding: 0; }
.cari-tab-panel:has(.cari-movement-workspace),
.cari-tab-panel:has(.cari-subset-workspace) { padding: 0; }
.cari-detail-modal .cari-tab-panel.active:has(.cari-movement-workspace),
.cari-detail-modal .cari-tab-panel.active:has(.cari-subset-workspace) { padding-bottom: 0; }
.cari-detail-modal .cari-tab-panel.active {
  min-height: 0;
  overflow: auto;
}
.cari-detail-modal .cari-tab-panel.active:not(:has(.cari-detail-table)):not(:has(.cari-cheque-table)) {
  padding-bottom: 26px;
}
.cari-detail-modal .cari-tab-panel:has(.cari-detail-table),
.cari-detail-modal .cari-tab-panel:has(.cari-cheque-table) {
  overflow: auto;
}
.cari-info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cari-info-section { overflow: hidden; border: 1px solid var(--border-light); border-radius: 8px; }
.cari-info-section .card-header { padding: 13px 16px; background: var(--surface-2); }
.cari-info-section dl { margin: 0; padding: 4px 16px; }
.cari-info-section dl > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--border-light); }
.cari-info-section dl > div:last-child { border-bottom: 0; }
.cari-info-section dt { color: var(--text-muted); font-size: 12px; }
.cari-info-section dd { margin: 0; color: var(--text); font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
.cari-note { margin-top: 16px; padding: 13px 15px; border-left: 3px solid var(--primary); background: var(--surface-2); }
.cari-note strong { font-size: 12px; }
.cari-note p { margin: 4px 0 0; color: var(--text-secondary); font-size: 13px; }
.cari-detail-table { min-width: 1000px; }
.cari-cheque-table { min-width: 940px; }
.cari-table-sub { display: block; margin-top: 3px; color: var(--text-muted); font-size: 11px; }
.cari-due-wrap { margin-top: 4px; }
.cari-movement-workspace,
.cari-subset-workspace { min-height: 100%; background: var(--surface); }
.cari-movement-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 20px 11px; background: var(--surface); }
.cari-movement-heading > div:first-child { display: grid; gap: 3px; }
.cari-movement-heading > div:first-child strong { color: var(--text); font-size: 14px; }
.cari-movement-heading > div:first-child span { color: var(--text-muted); font-size: 11px; }
.cari-flow-totals { display: flex; align-items: center; gap: 16px; color: var(--text-muted); font-size: 11px; }
.cari-flow-totals span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.cari-flow-totals i { width: 7px; height: 7px; border-radius: 50%; }
.cari-flow-totals i.in { background: var(--success); }
.cari-flow-totals i.out { background: var(--danger); }
.cari-flow-totals strong { color: var(--text); font-size: 12.5px; }
.cari-movement-toolbar { display: flex; align-items: center; gap: 4px; padding: 0 20px 12px; overflow-x: auto; border-bottom: 1px solid var(--border-light); background: var(--surface); }
.cari-movement-filter { min-height: 29px; display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; padding: 0 9px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--text-muted); font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.cari-movement-filter:hover { background: var(--surface-2); color: var(--text); }
.cari-movement-filter.active { border-color: var(--border); background: var(--surface-2); color: var(--primary); }
.cari-movement-filter span { min-width: 17px; height: 17px; display: grid; place-items: center; padding: 0 4px; border-radius: 4px; background: var(--surface-3); color: inherit; font-size: 9.5px; }
.cari-movement-feed { padding: 0 20px 20px; }
.cari-movement-feed[hidden] { display: none; }
.cari-movement-item { display: grid; grid-template-columns: 46px 36px minmax(0, 1fr) minmax(150px, auto); align-items: center; gap: 13px; min-height: 76px; padding: 11px 8px; border-bottom: 1px solid var(--border-light); transition: background-color .14s ease; }
.cari-movement-item[hidden] { display: none; }
.cari-movement-item:hover { background: var(--surface-2); }
.cari-movement-date { display: grid; justify-items: center; color: var(--text-muted); font-style: normal; }
.cari-movement-date strong { color: var(--text); font-size: 16px; line-height: 1; }
.cari-movement-date span { margin-top: 4px; font-size: 9.5px; }
.cari-movement-source { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 7px; background: #eef2f7; color: #475569; font-size: 11px; font-weight: 850; }
.cari-movement-source.source-income { background: #dff7ed; color: #047857; }
.cari-movement-source.source-expense { background: #fee8e8; color: #c81e1e; }
.cari-movement-source.source-cheque { background: #e5efff; color: #1d4ed8; }
.cari-movement-source.source-note { background: #f0e9ff; color: #6d28d9; }
.cari-movement-source.source-bank { background: #ddf5f7; color: #0e7490; }
.cari-movement-source.source-cash { background: #fff2d8; color: #b45309; }
.cari-movement-main { min-width: 0; }
.cari-movement-title { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.cari-movement-title > strong { color: var(--text); font-size: 13px; }
.cari-movement-title > span { color: var(--text-muted); font-size: 10.5px; }
.cari-movement-title > span.status { padding: 2px 6px; border-radius: 4px; background: var(--surface-3); color: var(--text-secondary); font-weight: 700; }
.cari-movement-meta { display: flex; align-items: center; gap: 0; flex-wrap: wrap; margin-top: 5px; color: var(--text-muted); font-size: 10.5px; }
.cari-movement-meta span { display: inline-flex; align-items: center; }
.cari-movement-meta span + span::before { content: "·"; margin: 0 7px; color: var(--border); }
.cari-movement-main p { margin: 5px 0 0; color: var(--text-secondary); font-size: 11.5px; line-height: 1.35; }
.cari-movement-amount { min-width: 150px; display: grid; justify-items: end; gap: 3px; text-align: right; }
.cari-movement-amount span { color: var(--text-muted); font-size: 9.5px; font-weight: 800; text-transform: uppercase; }
.cari-movement-amount strong { color: var(--text); font-size: 14px; white-space: nowrap; }
.cari-movement-amount.in strong { color: var(--success); }
.cari-movement-amount.out strong { color: var(--danger); }
.cari-subset-workspace .cari-movement-feed { padding-top: 8px; }
.cari-movement-empty { min-height: 260px; display: grid; place-items: center; }
.cari-movement-empty[hidden] { display: none; }
.cari-project-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--border-light); border-radius: 8px; color: var(--text); text-decoration: none; transition: border-color .16s ease, background .16s ease; }
.cari-project-row:hover { border-color: var(--primary); background: var(--primary-soft); }
.cari-project-row > span:first-child { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 7px; background: var(--primary-soft); color: var(--primary); }
.cari-project-row > span:nth-child(2) { display: grid; gap: 3px; }
.cari-project-row small { color: var(--text-muted); }

@media (max-width: 980px) {
  .cari-overview { grid-template-columns: 1fr; }
  .stock-detail-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stock-detail-metric:nth-child(2) { border-right: 0; }
  .stock-detail-metric:nth-child(-n+2) { border-bottom: 1px solid var(--border-light); }
  .stock-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .cari-detail-head { position: relative; align-items: flex-start; padding: 16px; }
  .cari-detail-identity { padding-right: 76px; }
  .cari-detail-actions { position: absolute; top: 12px; right: 12px; gap: 3px; }
  .cari-detail-actions .btn { width: 34px; height: 34px; padding: 0; justify-content: center; }
  .cari-detail-actions .btn span { display: none; }
  .cari-detail-avatar { width: 42px; height: 42px; }
  .cari-detail-title-row h2 { font-size: 17px; }
  .stock-detail-head { align-items: flex-start; padding: 16px; }
  .stock-detail-title { align-items: flex-start; }
  .stock-detail-avatar { width: 42px; height: 42px; }
  .stock-detail-title-row h2 { font-size: 17px; }
  .stock-detail-actions .btn { width: 34px; height: 34px; padding: 0; justify-content: center; }
  .stock-detail-actions .btn span { display: none; }
  .cari-overview { padding: 12px; }
  .cari-overview-stats strong { font-size: 13px; }
  .stock-detail-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stock-detail-metric { min-height: 118px; padding: 14px; border-right: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light); }
  .stock-detail-metric:nth-child(2n) { border-right: 0; }
  .stock-detail-metric:nth-last-child(-n+2) { border-bottom: 0; }
  .stock-detail-metric strong { font-size: 17px; }
  .stock-detail-grid { padding: 14px; }
  .stock-detail-info dl > div { grid-template-columns: 96px minmax(0, 1fr); }
  .cari-detail .detail-tabs { padding: 0 8px; }
  .cari-tab-panel { padding: 14px; }
  .cari-info-grid { grid-template-columns: 1fr; }
  .cari-info-section dl > div { grid-template-columns: 100px minmax(0, 1fr); }
  .cari-movement-heading { align-items: flex-start; flex-direction: column; gap: 10px; padding: 13px 14px 10px; }
  .cari-flow-totals { width: 100%; gap: 10px; overflow-x: auto; }
  .cari-movement-toolbar { padding: 0 14px 10px; }
  .cari-movement-feed { padding: 0 10px 14px; }
  .cari-movement-item { grid-template-columns: 40px 32px minmax(0, 1fr); gap: 9px; }
  .cari-movement-amount { grid-column: 3; min-width: 0; justify-items: start; text-align: left; }
}

@media (max-width: 760px) {
  .page-head { grid-template-columns: 1fr; }
  .page-actions { justify-content: flex-start; }
  .toolbar-tools { margin-left: 0; }
  .toolbar-row .form-control { width: 100%; }
  .form-section-grid { grid-template-columns: 1fr; }
  .cash-transaction-modal .cash-primary-grid { grid-template-columns: 1fr; }
  .company-expense-panel:not([hidden]) { grid-template-columns: 1fr; gap: 14px; }
  .company-expense-controls { grid-template-columns: 1fr; }
  .stock-document-header-grid { grid-template-columns: 1fr; }
  .stock-document-import-bar { align-items: stretch; flex-direction: column; }
  .stock-document-project-assign { flex-wrap: wrap; }
  .stock-document-project-assign .form-control { width: min(100%, 260px); }
  .stock-document-totals { justify-content: flex-start; gap: 12px; overflow-x: auto; }
  .stock-document-detail-head { display: block; }
  .stock-document-detail-head > :last-child { margin-top: 10px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   CENTRAL REPORTS
   ══════════════════════════════════════════════════════════════════════════ */
.report-center { display: grid; gap: 18px; }
.report-hero .dashboard-filter { align-self: stretch; }

.report-rail {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px;
}
.report-chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.report-chip {
  min-height: 36px; display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface-2); color: var(--text-secondary);
  font-size: 12.5px; font-weight: 750;
  transition: all .15s ease;
}
.report-chip:hover { border-color: var(--primary); background: var(--primary-soft); }
.report-chip svg { width: 15px; height: 15px; color: var(--secondary); }

.report-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}
.report-category-card {
  display: grid; gap: 5px; min-height: 82px; padding: 16px;
  border: 1px solid var(--border-light); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-sm);
  text-align: left;
  transition: all .2s ease;
}
.report-category-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--primary-soft); }
.report-category-card strong { color: var(--text); font-size: 14px; }
.report-category-card span { color: var(--text-muted); font-size: 12px; }

.report-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.report-card {
  display: grid; gap: 12px; min-height: 248px; padding: 20px;
  border: 1px solid var(--border-light); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-sm);
  transition: all .25s cubic-bezier(.4,0,.2,1);
}
.report-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.report-card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.report-icon {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 12px; background: var(--primary-soft); color: var(--secondary);
  transition: transform .2s ease;
}
.report-card:hover .report-icon { transform: scale(1.08); }
.report-icon svg { width: 19px; height: 19px; }
.report-card h3 { font-size: 16px; line-height: 1.25; }
.report-card p { color: var(--text-muted); font-size: 12.5px; min-height: 38px; }

.report-filter-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.report-filter-tags span {
  padding: 4px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-muted);
  font-size: 11px; font-weight: 700;
  transition: background .1s ease;
}
.report-filter-tags span:hover { background: var(--surface-3); }

.report-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.report-viewer { overflow: hidden; }

.report-meta {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin: 14px 0; color: var(--text-muted); font-size: 12px;
}
.report-meta span {
  padding: 7px 10px;
  border: 1px solid var(--border-light); border-radius: 9px;
  background: var(--surface-2);
  transition: border-color .15s ease;
}
.report-meta span:hover { border-color: var(--border); }

.report-fullscreen {
  position: fixed; inset: 12px; z-index: 120;
  overflow: auto; box-shadow: var(--shadow-xl);
  background: var(--surface); border-radius: var(--radius-lg);
}

@media (max-width: 1050px) {
  .report-rail { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════════════════
   SELECTION / FOCUS POLISH
   ══════════════════════════════════════════════════════════════════════════ */
::selection {
  background: rgba(99,102,241,.2);
  color: var(--text);
}

/* Smooth page transition feel */
.content > * { animation: slideUp .25s ease both; }

/* ══════════════════════════════════════════════════════════════════════════
   REPORTS SPLIT LAYOUT v3
   ══════════════════════════════════════════════════════════════════════════ */
.report-split-layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 20px;
  min-height: calc(100vh - var(--header-h) - 56px);
  align-items: start;
}
.report-sidebar {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--header-h) - 56px);
  position: sticky;
  top: calc(var(--header-h) + 10px);
  overflow: hidden;
}
.sidebar-search-box {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
}
.report-menu {
  overflow-y: auto;
  flex: 1;
  padding: 8px 6px;
}
.report-menu-group {
  margin-bottom: 4px;
}
.report-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  cursor: pointer;
  border-radius: 8px;
  transition: all .2s;
}
.report-menu-header:hover {
  background: var(--surface-2);
  color: var(--text);
}
.report-menu-group:not(.open) .report-menu-items {
  display: none;
}
.report-menu-group:not(.open) .category-arrow {
  transform: rotate(-90deg);
}
.category-arrow {
  font-size: 9px;
  transition: transform .2s ease;
}
.report-menu-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
  padding-left: 6px;
}
.report-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: 8px;
  cursor: pointer;
  transition: all .18s;
  position: relative;
}
.report-menu-item:hover {
  background: var(--surface-2);
  color: var(--text);
}
.report-menu-item.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}
.report-item-icon svg {
  width: 15px;
  height: 15px;
  opacity: .7;
}
.fav-icon-btn {
  margin-left: auto;
  border: none;
  background: none;
  color: var(--text-soft);
  font-size: 13px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .2s, color .2s;
}
.report-menu-item:hover .fav-icon-btn,
.fav-icon-btn.is-fav {
  opacity: 1;
}
.fav-icon-btn.is-fav {
  color: var(--warning);
}
.report-welcome-state {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 40px 30px;
}
.welcome-hero {
  max-width: 680px;
}
.welcome-badge {
  display: inline-flex;
  padding: 5px 12px;
  border-radius: 99px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}
.welcome-hero h2 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
}
.welcome-hero p {
  color: var(--text-muted);
  font-size: 14px;
}
.shortcut-block {
  margin-top: 14px;
}
.shortcut-block h4 {
  font-size: 13px;
  font-weight: 750;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.report-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.report-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.report-chip:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  transform: translateY(-1px);
}
.report-main {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  min-height: calc(100vh - var(--header-h) - 56px);
}
@media (max-width: 1050px) {
  .report-split-layout {
    grid-template-columns: 1fr;
  }
  .report-sidebar {
    position: static;
    max-height: none;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   INPUT FIELD PREFIX ICONS
   ══════════════════════════════════════════════════════════════════════════ */
.input-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.input-icon-wrapper .input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-soft);
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 2;
}
.input-icon-wrapper .input-icon svg {
  width: 17px;
  height: 17px;
}
.input-icon-wrapper .form-control {
  padding-left: 42px !important;
}

/* Login redesign */
.login-page-v2 {
  min-height: 100vh;
  padding: clamp(18px, 3vw, 36px);
  display: grid;
  place-items: center;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    linear-gradient(115deg, rgba(6, 24, 37, .96), rgba(13, 17, 23, .98) 46%, rgba(24, 31, 36, .96)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 1px, transparent 1px 78px),
    repeating-linear-gradient(0deg, rgba(255,255,255,.03) 0 1px, transparent 1px 78px);
}
.login-page-v2::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 22%, rgba(45, 212, 191, .13), transparent 28%),
    radial-gradient(circle at 84% 16%, rgba(245, 158, 11, .10), transparent 30%),
    linear-gradient(140deg, transparent 0 50%, rgba(255,255,255,.04) 50% 50.2%, transparent 50.2%);
}
.login-page-v2 .login-bg,
.login-page-v2 .login-bg-shape,
.login-page-v2 .login-bg-noise {
  display: none;
}
.login-shell {
  position: relative;
  z-index: 1;
  width: min(1040px, 100%);
  min-height: min(620px, calc(100vh - 72px));
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 28px;
  overflow: hidden;
  background: rgba(255,255,255,.07);
  box-shadow: 0 30px 90px rgba(0,0,0,.38);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}
.login-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 34px;
  padding: clamp(30px, 5vw, 58px);
  color: #fff;
  background:
    linear-gradient(160deg, rgba(9, 40, 52, .92), rgba(14, 43, 42, .88) 48%, rgba(48, 37, 17, .82)),
    repeating-linear-gradient(135deg, rgba(255,255,255,.06) 0 1px, transparent 1px 18px);
}
.login-visual::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 22px;
  pointer-events: none;
}
.login-brand-mark,
.login-status-strip {
  position: relative;
  z-index: 1;
}
.login-brand-mark {
  margin-bottom: clamp(54px, 9vw, 96px);
  display: flex;
  align-items: center;
  gap: 14px;
}
.login-brand-mark strong {
  display: block;
  font-size: 19px;
  letter-spacing: 0;
}
.login-brand-mark small {
  display: block;
  margin-top: 3px;
  color: rgba(255,255,255,.62);
  font-size: 12px;
}
.login-page-v2 .login-logo-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: linear-gradient(135deg, #0f766e, #14b8a6 55%, #f59e0b);
  color: #fff;
  box-shadow: 0 16px 36px rgba(20,184,166,.26);
  letter-spacing: 0;
}
.login-visual-copy {
  position: relative;
  z-index: 1;
  max-width: 570px;
}
.login-kicker {
  margin: 0 0 14px;
  color: #5eead4;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.login-visual-copy h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: 0;
  max-width: 12ch;
}
.login-visual-copy p:last-child {
  margin: 18px 0 0;
  max-width: 420px;
  color: rgba(255,255,255,.70);
  font-size: 16px;
  line-height: 1.65;
}
.login-snapshot {
  position: relative;
  z-index: 1;
  width: min(470px, 100%);
  padding: 14px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 18px;
  background: rgba(3, 7, 18, .38);
  box-shadow: 0 18px 44px rgba(0,0,0,.22);
}
.login-snapshot-head,
.login-metric-row,
.login-status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.login-snapshot-head span {
  color: rgba(255,255,255,.62);
  font-size: 13px;
  font-weight: 700;
}
.login-snapshot-head strong {
  padding: 5px 9px;
  border-radius: 999px;
  color: #022c22;
  background: #99f6e4;
  font-size: 11px;
}
.login-metric-row {
  margin: 14px 0;
}
.login-metric-row div {
  min-width: 0;
}
.login-metric-row small {
  display: block;
  margin-bottom: 4px;
  color: rgba(255,255,255,.52);
  font-size: 12px;
}
.login-metric-row strong {
  display: block;
  color: #fff;
  font-size: clamp(18px, 2vw, 24px);
}
.login-chart {
  height: 100px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: end;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.10);
}
.login-chart span {
  min-height: 28px;
  border-radius: 9px 9px 4px 4px;
  background: linear-gradient(180deg, #fbbf24, #14b8a6);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28);
}
.login-status-strip {
  display: none;
}
.login-status-strip span {
  padding: 10px 13px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.76);
  font-size: 12px;
  font-weight: 700;
}
.login-page-v2 .login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(30px, 5vw, 54px);
  border: 0;
  border-radius: 0;
  background: rgba(250, 252, 252, .96);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  animation: none;
}
.login-card-head {
  margin-bottom: 26px;
}
.login-page-v2 .login-logo.compact {
  display: none;
}
.login-page-v2 .login-title {
  margin: 0 0 8px;
  color: #101820;
  text-align: left;
  font-size: clamp(28px, 3.4vw, 34px);
  letter-spacing: 0;
}
@media (min-width: 901px) {
  .login-page-v2 .login-title {
    white-space: nowrap;
  }
}
.login-page-v2 .login-subtitle {
  margin: 0;
  color: #667085;
  text-align: left;
  font-size: 15px;
  line-height: 1.55;
}
.login-page-v2 .login-form {
  gap: 16px;
}
.login-page-v2 .lf-group label {
  color: #344054;
  letter-spacing: 0;
  text-transform: none;
  font-size: 13px;
}
.login-page-v2 .lf-group input,
.login-page-v2 .lf-pw-wrap input {
  height: 48px;
  border: 1px solid #d8dee6;
  border-radius: 12px;
  background: #fff;
  color: #101820;
  box-shadow: 0 1px 0 rgba(16,24,40,.04);
}
.login-page-v2 .lf-group input::placeholder,
.login-page-v2 .lf-pw-wrap input::placeholder {
  color: #98a2b3;
}
.login-page-v2 .lf-group input:hover,
.login-page-v2 .lf-pw-wrap input:hover {
  border-color: #b7c4cf;
}
.login-page-v2 .lf-group input:focus,
.login-page-v2 .lf-pw-wrap input:focus {
  border-color: #0f766e;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(20,184,166,.14);
}
.login-page-v2 .lf-eye {
  color: #667085;
}
.login-page-v2 .lf-eye:hover {
  color: #0f766e;
  background: #ecfdf5;
}
.login-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12.5px;
}
.login-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #475467;
  font-weight: 700;
}
.login-check input {
  width: 16px;
  height: 16px;
  accent-color: #0f766e;
}
.login-help {
  color: #667085;
}
.login-page-v2 .lf-submit {
  height: 48px;
  margin-top: 4px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0f766e, #14b8a6 58%, #f59e0b);
  box-shadow: 0 14px 28px rgba(15,118,110,.24);
}
.login-page-v2 .lf-submit:hover:not(:disabled) {
  filter: saturate(1.08) brightness(1.02);
  box-shadow: 0 18px 36px rgba(15,118,110,.30);
}
.login-page-v2 .login-secure {
  justify-content: flex-start;
  color: #667085;
  font-size: 12px;
}
.login-page-v2 .login-secure svg {
  color: #0f766e;
}
.login-page-v2 .login-copyright {
  position: relative;
  z-index: 1;
  margin: 18px 0 0;
  color: rgba(255,255,255,.55);
  text-align: center;
}

@media (max-width: 900px) {
  .login-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .login-visual {
    min-height: 360px;
  }
  .login-visual-copy h1 {
    max-width: 15ch;
  }
  .login-page-v2 .login-logo.compact {
    display: flex;
    justify-content: flex-start;
    margin: 0 0 18px;
  }
}

@media (max-width: 560px) {
  .login-page-v2 {
    padding: 12px;
  }
  .login-shell {
    border-radius: 20px;
  }
  .login-visual {
    display: none;
  }
  .login-page-v2 .login-card {
    min-height: calc(100vh - 58px);
    padding: 28px 22px;
  }
  .login-page-v2 .login-title {
    font-size: 28px;
  }
  .login-form-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Login color refinement */
.login-page-v2 {
  background:
    linear-gradient(120deg, rgba(236, 241, 238, .96), rgba(246, 248, 247, .98) 48%, rgba(229, 235, 232, .96)),
    repeating-linear-gradient(90deg, rgba(21, 37, 34, .045) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(0deg, rgba(21, 37, 34, .035) 0 1px, transparent 1px 96px);
}
.login-page-v2::before {
  background:
    linear-gradient(135deg, transparent 0 49.8%, rgba(31, 50, 47, .06) 49.8% 50.1%, transparent 50.1%),
    linear-gradient(20deg, rgba(255,255,255,.45), transparent 55%);
}
.login-shell {
  border-color: rgba(24, 39, 36, .12);
  background: rgba(255,255,255,.78);
  box-shadow: 0 28px 80px rgba(24, 39, 36, .16);
}
.login-visual {
  color: #f7faf8;
  background:
    linear-gradient(155deg, rgba(23, 45, 42, .98), rgba(30, 53, 49, .96) 52%, rgba(44, 52, 45, .96)),
    repeating-linear-gradient(135deg, rgba(255,255,255,.045) 0 1px, transparent 1px 22px);
}
.login-visual::after {
  border-color: rgba(255,255,255,.09);
}
.login-page-v2 .login-logo-icon {
  background: linear-gradient(135deg, #f8faf9 0%, #d9e3df 100%);
  color: #17332f;
  box-shadow: 0 14px 30px rgba(5, 17, 15, .24);
}
.login-brand-mark small,
.login-visual-copy p:last-child {
  color: rgba(247,250,248,.68);
}
.login-kicker {
  color: #c8a86a;
}
.login-snapshot {
  border-color: rgba(255,255,255,.12);
  background: rgba(9, 22, 20, .42);
  box-shadow: 0 18px 44px rgba(0,0,0,.18);
}
.login-snapshot-head strong {
  color: #17332f;
  background: #e7d7ad;
}
.login-chart span {
  background: linear-gradient(180deg, #d6bd7a, #7f9d91);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22);
}
.login-status-strip span {
  border-color: rgba(255,255,255,.11);
  background: rgba(255,255,255,.06);
  color: rgba(247,250,248,.74);
}
.login-page-v2 .login-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(249,250,249,.98)),
    #fff;
}
.login-page-v2 .login-title {
  color: #17201d;
}
.login-page-v2 .login-subtitle,
.login-help,
.login-page-v2 .login-secure {
  color: #6c7773;
}
.login-page-v2 .lf-group label,
.login-check {
  color: #394541;
}
.login-page-v2 .lf-group input,
.login-page-v2 .lf-pw-wrap input {
  border-color: #d8dfdc;
  background: #fbfcfb;
  color: #17201d;
}
.login-page-v2 .lf-group input:hover,
.login-page-v2 .lf-pw-wrap input:hover {
  border-color: #b8c5c0;
}
.login-page-v2 .lf-group input:focus,
.login-page-v2 .lf-pw-wrap input:focus {
  border-color: #43675f;
  box-shadow: 0 0 0 4px rgba(67, 103, 95, .14);
}
.login-check input {
  accent-color: #43675f;
}
.login-page-v2 .lf-eye:hover {
  color: #43675f;
  background: #eef3f1;
}
.login-page-v2 .lf-submit {
  background: linear-gradient(135deg, #243f3a, #43675f);
  box-shadow: 0 14px 26px rgba(36, 63, 58, .22);
}
.login-page-v2 .lf-submit:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow: 0 18px 34px rgba(36, 63, 58, .28);
}
.login-page-v2 .login-secure svg {
  color: #43675f;
}
.login-page-v2 .login-copyright {
  color: rgba(23,32,29,.58);
}

/* Login page - simple product-aligned layout */
.login-page-modern {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  color: #1e1b4b;
  background-color: #f5f6fc;
  background-image:
    linear-gradient(rgba(99, 102, 241, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, .045) 1px, transparent 1px);
  background-size: 48px 48px;
}

.login-panel {
  position: relative;
  width: min(440px, 100%);
  padding: 40px;
  border: 1px solid #e2e4ef;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 65px rgba(30, 27, 75, .11), 0 3px 10px rgba(30, 27, 75, .04);
  animation: loginPanelIn .38s ease-out both;
}

.login-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 40px;
  right: 40px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: #6366f1;
}

@keyframes loginPanelIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-header {
  margin-bottom: 30px;
}

.login-brand-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  margin-bottom: 28px;
}

.login-brand-full {
  display: block;
  width: 156px;
  height: 156px;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 14px 36px rgba(15, 12, 4, .22);
}

.login-brand-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  border-radius: 10px;
  background: #6366f1;
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 7px 18px rgba(99, 102, 241, .24);
}

.login-brand-name {
  color: #1e1b4b;
  font-size: 16px;
  font-weight: 750;
}

.login-heading h1 {
  margin: 0;
  color: #1e1b4b;
  font-size: 27px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: 0;
}

.login-heading p {
  margin: 9px 0 0;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.6;
}

.login-form-modern {
  display: grid;
  gap: 18px;
}

.login-field {
  display: grid;
  gap: 8px;
}

.login-field label {
  color: #374151;
  font-size: 13px;
  font-weight: 650;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: #9ca3af;
  pointer-events: none;
}

.login-input-icon svg,
.login-footer-icon svg {
  width: 100%;
  height: 100%;
}

.login-input-wrap input {
  width: 100%;
  height: 48px;
  padding: 0 14px 0 43px;
  border: 1px solid #dfe2ed;
  border-radius: 10px;
  outline: none;
  background: #fbfbfe;
  color: #1f2937;
  font: inherit;
  font-size: 14px;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.login-password-wrap input {
  padding-right: 72px;
}

.login-input-wrap:focus-within .login-input-icon {
  color: #6366f1;
}

.login-input-wrap input:hover {
  border-color: #c7cbe0;
  background: #fff;
}

.login-input-wrap input:focus {
  border-color: #6366f1;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, .12);
}

.login-password-toggle {
  position: absolute;
  right: 8px;
  min-width: 54px;
  height: 34px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #6366f1;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.login-password-toggle:hover,
.login-password-toggle:focus-visible {
  background: #eef2ff;
  outline: none;
}

.login-remember {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #6b7280;
  font-size: 13px;
  cursor: pointer;
}

.login-remember input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #6366f1;
}

.login-submit {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 10px;
  background: #6366f1;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 9px 22px rgba(99, 102, 241, .24);
  transition: background .16s ease, transform .16s ease, box-shadow .16s ease;
}

.login-submit:hover:not(:disabled) {
  background: #4f46e5;
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(79, 70, 229, .28);
}

.login-submit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, .2), 0 9px 22px rgba(99, 102, 241, .24);
}

.login-submit:disabled {
  opacity: .72;
  cursor: wait;
}

.login-submit-arrow {
  font-size: 18px;
  line-height: 1;
  transition: transform .16s ease;
}

.login-submit:hover:not(:disabled) .login-submit-arrow {
  transform: translateX(2px);
}

.login-submit.is-loading .login-submit-arrow {
  display: none;
}

.login-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid #eff0f8;
  color: #9ca3af;
  font-size: 11.5px;
}

.login-footer-icon {
  width: 13px;
  height: 13px;
  display: grid;
  place-items: center;
}

@media (max-width: 520px) {
  .login-page-modern {
    align-items: center;
    padding: 16px;
    background-size: 40px 40px;
  }

  .login-panel {
    padding: 32px 24px;
    border-radius: 16px;
  }

  .login-panel::before {
    left: 24px;
    right: 24px;
  }

  .login-brand-row {
    margin-bottom: 28px;
  }

  .login-heading h1 {
    font-size: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-panel { animation: none; }
  .login-submit,
  .login-submit-arrow { transition: none; }
}

.voucher-modal {
  max-width: min(1500px, 98vw) !important;
  width: 98vw;
  max-height: 96vh;
}

.voucher-modal .modal-body {
  padding: 24px 28px;
}

.voucher-modal .form-row {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
}

.voucher-modal .table-wrap {
  max-height: 46vh;
  overflow: auto;
}

.voucher-modal .voucher-lines {
  min-width: 1380px;
}

.voucher-modal .voucher-lines th,
.voucher-modal .voucher-lines td {
  padding: 10px 8px;
  vertical-align: top;
}

.voucher-modal .voucher-lines th:first-child,
.voucher-modal .voucher-lines td:first-child {
  min-width: 250px;
}

.voucher-modal .voucher-lines th:nth-child(2),
.voucher-modal .voucher-lines th:nth-child(3),
.voucher-modal .voucher-lines td:nth-child(2),
.voucher-modal .voucher-lines td:nth-child(3) {
  min-width: 130px;
}

.voucher-modal .voucher-lines th:nth-child(4),
.voucher-modal .voucher-lines th:nth-child(5),
.voucher-modal .voucher-lines th:nth-child(6),
.voucher-modal .voucher-lines th:nth-child(7),
.voucher-modal .voucher-lines td:nth-child(4),
.voucher-modal .voucher-lines td:nth-child(5),
.voucher-modal .voucher-lines td:nth-child(6),
.voucher-modal .voucher-lines td:nth-child(7) {
  min-width: 170px;
}

.voucher-modal .voucher-lines th:nth-child(8),
.voucher-modal .voucher-lines td:nth-child(8) {
  min-width: 220px;
}

.voucher-modal .voucher-lines .form-control {
  min-width: 100%;
}

@media (max-width: 820px) {
  .voucher-modal {
    width: 100vw;
    max-width: 100vw !important;
    max-height: 100vh;
    border-radius: 0;
  }

  .voucher-modal .modal-body {
    padding: 18px 14px;
  }

  .voucher-modal .form-row {
    grid-template-columns: 1fr;
  }
}
.form-control.project-cari-auto:disabled {
  opacity: 1;
  cursor: not-allowed;
  color: var(--primary, #2563eb);
  background: color-mix(in srgb, var(--primary, #2563eb) 8%, var(--surface, #fff));
  border-color: color-mix(in srgb, var(--primary, #2563eb) 35%, var(--border, #d1d5db));
}

/* Firma geçişi */
.brand-button {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.brand-button:hover { background: rgba(255,255,255,.04); }
.workspace-switcher { position: relative; }
.workspace-switcher-trigger {
  min-width: 164px;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 10px 5px 6px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.workspace-switcher-mark,
.workspace-option > span {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #0f766e);
  color: #fff;
  font-weight: 800;
}
.workspace-switcher-mark img,
.workspace-option > span img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.workspace-switcher-trigger > span:nth-child(2) { display: grid; text-align: left; line-height: 1.05; }
.workspace-switcher-trigger strong { font-size: 12px; }
.workspace-switcher-trigger small { margin-top: 3px; color: var(--text-soft); font-size: 9px; }
.workspace-switcher-arrow { margin-left: auto; color: var(--text-soft); transition: transform .2s; }
.workspace-switcher.open .workspace-switcher-arrow { transform: rotate(180deg); }
.workspace-switcher-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1200;
  width: 290px;
  display: none;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.workspace-switcher.open .workspace-switcher-menu { display: grid; gap: 5px; }
.workspace-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.workspace-option:hover { background: var(--surface-soft); }
.workspace-option.active { border-color: color-mix(in srgb, var(--primary) 32%, var(--border)); background: var(--primary-soft); }
.workspace-option div { display: grid; gap: 3px; }
.workspace-option strong { font-size: 12px; }
.workspace-option small { color: var(--text-soft); font-size: 10px; }
.workspace-option b { margin-left: auto; color: var(--primary); }
.workspace-no-finance .finance-only { display: none !important; }

@media (max-width: 820px) {
  .workspace-switcher-trigger { min-width: 42px; width: 42px; padding: 5px; }
  .workspace-switcher-trigger > span:nth-child(2),
  .workspace-switcher-arrow { display: none; }
  .workspace-switcher-menu { position: fixed; top: 66px; right: 12px; width: min(290px, calc(100vw - 24px)); }
}

/* ---------- Demo sürümü bandı ---------- */
.demo-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 18px; font-size: 13px;
  background: var(--warning-soft); color: var(--warning);
  border-bottom: 1px solid rgba(245,158,11,.25);
}
.demo-banner strong { padding: 2px 8px; border-radius: 6px; background: var(--warning); color: #fff; font-size: 11px; letter-spacing: .06em; }
.demo-banner.expired { background: var(--danger-soft); color: var(--danger); border-bottom-color: rgba(220,38,38,.25); }
.demo-banner.expired strong { background: var(--danger); }
.demo-banner.floating { position: fixed; top: 0; left: 0; right: 0; z-index: 50; justify-content: center; }
.demo-block {
  position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 24px;
  background: rgba(15,23,42,.72); backdrop-filter: blur(4px);
}
.demo-block-card { max-width: 440px; padding: 32px; border-radius: 14px; background: #fff; color: #0f172a; text-align: center; box-shadow: 0 20px 60px rgba(15,23,42,.3); }
.demo-block-card h2 { margin: 0 0 10px; font-size: 22px; }
.demo-block-card p { margin: 0; line-height: 1.55; color: #475569; }
