/* ==========================================================================
   Club Pro — App UI (dashboards for all roles)
   Visual language: "STADIUM / MATCH-DAY"
     · deep pitch-green header + horizontal pill nav (no sidebar)
     · electric lime accents, scoreboard KPI tiles, angled-corner cards
     · Almarai typography, track-lane progress bars, green table headers
   Builds on ../../../shared/css/base.css (all class names kept stable)
   ========================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Almarai:wght@400;700;800&display=swap");

:root {
  /* Stadium palette */
  --pitch: #0b3d2e;
  --pitch-2: #0f5138;
  --pitch-3: #146446;
  --lime: #b8f135;
  --lime-600: #a3dc1e;
  --lime-soft: #effbd6;
  --ink: #0d1b14;
  --field: #f1f4ef;
  --orange: #ff8a1f;

  /* Tokens consumed by base.css and by page-level styles */
  --brand: #0f5138;
  --brand-600: #0b3d2e;
  --brand-700: #0b3d2e;
  --brand-soft: #e3f1dc;
  --accent: #b8f135;
  --accent-soft: #effbd6;
  --sidebar: #0b3d2e;          /* kept: pages use it as "dark surface" */
  --sidebar-2: #0f5138;
  --sidebar-text: #b9cfc2;
  --bg: #f1f4ef;
  --surface: #ffffff;
  --surface-2: #f6f8f4;
  --border: #e0e7dc;
  --text: #0d1b14;
  --text-2: #4f6157;
  --muted: #8d9c93;
  --success: #16a34a; --success-soft: #dcfce7;
  --warning: #e8770f; --warning-soft: #ffedd5;
  --danger: #ef4444;  --danger-soft: #fee2e2;
  --info: #0284c7;    --info-soft: #e0f2fe;
  --shadow: 0 6px 20px -10px rgba(13,27,20,.25);
  --shadow-lg: 0 24px 50px -18px rgba(11,61,46,.45);
  --font: "Almarai", "Cairo", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;

  --topbar-h: 64px;
  --pillnav-h: 54px;
  --header-h: calc(var(--topbar-h) + var(--pillnav-h));   /* used by pages for sticky offsets */
  --sidebar-w: 300px;          /* width of the mobile menu drawer */
  --cut: 14px;                 /* angled corner size */
  --gradient-brand: linear-gradient(135deg, #146446 0%, #0f5138 50%, #0b3d2e 100%);
}

html { overflow-x: clip; }
body { font-family: var(--font); }
body.app { background: var(--field); overflow-x: clip; }
.hidden { display: none !important; }
svg.lucide { width: 18px; height: 18px; stroke-width: 2; flex-shrink: 0; }
::selection { background: var(--lime); color: var(--ink); }

/* ==========================================================================
   SHELL — header (top bar + pill nav), content, footer, drawer, tab bar
   ========================================================================== */
.app-header { position: sticky; top: 0; z-index: 40; }
.shell-inner { width: 100%; max-width: 1440px; margin-inline: auto; padding-inline: 32px; }

/* ---------- Top bar ---------- */
.topbar-app {
  position: relative; height: var(--topbar-h); color: #fff;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.025) 0 90px, transparent 90px 180px),
    var(--pitch);
}
.topbar-app > .shell-inner { height: 100%; display: flex; align-items: center; gap: 18px; }
.menu-toggle { display: none; }

.brand { display: flex; align-items: center; gap: 11px; color: #fff; flex-shrink: 0; }
.brand:hover { color: #fff; }
.brand-mark {
  width: 40px; height: 40px; display: grid; place-items: center; background: var(--lime); color: var(--ink);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 10px 100%, 0 calc(100% - 10px)); border-radius: 3px;
}
.brand-mark svg { width: 22px; height: 22px; color: var(--ink); stroke-width: 2.3; }
/* Product logo (Club Pro) on a small white tile so it stays legible on the dark pitch bar */
.brand-logo { width: 42px; height: 42px; flex-shrink: 0; display: block; object-fit: contain; background: #fff; padding: 4px; border-radius: 10px; box-shadow: 0 4px 14px rgba(0,0,0,.22); }
.brand-name { font-weight: 800; font-size: 19px; line-height: 1.05; letter-spacing: .2px; }
.brand-name small { display: block; font-size: 11px; font-weight: 400; color: var(--sidebar-text); letter-spacing: 0; margin-top: 4px; }

.role-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; flex-shrink: 0;
  border-radius: 999px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1);
  font-size: 12px; color: var(--sidebar-text); white-space: nowrap;
}
.role-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(184,241,53,.18); }
.role-chip b { color: #fff; font-weight: 700; }

.global-search { position: relative; flex: 1; max-width: 480px; min-width: 0; margin-inline-start: auto; }
.global-search input {
  width: 100%; height: 40px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.08);
  border-radius: 999px; padding: 0 42px 0 52px; font: inherit; font-size: 13px; color: #fff; transition: .15s;
}
.global-search input::placeholder { color: rgba(255,255,255,.55); }
.global-search input:focus { outline: none; background: #fff; color: var(--ink); border-color: var(--lime); box-shadow: 0 0 0 4px rgba(184,241,53,.3); }
.global-search input:focus::placeholder { color: var(--muted); }
.global-search > svg { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,.6); pointer-events: none; }
.global-search:focus-within > svg { color: var(--pitch-2); }
.global-search kbd { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font: 700 11px var(--font); color: var(--ink); background: var(--lime); border-radius: 6px; padding: 1px 7px; }
.search-results { position: absolute; top: calc(100% + 8px); inset-inline: 0; z-index: 60; }

.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border); background: #fff;
  display: grid; place-items: center; color: var(--text-2); cursor: pointer; position: relative; transition: .15s;
}
.icon-btn:hover { color: var(--pitch-2); border-color: var(--lime); background: var(--lime-soft); }
.topbar-app .icon-btn { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.1); color: #e3eee7; }
.topbar-app .icon-btn:hover { background: var(--lime); border-color: var(--lime); color: var(--ink); }
.icon-btn .dot-count {
  position: absolute; top: -6px; left: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--orange); color: var(--ink); font-size: 11px; font-weight: 800; display: grid; place-items: center;
  border: 2px solid var(--pitch); font-variant-numeric: tabular-nums;
}
.search-toggle { display: none !important; }

.user-btn {
  display: flex; align-items: center; gap: 10px; padding: 3px 4px 3px 12px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.05); cursor: pointer; font: inherit; text-align: right; color: #fff;
}
.user-btn:hover { background: rgba(255,255,255,.12); }
.user-btn .avatar { box-shadow: 0 0 0 2px var(--lime); }
.user-btn .meta b { display: block; font-size: 13px; color: #fff; line-height: 1.2; font-weight: 700; }
.user-btn .meta small { font-size: 11px; color: var(--sidebar-text); }
.user-btn > svg { color: var(--sidebar-text); width: 16px; }

/* ---------- Pill navigation row ---------- */
.pillnav {
  position: relative; height: var(--pillnav-h); background: var(--pitch-2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.pillnav::after { /* lime touch-line under the nav */
  content: ""; position: absolute; inset: auto 0 -3px 0; height: 3px;
  background: linear-gradient(90deg, transparent 0, var(--lime) 0) right / 120px 3px no-repeat, rgba(184,241,53,.28);
}
.pillnav > .shell-inner { height: 100%; position: relative; display: flex; align-items: center; }
.pill-track {
  display: flex; align-items: center; gap: 4px; height: 100%; flex: 1; min-width: 0;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none; scroll-behavior: smooth; overscroll-behavior-x: contain;
}
.pill-track::-webkit-scrollbar { display: none; }
.pillnav .nav-link {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 999px; flex-shrink: 0;
  color: rgba(255,255,255,.78); font-size: 13px; font-weight: 700; white-space: nowrap; transition: background .15s, color .15s;
}
.pillnav .nav-link svg { width: 16px; height: 16px; opacity: .85; }
.pillnav .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.pillnav .nav-link.active { background: var(--lime); color: var(--ink); box-shadow: 0 6px 16px -6px rgba(184,241,53,.6); }
.pillnav .nav-link.active svg { opacity: 1; color: var(--ink); }
.pillnav .nav-link .ext { width: 13px; height: 13px; opacity: .5; }
.pill-sep { flex-shrink: 0; width: 3px; height: 18px; margin: 0 8px; background: rgba(184,241,53,.35); transform: skewX(-20deg); border-radius: 1px; }

.nav-link .count {
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; padding: 0 7px; border-radius: 999px;
  line-height: 18px; font-variant-numeric: tabular-nums;
}
.nav-link .count.soft { background: var(--orange); color: var(--ink); }
.pillnav .nav-link.active .count { background: var(--ink); color: var(--lime); }

.pill-scroll {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 30px; height: 30px; border-radius: 50%;
  border: 0; background: var(--lime); color: var(--ink); display: none; place-items: center; cursor: pointer;
  box-shadow: 0 0 0 6px var(--pitch-2), 0 4px 10px rgba(0,0,0,.3);
}
.pill-scroll svg { width: 16px; height: 16px; }
.pill-scroll.to-start { right: 26px; }
.pill-scroll.to-end { left: 26px; }
.pillnav.can-start .pill-scroll.to-start, .pillnav.can-end .pill-scroll.to-end { display: grid; }

/* ---------- Content / footer ---------- */
.main { min-height: calc(100vh - var(--header-h)); display: flex; flex-direction: column; min-width: 0; }
.content { padding: 30px 32px 40px; flex: 1; width: 100%; max-width: 1440px; margin-inline: auto; min-width: 0; }
.app-foot {
  width: 100%; max-width: 1440px; margin-inline: auto; padding: 16px 32px 26px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted); border-top: 1px dashed #d3dccd;
}
.app-foot b { color: var(--text-2); font-weight: 800; }
.app-foot a { color: var(--pitch-2); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.app-foot a svg { width: 14px; height: 14px; }
.by-almgrat { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.by-almgrat img { width: 18px; height: 18px; }

/* ---------- Menu drawer (tablet / phone, keeps sections) ---------- */
.sidebar {
  position: fixed; inset-block: 0; right: 0; width: min(var(--sidebar-w), 86vw); z-index: 70;
  background: var(--pitch); color: var(--sidebar-text);
  display: flex; flex-direction: column; transform: translateX(105%); transition: transform .25s ease;
}
body.nav-open .sidebar { transform: none; box-shadow: -20px 0 60px rgba(0,0,0,.35); }
.sidebar .brand { padding: 20px 20px 16px; }
.sidebar .role-chip { margin: 0 18px 10px; height: auto; padding: 9px 12px; border-radius: 12px; display: flex; }
.nav-scroll { flex: 1; overflow-y: auto; padding: 4px 12px 16px; scrollbar-width: thin; scrollbar-color: #1d6a4c transparent; }
.nav-section { font-size: 11px; font-weight: 800; color: var(--lime); opacity: .7; padding: 16px 12px 8px; letter-spacing: .3px; }
.sidebar .nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--sidebar-text); font-weight: 700; font-size: 14px; transition: .15s; position: relative; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar .nav-link.active { background: var(--lime); color: var(--ink); }
.sidebar .nav-link.active svg { color: var(--ink); }
.sidebar .nav-link .count { margin-right: auto; }
.sidebar .nav-link .ext { margin-right: auto; width: 14px; opacity: .5; }
.sidebar-foot { padding: 14px 18px 18px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-foot a { color: #e3eee7; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.sidebar-foot a:hover { color: var(--lime); }
.sidebar-foot .by-almgrat { color: var(--sidebar-text); }
.sidebar-overlay { position: fixed; inset: 0; background: rgba(7,24,17,.55); z-index: 65; opacity: 0; visibility: hidden; transition: .2s; }
body.nav-open .sidebar-overlay { opacity: 1; visibility: visible; }

/* ---------- Bottom tab bar (member / coach on phones) ---------- */
.tabbar { display: none; }

/* ==========================================================================
   Dropdowns, notifications, search panel
   ========================================================================== */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 10px); left: 0; min-width: 240px; z-index: 80; color: var(--text);
  background: #fff; border: 1px solid var(--border); border-top: 3px solid var(--lime); border-radius: 4px 4px 14px 14px; box-shadow: var(--shadow-lg);
  padding: 6px; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: .16s ease;
}
.dropdown.open > .dropdown-menu, .dropdown-menu.show { opacity: 1; visibility: visible; transform: none; }
.dropdown-menu a, .dropdown-menu button.item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 9px; color: var(--text); font: inherit; font-size: 14px; font-weight: 400; background: none; border: 0; cursor: pointer; text-align: right; }
.dropdown-menu a:hover, .dropdown-menu button.item:hover { background: var(--lime-soft); }
.dropdown-menu a svg, .dropdown-menu button.item svg { color: var(--muted); }
.dropdown-menu .danger, .dropdown-menu .danger svg { color: var(--danger); }
.dropdown-menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.dropdown-head { padding: 12px 12px 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dropdown-head b { font-size: 15px; font-weight: 800; }
.notif-menu { width: 380px; padding: 0; }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { display: flex; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--border); position: relative; }
.notif-item.unread { background: #f7fcec; }
.notif-item.unread::after { content: ""; position: absolute; left: 14px; top: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--lime-600); box-shadow: 0 0 0 3px rgba(184,241,53,.3); }
.notif-item p { margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.6; }
.notif-item b { font-size: 14px; display: block; }
.notif-item small { font-size: 12px; color: var(--muted); }
.notif-foot { display: block; text-align: center; padding: 12px; border-top: 1px solid var(--border); font-weight: 700; font-size: 14px; color: var(--pitch-2); background: var(--surface-2); border-radius: 0 0 14px 14px; }
.notif-foot:hover { background: var(--lime); color: var(--ink); }

.search-panel { background: #fff; color: var(--text); border: 1px solid var(--border); border-top: 3px solid var(--lime); border-radius: 4px 4px 14px 14px; box-shadow: var(--shadow-lg); padding: 8px; max-height: 420px; overflow-y: auto; }
.search-group { font-size: 11px; font-weight: 800; color: var(--pitch-2); padding: 8px 10px 4px; }
.search-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; color: var(--text); }
.search-item:hover, .search-item.focus { background: var(--lime-soft); }
.search-item .sub { font-size: 12px; color: var(--muted); }
.search-item .tail { margin-right: auto; }
.search-empty { padding: 24px; text-align: center; color: var(--muted); font-size: 14px; }

/* ==========================================================================
   Page header — sporty title with slanted underline
   ========================================================================== */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 8px; flex-wrap: wrap; font-weight: 700; }
.breadcrumb a { color: var(--text-2); }
.breadcrumb a:hover { color: var(--pitch-2); }
.breadcrumb svg { width: 14px; height: 14px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head > * { min-width: 0; }
.page-head h1 { font-size: 28px; font-weight: 800; margin: 0; letter-spacing: -.2px; color: var(--ink); }
.page-head h1::after {
  content: ""; display: block; width: 64px; height: 6px; margin-top: 10px;
  background: linear-gradient(90deg, var(--pitch-2) 0 30%, var(--lime) 30%); transform: skewX(-30deg); transform-origin: right; border-radius: 1px;
}
.page-head p { margin: 8px 0 0; color: var(--text-2); font-size: 14px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn { border-radius: 999px; padding: 9px 18px; font-size: 14px; font-weight: 700; }
.btn-sm { padding: 6px 13px; font-size: 13px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-lg { padding: 13px 24px; font-size: 15px; }
.btn-primary { background: var(--lime); color: var(--ink); box-shadow: 0 6px 16px -8px rgba(122,170,20,.9); }
.btn-primary:hover { background: var(--lime-600); color: var(--ink); }
.btn-primary svg { color: var(--ink); }
.btn-outline { background: #fff; color: var(--ink); border-color: #cfd9ca; }
.btn-outline:hover { border-color: var(--pitch-2); color: var(--pitch-2); background: #fff; }
.btn-ghost:hover { background: var(--lime-soft); color: var(--ink); }
.btn-soft { background: var(--brand-soft); color: var(--pitch-2); }
.btn-soft:hover { background: #d2e9c6; }
.btn-dark { background: var(--pitch); color: #fff; }
.btn-dark:hover { background: var(--pitch-2); color: var(--lime); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-accent { background: var(--orange); color: var(--ink); }
.btn-accent:hover { background: #f57c0a; color: var(--ink); }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: 10px; border: 1px solid var(--border); background: #fff; color: var(--text-2); display: inline-grid; place-items: center; cursor: pointer; transition: .15s; }
.btn-icon:hover { color: var(--ink); border-color: var(--lime); background: var(--lime-soft); }
.btn-icon svg { width: 16px; height: 16px; }
.btn-block { width: 100%; }
button:disabled { opacity: .55; cursor: not-allowed; }

/* ==========================================================================
   Grid & utilities
   ========================================================================== */
.grid { display: grid; gap: 20px; }
.grid > *, .stack > *, .row-between > *, .card { min-width: 0; } /* let wide tables scroll inside .table-wrap */
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.text-muted { color: var(--muted); } .text-2 { color: var(--text-2); }
.text-success { color: var(--success); } .text-danger { color: var(--danger); } .text-warning { color: var(--warning); } .text-brand { color: var(--pitch-2); }
.fw-7 { font-weight: 700; } .fw-8 { font-weight: 800; }
.fs-12 { font-size: 12px; } .fs-13 { font-size: 13px; } .fs-14 { font-size: 14px; }
.nowrap { white-space: nowrap; }
.ltr { direction: ltr; unicode-bidi: embed; display: inline-block; }

/* ==========================================================================
   Cards — angled top-left corner + lime accent stripe (no clip-path, so
   dropdowns/pickers inside cards are never clipped)
   ========================================================================== */
.card {
  --card-bg: #fff;
  border-radius: 4px; border: 1px solid transparent; position: relative;
  background:
    linear-gradient(var(--lime), var(--lime)) top right / 56px 4px no-repeat,
    linear-gradient(135deg, transparent var(--cut), var(--card-bg) calc(var(--cut) + .5px)) border-box;
  box-shadow: 0 1px 0 rgba(13,27,20,.05), 0 10px 22px -18px rgba(11,61,46,.45);
}
.card .card, .modal .card { --card-bg: #fff; border-color: var(--border); background: #fff; box-shadow: none; border-radius: 10px; }
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 16px; border-bottom: 1px solid #edf1ea; flex-wrap: wrap; }
.card-head > * { min-width: 0; }
.card-head h3 { margin: 0; font-size: 16px; font-weight: 800; color: var(--ink); }
.card-head h3:not(.row)::after {
  content: ""; display: block; width: 26px; height: 3px; margin-top: 6px;
  background: var(--lime-600); transform: skewX(-35deg); transform-origin: right; border-radius: 1px;
}
.card-head p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.card-body { padding: 20px 22px; }
.card-foot { padding: 14px 22px; border-top: 1px solid #edf1ea; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; background: var(--surface-2); border-radius: 0 0 4px 4px; }

/* ---------- KPI — scoreboard tiles ---------- */
.card.kpi, .kpi {
  padding: 18px 20px 16px; display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; color: #fff;
  background:
    linear-gradient(var(--c, var(--lime)), var(--c, var(--lime))) bottom right / 100% 4px no-repeat,
    repeating-linear-gradient(90deg, rgba(255,255,255,.03) 0 26px, transparent 26px 52px) border-box,
    linear-gradient(135deg, transparent var(--cut), var(--pitch) calc(var(--cut) + .5px)) border-box;
  box-shadow: 0 14px 26px -18px rgba(11,61,46,.8);
  transition: transform .15s ease, box-shadow .15s ease;
}
a.kpi:hover { transform: translateY(-3px); box-shadow: 0 20px 30px -18px rgba(11,61,46,.9); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--c-soft, var(--brand-soft)); color: var(--c, var(--brand)); }
.kpi-icon svg { width: 22px; height: 22px; }
.kpi .kpi-icon { width: 40px; height: 40px; border-radius: 10px; background: rgba(255,255,255,.08); color: color-mix(in srgb, var(--c, var(--lime)) 45%, #fff); border: 1px solid rgba(255,255,255,.08); }
.kpi-label { font-size: 13px; color: var(--text-2); font-weight: 700; }
.kpi .kpi-label { color: rgba(255,255,255,.72); }
.kpi-value { font-size: 28px; font-weight: 800; line-height: 1; letter-spacing: -.3px; font-variant-numeric: tabular-nums; color: var(--ink); }
.kpi .kpi-value { font-size: 34px; color: var(--lime); text-shadow: 0 0 18px rgba(184,241,53,.25); }
.kpi-value small { font-size: 13px; font-weight: 700; color: var(--muted); margin-right: 5px; text-shadow: none; }
.kpi .kpi-value small { color: rgba(255,255,255,.55); }
.kpi-foot { font-size: 12px; color: var(--muted); }
.kpi .kpi-foot { color: rgba(255,255,255,.55); }
.trend { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.trend svg { width: 13px; height: 13px; }
.trend.up { color: #15803d; background: var(--success-soft); }
.trend.down { color: #b91c1c; background: var(--danger-soft); }
.trend.flat { color: var(--text-2); background: #eef2ea; }
.kpi .trend.up { color: var(--ink); background: var(--lime); }
.kpi .trend.down { color: #fff; background: rgba(239,68,68,.85); }
.kpi .trend.flat { color: #e3eee7; background: rgba(255,255,255,.1); }
.kpi .text-success { color: var(--lime); } .kpi .text-danger { color: #fca5a5; } .kpi .text-warning { color: #fdba74; } .kpi .text-muted { color: rgba(255,255,255,.55); }
.c-green  { --c: #16a34a; --c-soft: #dcfce7; }
.c-blue   { --c: #0284c7; --c-soft: #e0f2fe; }
.c-amber  { --c: #e8770f; --c-soft: #ffedd5; }
.c-red    { --c: #ef4444; --c-soft: #fee2e2; }
.c-violet { --c: #7c3aed; --c-soft: #ede9fe; }
.c-slate  { --c: #4f6157; --c-soft: #e9eee6; }
.c-teal   { --c: #0d9488; --c-soft: #ccfbf1; }
.c-orange { --c: #ff8a1f; --c-soft: #ffedd5; }
.kpi.c-green { --c: var(--lime); }
.kpi.c-slate { --c: #b9cfc2; }

/* ---------- Hero / welcome banner — match-day scoreboard ---------- */
.welcome {
  border-radius: 4px; padding: 28px 30px; color: #fff; position: relative; overflow: hidden;
  clip-path: polygon(22px 0, 100% 0, 100% 100%, 0 100%, 0 22px);
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 70px, transparent 70px 140px),
    radial-gradient(90% 140% at 0% 0%, #1a7a52 0%, transparent 60%),
    linear-gradient(135deg, var(--pitch-2) 0%, var(--pitch) 70%);
}
.welcome::before { content: ""; position: absolute; inset: 0 0 auto auto; width: 160px; height: 5px; background: var(--lime); }
.welcome::after { content: ""; position: absolute; left: -70px; top: 50%; width: 240px; height: 240px; transform: translateY(-50%); border-radius: 50%; border: 2px solid rgba(255,255,255,.12); pointer-events: none; }
.welcome h2 { font-size: 27px; font-weight: 800; margin-bottom: 6px; }
.welcome p { margin: 0; opacity: .82; }
.welcome .btn-outline { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.22); color: #fff; }
.welcome .btn-outline:hover { background: rgba(255,255,255,.18); color: #fff; }

/* ---------- Badges — pill tags ---------- */
.badge { font-size: 12px; padding: 3px 11px; gap: 6px; white-space: nowrap; border-radius: 999px; font-weight: 700; }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #ffedd5; color: #c2410c; }
.badge-danger  { background: #fee2e2; color: #b91c1c; }
.badge-brand   { background: var(--brand-soft); color: var(--pitch-2); }
.badge-slate { background: #e9eee6; color: #4f6157; }
.badge-violet { background: #ede9fe; color: #6d28d9; }
.badge-accent { background: var(--lime); color: var(--ink); }
.badge-lg { font-size: 13px; padding: 5px 13px; }

/* ---------- Avatars ---------- */
.avatar { width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; flex-shrink: 0; background: var(--av, var(--brand)); }
.avatar-sm { width: 30px; height: 30px; font-size: 12px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }
.avatar-xl { width: 96px; height: 96px; font-size: 34px; border: 4px solid #fff; box-shadow: 0 0 0 3px var(--lime), var(--shadow); }
.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person b { display: block; font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person small { display: block; font-size: 12px; color: var(--muted); }
a.person:hover b { color: var(--pitch-2); }

/* ==========================================================================
   Tables — green header row
   ========================================================================== */
.toolbar { display: flex; align-items: center; gap: 10px; padding: 16px 22px; border-bottom: 1px solid #edf1ea; flex-wrap: wrap; }
.toolbar > * { min-width: 0; }
.toolbar .search-input { position: relative; flex: 1; min-width: 200px; max-width: 340px; }
.toolbar .search-input input { padding-right: 40px; border-radius: 999px; }
.toolbar .search-input svg { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 17px; }
.toolbar .spacer { flex: 1; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: right; font-weight: 700; font-size: 12px; color: #e7f2ea; background: var(--pitch-2);
  padding: 12px 16px; border-bottom: 3px solid var(--lime); white-space: nowrap; letter-spacing: .2px;
}
.table th .check { accent-color: var(--lime); }
.table td { padding: 12px 16px; border-bottom: 1px solid #edf1ea; vertical-align: middle; white-space: nowrap; }
.table tbody tr { transition: background .12s; }
.table tbody tr:nth-child(even) { background: #fafcf8; }
.table tbody tr:hover { background: #f4fae6; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.table .num { font-weight: 800; font-variant-numeric: tabular-nums; }
.table .code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--text-2); direction: ltr; display: inline-block; }
.pagination { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pagination button { min-width: 32px; height: 32px; border-radius: 999px; border: 1px solid var(--border); background: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; color: var(--text-2); font-variant-numeric: tabular-nums; }
.pagination button:hover { border-color: var(--lime); }
.pagination button.active { background: var(--pitch-2); border-color: var(--pitch-2); color: var(--lime); }

/* ==========================================================================
   Forms
   ========================================================================== */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .label { font-size: 13px; font-weight: 700; color: var(--text-2); }
.input, .select, .textarea {
  width: 100%; height: 42px; border: 1px solid #d6dfd1; border-radius: 10px; padding: 0 12px;
  font: inherit; font-size: 14px; background: #fff; color: var(--text); transition: .15s;
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%230f5138' stroke-width='2.2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 12px center; padding-left: 34px; }
.toolbar .select { width: auto; min-width: 140px; max-width: 100%; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--pitch-2); box-shadow: 0 0 0 4px rgba(184,241,53,.35); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.hint { font-size: 12px; color: var(--muted); }
.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cdd6c8; border-radius: 999px; cursor: pointer; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 20px; height: 20px; right: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--pitch-2); }
.switch input:checked + span::before { transform: translateX(-20px); background: var(--lime); }
.check { width: 18px; height: 18px; accent-color: var(--pitch-2); cursor: pointer; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 12px; }
.choice { border: 1.5px solid var(--border); border-radius: 12px; padding: 16px; cursor: pointer; transition: .15s; background: #fff; position: relative; text-align: center; }
.choice:hover { border-color: var(--lime-600); }
.choice.selected { border-color: var(--pitch-2); background: var(--lime-soft); box-shadow: 0 0 0 3px rgba(184,241,53,.4); }
.choice.selected::after { content: "✓"; position: absolute; top: 8px; left: 10px; width: 20px; height: 20px; border-radius: 50%; background: var(--pitch-2); color: var(--lime); font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.choice .emoji { font-size: 30px; line-height: 1; margin-bottom: 8px; display: block; }

/* ==========================================================================
   Tabs & segmented control
   ========================================================================== */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 12px 16px; font: inherit; font-size: 14px; font-weight: 700; color: var(--text-2); background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--lime-600); }
.tab.active svg { color: var(--pitch-2); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade .2s ease; }
.seg { display: inline-flex; padding: 4px; background: #e6ece2; border-radius: 999px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 700; color: var(--text-2); padding: 6px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.seg button.active { background: var(--pitch-2); color: var(--lime); box-shadow: 0 2px 6px rgba(11,61,46,.25); }

/* ==========================================================================
   Modal & toast
   ========================================================================== */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(7,24,17,.6); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; opacity: 0; transition: opacity .18s; }
.modal-backdrop.show { opacity: 1; }
.modal { background: #fff; border-radius: 6px 6px 18px 18px; border-top: 5px solid var(--lime); width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0,0,0,.3); transform: translateY(12px) scale(.98); transition: transform .2s ease; min-width: 0; }
.modal-backdrop.show .modal { transform: none; }
.modal.lg { max-width: 820px; }
.modal.sm { max-width: 420px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 18px; font-weight: 800; }
.modal-body { padding: 22px 24px; overflow-y: auto; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-start; flex-wrap: wrap; background: var(--surface-2); border-radius: 0 0 18px 18px; }
.success-mark { width: 76px; height: 76px; border-radius: 50%; background: var(--lime); color: var(--ink); display: grid; place-items: center; margin: 4px auto 16px; animation: pop .35s ease; box-shadow: 0 0 0 8px var(--lime-soft); }
.success-mark svg { width: 38px; height: 38px; stroke-width: 2.8; }

.toast-wrap { position: fixed; bottom: 24px; left: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { min-width: 280px; max-width: 380px; background: var(--pitch); color: #fff; border-radius: 4px 14px 14px 14px; border-right: 4px solid var(--lime); padding: 14px 16px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow-lg); font-size: 14px; animation: toastIn .25s ease; }
.toast .t-icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--lime); color: var(--ink); flex-shrink: 0; }
.toast.error { border-right-color: var(--danger); } .toast.error .t-icon { background: rgba(239,68,68,.25); color: #fca5a5; }
.toast.info { border-right-color: #38bdf8; } .toast.info .t-icon { background: rgba(56,189,248,.2); color: #7dd3fc; }
.toast.warning { border-right-color: var(--orange); } .toast.warning .t-icon { background: rgba(255,138,31,.25); color: #fdba74; }
.toast.hide { animation: toastOut .25s ease forwards; }

/* ==========================================================================
   Lists, feed, progress (track lanes), ring, charts, misc
   ========================================================================== */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed #d8e1d3; }
.feed li:last-child { border-bottom: 0; }
.feed .f-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.feed p { margin: 0; font-size: 14px; }
.feed small { color: var(--muted); font-size: 12px; }
.t-info { background: var(--info-soft); color: var(--info); }
.t-success { background: var(--success-soft); color: var(--success); }
.t-warning { background: var(--warning-soft); color: var(--warning); }
.t-danger { background: var(--danger-soft); color: var(--danger); }
.t-brand { background: var(--lime-soft); color: var(--pitch-2); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #edf1ea; }
.list-row:last-child { border-bottom: 0; }

/* Progress = running-track lane */
.progress {
  height: 10px; border-radius: 3px; overflow: hidden; position: relative;
  background:
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(255,255,255,.9) 18px 20px),
    #e3e9df;
}
.progress > span {
  display: block; height: 100%; border-radius: 2px; transition: width .6s ease; position: relative;
  background:
    repeating-linear-gradient(-55deg, rgba(255,255,255,.18) 0 6px, transparent 6px 12px),
    var(--c, var(--pitch-2));
}
.progress > span::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--lime); }

.ring { --p: 75; --c: var(--pitch-2); width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), #e3e9df 0); position: relative; flex-shrink: 0; }
.ring::before { content: ""; position: absolute; inset: 12px; background: #fff; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--lime-soft); }
.ring > * { position: relative; text-align: center; }
.ring b { font-size: 26px; font-weight: 800; display: block; line-height: 1; font-variant-numeric: tabular-nums; }
.ring small { font-size: 12px; color: var(--muted); }

.chart-box { position: relative; height: 280px; min-width: 0; }
.chart-box.sm { height: 220px; }
.chart-box.lg { height: 340px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 8px; border-radius: 2px; display: inline-block; transform: skewX(-20deg); }

.empty-state { padding: 48px 24px; }
.empty-state .empty-icon { background: var(--lime-soft); color: var(--pitch-2); }

.info-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
.info-list div { min-width: 0; }
.info-list div small { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.info-list div b { font-size: 14px; font-weight: 700; }

/* Calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dow { text-align: center; font-size: 12px; font-weight: 800; color: var(--muted); padding: 4px 0; }
.cal .day { aspect-ratio: 1; border-radius: 8px; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: #f3f6f1; color: var(--text-2); position: relative; font-variant-numeric: tabular-nums; }
.cal .day.p { background: var(--pitch-2); color: var(--lime); }
.cal .day.a { background: var(--danger-soft); color: #b91c1c; }
.cal .day.today { outline: 2px solid var(--lime-600); outline-offset: 1px; }
.cal .day.future { background: transparent; color: #c6d0c1; }
.cal .day.empty { background: transparent; }

/* Session (fixture-style row) */
.session { display: flex; gap: 14px; padding: 12px 14px; border-radius: 4px 12px 12px 4px; border: 1px solid var(--border); background: #fff; align-items: center; border-right: 5px solid var(--c, var(--pitch-2)); min-width: 0; }
.session > * { min-width: 0; }
.session .time { text-align: center; min-width: 64px; padding: 6px 4px; border-radius: 8px; background: var(--pitch); color: var(--lime); flex-shrink: 0; }
.session .time b { display: block; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.session .time small { font-size: 11px; color: rgba(255,255,255,.65); }
.session h4 { margin: 0 0 2px; font-size: 15px; font-weight: 800; }
.session .meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.session .meta span { display: inline-flex; align-items: center; gap: 4px; }
.session .meta svg { width: 14px; height: 14px; }

.sport-tile { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 26px; background: color-mix(in srgb, var(--c, var(--brand)) 13%, #fff); flex-shrink: 0; }

.qr { width: 132px; height: 132px; background: #fff; padding: 8px; border-radius: 10px; display: grid; grid-template-columns: repeat(21, 1fr); gap: 0; }
.qr i { display: block; aspect-ratio: 1; }
.qr i.on { background: var(--ink); }

/* Animations (names kept: pages reuse them) */
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(12px); } }
.fade-in { animation: fade .3s ease both; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1280px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .role-chip-top { display: none; }
}
@media (max-width: 1100px) {
  .grid-main { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .shell-inner { padding-inline: 20px; }
  .menu-toggle { display: grid; }
  .user-btn .meta { display: none; }
  .user-btn { padding: 3px; }
  .content { padding: 24px 20px 36px; }
  .app-foot { padding-inline: 20px; }
  .pill-scroll.to-start { right: 14px; } .pill-scroll.to-end { left: 14px; }
}
@media (max-width: 720px) {
  :root { --topbar-h: 58px; --pillnav-h: 50px; }
  .shell-inner { padding-inline: 12px; }
  .topbar-app > .shell-inner { gap: 8px; }
  .brand-name small { display: none; }
  .brand-name { font-size: 17px; }
  .brand-mark { width: 36px; height: 36px; }
  .brand-logo { width: 38px; height: 38px; padding: 3px; border-radius: 9px; }
  .header-actions { margin-inline-start: auto; gap: 6px; }
  .icon-btn { width: 38px; height: 38px; }
  .search-toggle { display: grid !important; }
  .global-search { display: none; position: absolute; inset-inline: 12px; top: calc(100% + 8px); max-width: none; margin: 0; z-index: 5; }
  .topbar-app.search-open .global-search { display: block; }
  .global-search input { background: #fff; color: var(--ink); border-color: var(--lime); box-shadow: var(--shadow-lg); padding-left: 14px; height: 44px; }
  .global-search > svg { color: var(--pitch-2); }
  .global-search kbd { display: none; }
  .pillnav .nav-link { height: 34px; padding: 0 12px; }
  .pill-scroll { display: none !important; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .info-list { grid-template-columns: minmax(0, 1fr); }
  .content { padding: 20px 14px 32px; }
  .app-foot { padding-inline: 14px; justify-content: center; text-align: center; }
  .page-head { margin-bottom: 20px; }
  .page-head h1 { font-size: 22px; }
  .card-pad, .card-body { padding: 18px 16px; }
  .card-head, .toolbar, .card-foot { padding-inline: 16px; }
  .toolbar .search-input { min-width: 0; flex-basis: 100%; max-width: none; }
  .notif-menu { position: fixed; top: calc(var(--topbar-h) + 6px); left: 12px; right: 12px; width: auto; min-width: 0; }
  .user-btn > svg { display: none; }
  .toast-wrap { left: 12px; right: 12px; bottom: 16px; }
  .toast { max-width: none; min-width: 0; }
  .welcome { padding: 22px 18px; }
  .welcome h2 { font-size: 22px; }
  .header-actions .hide-sm { display: none; }
  .modal-head, .modal-body, .modal-foot { padding-inline: 18px; }

  /* member / coach: bottom tab bar replaces the pill row on phones */
  body.has-tabbar { --header-h: var(--topbar-h); }
  body.has-tabbar .pillnav { display: none; }
  body.has-tabbar .main { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  body.has-tabbar .toast-wrap { bottom: calc(82px + env(safe-area-inset-bottom)); }
  .tabbar {
    position: fixed; inset: auto 0 0 0; z-index: 45; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    height: calc(64px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--pitch); border-top: 3px solid var(--lime); box-shadow: 0 -10px 30px rgba(7,24,17,.25);
  }
  .tabbar a, .tabbar button {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0;
    color: var(--sidebar-text); font: inherit; font-size: 11px; font-weight: 700; background: none; border: 0; cursor: pointer; padding: 0 2px;
  }
  .tabbar span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar svg { width: 21px; height: 21px; }
  .tabbar .active { color: var(--lime); }
  .tabbar .active::before { content: ""; position: absolute; top: 0; width: 34px; height: 4px; background: var(--lime); transform: skewX(-25deg); }
  .tabbar .t-count { position: absolute; top: 7px; left: calc(50% - 20px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--orange); color: var(--ink); font-size: 10px; font-weight: 800; display: grid; place-items: center; }
}
@media (max-width: 480px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card.kpi, .kpi { padding: 14px 14px 13px; gap: 10px; }
  .kpi-value { font-size: 22px; }
  .kpi .kpi-value { font-size: 23px; }
  .kpi-icon { width: 38px; height: 38px; }
  .kpi .kpi-icon { width: 34px; height: 34px; }
  .kpi .trend { padding: 2px 7px; font-size: 11px; }
}
@media (max-width: 360px) {
  .brand-name { display: none; }
}
@media print {
  .app-header, .sidebar, .sidebar-overlay, .tabbar, .app-foot, .topbar-app, .page-actions, .toolbar, .toast-wrap { display: none !important; }
  .main { margin: 0; padding: 0 !important; }
  body.app { background: #fff; }
}
