/* ============================================================
   GlassM8 — Design System v2
   Aesthetic: Crystal Blue — sky brand energy
   Font: DM Sans (clean, professional, modern)
   Brand palette: Amber #f59e0b accent, Navy sidebar, Blue CTAs
   ============================================================ */


/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Shape & Motion */
  --radius: 8px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-pill: 999px;
  --ease: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;

  /* Type scale */
  --fs-xs: 0.72rem;
  --fs-sm: 0.8rem;
  --fs-base: 0.875rem;
  --fs-md: 0.95rem;
  --fs-lg: 1.1rem;
  --fs-xl: 1.35rem;
  --fs-2xl: 1.75rem;
  --fs-3xl: 2.25rem;

  /* Surface colors — Crystal Clear daylight */
  --bg: #f6f9fb;
  --bg1: #eef3f8;
  --sky: #e7f4f6;
  --surface: #ffffff;
  --t: #0c1a24;
  --t2: #2b3b44;
  --tm: #566873;
  --td: #8a98a0;
  --bd: #e3eaf0;
  --bd-strong: #cbd6df;
  --border: #e3eaf0;

  /* Accent — Crystal Clear teal (brand-injection target, keep --amber* names) */
  --amber: #0ea5a4;
  --amber-hover: #0c8f8e;
  --amber-light: #d8f3f1;
  --amber-subtle: #ecfbfa;
  --accent: var(--amber);
  --accent-hover: var(--amber-hover);
  --accent-bright: #22d3c5;

  /* Primary action — teal-harmonised */
  --primary: #0e7c86;
  --primary-hover: #0a6670;
  --primary-light: #e6f6f7;

  /* Status palette */
  --green: #16a34a;
  --green-light: #f0fdf4;
  --red: #dc2626;
  --red-light: #fef2f2;
  --purple: #7c3aed;
  --purple-light: #f5f3ff;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --info: #0ea5e9;
  --info-light: #f0f9ff;

  /* Backward-compat aliases */
  --ok: #16a34a;
  --ok-light: #f0fdf4;
  --rd: #dc2626;
  --rd-light: #fef2f2;
  --ac: #7c3aed;
  --ac-light: #f5f3ff;

  /* Shadow system — cooler, airier daylight tint */
  --shadow-xs: 0 1px 2px rgba(12,26,36,0.04);
  --shadow-sm: 0 1px 3px rgba(12,26,36,0.05), 0 1px 2px rgba(12,26,36,0.03);
  --shadow: 0 2px 8px rgba(12,26,36,0.06), 0 1px 2px rgba(12,26,36,0.04);
  --shadow-md: 0 4px 16px rgba(12,26,36,0.08), 0 2px 6px rgba(12,26,36,0.04);
  --shadow-lg: 0 12px 32px rgba(12,26,36,0.10), 0 4px 10px rgba(12,26,36,0.05);
  --shadow-xl: 0 24px 52px rgba(12,26,36,0.13), 0 8px 18px rgba(12,26,36,0.07);

  /* Sidebar — light daylight shell */
  --sidebar-bg: #ffffff;
  --sidebar-border: #e3eaf0;
  --sidebar-text: #566873;
  --sidebar-text-strong: #0c1a24;
  --sidebar-hover: #f1f5f8;
  --sidebar-active-bg: var(--amber-subtle);
  --sidebar-active-border: var(--amber);
  --sidebar-w: 250px;
  --topbar-h: 62px;
}

[data-theme="dark"] {
  --bg: #080d18;
  --bg1: #0f1829;
  --sky: #0c2226;
  --surface: #162032;
  --t: #f1f5f9;
  --t2: #cbd5e1;
  --tm: #94a3b8;
  --td: #64748b;
  --bd: #1e2d42;
  --bd-strong: #2b3d55;
  --border: #1e2d42;

  --amber-light: #0a2020;
  --amber-subtle: #071615;
  --primary-light: #072122;
  --green-light: #041f0e;
  --red-light: #1f0909;
  --purple-light: #150d2a;
  --warning-light: #1c1500;
  --info-light: #071825;
  --ok-light: #041f0e;
  --rd-light: #1f0909;
  --ac-light: #150d2a;

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow: 0 2px 8px rgba(0,0,0,0.35), 0 1px 3px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4), 0 2px 6px rgba(0,0,0,0.25);
  --shadow-lg: 0 12px 36px rgba(0,0,0,0.5), 0 4px 10px rgba(0,0,0,0.3);
  --shadow-xl: 0 24px 56px rgba(0,0,0,0.6), 0 8px 18px rgba(0,0,0,0.35);

  /* Sidebar stays dark in dark mode */
  --sidebar-bg: #0b1220;
  --sidebar-border: #17233a;
  --sidebar-text: #94a3b8;
  --sidebar-text-strong: #f1f5f9;
  --sidebar-hover: rgba(255,255,255,0.05);
  --sidebar-active-bg: var(--amber-subtle); /* overridden per-user if brand set */
  --sidebar-active-border: var(--amber);
}

/* ============================================================
   BASE RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-family: var(--font);
  font-size: 14.5px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  background-image: linear-gradient(180deg, rgba(14,165,164,0.035) 0%, transparent 220px);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--t);
  font-family: var(--font);
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; }

h1,h2,h3,h4,h5,h6 {
  font-family: var(--font);
  font-weight: 700;
  color: var(--t);
  line-height: 1.3;
  margin: 0 0 8px;
}

.text-muted { color: var(--tm) !important; }
.text-danger { color: var(--red) !important; }
.text-success { color: var(--green) !important; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0 10px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--bd-strong) transparent;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 8px 18px;
  border-bottom: 1px solid var(--sidebar-border);
  margin-bottom: 12px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-bright), var(--amber));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(14,165,164,0.35);
}

.brand-name {
  font-weight: 800;
  color: var(--sidebar-text-strong);
  font-size: 1rem;
  display: block;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.brand-sub {
  font-size: 0.65rem;
  color: var(--tm);
  display: block;
  font-weight: 400;
  margin-top: 1px;
}

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

.sidebar-section-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--td);
  padding: 14px 10px 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8.5px 10px;
  border-radius: 8px;
  color: var(--sidebar-text);
  font-size: 0.86rem;
  font-weight: 500;
  transition: all var(--ease);
  text-decoration: none;
  position: relative;
  border-left: 2px solid transparent;
}

.sidebar-link i {
  font-size: 1rem;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-strong);
}

.sidebar-link.active {
  background: var(--sidebar-active-bg);
  color: var(--amber-hover);
  font-weight: 600;
  border-left-color: var(--sidebar-active-border);
}

.sidebar-link.active i { color: var(--amber); }

.sidebar-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--sidebar-border);
  padding-bottom: 14px;
}

.sidebar-footer-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0 8px 10px;
  font-size: 0.65rem;
}

.sidebar-footer-links a {
  color: var(--td);
  text-decoration: none;
  transition: color var(--ease);
}

.sidebar-footer-links a:hover { color: var(--amber-hover); }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 8px;
  border-radius: 8px;
  margin-bottom: 4px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-bright), var(--amber));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

.user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.user-name {
  color: var(--sidebar-text-strong);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.user-role {
  color: var(--tm);
  font-size: 0.67rem;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-logout {
  color: var(--tm) !important;
  font-size: 0.82rem !important;
}

.sidebar-logout:hover {
  color: var(--red) !important;
  background: var(--red-light) !important;
  border-left-color: var(--red) !important;
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--bd);
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-xs);
}

.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }

.topbar-titles { display: flex; flex-direction: column; gap: 1px; min-width: 0; }

.topbar-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--t);
  white-space: nowrap;
  letter-spacing: -0.2px;
}

/* Breadcrumbs */
.crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  color: var(--tm);
  white-space: nowrap;
  overflow: hidden;
}
.crumbs a { color: var(--tm); text-decoration: none; transition: color var(--ease); }
.crumbs a:hover { color: var(--amber-hover); }
.crumbs .sep { color: var(--td); font-size: 0.7em; }
.crumbs .current { color: var(--t2); font-weight: 600; text-overflow: ellipsis; overflow: hidden; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--bd);
  background: transparent;
  color: var(--tm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--ease);
  position: relative;
  font-size: 0.95rem;
}

.topbar-btn:hover {
  background: var(--bg);
  color: var(--t);
  border-color: var(--amber);
}

.notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  border: 1.5px solid var(--surface);
}

/* ============================================================
   SEARCH
   ============================================================ */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg1);
  border: 1.5px solid transparent;
  border-radius: var(--radius-pill);
  padding: 0 14px;
  height: 36px;
  min-width: 220px;
  transition: background var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.search-box:hover {
  background: var(--bg);
  border-color: var(--bd);
}

.search-box:focus-within {
  background: var(--surface);
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(14,165,164,0.13);
}

.search-box i {
  color: var(--tm);
  font-size: 0.82rem;
  margin-right: 8px;
  flex-shrink: 0;
  transition: color var(--ease);
}

.search-box:focus-within i {
  color: var(--amber);
}

.search-box input {
  border: none !important;
  background: transparent !important;
  outline: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  font-family: var(--font);
  font-size: 0.84rem;
  color: var(--t);
  width: 100%;
  padding: 0;
}

.search-box input::placeholder { color: var(--td); }

.search-results {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--bd);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  max-height: 340px;
  overflow-y: auto;
  z-index: 300;
}

.search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  text-decoration: none;
  transition: background var(--ease);
  border-bottom: 1px solid var(--bd);
}

.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--bg); }

.search-item-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 0.82rem;
  flex-shrink: 0;
}

.search-item-body { flex: 1; min-width: 0; }
.search-item-title { font-weight: 600; font-size: 0.85rem; color: var(--t); display: block; line-height: 1.4; }
.search-item-sub { font-size: 0.73rem; color: var(--tm); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-empty { padding: 20px; text-align: center; color: var(--tm); font-size: 0.84rem; }

.search-inline { min-width: 180px; }
.search-inline form { display: contents; }
.search-inline input {
  border: none; background: none; outline: none;
  font-family: var(--font); font-size: 0.84rem; color: var(--t); width: 100%;
}

/* ============================================================
   NOTIFICATION DRAWER
   ============================================================ */
.notif-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 340px;
  background: var(--surface);
  border-left: 1px solid var(--bd);
  box-shadow: var(--shadow-xl);
  z-index: 500;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.notif-drawer.open { transform: translateX(0); }

.notif-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--bd);
  font-weight: 700;
  font-size: 0.95rem;
}

.notif-drawer-header button {
  background: none;
  border: none;
  color: var(--tm);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  border-radius: 6px;
  transition: color var(--ease), background var(--ease);
}

.notif-drawer-header button:hover {
  color: var(--t);
  background: var(--bg);
}

.notif-drawer-body { flex: 1; overflow-y: auto; padding: 8px 0; }

.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--bd);
  transition: background var(--ease);
  cursor: default;
}

.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: var(--primary-light); }

.notif-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--amber);
  flex-shrink: 0;
}

.notif-item-body { flex: 1; min-width: 0; }
.notif-item-text { font-size: 0.83rem; color: var(--t); line-height: 1.5; display: block; }
.notif-item-time { font-size: 0.7rem; color: var(--td); margin-top: 3px; display: block; }

.notif-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--tm);
  font-size: 0.84rem;
}

.notif-empty i {
  font-size: 2.2rem;
  color: var(--td);
  display: block;
  margin-bottom: 10px;
}

.notif-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 499;
  backdrop-filter: blur(2px);
}

.notif-drawer-overlay.open { display: block; }

/* ============================================================
   PAGE CONTENT
   ============================================================ */
.page-content {
  padding: 24px 28px 100px;
  flex: 1;
  background: linear-gradient(180deg, rgba(14,165,164,0.025) 0%, transparent 140px);
}

/* ============================================================
   MOBILE NAV
   ============================================================ */
/* ── Mobile Bottom Nav ─────────────────────────────────── */
.mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--bd);
  display: flex;
  z-index: 100;
  padding: 4px 8px max(10px, env(safe-area-inset-bottom));
  box-shadow: 0 -1px 0 var(--bd), 0 -8px 32px rgba(15,23,42,0.09);
}

.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 2px 2px;
  color: var(--td);
  font-size: 0.56rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.15s;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.mobile-nav-item .mnav-icon {
  width: 46px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-size: 1.25rem;
  transition: background 0.2s, transform 0.15s;
}

.mobile-nav-item.active { color: var(--amber); }
.mobile-nav-item.active .mnav-icon {
  background: var(--amber-light);
  transform: translateY(-1px);
}
.mobile-nav-item:active .mnav-icon { transform: scale(0.92); }

/* ── Mobile More Sheet ─────────────────────────────────── */
.mobile-more-menu {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  align-items: flex-end;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.mobile-more-menu.show { display: flex; }

.mobile-more-inner {
  background: var(--surface);
  width: 100%;
  border-radius: 24px 24px 0 0;
  padding: 0 0 max(24px, env(safe-area-inset-bottom));
  animation: slideUp 0.24s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 88vh;
  overflow-y: auto;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.mobile-more-handle {
  width: 36px;
  height: 4px;
  background: var(--bd);
  border-radius: 99px;
  margin: 12px auto 4px;
}

.mobile-more-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px 14px;
  font-weight: 800;
  font-size: 1rem;
  color: var(--t);
}

.mobile-more-header button {
  background: var(--bg);
  border: 1px solid var(--bd);
  color: var(--tm);
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 10px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.mobile-more-header button:hover { background: var(--bg1); }

/* Grid layout for nav items */
.mobile-more-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0 16px 16px;
}

.mobile-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px 10px;
  border-radius: 16px;
  background: var(--bg);
  border: 1px solid var(--bd);
  color: var(--t2);
  text-decoration: none;
  font-size: 0.65rem;
  font-weight: 700;
  text-align: center;
  transition: background 0.15s, transform 0.12s, border-color 0.15s;
  letter-spacing: 0.2px;
  -webkit-tap-highlight-color: transparent;
}

.mobile-grid-item:active { transform: scale(0.94); background: var(--bd); }

.mobile-grid-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--bd);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: var(--amber);
  transition: background 0.15s;
}

.mobile-grid-item:active .mobile-grid-icon { background: var(--amber-light); }

/* Admin section in more menu */
.mobile-more-section {
  padding: 4px 16px 8px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--td);
}

.mobile-more-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  color: var(--t);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.mobile-more-link:active { background: var(--bg); }
.mobile-more-link i { font-size: 1.1rem; color: var(--amber); width: 24px; text-align: center; }
.mobile-more-logout { color: var(--red) !important; border-top: 1px solid var(--bd); margin-top: 4px; }
.mobile-more-logout i { color: var(--red) !important; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid rgba(226,232,240,0.9);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(15,23,42,0.05), 0 1px 3px rgba(15,23,42,0.03);
  transition: box-shadow var(--ease), transform var(--ease);
}

.card:hover {
  box-shadow: 0 8px 28px rgba(15,23,42,0.09), 0 2px 6px rgba(15,23,42,0.04);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--t2);
  border-bottom: 1px solid var(--bd);
  background: linear-gradient(to right, #f8fafc, rgba(248,250,252,0.4));
}

.card-header i { color: var(--tm); }
.card-body { padding: 16px 18px; }

/* ============================================================
   KPI CARDS
   ============================================================ */
.dash-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid rgba(226,232,240,0.9);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 2px 12px rgba(15,23,42,0.06), 0 1px 3px rgba(15,23,42,0.03);
  transition: transform var(--ease), box-shadow var(--ease);
  position: relative;
  overflow: hidden;
}

.kpi-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  opacity: 0;
  transition: opacity var(--ease);
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(15,23,42,0.11), 0 3px 8px rgba(15,23,42,0.06);
}

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.kpi-green { background: linear-gradient(135deg, #d1fae5, #a7f3d0); color: var(--green); }
.kpi-amber { background: linear-gradient(135deg, var(--amber-subtle), var(--amber-light)); color: var(--amber-hover); }
.kpi-blue  { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: var(--primary); }
.kpi-purple{ background: linear-gradient(135deg, #ede9fe, #ddd6fe); color: var(--purple); }
.kpi-red   { background: linear-gradient(135deg, #fee2e2, #fecaca); color: var(--red); }

.kpi-body { display: flex; flex-direction: column; min-width: 0; }

.kpi-value {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--t);
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.kpi-label {
  font-size: 0.73rem;
  color: var(--tm);
  font-weight: 500;
  margin-top: 3px;
  letter-spacing: 0.1px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.bt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  font-family: var(--font);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--ease);
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
  letter-spacing: 0.1px;
}

.bt:hover { text-decoration: none; }

/* Primary — Crystal Clear teal, the trustworthy CTA */
.bt-p {
  background: linear-gradient(135deg, var(--accent-bright), var(--amber));
  color: #fff;
  border-color: var(--amber);
}
.bt-p:hover {
  background: linear-gradient(135deg, var(--amber), var(--amber-hover));
  border-color: var(--amber-hover);
  color: #fff;
  box-shadow: 0 4px 14px rgba(14,165,164,0.32);
}

/* Secondary */
.bt-s {
  background: var(--surface);
  color: var(--t2);
  border-color: var(--bd);
}
.bt-s:hover {
  background: var(--bg);
  border-color: #c7d2e0;
  color: var(--t);
}

/* Ghost */
.bt-g {
  background: transparent;
  color: var(--tm);
  border-color: var(--bd);
}
.bt-g:hover {
  background: var(--bg1);
  color: var(--t);
  border-color: var(--bd);
}

/* Outline — accent-bordered secondary action */
.bt-o {
  background: transparent;
  color: var(--amber);
  border-color: var(--amber);
}
.bt-o:hover {
  background: var(--amber-light);
  color: var(--amber-hover);
  border-color: var(--amber-hover);
}

/* Danger */
.bt-d {
  background: var(--red-light);
  color: var(--red);
  border-color: #fecaca;
}
.bt-d:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

/* Success/OK */
.bt-ok {
  background: var(--green-light);
  color: var(--green);
  border-color: #bbf7d0;
}
.bt-ok:hover {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

/* Amber (accent alias) */
.bt-amber, .bt-accent {
  background: linear-gradient(135deg, var(--accent-bright), var(--amber));
  color: #fff;
  border-color: var(--amber);
}
.bt-amber:hover, .bt-accent:hover {
  background: linear-gradient(135deg, var(--amber), var(--amber-hover));
  border-color: var(--amber-hover);
  color: #fff;
  box-shadow: 0 4px 14px rgba(14,165,164,0.32);
}

.bt-lg { padding: 11px 22px; font-size: 0.95rem; }
.bt-sm { padding: 5px 12px; font-size: 0.78rem; }
.bt-xs { padding: 3px 9px; font-size: 0.72rem; border-radius: var(--radius-sm); }
.bt:disabled { opacity: 0.5; cursor: not-allowed; }

/* Keyboard focus — visible ring on interactive elements */
.bt:focus-visible, .filter-pill:focus-visible, .sidebar-link:focus-visible,
.mobile-nav-item:focus-visible, .topbar-btn:focus-visible, a:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ============================================================
   BADGES
   ============================================================ */
.bd {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.2px;
  background: var(--bg1);
  color: var(--tm);
  border: 1px solid var(--bd);
  white-space: nowrap;
}

/* Badge variants — light mode */
.bd-active   { background: #e0f2fe; color: #0369a1; border-color: #7dd3fc; }
.bd-pending  { background: #fef3c7; color: #92400e; border-color: #f59e0b; }
.bd-in-progress { background: #eff6ff; color: #1d4ed8; border-color: #93c5fd; }
.bd-completed, .bd-paid, .bd-accepted { background: #f0fdf4; color: #15803d; border-color: #86efac; }
.bd-overdue  { background: #fef2f2; color: #b91c1c; border-color: #fca5a5; }
.bd-declined { background: #fef2f2; color: #b91c1c; border-color: #fca5a5; }
.bd-sent     { background: #f5f3ff; color: #6d28d9; border-color: #c4b5fd; }
.bd-scheduled{ background: #f5f3ff; color: #6d28d9; border-color: #c4b5fd; }
.bd-paused   { background: #fef3c7; color: #92400e; border-color: #f59e0b; }
.bd-warning  { background: #fef3c7; color: #92400e; border-color: #f59e0b; }
.bd-info     { background: #f0f9ff; color: #0369a1; border-color: #7dd3fc; }
.bd-cancelled{ background: var(--bg1); color: var(--tm); border-color: var(--bd); }

/* Badge variants — dark mode */
[data-theme="dark"] .bd-active    { background: rgba(14,165,164,0.18); color: #38bdf8; border-color: rgba(14,165,164,0.35); }
[data-theme="dark"] .bd-pending   { background: rgba(245,158,11,0.15); color: #fbbf24; border-color: rgba(245,158,11,0.35); }
[data-theme="dark"] .bd-in-progress { background: rgba(37,99,235,0.18); color: #60a5fa; border-color: rgba(37,99,235,0.35); }
[data-theme="dark"] .bd-completed,
[data-theme="dark"] .bd-paid,
[data-theme="dark"] .bd-accepted  { background: rgba(22,163,74,0.18); color: #4ade80; border-color: rgba(22,163,74,0.35); }
[data-theme="dark"] .bd-overdue,
[data-theme="dark"] .bd-declined  { background: rgba(220,38,38,0.18); color: #f87171; border-color: rgba(220,38,38,0.35); }
[data-theme="dark"] .bd-sent,
[data-theme="dark"] .bd-scheduled { background: rgba(124,58,237,0.18); color: #a78bfa; border-color: rgba(124,58,237,0.35); }
[data-theme="dark"] .bd-paused,
[data-theme="dark"] .bd-warning   { background: rgba(245,158,11,0.15); color: #fbbf24; border-color: rgba(245,158,11,0.35); }
[data-theme="dark"] .bd-info      { background: rgba(14,165,164,0.18); color: #38bdf8; border-color: rgba(14,165,164,0.35); }
[data-theme="dark"] .bd-cancelled { background: rgba(255,255,255,0.05); color: var(--tm); border-color: var(--bd); }

/* ============================================================
   FORMS
   ============================================================ */
.fg { margin-bottom: 14px; }

.fl {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--tm);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.fi, .fs {
  width: 100%;
  padding: 9px 13px;
  border-radius: 8px;
  border: 1.5px solid var(--bd);
  font-size: 0.88rem;
  font-family: var(--font);
  background: var(--surface);
  color: var(--t);
  transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
  line-height: 1.5;
}

.fi:hover, .fs:hover {
  border-color: #b8cce0;
}

.fi:focus, .fs:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(14,165,164,0.12);
  background: var(--surface);
}

.fi::placeholder { color: var(--td); }

textarea.fi {
  min-height: 80px;
  resize: vertical;
  line-height: 1.6;
}

.fr { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Select arrow — suppress native and Bootstrap arrows, apply custom one */
.fs, select.fi, select.fi.form-select {
  appearance: none !important;
  -webkit-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  padding-right: 34px;
}

[data-theme="dark"] .fs, [data-theme="dark"] select.fi, [data-theme="dark"] select.fi.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
}

/* Phone input */
.phone-wrap { display: flex; }

.phone-wrap .phone-code {
  width: 88px;
  flex-shrink: 0;
  border-radius: 8px 0 0 8px;
  border-right: none;
  padding: 9px 8px;
  font-size: 0.84rem;
  background: var(--surface);
  color: var(--t);
  border: 1.5px solid var(--bd);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%2364748b'%3E%3Cpath d='M5 7L1 3h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  padding-right: 18px;
}

.phone-wrap .fi { border-radius: 0 8px 8px 0; flex: 1; min-width: 0; }

/* Checkbox */
input[type="checkbox"] {
  accent-color: var(--primary);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* ============================================================
   MODALS — TWO SYSTEMS (both in use across templates)
   ============================================================ */

/* System 1: .mo / .ml (used in customers, invoices, etc.) */
.mo {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,14,26,0.55);
  z-index: 1050;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(6px);
}

.mo.show { display: flex; }

.ml {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.2s cubic-bezier(0.34, 1.2, 0.64, 1);
  border: 1px solid var(--bd);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.ml-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--bd);
  flex-shrink: 0;
}

.ml-hd h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.ml > form { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }

.ml-bd {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}
.ml-bd::-webkit-scrollbar { width: 6px; }
.ml-bd::-webkit-scrollbar-track { background: transparent; }
.ml-bd::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
.ml-bd::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

.ml-ft {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--bd);
  background: var(--bg1);
  flex-shrink: 0;
}

/* System 2: .modal-overlay / .modal-card (used in jobs, etc.) */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,14,26,0.55);
  z-index: 1050;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(6px);
}

.modal-overlay.show { display: flex; }

.modal-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.2s cubic-bezier(0.34, 1.2, 0.64, 1);
  border: 1px solid var(--bd);
}

.modal-lg { max-width: 680px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--bd);
  font-weight: 700;
  font-size: 1rem;
}

.modal-header button {
  background: none;
  border: none;
  color: var(--tm);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--ease), color var(--ease);
}

.modal-header button:hover { background: var(--bg); color: var(--t); }

.modal-body { padding: 20px 22px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--bd);
  background: var(--bg1);
}

/* ============================================================
   TABLES
   ============================================================ */
.table-responsive { overflow-x: auto; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  padding: 10px 16px;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--tm);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: var(--bg1);
  border-bottom: 1px solid var(--bd);
  white-space: nowrap;
}

.table td {
  padding: 11px 16px;
  text-align: left;
  font-size: 0.84rem;
  border-bottom: 1px solid var(--bd);
  color: var(--t);
  vertical-align: middle;
}

.table tbody tr {
  transition: background var(--ease);
}

.table tbody tr:hover td {
  background: var(--bg1);
}

.table tbody tr:last-child td { border-bottom: none; }

.table-actions { display: flex; gap: 4px; align-items: center; flex-wrap: nowrap; }

/* Table inside card (no border wrapper needed) */
.card .table th:first-child { padding-left: 20px; }
.card .table td:first-child { padding-left: 20px; }
.card .table th:last-child  { padding-right: 20px; }
.card .table td:last-child  { padding-right: 20px; }

/* .tw wrapper table (alternate) */
.tw { overflow-x: auto; border-radius: 8px; border: 1px solid var(--bd); }
.tw table { width: 100%; border-collapse: collapse; }
.tw th, .tw td { padding: 10px 14px; text-align: left; }
.tw th { background: var(--bg1); font-weight: 700; color: var(--tm); text-transform: uppercase; letter-spacing: 0.5px; font-size: 0.68rem; border-bottom: 1px solid var(--bd); }
.tw td { border-top: 1px solid var(--bd); font-size: 0.84rem; }
.tw tr:hover td { background: var(--bg1); }

/* ============================================================
   PAGE TOOLBAR & FILTERS
   ============================================================ */
.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.toolbar-left  { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Filter pills (segment control style) */
.filter-pills {
  display: flex;
  gap: 2px;
  background: var(--bg1);
  padding: 3px;
  border-radius: 9px;
  border: 1px solid var(--bd);
}

.filter-pill {
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--tm);
  transition: all var(--ease);
  text-decoration: none;
  white-space: nowrap;
}

.filter-pill:hover { background: var(--surface); color: var(--t); }

.filter-pill.active {
  background: var(--surface);
  color: var(--t);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

/* Filter bar (used in jobs.html) */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg1);
  padding: 3px;
  border-radius: 9px;
  border: 1px solid var(--bd);
}

.filter-tab {
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--tm);
  text-decoration: none;
  transition: all var(--ease);
  white-space: nowrap;
}

.filter-tab:hover { background: var(--surface); color: var(--t); }

.filter-tab.active {
  background: var(--surface);
  color: var(--t);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

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

/* ============================================================
   SHARED PAGE COMPONENTS
   filterbar / datenav / switch / meta-chips / stat-strip
   ============================================================ */

/* Filterbar — card grouping a page's filter & navigation controls */
.filterbar {
  background: var(--surface);
  border: 1px solid var(--bd);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: 10px 12px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.filterbar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.filterbar-row + .filterbar-row { border-top: 1px solid var(--bd); padding-top: 10px; }
.filterbar .fi, .filterbar .fs { width: auto; }

/* Date navigator — ‹ date › + Today in one unified control */
.datenav {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg1);
  border: 1px solid var(--bd);
  border-radius: 10px;
  padding: 3px;
  flex: 1;
  min-width: 260px;
  max-width: 430px;
}
.datenav .dnav-btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; color: var(--tm); text-decoration: none;
  transition: all var(--ease); flex-shrink: 0; font-size: 0.8rem;
}
.datenav .dnav-btn:hover { background: var(--surface); color: var(--amber); }
.datenav .dnav-btn.dnav-disabled { opacity: 0.3; pointer-events: none; }
.dnav-form { flex: 1; display: flex; margin: 0; }
.dnav-form input {
  width: 100%; border: none; background: transparent; text-align: center;
  font-family: var(--font); font-size: 0.84rem; font-weight: 600;
  color: var(--t); padding: 6px 4px; border-radius: 8px; cursor: pointer;
  color-scheme: light;
}
.dnav-form input:hover { background: var(--surface); }
.dnav-form input:focus { outline: 2px solid var(--amber-light); background: var(--surface); }
.dnav-today {
  flex-shrink: 0; padding: 5px 12px; border-radius: 8px;
  background: var(--amber-light); color: var(--amber);
  font-size: 0.74rem; font-weight: 700; text-decoration: none;
  transition: all var(--ease); margin-left: 2px;
}
.dnav-today:hover { background: var(--amber); color: #fff; }

/* Switch — toggle for boolean filters/settings */
.switch {
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; user-select: none; padding: 4px 2px; position: relative;
}
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
  width: 34px; height: 20px; border-radius: 20px;
  background: var(--bd); position: relative; transition: background 0.2s; flex-shrink: 0;
}
.switch-thumb {
  position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25); transition: transform 0.2s;
}
.switch input:checked + .switch-track { background: var(--green); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(14px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--amber); outline-offset: 2px; }
.switch-label { font-size: 0.78rem; font-weight: 600; color: var(--tm); }

/* Meta chips — small labelled facts under a page/detail heading */
.meta-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.meta-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; background: var(--bg1); border: 1px solid var(--bd);
  border-radius: 20px; font-size: 0.72rem; font-weight: 600; color: var(--tm);
}
.meta-chip i { font-size: 0.7rem; }

/* Stat strip — inline key figures inside a card body */
.stat-strip { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.stat-cell {
  flex: 1; min-width: 110px;
  background: var(--bg1); border: 1px solid var(--bd);
  border-radius: var(--radius); padding: 10px 14px;
}
.stat-cell-l {
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--tm); font-weight: 700;
}
.stat-cell-v { font-size: 1.05rem; font-weight: 800; color: var(--t); margin-top: 2px; }
.stat-strip-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; flex-wrap: wrap; }

@media (max-width: 768px) {
  .datenav { flex: 1 1 100%; min-width: 0; max-width: none; }
  .dnav-form input { font-size: 16px; }
  .filterbar .fi, .filterbar .fs { font-size: 16px; }
  .stat-strip-actions { margin-left: 0; width: 100%; }
  /* The topbar search hides on mobile, but filterbar search must stay */
  .filterbar .search-box { display: flex; width: 100%; }
}

/* Team chips inside a filterbar sit flush and scroll sideways on mobile */
.filterbar .team-chips { margin-bottom: 0; }
@media (max-width: 768px) {
  .filterbar .team-chips {
    flex-wrap: nowrap; overflow-x: auto;
    -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 4px;
  }
  .filterbar .team-chips::-webkit-scrollbar { display: none; }
  .filterbar .team-chips .team-chip { flex-shrink: 0; }
}

/* View toggle */
.view-toggle {
  display: flex;
  border: 1px solid var(--bd);
  border-radius: 8px;
  overflow: hidden;
}

.view-btn {
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--tm);
  background: var(--bg1);
  text-decoration: none;
  transition: all var(--ease);
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
  cursor: pointer;
  font-family: var(--font);
}

.view-btn:hover { background: var(--surface); color: var(--t); }
.view-btn.active { background: var(--primary); color: #fff; }

/* ============================================================
   GRIDS
   ============================================================ */
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.dash-grid { display: flex; flex-direction: column; gap: 16px; }
.dash-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* ============================================================
   QUICK ACTIONS
   ============================================================ */
.quick-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }

.quick-action {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--surface), var(--bg1));
  border: 1.5px solid var(--bd);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--t2);
  text-decoration: none;
  transition: all var(--ease);
  cursor: pointer;
  font-family: var(--font);
  box-shadow: var(--shadow-xs);
}

.quick-action i { color: var(--amber); font-size: 1rem; }

.quick-action:hover {
  border-color: rgba(14,165,164,0.5);
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  color: var(--t);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(14,165,164,0.15), var(--shadow-sm);
}

/* ============================================================
   DASHBOARD SPECIFICS
   ============================================================ */
.job-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--bd);
  font-size: 0.84rem;
}

.job-row:last-child { border-bottom: none; }

.job-time {
  font-weight: 700;
  color: var(--amber-hover);
  min-width: 50px;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.team-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }

.job-info { flex: 1; min-width: 0; }

.job-name {
  font-weight: 600;
  color: var(--t);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-detail {
  font-size: 0.73rem;
  color: var(--tm);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-price { font-weight: 700; color: var(--green); white-space: nowrap; font-size: 0.88rem; }

/* Week ahead rows */
.week-day-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--bd);
}

.week-day-row:last-child { border-bottom: none; }

.week-day-today {
  background: linear-gradient(90deg, var(--amber-subtle), transparent);
  margin: 0 -18px;
  padding: 10px 18px;
  border-radius: 6px;
  border-bottom-color: transparent !important;
}

.week-day-info { display: flex; flex-direction: column; }
.week-day-name { font-weight: 600; font-size: 0.88rem; display: flex; align-items: center; gap: 8px; }
.week-day-date { font-size: 0.73rem; color: var(--tm); margin-top: 1px; }
.week-day-stats { text-align: right; }
.week-day-count { font-size: 0.78rem; color: var(--tm); display: block; }
.week-day-total { font-weight: 700; color: var(--green); font-size: 0.88rem; }

/* Overdue / alert rows */
.overdue-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--bd);
  gap: 12px;
}

.overdue-row:last-child { border-bottom: none; }

.overdue-info { flex: 1; min-width: 0; }

.overdue-num {
  font-weight: 600;
  color: var(--purple);
  display: block;
  font-size: 0.84rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.overdue-cust {
  font-size: 0.73rem;
  color: var(--tm);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.overdue-right { text-align: right; flex-shrink: 0; }
.overdue-date { font-size: 0.73rem; color: var(--tm); display: block; }
.overdue-amt { font-weight: 700; color: var(--red); font-size: 0.88rem; display: block; }

/* Revenue bar chart (CSS fallback) */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
  padding-bottom: 24px;
  position: relative;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.bar {
  width: 100%;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, var(--primary), rgba(37,99,235,0.4));
  min-height: 3px;
  transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar-green { background: linear-gradient(180deg, var(--green), rgba(22,163,74,0.3)); }
.bar-label { font-size: 0.65rem; color: var(--tm); font-weight: 500; margin-top: 6px; text-align: center; }

/* Activity feed */
.activity-row {
  display: flex;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--bd);
}

.activity-row:last-child { border-bottom: none; }

.activity-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, #e0f2fe, #bae6fd);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--amber-hover);
  font-size: 0.8rem;
  flex-shrink: 0;
}

.activity-body { flex: 1; min-width: 0; }
.activity-text { font-size: 0.82rem; color: var(--t); display: block; line-height: 1.5; }
.activity-time { font-size: 0.68rem; color: var(--td); margin-top: 2px; display: block; }

/* Empty states */
.empty-state {
  text-align: center;
  padding: var(--sp-7) var(--sp-5);
  color: var(--tm);
}

.empty-state .es-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--sp-4);
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--amber-subtle);
  color: var(--amber);
  font-size: 1.7rem;
}

/* Back-compat: bare <i> inside an empty state still gets a tinted chip */
.empty-state > i {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--sp-4);
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--amber-subtle);
  color: var(--amber);
  font-size: 1.7rem;
}

.empty-state .es-title {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--t);
  margin: 0 0 var(--sp-1);
}

.empty-state p {
  margin: 0 0 var(--sp-4);
  font-size: var(--fs-base);
  color: var(--tm);
}

/* ============================================================
   SCHEDULE / WEEK VIEW
   ============================================================ */
.week-grid { margin-top: 8px; }
.week-nav { display: flex; justify-content: space-between; margin-bottom: 12px; align-items: center; }
.week-cols { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }

.week-col {
  background: var(--surface);
  border: 1px solid var(--bd);
  border-radius: var(--radius);
  min-height: 200px;
  box-shadow: var(--shadow-xs);
}

.week-col-today {
  border-color: var(--amber);
  box-shadow: 0 0 0 1px var(--amber);
}

.week-col-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--bd);
  background: var(--bg1);
  border-radius: var(--radius) var(--radius) 0 0;
  text-align: center;
}

.week-col-name { font-weight: 700; font-size: 0.8rem; display: block; }
.week-col-date { font-size: 0.7rem; color: var(--tm); }
.week-col-total { font-size: 0.7rem; color: var(--green); font-weight: 700; display: block; }
.week-col-body { padding: 8px; }

.week-job {
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  background: var(--bg1);
  margin-bottom: 6px;
  border-left: 3px solid var(--bd);
  border: 1px solid var(--bd);
  border-left-width: 3px;
}

.bd-left-pending    { border-left-color: var(--warning) !important; }
.bd-left-in-progress{ border-left-color: var(--primary) !important; }
.bd-left-completed  { border-left-color: var(--green)   !important; }

/* Table row state highlights */
tr.row-warn   { background: rgba(245,158,11,0.07) !important; }
tr.row-danger { background: rgba(220,38,38,0.07) !important; }
[data-theme="dark"] tr.row-warn   { background: rgba(245,158,11,0.12) !important; }
[data-theme="dark"] tr.row-danger { background: rgba(220,38,38,0.12) !important; }

.week-job-time   { font-size: 0.65rem; font-weight: 700; color: var(--purple); }
.week-job-name   { font-size: 0.76rem; font-weight: 600; color: var(--t); display: block; }
.week-job-detail { font-size: 0.66rem; color: var(--tm); }
.week-col-empty  { text-align: center; color: var(--td); font-size: 0.73rem; padding: 20px 4px; }

.team-chips { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.team-chip {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 12px; background: var(--surface);
  border-radius: 20px; border: 1px solid var(--bd);
  font-size: 0.76rem; font-weight: 500;
  cursor: pointer; transition: all var(--ease);
}
.team-chip:hover { border-color: var(--amber); transform: translateY(-1px); box-shadow: var(--shadow-xs); }
.team-chip.active { background: var(--amber); color: #fff; border-color: var(--amber); box-shadow: 0 2px 8px rgba(14,165,164,0.35); }
.team-chip.active .team-dot { box-shadow: 0 0 0 2px #fff; }

/* Schedule day view */
.jr {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: var(--surface);
  border: 1px solid var(--bd);
  border-radius: var(--radius);
  margin-bottom: 8px;
  transition: box-shadow var(--ease), border-color var(--ease);
  box-shadow: var(--shadow-xs);
}

.jr:hover { box-shadow: var(--shadow-sm); border-color: #d0d9e8; }

.jr-time { font-weight: 700; color: var(--amber-hover); min-width: 50px; font-size: 0.84rem; }
.jr-info { flex: 1; min-width: 0; }

.jr-name {
  font-weight: 600;
  color: var(--t);
  display: block;
  text-decoration: none;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jr-name:hover { color: var(--primary); }
.jr-detail { font-size: 0.73rem; color: var(--tm); display: block; }
.jr-price { font-weight: 700; color: var(--green); white-space: nowrap; }
.jr-actions { display: flex; gap: 4px; }
.jr-recurring { border-left: 3px solid var(--purple); }
.week-job-recurring { border-left-color: var(--purple) !important; }

.schedule-summary {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--bd);
  border-radius: var(--radius);
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--tm);
}

.schedule-total { font-weight: 700; color: var(--green); }

/* ============================================================
   DETAIL PAGES
   ============================================================ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--tm);
  margin-bottom: 16px;
  text-decoration: none;
  transition: color var(--ease);
}

.back-link:hover { color: var(--primary); }

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 14px;
}

.detail-name {
  font-size: 1.45rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.3px;
}

.detail-address {
  font-size: 0.84rem;
  color: var(--tm);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
}

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

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--bd);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow-xs);
}

.stat-card-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--tm);
  margin-bottom: 5px;
  font-weight: 700;
  display: block;
}

.stat-card-value { font-size: 1.3rem; font-weight: 800; display: block; color: var(--t); }
.stat-green  { color: var(--green)  !important; }
.stat-blue   { color: var(--primary)!important; }
.stat-purple { color: var(--purple) !important; }
.stat-red    { color: var(--red)    !important; }
.stat-amber  { color: var(--amber-hover) !important; }

.detail-fields { display: flex; flex-direction: column; gap: 14px; }

.detail-field-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--tm);
  margin-bottom: 3px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-field-value { font-size: 0.88rem; font-weight: 500; color: var(--t); }

.payment-alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.payment-danger { background: #fef2f2; color: #b91c1c; border: 1px solid #fca5a5; }
.payment-ok { background: #f0fdf4; color: #15803d; border: 1px solid #86efac; }
[data-theme="dark"] .payment-danger { background: rgba(220,38,38,0.15); color: #f87171; border-color: rgba(220,38,38,0.35); }
[data-theme="dark"] .payment-ok { background: rgba(22,163,74,0.15); color: #4ade80; border-color: rgba(22,163,74,0.35); }

.round-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--bg1);
  border-left: 3px solid var(--amber);
}

/* ============================================================
   TEAM
   ============================================================ */
.team-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }

.team-avatar {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #fff;
  flex-shrink: 0;
  font-weight: 800;
}

.team-info { flex: 1; }
.team-name { font-weight: 700; font-size: 0.92rem; display: block; }
.team-role { font-size: 0.72rem; font-weight: 600; }
.team-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }

.team-stat {
  background: var(--bg1);
  border-radius: 8px;
  padding: 10px 12px;
  border: 1px solid var(--bd);
}

.team-stat-label { font-size: 0.62rem; color: var(--tm); text-transform: uppercase; letter-spacing: 0.8px; font-weight: 700; display: block; }
.team-stat-value { font-size: 1.1rem; font-weight: 800; margin-top: 2px; display: block; color: var(--t); }
.team-contact { font-size: 0.77rem; color: var(--tm); display: flex; align-items: center; gap: 6px; margin-top: 4px; }

.team-chips { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.team-chip {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 12px; background: var(--surface);
  border-radius: 20px; border: 1px solid var(--bd);
  font-size: 0.76rem; font-weight: 500;
  cursor: pointer; transition: all var(--ease);
}
.team-chip:hover { border-color: var(--amber); transform: translateY(-1px); box-shadow: var(--shadow-xs); }
.team-chip.active { background: var(--amber); color: #fff; border-color: var(--amber); box-shadow: 0 2px 8px rgba(14,165,164,0.35); }
.team-chip.active .team-dot { box-shadow: 0 0 0 2px #fff; }

/* ============================================================
   REPORTS
   ============================================================ */
.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--bd);
}

.metric-row:last-child { border-bottom: none; }
.metric-label { font-size: 0.84rem; color: var(--tm); }
.metric-value { font-weight: 700; font-size: 0.88rem; color: var(--t); }
.metric-total { padding-top: 10px; margin-top: 4px; border-top: 2px solid var(--bd); border-bottom: none; }

/* ============================================================
   SETTINGS
   ============================================================ */
.toggle-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--bd);
  cursor: pointer;
}

.toggle-group:last-of-type { border-bottom: none; }
.toggle-label { font-size: 0.88rem; font-weight: 500; color: var(--t); }

.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  background: var(--bd);
  border-radius: 11px;
  transition: background var(--ease);
  flex-shrink: 0;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--ease);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-group input { display: none; }
.toggle-group input:checked + .toggle-switch { background: var(--primary); }
.toggle-group input:checked + .toggle-switch::after { transform: translateX(18px); }

.hours-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.hours-day { min-width: 90px; font-size: 0.84rem; font-weight: 500; color: var(--t); }
.hours-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hours-closed-label { display: flex; align-items: center; gap: 4px; font-size: 0.78rem; color: var(--tm); cursor: pointer; }
.hours-closed-label input { accent-color: var(--primary); }
.hours-time:disabled { opacity: 0.4; }

/* ============================================================
   BULK BAR
   ============================================================ */
.bulk-bar {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  border-top: 2px solid var(--primary);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
  border-radius: var(--radius) var(--radius) 0 0;
}

/* ============================================================
   WEATHER WIDGET
   ============================================================ */
.weather-days { display: flex; gap: 8px; overflow-x: auto; }

.weather-day {
  flex: 1;
  min-width: 88px;
  text-align: center;
  padding: 12px 8px;
  border-radius: 9px;
  background: var(--bg1);
  border: 1px solid var(--bd);
}

.weather-day-name { font-size: 0.72rem; font-weight: 700; color: var(--tm); margin-bottom: 6px; display: block; }
.weather-icon { font-size: 1.4rem; color: var(--amber); display: block; margin-bottom: 4px; }
.weather-temp { font-size: 1.1rem; font-weight: 700; color: var(--t); }
.weather-detail { font-size: 0.66rem; color: var(--tm); }
.weather-warning { border-color: var(--warning); background: var(--warning-light); }
.weather-alert { font-size: 0.63rem; font-weight: 700; color: var(--warning); margin-top: 4px; }
.weather-loading { text-align: center; color: var(--tm); padding: 16px; font-size: 0.84rem; }
.spin { animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   ROUNDS
   ============================================================ */
.round-card .card-body { padding: 18px; }
.round-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.round-color { width: 12px; height: 44px; border-radius: 6px; flex-shrink: 0; margin-top: 2px; }
.round-title { flex: 1; }
.round-name { font-size: 1rem; margin: 0; font-weight: 700; }
.round-day { font-size: 0.73rem; color: var(--tm); font-weight: 500; }
.round-area { font-size: 0.73rem; color: var(--tm); display: flex; align-items: center; gap: 4px; }
.round-actions { display: flex; gap: 4px; }
.round-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.round-stat { background: var(--bg1); border-radius: 8px; padding: 10px; text-align: center; border: 1px solid var(--bd); }
.round-stat-value { font-size: 1.1rem; font-weight: 800; display: block; color: var(--t); }
.round-stat-label { font-size: 0.63rem; color: var(--tm); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; }
.round-cust-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--bd); }
.round-cust-row:last-child { border-bottom: none; }
.round-cust-name { font-weight: 600; font-size: 0.86rem; color: var(--t); text-decoration: none; display: block; }
.round-cust-name:hover { color: var(--primary); }
.round-cust-addr { font-size: 0.73rem; color: var(--tm); }
.round-cust-total { display: flex; justify-content: space-between; padding: 12px 0 0; border-top: 2px solid var(--bd); margin-top: 8px; font-weight: 700; font-size: 0.88rem; }
.round-assign-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--bd); cursor: pointer; }
.round-assign-row:hover { background: var(--bg1); margin: 0 -20px; padding: 10px 20px; border-radius: 6px; }
.round-assign-row input[type="checkbox"] { accent-color: var(--primary); width: 16px; height: 16px; }

/* ============================================================
   ACCOUNTS / EXPORT
   ============================================================ */
.export-list { display: flex; flex-direction: column; gap: 2px; }

.export-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 9px;
  text-decoration: none;
  color: var(--t);
  transition: background var(--ease);
}

.export-item:hover { background: var(--bg); color: var(--t); }

.export-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.export-body { flex: 1; min-width: 0; }
.export-title { font-weight: 600; font-size: 0.86rem; display: block; color: var(--t); }
.export-desc { font-size: 0.73rem; color: var(--tm); display: block; }
.export-dl { color: var(--tm); font-size: 1rem; }
.export-item:hover .export-dl { color: var(--primary); }

.quarter-block { padding: 14px 0; border-bottom: 1px solid var(--bd); }
.quarter-block:last-child { border-bottom: none; }
.quarter-header { font-weight: 700; font-size: 0.8rem; color: var(--tm); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.quarter-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quarter-stat { background: var(--bg1); border-radius: 8px; padding: 10px 12px; border: 1px solid var(--bd); }
.quarter-stat-label { font-size: 0.63rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--tm); font-weight: 700; display: block; }
.quarter-stat-value { font-size: 1rem; font-weight: 800; display: block; margin-top: 2px; color: var(--t); }

/* ============================================================
   DROPDOWNS
   ============================================================ */
.cc-dropdown { position: relative; display: inline-block; }

.cc-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--bd);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  min-width: 200px;
  z-index: 300;
  padding: 6px 0;
  animation: dropIn 0.15s ease-out;
}

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.cc-dropdown.open .cc-dropdown-menu { display: block; }

.cc-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--t2);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--ease);
}

.cc-dropdown-item:hover { background: var(--bg); color: var(--t); }
.cc-dropdown-item i { color: var(--tm); width: 16px; text-align: center; }
.cc-dropdown-divider { height: 1px; background: var(--bd); margin: 4px 0; }

/* ============================================================
   TABLE CELL HELPERS
   ============================================================ */
.customer-name { font-weight: 600; font-size: 0.86rem; }
.customer-address { font-size: 0.73rem; color: var(--tm); margin-top: 2px; }
.invoice-number { font-weight: 700; color: var(--purple); }
.date { color: var(--tm); font-size: 0.8rem; }

/* ============================================================
   AUTH — SPLIT SCREEN
   ============================================================ */
.auth-split {
  min-height: 100vh;
  display: flex;
}

/* Left brand panel */
.auth-panel-l {
  flex: 0 0 42%;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 52px;
  position: relative;
  overflow: hidden;
}

.auth-panel-l::before {
  content: '';
  position: absolute;
  top: -120px;
  right: -80px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(14,165,164,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.auth-panel-l::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: -60px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(37,99,235,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.auth-brand-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  margin-bottom: 28px;
  box-shadow: 0 8px 24px rgba(14,165,164,0.28);
}

.auth-brand-name {
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.5px;
  display: block;
  margin-bottom: 6px;
}

.auth-brand-tagline {
  font-size: 0.92rem;
  color: rgba(255,255,255,0.5);
  margin-bottom: 44px;
  line-height: 1.5;
  max-width: 280px;
}

.auth-features { display: flex; flex-direction: column; gap: 16px; }

.auth-feature {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.auth-feature-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(14,165,164,0.15);
  border: 1px solid rgba(14,165,164,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--amber);
  font-size: 0.82rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.auth-feature-text {
  display: flex;
  flex-direction: column;
}

.auth-feature-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  line-height: 1.3;
}

.auth-feature-sub {
  font-size: 0.73rem;
  color: rgba(255,255,255,0.35);
  margin-top: 2px;
}

.auth-panel-l-footer {
  margin-top: 56px;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.2);
}

/* Right form panel */
.auth-panel-r {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 40px 32px;
}

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

.auth-form-heading {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--t);
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}

.auth-form-sub {
  font-size: 0.86rem;
  color: var(--tm);
  margin-bottom: 28px;
}

.auth-form-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--bd);
  padding: 28px 28px;
  box-shadow: var(--shadow-md);
}

/* Legacy auth classes (kept for compat) */
.auth-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 2rem; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 40px 36px; border: 1px solid var(--bd); }
.auth-logo { font-size: 2rem; text-align: center; margin-bottom: 4px; color: var(--amber); }
.auth-title { text-align: center; font-size: 1.5rem; font-weight: 800; color: var(--t); margin-bottom: 4px; }
.auth-sub { text-align: center; font-size: 0.84rem; color: var(--tm); margin-bottom: 24px; }
.auth-form .fg { margin-bottom: 16px; }
.auth-form .bt { width: 100%; justify-content: center; padding: 11px; font-size: 0.92rem; margin-top: 8px; }
.auth-alt { text-align: center; margin-top: 20px; font-size: 0.84rem; color: var(--tm); }
.auth-alt a { color: var(--primary); font-weight: 600; }

/* Flash messages */
.flash {
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-weight: 500;
  font-size: 0.84rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.flash-error   { background: var(--red-light);     color: var(--red);     border: 1px solid #fecaca; }
.flash-success { background: var(--green-light);   color: var(--green);   border: 1px solid #bbf7d0; }
.flash-warning { background: var(--warning-light); color: var(--warning); border: 1px solid #fde68a; }

/* ============================================================
   ALERTS (Bootstrap override)
   ============================================================ */
.alert { background: var(--surface); border: 1px solid var(--bd); color: var(--t); border-radius: var(--radius); }
.alert-success { background: #f0fdf4; color: #15803d; border-color: #86efac; }
.alert-error,
.alert-danger  { background: #fef2f2; color: #b91c1c; border-color: #fca5a5; }
.alert-warning { background: #fef3c7; color: #92400e; border-color: #f59e0b; }
.alert-info    { background: #eff6ff; color: #1d4ed8; border-color: #93c5fd; }

[data-theme="dark"] .alert-success { background: rgba(22,163,74,0.15);  color: #4ade80; border-color: rgba(22,163,74,0.35); }
[data-theme="dark"] .alert-error,
[data-theme="dark"] .alert-danger  { background: rgba(220,38,38,0.15);  color: #f87171; border-color: rgba(220,38,38,0.35); }
[data-theme="dark"] .alert-warning { background: rgba(245,158,11,0.15); color: #fbbf24; border-color: rgba(245,158,11,0.35); }
[data-theme="dark"] .alert-info    { background: rgba(37,99,235,0.15);  color: #60a5fa; border-color: rgba(37,99,235,0.35); }

.btn-close { filter: none; }

/* ============================================================
   BOOTSTRAP OVERRIDES
   ============================================================ */
body { color: var(--t); background: var(--bg); }

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--t);
  --bs-table-border-color: var(--bd);
  color: var(--t);
}

.table th { background: var(--bg1) !important; color: var(--tm) !important; border-color: var(--bd) !important; }
.table td { color: var(--t); border-color: var(--bd) !important; }
.table tr:hover td { background: var(--bg1) !important; }
.tw table th { color: var(--tm); }
.tw table td { color: var(--t); }

.form-control, .form-select, input, select, textarea {
  color: var(--t);
  background-color: var(--surface);
  border-color: var(--bd);
  font-family: var(--font);
}

.form-control:focus, .form-select:focus, input:focus, select:focus, textarea:focus {
  color: var(--t);
  background-color: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

select option { background: var(--surface); color: var(--t); }

input[type="checkbox"] { accent-color: var(--primary); }

/* ============================================================
   SKELETON LOADER
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--bg1) 25%, var(--bd) 50%, var(--bg1) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   DARK MODE OVERRIDES
   ============================================================ */
[data-theme="dark"] body {
  color: var(--t);
  background: var(--bg);
  background-image: linear-gradient(180deg, rgba(14,165,164,0.06) 0%, transparent 220px);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

[data-theme="dark"] .topbar {
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--bd);
  box-shadow: var(--shadow-xs);
}

[data-theme="dark"] .card-header {
  background: linear-gradient(to right, rgba(22,32,50,0.8), rgba(15,24,41,0.3));
}

[data-theme="dark"] .kpi-green { background: linear-gradient(135deg, rgba(22,163,74,0.18), rgba(22,163,74,0.08)); }
[data-theme="dark"] .kpi-amber { background: linear-gradient(135deg, rgba(14,165,164,0.18), rgba(14,165,164,0.08)); }
[data-theme="dark"] .kpi-blue  { background: linear-gradient(135deg, rgba(37,99,235,0.18), rgba(37,99,235,0.08)); }
[data-theme="dark"] .kpi-purple{ background: linear-gradient(135deg, rgba(124,58,237,0.18), rgba(124,58,237,0.08)); }
[data-theme="dark"] .kpi-red   { background: linear-gradient(135deg, rgba(220,38,38,0.18), rgba(220,38,38,0.08)); }

[data-theme="dark"] .bt-s { background: var(--bg1); color: var(--t2); border-color: var(--bd); }
[data-theme="dark"] .bt-s:hover { background: var(--bg); }
[data-theme="dark"] .bt-g { background: transparent; color: var(--tm); border-color: var(--bd); }
[data-theme="dark"] .bt-g:hover { background: rgba(255,255,255,0.06); color: var(--t); }
[data-theme="dark"] .bt-d { background: rgba(220,38,38,0.15); color: #f87171; border-color: rgba(220,38,38,0.3); }
[data-theme="dark"] .bt-d:hover { background: rgba(220,38,38,0.28); border-color: rgba(220,38,38,0.5); }
[data-theme="dark"] .bt-ok { background: rgba(22,163,74,0.15); color: #4ade80; border-color: rgba(22,163,74,0.3); }
[data-theme="dark"] .bt-ok:hover { background: rgba(22,163,74,0.28); border-color: rgba(22,163,74,0.5); }

[data-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea {
  background-color: var(--bg1);
  color: var(--t);
  border-color: var(--bd);
}

[data-theme="dark"] input:focus, [data-theme="dark"] select:focus, [data-theme="dark"] textarea:focus {
  background-color: var(--bg1);
}

[data-theme="dark"] input::placeholder { color: var(--td); }
[data-theme="dark"] .fi, [data-theme="dark"] .fs { background-color: var(--bg1); color: var(--t); border-color: var(--bd); }
[data-theme="dark"] .fi:hover, [data-theme="dark"] .fs:hover { border-color: rgba(255,255,255,0.12); }
[data-theme="dark"] .ml-ft, [data-theme="dark"] .modal-footer { background: var(--bg); }
[data-theme="dark"] .card-header { background: var(--bg1); }
[data-theme="dark"] .card { color: var(--t); background: var(--surface); border-color: var(--bd); }
[data-theme="dark"] .card-body { color: var(--t); }
[data-theme="dark"] .topbar { background: var(--surface); border-color: var(--bd); }
[data-theme="dark"] .topbar-title { color: var(--t); }
[data-theme="dark"] .topbar-btn { background: transparent; border-color: var(--bd); color: var(--tm); }
[data-theme="dark"] .table tr:hover td { background: var(--bg1) !important; }
[data-theme="dark"] select option { background: var(--bg1); color: var(--t); }
[data-theme="dark"] .auth-card { background: var(--surface); }
[data-theme="dark"] .auth-title { color: var(--t); }
[data-theme="dark"] .flash-error   { border-color: rgba(220,38,38,0.3); }
[data-theme="dark"] .flash-success { border-color: rgba(22,163,74,0.3); }
[data-theme="dark"] .flash-warning { border-color: rgba(217,119,6,0.3); }
[data-theme="dark"] .filter-pills, [data-theme="dark"] .filter-tabs { background: var(--bg); border-color: var(--bd); }
[data-theme="dark"] .filter-pill, [data-theme="dark"] .filter-tab { color: var(--tm); }
[data-theme="dark"] .filter-pill.active, [data-theme="dark"] .filter-tab.active { color: var(--t); }
[data-theme="dark"] .filter-pill:hover, [data-theme="dark"] .filter-tab:hover { color: var(--t); }
[data-theme="dark"] .view-toggle { border-color: var(--bd); }
[data-theme="dark"] .view-btn { background: var(--bg1); color: var(--tm); }
[data-theme="dark"] .view-btn:hover { color: var(--t); }
[data-theme="dark"] .view-btn.active { background: var(--primary); color: #fff; }
[data-theme="dark"] a.search-item { color: var(--t); }
[data-theme="dark"] .search-box { background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.12); }
[data-theme="dark"] .search-box:hover { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.18); }
[data-theme="dark"] .search-box:focus-within { background: var(--surface); border-color: var(--amber); }
[data-theme="dark"] .search-box input { color: var(--t) !important; }
[data-theme="dark"] .fi:hover, [data-theme="dark"] .fs:hover { border-color: rgba(255,255,255,0.15); }
[data-theme="dark"] .quick-action { background: var(--surface); border-color: var(--bd); color: var(--t2); }
[data-theme="dark"] .quick-action:hover { background: rgba(245,158,11,0.08); }
[data-theme="dark"] .week-col { background: var(--surface); border-color: var(--bd); }
[data-theme="dark"] .week-col-header { background: var(--bg1); }
[data-theme="dark"] .week-job { background: var(--bg1); }
[data-theme="dark"] .week-col-name, [data-theme="dark"] .week-job-name { color: var(--t); }
[data-theme="dark"] .jr { background: var(--surface); border-color: var(--bd); }
[data-theme="dark"] .jr-name, [data-theme="dark"] .job-name { color: var(--t); }
[data-theme="dark"] .kpi-card { background: var(--surface); border-color: var(--bd); }
[data-theme="dark"] .kpi-value { color: var(--t); }
[data-theme="dark"] .stat-card-value { color: var(--t); }
[data-theme="dark"] .detail-name, [data-theme="dark"] .detail-field-value { color: var(--t); }
[data-theme="dark"] .team-stat-value, [data-theme="dark"] .team-name { color: var(--t); }
[data-theme="dark"] .team-stat { background: var(--bg1); border-color: var(--bd); }
[data-theme="dark"] .round-stat-value, [data-theme="dark"] .round-name, [data-theme="dark"] .round-cust-name, [data-theme="dark"] .round-cust-total { color: var(--t); }
[data-theme="dark"] .round-stat { background: var(--bg1); border-color: var(--bd); }
[data-theme="dark"] .metric-value { color: var(--t); }
[data-theme="dark"] .hours-day, [data-theme="dark"] .toggle-label { color: var(--t); }
[data-theme="dark"] .quarter-stat-value { color: var(--t); }
[data-theme="dark"] .quarter-stat { background: var(--bg1); border-color: var(--bd); }
[data-theme="dark"] .schedule-summary { background: var(--surface); border-color: var(--bd); }
[data-theme="dark"] .bulk-bar { background: var(--surface); }
[data-theme="dark"] .weather-day { background: var(--bg1); border-color: var(--bd); }
[data-theme="dark"] .weather-warning { background: var(--warning-light); border-color: rgba(217,119,6,0.3); }
[data-theme="dark"] .cc-dropdown-menu { background: var(--surface); border-color: var(--bd); }
[data-theme="dark"] .cc-dropdown-item { color: var(--t2); }
[data-theme="dark"] .cc-dropdown-item:hover { background: var(--bg); color: var(--t); }
[data-theme="dark"] .mobile-more-header { color: var(--t); }
[data-theme="dark"] .customer-name { color: var(--t); }
[data-theme="dark"] .round-tag { background: var(--bg1); }
[data-theme="dark"] .notif-drawer { background: var(--surface); border-color: var(--bd); }
[data-theme="dark"] .notif-item:hover { background: var(--bg1); }
[data-theme="dark"] .notif-item.unread { background: var(--primary-light); }
[data-theme="dark"] .phone-wrap .phone-code {
  background: var(--bg1);
  color: var(--t);
  border-color: var(--bd);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%2394a3b8'%3E%3Cpath d='M5 7L1 3h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .sidebar { display: none !important; }
  .main-content { margin-left: 0; }

  /* Topbar — compact mobile */
  .topbar { padding: 0 12px; height: 56px; }
  .topbar-title { font-size: 1.1rem; font-weight: 800; letter-spacing: -0.3px; }
  .search-box { display: none; }
  .topbar-btn { width: 38px; height: 38px; }

  /* Content area with nav clearance */
  .page-content { padding: 14px 14px 100px; }

  /* Grid layouts */
  .dash-kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .g2, .g3, .dash-two-col, .settings-grid { grid-template-columns: 1fr; }
  .week-cols { grid-template-columns: repeat(3, 1fr); }
  .fr { grid-template-columns: 1fr; }

  /* Toolbar */
  .page-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .toolbar-left { flex-direction: column; align-items: stretch; }
  .toolbar-right { justify-content: flex-end; }

  /* Scrollable pills */
  .filter-pills, .filter-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .filter-pills::-webkit-scrollbar, .filter-tabs::-webkit-scrollbar { display: none; }

  /* Detail header */
  .detail-header { flex-direction: column; }

  /* Job row */
  .jr { flex-wrap: wrap; gap: 8px; }
  .jr-actions { width: 100%; justify-content: flex-end; padding-top: 4px; border-top: 1px solid var(--bd); }

  /* Quick actions horizontal scroll */
  .quick-actions { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 4px; }
  .quick-actions::-webkit-scrollbar { display: none; }
  .quick-action { flex-shrink: 0; min-width: 72px; }

  /* Filter bar */
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-search { flex-wrap: wrap; }

  /* Cards — slightly more breathing room */
  .card { border-radius: var(--radius-lg); }
  .card-header { font-size: 0.9rem; }
  .kpi-card { border-radius: var(--radius-lg); }

  /* Buttons — bigger touch targets */
  .bt { min-height: 40px; }

  /* Inputs — 16px minimum so iOS doesn't zoom on focus */
  .fi, .fs, .search-box input { font-size: 16px; }

  /* Auth */
  .auth-split { flex-direction: column; }
  .auth-panel-l { flex: none; min-height: auto; padding: 32px 28px; }
  .auth-panel-r { padding: 32px 20px; }
  .auth-features { display: none; }

  /* Notifications drawer */
  .notif-drawer { width: 100%; }

  /* Tables — swipeable */
  .table-responsive { border-radius: var(--radius); overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Bulk-action bar — clear of the fixed bottom nav */
  .bulk-bar { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); z-index: 101; border-radius: var(--radius); margin: 0 4px; }

  /* Cookie banner — sit above the fixed bottom nav */
  #cookieBanner { bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important; }
}

/* ============================================================
   DETAIL VIEW — two-column record layout
   ============================================================ */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.detail-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--bd);
}

.detail-row:last-child { border-bottom: none; }

.detail-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--tm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 130px;
  flex-shrink: 0;
  padding-top: 3px;
  line-height: 1.4;
}

@media (max-width: 768px) {
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .dash-kpis { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .week-cols { grid-template-columns: 1fr 1fr; }
  .kpi-value { font-size: 1.35rem; }
  .auth-panel-l { padding: 24px 20px; }
  .auth-form-card { padding: 22px 18px; }
}

@media (min-width: 1400px) {
  :root { --sidebar-w: 260px; }
  .page-content { padding: 28px 36px 100px; }
  .topbar { padding: 0 36px; }
}

/* ── Plan gating ── */
.sidebar-locked {
  opacity: 0.42;
  pointer-events: auto;
}
.sidebar-locked:hover {
  opacity: 0.6;
  background: transparent !important;
}
.sidebar-lock-icon {
  margin-left: auto;
  font-size: 0.6rem;
  opacity: 0.7;
}

/* ============================================================
   TOASTS (unified flash messages)
   ============================================================ */
.gm-toasts {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.gm-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--bd);
  border-left: 3px solid var(--tm);
  box-shadow: var(--shadow-lg);
  font-size: var(--fs-base);
  color: var(--t);
  animation: toastIn 0.28s cubic-bezier(0.34, 1.2, 0.64, 1);
}
.gm-toast.hiding { animation: toastOut 0.25s ease forwards; }

.gm-toast i.gm-toast-icon { font-size: 1rem; margin-top: 1px; flex-shrink: 0; }
.gm-toast .gm-toast-msg { flex: 1; line-height: 1.4; }
.gm-toast .gm-toast-close {
  background: none; border: none; cursor: pointer;
  color: var(--td); font-size: 0.9rem; padding: 0 2px; line-height: 1;
  transition: color var(--ease);
}
.gm-toast .gm-toast-close:hover { color: var(--t); }

.gm-toast.gm-success { border-left-color: var(--green); }
.gm-toast.gm-success i.gm-toast-icon { color: var(--green); }
.gm-toast.gm-error { border-left-color: var(--red); }
.gm-toast.gm-error i.gm-toast-icon { color: var(--red); }
.gm-toast.gm-warning { border-left-color: var(--warning); }
.gm-toast.gm-warning i.gm-toast-icon { color: var(--warning); }
.gm-toast.gm-info { border-left-color: var(--amber); }
.gm-toast.gm-info i.gm-toast-icon { color: var(--amber); }

@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(24px); } }

/* ============================================================
   PAGE HEADER (standard page title + breadcrumb + actions)
   ============================================================ */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;
}
.page-head .ph-titles { min-width: 0; }
.page-head .ph-title {
  font-size: var(--fs-2xl);
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--t);
  line-height: 1.15;
  margin: 2px 0 0;
}
.page-head .ph-sub { font-size: var(--fs-base); color: var(--tm); margin-top: 3px; }
.page-head .ph-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* ============================================================
   RESPONSIVE TABLE — card fallback on small screens
   ============================================================ */
@media (max-width: 767px) {
  table.rt thead { display: none; }
  table.rt, table.rt tbody, table.rt tr, table.rt td { display: block; width: 100%; }
  table.rt tr {
    background: var(--surface);
    border: 1px solid var(--bd);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
    padding: 6px 12px;
    margin-bottom: 10px;
  }
  table.rt td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    text-align: right;
    padding: 7px 0;
    border: none;
    border-bottom: 1px solid var(--bd);
  }
  table.rt td:last-child { border-bottom: none; }
  table.rt td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--tm);
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-align: left;
    flex-shrink: 0;
  }
  table.rt td:empty { display: none; }
}
