/* ============================================================
   Damlio Panel — Shared Design System
   Token-based, dark-mode-ready, accessible, responsive.
   All views import this file; never duplicate these styles.
   ============================================================ */

/* ── 1. Google Fonts are loaded in HTML <head>. ── */

/* ── 2. Design Tokens ─────────────────────────────────────── */
:root {
  /* Brand */
  --primary:      #00A8E8;
  --primary-600:  #0098d4;
  --navy:         #003459;
  --teal:         #00C2CB;

  /* Surfaces */
  --bg:           #f3f8fc;
  --bg-2:         #eaf2f8;
  --card:         #ffffff;
  --sidebar:      #04263d;

  /* Text */
  --text:         #0a2233;
  --text-2:       rgba(10,34,51,.64);
  --text-3:       rgba(10,34,51,.40);

  /* Borders */
  --line:         rgba(10,34,51,.10);
  --line-2:       rgba(10,34,51,.16);

  /* Semantic colours */
  --good:         #1a8a48;
  --good-bg:      rgba(26,138,72,.12);
  --warn:         #c9870a;
  --warn-bg:      rgba(201,135,10,.13);
  --danger:       #e0566a;
  --danger-bg:    rgba(224,86,106,.13);
  --info-bg:      rgba(0,168,232,.12);

  /* Shape */
  --r:            14px;
  --r-sm:         10px;
  --r-pill:       999px;

  /* Shadow */
  --shadow-sm:    0 3px 12px rgba(0,52,89,.06);
  --shadow:       0 14px 44px rgba(0,52,89,.12);
  --shadow-hover: 0 18px 50px rgba(0,52,89,.16);

  /* Layout */
  --side-w:       260px;
  --top-h:        66px;

  /* Typography scale */
  --text-xs:      12px;
  --text-sm:      13.5px;
  --text-base:    15px;
  --text-md:      17px;
  --text-lg:      clamp(20px, 2vw, 24px);
  --text-xl:      clamp(24px, 3vw, 30px);
  --text-h1:      clamp(22px, 3.5vw, 28px);

  /* Animation */
  --dur-fast:     120ms;
  --dur:          200ms;
  --dur-slow:     300ms;
  --ease:         cubic-bezier(.25,.46,.45,.94);
  --spring:       cubic-bezier(.34,1.56,.64,1);
}

html[data-theme="dark"] {
  --bg:           #0a141d;
  --bg-2:         #0e1a25;
  --card:         #13212e;
  --sidebar:      #061a2b;

  --text:         #eaf3fa;
  --text-2:       rgba(234,243,250,.66);
  --text-3:       rgba(234,243,250,.42);

  --line:         rgba(234,243,250,.12);
  --line-2:       rgba(234,243,250,.20);

  --good-bg:      rgba(26,138,72,.20);
  --warn-bg:      rgba(201,135,10,.20);
  --danger-bg:    rgba(224,86,106,.20);
  --info-bg:      rgba(0,168,232,.18);

  --shadow-sm:    0 3px 12px rgba(0,0,0,.30);
  --shadow:       0 14px 44px rgba(0,0,0,.50);
  --shadow-hover: 0 18px 50px rgba(0,0,0,.60);
}

/* ── 3. Reset & Base ──────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

html {
  font-size: var(--text-base);
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

img, svg {
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* Focus ring — visible only for keyboard navigation */
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Utility */
.mono {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ── 4. App Shell Grid ────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  min-height: 100vh;
}

/* ── 5. Sidebar ───────────────────────────────────────────── */
.sidebar {
  background: var(--sidebar);
  color: #cfe1ee;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.12) transparent;
  padding: 16px 12px 20px;
  gap: 2px;
  z-index: 40;
  transition: transform var(--dur-slow) var(--ease);
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.12);
  border-radius: 4px;
}

/* Logo */
.s-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 22px;
  color: #fff;
  letter-spacing: -.5px;
  padding: 8px 10px 20px;
  flex-shrink: 0;
}

/* Section label */
.s-section {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: rgba(207,225,238,.40);
  padding: 16px 12px 5px;
  flex-shrink: 0;
}

/* Nav items */
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: var(--r-sm);
  color: #a8c4d8;
  font-weight: 600;
  font-size: 14.5px;
  transition: background var(--dur-fast), color var(--dur-fast);
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  min-height: 44px; /* touch target */
  text-decoration: none;
  cursor: pointer;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: .85;
  transition: opacity var(--dur-fast);
}

.nav-item:hover {
  background: rgba(255,255,255,.07);
  color: #fff;
}
.nav-item:hover svg {
  opacity: 1;
}

.nav-item.active {
  background: linear-gradient(135deg, var(--primary), var(--teal));
  color: #fff;
  box-shadow: 0 6px 18px rgba(0,168,232,.30);
}
.nav-item.active svg {
  opacity: 1;
}

/* Count badge inside nav */
.nav-item .count {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 700;
  background: rgba(255,255,255,.14);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  flex-shrink: 0;
}
.nav-item.active .count {
  background: rgba(255,255,255,.25);
}

/* "Yakında" tag */
.nav-item .soon {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: rgba(207,225,238,.45);
  border: 1px solid rgba(207,225,238,.20);
  padding: 2px 7px;
  border-radius: var(--r-pill);
}

/* Sidebar footer — firm card */
.s-foot {
  margin-top: auto;
  padding: 14px 10px 0;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.s-foot .av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--teal));
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.s-foot .firm-name {
  color: #fff;
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1.3;
}

.s-foot .firm-owner {
  font-size: 12px;
  color: rgba(207,225,238,.55);
  line-height: 1.3;
}

/* ── 6. Main wrapper ──────────────────────────────────────── */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ── 7. Topbar ────────────────────────────────────────────── */
.topbar {
  height: var(--top-h);
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  transition: background var(--dur);
}

.menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--card);
  place-items: center;
  color: var(--text);
  flex-shrink: 0;
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.menu-btn:hover {
  background: var(--bg-2);
}
.menu-btn svg {
  width: 22px;
  height: 22px;
}

/* Search */
.search {
  flex: 1;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 0 16px;
  height: 42px;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,168,232,.15);
}
.search svg {
  width: 18px;
  height: 18px;
  color: var(--text-3);
  flex-shrink: 0;
}
.search input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 14.5px;
  color: var(--text);
  font-family: inherit;
  min-width: 0;
}
.search input::placeholder {
  color: var(--text-3);
}

/* Topbar right actions */
.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Icon button */
.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--card);
  display: grid;
  place-items: center;
  color: var(--text-2);
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast);
  position: relative;
  cursor: pointer;
}
.icon-btn:hover {
  background: var(--bg-2);
  color: var(--text);
  border-color: var(--line-2);
}
.icon-btn:active {
  transform: scale(.95);
}
.icon-btn svg {
  width: 20px;
  height: 20px;
}

/* Notification dot */
.badge-dot {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--card);
}

/* ── 8. Content area ──────────────────────────────────────── */
.content {
  padding: 26px 24px 48px;
  max-width: 1320px;
  width: 100%;
  flex: 1;
}

/* Page heading */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.page-head h1 {
  font-size: var(--text-h1);
  font-weight: 800;
  letter-spacing: -.6px;
  line-height: 1.1;
}

.page-head .date {
  color: var(--text-2);
  font-size: var(--text-sm);
  margin-top: 5px;
}

.page-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── 9. Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: var(--r-pill);
  font-family: inherit;
  font-weight: 700;
  font-size: 14.5px;
  border: 0;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              background var(--dur-fast);
  white-space: nowrap;
}
.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.btn:active {
  transform: scale(.97) !important;
  box-shadow: none !important;
}

/* Primary */
.btn,
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn:hover,
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(0,168,232,.35);
  background: var(--primary-600);
}

/* Navy variant */
.btn-navy {
  background: var(--navy);
  color: #fff;
}
.btn-navy:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(0,52,89,.35);
  background: #002a47;
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-2);
}
.btn-ghost:hover {
  background: var(--bg-2);
  border-color: var(--line-2);
  transform: translateY(-1px);
}

/* Danger */
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(224,86,106,.35);
  filter: brightness(1.08);
}

/* Small action button (in table rows) */
.act {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--card);
  display: grid;
  place-items: center;
  color: var(--text-2);
  cursor: pointer;
  transition: border-color var(--dur-fast), color var(--dur-fast),
              background var(--dur-fast), transform var(--dur-fast);
  flex-shrink: 0;
}
.act svg {
  width: 17px;
  height: 17px;
}
.act:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--info-bg);
}
.act:active {
  transform: scale(.93);
}
.act.wa:hover {
  border-color: #25D366;
  color: #25D366;
  background: rgba(37,211,102,.12);
}
.act.danger:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-bg);
}

.actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── 10. Stat Cards ───────────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 26px;
}

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
  cursor: default;
}
.stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat .top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat .ico {
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.stat .ico svg {
  width: 22px;
  height: 22px;
}
.stat .ico.b { background: var(--info-bg);   color: var(--primary); }
.stat .ico.w { background: var(--warn-bg);   color: var(--warn); }
.stat .ico.d { background: var(--danger-bg); color: var(--danger); }
.stat .ico.g { background: var(--good-bg);   color: var(--good); }

.stat .val {
  font-size: clamp(26px, 3vw, 32px);
  font-weight: 800;
  letter-spacing: -1px;
  margin-top: 14px;
  line-height: 1;
}

.stat .lbl {
  color: var(--text-2);
  font-size: var(--text-sm);
  margin-top: 6px;
  line-height: 1.35;
}

.stat .delta {
  font-size: 12.5px;
  font-weight: 700;
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.stat .delta svg {
  width: 14px;
  height: 14px;
}
.stat .delta.up   { color: var(--good); }
.stat .delta.down { color: var(--danger); }
.stat .delta.neutral { color: var(--text-3); }

/* ── 11. Panel / Card ─────────────────────────────────────── */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.panel-head h2 {
  font-size: var(--text-md);
  font-weight: 700;
  line-height: 1.2;
}
.panel-head .sub {
  color: var(--text-2);
  font-size: var(--text-sm);
  margin-top: 3px;
}
.panel-body {
  padding: 20px;
}

/* ── 12. Table ────────────────────────────────────────────── */
.scrollx {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.tbl th {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: .7px;
  text-transform: uppercase;
  color: var(--text-3);
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  white-space: nowrap;
}

.tbl td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  vertical-align: middle;
}

.tbl tr:last-child td {
  border-bottom: 0;
}

.tbl tbody tr {
  transition: background var(--dur-fast);
}
.tbl tbody tr:hover {
  background: var(--bg-2);
}

/* Customer cell */
.cust {
  display: flex;
  align-items: center;
  gap: 11px;
}
.cust .ava {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--navy);
  flex-shrink: 0;
  letter-spacing: -.5px;
}
html[data-theme="dark"] .cust .ava {
  color: var(--teal);
}
.cust .nm {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
}
.cust .ph {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.3;
}

/* Table helpers */
.muted  { color: var(--text-2); }
.small  { font-size: 12.5px; }
.remain {
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
}

/* ── 13. Badges ───────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* healthy */
.badge.good { color: var(--good);   background: var(--good-bg); }
/* warning */
.badge.warn { color: var(--warn);   background: var(--warn-bg); }
/* critical */
.badge.crit { color: var(--danger); background: var(--danger-bg); }
/* overdue — solid fill */
.badge.over { color: #fff; background: var(--danger); }
.badge.over::before { background: rgba(255,255,255,.8); }

/* ── 14. Filter Chips ─────────────────────────────────────── */
.filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 7px 14px;
  border-radius: var(--r-pill);
  transition: background var(--dur-fast), color var(--dur-fast),
              border-color var(--dur-fast), transform var(--dur-fast);
  cursor: pointer;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}
.chip:hover {
  border-color: var(--line-2);
  color: var(--text);
}
.chip:active {
  transform: scale(.97);
}
.chip.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
html[data-theme="dark"] .chip.active {
  background: var(--primary);
  border-color: var(--primary);
}

/* ── 15. Progress Bar ─────────────────────────────────────── */
.progress-wrap {
  height: 9px;
  background: var(--bg-2);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--r-pill);
  transition: width var(--dur-slow) var(--ease);
}
.progress-fill.green  { background: #25D366; }
.progress-fill.blue   { background: var(--primary); }
.progress-fill.teal   { background: var(--teal); }
.progress-fill.warn   { background: var(--warn); }
.progress-fill.danger { background: var(--danger); }

/* Progress row helper */
.progress-row {
  display: grid;
  gap: 7px;
}
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
}
.progress-label strong { font-weight: 600; }
.progress-label .rate  { color: var(--text-2); }

/* ── 16. Today Tasks ──────────────────────────────────────── */
.task {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  transition: background var(--dur-fast);
}
.task:last-child { border-bottom: 0; }
.task:hover { background: var(--bg-2); }

.task .tw {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--info-bg);
  color: var(--primary);
}
.task .tw svg { width: 19px; height: 19px; }

.task .tt { font-weight: 600; font-size: 14px; line-height: 1.3; }
.task .ts { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.task .time {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-2);
  font-weight: 600;
  flex-shrink: 0;
}

/* ── 17. Two-column lower section ────────────────────────── */
.lower {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 18px;
  margin-top: 18px;
}

/* ── 18. Form elements ────────────────────────────────────── */
.form-group {
  display: grid;
  gap: 7px;
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.5;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
  outline: none;
  min-height: 44px;
  appearance: none;
}
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230a2233' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
html[data-theme="dark"] .form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23eaf3fa' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}
.form-textarea {
  min-height: 96px;
  resize: vertical;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,168,232,.15);
}
.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-3);
}
.form-input.error,
.form-select.error {
  border-color: var(--danger);
}
.form-error {
  font-size: 12.5px;
  color: var(--danger);
  font-weight: 500;
}

/* ── 19. Modal + Scrim ────────────────────────────────────── */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(4,38,61,.55);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: scrimIn var(--dur) var(--ease) forwards;
}

@keyframes scrimIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.scrim.closing {
  animation: scrimOut var(--dur) var(--ease) forwards;
}
@keyframes scrimOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

.modal {
  background: var(--card);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn var(--dur) var(--spring) forwards;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.93) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.scrim.closing .modal {
  animation: modalOut var(--dur) var(--ease) forwards;
}
@keyframes modalOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(.94); }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 {
  font-size: var(--text-md);
  font-weight: 700;
}
.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  display: grid;
  place-items: center;
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.modal-close:hover {
  background: var(--bg-2);
  color: var(--text);
}
.modal-close svg { width: 18px; height: 18px; }

.modal-body {
  padding: 20px 22px;
  display: grid;
  gap: 16px;
}

.modal-foot {
  padding: 16px 22px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── 20. Toast Notifications ─────────────────────────────── */
#toast-region {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow);
  padding: 14px 18px;
  min-width: 280px;
  max-width: 380px;
  pointer-events: all;
  animation: toastIn var(--dur) var(--spring) forwards;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}
.toast.out {
  animation: toastOut var(--dur) var(--ease) forwards;
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(24px); }
}

.toast .t-ico {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.toast .t-ico svg { width: 18px; height: 18px; }

.toast.success .t-ico { background: var(--good-bg);   color: var(--good); }
.toast.info    .t-ico { background: var(--info-bg);   color: var(--primary); }
.toast.warn    .t-ico { background: var(--warn-bg);   color: var(--warn); }

.toast .t-msg {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

/* ── 21. Empty State ──────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 24px;
  text-align: center;
  gap: 12px;
}
.empty-state .e-ico {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--bg-2);
  display: grid;
  place-items: center;
  color: var(--text-3);
}
.empty-state .e-ico svg { width: 28px; height: 28px; }
.empty-state .e-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}
.empty-state .e-desc {
  font-size: var(--text-sm);
  color: var(--text-2);
  max-width: 300px;
  line-height: 1.5;
}

/* ── 22. Skeleton / Shimmer ───────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton {
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    var(--bg-2) 25%,
    var(--line) 50%,
    var(--bg-2) 75%
  );
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite;
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text.lg { height: 20px; }
.skeleton-text.sm { height: 11px; width: 60%; }
.skeleton-row { height: 54px; margin-bottom: 2px; }

/* ── 23. Mobile Overlay + Drawer ─────────────────────────── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(4,38,61,.52);
  z-index: 39;
  cursor: pointer;
}

/* ── 24. Responsive Breakpoints ───────────────────────────── */

/* Tablet: stack stat cards 2-col */
@media (max-width: 1080px) {
  .lower { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile: sidebar becomes a drawer */
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--side-w);
    height: 100dvh;
    transform: translateX(-100%);
    transition: transform var(--dur-slow) var(--ease);
    box-shadow: var(--shadow);
  }

  .app.open .sidebar  { transform: translateX(0); }
  .app.open .overlay  { display: block; }

  .menu-btn { display: grid; }

  .content { padding: 20px 16px 40px; }
}

/* Small mobile: 1-col stats, filters stay (yatay kaydırılır), tight content */
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; }
  /* Filtre chip'leri mobilde GİZLENMEZ — saha ekibi gecikmiş/kritik filtrelemeyi telefonda da kullanır.
     Yatay kaydırılabilir yapılır. */
  .panel-head { flex-wrap: wrap; }
  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 100%;
    padding-bottom: 2px;
  }
  .filters::-webkit-scrollbar { display: none; }
  .filters .chip { flex: 0 0 auto; }
  .content { padding: 16px 12px 36px; }
  .page-head h1 { font-size: 22px; }
  .lower { gap: 14px; }
}

/* ── 25. Misc utilities ───────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0;
}

.text-good   { color: var(--good); }
.text-warn   { color: var(--warn); }
.text-danger { color: var(--danger); }
.text-muted  { color: var(--text-2); }
.text-xs     { font-size: var(--text-xs); }
.text-sm     { font-size: var(--text-sm); }
.fw-700      { font-weight: 700; }
.fw-800      { font-weight: 800; }

.flex-row    { display: flex; align-items: center; }
.gap-8       { gap: 8px; }
.gap-12      { gap: 12px; }
.gap-16      { gap: 16px; }
.ml-auto     { margin-left: auto; }

/* Subscription plan card */
.plan-card {
  border: 2px solid var(--line);
  border-radius: var(--r);
  padding: 22px;
  transition: border-color var(--dur), box-shadow var(--dur), transform var(--dur);
  cursor: default;
}
.plan-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0,168,232,.10);
  transform: translateY(-2px);
}
.plan-card.featured {
  border-color: var(--primary);
  background: var(--info-bg);
}
.plan-price {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
  margin: 8px 0 4px;
}
.plan-price .period {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
}
.plan-features {
  list-style: none;
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.plan-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
}
.plan-features li svg {
  width: 16px;
  height: 16px;
  color: var(--good);
  flex-shrink: 0;
}

/* MRR / summary highlight box */
.highlight-box {
  background: linear-gradient(135deg, var(--primary), var(--teal));
  border-radius: var(--r);
  padding: 22px;
  color: #fff;
}
.highlight-box .h-val {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1;
}
.highlight-box .h-lbl {
  font-size: var(--text-sm);
  opacity: .85;
  margin-top: 5px;
}
.highlight-box .h-delta {
  font-size: 13px;
  font-weight: 700;
  margin-top: 8px;
  opacity: .9;
}
