/* =========================================================================
   Absensi · Pawon design system
   Palette drawn from the Javanese kitchen: banana leaf, turmeric, chili.
   Built on Bootstrap 5.3 variables so components inherit the theme.
   ========================================================================= */

:root {
  --leaf-900: #12301F;
  --leaf-800: #173D2B;
  --leaf-700: #1F4D3A;   /* primary */
  --leaf-600: #2A6249;
  --leaf-100: #E3EEE7;
  --leaf-50:  #F1F6F2;
  --turmeric: #E3A21A;
  --turmeric-100: #FBF0D6;
  --chili: #C8452D;
  --chili-100: #F8E3DE;
  --ink: #16211B;
  --ink-2: #4A5650;
  --ink-3: #7B8680;
  --line: #DFE5E1;
  --paper: #F5F7F4;
  --surface: #FFFFFF;
  --leaf-ink: #1F4D3A;      /* green text on light tints */
  --seg-bg: #E9EEEA;
  --chip-muted-bg: #EDF0EE;
  --head-bg: var(--paper);
  --sidebar-bg: var(--leaf-800);
  --pending-ink: #8A5E00;
  --bad-ink: #8E2B19;
  --ok-ink: var(--leaf-800);
  --glass-blur: none;

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-1: 0 1px 2px rgba(22, 33, 27, .06), 0 1px 1px rgba(22, 33, 27, .04);

  --bs-body-font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--paper);
  --bs-secondary-color: var(--ink-3);
  --bs-border-color: var(--line);
  --bs-primary: var(--leaf-700);
  --bs-primary-rgb: 31, 77, 58;
  --bs-link-color: var(--leaf-700);
  --bs-link-color-rgb: 31, 77, 58;
  --bs-link-hover-color: var(--leaf-900);
  --bs-focus-ring-color: rgba(227, 162, 26, .45);
  --bs-border-radius: var(--radius-sm);
}

body { font-feature-settings: "tnum" 0; letter-spacing: -0.005em; -webkit-font-smoothing: antialiased; }
.num, .table td, .clock { font-variant-numeric: tabular-nums; }
h1, .h1, h2, .h2, h3, .h3 { letter-spacing: -0.02em; font-weight: 700; }
.text-muted { color: var(--ink-3) !important; }
a { text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--turmeric); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn { border-radius: 10px; font-weight: 600; padding: .55rem 1rem; }
.btn-sm { border-radius: 8px; padding: .35rem .7rem; }
.btn-primary { --bs-btn-bg: var(--leaf-700); --bs-btn-border-color: var(--leaf-700); --bs-btn-hover-bg: var(--leaf-800); --bs-btn-hover-border-color: var(--leaf-800); --bs-btn-active-bg: var(--leaf-900); --bs-btn-disabled-bg: var(--leaf-600); --bs-btn-disabled-border-color: var(--leaf-600); }
.btn-outline-primary { --bs-btn-color: var(--leaf-700); --bs-btn-border-color: var(--leaf-700); --bs-btn-hover-bg: var(--leaf-700); --bs-btn-hover-border-color: var(--leaf-700); --bs-btn-active-bg: var(--leaf-800); }
.btn-quiet { background: var(--leaf-50); color: var(--leaf-ink); border: 1px solid transparent; }
.btn-quiet:hover { background: var(--leaf-100); color: var(--leaf-900); }
.btn-danger-soft { background: var(--chili-100); color: var(--chili); border: 0; }
.btn-danger-soft:hover { background: var(--chili); color: #fff; }

/* ---------- Forms ---------- */
.form-control, .form-select { border-radius: 10px; border-color: var(--line); padding: .6rem .8rem; }
.form-control:focus, .form-select:focus { border-color: var(--leaf-600); box-shadow: 0 0 0 .2rem rgba(31, 77, 58, .12); }
.form-label { font-weight: 600; font-size: .875rem; margin-bottom: .35rem; }
.form-text { color: var(--ink-3); }
.form-check-input:checked { background-color: var(--leaf-700); border-color: var(--leaf-700); }

/* ---------- Panels (cards) ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 1rem; margin: 0; }
.panel-body { padding: 1.25rem; }
.panel-flush .table { margin: 0; }

/* ---------- Status chips ---------- */
.chip { display: inline-flex; align-items: center; gap: .3rem; border-radius: 999px; padding: .2rem .6rem; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.chip::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; opacity: .85; }
.chip-ok      { background: var(--leaf-100); color: var(--leaf-ink); }
.chip-pending { background: var(--turmeric-100); color: var(--pending-ink); }
.chip-bad     { background: var(--chili-100); color: var(--chili); }
.chip-muted   { background: var(--chip-muted-bg); color: var(--ink-3); }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; --bs-table-hover-bg: var(--leaf-50); font-size: .9rem; }
.table > thead th { font-size: .78rem; font-weight: 600; color: var(--ink-3); background: var(--head-bg); border-bottom: 1px solid var(--line); padding: .7rem 1rem; white-space: nowrap; }
.table > tbody td { padding: .8rem 1rem; border-color: var(--line); vertical-align: middle; }
.table .sub { display: block; color: var(--ink-3); font-size: .78rem; }

.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--leaf-100); color: var(--leaf-ink); font-weight: 700; font-size: .8rem; flex: none; }
.thumb { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: var(--line); }

/* ---------- Alerts ---------- */
.alert { border: 0; border-radius: var(--radius-md); font-size: .9rem; }
.alert-success { background: var(--leaf-100); color: var(--ok-ink); }
.alert-danger  { background: var(--chili-100); color: var(--bad-ink); }
.alert-warning { background: var(--turmeric-100); color: var(--pending-ink); }
.alert-info    { background: var(--info-bg, #E7EEF0); color: var(--info-ink, #23424C); }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--ink-3); }
.empty .bi { font-size: 2rem; display: block; margin-bottom: .5rem; color: var(--leaf-600); }

/* =========================================================================
   HRD shell: sidebar + content
   ========================================================================= */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar-bg); color: #DDE8E1; padding: 1.25rem .9rem; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: .7rem; padding: .25rem .5rem 1.25rem; color: #fff; text-decoration: none; }
.brand img, .brand .brand-mark { width: 38px; height: 38px; border-radius: 10px; background: #fff; object-fit: contain; padding: 3px; flex: none; }
.brand .brand-mark { display: grid; place-items: center; background: var(--turmeric); color: var(--leaf-900); font-weight: 800; }
.brand strong { display: block; font-size: .95rem; line-height: 1.2; }
.brand small { color: #A9C2B4; font-size: .75rem; }
.nav-side { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.nav-side a { display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem; border-radius: 10px; color: #CFE0D6; text-decoration: none; font-weight: 500; font-size: .92rem; }
.nav-side a .bi { font-size: 1.1rem; opacity: .9; }
.nav-side a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-side a.active { background: var(--leaf-50); color: var(--leaf-800); font-weight: 700; }
.nav-side .count { margin-left: auto; background: var(--turmeric); color: var(--leaf-900); border-radius: 999px; font-size: .72rem; font-weight: 700; padding: .05rem .5rem; }
.nav-group { font-size: .75rem; color: #8FAE9C; padding: 1rem .75rem .35rem; }
.sidebar-foot { margin-top: auto; padding: .75rem; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .85rem; }
.sidebar-foot .who { color: #fff; font-weight: 600; }
.sidebar-foot a, .sidebar-foot button { color: #CFE0D6; }

.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 1rem; padding: 1.25rem 2rem .5rem; }
.topbar h1 { font-size: 1.5rem; margin: 0; }
.topbar .lede { color: var(--ink-3); margin: .15rem 0 0; font-size: .9rem; }
.topbar .actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
.content { padding: 1rem 2rem 3rem; }
.menu-toggle { display: none; }

@media (max-width: 991.98px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 272px; z-index: 1040; transform: translateX(-100%); transition: transform .2s ease; }
  .shell.menu-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35); }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 1rem 1rem .25rem; flex-wrap: wrap; }
  .content { padding: .75rem 1rem 2rem; }
}

/* Dashboard: today strip ------------------------------------------------- */
.today { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.today > div { padding: 1.1rem 1.25rem; border-left: 1px solid var(--line); }
.today > div:first-child { border-left: 0; background: var(--leaf-700); color: #fff; }
.today .big { font-size: 2.1rem; font-weight: 800; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.today .label { font-size: .85rem; color: var(--ink-3); margin-top: .35rem; }
.today > div:first-child .label { color: #BFD5C8; }
.today .bar { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .18); margin-top: .9rem; overflow: hidden; }
.today .bar span { display: block; height: 100%; background: var(--turmeric); }
.tone-late .big { color: var(--chili); }
.tone-leave .big { color: var(--pending-ink); }
@media (max-width: 991.98px) {
  .today { grid-template-columns: repeat(2, 1fr); }
  .today > div:first-child { grid-column: 1 / -1; }
  .today > div:nth-child(2), .today > div:nth-child(4) { border-left: 0; }
  .today > div { border-top: 1px solid var(--line); }
}

.branch-row { display: flex; align-items: center; gap: .9rem; padding: .8rem 1.25rem; border-top: 1px solid var(--line); }
.branch-row:first-child { border-top: 0; }
.branch-row .meter { flex: 1; height: 8px; background: var(--leaf-50); border-radius: 8px; overflow: hidden; }
.branch-row .meter span { display: block; height: 100%; background: var(--leaf-600); border-radius: 8px; }

/* Map picker */
.map-pick { height: 340px; border-radius: var(--radius-md); border: 1px solid var(--line); z-index: 0; }

/* =========================================================================
   Employee app shell (mobile first)
   ========================================================================= */
.app { max-width: 480px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); background: var(--paper); }
.app-head { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.1rem .5rem; }
.app-head img { width: 34px; height: 34px; border-radius: 9px; object-fit: contain; background: #fff; border: 1px solid var(--line); }
.app-head .title { font-weight: 700; font-size: 1rem; line-height: 1.2; }
.app-head .sub { font-size: .78rem; color: var(--ink-3); }
.app-body { padding: .5rem 1.1rem 1.5rem; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar ul { max-width: 480px; margin: 0 auto; list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); }
.tabbar a { display: grid; justify-items: center; gap: 2px; padding: .55rem 0 .6rem; font-size: .72rem; font-weight: 600; color: var(--ink-3); text-decoration: none; }
.tabbar .bi { font-size: 1.35rem; }
.tabbar a.active { color: var(--leaf-ink); }
.tabbar a.active .bi { background: var(--leaf-100); border-radius: 999px; padding: .1rem 1rem; }

/* The clock block: the one bold moment of the app */
.clock-card { background: var(--leaf-700); color: #fff; border-radius: 24px; padding: 1.25rem 1.25rem 1rem; position: relative; overflow: hidden; }
.clock-card::after { /* banana-leaf vein */
  content: ""; position: absolute; right: -60px; top: -40px; width: 220px; height: 220px; border-radius: 50%;
  background: repeating-linear-gradient(115deg, rgba(255,255,255,.06) 0 2px, transparent 2px 18px); pointer-events: none;
}
.clock-card .date { color: #BFD5C8; font-size: .85rem; }
.clock { font-size: 3.6rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1; margin: .2rem 0 .9rem; }
.clock .sec { font-size: 1.4rem; font-weight: 600; color: var(--turmeric); margin-left: .25rem; letter-spacing: 0; }
.shift { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.shift > div { background: rgba(255, 255, 255, .09); border-radius: 14px; padding: .6rem .75rem; }
.shift .k { font-size: .72rem; color: #BFD5C8; }
.shift .v { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.shift .v small { font-size: .72rem; font-weight: 600; color: var(--turmeric); margin-left: .25rem; }

.cam { position: relative; border-radius: 20px; overflow: hidden; background: #0E1A13; aspect-ratio: 3 / 4; }
.cam video, .cam img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.cam .guide { position: absolute; inset: 14% 18% 22%; border: 2px dashed rgba(255, 255, 255, .45); border-radius: 50% / 45%; pointer-events: none; }
.cam .hint { position: absolute; left: 0; right: 0; bottom: .75rem; text-align: center; color: #fff; font-size: .8rem; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.gps-line { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--ink-2); padding: .6rem .2rem; }
.gps-line .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); flex: none; }
.gps-line.ok .dot { background: #2E8B57; }
.gps-line.warn .dot { background: var(--turmeric); }
.gps-line.bad .dot { background: var(--chili); }

.punch { width: 100%; border: 0; border-radius: 16px; padding: 1rem; font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: .5rem; }
.punch-in  { background: var(--turmeric); color: var(--leaf-900); }
.punch-in:hover  { background: #D19414; }
.punch-out { background: var(--leaf-700); color: #fff; }
.punch-out:hover { background: var(--leaf-800); }
.punch:disabled { background: var(--line); color: var(--ink-3); }

.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain > li { display: flex; align-items: center; gap: .8rem; padding: .85rem 1rem; border-top: 1px solid var(--line); }
.list-plain > li:first-child { border-top: 0; }
.day-badge { width: 44px; text-align: center; flex: none; }
.day-badge b { display: block; font-size: 1.15rem; line-height: 1; font-variant-numeric: tabular-nums; }
.day-badge span { font-size: .7rem; color: var(--ink-3); }

.balance { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.balance > div + div { border-left: 1px solid var(--line); }
.balance b { display: block; font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.balance span { font-size: .78rem; color: var(--ink-3); }

/* Segmented filter */
.seg { display: inline-flex; background: var(--seg-bg); border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg a { padding: .4rem .85rem; border-radius: 9px; font-size: .85rem; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.seg a.active { background: var(--surface); color: var(--leaf-ink); box-shadow: var(--shadow-1); }

/* Auth pages */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background:
  radial-gradient(1200px 500px at 50% -10%, var(--leaf-100), transparent 70%), var(--paper); }
.auth-card { width: 100%; max-width: 400px; }
.auth-logo { width: 72px; height: 72px; border-radius: 18px; object-fit: contain; background: #fff; border: 1px solid var(--line); padding: 6px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- Review fixes ---------- */
.form-control, .form-select, .input-group-text { background-color: var(--surface); }
.input-group-text { border-color: var(--line); color: var(--ink-3); }
.form-range { accent-color: var(--leaf-700); }
.form-range::-webkit-slider-thumb { background: var(--leaf-700); }
.form-range::-moz-range-thumb { background: var(--leaf-700); }
.form-range:focus::-webkit-slider-thumb { box-shadow: 0 0 0 .2rem rgba(31, 77, 58, .2); }
.panel { overflow: hidden; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel:not([open]) > summary { border-bottom: 0; }
details.panel[open] > summary .bi-chevron-down { transform: rotate(180deg); }
.cam { aspect-ratio: auto; width: 100%; height: min(36vh, 320px); }
.cam .guide { inset: 10% 24% 16%; }
@media (max-height: 700px) { .clock { font-size: 2.8rem; margin-bottom: .6rem; } .clock-card { padding: 1rem; } }

.seg .btn-check + .seg-opt { padding: .45rem .85rem; border-radius: 9px; font-size: .85rem; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.seg .btn-check:checked + .seg-opt { background: var(--surface); color: var(--leaf-ink); box-shadow: var(--shadow-1); }
.seg .btn-check:focus-visible + .seg-opt { outline: 3px solid var(--turmeric); }
[hidden] { display: none !important; }

/* ---------- Announcements & tracker ---------- */
.ann-img { display: block; width: 100%; max-height: 260px; object-fit: cover; background: var(--line); }
.ann-body { font-size: .92rem; line-height: 1.55; overflow-wrap: anywhere; }
.ann-body.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.ann-bell { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--leaf-ink); font-size: 1.15rem; flex: none; text-decoration: none; }
.ann-bell span { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; border-radius: 999px; background: var(--turmeric); color: var(--leaf-900); font-size: .72rem; font-weight: 800; display: grid; place-items: center; padding: 0 5px; }
.worktrack { margin-top: .75rem; color: #DDEBE3; }
.worktrack .bar { height: 8px; border-radius: 8px; background: rgba(255, 255, 255, .16); margin-top: .4rem; overflow: hidden; }
.worktrack .bar span { display: block; height: 100%; background: var(--turmeric); border-radius: 8px; transition: width .6s ease; }
.worktrack.done .bar span { background: #7FD3A4; }

/* ---------- Theme picker ---------- */
.theme-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.theme-picker button { display: grid; justify-items: center; gap: .35rem; padding: .75rem .25rem; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: .78rem; font-weight: 600; }
.theme-picker button .sw { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); }
.theme-picker button[aria-pressed="true"] { border-color: var(--leaf-600); box-shadow: 0 0 0 2px var(--leaf-600) inset; color: var(--leaf-ink); }
.sw-system { background: linear-gradient(135deg, #F5F7F4 50%, #101A15 50%); }
.sw-light  { background: #F5F7F4; }
.sw-dark   { background: #101A15; }
.sw-glass  { background: radial-gradient(circle at 25% 30%, #BFE3CD, transparent 55%), radial-gradient(circle at 80% 70%, #F8D98C, transparent 55%), #DCEBE3; }

/* =========================================================================
   Dark theme
   ========================================================================= */
html[data-theme="dark"] {
  --paper: #0E1612;
  --surface: #16211B;
  --ink: #E4ECE7;
  --ink-2: #B9C6BF;
  --ink-3: #8A9991;
  --line: #26342C;
  --leaf-50: #1A2A21;
  --leaf-100: #1E3A2B;
  --leaf-ink: #9BD8B6;
  --turmeric-100: #3A2E10;
  --chili-100: #3E1E17;
  --pending-ink: #F2C863;
  --bad-ink: #F4A08D;
  --ok-ink: #B5E4C9;
  --seg-bg: #0B120E;
  --chip-muted-bg: #222E27;
  --sidebar-bg: #0A120D;
  --info-bg: #17262B; --info-ink: #A9CAD4;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  color-scheme: dark;
}
html[data-theme="dark"] .nav-side a.active { background: var(--leaf-100); color: #fff; }
html[data-theme="dark"] .btn-quiet:hover { color: #fff; }
html[data-theme="dark"] .today > div:first-child, html[data-theme="dark"] .clock-card { background: #1C4A35; }
html[data-theme="dark"] .auth-logo, html[data-theme="dark"] .app-head img { background: #fff; }
html[data-theme="dark"] .btn-close { filter: invert(1) grayscale(1) brightness(1.6); }
html[data-theme="dark"] .leaflet-container { filter: brightness(.85) contrast(1.05); }

/* =========================================================================
   Liquid Glass theme: translucent layers over a soft leaf-and-turmeric field.
   Follows the system light/dark setting for its tint.
   ========================================================================= */
html[data-theme="glass"] {
  --surface: rgba(255, 255, 255, .55);
  --line: rgba(255, 255, 255, .55);
  --head-bg: rgba(255, 255, 255, .35);
  --seg-bg: rgba(255, 255, 255, .35);
  --chip-muted-bg: rgba(255, 255, 255, .5);
  --leaf-50: rgba(255, 255, 255, .45);
  --sidebar-bg: rgba(23, 61, 43, .72);
  --glass-blur: blur(22px) saturate(180%);
  --glass-edge: inset 0 1px 0 rgba(255, 255, 255, .85), inset 0 -1px 0 rgba(255, 255, 255, .25), 0 10px 30px rgba(31, 77, 58, .10);
}
html[data-theme="glass"] body {
  background:
    radial-gradient(60vmax 60vmax at 0% 0%, rgba(140, 205, 167, .55), transparent 60%),
    radial-gradient(50vmax 50vmax at 100% 15%, rgba(248, 210, 120, .55), transparent 60%),
    radial-gradient(60vmax 60vmax at 60% 100%, rgba(150, 196, 214, .45), transparent 60%),
    #E9F1EC;
  background-attachment: fixed;
}
html[data-theme="glass"][data-bs-theme="dark"] {
  --paper: #0B130F;
  --surface: rgba(30, 44, 36, .5);
  --line: rgba(255, 255, 255, .12);
  --head-bg: rgba(255, 255, 255, .04);
  --seg-bg: rgba(0, 0, 0, .25);
  --chip-muted-bg: rgba(255, 255, 255, .08);
  --leaf-50: rgba(255, 255, 255, .06);
  --leaf-100: rgba(127, 211, 164, .16);
  --ink: #E6EEE9; --ink-2: #BCC9C2; --ink-3: #8FA096;
  --leaf-ink: #A6DEC0;
  --turmeric-100: rgba(227, 162, 26, .18); --chili-100: rgba(200, 69, 45, .2);
  --pending-ink: #F2C863; --bad-ink: #F4A08D; --ok-ink: #B5E4C9;
  --sidebar-bg: rgba(10, 22, 16, .6);
  --glass-edge: inset 0 1px 0 rgba(255, 255, 255, .14), 0 10px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
html[data-theme="glass"][data-bs-theme="dark"] body {
  background:
    radial-gradient(60vmax 60vmax at 0% 0%, rgba(42, 98, 73, .55), transparent 60%),
    radial-gradient(50vmax 50vmax at 100% 15%, rgba(140, 98, 20, .35), transparent 60%),
    radial-gradient(60vmax 60vmax at 60% 100%, rgba(40, 80, 100, .35), transparent 60%),
    #08100C;
  background-attachment: fixed;
}
html[data-theme="glass"] :is(.panel, .today, .tabbar, .sidebar, .modal-content, .dropdown-menu, .ann-bell, .theme-picker button, .app-head img) {
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-edge);
}
html[data-theme="glass"] :is(.panel, .today) { border-color: var(--line); border-radius: 22px; }
html[data-theme="glass"] .today > div:first-child,
html[data-theme="glass"] .clock-card {
  background: linear-gradient(160deg, rgba(42, 98, 73, .82), rgba(23, 61, 43, .78));
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 16px 40px rgba(23, 61, 43, .25);
}
html[data-theme="glass"] .clock-card { border-radius: 28px; }
html[data-theme="glass"] .form-control, html[data-theme="glass"] .form-select, html[data-theme="glass"] .input-group-text { background-color: rgba(255, 255, 255, .55); border-color: rgba(255, 255, 255, .7); }
html[data-theme="glass"][data-bs-theme="dark"] .form-control, html[data-theme="glass"][data-bs-theme="dark"] .form-select, html[data-theme="glass"][data-bs-theme="dark"] .input-group-text { background-color: rgba(0, 0, 0, .25); border-color: rgba(255, 255, 255, .12); }
html[data-theme="glass"] .btn-quiet { background: rgba(255, 255, 255, .45); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
html[data-theme="glass"][data-bs-theme="dark"] .btn-quiet { background: rgba(255, 255, 255, .08); }
html[data-theme="glass"] .sidebar { border-right: 1px solid rgba(255, 255, 255, .2); }
html[data-theme="glass"] .nav-side a.active { background: rgba(255, 255, 255, .85); }
html[data-theme="glass"][data-bs-theme="dark"] .nav-side a.active { background: rgba(255, 255, 255, .14); color: #fff; }
html[data-theme="glass"] .table > tbody td { border-color: var(--line); }
/* Floating glass tab bar */
html[data-theme="glass"] .tabbar { left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); border-radius: 26px; border: 1px solid var(--line); padding-bottom: 0; max-width: 456px; margin: 0 auto; }
html[data-theme="glass"] .app { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
html[data-theme="glass"] .tabbar a.active .bi { background: rgba(31, 77, 58, .14); }
html[data-theme="glass"] .auth { background: transparent; }
html[data-theme="glass"][data-bs-theme="dark"] .btn-close { filter: invert(1) grayscale(1) brightness(1.6); }

@media (prefers-reduced-transparency: reduce) {
  html[data-theme="glass"] { --surface: #F7FAF8; --glass-blur: none; }
  html[data-theme="glass"][data-bs-theme="dark"] { --surface: #16211B; }
}
html[data-bs-theme="dark"] { --bs-link-color: #9BD8B6; --bs-link-color-rgb: 155, 216, 182; --bs-link-hover-color: #C4EBD5; }
html[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: var(--leaf-ink); --bs-btn-border-color: var(--leaf-ink); --bs-btn-hover-color: #fff; }
html[data-bs-theme="dark"] .form-switch .form-check-input:not(:checked) { background-color: rgba(255, 255, 255, .08); }
.form-switch .form-check-input:focus:not(:checked) { --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%232A6249'/%3e%3c/svg%3e"); }
.form-check-input:focus { border-color: var(--leaf-600); box-shadow: 0 0 0 .2rem rgba(31, 77, 58, .15); }
.sidebar-foot .dropdown-item { color: var(--ink); }
.sidebar-foot .dropdown-item[aria-pressed="true"] { font-weight: 700; color: var(--leaf-ink); }
html[data-bs-theme="dark"] .chip-bad, html[data-bs-theme="dark"] .tone-late .big { color: var(--bad-ink); }
