/* Kill default page gutters */
html, body {
    height: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
    height: 100%;
    background: var(--bg); /* keep your theme background */
}
* { box-sizing: border-box; }


/* ============================
    Global theme tokens (shared)
   ============================ */
:root {
  /* colors – light default */
    --bg:#ffffff; --surface:#f7f8fa; --surface-2:#eef1f5;
    --text:#0b1020; --muted:#5b6475; --border:#d8dee9;

    --primary:#6ea8fe; --primary-contrast:#0b1020;
    --success:#2ecc71; --warning:#f39c12; --error:#ff6b6b;

    /* form surfaces */
    --field-bg:#ffffff; --field-border:#cfd6e4; --field-bg-focus:#ffffff;
    --focus-ring:rgba(110,168,254,.3);

    /* layout + radii + shadows */
    --radius-xs:6px; --radius-sm:8px; --radius-md:10px; --radius-lg:16px;
    --space-1:6px; --space-2:10px; --space-3:12px; --space-4:16px; --space-5:20px;

    --shadow-lg:0 20px 40px rgba(0,0,0,.18);
    --shadow-md:0 10px 20px rgba(0,0,0,.12);

    --brand:   #ff8a00;   /* primary orange */
    --brand-2: #ff5c33;   /* gradient mate */
    --on-brand:#ffffff;
}

/* ===== Customer page tokens (provide defaults) ===== */
:root {
  /* Links */
  --link: color-mix(in oklab, var(--primary) 85%, var(--text));

  /* Panels / cards */
  --panel-bg: var(--surface);
  --panel-border: var(--border);
  --panel-shadow: var(--shadow-md);

  /* Inputs */
  --input-bg: var(--field-bg);
  --input-border: var(--field-border);
  --input-text: var(--text);
  --input-placeholder: var(--muted);

  /* Buttons */
  --btn-bg: var(--primary);
  --btn-border: var(--primary);
  --btn-text: var(--primary-contrast);

  /* Optional soft page background token used by customer page */
  --surface-1: var(--surface-2);
}

/* Dark theme refinements */
@media (prefers-color-scheme: dark) {
  :root {
    --panel-bg: var(--surface);
    --panel-border: var(--border);
    --panel-shadow: var(--shadow-md);
    --input-bg: var(--field-bg);
    --input-border: var(--field-border);
    --input-text: var(--text);
    --input-placeholder: var(--muted);
    --btn-bg: var(--primary);
    --btn-border: var(--primary);
    --btn-text: var(--primary-contrast);
    --surface-1: var(--surface-2);
  }
}

/* Dark theme (auto) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg:#0b0f17; --surface:#101624; --surface-2:#0f1422;
        --text:#eaeef6; --muted:#b7c0d0; --border:rgba(255,255,255,.12);

        --primary:#6ea8fe; --primary-contrast:#0b1020;
        --success:#7ee787; --warning:#f6c86e; --error:#ff6b6b;

        --field-bg:rgba(255,255,255,.06);
        --field-border:rgba(255,255,255,.15);
        --field-bg-focus:rgba(255,255,255,.09);
        --focus-ring:rgba(110,168,254,.25);

        --shadow-lg:0 24px 48px rgba(0,0,0,.38);
        --shadow-md:0 12px 24px rgba(0,0,0,.22);

        --brand:#ff8a00;
        --brand-2:#ff5c33;
        --on-brand:#ffffff;
    }
}

/* If you use manual theme toggling, mirror these too */
:root[data-theme="light"] {
    color-scheme: light;

    /* RESET ALL CORE LIGHT TOKENS */
    --bg:#ffffff;
    --surface:#f7f8fa;
    --surface-2:#eef1f5;

    --text:#0b1020;
    --muted:#5b6475;
    --border:#d8dee9;

    --primary:#ff8a00;
    --primary-contrast:#0b1020;

    --field-bg:#ffffff;
    --field-border:#cfd6e4;
    --field-bg-focus:#ffffff;

    --focus-ring:rgba(110,168,254,.3);

    /* (optional) keep these if you use them */
    --panel-bg: var(--surface);
    --panel-border: var(--border);
    --panel-shadow: var(--shadow-md);
    --input-bg: var(--field-bg);
    --input-border: var(--field-border);
    --input-text: var(--text);
    --input-placeholder: var(--muted);
    --btn-bg: var(--primary);
    --btn-border: var(--primary);
    --btn-text: var(--primary-contrast);
    --surface-1: var(--surface-2);
}

:root[data-theme="dark"]{
    --panel-bg: var(--surface);
    --panel-border: var(--border);
    --panel-shadow: var(--shadow-md);
    --input-bg: var(--field-bg);
    --input-border: var(--field-border);
    --input-text: var(--text);
    --input-placeholder: var(--muted);
    --btn-bg: var(--primary);
    --btn-border: var(--primary);
    --btn-text: var(--primary-contrast);
    --surface-1: var(--surface-2);
}


/* Manual overrides (match schedule.css) */
:root[data-theme="light"] {
  color-scheme: light;

  /* keep brandy orange in light mode across the site */
  --primary:#ff8a00; --primary-contrast:#0b1020;

  /* ensure off-white containers if you prefer */
  /* (pages can opt into --surface-2 for softer cards) */
}
:root[data-theme="dark"] {
  color-scheme: dark;

  /* make dark mode dark gray (not pitch black) */
  --bg:#121212; --surface:#1e1e1e; --surface-2:#2a2a2a;
  --text:#ffffff; --muted:#c8c8c8; --border:#333;

  --primary:#ff8a00; --primary-contrast:#121212;

  --field-bg:#1a1a1a; --field-border:#3a3a3a; --field-bg-focus:#222;
  --focus-ring:rgba(255,138,0,.35);
}

/* ====== Base ====== */
html, body { 
    background:var(--bg); color:var(--text);
}
* { box-sizing:border-box; }
a { color: color-mix(in oklab, var(--primary) 85%, var(--text)); }
a:hover { filter:brightness(1.08); }

/* Body background: keep orange gradient in LIGHT mode only */
:root[data-theme="light"] body.is-brand-hero {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
    background-attachment: fixed; /* makes it span scrolling */
    background-repeat: no-repeat;
    background-size: cover;       /* fills the viewport */
    min-height: 100%;
}

.site-title {
    font-size: 2.5rem;       /* bigger text, adjust to taste */
    font-weight: 700;        /* bold for emphasis */
    line-height: 1.2;
    color: var(--text);      /* default readable color */
}

:root[data-theme="light"] body.is-brand-hero .site-title {
    color: var(--on-brand);
    text-shadow: 0 1px 2px rgba(0,0,0,.25); /* optional legibility boost */
}

/* Common containers/cards/buttons that pages can use */
.container-soft { background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-lg); box-shadow:var(--shadow-md); }

.card-soft { background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-md); box-shadow:var(--shadow-md); }

.btn,
button {
  display:inline-flex; align-items:center; gap:.5rem;
  padding:10px 14px; border-radius:var(--radius-sm);
  border:2px solid var(--primary);
  background:var(--surface-2); color:var(--text);
  cursor:pointer; transition:box-shadow .15s ease, transform .02s ease;
}
.btn.primary { background:var(--primary); color:var(--primary-contrast); }
.btn:hover, button:hover { box-shadow:0 0 0 3px var(--focus-ring); }

/* Theme toggle button (shared) */
.btn-theme {
  display:inline-flex; align-items:center; gap:.5rem;
  padding:8px 12px; border-radius:var(--radius-sm); border:1px solid var(--border);
  background:var(--surface-2); color:var(--text); cursor:pointer;
}
.btn-theme i { opacity:.9; }

/* Utility for “off-white” main container on light mode */
:root[data-theme="light"] .use-surface-2 { background:var(--surface-2) !important; }

.company-logo {
  height: 100px;     /* pick the exact size you want */
  width: auto;      /* preserve aspect ratio */
  display: block;   /* avoids baseline gaps */
}

.site-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;   /* spacing inside header */
}
.site-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 1rem;
}

.login-card {
  width: 100%;
  max-width: 400px;   /* desktop/tablet width */
  padding: 2rem;
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  box-shadow: var(--shadow-lg);
}

/* Inputs + labels look better stacked */
.login-card form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 600;
  font-size: 0.9rem;
}

.login-card input {
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 1rem;
}

/* Mobile tweaks */
@media (max-width: 480px) {
    .login-card {
        max-width: 100%;     /* fill available space */
        padding: 1.25rem;    /* tighter padding */
    }
    .site-title {
        font-size: 1.5rem;   /* shrink the title */
    }
    .company-logo {
        height: 72px;        /* shrink logo a bit */
    }
}
.login-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
}

.mini-logo {
    height: 75px;  /* adjust size */
    width: auto;
}

.form-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;   /* adds space from window edges */
  justify-content: center; /* center it on login page */
}

.app-logo {
  height: 80px;       /* default size for full pages */
  width: auto;
  display: block;
}

.app-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.2;
}

/* Smaller header variant for login pages */
.login-page .app-header .app-logo {
  height: 65px;
}

.login-page .app-header .app-title {
  font-size: 1.5rem;
}

.app-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-logo {
  height: 80px;  /* adjust as needed */
  width: auto;
  display: block;
}

.app-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.2;
}

/* Smaller header variant on login pages */
.login-page .app-logo { height: 40px; }
.login-page .app-title { font-size: 1.5rem; }

/* Actions area */
.app-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* Profile trigger button */
.profile-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}

/* Dropdown */
.profile-menu {
  position: relative;
}

.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 6px;
  display: none;          /* hidden by default */
  z-index: 1000;
}

.dropdown.open {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  color: var(--text);
  text-decoration: none;
}

.dropdown-item:hover {
  background: var(--surface-2);
}

/* Make the login header centered while keeping actions on the right when present */
.login-page .app-header {
  justify-content: center;
}

:root[data-theme="dark"] .login-page .app-header {
  background: #2b2f38;                 /* grey header background in dark mode */
  border-bottom: 1px solid var(--border);
  justify-content: space-between;      /* keep actions on the right if present */
}

:root[data-theme="dark"] .login-page .app-header .app-title {
  color: var(--brand);                  /* brand-colored text */
}

:root[data-theme="dark"] .login-page .app-header .btn-theme,
:root[data-theme="dark"] .login-page .app-header .profile-trigger {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);   /* light = white, dark = dark bg */
}

/* full-width header bar */
.app-header--bar {
  width: 100%;
  justify-content: center;      /* center logo+title on login */
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

/* header bar colors by theme */
:root[data-theme="light"] .app-header--bar {
  background: #f7f8fa;          /* light grey bar */
}
:root[data-theme="dark"] .app-header--bar {
  background: #2b2f38;          /* grey bar in dark mode */
}

/* title color per theme on login */
:root[data-theme="light"] .app-header--bar .app-title { color: var(--text); }
:root[data-theme="dark"]  .app-header--bar .app-title { color: var(--brand); }

/* smaller logo/title on login header */
.app-header--bar .app-logo  { height: 40px; width: auto; display: block; }
.app-header--bar .app-title { font-size: 1.5rem; margin: 0; line-height: 1.2; }

/* center the card in remaining space, no weird gaps */
.login-main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 16px;
}

/* your existing card styles apply; keep for clarity */
.login-card {
  width: 100%;
  max-width: 400px;
  padding: 2rem;
  border-radius: var(--radius-lg);
  background: var(--surface-2);   /* light grey on light mode */
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

/* Tighten spacing on small screens */
@media (max-width: 480px) {
  .app-header--bar .app-title { font-size: 1.25rem; }
  .app-header--bar .app-logo  { height: 36px; }
  .login-card { padding: 1.25rem; }
}

/* --- LOGIN CARD HEADER (inside the card, above the form) --- */
.login-card .app-header.app-header--in-card {
  background: transparent;      /* no bar inside the card */
  border: 0;
  padding: 0 0 12px 0;
  justify-content: center;
}

.login-card .app-header.app-header--in-card .app-logo {
  height: 40px;
  width: auto;
}

.login-card .app-header.app-header--in-card .app-title {
  font-size: 1.5rem;
  margin: 0;
  line-height: 1.2;
}

/* --- SITE HEADER BAR (top of normal pages) --- */
/* Give your site header element a distinguishing class in base.html, e.g.:
   <header class="app-header app-header--site"> ... */
:root[data-theme="dark"] .app-header--site {
  background: #2b2f38;          /* grey bar in dark mode */
  border-bottom: 1px solid var(--border);
}

:root[data-theme="light"] .app-header--site {
  background: transparent;       /* or #f7f8fa if you prefer a light bar */
  border-bottom: 0;              /* set to 1px if you want a divider in light mode */
}

/* Title color on the dark site header */
:root[data-theme="dark"] .app-header--site .app-title {
  color: var(--brand);
}

/* Keep the site header layout consistent */
.app-header--site {
  display: flex;
  align-items: center;
  justify-content: space-between;  /* title/left vs actions/right */
  gap: 12px;
  padding: 16px 24px;
}
.app-header--site .app-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.app-header--site .app-logo { height: 80px; width: auto; display: block; }
.app-header--site .app-title { font-size: 2rem; font-weight: 700; margin: 0; line-height: 1.2; }

.app-header--site {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 24px 32px;   /* ↑ increase vertical padding */
  position: relative;
}

/* Center group (logo + title) */
.app-header-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Logo + title */
.app-logo { height: 80px; width: auto; display: block; }
.app-title { font-size: 2rem; font-weight: 700; margin: 0; line-height: 1.2; }

/* Right-side actions */
.app-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-self: end;
}

.btn-theme,
.profile-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  font-size: 1.4rem;
  border-radius: var(--radius-md);
  padding: 0; /* no padding, keeps icon centered */
}

/* Normalize Font Awesome icon alignment */
.btn-theme i,
.profile-trigger i {
  line-height: 1;      /* remove extra vertical padding */
  margin: 0;           /* reset margin */
  font-size: 1.3em;    /* size tweak */
  vertical-align: middle;
  position: relative;
  top: 1px;            /* nudge down if it looks too high */
}

/* Base (phones) */
.app-header--site {
  /* tall enough to give top/bottom space without crowding small screens */
  padding: 14px 20px;          /* vertical | horizontal */
}
.app-header--site .app-logo {
  height: 56px;                /* smaller logo on phones */
}
.app-header--site .app-title {
  font-size: 1.6rem;
}

/* Tablets and up */
@media (min-width: 600px) {
  .app-header--site { padding: 18px 28px; }
  .app-header--site .app-logo { height: 68px; }
  .app-header--site .app-title { font-size: 1.8rem; }
}

/* Laptops/desktop */
@media (min-width: 900px) {
  .app-header--site { padding: 22px 32px; }  /* more vertical breathing room */
  .app-header--site .app-logo { height: 80px; }
  .app-header--site .app-title { font-size: 2rem; }
}

/* XL screens */
@media (min-width: 1280px) {
  .app-header--site { padding: 24px 40px; }
  .app-header--site .app-logo { height: 84px; }
  .app-header--site .app-title { font-size: 2.1rem; }
}

/* ===== Responsive login card header ===== */
.login-card .app-header--in-card {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* Base (phones) */
.login-card .app-header--in-card .app-logo {
  height: 36px;
}
.login-card .app-header--in-card .app-title {
  font-size: 1.25rem;
}

/* Tablets */
@media (min-width: 600px) {
  .login-card .app-header--in-card .app-logo {
    height: 44px;
  }
  .login-card .app-header--in-card .app-title {
    font-size: 1.4rem;
  }
}

/* Laptops/desktop */
@media (min-width: 900px) {
  .login-card .app-header--in-card .app-logo {
    height: 52px;
  }
  .login-card .app-header--in-card .app-title {
    font-size: 1.6rem;
  }
}

/* XL screens */
@media (min-width: 1280px) {
  .login-card .app-header--in-card .app-logo {
    height: 60px;
  }
  .login-card .app-header--in-card .app-title {
    font-size: 1.75rem;
  }
}

/* Ensure login card header stays centered and has no bar bg */
.login-card .app-header--in-card {
  background: transparent !important;
  border: 0;
  justify-content: center;
}

/* Also make sure its children align correctly */
.login-card .app-header--in-card .app-header-left {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}
:root[data-theme="light"] .login-page {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
}

/* Dark mode login background stays dark */
:root[data-theme="dark"] .login-page {
  background: var(--bg);
}

/* Make the login card bigger */
.login-card {
  max-width: 480px;         /* was 400px */
  padding: 2.5rem;          /* a bit more breathing room */
}

/* Inputs */
.login-card input {
  font-size: 1.1rem;        /* bigger text */
  padding: 14px 12px;       /* taller fields */
}

/* Labels */
.login-card form label {
  font-size: 1rem;          /* bump label size */
  gap: 6px;                 /* more space between label and input */
}

/* Button */
.login-card button {
  font-size: 1.1rem;        /* bigger text */
  padding: 14px;            /* taller button */
}

@media (min-width: 768px) {
  .login-card {
    max-width: 520px;
    padding: 3rem;
  }
}

/* Scale the Hub Login header inside the login card */
.login-card .app-header--in-card .app-title {
  font-size: 1.75rem;   /* larger than before */
  font-weight: 700;
}

/* Make the mini logo a bit bigger to match */
.login-card .app-header--in-card .app-logo {
  height: 52px;        /* was ~40px */
  width: auto;
}

/* Scale further on medium+ screens */
@media (min-width: 768px) {
  .login-card .app-header--in-card .app-title {
    font-size: 2rem;
  }
  .login-card .app-header--in-card .app-logo {
    height: 60px;
  }
}

/* Light mode: form card pure white */
:root[data-theme="light"] .login-card {
  background: #ffffff;
  border: 1px solid var(--border);
}

/* Dark mode: keep contrast */
:root[data-theme="dark"] .login-card {
  background: var(--surface-2); /* stays dark grey */
  border: 1px solid var(--border);
}

:root[data-theme="light"] .login-card {
  background: #ffffff;
  color: var(--text);                 /* ensure dark text inside the card */
  border: 1px solid var(--border);
}

/* Title inside the card */
:root[data-theme="light"] .login-card .app-header--in-card .app-title {
  color: var(--text);
}

/* Labels */
:root[data-theme="light"] .login-card form label {
  color: var(--text);
}

/* Inputs */
:root[data-theme="light"] .login-card input {
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--field-border);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.04);
}

:root[data-theme="light"] .login-card input::placeholder {
  color: #9aa4b2;                     /* slightly muted placeholder */
}

:root[data-theme="light"] .login-card input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Button contrast on white card */
:root[data-theme="light"] .login-card .btn.primary {
  background: var(--primary);
  color: var(--primary-contrast);
  border-color: var(--primary);
}

:root[data-theme="light"] .login-card {
  background: #ffffff !important;
  color: #0b1020 !important;                /* dark text */
  border: 1px solid var(--border) !important;
}

/* Header title inside the login card */
:root[data-theme="light"] .login-card .app-header--in-card .app-title {
  color: #0b1020 !important;
}

/* Labels */
:root[data-theme="light"] .login-card form label {
  color: #0b1020 !important;
}

/* Inputs (text visible + clear borders) */
:root[data-theme="light"] .login-card input {
  background: #ffffff !important;
  color: #0b1020 !important;
  border: 1px solid var(--field-border) !important;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.04) !important;
}

:root[data-theme="light"] .login-card input::placeholder {
  color: #9aa4b2 !important;
}

:root[data-theme="light"] .login-card input:focus {
  outline: none !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--focus-ring) !important;
}

/* Primary button contrast */
:root[data-theme="light"] .login-card .btn.primary {
  background: var(--primary) !important;
  color: var(--primary-contrast) !important;
  border-color: var(--primary) !important;
}

/* Stronger, defined inputs for LIGHT mode */
:root[data-theme="light"] .login-card input {
  background: #fafafa;                       /* slightly off-white */
  border: 2px solid #d0d7e2;                 /* thicker, clearer border */
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 1.1rem;
  color: #0b1020;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

:root[data-theme="light"] .login-card input:focus {
  background: #ffffff;                       /* pure white when active */
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus-ring);   /* highlight ring */
  outline: none;
}

/* Dark mode inputs — keep contrast but defined */
:root[data-theme="dark"] .login-card input {
  background: #1c1c1c;
  border: 2px solid #3a3a3a;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 1.1rem;
  color: #f1f1f1;
}

:root[data-theme="dark"] .login-card input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: none;
}
:root[data-theme="light"] .login-card input {
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.08);
}

/* ==== LOGIN FORM INPUTS (HIGH VISIBILITY) ==== */

/* Light mode */
:root[data-theme="light"] .login-card input {
  background: #f5f7fa;                     /* light grey so it pops on white card */
  border: 2px solid #b0b9c6;               /* darker border for visibility */
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 1.1rem;
  color: #0b1020;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);  /* inner shadow for depth */
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

:root[data-theme="light"] .login-card input:focus {
  background: #ffffff;                     /* pure white when active */
  border-color: var(--primary);            /* bright orange border */
  box-shadow: 0 0 0 3px var(--focus-ring); /* glowing ring */
  outline: none;
}

/* Dark mode */
:root[data-theme="dark"] .login-card input {
  background: #1e1e1e;                     /* solid dark box */
  border: 2px solid #444;                  /* strong border */
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 1.1rem;
  color: #f1f1f1;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.6);
}

:root[data-theme="dark"] .login-card input:focus {
  border-color: var(--primary);            /* orange border highlight */
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: none;
}
/* Light mode inputs — very defined */
:root[data-theme="light"] .login-card input {
  background: #f9fafc;                         /* slightly off-white */
  border: 2px solid #8a94a6;                   /* darker grey border */
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 1.1rem;
  color: #0b1020;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2); /* inner shadow for depth */
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

:root[data-theme="light"] .login-card input:focus {
  background: #ffffff;
  border-color: var(--primary);                /* brand orange border */
  box-shadow: 0 0 6px rgba(255,138,0,0.6);     /* outer glow on focus */
  outline: none;
}

/* Dark mode inputs — keep contrast strong */
:root[data-theme="dark"] .login-card input {
  background: #1a1c1e;
  border: 2px solid #666;
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 1.1rem;
  color: #f1f1f1;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.6);
}

:root[data-theme="dark"] .login-card input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 6px rgba(255,138,0,0.6);
  outline: none;
}

/* Primary button — bigger, bold, hover shadow */
.login-card .btn.primary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 14px;
  width: 100%;
  background: var(--primary);
  color: var(--primary-contrast);
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.login-card .btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.3), 0 0 0 3px rgba(255,138,0,0.3);
  cursor: pointer;
}
/* === FINAL OVERRIDE: make login inputs clearly visible === */

/* LIGHT MODE */
:root[data-theme="light"] body .login-page .login-card form input[type="email"],
:root[data-theme="light"] body .login-page .login-card form input[type="password"] {
  background: #f2f4f8 !important;            /* light grey so it shows on white card */
  color: #0b1020 !important;                  /* dark text */
  border: 2px solid #7b8798 !important;       /* darker border */
  border-radius: 10px !important;
  padding: 14px 16px !important;
  font-size: 1.1rem !important;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.18) !important;
}

:root[data-theme="light"] body .login-page .login-card form input[type="email"]:focus,
:root[data-theme="light"] body .login-page .login-card form input[type="password"]:focus {
  background: #ffffff !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--focus-ring) !important;
  outline: none !important;
}

:root[data-theme="light"] body .login-page .login-card form label {
  color: #0b1020 !important;
  font-weight: 600 !important;
}

/* DARK MODE */
:root[data-theme="dark"] body .login-page .login-card form input[type="email"],
:root[data-theme="dark"] body .login-page .login-card form input[type="password"] {
  background: #1a1c1f !important;
  color: #f1f1f1 !important;
  border: 2px solid #5a5f66 !important;
  border-radius: 10px !important;
  padding: 14px 16px !important;
  font-size: 1.1rem !important;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.6) !important;
}

:root[data-theme="dark"] body .login-page .login-card form input[type="email"]:focus,
:root[data-theme="dark"] body .login-page .login-card form input[type="password"]:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--focus-ring) !important;
  outline: none !important;
}

/* Placeholders */
:root[data-theme="light"] .login-card ::placeholder { color: #9aa4b2 !important; }
:root[data-theme="dark"]  .login-card ::placeholder { color: #b7bdc6 !important; }

/* Make the primary button feel clickable with a hover shadow */
.login-card .btn.primary {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%;
  font-size: 1.1rem; font-weight: 600;
  padding: 14px;
  border-radius: 10px;
  background: var(--primary); color: var(--primary-contrast); border: none;
  box-shadow: 0 4px 10px rgba(0,0,0,.2);
  transition: transform .15s ease, box-shadow .15s ease;
}
.login-card .btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0,0,0,.28), 0 0 0 3px rgba(255,138,0,.28);
  cursor: pointer;
}
.alerts { margin-bottom: 12px; display: grid; gap: 8px; }

.alert {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
}
.alert.error   { border-color: #ff6b6b; background: #ffecec; color: #7a0b0b; }
.alert.success { border-color: #2ecc71; background: #eafff1; color: #114d2a; }
.alert.info    { border-color: #6ea8fe; background: #eef5ff; color: #0b2f6b; }

/* Customer page container + panel */
.customer-wrap {
  padding: 24px 0;
  background: var(--surface-1, #f6f7f9);
}

[data-theme="dark"] .customer-wrap {
  background: var(--surface-1, #0f1114);
}

.customer-panel {
  background: var(--panel-bg, #fff);
  border: 1px solid var(--panel-border, rgba(0,0,0,.08));
  border-radius: 14px;
  box-shadow: var(--panel-shadow, 0 8px 28px rgba(0,0,0,.08));
  padding: 20px;
}

.customer-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  justify-content: space-between;
  margin-bottom: 16px;
}

.customer-meta {
  display: flex; gap: .5rem; flex-wrap: wrap; font-size: .9rem; opacity: .85;
}

.customer-section {
  background: transparent;
  border-top: 1px solid var(--panel-border, rgba(0,0,0,.08));
  padding-top: 16px;
  margin-top: 16px;
}

.customer-grid-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}

.pill {
  display: inline-block; padding: 4px 8px; border-radius: 999px;
  background: rgba(0,0,0,.06);
}
[data-theme="dark"] .pill { background: rgba(255,255,255,.08); }

/* =========================
   GLOBAL + COMMON ELEMENTS
   ========================= */
html, body {
  background: var(--bg);
  color: var(--text);
}

a { color: var(--link); }
.muted { color: var(--muted); }

/* Customer page container/panel */
.customer-wrap { background: var(--surface-1); padding: 24px 0; }

.customer-header h1 { color: var(--text); }
.customer-meta .pill {
  background: color-mix(in oklab, var(--panel-border) 25%, transparent);
  color: var(--text);
}

/* Buttons */
.btn {
  background: var(--panel-bg);
  color: var(--text);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 6px 10px;
}
.btn.primary {
  background: var(--btn-bg);
  border-color: var(--btn-border);
  color: var(--btn-text);
}
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* Forms (inputs, selects, textareas) */
input[type="text"], input[type="date"], input[type="search"],
input[type="tel"], input[type="email"], textarea, select {
  background: var(--input-bg) !important;
  color: var(--input-text) !important;
  border: 1px solid var(--input-border) !important;
  border-radius: 8px;
  padding: 8px;
}
input::placeholder, textarea::placeholder { color: var(--input-placeholder); }
input:focus, textarea:focus, select:focus {
  outline: none;
  box-shadow: var(--focus-ring);
  border-color: var(--link) !important;
}

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table thead th {
  background: var(--table-head-bg);
  color: var(--table-head-text);
  text-align: left;
  padding: 8px;
  border-bottom: 1px solid var(--table-row-border);
}
.table tbody td {
  padding: 8px;
  border-bottom: 1px solid var(--table-row-border);
}

/* Modal shells (if you have a .modal-content, use vars) */
.modal .modal-content {
  background: var(--panel-bg);
  color: var(--text);
  border: 1px solid var(--panel-border);
}

/* Floating quick editor overlay panel gets text from vars */
#qjf input, #qjf textarea, #qjf select {
  background: var(--input-bg) !important;
  color: var(--input-text) !important;
  border-color: var(--input-border) !important;
}

/* Reusable “app card” – same feel as the login card */
.app-card {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 20px; /* same padding as your customer-panel */
}

/* Ensure clear contrast per theme */
:root[data-theme="light"] .app-card { background: #ffffff; }
:root[data-theme="dark"]  .app-card { background: var(--surface-2); }

/* Make sure headings and small meta text stay readable */
.app-card h1, .app-card h2, .app-card h3,
.app-card .muted, .app-card p, .app-card li {
  color: var(--text);
}

/* Inputs/buttons inside the card follow theme tokens (strong contrast) */
.app-card input, .app-card textarea, .app-card select {
  background: var(--input-bg) !important;
  color: var(--input-text) !important;
  border: 1px solid var(--input-border) !important;
  border-radius: 8px;
  padding: 8px 10px;
}
.app-card input::placeholder, .app-card textarea::placeholder {
  color: var(--input-placeholder);
}
.app-card input:focus, .app-card textarea:focus, .app-card select:focus {
  outline: none;
  box-shadow: var(--focus-ring);
  border-color: var(--primary) !important;
}

/* Buttons in the card */
.app-card .btn {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
}
.app-card .btn.primary {
  background: var(--primary);
  color: var(--primary-contrast);
  border-color: var(--primary);
}

/* Customer page readability */
.customer-panel {
  line-height: 1.6;                 /* comfy line spacing */
  font-size: 1.125rem;               /* ~18px if browser default is 16px */
}

/* Clear, scalable headings inside the panel */
.customer-panel h1 { 
  font-size: clamp(1.75rem, 2vw + 1rem, 2.25rem);
  margin: 0 0 .5rem 0;
}
.customer-panel h2 {
  font-size: clamp(1.25rem, 1.2vw + 1rem, 1.6rem);
  margin: 1rem 0 .5rem 0;
}
.customer-panel h3 {
  font-size: 1.125rem;
  margin: .75rem 0 .35rem 0;
}

/* Inputs and table text inside the panel */
.customer-panel input,
.customer-panel select,
.customer-panel textarea {
  font-size: 1rem;        /* bump form fields a touch */
}
.customer-panel .table {
  font-size: 1rem;        /* make tables readable */
}

/* Force strong contrast on the customer card */
:root[data-theme="light"] .customer-panel {
  background: #ffffff;                      /* white card like login */
  color: #0b1020;                           /* dark navy text */
  border: 1px solid #cfd6e4;                /* visible border */
}

/* Make sure all plain text inside the card is dark enough */
.customer-panel,
.customer-panel p,
.customer-panel li,
.customer-panel dt,
.customer-panel dd,
.customer-panel th,
.customer-panel td,
.customer-panel label,
.customer-panel small {
  color: var(--text) !important;
}

/* Muted/secondary text still readable in light mode */
:root[data-theme="light"] .customer-panel .muted {
  color: #334155 !important;                /* slate-700 */
}

/* Links stand out and are obviously clickable */
.customer-panel a {
  color: color-mix(in oklab, var(--link) 85%, var(--text));
  text-decoration: underline;
}
.customer-panel a:hover { filter: brightness(1.08); }

/* Pills and badges: make sure they’re visible on white */
.customer-panel .pill {
  background: #eef2f7;                      /* soft gray */
  color: #0b1020;
  border: 1px solid #d8dee9;
}
/* Large text mode (site-wide scaling) */
:root[data-font="large"] {
  font-size: 18.75px;         /* ~17-18px base across site */
}
:root[data-font="large"] .customer-panel {
  font-size: 1.2rem;          /* nudge panel content a bit more */
}


:root[data-theme="light"] body.is-brand-hero {
  position: relative; /* anchor the pseudo-element */
}

:root[data-theme="light"] body.is-brand-hero::before {
  content: "";
  position: fixed;    /* sticks to the viewport */
  inset: 0;           /* full screen */
  z-index: -1;        /* behind all content */
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  background-repeat: no-repeat;
  background-size: cover;
  will-change: transform; /* smoother on mobile */
}
/* Make main schedule containers transparent so the wallpaper is visible */
.schedule-page main,
.schedule-page .container,
.schedule-page .content,
.schedule-page .page-wrap {
  background: transparent !important;
}

/* === Accordion (summary) hover/active tokens === */
:root {
  --summary-hover-bg: color-mix(in oklab, var(--surface) 92%, var(--text) 8%);
  --summary-active-bg: color-mix(in oklab, var(--surface) 88%, var(--text) 12%);
}

@media (prefers-color-scheme: dark) {
  :root {
    /* In dark, mix with white a bit so it lightens instead of darkening */
    --summary-hover-bg: color-mix(in oklab, var(--surface) 90%, white 10%);
    --summary-active-bg: color-mix(in oklab, var(--surface) 85%, white 15%);
  }
}

/* If you use manual theme toggling, mirror them explicitly */
:root[data-theme="light"] {
  --summary-hover-bg: color-mix(in oklab, var(--surface) 92%, var(--text) 8%);
  --summary-active-bg: color-mix(in oklab, var(--surface) 88%, var(--text) 12%);
}
:root[data-theme="dark"] {
  --summary-hover-bg: color-mix(in oklab, var(--surface) 90%, white 10%);
  --summary-active-bg: color-mix(in oklab, var(--surface) 85%, white 15%);
}
/* Three-area header: left | center | right, with center truly centered */
.app-header {
  position: relative;
  z-index: 100;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

/* Flex container with left, center, right zones */
.app-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

/* Left/right fixed widths so center can actually center */
.header-left,
.header-right {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Center block is absolutely centered */
.header-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-logo {
  height: 32px;
  width: auto;
}
.app-title {
  font-size: 1.25rem;
  margin: 0;
}

/* Back button styling */
.back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}
.back-btn:hover {
  background: var(--surface-3);
}

/* Profile trigger (top-right icon) */
.profile-trigger {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.6rem;
  cursor: pointer;
}
.dropdown-sep {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}
/* Fix: extend header background below the logo */
.page-header {
  background: var(--surface);
  padding-top: 1rem;
  padding-bottom: 1rem;  /* Increase bottom padding so it fully covers the logo */
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

/* Optional: if the logo overlaps, force it to sit fully inside the header */
.page-header .page-logo {
  display: block;
  height: 64px; /* or whatever your image height is */
  object-fit: contain;
}

/* If your header background doesn't visually connect to the rest of the surface */
.container-soft.page-home .page-header {
  margin-bottom: 1rem;
  border-radius: 0 0 0.75rem 0.75rem; /* optional aesthetic touch */
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
/* === Header sizing fix (keeps absolute-centered layout) === */
:root{
  --site-logo-h: 80px;           /* desktop logo height */
  --site-header-vpad: 16px;      /* vertical padding top/bottom */
}
@media (max-width: 600px){
  :root{ --site-logo-h: 56px; --site-header-vpad: 14px; }
}
@media (min-width: 1280px){
  :root{ --site-logo-h: 84px; --site-header-vpad: 24px; }
}

/* Make header tall enough to cover the logo even if center is absolute */
.app-header {
  background: var(--surface);
  padding: var(--site-header-vpad) 16px;
  min-height: calc(var(--site-logo-h) + (2 * var(--site-header-vpad)));
}

/* Ensure the logo actually uses that height */
.app-header .app-logo {
  height: var(--site-logo-h);
  width: auto;
}
.logo-chip {
  display:inline-flex;
  align-items:center;
  padding: 6px 10px;
  border-radius: 12px;
  background: color-mix(in oklab, var(--panel-bg) 85%, transparent);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow-md);
}

/* Dark mode: slightly darker plate */
:root[data-theme="dark"] .logo-chip{
  background: color-mix(in oklab, var(--surface-2) 92%, transparent);
}
/* Bigger company logo in the header */
:root{
  --site-logo-h: 112px;     /* was 80px */
  --site-header-vpad: 20px; /* a little more breathing room */
}

/* Responsive tweaks (optional) */
@media (max-width: 600px){
  :root{ --site-logo-h: 72px; --site-header-vpad: 16px; }
}
@media (min-width: 1280px){
  :root{ --site-logo-h: 128px; --site-header-vpad: 24px; }
}

/* Compact, lighter logo chip */
:root{
  /* chip spacing you can tune */
  --chip-py: 2px;           /* vertical padding (was 6px) */
  --chip-px: 8px;           /* horizontal padding (was 10px) */
  --chip-radius: 10px;      /* slightly smaller corners */
}

/* Make the chip hug the logo and remove extra line height */
.logo-chip{
  border: 0;                              /* remove border */
  box-shadow: inset 0 0 0 .5px rgba(0,0,0,.15),  /* subtle hairline */
              0 1px 4px rgba(0,0,0,.08);         /* tiny outer shadow */
}


/* Ensure the image itself doesn't add baseline gap */
.logo-chip .app-logo{
  display: block;        /* critical: removes ~3–4px baseline space */
}

/* Ensure the image itself doesn't add stray spacing */
.logo-chip .app-logo{
  display:block;                       /* remove baseline gap */
}

/* LIGHT MODE: keep it soft but visible */
:root[data-theme="light"] .logo-chip{
  /* Use the page surface, lightly shaded with text color for definition */
  background:
  linear-gradient(
    180deg,
    color-mix(in oklab, var(--panel-bg) 92%, var(--brand) 10%),
    color-mix(in oklab, var(--panel-bg) 92%, var(--brand-2) 10%)
  );

  border: 1px solid color-mix(in oklab, var(--panel-border) 70%, var(--text) 30%);
  box-shadow: 0 4px 12px rgba(0,0,0,.06);   /* softer than dark mode */
  backdrop-filter: saturate(110%) blur(4px); /* gentler so it doesn't wash out */
  -webkit-backdrop-filter: saturate(110%) blur(4px);
}

/* DARK MODE: make it MUCH lighter so the logo pops */
:root[data-theme="dark"] .logo-chip{
  /* lighter translucent plate over dark header */
  background: color-mix(in oklab, white 26%, var(--surface) 74%);
  border: 1px solid color-mix(in oklab, white 35%, var(--border) 65%);
  box-shadow: 0 6px 18px rgba(255,255,255,.06), var(--shadow-md);
}

/* OPTIONAL: if you still want it tighter on very small screens */
@media (max-width: 600px){
  :root{
    --chip-py: 2px;
    --chip-px: 6px;
    --chip-radius: 8px;
  }
}

:root{
  --chip-pad-y: 2px;   /* visible cushion around the logo */
  --chip-pad-x: 6px;
  --img-trim-y: 45px;   /* trim more/less if needed */
  --img-trim-x: 30px;
}

.app-header .logo-chip{
  display:inline-flex; align-items:center;
  padding: var(--chip-pad-y) var(--chip-pad-x) !important; /* win specificity */
  border-radius: 10px;
  line-height: 0;  /* no inline line-box height */
}

.app-header .logo-chip .app-logo{
  display:block;              /* removes baseline gap */
  margin: calc(-1 * var(--img-trim-y)) calc(-1 * var(--img-trim-x));
  height: var(--site-logo-h); /* keep sizing via your var */
  width:auto;
}
:root{
  --site-logo-h: 225px;   /* try 128–160px to taste */
  --site-header-vpad: 16px; /* keep tight vertical padding */
}
@media (max-width: 600px){
  :root{ --site-logo-h: 84px; --site-header-vpad: 12px; }
}

/* Keep the site header tight, but let the inner wrapper control layout */
.app-header--site{
  --site-header-vpad: 2px;                          /* tight vertical pad */
  padding: var(--site-header-vpad) 12px !important;
  min-height: calc(var(--site-logo-h) + 4px) !important;
}

/* The inner wrapper is the flex row and the centering anchor */
.app-header-inner{
  position: relative;                                /* anchor for the center */
  display: flex;
  align-items: center;
  justify-content: space-between;                    /* left | right */
}

/* ABSOLUTE, TRUE CENTER for the logo block */
.app-header-center{
  position: absolute;
  left: 50%;
  transform: translateX(-50%);                       /* perfectly centered */
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: center;
  pointer-events: auto;
}

/* (In case some CSS used .header-center earlier—mirror the rules) */
.header-center{                                      /* fallback alias */
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: center;
}

/* Chip stays tight and doesn't inflate the bar */
.app-header .logo-chip{
  padding: var(--chip-pad-y) var(--chip-pad-x) !important;
  line-height: 0 !important;
  overflow: visible;
}
.app-header .logo-chip .app-logo{
  display: block;
  height: var(--site-logo-h);
  width: auto;
}


/* 1) Make the site header the exact height of the logo (+ tiny buffer) */
.app-header--site{
  --site-header-vpad: 0px;                           /* no extra padding */
  padding-block: 0 !important;
  padding-inline: 12px;                               /* keep side space */
  height: calc(var(--site-logo-h) + 2px) !important;  /* 1px top + 1px bottom */
  min-height: 0 !important;                           /* don't let earlier rules expand it */
}

/* 2) True *vertical* centering of the middle block */
.app-header-inner{
  position: relative;               /* anchor for the absolute center */
  height: 100%;                     /* so 50% means center of the bar */
  display: flex;
  align-items: center;              /* keeps left/right vertically aligned */
  justify-content: space-between;   /* left | right */
}

.app-header-center{
  position: absolute;
  left: 50%;
  top: 50%;                         /* <-- vertical center */
  transform: translate(-50%, -50%); /* <-- perfect centering */
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 3) Chip contributes almost zero height */
.logo-chip{
  padding: var(--chip-pad-y, 2px) var(--chip-pad-x, 6px) !important;
  line-height: 0 !important;
  margin: 0 !important;
}

/* 4) The image itself doesn’t add spacing */
.logo-chip .app-logo{
  display: block;
  height: var(--site-logo-h);   /* e.g. 200px as you set */
  width: auto;
}

/* 5) Make side buttons fit the tighter bar (optional but helps) */
.menu-btn,
.back-btn,
.profile-trigger{
  height: clamp(32px, calc(var(--site-logo-h) * 0.35), 40px);
  width:  clamp(32px, calc(var(--site-logo-h) * 0.35), 40px);
  padding: 0;
  align-self: center;
}
/* 0) Guardrail: header itself is exactly the logo height */
.app-header--site{
  height: var(--site-logo-h) !important;
  padding-block: 0 !important;
  margin-bottom: 0 !important;
  border-bottom-width: 1px; /* keep the divider, remove if you want seamless */
}

/* 1) Kill any top spacing from the content area below the header */
.app-shell .page-wrap{
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* 2) Make sure the *first child* inside the page-wrap doesn’t reintroduce a gap */
.app-shell .page-wrap > *:first-child{
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* 3) Ensure the header row itself doesn’t add a bottom gap */
.app-header-inner{
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  height: 100% !important; /* fills the fixed-height header for perfect centering */
  align-items: center !important;
}

/* 4) If your page header block adds space on the home page, tighten it */
.container-soft.page-home .page-header{
  margin-top: 0 !important;
  padding-top: 0.25rem !important;
}

/* 5) Safety: don’t let any main container create a top gutter on the home page */
.page-home{
  margin-top: 0 !important;
  padding-top: 0 !important;
}
/* === Bigger header controls (hamburger, back, profile) === */
:root{
  --hdr-ctl-size: 48px;     /* button width/height */
  --hdr-ctl-icon: 1.55rem;  /* icon glyph size */
}

/* Slightly smaller on very small screens */
@media (max-width: 600px){
  :root{
    --hdr-ctl-size: 44px;
    --hdr-ctl-icon: 1.45rem;
  }
}

/* Apply to all three controls */
.menu-btn,
.back-btn,
.profile-trigger{
  width: var(--hdr-ctl-size) !important;
  height: var(--hdr-ctl-size) !important;
  border-radius: 12px;                 /* keeps them friendly */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;               /* pure icon */
}

/* Make the glyphs bigger and perfectly centered */
.menu-btn i,
.back-btn i,
.profile-trigger i{
  font-size: var(--hdr-ctl-icon) !important;
  line-height: 1;
}

/* Optional: slightly stronger hover so bigger buttons feel responsive */
.menu-btn:hover,
.back-btn:hover,
.profile-trigger:hover{
  box-shadow: 0 0 0 3px var(--focus-ring);
}
/* Bigger profile trigger in the header */
.app-header .profile-menu .profile-trigger{
  /* size the button */
  width: 52px !important;
  height: 52px !important;

  /* keep it looking like your other controls */
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  border-radius: 12px !important;
  border: 1px solid var(--border) !important;
  background: var(--surface-2) !important;
}

/* scale the icon inside */
.app-header .profile-menu .profile-trigger i{
  font-size: 1.8rem !important;
  line-height: 1 !important;
}
.app-header .menu-btn,
.app-header .back-btn{
  width: 52px !important;
  height: 52px !important;
  border-radius: 12px !important;
  padding: 0 !important;
}

.app-header .menu-btn i,
.app-header .back-btn i{
  font-size: 1.35rem !important; /* tweak to taste */
  line-height: 1 !important;
}
/* Header icon buttons match the logo chip in DARK mode */
:root[data-theme="dark"] .app-header .menu-btn,
:root[data-theme="dark"] .app-header .back-btn,
:root[data-theme="dark"] .app-header .profile-menu .profile-trigger{
  background: color-mix(in oklab, white 26%, var(--surface) 74%) !important;
  border: 1px solid color-mix(in oklab, white 35%, var(--border) 65%) !important;
  box-shadow: 0 6px 18px rgba(255,255,255,.06), var(--shadow-md) !important;
  -webkit-backdrop-filter: saturate(110%) blur(4px);
  backdrop-filter: saturate(110%) blur(4px);
  color: var(--text) !important;     /* icon color */
}

/* Hover/active states – just a touch brighter so it feels clickable */
:root[data-theme="dark"] .app-header .menu-btn:hover,
:root[data-theme="dark"] .app-header .back-btn:hover,
:root[data-theme="dark"] .app-header .profile-menu .profile-trigger:hover{
  background: color-mix(in oklab, white 32%, var(--surface) 68%) !important;
}

:root[data-theme="dark"] .app-header .menu-btn:active,
:root[data-theme="dark"] .app-header .back-btn:active,
:root[data-theme="dark"] .app-header .profile-menu .profile-trigger:active{
  background: color-mix(in oklab, white 22%, var(--surface) 78%) !important;
}

/* Make sure the icons themselves scale nicely */
:root[data-theme="dark"] .app-header .menu-btn i,
:root[data-theme="dark"] .app-header .back-btn i,
:root[data-theme="dark"] .app-header .profile-menu .profile-trigger i{
  line-height: 1 !important;
  font-size: 1.35rem; /* tweak if you want larger/smaller icons */
}
:root[data-theme="light"] .app-header .menu-btn,
:root[data-theme="light"] .app-header .back-btn,
:root[data-theme="light"] .app-header .profile-menu .profile-trigger{
  background:
    linear-gradient(
      180deg,
      color-mix(in oklab, var(--panel-bg) 92%, var(--brand) 10%),
      color-mix(in oklab, var(--panel-bg) 92%, var(--brand-2) 10%)
    ) !important;
  border: 1px solid color-mix(in oklab, var(--panel-border) 70%, var(--text) 30%) !important;
  box-shadow: 0 4px 12px rgba(0,0,0,.06);
  -webkit-backdrop-filter: saturate(110%) blur(4px);
  backdrop-filter: saturate(110%) blur(4px);
}

/* --- Keep the logo readable and centered --- */

/* The chip shouldn’t shrink below the logo’s min size */
.logo-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  flex: 0 0 auto;                         /* don't let flex shrink it */
  min-width: calc(56px + 24px);           /* min logo (56) + padding (12+12) */
}

/* Logo: strong floor + smooth scaling, no distortion */
.app-logo {
  height: clamp(56px, 6vw, 84px);         /* ↑ raise the minimum to stay visible */
  width: auto;                             /* preserve aspect */
  max-width: 100%;
  object-fit: contain;
  flex: 0 0 auto;                          /* don't let flex squeeze it */
  display: block;
}

/* Header flex: let it wrap cleanly when narrow */
.app-header .app-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}

/* Don’t allow controls to squeeze the center */
.header-left, .header-right { flex: 0 0 auto; }

/* Center region defaults */
.app-header-center {
  flex: 1 1 auto;
  min-width: 0;                            /* allow text to shrink if needed */
  display: flex;
  justify-content: center;
}

/* When width is limited, move the logo to its own row instead of shrinking it */
@media (max-width: 900px) {
  .app-header .app-header-inner { flex-wrap: wrap; }

  .app-header-center {
    flex: 0 0 100%;                         /* full row */
    order: 0;
    padding-block: .25rem;
  }
  .header-left { order: 1; }
  .header-right { order: 2; }
}

/* Optional: ultra-small screens—keep minimum readable */
@media (max-width: 380px) {
  .app-logo { height: 60px; }               /* fixed floor for very small devices */
}
/* ===== Responsive logo + chip that never collapses ===== */
:root{
  /* One knob for logo height (re-used by the chip) */
  --logo-h: clamp(56px, 6vw, 84px);
  --chip-pad-y: 2px;
  --chip-pad-x: 2px;
}

.app-header-center{
  display:flex; justify-content:center; flex:1 1 auto; min-width:0;
}

/* The chip: keep padding, ring, and rounded shape visible */
.logo-chip{
  display:inline-flex; align-items:center; justify-content:center;
  padding: var(--chip-pad-y) var(--chip-pad-x);
  background: var(--surface, #fff);              /* contrasts in light/dark */
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-xs, 0 1px 2px rgba(0,0,0,.06));
  line-height: 0;                                /* remove inline-img gaps */
  flex: 0 0 auto;                                /* never let flex shrink it */

  /* Keep chip larger than the logo so it doesn't blend into bg */
  min-height: calc(var(--logo-h) + (var(--chip-pad-y) * 2));
  min-width:  calc(var(--logo-h) + (var(--chip-pad-x) * 2));
}

/* The logo itself: scales smoothly, no distortion */
.app-logo{
  height: var(--logo-h);
  width: auto;
  object-fit: contain;
  display: block;
  flex: 0 0 auto;
}

/* When narrow, let the logo row wrap instead of shrinking */
@media (max-width: 900px){
  .app-header .app-header-inner{ flex-wrap: wrap; }
  .app-header-center{ flex:0 0 100%; order:0; padding-block:.25rem; }
  .header-left{ order:1; }
  .header-right{ order:2; }
}

/* Optional: ultra-narrow safety floor */
@media (max-width: 380px){
  :root{ --logo-h: 64px; } /* keep a strong minimum */
}
/* === Header logo chip: 20px top, 30px bottom === */
:root{
  --chip-pad-top: 20px;
  --chip-pad-bottom: 30px;
  /* keep your existing horizontal pad (or tweak) */
  --chip-pad-x: var(--chip-pad-x, 8px);
}

/* Apply asymmetric padding + correct min-height */
.app-header .logo-chip{
  padding: var(--chip-pad-top) var(--chip-pad-x) var(--chip-pad-bottom) !important;
  line-height: 0 !important;

  /* ensure the box is logo height + both paddings */
  min-height: calc(
    var(--logo-h, var(--site-logo-h, 72px)) +
    var(--chip-pad-top) + var(--chip-pad-bottom)
  ) !important;
}

/* keep the logo sizing exactly as you have it */
.app-header .logo-chip .app-logo{
  display: block;
  height: var(--logo-h, var(--site-logo-h, 72px)) !important;
  width: auto !important;
}
/* === Only adjust chip padding; don't let older rules square/trim it === */
:root{
  --chip-pad-x-final: 8px;       /* keep your horizontal cushion (tweak if needed) */
  --chip-pad-top-final: 0px;    /* requested top space */
  --chip-pad-bottom-final: 0px; /* requested bottom space */
}

.app-header .logo-chip{
  /* Apply asymmetric vertical padding; keep horizontal */
  padding: var(--chip-pad-top-final) var(--chip-pad-x-final) var(--chip-pad-bottom-final) var(--chip-pad-x-final) !important;

  /* Cancel earlier size constraints that were tying chip to logo HEIGHT */
  min-width: unset !important;
  min-height: unset !important;
  width: auto !important;
  height: auto !important;
  overflow: visible !important; /* we're using a trimmed PNG now; no cropping needed */
}

.app-header .logo-chip .app-logo{
  /* Keep your exact logo size behavior */
  height: var(--logo-h, var(--site-logo-h, 72px)) !important;
  width: auto !important;
  display: block !important;

  /* Nuke any old CSS “trim” margins now that the PNG is trimmed */
  margin: 0 !important;
}
/* === Make the header logo bigger (keeps your chip padding) === */
:root{
  /* Pick your size: fixed or responsive */
  /* Fixed desktop example: */
  /*--logo-h-final: 160px;*/

  /* Or responsive (uncomment this line and comment the fixed one): */
  --logo-h-final: clamp(160px, 10vw, 140px);
}

/* 1) Enlarge just the logo */
.app-header .logo-chip .app-logo{
  height: var(--logo-h-final) !important;
  width: auto !important;
}

/* 2) Match the header bar to the new logo height (no squish/overflow) */
.app-header--site{
  height: calc(var(--logo-h-final) + 2px) !important;
  padding-block: 0 !important;
}

/* 3) (Optional) Mobile floor so it’s still big when narrow */
@media (max-width: 600px){
  :root{ --logo-h-final: 110px; }  /* tweak to taste */
}
/* === Header breathing room + correct height for big logo/chip === */
:root{
  --page-top-gap: 8px;          /* space above the header */
  --header-bottom-gap: 16px;    /* space under the header */
}

.app-header--site{
  /* add outside spacing so it doesn't touch page edges or overlap content */
  margin-top: var(--page-top-gap) !important;
  margin-bottom: var(--header-bottom-gap) !important;

  /* stop hard-locking height to the logo only */
  height: auto !important;
  padding-block: 8px !important; /* a little internal padding */

  /* ensure header is tall enough for the big logo + chip pads */
  min-height: calc(
    var(--logo-h-final, var(--site-logo-h, 72px)) +
    var(--chip-pad-top-final, 20px) +
    var(--chip-pad-bottom-final, 30px)
  ) !important;
}

/* don't force a fixed row height inside; let it size naturally */
.app-header-inner{ height: auto !important; }

/* === LOGIN PAGE: compact, centered, no extra whitespace === */

/* Center the card and keep the viewport tidy */
.login-page{
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--surface-1);
}

/* Tight, single-column card */
.login-card{
  width: min(92vw, 420px);
  background: var(--panel-bg);
  color: var(--text);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  box-shadow: var(--panel-shadow, 0 10px 30px rgba(0,0,0,.10));
  padding: 16px 16px 18px;
}

/* Compact the header *inside* the card (don’t inherit the site header sizing) */
.login-card .app-header.app-header--in-card{
  position: static !important;
  inset: auto !important;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 0 10px 0 !important;
  min-height: 0 !important;
  height: auto !important;
  display: flex !important;
  align-items: center !important;
}

/* Kill global header variables for this small header */
.login-card .app-header--in-card{
  --site-logo-h: 40px !important;
  --logo-h: 40px !important;
  --site-header-vpad: 0px !important;
}

/* Small logo + title */
.login-card .app-header--in-card .app-logo{
  height: 36px !important;
  width: auto !important;
  display: block !important;
}
.login-card .app-header--in-card .app-title{
  font-size: 1.15rem !important;
  line-height: 1.1;
  margin: 0 0 0 8px;
  white-space: nowrap;
}

/* Form layout: tight vertical rhythm */
.login-card form{
  display: grid;
  gap: 10px;
  margin: 6px 0 0 0;
}
.login-card form label{
  display: grid;
  gap: 6px;
  font-weight: 600;
}
.login-card form input[type="email"],
.login-card form input[type="password"]{
  width: 100%;
}

/* Alerts: small spacing */
.login-card .alerts{ margin: 8px 0; }

/* Ensure no trailing space at bottom of the card */
.login-card > *:last-child{ margin-bottom: 0 !important; }

/* Make the button compact but comfy */
.login-card .btn.primary{
  padding: 12px !important;
  font-size: 1rem !important;
  border-radius: 10px !important;
}

/* Reduce any global header/button oversizing inside the card */
.login-card .menu-btn,
.login-card .back-btn,
.login-card .profile-trigger{
  width: 36px !important;
  height: 36px !important;
  padding: 0 !important;
  border-radius: 10px !important;
}

/* Optional: shrink white space on very small screens further */
@media (max-width: 380px){
  .login-card{ width: 94vw; padding: 14px; }
  .login-card .app-header--in-card .app-logo{ height: 32px !important; }
  .login-card .app-header--in-card .app-title{ font-size: 1.05rem !important; }
}
/* Nudge login card ~50px upward */
.login-page .login-card{
  transform: translateY(-100px);
}

/* On very small screens, reduce the nudge so it doesn't feel cramped */
@media (max-width: 420px){
  .login-page .login-card{ transform: translateY(-24px); }
}
/* Circular profile button */
.profile-menu .profile-trigger{
  width:40px; height:40px;
  padding:0;
  border-radius:999px;
  overflow:hidden;
  border:1px solid var(--border);
  background:var(--surface);
  display:inline-flex; align-items:center; justify-content:center;
}
.profile-menu .profile-trigger:hover{ background:var(--surface-2); }
.profile-menu .profile-trigger:focus-visible{
  outline:none;
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--primary) 50%, transparent);
}

/* Image fills the circle */
.profile-menu .avatar-img{
  width:100%; height:100%;
  object-fit:cover; display:block;
}

.app-header--site .logo-chip{
  clip-path: inset(0 0 10px 0 round 999px) !important; /* crops bottom 10px, keeps pill corners */
}

:root { --chip-crop: 10px; }  /* amount to cut from bottom */

/* Crop the chip without changing its corner radius */
.app-header .logo-chip{
  overflow: hidden !important;            /* hides the bottom overflow */
  border-radius: 10px !important;         /* your rounded corners */
  height: calc(
    var(--logo-h-final, var(--logo-h, var(--site-logo-h, 72px)))
    - var(--chip-crop)
  ) !important;                            /* trims ~10px off the bottom */
}

/* Keep the logo at the original size so the extra 10px gets hidden */
.app-header .logo-chip .app-logo{
  height: var(--logo-h-final, var(--logo-h, var(--site-logo-h, 72px))) !important;
  width: auto !important;
  display: block !important;
}

:root { --chip-shift: 10px; } /* +5 top, -5 bottom */

.app-header .logo-chip{
  overflow: hidden !important;
  border-radius: 10px !important;
  padding-top: calc(var(--chip-pad-top-final, 0px) + var(--chip-shift));
  height: calc(
    var(--logo-h-final, var(--logo-h, var(--site-logo-h, 72px))) - var(--chip-shift)
  ) !important;
}

.app-header .logo-chip .app-logo{
  height: var(--logo-h-final, var(--logo-h, var(--site-logo-h, 72px))) !important;
  width: auto !important;
  display: block !important;
  margin-top: calc(-1 * var(--chip-shift)); /* keeps logo aligned */
}

/* 0) Kill the pill maker */
.app-header--site .logo-chip{
  clip-path: none !important;
}

/* 1) Force normal rounded corners, not circular */
.app-header .logo-chip{
  border-radius: 10px !important;
}

/* Final override: independent top add + bottom crop */
:root{
  --chip-cut-bottom: 10px; /* keep your perfect bottom crop */
  --chip-add-top: 20px;    /* reveal 10px more at the top */
}

/* 1) Container: zero any old padding, then add top padding only */
.app-header .logo-chip{
  clip-path: none !important;
  overflow: hidden !important;
  border-radius: 10px !important;

  padding: 0 !important;                              /* wipe older padding */
  padding-block-start: var(--chip-add-top) !important; /* top add only */

  height: calc(
    var(--logo-h-final, var(--logo-h, var(--site-logo-h, 72px)))
    - var(--chip-cut-bottom)
  ) !important;
}

/* 2) Image: cancel old negative margins/transforms so top isn’t cut */
.app-header .logo-chip .app-logo{
  height: var(--logo-h-final, var(--logo-h, var(--site-logo-h, 84px))) !important;
  width: auto !important;
  margin-top: 0 !important;         /* kill earlier negative margins */
  transform: none !important;       /* kill any earlier shifts */
  display: block !important;
}
/* Fix: let the chip be full logo height (no bottom crop) */
:root{
  --chip-cut-bottom: 5px;
}

.app-header .logo-chip{
  height: var(--logo-h-final, var(--logo-h, var(--site-logo-h, 72px))) !important;
}
.app-header .logo-chip{
  height: auto !important;                /* grow to fit content */
  padding-top: 3px !important;           /* keep the top space you liked */
  padding-bottom: 3px !important;         /* add ~5px more at the bottom */
}
:root[data-theme="dark"]{
  /* Use the header grey (#2b2f38) for everything */
  --bg:        #2b2f38;
}

/* Ensure the actual page background uses it */
:root[data-theme="dark"] body,
:root[data-theme="dark"] html {
  background: #2b2f38 !important;
}

/* Dark mode: only the page background matches the header grey */
:root[data-theme="dark"]{
  /* Backdrop behind containers */
  --bg: #2b2f38;
}

/* Ensure the actual document background uses it */
:root[data-theme="dark"] html,
:root[data-theme="dark"] body {
  background: #2b2f38 !important;
}
