/* =============================================
   AquaFill — Global Styles
   ============================================= */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Manrope:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

/* ---- ROOT: LIGHT MODE ---- */
:root {
  --aqua:         #00C2FF;
  --aqua-dark:    #00a8dc;
  --sidebar-w:    240px;
  --radius:       12px;
  --radius-lg:    16px;
  --radius-xl:    20px;
  --shadow-sm:    0 1px 3px rgba(10,37,64,0.08);
  --shadow-md:    0 10px 25px -3px rgba(10,37,64,0.12);
  --shadow-lg:    0 20px 40px -5px rgba(10,37,64,0.18);

  /* Semantic light-mode palette */
  --navy:         #0A2540;
  --bg-main:      #F4F7FB;
  --bg-card:      #FFFFFF;
  --bg-sidebar:   #0A2540;
  --text-main:    #0F172A;
  --text-muted:   #64748B;
  --border:       #E2E8F0;
  --glass:        rgba(255,255,255,0.92);
  --white:        #ffffff;

  /* Status */
  --green:        #22c55e; --green-bg:  #dcfce7; --green-text: #166534;
  --amber:        #f59e0b; --amber-bg:  #fef3c7; --amber-text: #92400e;
  --red:          #ef4444; --red-bg:    #fee2e2; --red-text:   #991b1b;

  /* Mobile safe areas */
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top:    env(safe-area-inset-top, 0px);
}

/* ---- DARK MODE ---- */
[data-theme="dark"] {
  --navy:       #38bdf8;
  --bg-main:    #0D1117;
  --bg-card:    #161B22;
  --bg-sidebar: #0D1117;
  --text-main:  #E6EDF3;
  --text-muted: #8B949E;
  --border:     #30363D;
  --glass:      rgba(22,27,34,0.95);
  --white:      #161B22;

  --green-bg:   #0d2b1a; --green-text: #4ade80;
  --amber-bg:   #2d1f05; --amber-text: #fbbf24;
  --red-bg:     #2d0b0b; --red-text:   #f87171;
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Manrope', sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}

body:not(.landing-body) {
  background:
    linear-gradient(120deg, rgba(0,194,255,0.08) 0 1px, transparent 1px 120px),
    linear-gradient(135deg, rgba(255,255,255,0.92), rgba(236,248,255,0.72) 42%, rgba(244,247,251,0.96)),
    var(--bg-main);
}

[data-theme="dark"] body:not(.landing-body) {
  background:
    linear-gradient(120deg, rgba(0,194,255,0.08) 0 1px, transparent 1px 120px),
    linear-gradient(135deg, rgba(13,17,23,0.98), rgba(10,20,31,0.96) 48%, rgba(13,17,23,1)),
    var(--bg-main);
}

h1,h2,h3,h4,h5 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  line-height: 1.3;
  color: var(--navy);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
}

p {
  color: var(--text-muted);
}

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

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, rgba(10,37,64,0.96), rgba(7,24,42,0.98));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  height: 100vh;
  position: fixed;
  left: 0; top: 0;
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-right: 1px solid rgba(255,255,255,0.06);
  overflow-y: auto;
  overscroll-behavior: contain;
}

[data-theme="dark"] .sidebar {
  background: #090E14;
  border-right-color: var(--border);
}

.sidebar-logo {
  padding: 24px 20px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
[data-theme="dark"] .sidebar-logo { border-bottom-color: var(--border); }

.sidebar-logo .logo-icon {
  width: 36px; height: 36px;
  background: var(--aqua);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #0A2540; font-size: 20px;
}
.sidebar-logo .logo-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 20px; font-weight: 800;
  color: white; letter-spacing: -0.5px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex; flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-link {
  display: flex; align-items: center;
  gap: 12px; padding: 11px 14px;
  border-radius: 10px;
  color: rgba(255,255,255,0.55);
  font-size: 14px; font-weight: 600;
  transition: all 0.2s ease;
  position: relative;
}
.nav-link:hover { background: rgba(255,255,255,0.07); color: white; }
.nav-link.active {
  background: rgba(0,194,255,0.15);
  color: var(--aqua);
  border-left: 3px solid var(--aqua);
  padding-left: 11px;
}
.nav-link .material-symbols-outlined { font-size: 20px; }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
[data-theme="dark"] .sidebar-footer { border-top-color: var(--border); }

.sidebar-user {
  display: flex; align-items: center;
  gap: 10px; padding: 10px; border-radius: 10px;
}
.sidebar-user .user-info { min-width: 0; }
.sidebar-user .user-name { font-size: 13px; font-weight: 700; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .user-role { font-size: 11px; color: rgba(255,255,255,0.45); }

.logout-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; color: #f87171;
  font-size: 13px; font-weight: 600;
  border-radius: 8px; margin-top: 4px;
  transition: background 0.2s;
  cursor: pointer; border: none; background: none; width: 100%;
  font-family: 'Manrope', sans-serif;
}
.logout-btn:hover { background: rgba(239,68,68,0.12); }

/* ---- TOPBAR ---- */
.topbar {
  height: 60px;
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: color-mix(in srgb, var(--glass) 88%, transparent);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.topbar-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.theme-toggle {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.theme-toggle:hover {
  transform: rotate(15deg) scale(1.1);
  background: var(--aqua);
  color: #0A2540;
  border-color: var(--aqua);
}

/* ── Inline modal error/success banners ── */
.inline-error, .inline-success, .inline-warning, .inline-info {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
  border: 1px solid transparent;
  margin-bottom: 12px;
}
.inline-error {
  background: rgba(239,68,68,0.08);
  border-color: rgba(239,68,68,0.25);
  color: #991b1b;
}
[data-theme="dark"] .inline-error {
  background: rgba(239,68,68,0.12);
  border-color: rgba(239,68,68,0.25);
  color: #fca5a5;
}
.inline-success {
  background: rgba(16,185,129,0.1);
  border-color: rgba(16,185,129,0.3);
  color: #065f46;
}
[data-theme="dark"] .inline-success {
  background: rgba(16,185,129,0.12);
  border-color: rgba(16,185,129,0.25);
  color: #6ee7b7;
}
.inline-warning {
  background: rgba(245,158,11,0.09);
  border-color: rgba(245,158,11,0.3);
  color: #92400e;
}
[data-theme="dark"] .inline-warning {
  background: rgba(245,158,11,0.12);
  border-color: rgba(245,158,11,0.3);
  color: #fcd34d;
}
.inline-info {
  background: rgba(99,102,241,0.08);
  border-color: rgba(99,102,241,0.25);
  color: #3730a3;
}
[data-theme="dark"] .inline-info {
  background: rgba(99,102,241,0.14);
  border-color: rgba(99,102,241,0.3);
  color: #a5b4fc;
}
.inline-error .material-symbols-outlined,
.inline-success .material-symbols-outlined,
.inline-warning .material-symbols-outlined,
.inline-info .material-symbols-outlined { font-size: 15px; flex-shrink: 0; margin-top: 1px; }
.notif-bell-wrap {
  position: relative;
  flex-shrink: 0;
}
.notif-bell-btn {
  position: relative;
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.notif-bell-btn:hover {
  background: var(--aqua);
  color: #0A2540;
  border-color: var(--aqua);
}
.notif-bell-btn .material-symbols-outlined { font-size: 20px; }
.notif-bell-badge {
  position: absolute;
  top: -5px; right: -5px;
  min-width: 18px; height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: #ef4444;
  color: #fff;
  font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
  border: 2px solid var(--bg-main);
  pointer-events: none;
}
.notif-panel {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  z-index: 999;
  overflow: hidden;
  animation: notifSlideDown 0.18s cubic-bezier(0.4,0,0.2,1);
}
.notif-panel.open { display: block; }
@keyframes notifSlideDown {
  from { opacity:0; transform:translateY(-8px); }
  to   { opacity:1; transform:translateY(0); }
}
.notif-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}
.notif-panel-title {
  font-size: 14px; font-weight: 800; color: var(--text-main);
}
.notif-mark-all {
  font-size: 11px; font-weight: 700;
  color: var(--aqua);
  background: none; border: none; cursor: pointer;
  padding: 4px 8px; border-radius: 6px;
  transition: background 0.15s;
  font-family: 'Manrope', sans-serif;
}
.notif-mark-all:hover { background: rgba(0,194,255,0.1); }
.notif-list {
  max-height: 360px;
  overflow-y: auto;
}
.notif-item {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  color: inherit;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-main); }
.notif-item.unread { background: rgba(0,194,255,0.05); }
.notif-item.unread:hover { background: rgba(0,194,255,0.10); }
.notif-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 18px;
}
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title {
  font-size: 13px; font-weight: 700; color: var(--text-main);
  margin-bottom: 2px; line-height: 1.3;
}
.notif-item-msg {
  font-size: 12px; color: var(--text-muted); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.notif-item-time {
  font-size: 10px; color: var(--text-muted); margin-top: 4px;
  font-weight: 600;
}
.notif-unread-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--aqua); flex-shrink: 0; margin-top: 5px;
}
.notif-empty {
  padding: 36px 20px;
  text-align: center;
  font-size: 13px; color: var(--text-muted); font-weight: 600;
}
/* Admin static notif rows */
.notif-admin-row {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  color: inherit;
}
.notif-admin-row:last-child { border-bottom: none; }
.notif-admin-row:hover { background: var(--bg-main); }

@media (max-width: 480px) {
  .notif-panel { width: calc(100vw - 24px); right: -8px; }
}

/* ---- LAYOUT ---- */
.app-layout { display: flex; min-height: 100vh; }

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  background: var(--bg-main);
}

.page-content {
  flex: 1;
  padding: 24px 28px;
  max-width: 100%;
}

/* On desktop the refiller dashboard uses rf-bottom-grid which needs to stretch
   to fill the remaining viewport height. Make page-content a flex column so
   children that use flex:1 on the bottom grid actually expand. */
@media (min-width: 769px) {
  .page-content {
    display: flex;
    flex-direction: column;
  }
}

.container-fluid { width: 100%; margin-left: auto; margin-right: auto; }

/* ---- NO PHANTOM SCROLL ON MOBILE ----
   On small screens the sidebar collapses, so main-content becomes
   the full page. We lock the stack to 100% viewport height and make
   main-content the ONLY scroll container — scroll area is now exactly
   as tall as the real content, never taller. Desktop is untouched.  */
@media (max-width: 768px) {
  html, body { height: 100%; overflow: hidden; }

  .app-layout {
    height: 100%;
    min-height: unset;
    overflow: hidden;
  }

  .main-content {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }

  /* Prevent page-content from generating phantom scroll space below content */
  .page-content {
    min-height: 0;
    flex-shrink: 0;
    padding-bottom: 24px;
  }
  /* Settings grid: no extra bottom breathing room that creates phantom scroll */
  .settings-grid {
    margin-bottom: 0;
  }
  /* Remove min-height from settings cards on mobile — size to content only */
  .settings-grid .card,
  .settings-grid > div > .card,
  .settings-panel {
    min-height: 0 !important;
  }
}

/* ---- CARDS ---- */
.card {
  background: color-mix(in srgb, var(--bg-card) 86%, transparent);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 16px 42px rgba(10,37,64,0.08);
  border: 1px solid color-mix(in srgb, var(--border) 74%, transparent);
  color: var(--text-main);
}

[data-theme="dark"] .card {
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* Card Hover effect — desktop only */
@media (min-width: 769px) {
  .card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: 10px;
  font-size: 14px; font-weight: 600;
  cursor: pointer; border: none;
  transition: all 0.2s ease;
  font-family: 'Manrope', sans-serif;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn-primary { background: var(--aqua); color: #0A2540; }
.btn-primary:hover { background: var(--aqua-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,194,255,0.3); }
.btn-navy { background: #0A2540; color: white; border-radius: 10px; font-weight: 600; transition: all 0.2s; }
[data-theme="dark"] .btn-navy { background: #1e3a5f; }
.btn-navy:hover { background: #334155; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.btn-green { background: var(--green); color: white; }
.btn-green:hover { background: #16a34a; }
.btn-red { background: var(--red); color: white; }
.btn-red:hover { background: #dc2626; }
.btn-outline { background: transparent; border: 2px solid var(--aqua); color: var(--aqua); }
.btn-outline:hover { background: var(--aqua); color: #0A2540; }
.btn-outline-red { background: transparent; border: 2px solid var(--red); color: var(--red); }
.btn-outline-red:hover { background: var(--red); color: white; }
.btn-sm  { padding: 7px 14px; font-size: 13px; }
.btn-lg  { padding: 14px 28px; font-size: 16px; }
.btn-full { width: 100%; justify-content: center; }

/* Modern Icon Button for Delete */
.btn-icon-danger {
  background: #fee2e2;
  color: #ef4444;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-danger:hover {
  background: #ef4444 !important;
  color: white !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* ---- BADGES ---- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.03em; text-transform: uppercase;
}
.badge-green { background: var(--green-bg); color: var(--green-text); }
.badge-red   { background: var(--red-bg);   color: var(--red-text); }
.badge-amber { background: var(--amber-bg); color: var(--amber-text); }
.badge-blue  { background: #dbeafe; color: #1e40af; }
[data-theme="dark"] .badge-blue { background: #1e3a5f; color: #93c5fd; }
.badge-gray  { background: #f1f5f9; color: #64748b; }
[data-theme="dark"] .badge-gray { background: #1e293b; color: #94a3b8; }

/* ---- FORMS ---- */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text-main); }

.form-input {
  height: 44px; padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px; font-size: 14px;
  font-family: 'Manrope', sans-serif;
  color: var(--text-main);
  background: var(--bg-card);
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
.form-input:focus { outline: none; border-color: var(--aqua); box-shadow: 0 0 0 3px rgba(0,194,255,0.15); }
.form-input:disabled { background: var(--bg-main); color: var(--text-muted); cursor: not-allowed; }
[data-theme="dark"] .form-input { background: #1c2536; border-color: var(--border); }
[data-theme="dark"] .form-input:disabled { background: #0d1117; }

.form-select {
  height: 44px; padding: 0 36px 0 14px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 14px; font-family: 'Manrope', sans-serif;
  color: var(--text-main); background: var(--bg-card)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E")
    no-repeat right 14px center;
  appearance: none; width: 100%;
  transition: border-color 0.2s; cursor: pointer;
}
.form-select:focus { outline: none; border-color: var(--aqua); box-shadow: 0 0 0 3px rgba(0,194,255,0.15); }
[data-theme="dark"] .form-select { background-color: #1c2536; border-color: var(--border); }

/* ---- TABLES ---- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
table { width: 100%; border-collapse: collapse; background: var(--bg-card); min-width: 500px; }
thead tr { background: var(--bg-main); border-bottom: 1px solid var(--border); }
th { padding: 12px 16px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); white-space: nowrap; }
td { padding: 14px 16px; font-size: 14px; border-bottom: 1px solid var(--border); color: var(--text-main); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-main); }

/* ---- STAT CARDS ---- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
}
.stat-card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  padding: 20px 22px; border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card .stat-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px; font-size: 22px;
}
.stat-card .stat-info { flex: 1; min-width: 0; }
.stat-card .stat-label { font-size: 12px; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-card .stat-value { font-size: 26px; font-weight: 800; color: var(--navy); font-family: 'Plus Jakarta Sans', sans-serif; line-height: 1.2; }
.stat-card .stat-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ---- RESPONSIVE GRID HELPERS ---- */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.grid-3-2col {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 20px;
  align-items: stretch;
}
.grid-3-2col > .card {
  display: flex;
  flex-direction: column;
  min-height: 400px;
}
.grid-3-2col > .card #weeklyChart {
  flex: 1;
  min-height: 240px;
}
.grid-3-2col > .card > div:last-child {
  flex: 1;
}

/* ---- SETTINGS PAGE ---- */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 16px;
  align-items: stretch;
}

/* Left profile card — grows to match right column height */
.settings-profile-card {
  min-height: 0;
  height: 100%;
  box-sizing: border-box;
}

/* Right column */
.settings-right-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Security & Appearance panels fill the right column evenly */
.settings-right-col .settings-panel {
  flex: 1 1 auto;
}

/* Profile avatar section — compact, centered */
.profile-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-bottom: 16px;
  text-align: center;
}

/* Avatar action buttons row */
.avatar-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

/* Divider inside card */
.settings-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0 0 16px;
}

/* Profile form fields */
.settings-form-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

/* Section header inside a card (Security, Appearance) */
.settings-section-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* Each row inside Security / Appearance cards */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
}
.settings-row + .settings-row {
  border-top: 1px solid var(--border);
}
.settings-row:hover {
  background: var(--bg-main);
}

/* Icon + label group inside a settings row */
.settings-row-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.settings-row-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.settings-row-text {
  min-width: 0;
}
.settings-row-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
}
.settings-row-sub {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Compact card variant for settings panels */
.settings-panel {
  padding: 0;
  overflow: hidden;
}

/* ---- TABS ---- */
.tab-bar {
  display: flex; gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: 11px 18px; font-size: 14px; font-weight: 600;
  color: var(--text-muted); border: none; background: none;
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all 0.2s;
  font-family: 'Manrope', sans-serif;
  display: flex; align-items: center; gap: 8px;
  white-space: nowrap; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.tab-btn:hover { color: var(--text-main); }
.tab-btn.active { color: var(--aqua); border-bottom-color: var(--aqua); }
.tab-count {
  background: var(--amber-bg); color: var(--amber-text);
  font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 999px;
}

/* ---- MODALS ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
  opacity: 0; visibility: hidden;
  transition: all 0.25s ease;
}
.modal-overlay.open { opacity: 1; visibility: visible; }

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 28px 24px;
  width: 100%;
  max-width: 100%;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  border-bottom: none;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 92vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: calc(24px + var(--safe-bottom));
}

/* drag handle for mobile sheet feel */
.modal::before {
  content: '';
  display: block;
  width: 36px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 20px;
}

.modal-overlay.open .modal { transform: translateY(0); }
.modal-title { font-size: 19px; font-weight: 700; margin-bottom: 8px; color: var(--text-main); }
.modal-body { color: var(--text-muted); font-size: 15px; margin-bottom: 24px; }
.modal-actions { display: flex; flex-direction: column-reverse; gap: 10px; }
.modal-actions .btn { width: 100%; justify-content: center; }

/* Refiller order modal scoped on desktop */
#orderActionModal {
  left: var(--sidebar-w);
}

/* ---- ALERTS ---- */
.alert {
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.alert .material-symbols-outlined { flex-shrink: 0; font-size: 18px; margin-top: 1px; }
.alert-success {
  background: rgba(16,185,129,0.1);
  color: #065f46;
  border-color: rgba(16,185,129,0.3);
}
[data-theme="dark"] .alert-success {
  background: rgba(16,185,129,0.12);
  color: #6ee7b7;
  border-color: rgba(16,185,129,0.25);
}
.alert-error {
  background: rgba(239,68,68,0.08);
  color: #991b1b;
  border-color: rgba(239,68,68,0.25);
}
[data-theme="dark"] .alert-error {
  background: rgba(239,68,68,0.12);
  color: #fca5a5;
  border-color: rgba(239,68,68,0.25);
}
.alert-warning {
  background: rgba(245,158,11,0.09);
  color: #92400e;
  border-color: rgba(245,158,11,0.3);
}
[data-theme="dark"] .alert-warning {
  background: rgba(245,158,11,0.12);
  color: #fcd34d;
  border-color: rgba(245,158,11,0.25);
}
.alert-info {
  background: rgba(99,102,241,0.08);
  color: #3730a3;
  border-color: rgba(99,102,241,0.25);
}
[data-theme="dark"] .alert-info {
  background: rgba(99,102,241,0.14);
  color: #a5b4fc;
  border-color: rgba(99,102,241,0.3);
}

/* ---- SEARCH BAR ---- */
.search-bar { position: relative; display: flex; align-items: center; }
.search-bar .material-symbols-outlined { position: absolute; left: 12px; color: var(--text-muted); font-size: 20px; pointer-events: none; }
.search-bar input {
  padding-left: 40px; height: 42px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 14px; font-family: 'Manrope', sans-serif;
  background: var(--bg-card); width: 100%; transition: all 0.2s;
  color: var(--text-main);
}
.search-bar input:focus { outline: none; border-color: var(--aqua); background: var(--bg-card); }

/* ---- TOGGLE ---- */
.toggle-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.toggle {
  width: 52px; height: 28px; background: #cbd5e1;
  border-radius: 999px; position: relative;
  cursor: pointer; border: none; transition: background 0.3s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  flex-shrink: 0;
}
.toggle.on { background: var(--green); }
.toggle::after {
  content: ''; position: absolute;
  width: 22px; height: 22px; background: white;
  border-radius: 50%; top: 3px; left: 3px;
  transition: transform 0.3s; box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.toggle.on::after { transform: translateX(24px); }

/* ---- AVATAR ---- */
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; flex-shrink: 0;
}

/* ---- PROFILE AVATAR SECTION (Settings page) ---- */
.profile-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-bottom: 20px;
  text-align: center;
}

.profile-avatar-wrapper {
  position: relative;
  width: 96px;
  height: 96px;
  flex-shrink: 0;
}

.profile-avatar-img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--aqua);
  box-shadow: 0 4px 14px rgba(0,194,255,0.25);
  display: block;
}

.profile-avatar-placeholder {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--aqua);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 800;
  border: 3px solid var(--aqua);
  box-shadow: 0 4px 14px rgba(0,194,255,0.25);
  letter-spacing: 1px;
}

.avatar-edit-btn {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid var(--bg-card);
  transition: background 0.2s, transform 0.15s;
  z-index: 2;
}
.avatar-edit-btn:hover {
  background: var(--aqua);
  color: var(--navy);
  transform: scale(1.1);
}

.profile-avatar-info {
  min-width: 0;
  width: 100%;
}

/* ---- STATUS BANNER ---- */
.status-banner {
  padding: 16px 20px; border-radius: var(--radius);
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 24px;
}
.status-banner.approved { background: var(--green-bg); border-left: 4px solid var(--green); color: var(--green-text); }
.status-banner.pending  { background: var(--amber-bg); border-left: 4px solid var(--amber); color: var(--amber-text); }
.status-banner.rejected { background: var(--red-bg);   border-left: 4px solid var(--red);   color: var(--red-text); }

/* ---- STATION CARD ---- */
.station-card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  overflow: hidden; border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); transition: box-shadow 0.2s, transform 0.2s;
}
.station-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.station-card-img { width: 100%; height: 160px; object-fit: cover; background: var(--bg-main); }
.station-card-body { padding: 18px; }
.station-card-name { font-size: 16px; font-weight: 700; margin-bottom: 6px; color: var(--navy); }
.station-card-addr { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; margin-bottom: 12px; }

/* ---- PAGINATION ---- */
.pagination { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.page-btn {
  width: 36px; height: 36px; border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--bg-card); font-size: 13px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; color: var(--text-main);
  font-family: 'Manrope', sans-serif;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.page-btn:hover { border-color: var(--aqua); color: var(--aqua); }
.page-btn.active { background: var(--aqua); color: #0A2540; border-color: var(--aqua); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---- LEAFLET ---- */
#map { width: 100%; height: 100%; min-height: 400px; }
.leaflet-tile { border: none !important; outline: none !important; }
.leaflet-container {
  background: #e8f0f8 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 1 !important;
}
[data-theme="dark"] .leaflet-container { background: #1a2035 !important; }
.leaflet-top.leaflet-left { top: 80px !important; bottom: auto !important; left: 16px !important; display: flex; flex-direction: column; z-index: 1000; }
.leaflet-bar { border: 1px solid var(--border) !important; box-shadow: var(--shadow-sm) !important; }
.leaflet-bar a { background-color: var(--bg-card) !important; color: var(--text-main) !important; border-bottom: 1px solid var(--border) !important; }

/* Map preview containers */
.map-preview-container {
  width: 100% !important;
  height: 100% !important;
  position: relative;
  z-index: 1;
  overflow: hidden;
  border-radius: 8px;
}

/* ---- UTILS ---- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; }
.mt-1 { margin-top: 4px; }  .mt-2 { margin-top: 8px; }  .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.w-full { width: 100%; } .text-sm { font-size: 13px; } .text-xs { font-size: 11px; }
.text-muted { color: var(--text-muted); } .font-bold { font-weight: 700; }
.hidden { display: none !important; } .relative { position: relative; }

/* ---- SPINNER / ANIM ---- */
.spinner { width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--aqua); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.3s ease forwards; }

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---- MOBILE MENU BUTTON ---- */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.mobile-menu-btn:active { background: var(--bg-main); }

/* ---- SIDEBAR OVERLAY ---- */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 199;
}
.sidebar-overlay.open { display: block; }

/* ---- CARD HEADER ROW ---- */
.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}
.card-header-row h2,
.card-header-row h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

/* ---- SECTION DIVIDER ---- */
.section-gap { margin-bottom: 20px; }

/* ============================================
   DESKTOP OVERRIDES — modals as centered dialogs
   ============================================ */
@media (min-width: 769px) {
  .modal-overlay {
    align-items: center;
    padding: 16px;
  }
  .modal {
    border-radius: var(--radius-xl);
    border-bottom: 1px solid var(--border);
    max-width: 480px;
    width: 100%;
    transform: translateY(20px) scale(0.98);
    padding: 32px;
    padding-bottom: 32px;
  }
  .modal::before { display: none; }
  .modal-overlay.open .modal { transform: translateY(0) scale(1); }
  .modal-actions { flex-direction: row; justify-content: flex-end; }
  .modal-actions .btn { width: auto; }
}

/* ============================================
   TABLET — max-width: 1024px
   ============================================ */
@media (max-width: 1024px) {
  /* Stat grid: 2 columns on tablet */
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}

/* ============================================
   MOBILE BREAKPOINT — max-width: 768px
   ============================================ */
@media (max-width: 768px) {

  /* ---- 1. SIDEBAR ---- */
  /* Slide fully off-screen; only reappear when .open is toggled */
  .sidebar {
    transform: translateX(-100%);
    z-index: 300;
    width: 270px;
    padding-top: var(--safe-top);
    will-change: transform;
  }
  .sidebar.open { transform: translateX(0); }

  /* Full-screen dark overlay behind sidebar */
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 299;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }
  .sidebar-overlay.open { display: block; }

  /* ---- 2. MAIN CONTENT ---- */
  /* Reset margin so content fills full viewport width */
  .main-content { margin-left: 0; }

  /* ---- 3. TOPBAR ---- */
  /* Reduce height and padding; show hamburger button */
  .topbar {
    padding: 0 12px;
    padding-top: var(--safe-top);
    height: calc(52px + var(--safe-top));
    gap: 8px;
  }
  .topbar-title {
    font-size: 14px;
    max-width: calc(100vw - 130px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
  }
  .topbar-actions {
    gap: 6px;
    flex-shrink: 0;
  }
  /* Hamburger visible on mobile, hidden on desktop (desktop rule above) */
  .mobile-menu-btn {
    display: flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
  }
  /* Theme toggle — keep tappable */
  .theme-toggle {
    width: 40px;
    height: 40px;
    min-width: 44px;
    min-height: 44px;
  }

  /* ---- 4. PAGE CONTENT ---- */
  /* Reduce padding so content doesn't press against edges */
  .page-content {
    padding: 14px;
    padding-bottom: calc(20px + var(--safe-bottom));
  }

  /* ---- 5. STAT / SUMMARY GRIDS ---- */
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card {
    padding: 14px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .stat-card .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
    margin-bottom: 0;
    border-radius: 10px;
    flex-shrink: 0;
  }
  .stat-card .stat-info { flex: 1; min-width: 0; }
  .stat-card .stat-value { font-size: 22px; line-height: 1.1; }
  .stat-card .stat-label { font-size: 10px; margin-bottom: 2px; }
  .stat-card .stat-sub   { font-size: 10px; margin-top: 2px; }

  /* Responsive grid helpers collapse to single column */
  .grid-2col,
  .grid-3-2col { grid-template-columns: 1fr; gap: 12px; }

  /* ---- 6. CARDS ---- */
  .card {
    padding: 14px 16px;
    border-radius: var(--radius);
  }
  /* Remove sticky hover transform on touch devices */
  @media (hover: none) {
    .card:hover {
      transform: none;
      box-shadow: var(--shadow-sm);
    }
  }

  /* ---- 7. TABLES ---- */
  /* Horizontal scroll wrapper is already .table-wrap in the markup;
     ensure the table itself has a min-width so columns don't collapse */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  table {
    font-size: 13px;
    min-width: 540px;
    white-space: nowrap;
  }
  th { padding: 10px 12px; font-size: 10px; white-space: nowrap; }
  td { padding: 10px 12px; white-space: nowrap; }

  /* ---- 8. MODALS — bottom sheet on mobile ---- */
  /* Default (mobile) behaviour is already bottom-sheet via the base styles;
     enforce it explicitly here for robustness */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .modal {
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border-bottom: none;
    width: 100%;
    max-width: 100%;
    padding: 24px 20px;
    padding-bottom: calc(24px + var(--safe-bottom));
    max-height: 92vh;
    transform: translateY(100%);
  }
  .modal-overlay.open .modal { transform: translateY(0); }
  .modal-actions { flex-direction: column-reverse; gap: 8px; }
  .modal-actions .btn { width: 100%; justify-content: center; }

  /* Order action modal: strip desktop sidebar offset */
  #orderActionModal { left: 0; }

  /* ---- 9. BUTTONS ---- */
  .btn {
    padding: 9px 16px;
    font-size: 13px;
    /* Ensure minimum tap target */
    min-height: 44px;
  }
  .btn-sm  { padding: 7px 12px; font-size: 12px; min-height: 36px; }
  .btn-lg  { padding: 12px 24px; font-size: 15px; }
  /* Full-width buttons still fill container */
  .btn-full { width: 100%; justify-content: center; }

  /* ---- 10. FORMS ---- */
  /* Inputs and selects fill full width on mobile */
  .form-input,
  .form-select {
    width: 100%;
    font-size: 16px; /* prevents iOS auto-zoom */
  }
  /* Stack any flex/grid side-by-side form rows */
  .form-row,
  .form-inline {
    flex-direction: column;
    gap: 12px;
  }
  .form-row > *,
  .form-inline > * { width: 100%; }

  /* ---- 11. PAGINATION ---- */
  .pagination {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .page-btn {
    width: 40px;
    height: 40px;
    min-width: 44px;
    min-height: 44px;
    font-size: 13px;
    flex-shrink: 0;
  }

  /* ---- 12. INLINE FLEX / ORDER / STATION CARDS ---- */
  /* Force multi-column flex rows to wrap; keep action buttons tappable */
  [style*="display:flex"],
  [style*="display: flex"] {
    flex-wrap: wrap;
  }
  /* Station card body: stack vertically */
  .station-card-body { padding: 14px; }
  .station-card-name { font-size: 15px; }
  .station-card-addr { font-size: 12px; }
  /* Action buttons: full minimum tap size */
  [style*="display:flex"] .btn,
  [style*="display: flex"] .btn {
    min-height: 44px;
  }

  /* ---- 13. TYPOGRAPHY ---- */
  /* Scale down page titles, stat values, and labels */
  h2 { font-size: 18px; }
  h3 { font-size: 15px; }
  .topbar-title { font-size: 14px; }

  /* ---- 15. TOUCH TARGETS ---- */
  /* Nav links: minimum 44px height */
  .nav-link {
    padding: 12px 14px;
    min-height: 44px;
  }
  .nav-link .material-symbols-outlined { font-size: 20px; }
  /* Tab bar buttons */
  .tab-btn {
    padding: 10px 14px;
    font-size: 13px;
    min-height: 44px;
  }
  /* Logout button */
  .logout-btn { min-height: 44px; }

  /* ---- MISC ---- */
  /* Card header rows: tighten but keep on one line */
  .card-header-row {
    flex-wrap: nowrap;
    gap: 8px;
    margin-bottom: 14px;
    align-items: center;
  }
  .card-header-row h2,
  .card-header-row h3 {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px !important;
  }
  .card-header-row > a,
  .card-header-row > .badge,
  .card-header-row > .btn {
    flex-shrink: 0;
  }
  .card-header-row .btn {
    font-size: 12px;
    padding: 7px 12px;
    min-height: 36px;
  }
  /* Section gap tighter */
  .section-gap { margin-bottom: 12px; }
  /* Dashboard greeting: hidden on mobile — rf-hero replaces it */
  .dashboard-greeting { display: none; }
  .dashboard-greeting .station-status-card { width: 100%; }
  /* Settings grid: stack profile above security/appearance on mobile */
  .settings-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .settings-profile-card { padding: 16px; }
  .settings-row { padding: 10px 14px; }
  .settings-section-header { padding: 10px 14px; }

  /* Charts: ensure readable minimum height */
  #signupChart,
  #weeklyChart { min-height: 160px; }

  /* Dashboard cards (Weekly Orders + Recent Orders): fill remaining screen */
  .grid-3-2col .card {
    min-height: 260px;
    display: flex;
    flex-direction: column;
  }
  .grid-3-2col .card > div:last-child {
    flex: 1;
  }
  #weeklyChart {
    flex: 1;
    min-height: 200px;
  }
  /* Toast: bottom-center */
  .toast-mobile-fix {
    bottom: 16px !important;
    left: 16px !important;
    right: 16px !important;
    width: calc(100% - 32px) !important;
    text-align: center;
    justify-content: center;
  }
  /* Status banner: stack on mobile */
  .status-banner {
    flex-wrap: wrap;
    padding: 12px 14px;
  }
  /* Alert: readable on small screens */
  .alert { font-size: 13px; padding: 11px 13px; gap: 8px; border-radius: 10px; }
  .alert .material-symbols-outlined { font-size: 16px; }
  /* Search bar: full width */
  .search-bar { width: 100%; }
  .search-bar input { width: 100%; font-size: 16px; }
  /* Btn-full-mobile helper */
  .btn-full-mobile { width: 100%; justify-content: center; }
}

/* ============================================
   VERY SMALL SCREENS — max-width: 400px
   ============================================ */
@media (max-width: 400px) {

  /* ---- 5. STAT GRIDS — 2 col, horizontal layout ---- */
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card { padding: 12px 10px; gap: 10px; }
  .stat-card .stat-icon { width: 34px; height: 34px; font-size: 17px; }
  .stat-card .stat-value { font-size: 18px; }
  .stat-card .stat-label { font-size: 10px; }

  /* ---- 6. CARDS ---- */
  .card { padding: 12px; border-radius: 10px; }

  /* ---- 8. MODALS — reduce padding on very small screens ---- */
  .modal { padding: 18px 14px; padding-bottom: calc(18px + var(--safe-bottom)); }
  .modal-title { font-size: 16px; }
  .modal-body  { font-size: 13px; }

  /* ---- 3. TOPBAR ---- */
  .topbar-title { font-size: 13px; max-width: calc(100vw - 110px); }

  /* ---- 13. TYPOGRAPHY ---- */
  h2 { font-size: 16px; }
  h3 { font-size: 14px; }

  /* ---- 11. PAGINATION ---- */
  .page-btn { width: 36px; height: 36px; min-width: 36px; min-height: 36px; font-size: 12px; }

  /* ---- 9. BUTTONS ---- */
  .btn { padding: 8px 14px; font-size: 12px; }

  /* ---- Nav links ---- */
  .nav-link { padding: 13px 14px; font-size: 14px; }
  .nav-link .material-symbols-outlined { font-size: 20px; }
}
/* ============================================================
   ORDERS PAGE — Semantic component classes
   (replaces inline styles for better responsive control)
   ============================================================ */

/* ── Page header row ── */
.orders-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

/* ── Branch filter pills ── */
.branch-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.branch-pill {
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.18s;
  white-space: nowrap;
}
.branch-pill.active {
  border-color: var(--aqua);
  background: rgba(0,194,255,0.1);
  color: var(--aqua);
}

/* ── Stats grid: 4-col desktop, 2x2 tablet/mobile ── */
.orders-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.orders-stat-card {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Tabs + search toolbar ── */
.orders-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.orders-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-main);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.orders-tabs::-webkit-scrollbar { display: none; }
.orders-tab {
  text-decoration: none;
  border-radius: 7px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.orders-tab.active {
  background: var(--bg-card);
  color: var(--navy);
  box-shadow: 0 1px 3px rgba(10,37,64,0.1);
}
.orders-tab-badge {
  background: #f59e0b;
  color: white;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  line-height: 16px;
}

/* ── Order card ── */
.order-card {
  background: var(--bg-card);
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* Card header */
.order-card-header {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.order-client-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.order-client-text { min-width: 0; }
.order-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--aqua);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}
.order-client-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.order-client-email {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Meta badges row */
.order-meta-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.order-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}
.order-type-badge.pickup  { background: rgba(99,102,241,0.1); color: #6366f1; }
.order-type-badge.delivery { background: rgba(0,194,255,0.1); color: var(--aqua-dark, #00a8d4); }
.order-branch-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-main);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.order-date-text {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.order-status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
  white-space: nowrap;
}
.order-payment-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

/* Details row */
.order-details-row {
  padding: 0 18px 14px;
  border-top: 1px solid var(--border);
}
.order-details-grid {
  display: flex;
  gap: 0;
  width: 100%;
  background: var(--bg-main);
  border-radius: 10px;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.order-detail-cell {
  flex: 1;
  padding: 10px 14px;
  border-right: 1px solid var(--border);
  min-width: 0;
}
.order-detail-cell:last-child { border-right: none; }
.order-detail-cell.order-detail-address { flex: 2; }
.order-detail-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
  white-space: nowrap;
}
.order-detail-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

/* Actions row */
.order-actions-row {
  padding: 0 18px 14px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* Mark as Paid button */
.btn-mark-paid {
  height: 38px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1.5px solid #10b981;
  background: rgba(16,185,129,0.08);
  color: #10b981;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Manrope', sans-serif;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-mark-paid:hover { background: rgba(16,185,129,0.18); }

/* Complete buttons */
.btn-complete {
  width: 100%;
  height: 38px;
  border-radius: 8px;
  border: none;
  color: white;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: 'Manrope', sans-serif;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.btn-complete:hover { opacity: 0.85; }
.btn-complete:disabled { cursor: not-allowed; opacity: 1; }
.btn-complete-delivery { background: #22c55e; }
.btn-complete-ready    { background: #6366f1; }
.btn-complete-pickup   { background: #0ea5e9; }

/* Cancel button */
.btn-cancel-order {
  height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Manrope', sans-serif;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-cancel-order:hover { border-color: #ef4444; color: #ef4444; }

/* Unpaid notice strip */
.order-unpaid-notice {
  margin: 0 18px 14px;
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: #d97706;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.4;
}

/* ============================================================
   ORDERS PAGE — RESPONSIVE OVERRIDES
   ============================================================ */

/* Tablet: 2×2 stats grid */
@media (max-width: 1024px) {
  .orders-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

/* Mobile: full responsive treatment */
@media (max-width: 768px) {

  /* Page header: stack vertically */
  .orders-page-header {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 10px;
  }

  /* Stats: 2-col grid */
  .orders-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 16px;
  }
  .orders-stat-card {
    padding: 12px;
    gap: 10px;
  }

  /* Toolbar: stack search below tabs */
  .orders-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 14px;
  }
  .orders-tabs {
    width: 100%;
  }
  .orders-tab {
    padding: 8px 12px;
    font-size: 12px;
    flex: 1;
    justify-content: center;
  }

  /* Card header: stack client + badges */
  .order-card-header {
    padding: 12px 14px;
    gap: 8px;
  }
  .order-client-info { flex: 1; min-width: 0; }
  .order-client-name { font-size: 13px; }
  .order-client-email { font-size: 11px; }

  /* Meta badges: wrap tightly */
  .order-meta-badges {
    width: 100%;
    gap: 5px;
  }
  .order-date-text { font-size: 10px; }
  .order-status-badge, .order-payment-badge { font-size: 10px; padding: 2px 7px; }

  /* Details grid: 2×2 on mobile */
  .order-details-row { padding: 0 14px 12px; }
  .order-details-grid {
    flex-wrap: wrap;
    border-radius: 8px;
  }
  .order-detail-cell {
    flex: 1 1 calc(50% - 1px);
    min-width: 0;
    padding: 9px 12px;
    box-sizing: border-box;
  }
  /* Address cell: full width on mobile */
  .order-detail-cell.order-detail-address {
    flex: 1 1 100%;
    border-right: none;
    border-top: 1px solid var(--border);
  }
  .order-detail-label { font-size: 9px; }
  .order-detail-value { font-size: 12px; }

  /* Actions: stack vertically on mobile */
  .order-actions-row {
    padding: 0 14px 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .btn-mark-paid {
    width: 100%;
    justify-content: center;
    height: 42px;
    font-size: 13px;
  }
  .btn-complete-wrap { flex: none; }
  .btn-complete {
    height: 42px;
    font-size: 13px;
  }
  .btn-cancel-order {
    width: 100%;
    justify-content: center;
    height: 42px;
    font-size: 13px;
  }

  /* Unpaid notice */
  .order-unpaid-notice {
    margin: 0 14px 12px;
    font-size: 11px;
  }

  /* Revenue card: compact */
  .orders-revenue-card {
    padding: 14px 16px;
  }
}

/* Very small screens */
@media (max-width: 400px) {
  .orders-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .orders-stat-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 10px 12px;
  }
  .orders-tab { padding: 7px 8px; font-size: 11px; }
  .order-card-header { padding: 10px 12px; }
  .order-details-row { padding: 0 12px 10px; }
  .order-actions-row { padding: 0 12px 10px; }
  .order-unpaid-notice { margin: 0 12px 10px; }
}
/* ============================================
   ADMIN DASHBOARD — SEMANTIC ROW CLASSES
   ============================================ */

/* User row in Recent Sign-Ups list */
.dash-user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-main);
  color: var(--text-main);
  min-width: 0;
}
.dash-user-info {
  flex: 1;
  min-width: 0;
}
.dash-user-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-user-meta {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-user-badge { flex-shrink: 0; }

/* Pending refiller row */
.dash-pending-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-main);
  border: 1px solid var(--amber-bg);
  gap: 10px;
  min-width: 0;
}
.dash-pending-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.dash-pending-text { min-width: 0; }
.dash-pending-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-pending-date { font-size: 11px; color: var(--text-muted); }
.dash-pending-row .btn { flex-shrink: 0; }

/* Shared list wrapper */
.dash-list { display: flex; flex-direction: column; gap: 8px; }

/* Mobile: prevent the global flex-wrap override from breaking these rows */
@media (max-width: 768px) {
  .dash-user-row,
  .dash-pending-row,
  .dash-pending-info {
    flex-wrap: nowrap !important;
  }

  /* Orders table on dashboard: tighter cells */
  .table-wrap table { min-width: 460px; }
  .table-wrap th { padding: 8px 10px; font-size: 10px; }
  .table-wrap td { padding: 9px 10px; font-size: 12px; }

  /* Chart: readable minimum */
  #signupChart { min-height: 140px; }
}
/* ═══════════════════════════════════════════════════════
   REFILLER DASHBOARD
   ═══════════════════════════════════════════════════════ */

/* ── Hero card (mobile only) ── */
.rf-hero {
  background: linear-gradient(135deg, #0a2540 0%, #0d3460 55%, #0077aa 100%);
  border-radius: var(--radius-lg);
  padding: 18px 16px 16px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}
.rf-hero::before {
  content: '';
  position: absolute;
  top: -36px; right: -36px;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: rgba(0,194,255,0.10);
  pointer-events: none;
}
.rf-hero::after {
  content: '';
  position: absolute;
  bottom: -50px; right: 16px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(0,194,255,0.06);
  pointer-events: none;
}
.rf-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.rf-hero-greeting {
  font-size: 10.5px;
  font-weight: 700;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.rf-hero-name {
  font-size: 19px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.rf-hero-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  margin-top: 3px;
}
.rf-hero-actions {
  display: flex;
  gap: 8px;
}
.rf-hero-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.18s;
  white-space: nowrap;
  min-width: 0;
}
.rf-hero-btn .material-symbols-outlined { font-size: 15px; flex-shrink: 0; }
.rf-hero-btn.primary {
  background: rgba(0,194,255,0.18);
  border: 1px solid rgba(0,194,255,0.32);
  color: #00C2FF;
}
.rf-hero-btn.primary:active { background: rgba(0,194,255,0.30); }
.rf-hero-btn.secondary {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.72);
}
.rf-hero-btn.secondary:active { background: rgba(255,255,255,0.14); }

/* ── Alert banner (mobile) ── */
.rf-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.5;
}
.rf-alert .material-symbols-outlined { font-size: 17px; flex-shrink: 0; margin-top: 1px; }
.rf-alert.info    { background: #dbeafe; color: #1e40af; border: 1px solid rgba(59,130,246,0.18); }
.rf-alert.warning { background: var(--amber-bg); color: var(--amber-text); border: 1px solid rgba(245,158,11,0.20); }
.rf-alert.error   { background: var(--red-bg);   color: var(--red-text);   border: 1px solid rgba(239,68,68,0.18); }
.rf-alert a       { font-weight: 700; color: inherit; text-decoration: underline; }

/* ── Stat grid — 2×2 on mobile, 4-col on desktop ── */
.rf-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.rf-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 13px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.rf-stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.rf-stat-card.blue::before  { background: #3b82f6; }
.rf-stat-card.green::before { background: #22c55e; }
.rf-stat-card.amber::before { background: #f59e0b; }
.rf-stat-card.aqua::before  { background: #00C2FF; }
.rf-stat-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
}
.rf-stat-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.2;
}
.rf-stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', sans-serif;
  line-height: 1;
  letter-spacing: -0.5px;
}
.rf-stat-value.sm { font-size: 17px; letter-spacing: -0.3px; }

/* ── Section header ── */
.rf-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 11px;
}
.rf-section-head h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}
.rf-section-head a {
  font-size: 12px;
  font-weight: 700;
  color: var(--aqua);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 2px;
}
.rf-section-head a .material-symbols-outlined { font-size: 14px; }

/* ── Chart card ── */
.rf-chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 16px 12px;
  margin-bottom: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  position: relative;
  overflow: hidden;
}
.rf-chart-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #00C2FF, #0077aa);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
#weeklyChart {
  width: 100%;
  height: 160px;
  display: block;
  overflow: visible;
}

/* ── Orders card ── */
.rf-orders-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 14px 6px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}
.rf-orders-list {
  display: block;
  width: 100%;
}
.rf-order-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.rf-order-row:last-child { border-bottom: none; padding-bottom: 4px; }
.rf-order-avatar {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #00C2FF, #0077aa);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.rf-order-info { flex: 1; min-width: 0; }
.rf-order-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rf-order-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.rf-order-meta .material-symbols-outlined { font-size: 11px; }
.rf-order-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  flex-shrink: 0;
  white-space: nowrap;
}
.rf-order-badge.completed { background: var(--green-bg); color: var(--green-text); }
.rf-order-badge.pending   { background: var(--amber-bg); color: var(--amber-text); }
.rf-order-badge.cancelled { background: var(--red-bg);   color: var(--red-text); }

/* ── Empty state ── */
.rf-empty {
  text-align: center;
  padding: 28px 16px 20px;
  color: var(--text-muted);
}
.rf-empty .material-symbols-outlined {
  font-size: 38px;
  display: block;
  margin-bottom: 7px;
  opacity: 0.30;
}
.rf-empty p { font-size: 12.5px; }

/* ── Bottom grid: stacked mobile, side-by-side desktop ── */
.rf-bottom-grid { display: block; }

/* ── Desktop overrides ── */
@media (min-width: 769px) {
  .rf-hero         { display: none; }
  .rf-alert-mobile { display: none; }

  .rf-stat-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
    flex-shrink: 0;
  }
  .rf-stat-card  { padding: 20px 18px 16px; }
  .rf-stat-value { font-size: 30px; }
  .rf-stat-value.sm { font-size: 21px; }

  /* Dashboard greeting and stat grid must not grow — only rf-bottom-grid should */
  .dashboard-greeting { flex-shrink: 0; }

  /* Bottom grid fills all remaining vertical space in the page */
  .rf-bottom-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 16px;
    align-items: stretch;
    flex: 1 1 auto;
    min-height: 0;
  }

  /* Both cards are flex columns that stretch to the grid row height */
  .rf-chart-card,
  .rf-orders-card {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    /* min-height ensures cards are always tall even with sparse data */
    min-height: 420px;
  }

  /* Section head is fixed height */
  .rf-chart-card > .rf-section-head,
  .rf-orders-card > .rf-section-head { flex-shrink: 0; }

  /* Chart div grows to fill the card — JS reads clientHeight from this */
  .rf-chart-card #weeklyChart {
    flex: 1 1 auto;
    /* explicit min-height so clientHeight is non-zero before flex resolves */
    min-height: 340px;
    height: 100%;
    width: 100%;
    display: block;
    overflow: visible;
  }

  /* Orders list wrapper grows but content stays top-aligned */
  .rf-orders-card > .rf-orders-list {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-content: flex-start;
    overflow-y: auto;
  }

  /* Empty state centres itself inside the stretched card */
  .rf-orders-card > .rf-empty {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
  }
}

/* ═══════════════════════════════════════════════════════
   REFILLER STATION PAGE
   ═══════════════════════════════════════════════════════ */

/* ── Page header ── */
.st-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.st-page-head h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 3px;
}
.st-page-head p {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Summary stat strip ── */
.st-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.st-summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}
.st-summary-icon {
  width: 44px; height: 44px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 24px;
}
.st-summary-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}
.st-summary-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', sans-serif;
  line-height: 1;
}

/* ── Section title row ── */
.st-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.st-section-head h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

/* ── Branch gallery grid ── */
.st-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* ── Branch card ── */
.st-branch-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}
.st-branch-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.st-branch-img {
  height: 170px;
  position: relative;
  overflow: hidden;
  background: var(--bg-main);
  flex-shrink: 0;
}
.st-branch-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.st-branch-status-badge {
  position: absolute;
  top: 10px; right: 10px;
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid transparent;
}
.st-branch-status-badge .material-symbols-outlined { font-size: 13px; }
.st-branch-status-badge.approved { color: #10b981; border-color: rgba(16,185,129,0.35); }
.st-branch-status-badge.pending  { color: #f59e0b; border-color: rgba(245,158,11,0.35); }
.st-branch-status-badge.rejected { color: #ef4444; border-color: rgba(239,68,68,0.35); }

.st-branch-body {
  padding: 16px 16px 4px;
  flex: 1;
}
.st-branch-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.st-branch-label {
  display: inline-block;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-main);
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.st-branch-address {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.4;
}
.st-branch-address .material-symbols-outlined { font-size: 14px; margin-top: 1px; flex-shrink: 0; }

/* Payment badges */
.st-payment-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 12px;
}
.st-payment-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}

/* Stats mini-row inside card */
.st-branch-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--bg-main);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
}
.st-branch-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.st-branch-stat-value {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.st-branch-stats > div:last-child {
  text-align: right;
}

/* Toggle row */
.st-toggle-row {
  margin: 0 16px 14px;
  padding: 11px 13px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1.5px solid var(--border);
  background: var(--bg-main);
  transition: background 0.25s, border-color 0.25s;
}
.st-toggle-row.open {
  background: rgba(16,185,129,0.07);
  border-color: #10b981;
}
.st-toggle-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}
.st-toggle-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  transition: background 0.25s;
  flex-shrink: 0;
}
.st-toggle-row.open .st-toggle-status { color: #065f46; }
.st-toggle-row.open .st-toggle-dot    { background: #10b981; }
.st-toggle-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.st-toggle-verb {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Reason banners inside card */
.st-reason-banner {
  margin: 0 16px 12px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid transparent;
}
.st-reason-banner .material-symbols-outlined { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.st-reason-banner.warning {
  background: rgba(245,158,11,0.09);
  border-color: rgba(245,158,11,0.3);
  color: #92400e;
}
[data-theme="dark"] .st-reason-banner.warning {
  background: rgba(245,158,11,0.12);
  border-color: rgba(245,158,11,0.3);
  color: #fcd34d;
}
.st-reason-banner.error {
  background: rgba(239,68,68,0.08);
  border-color: rgba(239,68,68,0.25);
  color: #991b1b;
}
[data-theme="dark"] .st-reason-banner.error {
  background: rgba(239,68,68,0.12);
  border-color: rgba(239,68,68,0.25);
  color: #fca5a5;
}
.st-reason-banner.info {
  background: rgba(245,158,11,0.09);
  border-color: rgba(245,158,11,0.3);
  color: #92400e;
}
[data-theme="dark"] .st-reason-banner.info {
  background: rgba(245,158,11,0.12);
  border-color: rgba(245,158,11,0.3);
  color: #fcd34d;
}

/* Card footer actions */
.st-branch-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-main);
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.st-btn-edit {
  flex: 1;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 9px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}
.st-btn-edit:hover { background: var(--bg-main); border-color: var(--navy); }
.st-btn-edit .material-symbols-outlined { font-size: 16px; }
.st-btn-delete {
  width: 38px; height: 38px;
  border-radius: 9px;
  background: var(--red-bg);
  color: var(--red-text);
  border: 1.5px solid transparent;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.18s;
}
.st-btn-delete:hover { background: #fca5a5; }
.st-btn-delete .material-symbols-outlined { font-size: 18px; }

/* ── Station form modal ── */
.st-modal {
  max-width: 680px;
  width: 100%;
  padding: 0 !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 92vh;
}
.st-modal-header {
  padding: 20px 24px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.st-modal-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}
.st-modal-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--bg-main);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.18s;
}
.st-modal-close:hover { background: var(--red-bg); color: var(--red-text); }
.st-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}
.st-modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  background: var(--bg-card);
}

/* Form section divider */
.st-form-section {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.st-form-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.st-form-section-title {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}
.st-form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Payment method cards */
.payment-defaults-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(16,185,129,0.07);
  border: 1.5px solid rgba(16,185,129,0.25);
  border-radius: 10px;
  margin-bottom: 4px;
}
.payment-toggle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.payment-method-card {
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 13px 12px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--bg-card);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  user-select: none;
}
.payment-method-card.selected {
  border-color: var(--aqua);
  background: rgba(0,194,255,0.05);
}
.payment-method-card input[type=checkbox] {
  accent-color: var(--aqua);
  width: 16px; height: 16px;
  margin-top: 2px;
  flex-shrink: 0;
}
.payment-method-icon { font-size: 20px; flex-shrink: 0; }
.payment-method-label { font-size: 13px; font-weight: 700; color: var(--text-main); }
.payment-method-sub   { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.payment-extra-field {
  margin-top: 12px;
  padding: 14px;
  background: var(--bg-main);
  border-radius: 10px;
  border: 1px solid var(--border);
}

/* QR drop zone */
.qr-dropzone {
  border: 2px dashed var(--aqua);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  background: rgba(0,194,255,0.04);
  transition: background 0.2s;
}
.qr-dropzone:hover { background: rgba(0,194,255,0.09); }
.qr-preview-wrap {
  display: none;
  margin-top: 10px;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  height: 100px;
  border: 2px solid var(--aqua);
}
.qr-preview-wrap img { width:100%;height:100%;object-fit:contain;background:#fff; }
.qr-clear-btn {
  position: absolute;
  top: 5px; right: 5px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,0.65);
  border: none; color: white;
  cursor: pointer; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}

/* Editing notice banner */
.st-edit-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 11px 13px;
  background: #fef3c7;
  border: 1px solid var(--amber, #f59e0b);
  border-radius: 8px;
  color: #92400e;
  font-size: 12px;
  margin-bottom: 16px;
}
.st-edit-notice .material-symbols-outlined { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

/* Inline form error */
.st-modal-error {
  display: none;
  margin-bottom: 14px;
  padding: 11px 13px;
  background: var(--red-bg);
  border: 1px solid #fca5a5;
  border-radius: 8px;
  color: var(--red-text);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.st-modal-error .material-symbols-outlined { font-size: 16px; flex-shrink: 0; }

/* ── Map picker in modal ── */
#pickMap {
  height: 280px !important;
  width: 100% !important;
  display: block !important;
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  background: #e8f0f8;
}
#pickMap .leaflet-container { height: 100% !important; width: 100% !important; }

/* ── Empty state ── */
.st-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}
.st-empty .material-symbols-outlined {
  font-size: 56px;
  display: block;
  margin-bottom: 14px;
  color: var(--border);
}
.st-empty h4 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.st-empty p  { font-size: 14px; margin-bottom: 20px; }

/* ── Mobile overrides ── */
@media (max-width: 768px) {
  .st-page-head { align-items: flex-start; }
  .st-page-head > div { flex: 1; min-width: 0; }
  .st-page-head h2 { font-size: 18px; }
  .st-page-head .btn {
    font-size: 12px;
    padding: 9px 14px;
    height: auto;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 2px;
  }

  .st-summary {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .st-summary-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 10px;
  }
  .st-summary-icon { width: 36px; height: 36px; font-size: 20px; border-radius: 9px; }
  .st-summary-value { font-size: 20px; }
  .st-summary-label { font-size: 9px; }

  .st-gallery { grid-template-columns: 1fr; gap: 14px; }
  .st-branch-img { height: 150px; }

  .st-form-row-2 { grid-template-columns: 1fr; gap: 10px; }
  .payment-toggle-grid { grid-template-columns: 1fr 1fr; }

  .st-modal-header { padding: 16px 16px 14px; }
  .st-modal-body   { padding: 16px; }
  .st-modal-footer { padding: 12px 16px; }

  #pickMap { height: 240px !important; }
}

@media (max-width: 400px) {
  .payment-toggle-grid { grid-template-columns: 1fr; }
  .st-summary { grid-template-columns: 1fr 1fr 1fr; }
}

/* =============================================
   Modern SaaS Landing Page
   ============================================= */
.landing-body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(110deg, rgba(0,194,255,0.09) 0 1px, transparent 1px 118px),
    linear-gradient(180deg, rgba(250,253,255,1), rgba(232,248,255,0.9) 45%, rgba(247,250,252,1));
}

[data-theme="dark"] .landing-body {
  background:
    linear-gradient(110deg, rgba(56,189,248,0.08) 0 1px, transparent 1px 118px),
    linear-gradient(180deg, #08111c, #0b1824 45%, #0d1117);
}

.landing-shell {
  position: relative;
  min-height: 100vh;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 34px;
}

.glass-panel {
  background: rgba(255,255,255,0.68);
  border: 1px solid rgba(148,163,184,0.28);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(10,37,64,0.10);
  backdrop-filter: blur(22px) saturate(155%);
  -webkit-backdrop-filter: blur(22px) saturate(155%);
}

[data-theme="dark"] .glass-panel {
  background: rgba(16,25,38,0.68);
  border-color: rgba(148,163,184,0.18);
  box-shadow: 0 20px 54px rgba(0,0,0,0.34);
}

.landing-nav {
  position: sticky;
  top: 16px;
  z-index: 20;
  min-height: 70px;
  padding: 12px 14px 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.landing-brand {
  display: inline-flex;
  align-items: center;
  min-width: 146px;
}

.landing-logo {
  height: 42px;
  width: auto;
  object-fit: contain;
}

.landing-logo-light { display: block; }
.landing-logo-dark { display: none; }
[data-theme="dark"] .landing-logo-light { display: none; }
[data-theme="dark"] .landing-logo-dark { display: block; }

.landing-links {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 8px;
  background: rgba(255,255,255,0.38);
}

[data-theme="dark"] .landing-links {
  background: rgba(255,255,255,0.04);
}

.landing-links a {
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 800;
}

.landing-links a:hover {
  color: var(--text-main);
  background: rgba(0,194,255,0.10);
}

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

.landing-theme,
.landing-login,
.landing-cta {
  height: 42px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  border: 1px solid rgba(148,163,184,0.28);
}

.landing-theme {
  width: 42px;
  color: var(--text-main);
  background: rgba(255,255,255,0.52);
  cursor: pointer;
}

[data-theme="dark"] .landing-theme {
  background: rgba(255,255,255,0.06);
}

.landing-login {
  padding: 0 16px;
  color: var(--text-main);
  background: rgba(255,255,255,0.36);
  font-size: 13px;
}

.landing-cta {
  gap: 6px;
  padding: 0 16px;
  background: #0A2540;
  color: #fff;
  border-color: #0A2540;
  font-size: 13px;
}

[data-theme="dark"] .landing-cta {
  background: var(--aqua);
  color: #062033;
  border-color: var(--aqua);
}

.landing-hero {
  position: relative;
  min-height: calc(100vh - 116px);
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.88fr);
  align-items: center;
  gap: 54px;
  padding: 58px 0 34px;
}

.landing-water-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.water-line {
  position: absolute;
  left: 50%;
  width: 78vw;
  max-width: 980px;
  height: 190px;
  border: 1px solid rgba(0,194,255,0.15);
  border-color: rgba(0,194,255,0.16) transparent transparent transparent;
  border-radius: 50%;
  transform: translateX(-50%) rotate(-4deg);
}

.water-line-1 { top: 12%; }
.water-line-2 { top: 28%; width: 68vw; transform: translateX(-48%) rotate(3deg); }
.water-line-3 { bottom: 2%; width: 88vw; transform: translateX(-52%) rotate(2deg); }

.water-grid {
  position: absolute;
  right: -90px;
  top: 18%;
  width: 430px;
  height: 560px;
  background-image:
    linear-gradient(rgba(0,194,255,0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,194,255,0.09) 1px, transparent 1px);
  background-size: 34px 34px;
  transform: perspective(800px) rotateY(-22deg) rotateZ(5deg);
  mask-image: linear-gradient(to bottom, transparent, #000 20%, #000 75%, transparent);
}

.hero-copy,
.hero-visual {
  position: relative;
  z-index: 1;
}

.hero-kicker {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  margin-bottom: 18px;
  color: #075985;
  font-size: 13px;
  font-weight: 800;
}

[data-theme="dark"] .hero-kicker {
  color: #7dd3fc;
}

.hero-kicker .material-symbols-outlined {
  font-size: 18px;
  color: #10b981;
}

.hero-copy h1 {
  max-width: 760px;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 1.02;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 22px;
}

.hero-lede {
  max-width: 630px;
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
}

.hero-primary,
.hero-secondary {
  min-height: 52px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  font-size: 15px;
  font-weight: 800;
}

.hero-primary {
  background: #0A2540;
  color: #fff;
  box-shadow: 0 18px 36px rgba(10,37,64,0.22);
}

[data-theme="dark"] .hero-primary {
  background: var(--aqua);
  color: #062033;
}

.hero-secondary {
  color: var(--text-main);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 570px;
}

.hero-metrics div {
  padding: 14px 16px;
  border-radius: 8px;
  background: rgba(255,255,255,0.46);
  border: 1px solid rgba(148,163,184,0.22);
}

[data-theme="dark"] .hero-metrics div {
  background: rgba(255,255,255,0.045);
}

.hero-metrics strong {
  display: block;
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 24px;
  line-height: 1;
  margin-bottom: 5px;
}

.hero-metrics span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.hero-visual {
  min-height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dashboard-glass {
  width: min(100%, 460px);
  padding: 18px;
  border-radius: 8px;
}

.dash-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.dash-eyebrow {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.dash-top h2 {
  color: var(--text-main);
  font-size: 22px;
  margin-top: 2px;
}

.dash-status {
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(16,185,129,0.12);
  color: #059669;
  font-size: 12px;
  font-weight: 900;
}

.dash-map {
  position: relative;
  height: 260px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(148,163,184,0.24);
  background:
    linear-gradient(0deg, rgba(15,118,110,0.08) 0 1px, transparent 1px 42px),
    linear-gradient(90deg, rgba(14,165,233,0.08) 0 1px, transparent 1px 42px),
    linear-gradient(135deg, rgba(224,242,254,0.76), rgba(240,253,250,0.74));
}

[data-theme="dark"] .dash-map {
  background:
    linear-gradient(0deg, rgba(14,165,233,0.08) 0 1px, transparent 1px 42px),
    linear-gradient(90deg, rgba(20,184,166,0.08) 0 1px, transparent 1px 42px),
    linear-gradient(135deg, rgba(8,47,73,0.7), rgba(19,78,74,0.46));
}

.map-route {
  position: absolute;
  left: 18%;
  top: 52%;
  width: 68%;
  height: 46%;
  border-top: 3px solid rgba(0,194,255,0.72);
  border-right: 3px solid rgba(16,185,129,0.62);
  border-radius: 0 80px 0 0;
  transform: rotate(-10deg);
}

.pin {
  position: absolute;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(0,194,255,0.35);
  box-shadow: 0 12px 24px rgba(10,37,64,0.14);
}

[data-theme="dark"] .pin {
  background: rgba(15,23,42,0.86);
}

.pin i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--aqua);
}

.pin-a { left: 14%; top: 26%; }
.pin-b { right: 18%; top: 38%; }
.pin-c { left: 46%; bottom: 18%; border-color: rgba(16,185,129,0.38); }
.pin-c i { background: #10b981; }

.dash-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.dash-stats div {
  min-height: 108px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.52);
  border: 1px solid rgba(148,163,184,0.22);
}

[data-theme="dark"] .dash-stats div {
  background: rgba(255,255,255,0.05);
}

.dash-stats .material-symbols-outlined {
  font-size: 23px;
  color: var(--aqua);
  margin-bottom: 12px;
}

.dash-stats strong,
.dash-stats small {
  display: block;
}

.dash-stats strong {
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 22px;
  line-height: 1.1;
}

.dash-stats small {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
}

.floating-order {
  position: absolute;
  right: 0;
  bottom: 92px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(280px, 76%);
  padding: 12px 14px;
}

.floating-order .material-symbols-outlined {
  color: #10b981;
  font-size: 26px;
}

.floating-order strong,
.floating-order small {
  display: block;
}

.floating-order strong {
  color: var(--text-main);
  font-size: 14px;
}

.floating-order small {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.landing-feature-band {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 6px 0 22px;
}

.feature-tile {
  padding: 18px;
  min-height: 190px;
}

.feature-tile .material-symbols-outlined {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(0,194,255,0.12);
  color: #0369a1;
  font-size: 23px;
  margin-bottom: 16px;
}

[data-theme="dark"] .feature-tile .material-symbols-outlined {
  color: #7dd3fc;
}

.feature-tile h3 {
  color: var(--text-main);
  font-size: 17px;
  margin-bottom: 8px;
}

.feature-tile p {
  font-size: 14px;
  line-height: 1.65;
}

@media (max-width: 980px) {
  .landing-hero {
    grid-template-columns: 1fr;
    gap: 22px;
    padding-top: 42px;
  }

  .hero-copy h1 {
    max-width: 820px;
  }

  .hero-visual {
    min-height: 440px;
    justify-content: flex-start;
  }

  .dashboard-glass {
    max-width: 620px;
  }

  .floating-order {
    left: min(330px, 40%);
    right: auto;
    bottom: 44px;
  }

  .landing-feature-band {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .landing-shell {
    width: min(100% - 22px, 560px);
    padding-top: 12px;
  }

  .landing-nav {
    top: 10px;
    min-height: auto;
    flex-wrap: wrap;
    padding: 10px;
  }

  .landing-brand {
    min-width: 0;
    flex: 1;
  }

  .landing-logo {
    height: 36px;
  }

  .landing-links {
    order: 3;
    width: 100%;
    justify-content: space-between;
    overflow-x: auto;
  }

  .landing-links a {
    flex: 1;
    text-align: center;
    white-space: nowrap;
  }

  .landing-login {
    display: none;
  }

  .landing-cta {
    width: 42px;
    padding: 0;
  }

  .landing-cta span:first-child {
    display: none;
  }

  .landing-hero {
    min-height: auto;
    padding: 34px 0 26px;
  }

  .hero-copy h1 {
    font-size: 42px;
  }

  .hero-lede {
    font-size: 15px;
  }

  .hero-buttons {
    align-items: stretch;
  }

  .hero-primary,
  .hero-secondary {
    flex: 1 1 100%;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 0;
    display: block;
  }

  .dashboard-glass {
    width: 100%;
    padding: 12px;
  }

  .dash-map {
    height: 220px;
  }

  .dash-stats {
    grid-template-columns: 1fr;
  }

  .dash-stats div {
    min-height: 82px;
  }

  .floating-order {
    position: relative;
    left: auto;
    bottom: auto;
    width: 100%;
    margin-top: 12px;
  }

  .feature-tile {
    min-height: 0;
  }
}

@media (max-width: 720px) {
  .landing-body {
    background:
      linear-gradient(115deg, rgba(0,194,255,0.08) 0 1px, transparent 1px 72px),
      linear-gradient(180deg, rgba(248,253,255,1), rgba(229,247,255,0.88) 48%, rgba(248,250,252,1));
  }

  [data-theme="dark"] .landing-body {
    background:
      linear-gradient(115deg, rgba(56,189,248,0.07) 0 1px, transparent 1px 72px),
      linear-gradient(180deg, #07131d, #0a1a27 52%, #0b1119);
  }

  .landing-shell {
    width: min(100% - 20px, 430px);
    padding: 10px 0 24px;
  }

  .landing-nav {
    top: 8px;
    gap: 8px;
    padding: 8px;
    border-radius: 10px;
  }

  .landing-logo {
    height: 30px;
    max-width: 126px;
  }

  .landing-theme,
  .landing-cta {
    width: 38px;
    height: 38px;
    border-radius: 8px;
  }

  .landing-links {
    gap: 4px;
    padding: 3px;
    border-radius: 8px;
  }

  .landing-links a {
    padding: 7px 8px;
    font-size: 11px;
  }

  .landing-hero {
    gap: 18px;
    padding: 24px 0 18px;
  }

  .hero-kicker {
    max-width: 100%;
    padding: 7px 10px;
    margin-bottom: 12px;
    gap: 6px;
    font-size: 11px;
    line-height: 1.25;
  }

  .hero-kicker .material-symbols-outlined {
    font-size: 15px;
  }

  .hero-copy h1 {
    max-width: 390px;
    font-size: clamp(30px, 9vw, 36px);
    line-height: 1.08;
    margin-bottom: 12px;
  }

  .hero-lede {
    max-width: 390px;
    font-size: 13px;
    line-height: 1.58;
    margin-bottom: 18px;
  }

  .hero-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin-bottom: 16px;
  }

  .hero-primary,
  .hero-secondary {
    min-height: 42px;
    padding: 0 10px;
    font-size: 12px;
    border-radius: 8px;
  }

  .hero-primary .material-symbols-outlined,
  .hero-secondary .material-symbols-outlined {
    font-size: 16px;
  }

  .hero-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    max-width: 100%;
    padding: 6px;
    border: 1px solid rgba(148,163,184,0.22);
    border-radius: 10px;
    background: rgba(255,255,255,0.52);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  [data-theme="dark"] .hero-metrics {
    background: rgba(15,23,42,0.48);
    border-color: rgba(125,211,252,0.16);
  }

  .hero-metrics div {
    min-height: 58px;
    padding: 8px 6px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    display: grid;
    place-items: center;
    align-content: center;
    text-align: center;
    box-shadow: none;
  }

  .hero-metrics div + div {
    border-left: 1px solid rgba(148,163,184,0.22);
  }

  [data-theme="dark"] .hero-metrics div + div {
    border-left-color: rgba(125,211,252,0.15);
  }

  .hero-metrics strong {
    font-size: 17px;
    margin-bottom: 4px;
  }

  .hero-metrics span {
    max-width: 74px;
    font-size: 9.5px;
    line-height: 1.15;
  }

  .hero-visual {
    margin-top: 4px;
  }

  .dashboard-glass {
    padding: 10px;
    border-radius: 10px;
  }

  .dash-top {
    gap: 10px;
    margin-bottom: 10px;
  }

  .dash-eyebrow {
    font-size: 10px;
  }

  .dash-top h2 {
    font-size: 17px;
  }

  .dash-status {
    padding: 5px 8px;
    font-size: 10px;
  }

  .dash-map {
    height: 150px;
    border-radius: 8px;
  }

  .pin {
    width: 26px;
    height: 26px;
  }

  .pin i {
    width: 9px;
    height: 9px;
  }

  .dash-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin-top: 8px;
  }

  .dash-stats div {
    min-height: 72px;
    padding: 9px 7px;
    display: grid;
    place-items: center;
    text-align: center;
    align-content: center;
  }

  .dash-stats .material-symbols-outlined {
    font-size: 18px;
    margin-bottom: 5px;
  }

  .dash-stats strong {
    font-size: 15px;
  }

  .dash-stats small {
    font-size: 10px;
  }

  .floating-order {
    margin-top: 9px;
    padding: 10px 12px;
    border-radius: 10px;
  }

  .floating-order .material-symbols-outlined {
    font-size: 21px;
  }

  .floating-order strong {
    font-size: 13px;
  }

  .floating-order small {
    font-size: 11px;
  }

  .landing-feature-band {
    gap: 10px;
    padding: 4px 0 10px;
  }

  .feature-tile {
    padding: 14px;
    border-radius: 10px;
  }

  .feature-tile .material-symbols-outlined {
    width: 34px;
    height: 34px;
    font-size: 19px;
    margin-bottom: 10px;
  }

  .feature-tile h3 {
    font-size: 15px;
    margin-bottom: 5px;
  }

  .feature-tile p {
    font-size: 12px;
    line-height: 1.52;
  }

  .water-line {
    width: 120vw;
    height: 120px;
  }

  .water-grid {
    right: -160px;
    top: 26%;
    width: 300px;
    height: 390px;
    opacity: 0.55;
    background-size: 26px 26px;
  }
}

@media (max-width: 390px) {
  .landing-shell {
    width: calc(100% - 16px);
  }

  .hero-copy h1 {
    font-size: 29px;
  }

  .hero-buttons {
    grid-template-columns: 1fr;
  }

  .hero-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-metrics div {
    min-height: 54px;
    padding-inline: 4px;
  }

  .hero-metrics strong {
    font-size: 15px;
  }

  .hero-metrics span {
    font-size: 9px;
  }

  .dash-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .dash-stats div {
    min-height: 68px;
    padding: 8px 4px;
  }

  .dash-stats .material-symbols-outlined {
    font-size: 17px;
    margin-bottom: 4px;
  }

  .dash-stats strong {
    font-size: 13px;
    word-break: break-word;
  }

  .dash-stats small {
    font-size: 9px;
  }
}

/* =============================================
   Fluid App Modernization Pass
   ============================================= */
.landing-root,
.landing-root body {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: auto;
  touch-action: auto;
}

@media (max-width: 768px) {
  .landing-root,
  .landing-root body.landing-body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .landing-root .landing-shell {
    min-height: auto;
    padding-bottom: calc(28px + var(--safe-bottom));
  }
}

@media (prefers-reduced-motion: no-preference) {
  body,
  .app-layout,
  .main-content,
  .page-content,
  .sidebar,
  .topbar,
  .card,
  .stat-card,
  .rf-stat-card,
  .rf-chart-card,
  .rf-orders-card,
  .st-branch-card,
  .table-wrap,
  .btn,
  .nav-link,
  .form-input,
  .form-select,
  .badge,
  .landing-nav,
  .glass-panel,
  .hero-primary,
  .hero-secondary,
  .feature-tile {
    transition:
      background-color 0.24s ease,
      border-color 0.24s ease,
      box-shadow 0.24s ease,
      color 0.24s ease,
      opacity 0.24s ease,
      transform 0.24s ease;
  }

  .page-content.fade-in,
  .landing-hero,
  .landing-feature-band {
    animation: aqSoftRise 0.46s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }

  .water-line {
    animation: aqWaveDrift 8s ease-in-out infinite alternate;
  }

  .water-line-2 {
    animation-duration: 10s;
  }

  .floating-order {
    animation: aqFloat 4.5s ease-in-out infinite;
  }
}

@keyframes aqSoftRise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes aqWaveDrift {
  from {
    opacity: 0.5;
    transform: translateX(-50%) rotate(-4deg) translateY(0);
  }
  to {
    opacity: 0.95;
    transform: translateX(-50%) rotate(-2deg) translateY(10px);
  }
}

@keyframes aqFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

body:not(.landing-body)::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(110deg, rgba(0,194,255,0.08) 0 1px, transparent 1px 112px),
    linear-gradient(180deg, rgba(255,255,255,0.18), transparent 34%),
    radial-gradient(ellipse at 92% 4%, rgba(20,184,166,0.14), transparent 34rem);
}

[data-theme="dark"] body:not(.landing-body)::before {
  background:
    linear-gradient(110deg, rgba(56,189,248,0.08) 0 1px, transparent 1px 112px),
    linear-gradient(180deg, rgba(255,255,255,0.04), transparent 34%),
    radial-gradient(ellipse at 92% 4%, rgba(20,184,166,0.12), transparent 34rem);
}

body:not(.landing-body)::after {
  content: "";
  position: fixed;
  left: var(--sidebar-w);
  right: 0;
  top: 86px;
  height: 220px;
  z-index: -1;
  pointer-events: none;
  opacity: 0.58;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(0,194,255,0.16), transparent 24rem),
    linear-gradient(174deg, transparent 30%, rgba(0,194,255,0.13) 31%, transparent 32%),
    linear-gradient(178deg, transparent 54%, rgba(20,184,166,0.10) 55%, transparent 56%);
}

[data-theme="dark"] body:not(.landing-body)::after {
  opacity: 0.5;
}

.main-content {
  background: transparent;
}

.page-content {
  position: relative;
}

.topbar {
  box-shadow: 0 14px 36px rgba(10,37,64,0.06);
}

[data-theme="dark"] .topbar {
  box-shadow: 0 14px 36px rgba(0,0,0,0.2);
}

.sidebar {
  box-shadow: 14px 0 40px rgba(8,24,40,0.16);
}

.sidebar-logo img {
  max-width: 168px;
}

.nav-link {
  border: 1px solid transparent;
}

.nav-link:hover {
  transform: translateX(3px);
  border-color: rgba(255,255,255,0.08);
}

.nav-link.active {
  box-shadow: inset 0 0 0 1px rgba(0,194,255,0.18), 0 10px 24px rgba(0,194,255,0.08);
}

.card,
.stat-card,
.rf-stat-card,
.rf-chart-card,
.rf-orders-card,
.st-summary-card,
.st-branch-card,
.settings-panel,
.table-wrap,
.modal,
.detail-panel,
.map-legend,
.map-search,
.filter-pill:not(.active),
.notif-panel {
  background: rgba(255,255,255,0.74);
  border-color: rgba(148,163,184,0.24);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  box-shadow: 0 18px 46px rgba(10,37,64,0.09);
}

[data-theme="dark"] .card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .rf-stat-card,
[data-theme="dark"] .rf-chart-card,
[data-theme="dark"] .rf-orders-card,
[data-theme="dark"] .st-summary-card,
[data-theme="dark"] .st-branch-card,
[data-theme="dark"] .settings-panel,
[data-theme="dark"] .table-wrap,
[data-theme="dark"] .modal,
[data-theme="dark"] .detail-panel,
[data-theme="dark"] .map-legend,
[data-theme="dark"] .map-search,
[data-theme="dark"] .filter-pill:not(.active),
[data-theme="dark"] .notif-panel {
  background: rgba(17,25,38,0.78);
  border-color: rgba(148,163,184,0.18);
  box-shadow: 0 18px 46px rgba(0,0,0,0.28);
}

.stat-card,
.rf-stat-card,
.st-summary-card {
  position: relative;
  overflow: hidden;
}

.stat-card::after,
.rf-stat-card::after,
.st-summary-card::after {
  content: "";
  position: absolute;
  inset: auto -20% -55% 28%;
  height: 120px;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, rgba(0,194,255,0.16), transparent 64%),
    linear-gradient(95deg, transparent 20%, rgba(20,184,166,0.13), transparent 72%);
  transform: rotate(-8deg);
}

.stat-icon,
.rf-stat-icon,
.st-summary-icon,
.notif-icon {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), 0 12px 24px rgba(10,37,64,0.08);
}

.btn,
.filter-pill,
.order-type-btn,
.map-payment-opt,
.st-btn-edit,
.st-btn-delete,
.qty-btn,
.notif-bell-btn,
.theme-toggle,
.landing-theme {
  will-change: transform;
}

.btn:hover,
.filter-pill:hover,
.order-type-btn:hover,
.map-payment-opt:hover,
.st-btn-edit:hover,
.qty-btn:hover,
.notif-bell-btn:hover,
.theme-toggle:hover,
.landing-theme:hover,
.hero-primary:hover,
.hero-secondary:hover,
.feature-tile:hover {
  transform: translateY(-2px);
}

.btn:active,
.filter-pill:active,
.order-type-btn:active,
.map-payment-opt:active,
.st-btn-edit:active,
.qty-btn:active,
.notif-bell-btn:active,
.theme-toggle:active,
.landing-theme:active {
  transform: translateY(0) scale(0.98);
}

.btn-primary,
.filter-pill.active {
  background: linear-gradient(135deg, #00C2FF, #19d3c5);
  color: #062033;
  box-shadow: 0 14px 30px rgba(0,194,255,0.22);
}

.btn-navy,
.landing-cta,
.hero-primary {
  background: linear-gradient(135deg, #0A2540, #0f3a5f);
  box-shadow: 0 16px 34px rgba(10,37,64,0.22);
}

[data-theme="dark"] .btn-navy,
[data-theme="dark"] .landing-cta,
[data-theme="dark"] .hero-primary {
  background: linear-gradient(135deg, #00C2FF, #19d3c5);
  color: #062033;
}

.form-input,
.form-select,
.map-search {
  background: rgba(255,255,255,0.74);
  border-color: rgba(148,163,184,0.30);
}

[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select,
[data-theme="dark"] .map-search {
  background: rgba(15,23,42,0.72);
}

.form-input:focus,
.form-select:focus,
.map-search:focus {
  transform: translateY(-1px);
  box-shadow: 0 0 0 4px rgba(0,194,255,0.14), 0 14px 28px rgba(10,37,64,0.08);
}

.table-wrap {
  overflow: auto;
}

table {
  background: transparent;
}

thead tr {
  background: rgba(0,194,255,0.07);
}

[data-theme="dark"] thead tr {
  background: rgba(0,194,255,0.08);
}

tr:hover td {
  background: rgba(0,194,255,0.055);
}

.alert,
.inline-error,
.inline-success,
.inline-warning,
.inline-info,
.rf-alert {
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(10,37,64,0.07);
}

.rf-hero {
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(10,37,64,0.92), rgba(0,121,154,0.78)),
    linear-gradient(110deg, rgba(255,255,255,0.16) 0 1px, transparent 1px 54px);
  box-shadow: 0 24px 54px rgba(10,37,64,0.20);
}

.rf-chart-card,
.rf-orders-card {
  border-radius: 8px;
}

.rf-order-row,
.dash-user-row,
.dash-pending-row,
.notif-item,
.notif-admin-row {
  border-radius: 8px;
}

.rf-order-row:hover,
.dash-user-row:hover,
.dash-pending-row:hover,
.notif-item:hover,
.notif-admin-row:hover {
  background: rgba(0,194,255,0.06);
}

.st-branch-card,
.feature-tile {
  border-radius: 8px;
}

.st-branch-img {
  background:
    linear-gradient(110deg, rgba(0,194,255,0.08) 0 1px, transparent 1px 46px),
    linear-gradient(135deg, rgba(224,242,254,0.7), rgba(240,253,250,0.68));
}

.modal-overlay.open .modal {
  animation: aqModalIn 0.24s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes aqModalIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.map-filter-bar {
  gap: 10px;
}

.map-search,
.filter-pill,
.map-legend {
  border-radius: 8px !important;
}

.detail-panel {
  border-left-color: rgba(148,163,184,0.24) !important;
}

.detail-header-media {
  background:
    linear-gradient(110deg, rgba(0,194,255,0.08) 0 1px, transparent 1px 44px),
    linear-gradient(135deg, rgba(224,242,254,0.68), rgba(240,253,250,0.64)) !important;
}

.leaflet-container {
  font-family: 'Manrope', sans-serif;
}

@media (min-width: 769px) {
  .card:hover,
  .stat-card:hover,
  .rf-stat-card:hover,
  .rf-chart-card:hover,
  .rf-orders-card:hover,
  .st-summary-card:hover,
  .st-branch-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 24px 54px rgba(10,37,64,0.13);
  }

  [data-theme="dark"] .card:hover,
  [data-theme="dark"] .stat-card:hover,
  [data-theme="dark"] .rf-stat-card:hover,
  [data-theme="dark"] .rf-chart-card:hover,
  [data-theme="dark"] .rf-orders-card:hover,
  [data-theme="dark"] .st-summary-card:hover,
  [data-theme="dark"] .st-branch-card:hover {
    box-shadow: 0 24px 54px rgba(0,0,0,0.34);
  }
}

@media (max-width: 768px) {
  body:not(.landing-body)::after {
    left: 0;
    top: 70px;
    height: 170px;
  }

  .topbar {
    height: 58px;
    padding: 0 14px;
  }

  .page-content {
    padding: 18px 14px 22px;
  }

  .sidebar {
    box-shadow: 18px 0 54px rgba(0,0,0,0.24);
  }

  .card,
  .stat-card,
  .rf-stat-card,
  .rf-chart-card,
  .rf-orders-card,
  .st-summary-card,
  .st-branch-card,
  .settings-panel {
    border-radius: 8px;
  }

  .stat-grid,
  .rf-stat-grid,
  .st-summary {
    gap: 10px;
  }

  .detail-panel {
    border-radius: 18px 18px 0 0 !important;
  }

  .detail-panel.sheet-open {
    box-shadow: 0 -24px 60px rgba(10,37,64,0.18);
  }
}

/* =============================================
   Compact Settings + Auth Motion Polish
   ============================================= */
@media (min-width: 1024px) {
  .settings-grid {
    grid-template-columns: minmax(300px, 360px) minmax(420px, 620px);
    gap: 14px;
    align-items: start;
    max-width: 1040px;
  }

  .settings-profile-card {
    height: auto;
    min-height: 0;
    padding: 18px;
  }

  .settings-right-col {
    gap: 12px;
  }

  .settings-right-col .settings-panel {
    flex: 0 0 auto;
  }

  .profile-avatar-section {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 12px;
    padding-bottom: 12px;
  }

  .avatar-actions {
    justify-content: flex-start;
    margin-bottom: 12px;
  }

  .settings-divider {
    margin-bottom: 12px;
  }

  .settings-form-fields {
    gap: 10px;
    margin-bottom: 12px;
  }

  .settings-section-header {
    padding: 10px 14px;
  }

  .settings-row {
    padding: 10px 14px;
  }

  .settings-row-icon {
    width: 34px;
    height: 34px;
  }
}

.auth-page {
  overflow-x: hidden;
  min-height: 100vh;
  background:
    linear-gradient(115deg, rgba(0,194,255,0.14) 0 1px, transparent 1px 54px),
    linear-gradient(155deg, rgba(20,184,166,0.14), transparent 42%),
    linear-gradient(180deg, #f7fdff 0%, #eaf9ff 48%, #f8fbff 100%) !important;
}

.auth-page .auth-wrap {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.68), rgba(255,255,255,0.28)),
    linear-gradient(180deg, rgba(0,194,255,0.06), rgba(20,184,166,0.06));
}

.auth-page .auth-left {
  background:
    linear-gradient(135deg, rgba(10,37,64,0.92), rgba(8,92,125,0.86)),
    linear-gradient(115deg, rgba(255,255,255,0.10) 0 1px, transparent 1px 42px) !important;
}

.auth-page .auth-left::before,
.auth-page .auth-left::after {
  display: none !important;
}

.auth-page .auth-right {
  background: transparent !important;
}

.auth-page .auth-form-wrap {
  padding: 34px;
  border: 1px solid rgba(255,255,255,0.58);
  border-radius: 18px;
  background: rgba(255,255,255,0.58);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.78),
    0 24px 60px rgba(10,37,64,0.12);
  backdrop-filter: blur(22px) saturate(1.25);
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
}

.auth-page .auth-heading {
  color: var(--text-main) !important;
}

.auth-page .auth-sub {
  color: var(--text-muted) !important;
}

.auth-page .form-input,
.auth-page .role-label {
  background: rgba(255,255,255,0.64) !important;
  border-color: rgba(148,163,184,0.32) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.58);
}

.auth-page .btn-primary {
  box-shadow: 0 14px 28px rgba(0,194,255,0.20);
}

[data-theme="dark"] .auth-page {
  background:
    linear-gradient(115deg, rgba(0,194,255,0.11) 0 1px, transparent 1px 54px),
    linear-gradient(155deg, rgba(20,184,166,0.12), transparent 42%),
    linear-gradient(180deg, #071620 0%, #0b2533 52%, #07111b 100%) !important;
}

[data-theme="dark"] .auth-page .auth-form-wrap {
  border-color: rgba(125,211,252,0.18);
  background: rgba(15,23,42,0.62);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 24px 60px rgba(0,0,0,0.32);
}

[data-theme="dark"] .auth-page .form-input,
[data-theme="dark"] .auth-page .role-label {
  background: rgba(15,23,42,0.58) !important;
  border-color: rgba(125,211,252,0.18) !important;
}

.auth-logo-img {
  height: 48px;
  width: auto;
  max-width: 190px;
  object-fit: contain;
  display: block;
}

.auth-logo-dark {
  display: none;
}

[data-theme="dark"] .auth-logo-light {
  display: none;
}

[data-theme="dark"] .auth-logo-dark {
  display: block;
}

@media (prefers-reduced-motion: no-preference) {
  .auth-page .auth-left {
    animation: authPanelIn 0.62s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }

  .auth-page .auth-right {
    animation: authFormSideIn 0.62s cubic-bezier(0.2, 0.8, 0.2, 1) 0.08s both;
  }

  .auth-page .auth-form-wrap,
  .auth-page .left-center,
  .auth-page .left-logo,
  .auth-page .left-footer {
    animation: authSoftRise 0.52s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }

  .auth-page .left-center { animation-delay: 0.08s; }
  .auth-page .left-footer { animation-delay: 0.16s; }

  .auth-page .form-input,
  .auth-page .role-label,
  .auth-page .btn,
  .auth-page .auth-link a,
  .auth-page .pw-toggle {
    transition:
      background-color 0.22s ease,
      border-color 0.22s ease,
      box-shadow 0.22s ease,
      color 0.22s ease,
      opacity 0.22s ease,
      transform 0.22s ease;
  }

  .auth-page .form-input:focus {
    transform: translateY(-1px);
  }

  .auth-page .role-label:hover,
  .auth-page .btn:hover {
    transform: translateY(-2px);
  }
}

@keyframes authPanelIn {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes authSoftRise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .auth-page .auth-right {
    min-height: 100vh;
    align-items: center !important;
    justify-content: center !important;
    padding: 18px 12px !important;
  }

  .auth-page .auth-form-wrap {
    width: 100%;
    max-width: 430px !important;
    margin: auto;
    padding: 20px !important;
    border-radius: 14px;
  }

  .auth-page .auth-heading {
    font-size: 24px !important;
    margin-bottom: 4px !important;
  }

  .auth-page .auth-sub {
    font-size: 12px !important;
    margin-bottom: 18px !important;
  }

  .auth-page #regForm > div {
    gap: 11px !important;
  }

  .auth-page #regForm .form-label {
    margin-bottom: 5px;
    font-size: 12px;
  }

  .auth-page #regForm .form-input {
    min-height: 42px;
    height: 42px;
    padding: 0 12px;
    font-size: 13px;
    border-radius: 9px !important;
  }

  .auth-page #regForm .role-pick {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .auth-page #regForm .role-label {
    min-height: 76px;
    padding: 10px 8px !important;
    gap: 5px !important;
    border-width: 1px !important;
    border-radius: 10px !important;
    background:
      linear-gradient(135deg, rgba(255,255,255,0.74), rgba(236,248,255,0.48)) !important;
  }

  [data-theme="dark"] .auth-page #regForm .role-label {
    background:
      linear-gradient(135deg, rgba(15,23,42,0.70), rgba(8,47,73,0.34)) !important;
  }

  .auth-page #regForm .role-label .material-symbols-outlined {
    font-size: 22px !important;
  }

  .auth-page #regForm .role-label span.role-name {
    font-size: 12px !important;
  }

  .auth-page #regForm .role-label span[style*="font-size:11px"] {
    font-size: 10px !important;
    line-height: 1.15;
  }

  .auth-page #regForm .pw-toggle {
    right: 10px;
  }

  .auth-page #regForm .strength-bar {
    margin-top: 6px;
  }

  .auth-page #regForm #strengthLabel {
    display: block;
    margin-top: 3px;
    font-size: 10px !important;
  }

  .auth-page #regForm input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
  }

  .auth-page #regForm label[for="terms"] {
    font-size: 11px !important;
    line-height: 1.45;
  }

  .auth-page #regForm .btn-lg {
    min-height: 44px;
    height: 44px;
    font-size: 13px;
    border-radius: 9px;
  }

  .auth-page #regForm + .auth-link,
  .auth-page .auth-link {
    margin-top: 12px !important;
    font-size: 12px !important;
  }

  .auth-logo-img {
    height: 42px;
  }
}

@media (max-width: 360px) {
  .auth-page .auth-form-wrap {
    padding: 16px !important;
  }

  .auth-page #regForm .role-pick {
    grid-template-columns: 1fr !important;
  }

  .auth-page #regForm .role-label {
    min-height: 58px;
    flex-direction: row !important;
    justify-content: flex-start !important;
    text-align: left !important;
    padding: 9px 10px !important;
  }
}

@media (max-height: 720px) and (max-width: 768px) {
  .auth-page .auth-right {
    align-items: flex-start !important;
  }

  .auth-page .auth-form-wrap {
    margin: 0 auto;
  }
}

/* =============================================
   Refiller Orders Modern Refresh
   ============================================= */
.orders-page-header {
  padding: 2px 0 4px;
  margin-bottom: 16px;
}

.orders-page-header h2 {
  color: var(--text-main) !important;
}

.branch-select-wrap {
  border-radius: 8px;
  background: rgba(255,255,255,0.72);
  border-color: rgba(148,163,184,0.28);
  box-shadow: 0 12px 26px rgba(10,37,64,0.07);
  backdrop-filter: blur(16px) saturate(145%);
  -webkit-backdrop-filter: blur(16px) saturate(145%);
}

[data-theme="dark"] .branch-select-wrap {
  background: rgba(17,25,38,0.78);
  border-color: rgba(148,163,184,0.18);
}

.orders-stats-grid {
  gap: 14px;
  margin-bottom: 18px;
}

.orders-stat-card {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  padding: 16px;
  min-height: 86px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.78), rgba(236,248,255,0.54)),
    rgba(255,255,255,0.68);
}

[data-theme="dark"] .orders-stat-card {
  background:
    linear-gradient(135deg, rgba(17,25,38,0.86), rgba(8,47,73,0.36)),
    rgba(17,25,38,0.76);
}

.orders-stat-card::before {
  content: "";
  position: absolute;
  inset: auto -18px -44px auto;
  width: 120px;
  height: 90px;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(0,194,255,0.18), transparent 70%);
}

.orders-toolbar {
  align-items: center;
  margin-bottom: 16px;
}

.orders-tabs {
  border-radius: 8px;
  background: rgba(255,255,255,0.56);
  border-color: rgba(148,163,184,0.24);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.48);
}

[data-theme="dark"] .orders-tabs {
  background: rgba(15,23,42,0.56);
  border-color: rgba(148,163,184,0.18);
}

.orders-tab {
  border-radius: 6px;
}

.orders-tab:hover {
  color: var(--text-main);
  background: rgba(0,194,255,0.08);
}

.orders-tab.active {
  background: linear-gradient(135deg, rgba(0,194,255,0.18), rgba(20,184,166,0.14));
  color: var(--text-main);
  box-shadow: 0 10px 24px rgba(0,194,255,0.10);
}

.order-card {
  position: relative;
  border-left: 1px solid rgba(148,163,184,0.24) !important;
  border-color: rgba(148,163,184,0.24) !important;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.78), rgba(236,248,255,0.50)),
    rgba(255,255,255,0.72);
  box-shadow: 0 16px 42px rgba(10,37,64,0.08);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}

.order-card::before,
.order-card::after {
  content: none !important;
  display: none !important;
}

[data-theme="dark"] .order-card {
  background:
    linear-gradient(135deg, rgba(17,25,38,0.86), rgba(8,47,73,0.30)),
    rgba(17,25,38,0.76);
  border-color: rgba(148,163,184,0.18) !important;
  box-shadow: 0 18px 44px rgba(0,0,0,0.28);
}

@media (min-width: 769px) {
  .order-card:hover {
    transform: translateY(-3px);
    border-color: rgba(0,194,255,0.32) !important;
    box-shadow: 0 24px 56px rgba(10,37,64,0.12);
  }

  [data-theme="dark"] .order-card:hover {
    box-shadow: 0 24px 56px rgba(0,0,0,0.34);
  }
}

.order-card-header {
  padding: 16px 18px 12px;
  align-items: flex-start;
}

.order-avatar {
  border-radius: 8px;
  background: linear-gradient(135deg, #00C2FF, #19d3c5);
  color: #062033;
  box-shadow: 0 12px 24px rgba(0,194,255,0.18);
}

.order-client-name {
  font-weight: 800;
}

.order-meta-badges {
  justify-content: flex-end;
}

.order-type-badge,
.order-branch-badge,
.order-status-badge,
.order-payment-badge,
.payment-method-pill,
.proof-review-badge {
  border-radius: 999px !important;
}

.order-date-text {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(148,163,184,0.10);
}

.order-details-row {
  border-top: none;
  padding: 0 18px 14px;
}

.order-details-grid {
  display: grid;
  grid-template-columns: minmax(86px, 0.8fr) minmax(86px, 0.8fr) minmax(100px, 0.9fr) minmax(220px, 2.2fr);
  gap: 1px;
  background: rgba(148,163,184,0.18);
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 8px;
  overflow: hidden;
}

.order-detail-cell {
  border-right: none;
  background: rgba(255,255,255,0.54);
  padding: 12px 14px;
}

[data-theme="dark"] .order-detail-cell {
  background: rgba(15,23,42,0.42);
}

.order-detail-label {
  letter-spacing: 0.06em;
}

.order-detail-value {
  font-size: 14px;
}

.order-actions-row {
  padding: 0 18px 16px;
}

.btn-mark-paid,
.btn-complete,
.btn-cancel-order,
.proof-thumb-wrap {
  border-radius: 8px;
  min-height: 40px;
  transition:
    background-color 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    color 0.22s ease,
    opacity 0.22s ease,
    transform 0.22s ease;
}

.btn-mark-paid:hover,
.btn-complete:hover,
.btn-cancel-order:hover,
.proof-thumb-wrap:hover {
  transform: translateY(-2px);
}

.btn-complete {
  box-shadow: 0 12px 24px rgba(34,197,94,0.15);
}

.btn-cancel-order {
  background: rgba(255,255,255,0.38);
}

[data-theme="dark"] .btn-cancel-order {
  background: rgba(15,23,42,0.34);
}

.order-unpaid-notice,
.order-proof-row {
  border-radius: 8px !important;
}

@media (max-width: 900px) {
  .order-details-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .order-detail-cell.order-detail-address {
    grid-column: 1 / -1;
    border-top: none;
  }
}

@media (max-width: 768px) {
  .orders-page-header {
    margin-bottom: 14px;
  }

  .orders-stats-grid {
    gap: 10px;
    margin-bottom: 14px;
  }

  .orders-stat-card {
    min-height: 78px;
    padding: 12px;
  }

  .orders-toolbar {
    gap: 10px;
  }

  .orders-tabs {
    padding: 4px;
  }

  .orders-tab {
    min-width: max-content;
    flex: 1 0 auto;
  }

  .order-card {
    border-radius: 8px;
    border-left-width: 1px !important;
  }

  .order-card-header {
    padding: 14px 14px 10px;
  }

  .order-meta-badges {
    justify-content: flex-start;
  }

  .order-details-row {
    padding: 0 14px 12px;
  }

  .order-details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
  }

  .order-detail-cell {
    padding: 10px 12px;
  }

  .order-detail-cell.order-detail-address {
    grid-column: 1 / -1;
  }

  .order-actions-row {
    padding: 0 14px 14px;
  }
}

@media (max-width: 420px) {
  .orders-stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .order-details-grid {
    grid-template-columns: 1fr;
  }

  .order-detail-cell.order-detail-address {
    grid-column: auto;
  }
}

/* =============================================
   App-Wide Modern Workspace Polish
   Refiller, Client, and Admin tabs
   ============================================= */
:root {
  --aq-surface: rgba(255,255,255,0.76);
  --aq-surface-strong: rgba(255,255,255,0.88);
  --aq-surface-soft: rgba(236,248,255,0.58);
  --aq-line: rgba(148,163,184,0.24);
  --aq-line-strong: rgba(0,194,255,0.28);
  --aq-shadow: 0 18px 46px rgba(10,37,64,0.09);
  --aq-shadow-hover: 0 26px 64px rgba(10,37,64,0.14);
  --aq-radius: 8px;
  --aq-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

[data-theme="dark"] {
  --aq-surface: rgba(17,25,38,0.78);
  --aq-surface-strong: rgba(17,25,38,0.92);
  --aq-surface-soft: rgba(8,47,73,0.30);
  --aq-line: rgba(148,163,184,0.18);
  --aq-line-strong: rgba(56,189,248,0.28);
  --aq-shadow: 0 18px 48px rgba(0,0,0,0.30);
  --aq-shadow-hover: 0 28px 66px rgba(0,0,0,0.38);
}

body[data-role] .page-content {
  isolation: isolate;
}

body[data-role] .page-content::before {
  content: "";
  position: fixed;
  inset: 60px 0 0 var(--sidebar-w);
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(118deg, rgba(0,194,255,0.07) 0 1px, transparent 1px 94px),
    radial-gradient(ellipse at 88% 8%, rgba(20,184,166,0.15), transparent 34rem),
    radial-gradient(ellipse at 14% 90%, rgba(99,102,241,0.10), transparent 28rem);
  opacity: 0.72;
}

[data-theme="dark"] body[data-role] .page-content::before {
  opacity: 0.48;
}

@media (max-width: 768px) {
  body[data-role] .page-content::before {
    inset: 58px 0 0 0;
  }
}

body[data-role] h2,
body[data-role] h3,
body[data-role] .topbar-title {
  color: var(--text-main) !important;
  letter-spacing: 0;
}

body[data-role] .card,
body[data-role] .stat-card,
body[data-role] .rf-stat-card,
body[data-role] .rf-chart-card,
body[data-role] .rf-orders-card,
body[data-role] .st-summary-card,
body[data-role] .st-branch-card,
body[data-role] .settings-panel,
body[data-role] .settings-profile-card,
body[data-role] .um-stat-card,
body[data-role] .user-card,
body[data-role] .req-card,
body[data-role] .station-card,
body[data-role] .order-card,
body[data-role] .info-panel,
body[data-role] .map-legend,
body[data-role] .detail-panel,
body[data-role] .modal,
body[data-role] .search-bar,
body[data-role] .branch-select-wrap,
body[data-role] .branch-pill,
body[data-role] .payment-opt,
body[data-role] .payment-method-card,
body[data-role] .map-payment-opt,
body[data-role] .proof-dropzone,
body[data-role] .map-proof-dropzone,
body[data-role] .table-wrap,
body[data-role] .notif-panel {
  border-radius: var(--aq-radius) !important;
  border-color: var(--aq-line) !important;
  background:
    linear-gradient(135deg, var(--aq-surface-strong), var(--aq-surface-soft)),
    var(--aq-surface) !important;
  box-shadow: var(--aq-shadow);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}

body[data-role] .station-card,
body[data-role] .order-card,
body[data-role] .user-card,
body[data-role] .req-card,
body[data-role] .branch-pill,
body[data-role] .dash-user-row,
body[data-role] .dash-pending-row,
body[data-role] .rf-order-row,
body[data-role] .notif-item {
  overflow: hidden;
}

body[data-role] .stat-card,
body[data-role] .rf-stat-card,
body[data-role] .st-summary-card,
body[data-role] .orders-stat-card,
body[data-role] .um-stat-card,
body[data-role] .card {
  position: relative;
}

body[data-role] .stat-card::before,
body[data-role] .rf-stat-card::before,
body[data-role] .st-summary-card::before,
body[data-role] .um-stat-card::before,
body[data-role] .card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.32), transparent 38%),
    linear-gradient(118deg, transparent 58%, rgba(0,194,255,0.08));
  opacity: 0.72;
}

body[data-role] .card > *,
body[data-role] .stat-card > *,
body[data-role] .rf-stat-card > *,
body[data-role] .st-summary-card > *,
body[data-role] .um-stat-card > * {
  position: relative;
  z-index: 1;
}

body[data-role] .stat-value,
body[data-role] .rf-stat-value,
body[data-role] .st-summary-value,
body[data-role] .um-stat-value {
  color: var(--text-main) !important;
}

body[data-role] .stat-icon,
body[data-role] .rf-stat-icon,
body[data-role] .st-summary-icon,
body[data-role] .um-stat-icon,
body[data-role] .settings-row-icon {
  border-radius: var(--aq-radius) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.50), 0 12px 24px rgba(10,37,64,0.09);
}

body[data-role] .tab-bar,
body[data-role] .orders-tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--aq-line);
  border-radius: var(--aq-radius);
  background: rgba(255,255,255,0.56);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), 0 12px 28px rgba(10,37,64,0.06);
  overflow-x: auto;
  scrollbar-width: none;
}

body[data-role] .tab-bar::-webkit-scrollbar,
body[data-role] .orders-tabs::-webkit-scrollbar {
  display: none;
}

[data-theme="dark"] body[data-role] .tab-bar,
[data-theme="dark"] body[data-role] .orders-tabs {
  background: rgba(15,23,42,0.58);
}

body[data-role] .tab-btn,
body[data-role] .orders-tab,
body[data-role] .um-role-pill,
body[data-role] [href*="?tab="] {
  border-radius: 6px !important;
  border-color: transparent !important;
  min-height: 38px;
}

body[data-role] .tab-btn.active,
body[data-role] .orders-tab.active,
body[data-role] .um-role-pill.active,
body[data-role] [href*="?tab="][style*="var(--navy)"] {
  background: linear-gradient(135deg, rgba(0,194,255,0.20), rgba(20,184,166,0.15)) !important;
  color: var(--text-main) !important;
  box-shadow: 0 10px 24px rgba(0,194,255,0.10);
}

body[data-role] .search-bar {
  min-height: 44px;
  border: 1px solid var(--aq-line);
  padding: 0 14px;
  border-radius: 8px !important;
}

body[data-role] .search-bar input {
  width: 100%;
  min-height: 44px;
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  padding-left: 36px;
}

body[data-role] .search-bar input:focus {
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

body[data-role] .form-input,
body[data-role] .form-select,
body[data-role] textarea {
  border-radius: var(--aq-radius) !important;
  border-color: var(--aq-line) !important;
  background: rgba(255,255,255,0.72) !important;
}

[data-theme="dark"] body[data-role] .form-input,
[data-theme="dark"] body[data-role] .form-select,
[data-theme="dark"] body[data-role] textarea {
  background: rgba(15,23,42,0.72) !important;
}

body[data-role="client"][data-page="transactions"] .transactions-search-bar {
  min-height: 48px;
  padding: 0 14px;
  border-radius: 8px !important;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.82), rgba(236,248,255,0.58)),
    var(--bg-card) !important;
}

body[data-role="client"][data-page="transactions"] .transactions-search-bar input {
  height: 46px;
  width: 100%;
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  padding-left: 36px;
}

body[data-role="client"][data-page="transactions"] .transactions-search-bar input:focus {
  border: 0 !important;
  background: transparent !important;
}

[data-theme="dark"] body[data-role="client"][data-page="transactions"] .transactions-search-bar {
  background:
    linear-gradient(135deg, rgba(15,23,42,0.78), rgba(8,47,73,0.40)),
    var(--bg-card) !important;
}

body[data-role] .btn,
body[data-role] button,
body[data-role] .page-btn,
body[data-role] .filter-pill,
body[data-role] .order-type-btn,
body[data-role] .map-payment-opt,
body[data-role] .payment-opt,
body[data-role] .payment-method-card,
body[data-role] .proof-viewer-thumb {
  border-radius: var(--aq-radius) !important;
  transition:
    background-color 0.22s var(--aq-ease),
    border-color 0.22s var(--aq-ease),
    box-shadow 0.22s var(--aq-ease),
    color 0.22s var(--aq-ease),
    opacity 0.22s var(--aq-ease),
    transform 0.22s var(--aq-ease);
}

body[data-role] .btn-primary,
body[data-role] .btn-navy,
body[data-role] .btn-green,
body[data-role] .um-create-btn {
  background: linear-gradient(135deg, #00C2FF, #19d3c5) !important;
  color: #062033 !important;
  border-color: rgba(0,194,255,0.35) !important;
  box-shadow: 0 14px 30px rgba(0,194,255,0.20);
}

body[data-role] .btn-outline,
body[data-role] .btn-outline-red,
body[data-role] .logout-btn,
body[data-role] .page-btn {
  background: rgba(255,255,255,0.52);
}

[data-theme="dark"] body[data-role] .btn-outline,
[data-theme="dark"] body[data-role] .btn-outline-red,
[data-theme="dark"] body[data-role] .logout-btn,
[data-theme="dark"] body[data-role] .page-btn {
  background: rgba(15,23,42,0.54);
}

@media (hover: hover) and (min-width: 769px) {
  body[data-role] .card:hover,
  body[data-role] .stat-card:hover,
  body[data-role] .rf-stat-card:hover,
  body[data-role] .rf-chart-card:hover,
  body[data-role] .rf-orders-card:hover,
  body[data-role] .st-summary-card:hover,
  body[data-role] .st-branch-card:hover,
  body[data-role] .settings-panel:hover,
  body[data-role] .um-stat-card:hover,
  body[data-role] .user-card:hover,
  body[data-role] .req-card:hover,
  body[data-role] .station-card:hover,
  body[data-role] .order-card:hover,
  body[data-role] .branch-pill:hover {
    transform: translateY(-3px);
    border-color: var(--aq-line-strong) !important;
    box-shadow: var(--aq-shadow-hover);
  }

  body[data-role] .btn:hover,
  body[data-role] button:hover,
  body[data-role] .page-btn:hover,
  body[data-role] .filter-pill:hover,
  body[data-role] .payment-opt:hover,
  body[data-role] .payment-method-card:hover,
  body[data-role] .map-payment-opt:hover,
  body[data-role] .proof-viewer-thumb:hover {
    transform: translateY(-2px);
  }
}

body[data-role] .badge,
body[data-role] .tab-count,
body[data-role] .payment-method-pill,
body[data-role] .order-type-badge,
body[data-role] .order-branch-badge,
body[data-role] .order-status-badge,
body[data-role] .order-payment-badge,
body[data-role] .proof-review-badge {
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,0.20);
}

body[data-page="dashboard"] .stat-grid,
body[data-page="dashboard"] .rf-stat-grid,
body[data-page="station"] .st-summary,
body[data-page="orders"] .orders-stats-grid,
body[data-page="transactions"] .page-content > div[style*="grid-template-columns"],
body[data-page="users"] .um-stats {
  gap: 14px !important;
}

body[data-page="dashboard"] .grid-2col,
body[data-page="dashboard"] .rf-bottom-grid {
  gap: 16px !important;
}

body[data-page="dashboard"] .rf-hero {
  border: 1px solid rgba(255,255,255,0.16);
  background:
    linear-gradient(135deg, rgba(10,37,64,0.94), rgba(0,121,154,0.78)),
    linear-gradient(118deg, rgba(255,255,255,0.15) 0 1px, transparent 1px 58px) !important;
}

body[data-page="dashboard"] .dash-list,
body[data-page="inbox"] .card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

body[data-page="inbox"] .card > div[style*="border-bottom"],
body[data-page="dashboard"] .dash-user-row,
body[data-page="dashboard"] .dash-pending-row,
body[data-page="dashboard"] .rf-order-row {
  border-radius: var(--aq-radius) !important;
  background: rgba(255,255,255,0.42);
  border: 1px solid transparent;
}

[data-theme="dark"] body[data-page="inbox"] .card > div[style*="border-bottom"],
[data-theme="dark"] body[data-page="dashboard"] .dash-user-row,
[data-theme="dark"] body[data-page="dashboard"] .dash-pending-row,
[data-theme="dark"] body[data-page="dashboard"] .rf-order-row {
  background: rgba(15,23,42,0.38);
}

body[data-page="map"] .page-content {
  background:
    linear-gradient(118deg, rgba(0,194,255,0.05) 0 1px, transparent 1px 80px),
    var(--bg-main);
}

body[data-page="map"] .map-wrap,
body[data-page="map"] .map-container,
body[data-page="map"] #map {
  min-height: 0;
}

body[data-page="map"] .info-panel,
body[data-page="map"] .detail-panel {
  border-left: 1px solid var(--aq-line) !important;
}

body[data-page="map"] .branch-pill.active,
body[data-page="map"] .map-payment-opt.selected,
body[data-page="refill"] .payment-opt.selected,
body[data-page="station"] .payment-method-card.selected,
body[data-page="station"] .payment-method-card:has(input:checked) {
  border-color: var(--aq-line-strong) !important;
  background: linear-gradient(135deg, rgba(0,194,255,0.16), rgba(20,184,166,0.10)) !important;
}

body[data-page="map"] .leaflet-container,
body[data-page="station"] .leaflet-container,
body[data-page="requests"] .leaflet-container {
  font-family: 'Manrope', sans-serif;
  background: #dff4fb;
}

body[data-page="refill"] .station-card {
  min-height: 100%;
}

body[data-page="refill"] .station-card > div:first-child,
body[data-page="requests"] .station-card-top,
body[data-page="requests"] .station-photo,
body[data-page="requests"] .station-photo-placeholder,
body[data-page="requests"] .map-thumb,
body[data-page="station"] .st-branch-img,
body[data-page="map"] .detail-header-media {
  background:
    linear-gradient(118deg, rgba(0,194,255,0.08) 0 1px, transparent 1px 46px),
    linear-gradient(135deg, rgba(224,242,254,0.72), rgba(240,253,250,0.68)) !important;
}

body[data-page="refill"] .station-card img,
body[data-page="requests"] .station-photo,
body[data-page="map"] .detail-header-media img,
body[data-page="station"] .st-branch-img img {
  transition: transform 0.35s var(--aq-ease), filter 0.35s var(--aq-ease);
}

@media (hover: hover) and (min-width: 769px) {
  body[data-page="refill"] .station-card:hover img,
  body[data-page="requests"] .card:hover .station-photo,
  body[data-page="station"] .st-branch-card:hover .st-branch-img img {
    transform: scale(1.035);
  }
}

body[data-page="transactions"] .order-card {
  border-left-width: 1px !important;
}

body[data-page="transactions"] .order-card[style],
body[data-page="orders"] .order-card[style] {
  border-left-color: var(--aq-line) !important;
}

body[data-page="transactions"] .proof-viewer-thumb,
body[data-page="orders"] .proof-review-badge,
body[data-page="orders"] .proof-thumb-wrap {
  box-shadow: 0 10px 22px rgba(10,37,64,0.07);
}

body[data-page="station"] .st-page-head,
body[data-page="orders"] .orders-page-header,
body[data-page="users"] .page-content > div:first-of-type,
body[data-page="transactions"] .page-content > div:first-of-type,
body[data-page="refill"] .page-content > div:first-of-type {
  padding: 2px 0 4px;
}

body[data-page="station"] .st-gallery {
  gap: 16px !important;
}

body[data-page="station"] .st-modal,
body[data-page="station"] .st-form-section,
body[data-page="station"] .payment-defaults-banner,
body[data-page="station"] #pickMap {
  border-radius: var(--aq-radius) !important;
}

body[data-page="station"] .st-form-section {
  border: 1px solid var(--aq-line);
  background: rgba(255,255,255,0.52);
  padding: 14px;
}

body[data-page="station"] .st-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
}

body[data-page="station"] .st-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

body[data-page="station"] .st-map-legend i,
body[data-page="station"] .st-existing-branch-marker span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
}

body[data-page="station"] .st-map-legend i.own,
body[data-page="station"] .st-existing-branch-marker span.own {
  background: #00c2ff;
  box-shadow: 0 0 0 4px rgba(0,194,255,0.16);
}

body[data-page="station"] .st-map-legend i.other,
body[data-page="station"] .st-existing-branch-marker span.other {
  background: #8b5cf6;
  box-shadow: 0 0 0 4px rgba(139,92,246,0.16);
}

body[data-page="station"] .st-existing-branch-marker span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 3px solid rgba(255,255,255,0.95);
  box-shadow: 0 10px 24px rgba(10,37,64,0.24);
}

body[data-page="station"] .st-existing-branch-marker span i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
}

body[data-page="station"] .st-map-popup {
  min-width: 170px;
  display: grid;
  gap: 4px;
  color: #0a2540;
}

body[data-page="station"] .st-map-popup strong {
  font-size: 13px;
}

body[data-page="station"] .st-map-popup small,
body[data-page="station"] .st-map-popup span {
  font-size: 11px;
  color: #64748b;
}

[data-theme="dark"] body[data-page="station"] .st-form-section {
  background: rgba(15,23,42,0.38);
}

body[data-page="inbox"] .card {
  padding: 10px !important;
}

body[data-page="inbox"] .card > div {
  border-radius: var(--aq-radius);
}

body[data-page="users"] .user-card,
body[data-page="users"] .req-card {
  padding: 16px !important;
}

body[data-page="users"] .user-card-avatar,
body[data-page="users"] .req-avatar,
body[data-page="dashboard"] .avatar,
body[data-page="settings"] .profile-avatar {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), 0 12px 24px rgba(10,37,64,0.10);
}

body[data-page="requests"] .card[id^="station-"] {
  border: 1px solid var(--aq-line) !important;
}

body[data-page="requests"] .station-card-top {
  border-bottom: 1px solid var(--aq-line);
}

body[data-page="requests"] .map-modal-header,
body[data-page="requests"] .map-modal-footer {
  background: var(--aq-surface-strong) !important;
}

body[data-page="settings"] .settings-grid {
  width: 100%;
}

body[data-page="settings"] .settings-row {
  border-radius: var(--aq-radius);
  margin: 4px 8px;
}

body[data-page="settings"] .settings-row:hover {
  background: rgba(0,194,255,0.06);
}

body[data-page="settings"] .settings-section-header {
  color: var(--text-main);
}

body[data-page="settings"] .settings-profile-card {
  overflow: hidden;
}

@media (prefers-reduced-motion: no-preference) {
  body[data-role] .page-content.fade-in {
    animation: aqWorkspaceIn 0.42s var(--aq-ease) both;
  }

  body[data-role] .stat-card,
  body[data-role] .rf-stat-card,
  body[data-role] .st-summary-card,
  body[data-role] .orders-stat-card,
  body[data-role] .um-stat-card,
  body[data-role] .card,
  body[data-role] .station-card,
  body[data-role] .order-card,
  body[data-role] .user-card,
  body[data-role] .req-card {
    animation: aqCardIn 0.42s var(--aq-ease) both;
  }
}

@keyframes aqWorkspaceIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes aqCardIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 1200px) {
  body[data-page="settings"] .settings-grid {
    grid-template-columns: minmax(300px, 360px) minmax(420px, 660px);
    max-width: 1080px;
  }

  body[data-page="dashboard"] .page-content,
  body[data-page="orders"] .page-content,
  body[data-page="station"] .page-content,
  body[data-page="inbox"] .page-content,
  body[data-page="refill"] .page-content,
  body[data-page="transactions"] .page-content,
  body[data-page="users"] .page-content,
  body[data-page="requests"] .page-content,
  body[data-page="settings"] .page-content {
    padding-top: 24px;
  }
}

@media (max-width: 900px) {
  body[data-page="dashboard"] .grid-2col,
  body[data-page="dashboard"] .rf-bottom-grid {
    grid-template-columns: 1fr !important;
  }

  body[data-page="requests"] .tab-bar,
  body[data-page="users"] .tab-bar,
  body[data-page="transactions"] .page-content > div[style*="overflow-x:auto"],
  body[data-page="orders"] .orders-tabs {
    margin-inline: -2px;
  }
}

@media (max-width: 768px) {
  body[data-role] .page-content {
    padding: 16px 12px 22px;
  }

  body[data-role] .main-content,
  body[data-role] .topbar,
  body[data-role] .page-content {
    width: 100%;
    max-width: 100vw;
  }

  body[data-role] .topbar {
    left: 0;
    right: 0;
    margin: 0;
    box-sizing: border-box;
  }

  body[data-role] .card,
  body[data-role] .stat-card,
  body[data-role] .rf-stat-card,
  body[data-role] .rf-chart-card,
  body[data-role] .rf-orders-card,
  body[data-role] .st-summary-card,
  body[data-role] .st-branch-card,
  body[data-role] .settings-panel,
  body[data-role] .settings-profile-card,
  body[data-role] .um-stat-card,
  body[data-role] .user-card,
  body[data-role] .req-card,
  body[data-role] .station-card,
  body[data-role] .order-card {
    box-shadow: 0 12px 30px rgba(10,37,64,0.08);
  }

  body[data-role] .tab-bar,
  body[data-role] .orders-tabs {
    width: 100%;
  }

  body[data-role] .tab-btn,
  body[data-role] .orders-tab,
  body[data-role] .um-role-pill {
    flex: 1 0 auto;
    min-width: max-content;
  }

  body[data-page="map"] .page-content {
    padding: 0 !important;
  }

  body[data-page="map"] .info-panel {
    border-left: none !important;
    border-top: 1px solid var(--aq-line) !important;
    box-shadow: 0 -14px 40px rgba(10,37,64,0.10);
  }

  body[data-page="map"] .detail-panel {
    border-radius: 18px 18px 0 0 !important;
  }

  body[data-page="refill"] .page-content > div[style*="grid-template-columns"],
  body[data-page="transactions"] .page-content > div[style*="grid-template-columns"],
  body[data-page="users"] .um-stats,
  body[data-page="station"] .st-summary,
  body[data-page="orders"] .orders-stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  body[data-page="refill"] .station-card > div:first-child {
    height: 142px !important;
  }

  body[data-page="users"] .user-card,
  body[data-page="users"] .req-card {
    gap: 10px;
  }

  body[data-page="settings"] .settings-row {
    margin-inline: 0;
  }
}

@media (max-width: 480px) {
  body[data-page="refill"] .page-content > div[style*="grid-template-columns"],
  body[data-page="transactions"] .page-content > div[style*="grid-template-columns"],
  body[data-page="users"] .um-stats,
  body[data-page="station"] .st-summary,
  body[data-page="orders"] .orders-stats-grid {
    grid-template-columns: 1fr !important;
  }

  body[data-page="orders"] .order-details-grid,
  body[data-page="transactions"] .order-details-grid {
    grid-template-columns: 1fr !important;
  }

  body[data-page="users"] .user-card,
  body[data-page="users"] .req-card-top {
    align-items: flex-start;
  }

  body[data-page="users"] .req-actions {
    flex-direction: column;
  }
}

/* =============================================
   Full Desktop Settings + Sidebar Sign Out Fix
   ============================================= */
.sidebar .logout-btn {
  background: transparent !important;
  border: 1px solid transparent !important;
  color: #f87171 !important;
  box-shadow: none !important;
}

.sidebar .logout-btn:hover {
  background: rgba(239,68,68,0.12) !important;
  border-color: rgba(239,68,68,0.18) !important;
  color: #fecaca !important;
}

[data-theme="light"] .sidebar .logout-btn,
:root:not([data-theme="dark"]) .sidebar .logout-btn {
  color: #f87171 !important;
}

@media (min-width: 1024px) {
  body[data-page="settings"] .page-content {
    min-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
  }

  body[data-page="settings"] .settings-grid {
    width: 100%;
    max-width: none;
    flex: 1;
    grid-template-columns: minmax(430px, 1.08fr) minmax(480px, 0.92fr);
    gap: 18px;
    align-items: stretch;
  }

  body[data-page="settings"] .settings-profile-card {
    height: 100%;
    min-height: clamp(560px, calc(100vh - 116px), 820px);
    padding: 28px;
    display: flex;
    flex-direction: column;
  }

  body[data-page="settings"] .settings-profile-card form:last-child {
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  body[data-page="settings"] .settings-profile-card form:last-child > div[style*="grid-template-columns"],
  body[data-page="settings"] .settings-profile-card form:last-child > .form-group {
    margin-bottom: 18px !important;
  }

  body[data-page="settings"] .settings-profile-card form:last-child > div:last-child {
    margin-top: auto;
  }

  body[data-page="settings"] .profile-avatar-section {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
    padding: 10px 0 22px;
  }

  body[data-page="settings"] .profile-avatar-wrapper {
    transform: scale(1.05);
  }

  body[data-page="settings"] .avatar-actions {
    justify-content: center;
    margin-bottom: 22px;
  }

  body[data-page="settings"] .settings-divider {
    margin-bottom: 22px;
  }

  body[data-page="settings"] .settings-right-col {
    height: 100%;
    min-height: clamp(560px, calc(100vh - 116px), 820px);
    gap: 18px;
    display: flex;
  }

  body[data-page="settings"] .settings-right-col .settings-panel {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  body[data-page="settings"] .settings-section-header {
    padding: 18px 22px;
  }

  body[data-page="settings"] .settings-row {
    flex: 1;
    min-height: 126px;
    padding: 22px;
    align-items: center;
  }

  body[data-page="settings"] .settings-row + .settings-row {
    border-top-color: var(--aq-line);
  }

  body[data-page="settings"] .settings-row-info {
    gap: 16px;
  }

  body[data-page="settings"] .settings-row-icon {
    width: 48px;
    height: 48px;
  }

  body[data-page="settings"] .settings-row-title {
    font-size: 15px;
    font-weight: 800;
  }

  body[data-page="settings"] .settings-row-sub {
    font-size: 12px;
    margin-top: 3px;
  }
}

@media (min-width: 1440px) {
  body[data-page="settings"] .settings-grid {
    grid-template-columns: minmax(520px, 1.08fr) minmax(560px, 0.92fr);
    gap: 22px;
  }

  body[data-page="settings"] .settings-profile-card,
  body[data-page="settings"] .settings-right-col {
    min-height: clamp(640px, calc(100vh - 120px), 900px);
  }
}

@media (max-width: 768px) {
  .sidebar .logout-btn {
    min-height: 44px;
  }
}

/* =============================================
   Admin Users Summary Cards
   ============================================= */
body[data-role="admin"][data-page="users"] .um-stats {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

body[data-role="admin"][data-page="users"] .um-stat-card {
  min-height: 76px;
  padding: 14px 16px;
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(0,194,255,0.18) !important;
  background:
    linear-gradient(105deg, rgba(255,255,255,0.86), rgba(207,246,255,0.56) 50%, rgba(242,252,255,0.88)),
    rgba(255,255,255,0.78) !important;
  box-shadow: 0 14px 32px rgba(10,37,64,0.08);
}

body[data-role="admin"][data-page="users"] .um-stat-card::before {
  background:
    linear-gradient(95deg, rgba(255,255,255,0.55), transparent 44%),
    radial-gradient(ellipse at 90% 20%, rgba(0,194,255,0.16), transparent 58%);
  opacity: 1;
}

body[data-role="admin"][data-page="users"] .um-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px !important;
  background: rgba(255,255,255,0.68) !important;
  border: 1px solid rgba(148,163,184,0.20);
}

body[data-role="admin"][data-page="users"] .um-stat-icon .material-symbols-outlined {
  font-size: 25px !important;
}

body[data-role="admin"][data-page="users"] .um-stat-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #64748b;
  line-height: 1.1;
}

body[data-role="admin"][data-page="users"] .um-stat-value {
  margin-top: 4px;
  font-size: 23px;
  font-weight: 900;
  color: #0f172a !important;
  line-height: 1;
}

[data-theme="dark"] body[data-role="admin"][data-page="users"] .um-stat-card {
  border-color: rgba(56,189,248,0.20) !important;
  background:
    linear-gradient(105deg, rgba(17,25,38,0.90), rgba(8,47,73,0.54) 52%, rgba(15,23,42,0.88)),
    rgba(17,25,38,0.82) !important;
}

[data-theme="dark"] body[data-role="admin"][data-page="users"] .um-stat-icon {
  background: rgba(15,23,42,0.68) !important;
  border-color: rgba(148,163,184,0.18);
}

[data-theme="dark"] body[data-role="admin"][data-page="users"] .um-stat-label {
  color: #94a3b8;
}

[data-theme="dark"] body[data-role="admin"][data-page="users"] .um-stat-value {
  color: #e6edf3 !important;
}

@media (max-width: 768px) {
  body[data-role="admin"][data-page="users"] .um-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
    align-items: stretch;
  }

  body[data-role="admin"][data-page="users"] .um-stat-card {
    min-width: 0;
    min-height: 76px;
    padding: 11px;
    gap: 9px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
  }

  body[data-role="admin"][data-page="users"] .um-stat-icon {
    width: 38px;
    height: 38px;
  }

  body[data-role="admin"][data-page="users"] .um-stat-icon .material-symbols-outlined {
    font-size: 22px !important;
  }

  body[data-role="admin"][data-page="users"] .um-stat-label {
    font-size: 10px;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  body[data-role="admin"][data-page="users"] .um-stat-value {
    font-size: 21px;
  }
}

/* =============================================
   Client Refill Header
   ============================================= */
body[data-role="client"][data-page="refill"] .client-refill-hero {
  position: relative;
  min-height: 150px;
  margin-bottom: 24px;
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  overflow: hidden;
  border: 1px solid rgba(0,194,255,0.18);
  border-radius: 8px;
  background:
    linear-gradient(115deg, rgba(255,255,255,0.92), rgba(211,245,255,0.64) 48%, rgba(245,253,255,0.92)),
    linear-gradient(118deg, rgba(0,194,255,0.08) 0 1px, transparent 1px 58px);
  box-shadow: 0 18px 44px rgba(10,37,64,0.08);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}

body[data-role="refiller"][data-page="inbox"] .topbar-title {
  display: none;
}

body[data-role="client"][data-page="refill"] .client-refill-hero::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -82px;
  width: min(760px, 120%);
  height: 180px;
  pointer-events: none;
  border: 1px solid rgba(0,194,255,0.18);
  border-color: rgba(0,194,255,0.18) transparent transparent transparent;
  border-radius: 50%;
  transform: translateX(-50%);
}

body[data-role="client"][data-page="refill"] .client-refill-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 22% 20%, rgba(0,194,255,0.18), transparent 18rem),
    radial-gradient(ellipse at 84% 74%, rgba(20,184,166,0.14), transparent 20rem);
}

body[data-role="client"][data-page="refill"] .client-refill-hero > * {
  position: relative;
  z-index: 1;
}

body[data-role="client"][data-page="refill"] .client-refill-hero-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(0,194,255,0.22);
  box-shadow: 0 12px 26px rgba(0,194,255,0.14);
}

body[data-role="client"][data-page="refill"] .client-refill-hero-icon .material-symbols-outlined {
  font-size: 28px;
  color: #0284c7;
}

body[data-role="client"][data-page="refill"] .client-refill-hero h2 {
  margin: 0 0 4px;
  font-size: clamp(24px, 4.4vw, 34px);
  font-weight: 900;
  color: var(--text-main) !important;
}

body[data-role="client"][data-page="refill"] .client-refill-hero p {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
}

[data-theme="dark"] body[data-role="client"][data-page="refill"] .client-refill-hero {
  border-color: rgba(56,189,248,0.20);
  background:
    linear-gradient(115deg, rgba(17,25,38,0.92), rgba(8,47,73,0.58) 48%, rgba(15,23,42,0.90)),
    linear-gradient(118deg, rgba(56,189,248,0.08) 0 1px, transparent 1px 58px);
}

[data-theme="dark"] body[data-role="client"][data-page="refill"] .client-refill-hero-icon {
  background: rgba(15,23,42,0.72);
  border-color: rgba(56,189,248,0.22);
}

@media (max-width: 768px) {
  body[data-role="client"][data-page="refill"] .client-refill-hero {
    min-height: 134px;
    margin-bottom: 18px;
    padding: 22px 16px;
  }
}

/* Shared centered page hero for older tab headers */
body[data-role] .aq-page-hero {
  position: relative;
  min-height: 150px;
  margin-bottom: 24px;
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  overflow: hidden;
  border: 1px solid rgba(0,194,255,0.18);
  border-radius: 8px;
  background:
    linear-gradient(115deg, rgba(255,255,255,0.92), rgba(211,245,255,0.64) 48%, rgba(245,253,255,0.92)),
    linear-gradient(118deg, rgba(0,194,255,0.08) 0 1px, transparent 1px 58px);
  box-shadow: 0 18px 44px rgba(10,37,64,0.08);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}

body[data-role] .aq-page-hero::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -82px;
  width: min(760px, 120%);
  height: 180px;
  pointer-events: none;
  border: 1px solid rgba(0,194,255,0.18);
  border-color: rgba(0,194,255,0.18) transparent transparent transparent;
  border-radius: 50%;
  transform: translateX(-50%);
}

body[data-role] .aq-page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 22% 20%, rgba(0,194,255,0.18), transparent 18rem),
    radial-gradient(ellipse at 84% 74%, rgba(20,184,166,0.14), transparent 20rem);
}

body[data-role] .aq-page-hero > * {
  position: relative;
  z-index: 1;
}

body[data-role] .aq-page-hero > div:not(.aq-page-hero-icon):not(.aq-page-hero-actions) {
  flex: initial !important;
  min-width: 0;
  max-width: 720px;
}

body[data-role] .aq-page-hero-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(0,194,255,0.22);
  box-shadow: 0 12px 26px rgba(0,194,255,0.14);
}

body[data-role] .aq-page-hero-icon .material-symbols-outlined {
  font-size: 28px;
  color: #0284c7;
}

body[data-role] .aq-page-hero h2 {
  margin: 0 0 4px;
  font-size: clamp(24px, 4.4vw, 34px);
  font-weight: 900;
  color: var(--text-main) !important;
}

body[data-role] .aq-page-hero p {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
}

body[data-role] .aq-page-hero-actions {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

body[data-role] .aq-page-hero-compact {
  min-height: 118px;
}

body[data-page="station"] .st-page-head.aq-page-hero,
body[data-page="orders"] .orders-page-header.aq-page-hero {
  align-items: center;
}

body[data-page="orders"] .orders-page-header.aq-page-hero {
  min-height: 126px;
}

body[data-role="client"][data-page="refill"] .topbar,
body[data-role="client"][data-page="transactions"] .topbar,
body[data-role="refiller"][data-page="orders"] .topbar,
body[data-role="refiller"][data-page="station"] .topbar,
body[data-role="admin"][data-page="users"] .topbar {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
}

body[data-role="client"][data-page="refill"] .topbar > div:first-child,
body[data-role="client"][data-page="transactions"] .topbar > div:first-child,
body[data-role="refiller"][data-page="orders"] .topbar > div:first-child,
body[data-role="refiller"][data-page="station"] .topbar > div:first-child,
body[data-role="admin"][data-page="users"] .topbar > div:first-child {
  display: contents !important;
}

body[data-role="client"][data-page="refill"] .mobile-menu-btn,
body[data-role="client"][data-page="transactions"] .mobile-menu-btn,
body[data-role="refiller"][data-page="orders"] .mobile-menu-btn,
body[data-role="refiller"][data-page="station"] .mobile-menu-btn,
body[data-role="admin"][data-page="users"] .mobile-menu-btn {
  grid-column: 1;
  justify-self: start;
}

body[data-role="client"][data-page="refill"] .topbar-title,
body[data-role="client"][data-page="transactions"] .topbar-title,
body[data-role="refiller"][data-page="orders"] .topbar-title,
body[data-role="refiller"][data-page="station"] .topbar-title,
body[data-role="admin"][data-page="users"] .topbar-title {
  grid-column: 2;
  justify-self: center;
  display: block;
  max-width: 100%;
  text-align: center;
}

body[data-role="client"][data-page="refill"] .topbar-actions,
body[data-role="client"][data-page="transactions"] .topbar-actions,
body[data-role="refiller"][data-page="orders"] .topbar-actions,
body[data-role="refiller"][data-page="station"] .topbar-actions,
body[data-role="admin"][data-page="users"] .topbar-actions {
  grid-column: 3;
  justify-self: end;
}

body[data-page="orders"] .orders-page-header.aq-page-hero h2 {
  max-width: 760px;
  font-size: clamp(22px, 4vw, 32px);
}

body[data-page="orders"] .orders-search-bar {
  flex: 1 1 360px;
  width: min(100%, 460px);
  max-width: 460px;
  min-width: 240px;
}

[data-theme="dark"] body[data-page="orders"] .branch-select {
  color: #e6edf3;
}

[data-theme="dark"] body[data-page="orders"] .branch-select-wrap .material-symbols-outlined {
  color: #94a3b8 !important;
}

@media (max-width: 768px) {
  body[data-page="orders"] .orders-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  body[data-page="orders"] .orders-stat-card {
    min-width: 0;
    min-height: 78px;
    padding: 12px;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
  }

  body[data-page="orders"] .orders-search-bar {
    width: 100%;
    max-width: none;
    min-width: 0;
    flex-basis: 100%;
  }
}

@media (max-width: 420px) {
  body[data-page="orders"] .orders-stat-card {
    grid-template-columns: 36px minmax(0, 1fr);
    padding: 10px;
  }
}

[data-theme="dark"] body[data-role] .aq-page-hero {
  border-color: rgba(56,189,248,0.20);
  background:
    linear-gradient(115deg, rgba(17,25,38,0.92), rgba(8,47,73,0.58) 48%, rgba(15,23,42,0.90)),
    linear-gradient(118deg, rgba(56,189,248,0.08) 0 1px, transparent 1px 58px);
}

[data-theme="dark"] body[data-role] .aq-page-hero-icon {
  background: rgba(15,23,42,0.72);
  border-color: rgba(56,189,248,0.22);
}

@media (max-width: 768px) {
  body[data-role] .aq-page-hero {
    min-height: 134px;
    margin-bottom: 18px;
    padding: 22px 16px;
  }

  body[data-role] .aq-page-hero-compact {
    min-height: 112px;
  }

  body[data-role] .aq-page-hero-actions .btn,
  body[data-role] .aq-page-hero-actions .branch-select-wrap {
    width: 100%;
    justify-content: center;
  }
}

/* Client transaction mobile badge alignment */
@media (max-width: 768px) {
  body[data-role="client"][data-page="transactions"] .order-card-header {
    align-items: flex-start;
    gap: 12px;
  }

  body[data-role="client"][data-page="transactions"] .order-card-header > div:first-child {
    min-width: 0;
  }

  body[data-role="client"][data-page="transactions"] .order-card-header > div:last-child {
    width: 100%;
    justify-content: flex-start !important;
    gap: 6px;
    padding-left: 52px;
  }

  body[data-role="client"][data-page="transactions"] .proof-viewer-thumb {
    margin-left: 0;
  }
}

@media (max-width: 420px) {
  body[data-role="client"][data-page="transactions"] .order-card-header > div:last-child {
    padding-left: 0;
  }
}

/* Shared topbar centering and notification controls */
body[data-role] .topbar {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
}

body[data-role] .topbar > div:first-child {
  display: contents !important;
}

body[data-role] .mobile-menu-btn {
  grid-column: 1;
  justify-self: start;
}

body[data-role] .topbar-title {
  grid-column: 2;
  justify-self: center;
  max-width: 100%;
  text-align: center;
}

body[data-role] .topbar-actions {
  grid-column: 3;
  justify-self: end;
}

.notif-item {
  align-items: center;
  gap: 8px;
}

.notif-item-main {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.notif-delete-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.notif-delete-btn:hover {
  color: #ef4444;
  border-color: rgba(239,68,68,0.20);
  background: rgba(239,68,68,0.08);
}

.notif-delete-btn .material-symbols-outlined {
  font-size: 17px;
}

/* Refiller order cards: keep dates beside client names and give badges room. */
body[data-role="refiller"][data-page="orders"] .branch-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

body[data-role="refiller"][data-page="orders"] .order-client-text {
  flex: 1;
  min-width: 0;
}

body[data-role="refiller"][data-page="orders"] .order-client-name-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

body[data-role="refiller"][data-page="orders"] .order-client-name {
  min-width: 0;
  flex: 0 1 auto;
}

body[data-role="refiller"][data-page="orders"] .order-date-inline {
  flex: 0 0 auto;
  margin-left: 0;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(148,163,184,0.12);
}

@media (max-width: 768px) {
  body[data-role="refiller"][data-page="orders"] .order-card-header {
    align-items: flex-start;
    gap: 10px;
  }

  body[data-role="refiller"][data-page="orders"] .order-client-info {
    width: 100%;
    min-width: 0;
  }

  body[data-role="refiller"][data-page="orders"] .order-meta-badges {
    width: 100%;
    justify-content: flex-start;
    padding-left: 50px;
  }

  body[data-role="refiller"][data-page="orders"] .order-date-inline {
    font-size: 10px;
    padding: 3px 7px;
  }
}

@media (max-width: 420px) {
  body[data-role="refiller"][data-page="orders"] .order-client-name-line {
    align-items: center;
    flex-direction: row;
    gap: 6px;
  }

  body[data-role="refiller"][data-page="orders"] .order-date-inline {
    margin-left: 0;
    max-width: 48%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body[data-role="refiller"][data-page="orders"] .order-meta-badges {
    padding-left: 0;
  }
}

/* Refiller station mobile tightening */
@media (max-width: 768px) {
  body[data-role="refiller"][data-page="station"] .st-page-head.aq-page-hero {
    min-height: auto;
    padding: 18px 14px;
    gap: 10px;
  }

  body[data-role="refiller"][data-page="station"] .st-page-head .btn,
  body[data-role="refiller"][data-page="station"] .aq-page-hero-actions .btn {
    width: 100%;
    justify-content: center;
    min-height: 42px;
  }

  body[data-role="refiller"][data-page="station"] .st-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin-bottom: 14px;
  }

  body[data-role="refiller"][data-page="station"] .st-summary-card {
    min-height: 72px;
    padding: 10px 8px !important;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    text-align: center;
  }

  body[data-role="refiller"][data-page="station"] .st-summary-icon {
    width: 34px !important;
    height: 34px !important;
    margin: 0 auto;
  }

  body[data-role="refiller"][data-page="station"] .st-summary-label {
    font-size: 9px;
    line-height: 1.1;
  }

  body[data-role="refiller"][data-page="station"] .st-summary-value {
    font-size: 18px;
    line-height: 1;
  }
}

/* Settings avatar actions */
body[data-page="settings"] .avatar-actions {
  justify-content: center;
  align-items: center;
}

body[data-page="settings"] .remove-avatar-form {
  display: flex;
  justify-content: center;
  width: 100%;
}

body[data-page="settings"] .remove-avatar-form .btn {
  min-width: 150px;
  justify-content: center;
}

body[data-page="settings"] .avatar-actions:empty {
  display: none;
}

body[data-role="admin"][data-page="users"] .user-card-avatar {
  overflow: hidden;
}

body[data-role="admin"][data-page="users"] .user-card-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 50%;
}

body[data-role="admin"][data-page="users"] .req-avatar {
  overflow: hidden;
}

body[data-role="admin"][data-page="users"] .req-avatar img,
body[data-role="refiller"] .order-avatar img,
body[data-role="refiller"] .rf-order-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}

/* Polished app topbar */
body[data-role] .topbar {
  min-height: 64px;
  border-bottom: 1px solid rgba(0,194,255,0.16);
  background:
    linear-gradient(90deg, rgba(255,255,255,0.88), rgba(224,247,255,0.66) 50%, rgba(255,255,255,0.88)),
    linear-gradient(120deg, rgba(0,194,255,0.08) 0 1px, transparent 1px 64px);
  box-shadow: 0 12px 32px rgba(10,37,64,0.08);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

[data-theme="dark"] body[data-role] .topbar {
  border-bottom-color: rgba(56,189,248,0.18);
  background:
    linear-gradient(90deg, rgba(15,23,42,0.92), rgba(8,47,73,0.56) 50%, rgba(15,23,42,0.92)),
    linear-gradient(120deg, rgba(56,189,248,0.07) 0 1px, transparent 1px 64px);
  box-shadow: 0 14px 34px rgba(0,0,0,0.22);
}

body[data-role] .topbar-title {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid rgba(0,194,255,0.16);
  border-radius: 999px;
  background: rgba(255,255,255,0.46);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}

[data-theme="dark"] body[data-role] .topbar-title {
  background: rgba(15,23,42,0.44);
  border-color: rgba(56,189,248,0.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

body[data-role="client"][data-page="refill"] .topbar-title,
body[data-role="client"][data-page="transactions"] .topbar-title {
  padding-top: 4px;
  padding-bottom: 0;
}

body[data-role] .mobile-menu-btn,
body[data-role] .notif-bell-btn {
  border: 1px solid rgba(0,194,255,0.18);
  background: rgba(255,255,255,0.56);
  box-shadow: 0 10px 22px rgba(10,37,64,0.08);
}

[data-theme="dark"] body[data-role] .mobile-menu-btn,
[data-theme="dark"] body[data-role] .notif-bell-btn {
  border-color: rgba(56,189,248,0.18);
  background: rgba(15,23,42,0.62);
}

/* Refiller station stat alignment */
body[data-role="refiller"][data-page="station"] .st-summary-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
}

body[data-role="refiller"][data-page="station"] .st-summary-icon {
  display: grid !important;
  place-items: center;
  justify-self: center;
}

body[data-role="refiller"][data-page="station"] .st-summary-icon .material-symbols-outlined {
  display: block;
  line-height: 1;
}

body[data-role="refiller"][data-page="station"] .st-summary-card > div:last-child {
  min-width: 0;
}

@media (max-width: 768px) {
  body[data-role="refiller"][data-page="station"] .st-summary-card {
    grid-template-columns: 1fr;
    justify-items: center;
    align-items: center;
  }
}

/* Refiller orders revenue and branch controls */
body[data-role="refiller"][data-page="orders"] .page-content > div[style*="margin-bottom:12px"] {
  display: flex;
  justify-content: center;
  margin-bottom: 16px !important;
}

body[data-role="refiller"][data-page="orders"] .page-content > div[style*="margin-bottom:12px"] > .card {
  width: min(100%, 520px);
  min-height: 108px;
  justify-content: center;
  text-align: center;
  border-left: 0 !important;
  border-top: 3px solid var(--aqua);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.88), rgba(214,246,255,0.62)),
    var(--bg-card);
}

body[data-role="refiller"][data-page="orders"] .page-content > div[style*="margin-bottom:12px"] > .card > div:first-child {
  width: 52px !important;
  height: 52px !important;
  border-radius: 8px !important;
  box-shadow: 0 12px 26px rgba(0,194,255,0.16);
}

[data-theme="dark"] body[data-role="refiller"][data-page="orders"] .page-content > div[style*="margin-bottom:12px"] > .card {
  background:
    linear-gradient(135deg, rgba(15,23,42,0.92), rgba(8,47,73,0.58)),
    var(--bg-card);
}

body[data-role="refiller"][data-page="orders"] .branch-select-wrap {
  min-height: 44px;
  padding: 0 14px;
  gap: 8px;
  border-radius: 8px;
  border-color: rgba(0,194,255,0.22);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.78), rgba(224,247,255,0.48)),
    var(--bg-card);
  box-shadow: 0 12px 28px rgba(10,37,64,0.08);
}

body[data-role="refiller"][data-page="orders"] .branch-select {
  min-width: 160px;
  color: var(--text-main);
}

body[data-role="refiller"][data-page="orders"] .branch-select-wrap:focus-within,
body[data-role="refiller"][data-page="orders"] .branch-select-wrap:hover {
  border-color: rgba(0,194,255,0.52);
  box-shadow: 0 14px 32px rgba(0,194,255,0.12);
}

[data-theme="dark"] body[data-role="refiller"][data-page="orders"] .branch-select-wrap {
  background:
    linear-gradient(135deg, rgba(15,23,42,0.76), rgba(8,47,73,0.42)),
    var(--bg-card);
  border-color: rgba(56,189,248,0.22);
}

@media (max-width: 768px) {
  body[data-role="refiller"][data-page="orders"] .page-content > div[style*="margin-bottom:12px"] > .card {
    width: 100%;
    min-height: 96px;
    flex-direction: column;
    gap: 10px !important;
    padding: 16px !important;
  }

  body[data-role="refiller"][data-page="orders"] .branch-select-wrap {
    width: 100%;
  }

  body[data-role="refiller"][data-page="orders"] .branch-select {
    width: 100%;
    min-width: 0;
    text-align: center;
  }
}

/* Admin requests and user-management layout polish */
body[data-role="admin"][data-page="requests"] .request-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr));
  justify-content: stretch;
  gap: 20px;
}

body[data-role="admin"][data-page="requests"] .tab-bar {
  justify-content: flex-start;
  max-width: none;
  margin-inline: 0;
}

body[data-role="admin"][data-page="users"] .um-filters {
  width: 100%;
}

body[data-role="admin"][data-page="users"] .um-search-bar {
  width: 100% !important;
  max-width: none !important;
  flex: 1 1 auto;
}

body[data-role="admin"][data-page="users"] .um-search-bar input {
  width: 100%;
}

@media (max-width: 768px) {
  body[data-role="admin"][data-page="requests"] .request-card-grid {
    grid-template-columns: minmax(0, min(100%, 520px));
    justify-content: center;
    gap: 14px;
  }

  body[data-role="admin"][data-page="requests"] .tab-bar,
  body[data-role="admin"][data-page="users"] .tab-bar {
    width: 100%;
    justify-content: center;
    margin-inline: auto;
  }

  body[data-role="admin"][data-page="users"] .um-pills-row {
    align-items: stretch;
  }
}

/* Final mobile topbar width/centering guard */
@media (max-width: 768px) {
  body[data-role] .main-content {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: 0 !important;
    scrollbar-width: none;
  }

  body[data-role] .main-content::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
  }

  body[data-role] .topbar {
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 100vw !important;
    margin: 0 !important;
    padding-left: max(12px, env(safe-area-inset-left)) !important;
    padding-right: max(12px, env(safe-area-inset-right)) !important;
    box-sizing: border-box !important;
    grid-template-columns: 44px minmax(0, 1fr) 44px !important;
    column-gap: 8px;
    overflow: visible;
  }

  body[data-role] .topbar::after {
    content: "";
    position: absolute;
    top: 0;
    right: -12px;
    bottom: -1px;
    width: 12px;
    border-bottom: inherit;
    background:
      linear-gradient(90deg, rgba(224,247,255,0.66), rgba(255,255,255,0.88)),
      linear-gradient(120deg, rgba(0,194,255,0.08) 0 1px, transparent 1px 64px);
    pointer-events: none;
  }

  [data-theme="dark"] body[data-role] .topbar::after {
    background:
      linear-gradient(90deg, rgba(8,47,73,0.56), rgba(15,23,42,0.92)),
      linear-gradient(120deg, rgba(56,189,248,0.07) 0 1px, transparent 1px 64px);
  }

  body[data-role] .topbar-title {
    width: auto;
    max-width: 100%;
    justify-self: center;
    text-align: center;
    align-self: center;
    height: 36px;
    min-height: 36px;
    line-height: 1.15;
    transform: none;
    padding: 2px 18px 0;
    box-sizing: border-box;
  }

  body[data-role="refiller"][data-page="orders"] .topbar-title,
  body[data-role="refiller"][data-page="station"] .topbar-title {
    align-items: center;
    padding-top: 7px;
    padding-bottom: 0;
  }

  body[data-role="refiller"][data-page="orders"] .topbar-title {
    padding-top: 9px;
  }

  body[data-role="client"][data-page="refill"] .topbar-title,
  body[data-role="client"][data-page="transactions"] .topbar-title {
    padding-top: 9px;
    padding-bottom: 0;
  }

  body[data-role] .topbar-actions {
    width: 44px;
    justify-content: flex-end;
  }
}

/* Refiller dashboard/order stat centering */
body[data-role="refiller"][data-page="dashboard"] .rf-stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

body[data-role="refiller"][data-page="dashboard"] .rf-stat-card {
  min-height: 142px;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 14px 18px;
}

body[data-role="refiller"][data-page="dashboard"] .rf-stat-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin: 0 auto 2px;
}

body[data-role="refiller"][data-page="dashboard"] .rf-stat-label,
body[data-role="refiller"][data-page="dashboard"] .rf-stat-value {
  text-align: center;
}

body[data-role="refiller"][data-page="dashboard"] .rf-stat-value.sm {
  font-size: clamp(16px, 1.8vw, 21px);
  max-width: 100%;
  overflow-wrap: anywhere;
}

body[data-role="refiller"][data-page="orders"] .orders-stats-grid {
  width: min(100%, 980px);
  margin: 0 auto 24px;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
}

body[data-role="refiller"][data-page="orders"] .orders-stat-card {
  min-height: 128px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 14px;
  text-align: center;
  border-radius: 8px;
}

body[data-role="refiller"][data-page="orders"] .orders-stat-card > div:first-child {
  width: 44px !important;
  height: 44px !important;
  border-radius: 8px !important;
}

body[data-role="refiller"][data-page="orders"] .orders-stat-card > div:last-child {
  min-width: 0;
}

body[data-role="refiller"][data-page="orders"] .orders-stat-card > div:last-child > div {
  text-align: center;
}

@media (max-width: 900px) {
  body[data-role="refiller"][data-page="dashboard"] .rf-stat-grid,
  body[data-role="refiller"][data-page="orders"] .orders-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  body[data-role="refiller"][data-page="dashboard"] .rf-stat-grid,
  body[data-role="refiller"][data-page="orders"] .orders-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  body[data-role="refiller"][data-page="dashboard"] .rf-stat-card,
  body[data-role="refiller"][data-page="orders"] .orders-stat-card {
    min-height: 112px;
    padding: 14px 10px !important;
  }

  body[data-role="refiller"][data-page="dashboard"] .rf-stat-icon,
  body[data-role="refiller"][data-page="orders"] .orders-stat-card > div:first-child {
    width: 38px !important;
    height: 38px !important;
  }
}

@media (max-width: 380px) {
  body[data-role="refiller"][data-page="dashboard"] .rf-stat-value.sm,
  body[data-role="refiller"][data-page="orders"] .orders-stat-card > div:last-child > div:last-child {
    font-size: 16px !important;
  }
}
