@import url("https://fonts.googleapis.com/css2?family=Geologica:wght@400;600;700&family=Inter:wght@400;500;600;700&display=swap");

/* styles.css - shared by all pages */
:root {
  --pm-primary: #738b3b;
  --pm-primary-hover: #637832;
  --pm-primary-light: #eaf3d6;
  --pm-primary-soft: #f2f7e7;
  --pm-yellow: #facb34;
  --pm-yellow-light: #fff8dc;
  --pm-black: #111111;
  --pm-white: #f6f5f7;
  --pm-success: #16a34a;
  --pm-success-light: #dcfce7;
  --pm-danger: #dc2626;
  --pm-danger-light: #fee2e2;
  --pm-warning: #f59e0b;
  --pm-warning-light: #fef3c7;
  --pm-disabled: #d1d5db;
  --pm-gray-900: #212429;
  --pm-gray-700: #495057;
  --pm-gray-400: #acb5bd;
  --pm-gray-200: #dde2e5;
  --pm-gray-100: #f8f9fa;
  --pm-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
  --pm-shadow-sm: 0 6px 18px rgba(15, 23, 42, 0.06);
  --pm-shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.12);
  /* A3: reduced curves on boxes/tabs, full curves kept on buttons/chips */
  --pm-radius-card: 10px;
  --pm-radius-box: 10px;
  --pm-radius-panel: 14px;
  --pm-radius-btn: 12px;
  --pm-radius-input: 11px;
  --pm-radius-chip: 999px;
  --pm-radius-xs: 8px;
  --pm-motion: 200ms ease-in-out;
  --pm-btn-h: 44px;
  --pm-input-h: 44px;

  /* ===== A1: Glassmorphism design layer (tuned to clean near-white ss1 look) ===== */
  --pm-glass-bg: rgba(255, 255, 255, 0.86);
  --pm-glass-bg-strong: rgba(255, 255, 255, 0.93);
  --pm-glass-bg-soft: rgba(255, 255, 255, 0.7);
  --pm-glass-border: rgba(226, 230, 220, 0.9);
  --pm-glass-border-ink: rgba(115, 139, 59, 0.18);
  --pm-glass-blur: 14px;
  --pm-glass-blur-strong: 18px;
  --pm-glass-highlight: rgba(255, 255, 255, 0.5);
  --pm-glass-shadow: 0 6px 20px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --pm-glass-shadow-lg: 0 18px 44px rgba(15, 23, 42, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  --pm-gray-300: #cbd2d9;
  /* Subtle light wash behind glass surfaces (faint brand tints in the corners) */
  --pm-grad-app:
    radial-gradient(900px 520px at 100% -6%, rgba(250, 203, 52, 0.10), transparent 55%),
    radial-gradient(820px 520px at -4% 0%, rgba(115, 139, 59, 0.07), transparent 55%),
    linear-gradient(180deg, #fbfcf9 0%, #f7f8f3 60%, #f4f6ee 100%);

  /* Backward-compatible aliases */
  --bg: var(--pm-white);
  --card: #ffffff;
  --muted: var(--pm-gray-700);
  --accent: var(--pm-primary);
  --accent-2: var(--pm-primary-hover);
  --success: var(--pm-success);
  --danger: var(--pm-danger);
  --shadow: var(--pm-shadow);
  --radius: var(--pm-radius-card);
  --primary: var(--pm-primary);
  --glass: rgba(255, 255, 255, 0.82);
}

/* ========== Base Reset ========== */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--pm-gray-900);
  font-family: "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding: 28px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  line-height: 1.5;
}

body.pm-console {
  padding: 18px 20px 24px;
  background: var(--pm-grad-app);
  background-attachment: fixed;
}

body.pm-auth {
  padding: 0;
  /* height:auto overrides the global html,body{height:100%} so the auth page
     can grow taller than the viewport and the WINDOW scrolls (no clipping). */
  height: auto;
  min-height: 100vh;
  background:
    radial-gradient(1000px 560px at 6% -6%, rgba(250, 203, 52, 0.20), transparent 58%),
    radial-gradient(1000px 600px at 102% 8%, rgba(115, 139, 59, 0.20), transparent 56%),
    radial-gradient(800px 700px at 50% 118%, rgba(115, 139, 59, 0.12), transparent 60%),
    linear-gradient(180deg, #f4f7ec 0%, #eef3e1 52%, #f6f5f0 100%);
  background-attachment: fixed;
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1 {
  font-family: "Geologica", "Inter", sans-serif;
  color: var(--pm-black);
  letter-spacing: -0.02em;
}

p {
  margin-top: 0;
}

a {
  color: var(--accent);
}

img {
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  font-family: "Inter", sans-serif;
}

textarea {
  resize: vertical;
}

:focus-visible {
  outline: 2px solid var(--pm-primary);
  outline-offset: 2px;
}

/* ========== Layout ========== */
.container {
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.pm-auth .container {
  max-width: none;
  min-height: 100vh;
  /* Full-bleed login (PMS-style): the wrap fills the whole viewport edge-to-edge
     rather than sitting as a centered, padded card. */
  padding: 0;
  justify-content: stretch;
  align-items: stretch;
}

.pm-console .container {
  max-width: none;
  width: 100%;
}

/* ========== Utility Bar ========== */
.utility-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 0 4px;
  color: var(--pm-gray-700);
  font-size: 13px;
}

.utility-bar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.loading-overlay-panel {
  width: min(100%, 420px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 30px 28px;
  border-radius: 28px;
  border: 1px solid rgba(115, 139, 59, 0.16);
  background:
    radial-gradient(circle at top, rgba(115, 139, 59, 0.12), rgba(255, 255, 255, 0) 58%),
    rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 72px rgba(15, 23, 42, 0.12);
  text-align: center;
  backdrop-filter: blur(16px);
}

.loading-overlay-logo {
  width: min(220px, 70%);
  height: auto;
}

.loading-overlay-spinner {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 4px solid rgba(115, 139, 59, 0.12);
  border-top-color: var(--pm-primary);
  animation: spin 0.9s linear infinite;
}

.loading-overlay-title {
  margin: 0;
  font-family: "Geologica", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--pm-black);
}

.loading-overlay-copy {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--pm-gray-600);
}

#langSelect {
  min-height: 40px;
  padding: 8px 14px;
  border-radius: var(--pm-radius-chip);
  border: 1px solid var(--pm-gray-200);
  background: rgba(255, 255, 255, 0.94);
  color: var(--pm-gray-900);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

/* ========== Header ========== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.h-title {
  display: flex;
  gap: 14px;
  align-items: center;
  min-width: 0;
}

.logo {
  width: 52px;
  height: 52px;
  background: linear-gradient(180deg, var(--pm-primary), var(--pm-primary-hover));
  border-radius: 14px;
  color: #f6f5f7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  box-shadow: var(--pm-shadow-sm);
  border: 1px solid rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}

.logo.logo-image {
  width: 120px;
  height: 52px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.92);
}

.logo.logo-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.h1 {
  font-size: clamp(1.2rem, 1.1rem + 1vw, 1.9rem);
  line-height: 1.1;
  margin: 0;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-actions .btn {
  margin-left: 4px;
}

/* ========== App Shell ========== */
.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.pm-console .app-shell {
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 28px;
}

.app-sidebar {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
  /* ss12 fix: own viewport-height scroll context so the nav scrolls
     independently (under the cursor) instead of moving with the page. */
  height: calc(100vh - 32px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  background: var(--pm-glass-bg-strong);
  border: 1px solid var(--pm-glass-border);
  border-radius: var(--pm-radius-panel);
  box-shadow: var(--pm-glass-shadow);
  -webkit-backdrop-filter: blur(var(--pm-glass-blur-strong)) saturate(140%);
  backdrop-filter: blur(var(--pm-glass-blur-strong)) saturate(140%);
}

.app-sidebar::-webkit-scrollbar {
  width: 7px;
}

.app-sidebar::-webkit-scrollbar-thumb {
  background: rgba(115, 139, 59, 0.25);
  border-radius: 999px;
}

.pm-console .app-sidebar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(246, 248, 240, 0.6)),
    linear-gradient(180deg, rgba(115, 139, 59, 0.05), rgba(250, 203, 52, 0.03));
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--pm-gray-200);
}

.sidebar-brand img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.sidebar-brand strong {
  display: block;
  font-family: "Geologica", sans-serif;
  font-size: 1rem;
  color: var(--pm-black);
}

.sidebar-brand span {
  font-size: 12px;
  color: var(--pm-gray-700);
}

.sidebar-profile {
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(115, 139, 59, 0.12), rgba(115, 139, 59, 0.04));
  border: 1px solid rgba(115, 139, 59, 0.16);
}

.sidebar-profile strong {
  display: block;
  font-size: 0.95rem;
  color: var(--pm-black);
}

.sidebar-profile span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--pm-gray-700);
}

.sidebar-group-label {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pm-gray-400);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-button {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--pm-gray-700);
  padding: 12px 14px;
  border-radius: 14px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color var(--pm-motion),
    color var(--pm-motion),
    border-color var(--pm-motion),
    transform var(--pm-motion);
}

.sidebar-button:hover {
  background: var(--pm-gray-100);
  color: var(--pm-primary);
  border-color: rgba(115, 139, 59, 0.18);
}

.sidebar-button.active {
  /* PMS-style active item: solid green pill, white label + white icon */
  background: var(--pm-primary);
  color: #ffffff;
  border-color: var(--pm-primary);
  box-shadow: 0 6px 16px rgba(115, 139, 59, 0.26);
}

/* A2: icon-based nav — .sidebar-dot is repurposed into a masked line icon,
   keyed per data-panel in CSS so all module templates get icons with no markup edits. */
.sidebar-dot {
  width: 19px;
  height: 19px;
  border-radius: 0;
  flex-shrink: 0;
  opacity: 1;
  background: currentColor;
  color: var(--pm-gray-700);
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
  transition: color var(--pm-motion);
}

.sidebar-button:hover .sidebar-dot {
  color: var(--pm-primary);
}

.sidebar-button.active .sidebar-dot {
  /* Selected tab: icon turns brand yellow (per the PMS reference) for a clear,
     branded active state against the green pill. */
  color: var(--pm-yellow);
}

/* Per-panel icons (Lucide-style line glyphs, inlined as mask data-URIs) */
.sidebar-button[data-panel="dashboardTab"] .sidebar-dot {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='9' rx='1'/%3E%3Crect x='14' y='3' width='7' height='5' rx='1'/%3E%3Crect x='14' y='12' width='7' height='9' rx='1'/%3E%3Crect x='3' y='16' width='7' height='5' rx='1'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='9' rx='1'/%3E%3Crect x='14' y='3' width='7' height='5' rx='1'/%3E%3Crect x='14' y='12' width='7' height='9' rx='1'/%3E%3Crect x='3' y='16' width='7' height='5' rx='1'/%3E%3C/svg%3E");
}
.sidebar-button[data-panel="workspacePanel"] .sidebar-dot {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='4' y1='21' x2='4' y2='14'/%3E%3Cline x1='4' y1='10' x2='4' y2='3'/%3E%3Cline x1='12' y1='21' x2='12' y2='12'/%3E%3Cline x1='12' y1='8' x2='12' y2='3'/%3E%3Cline x1='20' y1='21' x2='20' y2='16'/%3E%3Cline x1='20' y1='12' x2='20' y2='3'/%3E%3Cline x1='1' y1='14' x2='7' y2='14'/%3E%3Cline x1='9' y1='8' x2='15' y2='8'/%3E%3Cline x1='17' y1='16' x2='23' y2='16'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='4' y1='21' x2='4' y2='14'/%3E%3Cline x1='4' y1='10' x2='4' y2='3'/%3E%3Cline x1='12' y1='21' x2='12' y2='12'/%3E%3Cline x1='12' y1='8' x2='12' y2='3'/%3E%3Cline x1='20' y1='21' x2='20' y2='16'/%3E%3Cline x1='20' y1='12' x2='20' y2='3'/%3E%3Cline x1='1' y1='14' x2='7' y2='14'/%3E%3Cline x1='9' y1='8' x2='15' y2='8'/%3E%3Cline x1='17' y1='16' x2='23' y2='16'/%3E%3C/svg%3E");
}
.sidebar-button[data-panel="usersTab"] .sidebar-dot {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M23 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M23 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E");
}
.sidebar-button[data-panel="driverTab"] .sidebar-dot {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M2.5 12h6M15.5 12h6M12 2.5v6M12 15.5v6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M2.5 12h6M15.5 12h6M12 2.5v6M12 15.5v6'/%3E%3C/svg%3E");
}
.sidebar-button[data-panel="operatorTab"] .sidebar-dot {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 18v-6a9 9 0 0 1 18 0v6'/%3E%3Cpath d='M21 19a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3zM3 19a2 2 0 0 0 2 2h1a2 2 0 0 0 2-2v-3a2 2 0 0 0-2-2H3z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 18v-6a9 9 0 0 1 18 0v6'/%3E%3Cpath d='M21 19a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3zM3 19a2 2 0 0 0 2 2h1a2 2 0 0 0 2-2v-3a2 2 0 0 0-2-2H3z'/%3E%3C/svg%3E");
}
.sidebar-button[data-panel="revenueTab"] .sidebar-dot {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h12M6 8h12M9 13c5 0 5-5 0-5'/%3E%3Cpath d='M6 8h6l-6 8h6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h12M6 8h12M9 13c5 0 5-5 0-5'/%3E%3Cpath d='M6 8h6l-6 8h6'/%3E%3C/svg%3E");
}
.sidebar-button[data-panel="todayTab"] .sidebar-dot {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='22 12 18 12 15 21 9 3 6 12 2 12'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='22 12 18 12 15 21 9 3 6 12 2 12'/%3E%3C/svg%3E");
}
.sidebar-button[data-panel="historyTab"] .sidebar-dot {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v5h5'/%3E%3Cpath d='M3.05 13A9 9 0 1 0 6 5.3L3 8'/%3E%3Cpath d='M12 7v5l4 2'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v5h5'/%3E%3Cpath d='M3.05 13A9 9 0 1 0 6 5.3L3 8'/%3E%3Cpath d='M12 7v5l4 2'/%3E%3C/svg%3E");
}
.sidebar-button[data-panel="searchTab"] .sidebar-dot {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
}
.sidebar-button[data-panel="reportTab"] .sidebar-dot {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cline x1='8' y1='17' x2='8' y2='13'/%3E%3Cline x1='12' y1='17' x2='12' y2='11'/%3E%3Cline x1='16' y1='17' x2='16' y2='15'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cline x1='8' y1='17' x2='8' y2='13'/%3E%3Cline x1='12' y1='17' x2='12' y2='11'/%3E%3Cline x1='16' y1='17' x2='16' y2='15'/%3E%3C/svg%3E");
}
.sidebar-button[data-panel="flatsTab"] .sidebar-dot {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='2' width='16' height='20' rx='2'/%3E%3Cline x1='9' y1='6' x2='9' y2='6'/%3E%3Cline x1='15' y1='6' x2='15' y2='6'/%3E%3Cline x1='9' y1='10' x2='9' y2='10'/%3E%3Cline x1='15' y1='10' x2='15' y2='10'/%3E%3Cline x1='9' y1='14' x2='9' y2='14'/%3E%3Cline x1='15' y1='14' x2='15' y2='14'/%3E%3Cpath d='M10 22v-4h4v4'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='2' width='16' height='20' rx='2'/%3E%3Cline x1='9' y1='6' x2='9' y2='6'/%3E%3Cline x1='15' y1='6' x2='15' y2='6'/%3E%3Cline x1='9' y1='10' x2='9' y2='10'/%3E%3Cline x1='15' y1='10' x2='15' y2='10'/%3E%3Cline x1='9' y1='14' x2='9' y2='14'/%3E%3Cline x1='15' y1='14' x2='15' y2='14'/%3E%3Cpath d='M10 22v-4h4v4'/%3E%3C/svg%3E");
}
.sidebar-button[data-panel="residentsTab"] .sidebar-dot {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3Cpolyline points='9 22 9 12 15 12 15 22'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3Cpolyline points='9 22 9 12 15 12 15 22'/%3E%3C/svg%3E");
}
.sidebar-button[data-panel="fixedQrTab"] .sidebar-dot {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1'/%3E%3Cline x1='14' y1='14' x2='14' y2='14'/%3E%3Cline x1='18' y1='14' x2='21' y2='14'/%3E%3Cline x1='21' y1='17' x2='21' y2='21'/%3E%3Cline x1='14' y1='18' x2='14' y2='21'/%3E%3Cline x1='17' y1='21' x2='18' y2='21'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1'/%3E%3Cline x1='14' y1='14' x2='14' y2='14'/%3E%3Cline x1='18' y1='14' x2='21' y2='14'/%3E%3Cline x1='21' y1='17' x2='21' y2='21'/%3E%3Cline x1='14' y1='18' x2='14' y2='21'/%3E%3Cline x1='17' y1='21' x2='18' y2='21'/%3E%3C/svg%3E");
}
.sidebar-button[data-panel="userManualTab"] .sidebar-dot {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5A2.5 2.5 0 0 1 6.5 17H20'/%3E%3Cpath d='M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5A2.5 2.5 0 0 1 6.5 17H20'/%3E%3Cpath d='M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z'/%3E%3C/svg%3E");
}
/* Superadmin nav icons */
.sidebar-button[data-panel="superadminDashboardPanel"] .sidebar-dot {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='9' rx='1'/%3E%3Crect x='14' y='3' width='7' height='5' rx='1'/%3E%3Crect x='14' y='12' width='7' height='9' rx='1'/%3E%3Crect x='3' y='16' width='7' height='5' rx='1'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='9' rx='1'/%3E%3Crect x='14' y='3' width='7' height='5' rx='1'/%3E%3Crect x='14' y='12' width='7' height='9' rx='1'/%3E%3Crect x='3' y='16' width='7' height='5' rx='1'/%3E%3C/svg%3E");
}
.sidebar-button[data-panel="superadminSitesPanel"] .sidebar-dot {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='3' y1='21' x2='21' y2='21'/%3E%3Cpath d='M5 21V7l8-4v18'/%3E%3Cpath d='M19 21V11l-6-4'/%3E%3Cline x1='9' y1='9' x2='9' y2='9'/%3E%3Cline x1='9' y1='13' x2='9' y2='13'/%3E%3Cline x1='9' y1='17' x2='9' y2='17'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='3' y1='21' x2='21' y2='21'/%3E%3Cpath d='M5 21V7l8-4v18'/%3E%3Cpath d='M19 21V11l-6-4'/%3E%3Cline x1='9' y1='9' x2='9' y2='9'/%3E%3Cline x1='9' y1='13' x2='9' y2='13'/%3E%3Cline x1='9' y1='17' x2='9' y2='17'/%3E%3C/svg%3E");
}
.sidebar-button[data-panel="superadminAddSitePanel"] .sidebar-dot {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'/%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'/%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3C/svg%3E");
}
.sidebar-button[data-panel="superadminLimitsPanel"] .sidebar-dot {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E");
}
.sidebar-button[data-panel="superadminModulesPanel"] .sidebar-dot {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2l3 6 6 .9-4.5 4.2 1 6.1-5.5-3-5.5 3 1-6.1L3 8.9 9 8z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2l3 6 6 .9-4.5 4.2 1 6.1-5.5-3-5.5 3 1-6.1L3 8.9 9 8z'/%3E%3C/svg%3E");
}

.app-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pm-console .app-main {
  gap: 22px;
}

.panel-host {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel-block {
  display: none;
}

.panel-block.active {
  display: block;
}

.pm-console .panel-block.active {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.page-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  flex-wrap: wrap;
}

.page-hero-copy h2,
.page-hero-copy h3 {
  margin: 0 0 8px;
}

.page-hero-copy p {
  margin: 0;
  color: var(--pm-gray-700);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--pm-primary-soft);
  color: var(--pm-primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dashboard-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

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

.metric-card {
  position: relative;
  background: var(--pm-glass-bg-strong);
  border: 1px solid var(--pm-glass-border);
  /* ss1: colored left-accent bar */
  border-left: 3px solid var(--pm-gray-300);
  border-radius: var(--pm-radius-box);
  padding: 18px;
  box-shadow: var(--pm-glass-shadow);
  -webkit-backdrop-filter: blur(var(--pm-glass-blur)) saturate(130%);
  backdrop-filter: blur(var(--pm-glass-blur)) saturate(130%);
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  overflow: clip;
  transition: transform var(--pm-motion), box-shadow var(--pm-motion);
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(130% 60% at 16% -14%, var(--pm-glass-highlight), transparent 56%);
  opacity: 0.5;
}

.metric-card > * {
  position: relative;
  z-index: 1;
}

/* Rotate accent colors green → yellow → neutral across the KPI row (ss1 style) */
.metric-grid > .metric-card:nth-child(4n + 1) { border-left-color: var(--pm-primary); }
.metric-grid > .metric-card:nth-child(4n + 2) { border-left-color: var(--pm-yellow); }

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--pm-glass-shadow-lg);
}

/* Emphasis card: white with a green left accent + faint green wash (not a solid fill) */
.metric-card.metric-card-highlight {
  background:
    linear-gradient(180deg, rgba(115, 139, 59, 0.10), rgba(255, 255, 255, 0.92));
  color: var(--pm-black);
  border-color: var(--pm-glass-border);
  border-left-color: var(--pm-primary);
}

.metric-card.metric-card-highlight::before {
  background: radial-gradient(130% 60% at 16% -14%, rgba(255, 255, 255, 0.4), transparent 56%);
}

.metric-card.metric-card-highlight .metric-kicker {
  color: var(--pm-gray-400);
}

.metric-card.metric-card-highlight .metric-meta {
  color: var(--pm-gray-700);
}

.metric-card.metric-card-highlight .metric-value {
  color: var(--pm-black);
}

.metric-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pm-gray-400);
}

/* PMS-style KPI icon chip (top-right of each metric card) */
.metric-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.metric-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(115, 139, 59, 0.12);
  color: var(--pm-primary);
}

.metric-icon svg {
  width: 19px;
  height: 19px;
}

.metric-card.metric-card-highlight .metric-icon {
  background: rgba(115, 139, 59, 0.18);
  color: var(--pm-primary);
}

/* Match the icon chip tint to the left-accent rotation (green / yellow) */
.metric-grid > .metric-card:nth-child(4n + 2) .metric-icon {
  background: rgba(250, 203, 52, 0.22);
  color: #9a7b08;
}

.metric-value {
  font-family: "Geologica", sans-serif;
  font-size: clamp(1.8rem, 1.4rem + 1.2vw, 2.8rem);
  line-height: 1;
  color: var(--pm-black);
}

.metric-meta {
  font-size: 13px;
  color: var(--pm-gray-700);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.9fr);
  gap: 18px;
  align-items: start;
  grid-auto-rows: minmax(0, auto);
}

.chart-card,
.insight-card {
  background: var(--pm-glass-bg-strong);
  border: 1px solid var(--pm-glass-border);
  border-radius: var(--pm-radius-card);
  padding: 18px;
  box-shadow: var(--pm-glass-shadow);
  -webkit-backdrop-filter: blur(var(--pm-glass-blur)) saturate(130%);
  backdrop-filter: blur(var(--pm-glass-blur)) saturate(130%);
  align-self: start;
  min-height: 0;
  overflow: hidden;
}

.chart-card h3,
.insight-card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.chart-card p,
.insight-card p {
  margin: 0 0 16px;
  color: var(--pm-gray-700);
}

.chart-card-throughput {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chart-stage {
  position: relative;
  width: 100%;
  height: clamp(220px, 30vw, 270px);
  min-height: 220px;
  max-height: 270px;
}

.chart-stage.chart-stage-tall {
  height: clamp(248px, 34vw, 320px);
  min-height: 248px;
  max-height: 320px;
}

.chart-stage > canvas {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin: -2px 0 2px;
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--pm-gray-700);
}

.chart-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex-shrink: 0;
}

.chart-legend-swatch-primary {
  background: var(--pm-primary);
}

.chart-legend-swatch-accent {
  background: var(--pm-yellow);
}

/* The class's display:flex would otherwise override the [hidden] attribute,
   leaving the empty overlay on top of a chart that DID render. */
.chart-empty-state[hidden] {
  display: none !important;
}

.chart-empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(248, 249, 250, 0.99));
  color: var(--pm-gray-700);
}

.chart-empty-state strong {
  color: var(--pm-black);
  font-size: 15px;
}

.chart-empty-state span {
  max-width: 320px;
  font-size: 13px;
  line-height: 1.5;
}

.chart-stage.is-empty > canvas {
  pointer-events: none;
}

.chart-stage .no-data-message {
  display: none !important;
}

.dashboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.dashboard-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.dashboard-filters .field {
  min-width: 172px;
}

.dashboard-filters label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pm-gray-700);
}

.insight-list,
.status-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.insight-item,
.status-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--pm-gray-100);
  border: 1px solid var(--pm-gray-200);
}

.insight-item strong,
.status-item strong {
  font-size: 14px;
  color: var(--pm-black);
}

.insight-item span,
.status-item span {
  font-size: 13px;
  color: var(--pm-gray-700);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-pill.success {
  background: var(--pm-success-light);
  color: var(--pm-success);
}

.status-pill.warning {
  background: var(--pm-warning-light);
  color: #92400e;
}

.status-pill.danger {
  background: var(--pm-danger-light);
  color: var(--pm-danger);
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.table-toolbar h3 {
  margin: 0;
}

.section-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.summary-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--pm-gray-100);
  border: 1px solid var(--pm-gray-200);
}

.summary-item strong {
  display: block;
  font-size: 14px;
  color: var(--pm-black);
}

.summary-item span {
  font-size: 13px;
  color: var(--pm-gray-700);
}

.admin-workspace-grid,
.superadmin-workspace-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.workspace-card {
  margin-bottom: 0;
}

.workspace-wide {
  grid-column: 1 / -1;
}

/* ========== Cards ========== */
/* A1: Reusable glass surface (water-droplet sheen via ::before highlight) */
.glass,
.card {
  position: relative;
  background: var(--pm-glass-bg);
  border-radius: var(--pm-radius-card);
  padding: 20px;
  box-shadow: var(--pm-glass-shadow);
  border: 1px solid var(--pm-glass-border);
  margin-bottom: 18px;
  -webkit-backdrop-filter: blur(var(--pm-glass-blur)) saturate(135%);
  backdrop-filter: blur(var(--pm-glass-blur)) saturate(135%);
  overflow: clip;
}

.glass::before,
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  /* subtle top sheen / soft droplet specular highlight */
  background:
    radial-gradient(130% 56% at 18% -14%, var(--pm-glass-highlight), transparent 58%);
  opacity: 0.55;
}

.glass > *,
.card > * {
  position: relative;
  z-index: 1;
}

/* Graceful fallback where backdrop-filter is unsupported */
@supports not ((-webkit-backdrop-filter: blur(2px)) or (backdrop-filter: blur(2px))) {
  .glass,
  .card {
    background: var(--pm-glass-bg-strong);
  }
}

.pm-console .card {
  border-radius: var(--pm-radius-card);
}

.card h2,
.card h3,
.card h4 {
  margin-top: 0;
  margin-bottom: 12px;
}

/* ========== Login Panels ========== */
.login-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(400px, 0.85fr);
  gap: 0;
  align-items: stretch;
  /* Full-bleed: fills the entire viewport edge-to-edge (PMS-style) instead of a
     centered bordered card. Page still scrolls if content ever exceeds the
     viewport (e.g. small/zoomed screens) — never clips. */
  width: 100%;
  max-width: none;
  margin: 0;
  /* Fill the viewport; content is sized/spaced to fit one screen naturally on
     desktop (no forced clipping — it can still scroll as a fallback on very short
     screens; mobile <=768 stacks). */
  min-height: 100vh;
  border-radius: 0;
  overflow: hidden;
  border: none;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.72);
}

/* These are .card elements; drop the inherited card margin-bottom (18px) that
   otherwise pushes the login ~20px past the viewport (scroll at 100% zoom). */
.login-showcase,
.login-panel {
  margin-bottom: 0;
}

.login-panel {
  padding: clamp(24px, 2.7vw, 40px);
  /* Full-bleed: square edges so the panel meets the viewport with no rounded
     corner revealing the page background. */
  border-radius: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 0;
  position: relative;
  /* A9: flow naturally — let the WINDOW scroll (handled on body.pm-auth) rather
     than the panel scrolling internally and clipping its own content. */
  overflow: visible;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 244, 0.98));
  box-shadow: none;
}

.login-panel::before {
  content: "";
  position: absolute;
  top: -120px;
  right: -68px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(250, 203, 52, 0.18), rgba(250, 203, 52, 0) 68%);
  pointer-events: none;
}

.login-panel::after {
  content: "";
  position: absolute;
  inset: auto 26px 24px auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(115, 139, 59, 0.08), rgba(115, 139, 59, 0) 72%);
  pointer-events: none;
}

.login-panel > * {
  position: relative;
  z-index: 1;
}

.login-panel h2 {
  font-size: clamp(1.6rem, 1.2rem + 1vw, 2.1rem);
  margin-bottom: 10px;
}

.login-showcase {
  min-height: 100%;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: clamp(24px, 2.6vw, 40px);
  min-height: 0;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.1), transparent 24%),
    linear-gradient(138deg, rgba(28, 37, 15, 0.98), rgba(62, 82, 30, 0.98) 28%, rgba(115, 139, 59, 0.96) 68%, rgba(154, 176, 79, 0.9) 100%),
    radial-gradient(circle at bottom left, rgba(250, 203, 52, 0.28), transparent 34%);
  color: #f6f5f7;
  border: none;
  /* never clip the showcase content; the wrap's overflow:hidden keeps the
     rounded-card edges clean and contains the decorative glow. */
  overflow: visible;
  position: relative;
  box-shadow: none;
}

.login-showcase::after {
  content: "";
  position: absolute;
  inset: auto -6% -28% auto;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: rgba(250, 203, 52, 0.18);
  filter: blur(2px);
}

.login-showcase::before {
  content: "";
  position: absolute;
  inset: 0;
  /* Clean soft vignette — dotted texture removed per feedback */
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent 40%),
    linear-gradient(0deg, rgba(17, 17, 17, 0.12), transparent 52%);
  pointer-events: none;
  opacity: 0.6;
}

.login-brand {
  display: grid;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.login-brand-plate {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: auto;
  min-height: 0;
  /* Nudge ONLY the logo up + slightly toward center (transform doesn't reflow
     siblings, so the heading below stays put). */
  transform: translate(26px, -14px);
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  position: relative;
  overflow: visible;
}

.login-brand-plate::before {
  content: none;
}

.login-brand-wordmark {
  display: block;
  width: auto;
  /* The source PNG has heavy transparent whitespace baked around the mark, which
     made the visible logo look small. object-view-box crops to the actual mark
     (Chromium); object-fit then sizes THAT to the element height -> a much larger
     logo occupying the optimal space, no surrounding emptiness. Non-supporting
     browsers ignore object-view-box and fall back to the full image. */
  object-view-box: inset(28% 11% 29% 11%);
  height: clamp(76px, 8vw, 112px);
  max-width: min(560px, 94%);
  object-fit: contain;
  object-position: left center;
  filter: none;
}

.login-brand-heading {
  display: grid;
  gap: 6px;
  padding-top: 4px;
}

.login-brand-system {
  margin: 0;
  font-size: clamp(1.7rem, 1.3rem + 0.9vw, 2.4rem);
  line-height: 0.98;
  color: #ffffff;
  max-width: 840px;
}

.login-showcase-copy {
  position: relative;
  z-index: 1;
  margin-top: 10px;
}

.login-rotator {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 0 0 12px;
  border-radius: 0;
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(246, 245, 247, 0.82);
  position: relative;
  transition:
    opacity 260ms ease,
    transform 260ms ease,
    color var(--pm-motion);
}

.login-rotator::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  max-width: 240px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(250, 203, 52, 0.96), rgba(250, 203, 52, 0.12));
  box-shadow: 0 0 18px rgba(250, 203, 52, 0.22);
}

.login-rotator.is-leaving {
  opacity: 0;
  transform: translateY(6px);
}

.login-showcase-copy h2 {
  font-size: clamp(1.4rem, 1.15rem + 0.7vw, 1.95rem);
  line-height: 1.06;
  margin-bottom: 6px;
  color: #ffffff;
  max-width: 720px;
}

.login-showcase-copy p {
  max-width: 540px;
  color: rgba(246, 245, 247, 0.9);
  font-size: 0.9rem;
  margin-bottom: 0;
  line-height: 1.5;
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  position: relative;
  z-index: 1;
  margin-top: 16px;
}

.showcase-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: var(--pm-radius-box);
  position: relative;
  overflow: hidden;
  /* Glassmorphism: pronounced frosted glass over the green hero — bright diagonal
     fill, crisp edge highlight, depth shadow + inner glow ("liquid glass"). */
  border: 1px solid rgba(255, 255, 255, 0.30);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.30), rgba(255, 255, 255, 0.08) 60%, rgba(255, 255, 255, 0.14));
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  backdrop-filter: blur(22px) saturate(165%);
  box-shadow:
    0 14px 34px rgba(12, 20, 6, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 0 28px rgba(255, 255, 255, 0.06);
  min-height: 0;
  transition: box-shadow 220ms ease, border-color 220ms ease, background 220ms ease;
}

.showcase-item:hover {
  /* The card itself does NOT move — only the glass gets frostier/brighter and the
     internal sheen speeds up (see ::after below). */
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.12) 60%, rgba(255, 255, 255, 0.2));
  -webkit-backdrop-filter: blur(26px) saturate(185%);
  backdrop-filter: blur(26px) saturate(185%);
  box-shadow:
    0 18px 42px rgba(12, 20, 6, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 0 40px rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Keep the icon + text above the animated sheen layer. */
.showcase-item > * {
  position: relative;
  z-index: 1;
}

/* Smooth light SHEEN that glides INSIDE each glass card (the card never moves).
   Staggered per card; faster on hover. Disabled under prefers-reduced-motion. */
.showcase-item::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 36%, rgba(255, 255, 255, 0.42) 50%, transparent 64%);
  transform: translateX(-135%);
}

@media (prefers-reduced-motion: no-preference) {
  .showcase-item::after {
    animation: pmGlassSheen 5.5s ease-in-out infinite;
  }
  .showcase-grid > .showcase-item:nth-child(2)::after { animation-delay: 1.3s; }
  .showcase-grid > .showcase-item:nth-child(3)::after { animation-delay: 2.6s; }
  .showcase-grid > .showcase-item:nth-child(4)::after { animation-delay: 3.9s; }
  .showcase-item:hover::after { animation-duration: 2.4s; }
}

@keyframes pmGlassSheen {
  0%   { transform: translateX(-135%); }
  55%  { transform: translateX(135%); }
  100% { transform: translateX(135%); }
}

.showcase-item-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--pm-yellow);
  background: rgba(17, 17, 17, 0.14);
  border: 1px solid rgba(250, 203, 52, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.showcase-item-icon svg {
  width: 19px;
  height: 19px;
}

.showcase-item-body {
  display: grid;
  gap: 6px;
}

.showcase-item-body {
  gap: 3px;
}

.showcase-item strong {
  display: block;
  font-size: 0.98rem;
  color: #ffffff;
}

.showcase-item p {
  margin: 0;
  color: rgba(246, 245, 247, 0.8);
  font-size: 0.82rem;
  line-height: 1.4;
}

.login-panel-topbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 2px;
}

.login-language-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(248, 250, 244, 0.96);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.login-language-control label {
  font-size: 12px;
  font-weight: 700;
  color: var(--pm-gray-700);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.login-language-control #langSelect {
  min-height: 34px;
  width: auto;
  padding: 6px 12px;
  border-radius: 999px;
  box-shadow: none;
}

.login-panel-body {
  max-width: 430px;
  width: 100%;
  margin: 0 auto;
  /* Vertically center the sign-in content within the panel (ss2) */
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Group the welcome heading + all fields + sign-in into ONE defined box. */
.login-card-box {
  width: 100%;
  padding: clamp(16px, 1.8vw, 26px);
  border: 1px solid var(--pm-gray-200);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.login-panel-header {
  margin-bottom: 16px;
}

.login-panel-header .small {
  font-size: 14px;
  line-height: 1.7;
  color: var(--pm-gray-700);
}

/* Plain field group wrapper (no visual box — matches ss2) */
.login-fields-box {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin-bottom: 20px;
}

.login-fields-box .field-group {
  margin: 0;
}

.field-hint {
  font-size: 12px;
  color: var(--pm-gray-500);
  line-height: 1.5;
}

.input-shell {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 52px;
  border-radius: 12px;
  border: 1px solid var(--pm-gray-200);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
  transition:
    border-color var(--pm-motion),
    box-shadow var(--pm-motion),
    transform var(--pm-motion);
}

.input-shell:focus-within {
  border-color: rgba(115, 139, 59, 0.8);
  box-shadow: 0 0 0 4px rgba(115, 139, 59, 0.12);
}

.input-icon {
  /* Absolute overlay so the input (and its autofill background) spans the
     whole field — including behind the icon. */
  position: absolute;
  left: 0;
  top: 0;
  width: 44px;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--pm-gray-400);
  pointer-events: none;
  z-index: 2;
}

.input-icon svg {
  width: 18px;
  height: 18px;
}

.input-shell input {
  width: 100%;
  /* Stretch to the full shell height so the autofill background (painted on the
     input box) covers the entire field edge-to-edge — no partial/incomplete fill. */
  align-self: stretch;
  height: 100%;
  min-height: 52px !important;
  padding: 0 14px 0 44px !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: transparent !important;
  box-shadow: none !important;
}

.input-shell input:focus {
  box-shadow: none !important;
}

/* Make browser autofill fill the entire field (uniform bg, no partial blue/yellow box) */
.input-shell input:-webkit-autofill,
.input-shell input:-webkit-autofill:hover,
.input-shell input:-webkit-autofill:focus,
.input-shell input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--pm-gray-900);
  -webkit-box-shadow: inset 0 0 0 1000px #ffffff !important;
  box-shadow: inset 0 0 0 1000px #ffffff !important;
  border-radius: 12px !important;
  caret-color: var(--pm-gray-900);
  transition: background-color 100000s ease-in-out 0s;
}

.password-field input {
  padding-right: 50px !important;
}

.password-toggle {
  width: 40px;
  height: 40px;
  margin-right: 6px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--pm-gray-700);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color var(--pm-motion),
    border-color var(--pm-motion),
    box-shadow var(--pm-motion),
    transform var(--pm-motion);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
}

.password-toggle:hover {
  background: rgba(115, 139, 59, 0.08);
  border-color: rgba(115, 139, 59, 0.2);
  box-shadow: 0 8px 16px rgba(115, 139, 59, 0.08);
}

.login-submit-btn {
  width: 100%;
  min-height: 52px;
  margin-top: 10px;
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(180deg, #829948, #738b3b);
  box-shadow: 0 18px 36px rgba(115, 139, 59, 0.24);
}

.login-submit-btn:hover {
  box-shadow: 0 22px 42px rgba(115, 139, 59, 0.28);
}

.login-message {
  margin-top: 10px;
  margin-bottom: 0;
  color: var(--danger);
}

.login-panel-footer {
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  color: var(--pm-gray-400);
  font-size: 12px;
}

.login-footer-link {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--pm-primary);
  text-decoration: none;
}

.login-footer-link:hover {
  text-decoration: underline;
}

/* ===== Professional pill toggle switch + Auto-Pilot Control Center card ===== */
.autopilot-card .autopilot-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.autopilot-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--pm-primary);
  background: rgba(115, 139, 59, 0.12);
  border: 1px solid rgba(115, 139, 59, 0.20);
}
.autopilot-icon svg { width: 22px; height: 22px; }
.autopilot-control {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(115, 139, 59, 0.06);
  border: 1px solid var(--pm-gray-200);
}
.autopilot-state {
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pm-gray-600);
}
.autopilot-msg { margin-top: 12px; color: var(--pm-gray-600); }

.pm-toggle { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.pm-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.pm-toggle-track {
  width: 56px;
  height: 30px;
  border-radius: 999px;
  background: var(--pm-gray-300);
  display: inline-flex;
  align-items: center;
  padding: 3px;
  transition: background 0.25s ease;
}
.pm-toggle-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.32);
  transition: transform 0.25s ease;
}
.pm-toggle input:checked + .pm-toggle-track { background: var(--pm-primary); }
.pm-toggle input:checked + .pm-toggle-track .pm-toggle-thumb { transform: translateX(26px); }
.pm-toggle input:focus-visible + .pm-toggle-track { box-shadow: 0 0 0 4px rgba(115, 139, 59, 0.20); }
.pm-toggle input:disabled + .pm-toggle-track { opacity: 0.5; cursor: not-allowed; }

/* Compact, aligned User Management forms (were full-width + widely spread). */
#addUserForm,
#removeUserForm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
#addUserForm input,
#addUserForm select {
  flex: 1 1 170px;
  min-width: 0;
  max-width: 240px;
  margin: 0;
}
#removeUserForm input {
  flex: 0 1 240px;
  min-width: 0;
  margin: 0;
}
#addUserForm button,
#removeUserForm button {
  flex: 0 0 auto;
}

/* (Removed the max-height:940px override that forced a fixed wrap height and
   clipped the showcase. The base login is now a compact, content-sized card
   that centers and scrolls — never clips — at every zoom level.) */

@keyframes loginPulse {
  0%, 100% {
    transform: translateY(0);
    opacity: 0.9;
  }
  50% {
    transform: translateY(-1px);
    opacity: 1;
  }
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pm-date-shell {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: min(100%, 220px);
  max-width: 100%;
}

.pm-date-shell.pm-date-shell-fluid {
  width: 100%;
}

.pm-date-shell > .pm-date-text-input {
  width: 100% !important;
  padding-right: 48px !important;
  cursor: pointer;
}

.pm-date-shell > .pm-date-text-input:not([readonly]) {
  cursor: text;
}

.pm-date-trigger {
  position: absolute;
  right: 6px;
  top: 50%;
  width: 36px;
  height: 36px;
  margin: 0;
  transform: translateY(-50%);
  border-radius: 10px;
  border: 1px solid rgba(115, 139, 59, 0.16);
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(244,247,236,0.96));
  color: var(--pm-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  transition:
    transform var(--pm-motion),
    box-shadow var(--pm-motion),
    border-color var(--pm-motion),
    background-color var(--pm-motion);
}

.pm-date-trigger:hover {
  transform: translateY(-50%) translateY(-1px);
  border-color: rgba(115, 139, 59, 0.32);
  box-shadow: 0 12px 24px rgba(115, 139, 59, 0.14);
}

.pm-date-trigger:active {
  transform: translateY(-50%) scale(0.97);
}

.pm-date-trigger svg {
  width: 16px;
  height: 16px;
}

.pm-date-native-proxy {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.pm-date-popover {
  position: fixed;
  z-index: 12000;
  width: 276px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(14px);
}

.pm-date-popover[hidden] {
  display: none;
}

.pm-date-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.pm-date-popover-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--pm-gray-900);
}

.pm-date-nav {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(115, 139, 59, 0.16);
  background: linear-gradient(180deg, #ffffff, #f7f9f1);
  color: var(--pm-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.pm-date-nav svg {
  width: 16px;
  height: 16px;
}

.pm-date-nav:disabled {
  opacity: 0.36;
  cursor: not-allowed;
}

.pm-date-weekdays,
.pm-date-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.pm-date-weekdays {
  margin-bottom: 8px;
}

.pm-date-weekdays span {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--pm-gray-500);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pm-date-day {
  min-height: 34px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--pm-gray-800);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform var(--pm-motion),
    background-color var(--pm-motion),
    border-color var(--pm-motion),
    color var(--pm-motion);
}

.pm-date-day:hover {
  background: rgba(115, 139, 59, 0.1);
  border-color: rgba(115, 139, 59, 0.18);
}

.pm-date-day.is-today {
  border-color: rgba(250, 203, 52, 0.45);
  color: #8a6412;
}

.pm-date-day.is-selected {
  background: var(--pm-primary);
  color: #ffffff;
  box-shadow: 0 12px 22px rgba(115, 139, 59, 0.18);
}

.pm-date-day.is-disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

.pm-date-day-empty {
  min-height: 34px;
}

.field-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--pm-gray-700);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

/* ========== Form Controls ========== */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select,
textarea {
  width: 100%;
  min-height: var(--pm-input-h);
  padding: 11px 14px;
  border-radius: var(--pm-radius-input);
  border: 1px solid var(--pm-gray-200);
  background: #ffffff;
  color: var(--pm-gray-900);
  transition:
    border-color var(--pm-motion),
    box-shadow var(--pm-motion),
    background-color var(--pm-motion);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"])::placeholder,
textarea::placeholder {
  color: var(--pm-gray-400);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
select:focus,
textarea:focus {
  border-color: rgba(115, 139, 59, 0.8);
  box-shadow: 0 0 0 4px rgba(115, 139, 59, 0.12);
  outline: none;
}

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

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--pm-btn-h);
  padding: 10px 18px;
  border-radius: var(--pm-radius-btn);
  background: var(--accent);
  color: #ffffff;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition:
    transform var(--pm-motion),
    background-color var(--pm-motion),
    border-color var(--pm-motion),
    box-shadow var(--pm-motion);
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover {
  background: var(--accent-2);
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(115, 139, 59, 0.18);
}

.btn:active {
  transform: scale(0.97);
}

.btn.secondary {
  background: #ffffff;
  color: var(--accent);
  border-color: #cdd9af;
}

.btn.secondary:hover {
  background: var(--pm-primary-light);
  color: var(--accent);
  box-shadow: none;
}

.btn[disabled] {
  background: var(--pm-disabled);
  color: var(--pm-gray-700);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* ========== Tabs ========== */
.tabs {
  display: flex;
  flex-direction: row;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.tab {
  flex: 1;
  text-align: center;
  background: rgba(255, 255, 255, 0.5);
  padding: 11px 16px;
  border-radius: var(--pm-radius-xs);
  border: 1px solid var(--pm-glass-border);
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition:
    background-color var(--pm-motion),
    color var(--pm-motion),
    border-color var(--pm-motion),
    box-shadow var(--pm-motion);
}

.tab:hover {
  background: var(--pm-gray-100);
  color: var(--accent);
  border-color: #cdd9af;
}

.tab.active {
  background: var(--pm-primary-soft) !important;
  border-color: rgba(115, 139, 59, 0.6) !important;
  box-shadow: inset 0 0 0 1px rgba(115, 139, 59, 0.28);
  color: var(--pm-primary) !important;
}

/* A8: segmented tab control (Superadmin Active / Deleted sites, reusable) */
.seg-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  margin-bottom: 16px;
  border-radius: var(--pm-radius-box);
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--pm-glass-border);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: var(--pm-glass-shadow);
  max-width: 100%;
  flex-wrap: wrap;
}

.seg-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: var(--pm-radius-btn);
  background: transparent;
  color: var(--pm-gray-700);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color var(--pm-motion),
    color var(--pm-motion),
    box-shadow var(--pm-motion),
    border-color var(--pm-motion);
}

.seg-tab .seg-tab-ico {
  display: inline-flex;
}

.seg-tab .seg-tab-ico svg {
  width: 16px;
  height: 16px;
}

.seg-tab:hover {
  color: var(--pm-primary);
  background: rgba(115, 139, 59, 0.08);
}

.seg-tab.active {
  background: #ffffff;
  color: var(--pm-primary);
  border-color: rgba(115, 139, 59, 0.35);
  box-shadow: 0 4px 12px rgba(115, 139, 59, 0.14);
}

/* ========== Badge / Status ========== */
.badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 24px;
  padding: 4px 10px;
  border-radius: var(--pm-radius-chip);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.badge {
  min-width: 24px;
  background: var(--pm-yellow);
  color: var(--pm-black);
}

.status-badge {
  background: var(--pm-gray-100);
  color: var(--pm-gray-700);
  border: 1px solid var(--pm-gray-200);
}

.status-badge.success {
  background: var(--pm-success-light);
  color: var(--pm-success);
  border-color: rgba(22, 163, 74, 0.18);
}

.status-badge.warning {
  background: var(--pm-warning-light);
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.22);
}

.status-badge.danger {
  background: var(--pm-danger-light);
  color: var(--pm-danger);
  border-color: rgba(220, 38, 38, 0.16);
}

.status-badge.info {
  background: var(--pm-primary-light);
  color: var(--pm-primary);
  border-color: rgba(115, 139, 59, 0.18);
}

/* ========== Car List ========== */
.car-list {
  display: grid;
  gap: 12px;
}

.car-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px;
  border-radius: var(--pm-radius-btn);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), #ffffff);
  border: 1px solid var(--pm-gray-200);
  flex-wrap: wrap;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.car-left {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.car-plate {
  min-width: 96px;
  height: 56px;
  border-radius: var(--pm-radius-xs);
  background: var(--pm-black);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(2, 6, 23, 0.08);
}

.car-meta p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

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

.input-sm {
  padding: 8px 10px;
  border-radius: var(--pm-radius-xs);
  border: 1px solid var(--pm-gray-200);
}

/* ========== Payment Controls ========== */
.payment-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 8px;
}

.payment-options label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--pm-radius-chip);
  border: 1px solid var(--pm-gray-200);
  background: #ffffff;
  color: var(--pm-gray-900);
  font-weight: 600;
  cursor: pointer;
}

/* ========== Tables ========== */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--pm-glass-border);
  border-radius: var(--pm-radius-box);
  background: rgba(255, 255, 255, 0.4);
  -webkit-overflow-scrolling: touch;
}

.pm-console table {
  min-width: 100%;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
  overflow: hidden;
}

table tbody tr {
  transition: background-color var(--pm-motion);
}

table th,
table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(221, 226, 229, 0.7);
}

table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(238, 242, 227, 0.96);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-weight: 700;
  color: var(--pm-gray-700);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
}

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

table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.35);
}

table tbody tr:hover {
  background: rgba(115, 139, 59, 0.1);
}

/* ========== Module Selection Grid ========== */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.module-card {
  background: var(--pm-primary-light);
  border: 2px solid var(--pm-gray-200);
  border-radius: var(--pm-radius-card);
  padding: 16px;
  cursor: pointer;
  transition:
    border-color var(--pm-motion),
    background-color var(--pm-motion),
    box-shadow var(--pm-motion);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.module-card:hover {
  border-color: var(--accent);
  background: #ffffff;
}

.module-card.selected {
  border-color: var(--accent);
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(115, 139, 59, 0.22);
}

.module-card h4 {
  margin: 0;
  color: var(--pm-gray-900);
  font-size: 15px;
}

.module-card p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

/* ========== Toasts ========== */
.toasts {
  position: fixed;
  right: 20px;
  top: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--pm-radius-btn);
  background: #ffffff;
  border-left: 6px solid var(--accent);
  box-shadow: var(--shadow);
  min-width: 240px;
}

.toast.success {
  border-left-color: var(--success);
}

.toast.warn {
  border-left-color: var(--danger);
}

.toast .t-text {
  font-size: 14px;
  color: var(--pm-gray-900);
}

/* ========== Modal (Global) ========== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  z-index: 10000;
}

.modal-content {
  background: #ffffff;
  border-radius: var(--pm-radius-card);
  padding: 24px;
  width: 100%;
  max-width: 500px;
  box-shadow: var(--pm-shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-body {
  font-size: 14px;
  line-height: 1.5;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}

.modal-box {
  background: var(--card);
  border-radius: var(--pm-radius-card);
  padding: 20px;
  max-width: 420px;
  width: 90%;
  box-shadow: var(--pm-shadow-lg);
  animation: fadeIn 0.2s ease-in-out;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--pm-gray-700);
}

.driver-list {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0;
}

.driver-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--pm-radius-xs);
  border: 1px solid var(--pm-gray-200);
  background: var(--pm-gray-100);
  cursor: pointer;
  transition:
    background-color var(--pm-motion),
    border-color var(--pm-motion),
    transform var(--pm-motion);
}

.driver-item:hover {
  background: var(--pm-primary-light);
  border-color: var(--accent);
}

.driver-item span {
  font-size: 14px;
  font-weight: 600;
}

.driver-item small {
  color: var(--muted);
}

/* ========== Helpers ========== */
.small {
  font-size: 13px;
  color: var(--muted);
}

.kv {
  font-weight: 700;
  color: var(--pm-black);
}

.center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer {
  margin-top: auto;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 12px;
}

/* ========== Bootstrap Compatibility Layer ========== */
.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -12px;
  margin-left: -12px;
}

.col-lg-6,
.col-md-6,
.col-12 {
  padding-right: 12px;
  padding-left: 12px;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .col-md-6 {
    width: 50%;
  }
}

@media (min-width: 992px) {
  .col-lg-6 {
    width: 50%;
  }
}

.g-4 {
  gap: 24px;
}

.mb-5 {
  margin-bottom: 48px;
}

.mb-4 {
  margin-bottom: 24px;
}

.mb-3 {
  margin-bottom: 16px;
}

.mt-3 {
  margin-top: 16px;
}

.p-4 {
  padding: 24px;
}

.h-100 {
  height: 100%;
}

.text-center {
  text-align: center;
}

.fw-bold {
  font-weight: 700;
}

.text-muted {
  color: var(--pm-gray-700);
}

.text-white {
  color: #ffffff;
}

.display-4 {
  font-size: 2.25rem;
  font-weight: 700;
  font-family: "Geologica", sans-serif;
}

.display-5 {
  font-size: 1.75rem;
  font-weight: 700;
  font-family: "Geologica", sans-serif;
}

.shadow-sm {
  box-shadow: var(--pm-shadow-sm) !important;
}

.border-0 {
  border: 0 !important;
}

.rounded-top {
  border-top-left-radius: var(--pm-radius-card);
  border-top-right-radius: var(--pm-radius-card);
}

.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.bg-danger {
  background-color: var(--pm-danger) !important;
}

/* ========== Animation ========== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ========== Responsive Adjustments ========== */
@media (max-width: 1024px) {
  .container {
    max-width: 100%;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: static;
  }

  .pm-console .app-sidebar {
    min-height: auto;
  }

  .login-wrap {
    gap: 0;
  }

  .module-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .metric-grid,
  .metric-grid.metric-grid-wide,
  .dashboard-grid,
  .admin-workspace-grid,
  .superadmin-workspace-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chart-stage,
  .chart-stage.chart-stage-tall {
    height: clamp(220px, 34vw, 300px);
  }
}

@media (max-width: 900px) {
  body {
    padding: 14px;
  }

  body.pm-auth,
  body.pm-console {
    padding: 12px;
  }

  .login-wrap {
    grid-template-columns: 1fr;
    padding: 0;
    margin-top: 0;
    height: auto;
    flex: 0 0 auto;
    overflow: visible;
  }

  .pm-auth .container { min-height: 0; }
  .login-panel { overflow: visible; }

  .sidebar-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .login-panel,
  .login-showcase {
    padding: 22px;
  }

  .showcase-grid {
    grid-template-columns: 1fr;
  }

  .btn {
    font-size: 14px;
    padding: 10px 12px;
  }

  .tab {
    flex: 1 1 48%;
  }

  .toast {
    min-width: 200px;
    font-size: 13px;
  }

  .modal-content {
    padding: 18px;
  }
}

@media (max-width: 768px) {
  .header {
    gap: 12px;
  }

  .logo {
    width: 44px;
    height: 44px;
    font-size: 15px;
    border-radius: 12px;
  }

  .logo.logo-image {
    width: 104px;
    height: 44px;
    padding: 7px 12px;
  }

  .card {
    padding: 16px;
  }

  .module-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .driver-item img {
    width: 70px;
    height: 70px;
  }

  .login-wrap {
    grid-template-columns: 1fr;
    gap: 12px;
    height: auto;
    min-height: 0;
    border: none;
    box-shadow: none;
    background: transparent;
    overflow: visible;
  }

  .login-brand-plate {
    width: auto;
    min-height: 0;
  }

  .login-showcase {
    justify-content: flex-start;
    gap: 16px;
    min-height: auto;
    padding: 24px;
    overflow: visible;
  }

  /* Mobile clipping fix: don't lock the login to viewport height — let the
     page flow & scroll so Password / Sign in / footer are never cut off. */
  .pm-auth .container { min-height: 0; }
  .login-wrap { flex: 0 0 auto; }
  .login-panel {
    overflow: visible;
    justify-content: flex-start;
  }
  .login-panel-body {
    flex: 0 0 auto;
    justify-content: flex-start;
  }
  .login-brand-wordmark { max-height: 60px; }

  .login-brand {
    gap: 14px;
  }

  .login-brand-heading {
    gap: 10px;
    padding-top: 8px;
  }

  .login-brand-system {
    max-width: 10ch;
    font-size: clamp(2.5rem, 7.5vw, 4.15rem);
    line-height: 0.96;
  }

  .login-showcase-copy {
    margin-top: 10px;
  }

  .login-showcase-copy h2 {
    font-size: clamp(1.95rem, 6vw, 2.75rem);
    line-height: 1.02;
    max-width: 11ch;
  }

  .login-showcase-copy p {
    max-width: none;
    font-size: 0.94rem;
    line-height: 1.6;
  }

  .showcase-grid {
    margin-top: 18px;
    gap: 18px;
  }

  .metric-grid,
  .metric-grid.metric-grid-wide,
  .dashboard-grid,
  .admin-workspace-grid,
  .superadmin-workspace-grid {
    grid-template-columns: 1fr;
  }

  .chart-stage,
  .chart-stage.chart-stage-tall {
    height: clamp(220px, 48vw, 280px);
  }

  .car-card {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .car-left {
    width: 100%;
  }

  .car-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .car-actions .btn,
  .car-actions .input-sm {
    flex: 1 1 auto;
    min-width: 0;
  }

  .table-wrapper {
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 480px;
  }

  select,
  input[type="text"],
  input[type="number"],
  input[type="tel"],
  input[type="password"],
  input[type="email"],
  input[type="date"],
  textarea {
    font-size: 16px !important;
  }

  .modal-content,
  .modal-box {
    max-width: 96vw;
    width: 94%;
  }

  .form-row > div {
    flex-wrap: wrap !important;
  }

  form {
    flex-direction: column;
    align-items: stretch;
  }

  form > input,
  form > select,
  form > button {
    width: 100%;
    margin-right: 0;
  }
}

@media (max-width: 480px) {
  body {
    padding: 8px !important;
  }

  .utility-bar {
    justify-content: space-between;
    gap: 8px;
    padding: 0;
  }

  .sidebar-nav {
    grid-template-columns: 1fr;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .h-title {
    gap: 8px;
  }

  .logo {
    width: 36px;
    height: 36px;
    font-size: 13px;
    border-radius: 10px;
  }

  .card {
    padding: 12px;
    margin-bottom: 10px;
    border-radius: var(--pm-radius-btn);
  }

  .login-wrap {
    gap: 10px;
  }

  .login-panel,
  .login-showcase {
    padding: 18px !important;
    border-radius: 24px;
  }

  .login-showcase {
    gap: 14px;
  }

  .login-brand-plate {
    width: min(390px, 84vw);
    min-height: 102px;
  }

  .login-brand-wordmark {
    max-height: 120px;
  }

  .login-brand-system {
    font-size: clamp(2.2rem, 12vw, 3.6rem);
    max-width: 6ch;
  }

  .login-rotator {
    min-height: 24px;
    padding-bottom: 10px;
    font-size: 11px;
    letter-spacing: 0.11em;
  }

  .login-showcase-copy h2 {
    font-size: clamp(1.8rem, 9.4vw, 2.65rem);
    line-height: 1.04;
    max-width: 8.5ch;
    margin-bottom: 10px;
  }

  .login-showcase-copy p {
    font-size: 0.95rem;
    line-height: 1.58;
  }

  .showcase-item {
    min-height: 124px;
    padding: 20px;
  }

  .login-panel-topbar {
    justify-content: center;
    margin-bottom: 12px;
  }

  .login-language-control {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 8px 8px 12px;
  }

  .login-language-control label {
    font-size: 11px;
    letter-spacing: 0.05em;
  }

  .login-language-control #langSelect {
    min-width: 128px;
    padding-inline: 12px;
  }

  .login-panel-body {
    margin-top: 0;
  }

  .login-panel-header {
    margin-bottom: 18px;
  }

  .tabs {
    gap: 4px;
  }

  .tab {
    padding: 8px 6px;
    font-size: 12px;
    flex: 1 1 auto !important;
  }

  .btn {
    font-size: 13px;
    padding: 8px 10px;
  }

  table {
    font-size: 12px;
  }

  table th,
  table td {
    padding: 6px 8px;
  }

  .car-card {
    padding: 10px;
  }

  .car-left {
    gap: 8px;
    flex-wrap: nowrap;
  }

  .car-plate {
    min-width: 80px;
    height: 44px;
    font-size: 13px;
  }

  .car-meta p,
  .car-meta small {
    font-size: 12px;
  }

  .car-actions {
    gap: 6px;
    flex-wrap: wrap;
  }

  .car-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
    text-align: center;
  }

  .car-actions .input-sm {
    flex: 1 1 100%;
  }

  .input-sm {
    padding: 6px;
    font-size: 13px;
  }

  .module-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .module-card {
    padding: 12px;
  }

  .module-card h4 {
    font-size: 14px;
  }

  .module-card p {
    font-size: 12px;
  }

  .app-sidebar {
    padding: 16px;
    border-radius: 20px;
  }

  .metric-card,
  .chart-card,
  .insight-card {
    padding: 16px;
  }

  .modal-content {
    padding: 14px;
    max-width: 98vw;
  }

  .modal-box {
    padding: 14px;
    width: 96%;
    max-width: 100vw;
  }

  .modal-title {
    font-size: 16px;
  }

  .table-wrapper {
    margin: 0 -4px;
  }

  table {
    min-width: 400px;
    font-size: 11px;
  }

  table th,
  table td {
    padding: 5px 6px;
    white-space: nowrap;
  }

  .toasts {
    right: 8px;
    top: 8px;
    left: 8px;
  }

  .toast {
    min-width: auto;
    width: 100%;
    padding: 10px 14px;
  }

  .driver-list {
    max-height: 220px;
    gap: 8px;
  }

  .driver-item {
    gap: 10px;
    padding: 10px;
    flex-wrap: wrap;
  }

  .driver-item img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
  }

  .driver-item span {
    font-size: 13px;
  }

  .footer {
    font-size: 11px;
    padding: 8px;
  }

  .small {
    font-size: 12px;
  }
}

@media (max-width: 360px) {
  body {
    padding: 6px !important;
  }

  .header {
    padding: 10px;
    gap: 6px;
  }

  .logo {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .card {
    padding: 10px;
    margin-bottom: 8px;
  }

  .login-showcase,
  .login-panel {
    padding: 16px !important;
  }

  .login-brand-plate {
    width: min(300px, 86vw);
    min-height: 88px;
  }

  .login-brand-wordmark {
    max-height: 98px;
  }

  .login-brand-system {
    font-size: clamp(1.95rem, 12.2vw, 3rem);
  }

  .login-showcase-copy h2 {
    font-size: clamp(1.55rem, 8.7vw, 2.2rem);
    max-width: 9ch;
  }

  .login-language-control {
    padding: 8px 8px 8px 10px;
  }

  .login-language-control label {
    font-size: 10px;
  }

  .btn {
    font-size: 12px;
    padding: 7px 8px;
    gap: 4px;
  }

  .tab {
    padding: 6px 4px;
    font-size: 11px;
  }

  .tabs {
    gap: 3px;
  }

  .car-plate {
    min-width: 64px;
    height: 36px;
    font-size: 11px;
  }

  .toast {
    padding: 8px 10px;
    font-size: 12px;
  }

  .footer {
    font-size: 10px;
    padding: 6px;
  }
}

/* ── Additional mobile polish (360px and below) ──────────────────────────── */
@media (max-width: 480px) {
  /* Dashboard filters — prevent min-width overflow */
  .dashboard-filters .field {
    min-width: 0;
    flex: 1 1 100%;
  }

  /* Tabs — ensure they don't break layout with many items */
  .tabs {
    gap: 4px;
  }

  /* Page hero actions — stack vertically on very small screens */
  .page-hero {
    gap: 12px;
  }

  /* Metric grid — single column at mobile */
  .metric-grid,
  .metric-grid.metric-grid-wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  /* Metric cards smaller on mobile */
  .metric-card {
    min-height: 100px;
    padding: 14px;
    gap: 8px;
  }

  /* Summary/insight lists on mobile */
  .summary-list,
  .insight-list,
  .status-list {
    gap: 8px;
  }

  /* Chart stage — slightly taller on mobile to compensate for width */
  .chart-stage {
    height: clamp(220px, 60vw, 280px);
  }
}

/* ── Superadmin sidebar: compact on tablet ───────────────────────────────── */
@media (max-width: 1024px) and (min-width: 769px) {
  .app-shell {
    grid-template-columns: 200px 1fr;
  }
}

/* ========== RESPONSIVE ENHANCEMENT PACK — Session 11 ========== */

/* ── 1. Mobile sidebar → compact sticky horizontal nav bar ──────────────── */
@media (max-width: 768px) {
  /* A9 FIX: force single column on the console (the non-media
     `.pm-console .app-shell` 292px rule otherwise wins and pushes content
     off-screen on phones). Covers admin + superadmin shells. */
  .pm-console .app-shell,
  .app-shell.admin-shell,
  .app-shell.superadmin-shell {
    grid-template-columns: 1fr !important;
  }

  /* Override stacked sidebar: make it a sticky top nav strip */
  .app-shell.admin-shell {
    gap: 0;
  }

  .app-shell .app-sidebar,
  .app-shell.admin-shell .app-sidebar {
    position: sticky;
    top: 0;
    z-index: 200;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--pm-gray-200);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.07);
    min-height: 0;
    /* The base .app-sidebar rule sets height:calc(100vh - 32px) for the desktop
       full-height sidebar. On mobile that, combined with align-items:center, left
       the horizontal nav floating in a ~635px-tall empty card and pushed the page
       content down to ~y860. Size the top strip to its content instead. */
    height: auto;
  }

  .app-sidebar .sidebar-brand,
  .app-sidebar .sidebar-profile,
  .app-sidebar .sidebar-group-label {
    display: none !important;
  }

  /* Nav items as horizontal scrollable pill strip */
  .app-sidebar .sidebar-nav,
  .app-sidebar > div > .sidebar-nav {
    display: flex !important;
    flex-direction: row !important;
    grid-template-columns: none !important;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    gap: 5px;
    padding: 2px 0 6px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex: 1;
  }

  .app-sidebar .sidebar-nav::-webkit-scrollbar {
    display: none;
  }

  .app-sidebar .sidebar-button {
    flex-shrink: 0;
    width: auto !important;
    white-space: nowrap;
    padding: 7px 11px !important;
    font-size: 12.5px !important;
    border-radius: 10px !important;
    gap: 5px;
  }

  .app-sidebar .sidebar-dot {
    width: 16px !important;
    height: 16px !important;
  }
}

/* ── 2. Tabs — horizontal scroll on small screens (no wrap) ─────────────── */
.tabs {
  /* Allow overflow scroll when many tabs */
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex-wrap: nowrap;
  padding-bottom: 4px; /* room for scroll bar if shown */
}

.tabs::-webkit-scrollbar {
  display: none;
}

/* Prevent tabs from shrinking too small */
.tab {
  flex: 0 0 auto;
  min-width: max-content;
}

@media (max-width: 1024px) {
  .tab {
    flex: 1 1 auto;
    min-width: min-content;
    padding: 9px 12px;
    font-size: 13px;
  }
}

@media (max-width: 768px) {
  .tabs {
    gap: 5px;
    margin-bottom: 12px;
  }

  .tab {
    flex: 0 0 auto;
    padding: 8px 11px;
    font-size: 12px;
    min-width: 0;
  }
}

@media (max-width: 480px) {
  .tabs {
    gap: 4px;
  }

  .tab {
    padding: 7px 9px;
    font-size: 11.5px;
    border-radius: 10px;
  }
}

/* ── 3. Dashboard filter toolbar responsive ─────────────────────────────── */
.dashboard-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.dashboard-filters .field {
  flex: 1 1 140px;
  min-width: 0;
}

@media (max-width: 600px) {
  .dashboard-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .dashboard-filters {
    flex-direction: column;
    gap: 8px;
  }

  .dashboard-filters .field {
    flex: 1 1 100%;
  }
}

/* ── 4. Report / admin filter rows — wrap on small screens ──────────────── */
.report-filter-section,
.admin-filter-row,
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  max-width: 100%;
}

/* Let filter controls shrink so the row never overflows its card */
.report-filter-section > *,
.admin-filter-row > *,
.filter-row > * {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 600px) {
  .report-filter-section,
  .admin-filter-row,
  .filter-row {
    flex-direction: column;
    align-items: stretch;
  }

  .report-filter-section > *,
  .admin-filter-row > *,
  .filter-row > * {
    width: 100%;
    flex: 1 1 100%;
  }
}

/* ── 5. Table enhancements — horizontal scroll with visual cue ──────────── */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--pm-radius-xs);
  scroll-snap-type: x proximity;
}

/* Report-tab fix: `.table-responsive` had no overflow handling, so wide report
   tables pushed `.card-body` (a flex column) past its width. Make the wrapper
   scroll, and let flex children shrink (default min-width:auto blocks it). */
.table-responsive {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.card-body,
.card-body > *,
.report-filter-section {
  min-width: 0;
  max-width: 100%;
}

/* Gradient scroll hint on right side when table overflows */
@supports (background: linear-gradient(white, white) local) {
  .table-scroll-hint {
    position: relative;
  }

  .table-scroll-hint::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 32px;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.9));
    pointer-events: none;
    border-radius: 0 var(--pm-radius-xs) var(--pm-radius-xs) 0;
  }
}

@media (max-width: 768px) {
  table {
    min-width: 540px;
  }

  .table-wrapper {
    margin-inline: -4px;
    border-radius: 8px;
  }
}

@media (max-width: 480px) {
  table {
    min-width: 460px;
  }

  table th {
    font-size: 11px;
    padding: 6px 8px;
    white-space: nowrap;
  }

  table td {
    font-size: 11px;
    padding: 5px 8px;
    white-space: nowrap;
  }
}

/* ── 6. Modals — full-screen on very small phones ───────────────────────── */
@media (max-width: 480px) {
  .modal-content,
  .modal-box {
    width: 100% !important;
    max-width: 100vw !important;
    min-height: 30vh;
    border-radius: 20px 20px 0 0 !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    margin: 0 !important;
    max-height: 90vh;
    overflow-y: auto;
  }
}

/* ── 7. Sidebar compact at tablet 900–1024px ────────────────────────────── */
@media (max-width: 1024px) and (min-width: 769px) {
  .app-sidebar .sidebar-button {
    padding: 10px 11px;
    font-size: 13px;
  }

  .app-sidebar .sidebar-brand strong {
    font-size: 0.88rem;
  }

  .app-sidebar .sidebar-brand span,
  .app-sidebar .sidebar-profile span {
    font-size: 11px;
  }

  .app-sidebar .sidebar-profile {
    padding: 10px 12px;
  }
}

/* ── 8. Cards in metric grids: responsive padding/font ─────────────────── */
@media (max-width: 900px) {
  .metric-card {
    padding: 14px 16px;
    min-height: 90px;
  }

  .metric-value {
    font-size: 1.8rem;
  }

  .metric-kicker {
    font-size: 10.5px;
  }
}

/* ── 9. Page hero responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .page-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 18px;
  }

  .page-hero-copy h2 {
    font-size: 1.35rem;
  }

  .page-hero-copy p {
    font-size: 0.88rem;
  }
}

/* ── 10. Dashboard insight cards — stack on mobile ──────────────────────── */
@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr !important;
  }

  .insight-card {
    padding: 16px;
  }

  .chart-card {
    padding: 16px;
  }

  .chart-stage-tall {
    height: clamp(240px, 55vw, 340px) !important;
  }
}

/* ── 11. Admin workspace grid — single column on phone ──────────────────── */
@media (max-width: 600px) {
  .admin-workspace-grid,
  .superadmin-workspace-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .workspace-card {
    min-width: 0;
  }
}

/* ── 12. Action stack buttons — full width on phone ─────────────────────── */
@media (max-width: 600px) {
  .admin-action-stack {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .admin-action-stack .btn {
    width: 100%;
    justify-content: center;
  }

  .admin-date-filter,
  .admin-date-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .admin-date-filter > *,
  .admin-date-bar > * {
    flex: 1 1 100% !important;
    min-width: 0 !important;
  }
}

/* ── 13. Forms inside cards — stack on mobile ───────────────────────────── */
@media (max-width: 600px) {
  .form-grid,
  .form-row {
    flex-direction: column !important;
    gap: 8px;
  }

  .form-grid > *,
  .form-row > * {
    width: 100% !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }
}

/* ── 14. Header responsive — compact on phone ───────────────────────────── */
@media (max-width: 600px) {
  .header {
    padding: 10px 12px;
    gap: 8px;
  }

  .header .h-title {
    gap: 8px;
  }
}

/* ── Print: hide controls, keep charts and tables ────────────────────────── */
@media print {
  .app-sidebar,
  .tabs,
  .btn,
  .header-actions,
  .utility-bar,
  .footer,
  .modal-overlay,
  .toasts {
    display: none !important;
  }
  .container {
    padding: 0;
  }
  .card {
    box-shadow: none;
    border: 1px solid #e0e0e0;
  }
  .chart-stage {
    page-break-inside: avoid;
  }
}

/* ── Mobile top-nav strip: make the admin/superadmin nav horizontally scrollable
   (final pass, 2026-06-17). On phones (<=768px) .app-sidebar becomes a horizontal
   strip; the unnamed flex wrapper between .app-sidebar and .sidebar-nav had
   min-width:auto, so it could not shrink below its content width — the inner nav
   stayed at full width (~1074px) and was clipped by the sidebar (far-right items
   like History/Search/Dashboard/Report/User Manual were unreachable). Allowing the
   wrapper to shrink lets the inner .sidebar-nav own the horizontal scroll, and a
   thin visible scrollbar makes the swipe discoverable. ──────────────────────── */
@media (max-width: 768px) {
  .app-shell .app-sidebar,
  .app-shell.admin-shell .app-sidebar,
  .app-shell.superadmin-shell .app-sidebar {
    overflow-x: auto;
    overflow-y: hidden;
  }
  .app-sidebar > div {
    min-width: 0;
    flex: 1 1 0%;
  }
  .app-sidebar .sidebar-nav,
  .app-sidebar > div > .sidebar-nav {
    min-width: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(115, 139, 59, 0.4) transparent;
  }
  .app-sidebar .sidebar-nav::-webkit-scrollbar {
    display: block;
    height: 4px;
  }
  .app-sidebar .sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(115, 139, 59, 0.4);
    border-radius: 999px;
  }
}
