@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/6.6.6/css/flag-icons.min.css');

/* ═══════════════════════════════════════════════════════════════════════════
   Köterverket Platform — Design System
   ─────────────────────────────────────────────────────────────────────────
   System accent colours:
     Backroom  (dog clubs / sports)  → #2563eb  (blue)
     Bloodline (breeders / kennels)  → #e11d48  (rose)
     Boardroom (organisations)       → #7c3aed  (purple)

   Set  data-system="backroom|bloodline|boardroom"  on  <html>
   Set  data-theme="dark"  on  <html>  for dark mode
═══════════════════════════════════════════════════════════════════════════ */

/* ── Base tokens (Backroom / blue default) ─────────────────────────────── */
:root {
  --bg:      #eef1f6;
  --paper:   #ffffff;
  --paper2:  rgba(255,255,255,.88);
  --text:    #0d1321;
  --muted:   #52637a;
  --line:    rgba(13,19,33,.14);
  --line2:   rgba(13,19,33,.09);
  --shadow:  0 18px 50px rgba(13,19,33,.08);

  --accent:  #2563eb;
  --accent2: #1d4ed8;
  --accent-bg: rgba(37,99,235,.08);

  --ok:   #166534;
  --bad:  #991b1b;
  --warn: #b45309;

  --ok-bg:   rgba(22,101,52,.09);
  --bad-bg:  rgba(153,27,27,.09);
  --warn-bg: rgba(180,83,9,.09);

  --radius:  14px;
  --radius2: 18px;
  --pad:     16px;

  --btn:     #0d1321;
  --btnText: #ffffff;

  --sidebar-w: 224px;
  --topbar-h:  68px;

  --logo-filter: none;
  --theme-sun: none;
  --theme-moon: block;
}

/* ── Bloodline overrides ────────────────────────────────────────────────── */
[data-system="bloodline"] {
  --accent:     #e11d48;
  --accent2:    #be123c;
  --accent-bg:  rgba(225,29,72,.08);
  --btn:        #e11d48;
}

/* ── Boardroom overrides ────────────────────────────────────────────────── */
[data-system="boardroom"] {
  --accent:     #7c3aed;
  --accent2:    #6d28d9;
  --accent-bg:  rgba(124,58,237,.08);
  --btn:        #7c3aed;
}

/* ── Dark mode ─────────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:     #0b0c10;
  --paper:  #13141c;
  --paper2: rgba(16,17,26,.92);
  --text:   #e4e6ef;
  --muted:  #5c6880;
  --line:   rgba(255,255,255,.07);
  --line2:  rgba(255,255,255,.05);
  --shadow: 0 18px 50px rgba(0,0,0,.4);

  --btn:     var(--accent);
  --btnText: #ffffff;

  --logo-filter: brightness(0) invert(1);
  --theme-sun: block;
  --theme-moon: none;
}

[data-theme="dark"] body::before   { mix-blend-mode: screen; opacity: .04; }
[data-theme="dark"] .topbar-user   { background: rgba(255,255,255,.05); }
[data-theme="dark"] .card          { background: var(--paper); border-color: var(--line); }
[data-theme="dark"] .sidebar       { background: #0d0e14; border-color: var(--line2); }
[data-theme="dark"] .nav-item.active { background: var(--accent); color: #fff; }
[data-theme="dark"] .table th      { background: rgba(255,255,255,.04); }
[data-theme="dark"] .table tr:hover td { background: rgba(255,255,255,.03); }
[data-theme="dark"] .btn-secondary { background: rgba(255,255,255,.07); border-color: var(--line); color: var(--text); }
[data-theme="dark"] .btn-secondary:hover { background: rgba(255,255,255,.12); }
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea        { background: rgba(255,255,255,.06); border-color: var(--line); color: var(--text); }
[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus  { border-color: var(--accent); background: rgba(255,255,255,.08); }

/* ── Theme toggle ───────────────────────────────────────────────────────── */
.theme-toggle-btn {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line2);
  background: var(--paper);
  color: var(--muted);
  cursor: pointer; flex-shrink: 0;
  transition: background .2s, border-color .2s, color .2s;
}
.theme-toggle-btn:hover  { color: var(--text); border-color: var(--accent); }
.theme-toggle-btn svg    { flex-shrink: 0; }

@keyframes kv-spin-slow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
#pf-icon-sun  { animation: kv-spin-slow 8s linear infinite; transform-origin: center; }

html:not([data-theme="dark"]) #pf-icon-sun  { display: none !important; }
html:not([data-theme="dark"]) #pf-icon-moon { display: block !important; }
html[data-theme="dark"] #pf-icon-sun        { display: block !important; }
html[data-theme="dark"] #pf-icon-moon       { display: none !important; }

/* ── Language picker ────────────────────────────────────────────────────── */
.lang-picker {
  position: relative;
}

.lang-picker-btn {
  display: flex; align-items: center; gap: 5px;
  height: 34px; padding: 0 9px;
  border-radius: 8px;
  border: 1px solid var(--line2);
  background: var(--paper);
  color: var(--muted);
  cursor: pointer; flex-shrink: 0;
  font-size: 12px; font-weight: 600; font-family: inherit;
  transition: background .2s, border-color .2s, color .2s;
}
.lang-picker-btn:hover { color: var(--text); border-color: var(--accent); }
.lang-flag-icon { width: 18px; height: 14px; border-radius: 2px; flex-shrink: 0; }
.lang-code      { letter-spacing: .04em; }

.lang-dropdown {
  display: none;
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 140px;
  background: var(--paper);
  border: 1px solid var(--line2);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  overflow: hidden;
  z-index: 200;
}

.lang-picker.open .lang-dropdown { display: block; }
.lang-picker.open .lang-picker-btn { border-color: var(--accent); color: var(--text); }

.lang-option {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 14px;
  background: none; border: none;
  font-size: 13px; font-family: inherit; color: var(--text);
  cursor: pointer; text-align: left;
  transition: background .15s;
}
.lang-option:hover       { background: var(--accent-bg); }
.lang-option--active     { font-weight: 700; color: var(--accent); }

[data-theme="dark"] .lang-dropdown { background: #1e2435; border-color: rgba(255,255,255,.12); }
[data-theme="dark"] .lang-picker-btn { background: rgba(255,255,255,.06); }

/* ── RESET ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

/* Subtle noise grain */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  opacity: .18; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='.38'/%3E%3C/svg%3E");
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 20px; font-weight: 700; line-height: 1.25; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 600; }
p  { margin-top: 6px; }

/* ── APP SHELL ──────────────────────────────────────────────────────────── */
.pf-app     { min-height: 100%; display: flex; flex-direction: column; }
.pf-layout  { display: flex; flex: 1; min-height: 0; }
.pf-content { flex: 1; min-width: 0; padding: 28px 28px 48px; overflow-y: auto; }

/* ── TOPBAR ─────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  padding: 0 22px;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--paper2);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line2);
}

.topbar-left  { display: flex; align-items: center; gap: 14px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.topbar-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 15px; letter-spacing: -.2px;
  color: var(--text); text-decoration: none;
}
.topbar-brand:hover { text-decoration: none; color: var(--accent); }

.topbar-brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 15px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .2s;
}
.topbar-brand-img {
  height: 34px; width: auto; display: block;
  filter: var(--logo-filter);
  transition: filter .2s;
}

.topbar-site-name { font-weight: 600; font-size: 14px; color: var(--muted); }

.burger {
  display: none;
  width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--line2);
  background: var(--paper);
  cursor: pointer; align-items: center; justify-content: center;
  color: var(--text); flex-shrink: 0;
}
.burger:hover { border-color: var(--accent); }

.topbar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px; border-radius: 10px;
  background: var(--bg);
  cursor: default;
}
.avatar-circle {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  letter-spacing: .5px;
  overflow: hidden;
}
.avatar-circle--photo {
  padding: 0;
  font-size: 0;
}
.topbar-user-meta { display: flex; flex-direction: column; line-height: 1.3; }
.topbar-name { font-size: 13px; font-weight: 600; }
.topbar-logout { font-size: 11px; color: var(--muted); }
.topbar-logout:hover { color: var(--bad); text-decoration: none; }

/* Flash data element (hidden, read by JS) */
#pf-flash-data { display: none; }

/* ── SIDEBAR ─────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--paper);
  border-right: 1px solid var(--line2);
  display: flex; flex-direction: column;
  overflow-y: auto;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
}

.sidebar-title {
  font-size: 10px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--muted);
  padding: 20px 18px 8px;
}

.sidebar-nav { flex: 1; padding: 0 10px 10px; display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px;
  font-size: 13.5px; font-weight: 500;
  color: var(--text); text-decoration: none;
  transition: background .15s, color .15s;
  cursor: pointer;
}
.nav-item:hover { background: var(--accent-bg); color: var(--accent); text-decoration: none; }
.nav-item.active {
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 600;
}
.nav-item svg, .nav-item i[data-lucide] { flex-shrink: 0; width: 16px; height: 16px; opacity: .85; }

.nav-divider { height: 1px; background: var(--line2); margin: 8px 4px; }

.nav-group-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--muted);
  padding: 12px 10px 4px;
}

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 39;
  background: rgba(0,0,0,.45);
}

/* Footer inside sidebar */
.sidebar-footer {
  margin-top: auto;
  padding: 16px 18px;
  font-size: 11px; color: var(--muted); line-height: 1.6;
  border-top: 1px solid var(--line2);
}
.sidebar-footer .brand { color: var(--accent); font-weight: 600; }

/* ── CONTENT AREA ────────────────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  margin-bottom: 24px;
}
.page-header h1 { margin: 0; }
.page-subtitle { font-size: 13px; color: var(--muted); margin-top: 3px; }

/* ── CARDS ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--paper);
  border: 1px solid var(--line2);
  border-radius: var(--radius2);
  padding: var(--pad) 20px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }

.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 10px;
}
.card-head h3 { margin: 0; }

/* ── KPI ─────────────────────────────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }

.kpi {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 20px;
}
.kpi i[data-lucide], .kpi svg { width: 28px; height: 28px; color: var(--accent); opacity: .7; flex-shrink: 0; }
.kpi-value { font-size: 28px; font-weight: 800; line-height: 1; color: var(--text); }
.kpi-label { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ── GRID HELPERS ────────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── TABLE ───────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

.table {
  width: 100%; border-collapse: collapse;
  font-size: 13.5px;
}
.table th {
  text-align: left;
  font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  color: var(--muted);
  padding: 9px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--line2);
  white-space: nowrap;
}
.table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line2);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td     { background: var(--accent-bg); }

/* ── FORMS ───────────────────────────────────────────────────────────────── */
.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-row label { font-size: 13px; font-weight: 600; color: var(--text); }
.form-hint { font-size: 12px; color: var(--muted); }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="date"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: var(--paper);
  color: var(--text);
  transition: border-color .15s, background .15s;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  background: var(--paper);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%2352637a' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
textarea { resize: vertical; min-height: 90px; }

.form-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-cols-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── BUTTONS ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: 10px;
  font-size: 14px; font-weight: 600; font-family: inherit;
  background: var(--btn); color: var(--btnText);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: opacity .15s, background .15s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { opacity: .88; text-decoration: none; }
.btn svg, .btn i[data-lucide] { width: 16px; height: 16px; }

.btn-primary  { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent2); border-color: var(--accent2); opacity: 1; }

.btn-secondary { background: var(--paper); color: var(--text); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn-danger:hover { background: #b91c1c; opacity: 1; }

.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; padding-left: 8px; padding-right: 8px; }
.btn-ghost:hover { color: var(--text); background: var(--bg); }

.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-sm svg, .btn-sm i[data-lucide] { width: 13px; height: 13px; }

/* ── BADGES / PILLS ──────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .2px;
  white-space: nowrap;
}
.badge-active   { background: var(--ok-bg);   color: var(--ok);   }
.badge-inactive { background: var(--bg);       color: var(--muted); border: 1px solid var(--line2); }
.badge-warn     { background: var(--warn-bg);  color: var(--warn); }
.badge-danger   { background: var(--bad-bg);   color: var(--bad);  }
.badge-accent   { background: var(--accent-bg); color: var(--accent); }
.badge-trial    { background: rgba(99,102,241,.1); color: #4338ca; }
.badge-premium  { background: rgba(245,158,11,.12); color: #92400e; }

/* Status dot */
.status-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted); flex-shrink: 0;
}
.status-dot.ok     { background: #16a34a; }
.status-dot.bad    { background: #dc2626; }
.status-dot.warn   { background: #d97706; }
.status-dot.accent { background: var(--accent); }

/* ── NOTICES / ALERTS ────────────────────────────────────────────────────── */
.notice {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 16px; border-radius: 12px;
  font-size: 13.5px; line-height: 1.5;
  margin-bottom: 16px;
}
.notice svg, .notice i[data-lucide] { flex-shrink: 0; width: 16px; height: 16px; margin-top: 1px; }

.notice.info    { background: var(--accent-bg); color: var(--accent); }
.notice.success { background: var(--ok-bg);     color: var(--ok); }
.notice.warning { background: var(--warn-bg);   color: var(--warn); }
.notice.danger  { background: var(--bad-bg);    color: var(--bad); }

/* ── TOAST ───────────────────────────────────────────────────────────────── */
#pf-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 999;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.pf-toast-item {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px; border-radius: 12px;
  font-size: 14px; font-weight: 500;
  background: var(--paper); border: 1px solid var(--line2);
  box-shadow: 0 8px 30px rgba(0,0,0,.14);
  pointer-events: auto;
  animation: pf-toast-in .22s ease;
  max-width: 360px;
}
.pf-toast-item.success { border-left: 4px solid #16a34a; }
.pf-toast-item.error   { border-left: 4px solid #dc2626; }
.pf-toast-item.info    { border-left: 4px solid var(--accent); }
.pf-toast-item.warning { border-left: 4px solid #d97706; }
@keyframes pf-toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ── SECTION TITLE ───────────────────────────────────────────────────────── */
.section-title {
  font-size: 11px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase; color: var(--muted);
  margin-bottom: 10px;
}

/* ── EMPTY STATE ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 48px 24px; color: var(--muted);
}
.empty-state i[data-lucide], .empty-state svg {
  width: 40px; height: 40px; opacity: .35; margin-bottom: 14px;
}
.empty-state p { font-size: 14px; margin-top: 6px; }

/* ── PROFILE / AVATAR ────────────────────────────────────────────────────── */
.avatar-lg {
  width: 60px; height: 60px; border-radius: 50%;
  font-size: 20px; font-weight: 800; letter-spacing: .5px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: #fff; background: var(--accent);
}

/* ── FILTER ROW ──────────────────────────────────────────────────────────── */
.filter-row {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; margin-bottom: 18px;
}
.filter-row input[type="search"],
.filter-row input[type="text"] { max-width: 260px; }
.filter-row select             { max-width: 180px; }

/* ── LOGIN PAGE ──────────────────────────────────────────────────────────── */
.login-page { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 20px; }
.login-page::before { content: none; }

.login-wrap { width: 100%; max-width: 400px; }

.login-brand {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-bottom: 28px;
}
.login-brand-mark {
  width: 46px; height: 46px; border-radius: 13px;
  background: var(--accent); color: #fff;
  font-size: 22px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.login-brand-text { font-size: 22px; font-weight: 800; letter-spacing: -.3px; }

.login-card { padding: 32px; }
.login-card h1 { font-size: 22px; margin-bottom: 4px; }

.login-actions { margin-top: 6px; }
.login-actions .btn { width: 100%; justify-content: center; padding: 11px 18px; font-size: 15px; }

.login-err {
  margin-top: 14px; padding: 11px 14px; border-radius: 10px;
  background: var(--bad-bg); color: var(--bad);
  font-size: 13.5px;
}

.login-links {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px; font-size: 12.5px;
}
.login-links a { color: var(--muted); }
.login-links a:hover { color: var(--accent); }

.login-note { text-align: center; font-size: 12px; color: var(--muted); margin-top: 18px; line-height: 1.6; }

/* ── HELPERS ─────────────────────────────────────────────────────────────── */
.muted  { color: var(--muted); }
.ok     { color: var(--ok); }
.bad    { color: var(--bad); }
.warn   { color: var(--warn); }
.accent { color: var(--accent); }

.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-0  { margin-bottom: 0; }
.mb-4  { margin-bottom: 4px; }

.flex   { display: flex; }
.gap-6  { gap: 6px; }
.gap-8  { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fs-12  { font-size: 12px; }
.fs-13  { font-size: 13px; }

/* ── RESPONSIVE ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .form-cols { grid-template-columns: 1fr; }
  .form-cols-3 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .burger { display: flex; }

  .sidebar {
    position: fixed;
    top: 0; left: 0; z-index: 40;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,.18);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }

  .pf-content { padding: 18px 16px 40px; }
  .topbar { padding: 0 14px; }

  .table th, .table td { padding: 8px 10px; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .login-card { padding: 24px 20px; }
}
