:root {
  --ink: #1a1530;
  --coin: #ffc62e;
  --coin-soft: #fde8a0;
  --coral: #ff5d4a;
  --mint: #2fc592;
  --sky: #d6ecff;
  --paper: #ffffff;
  --paper-trans: rgba(255, 255, 255, 0.94);
  --paper-soft: #fcf9f2;
  --muted: #5d587a;
  --line: 1.5px solid rgba(26, 21, 48, 0.16);
  --shadow: 0 10px 25px -4px rgba(26, 21, 48, 0.08), 0 2px 6px rgba(26, 21, 48, 0.04);
  --radius: 22px;
  --display: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  overscroll-behavior-y: none;
}
body {
  margin: 0; font-family: var(--body); font-weight: 500; font-size: 15px; line-height: 1.5;
  color: var(--ink);
  background-color: #f4ecda;
  background-image: 
    radial-gradient(circle at 50% 80px, #ffd466 0%, rgba(255, 212, 102, 0.45) 45%, transparent 75%),
    radial-gradient(rgba(26, 21, 48, 0.065) 1.5px, transparent 1.5px);
  background-size: 100% 750px, 18px 18px;
  background-repeat: no-repeat, repeat;
  min-height: 100vh; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-y pinch-zoom;
}
button, a, input, select, textarea, .btn, .card, .stat, .tap-card, .mob-tab, .drawer-card, .quick-preset-pill, .filter-tab {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.nav, .mob-bar, .mob-drawer {
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
a { color: var(--ink); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { background: var(--coin); }
h1, h2, h3 { margin: 0 0 .4rem; line-height: 1.25; color: var(--ink); }
h1 { font-family: var(--body); font-weight: 800; letter-spacing: -.02em; font-size: clamp(1.25rem, 3.2vw, 1.7rem); display: flex; align-items: center; gap: .45rem; }
h2 { font-family: var(--body); font-weight: 800; letter-spacing: -.01em; font-size: 1.2rem; }
h3 { font-size: 1rem; font-weight: 800; }
.ico { flex: none; vertical-align: -.2em; }
.muted { color: var(--muted); }
.center { text-align: center; }
.right { text-align: right; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }

/* ==========================================================================
   SMOOTH CROSS-PAGE & SECTION VIEW TRANSITIONS (W3C Standard)
   ========================================================================== */
@view-transition {
  navigation: auto;
}

/* Stable Persistent Elements across Section Changes */
.topbar {
  view-transition-name: app-topbar;
}
.mobile-bottom-bar {
  view-transition-name: app-bottombar;
}
main.wrap {
  view-transition-name: app-page-content;
}

/* Custom view transition animations for smooth section glide */
::view-transition-old(app-page-content) {
  animation: 0.16s cubic-bezier(0.4, 0, 1, 1) both pageSlideExit;
}
::view-transition-new(app-page-content) {
  animation: 0.24s cubic-bezier(0.16, 1, 0.3, 1) 0.03s both pageSlideEnter;
}

@keyframes pageSlideExit {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-8px) scale(0.995);
  }
}

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

/* Fallback entrance & cascade animation for section switching */
@media (prefers-reduced-motion: no-preference) {
  main.wrap {
    animation: smoothSectionIn 0.26s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  .page-head {
    animation: smoothSectionIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  .dash-quick-nav, .bill-filter-bar, .monthnav, .tab-bar {
    animation: smoothSectionIn 0.26s 0.04s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  .stat-grid, .stats {
    animation: smoothSectionIn 0.28s 0.06s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
  main.wrap, .page-head, .dash-quick-nav, .stat-grid, .stats, .nav a.on, .mob-tab.active, .drawer-card {
    animation: none !important;
  }
}

.is-pressed {
  transform: scale(0.97) translateZ(0) !important;
  transition: transform 0.06s cubic-bezier(0.2, 0, 0, 1) !important;
}

.wrap { width: min(1080px, 100%); margin: 0 auto; padding: 1.25rem 1rem 2.5rem; flex: 1; }
.foot { text-align: center; padding: .85rem; font-weight: 800; font-size: .88rem; color: var(--muted); }

/* ---------- wordmark ---------- */
.wordmark { font-family: var(--body); font-weight: 900; font-size: 1.35rem; letter-spacing: -.02em; line-height: 1; white-space: nowrap; }
.wordmark b { display: inline-block; color: var(--coral); font-weight: 900; }
.wordmark.big { font-size: clamp(1.6rem, 5vw, 2.2rem); display: block; text-align: center; margin: .25rem 0 .5rem; }

/* ---------- top bar (slightly yellow comic coin header as before) ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: nowrap;
  padding: 0.65rem 1.25rem;
  background: linear-gradient(180deg, #ffde6b 0%, #ffd043 100%);
  border-bottom: 2px solid var(--ink);
  box-shadow: 0 4px 14px rgba(26, 21, 48, 0.08);
  min-height: 56px;
  box-sizing: border-box;
}
.brand { display: flex; align-items: center; gap: .5rem; text-decoration: none; flex-shrink: 0; }
.brand:hover { background: none; }
.brand-logo { width: 36px; height: 36px; flex-shrink: 0; }
.nav {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: nowrap;
  flex: 1;
  margin: 0 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.38rem 0.75rem;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--ink);
  border: 1.5px solid transparent;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.15s ease, background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.nav a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.75);
  transform: translateY(-1px);
}
.nav a:active {
  transform: scale(0.95);
}
.nav a.on {
  background: var(--ink);
  color: var(--coin);
  border: 1.5px solid var(--ink);
  box-shadow: 2px 2px 0 rgba(26, 21, 48, 0.25);
  animation: navPillPop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.nav a.on .ico,
.nav a.on svg {
  stroke: var(--coin);
  transform: scale(1.08);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes navPillPop {
  0% { transform: scale(0.92); }
  60% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Topbar Action Items & Profile */
.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin: 0;
  flex-shrink: 0;
}
.who-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-weight: 800;
  font-size: .86rem;
  padding: .35rem .75rem;
  background: rgba(255, 255, 255, 0.82);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  white-space: nowrap;
}
.topbar-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: transform .08s, box-shadow .08s, background .1s;
  padding: 0;
  box-sizing: border-box;
}
.topbar-btn:hover {
  background: #ffffff;
  transform: translateY(-1px);
  box-shadow: 3px 3px 0 var(--ink);
}
.topbar-btn:active {
  transform: translateY(1px);
  box-shadow: 1px 1px 0 var(--ink);
}
.topbar-btn.active {
  background: var(--ink);
  color: var(--coin);
  border-color: var(--ink);
}
.topbar-logout-form {
  margin: 0;
  display: inline-flex;
}
.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  width: auto;
  padding: 0 .65rem;
  font-size: .88rem;
  font-weight: 800;
  font-family: var(--body);
}
.btn-logout:hover {
  background: #ffd2cc;
  color: var(--coral);
}
.btn-logout-label {
  display: inline;
}

.who { display: flex; align-items: center; gap: .6rem; margin: 0; }
.who-name { font-weight: 800; display: inline-flex; align-items: center; gap: .3rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: 800 .9rem var(--body); padding: .5rem 1rem; cursor: pointer; text-decoration: none;
  color: var(--ink); background: var(--paper);
  border: 1.5px solid rgba(26, 21, 48, 0.2);
  border-radius: 12px;
  box-shadow: 0 2px 5px rgba(26, 21, 48, 0.06), 1.5px 1.5px 0 var(--ink);
  transition: transform .1s ease, box-shadow .1s ease, background .12s ease;
  min-height: 38px;
}
.btn:hover { background: #fffbe8; transform: translateY(-1px); box-shadow: 0 4px 10px rgba(26, 21, 48, 0.1), 2px 2px 0 var(--ink); }
.btn:active { transform: translateY(1px); box-shadow: 0 1px 2px rgba(26, 21, 48, 0.06); }
.btn-primary { background: var(--coral); color: #fff; border-color: rgba(26, 21, 48, 0.2); }
.btn-primary:hover { background: #ff7261; }
.btn-ghost { background: var(--paper); }
.btn-small { padding: .32rem .75rem; font-size: .84rem; min-height: 32px; border-radius: 10px; box-shadow: 0 2px 4px rgba(26, 21, 48, 0.05), 1px 1px 0 var(--ink); }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1.5px solid rgba(26, 21, 48, 0.2); border-radius: 12px; background: var(--paper); color: var(--ink); cursor: pointer; box-shadow: 0 2px 4px rgba(26, 21, 48, 0.05); transition: transform .08s, box-shadow .08s; }
.icon-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 8px rgba(26, 21, 48, 0.1); }
.icon-btn.danger:hover { background: var(--coral); color: #fff; }
.icon-btn.loading {
  pointer-events: none;
  opacity: 0.85;
  cursor: wait;
}
.spinner-sm {
  animation: spin-del 0.75s linear infinite;
  display: inline-block;
  vertical-align: middle;
}
@keyframes spin-del {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
tr.row-deleting {
  background-color: #fee2e2 !important;
  opacity: 0.45;
  transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.2s ease;
}

/* ---------- forms ---------- */
.stack { display: grid; gap: .9rem; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.row.wrap-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .9rem; }
.row.wrap-row .field { flex: 1 1 160px; }
.row.wrap-row .field.grow { flex: 2 1 260px; }
.field { display: grid; gap: .25rem; font-weight: 800; font-size: .88rem; }
.field > span { display: inline-flex; align-items: center; gap: .35rem; }
input, select, textarea {
  width: 100%; font: 600 .92rem var(--body); color: var(--ink); background: #ffffff;
  padding: .55rem .85rem; border: 1.5px solid rgba(26, 21, 48, 0.18); border-radius: 12px; min-height: 42px;
  box-shadow: inset 0 1px 2px rgba(26, 21, 48, 0.04);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  box-sizing: border-box;
}
input[type=file] { padding: .5rem; background: #ffffff; border-radius: 12px; }
input:focus, select:focus, textarea:focus {
  outline: none !important;
  border-color: var(--coral) !important;
  box-shadow: 0 0 0 3.5px rgba(255, 93, 74, 0.22) !important;
}
.check { display: flex; align-items: center; gap: .6rem; font-weight: 800; }
.check input { width: 22px; height: 22px; min-height: 0; accent-color: var(--coral); }
form.inline { display: inline; margin: 0; }

/* ---------- password visibility toggle ---------- */
.input-pass-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.input-pass-wrap input {
  width: 100%;
  padding-right: 2.85rem !important;
}
.btn-toggle-pass {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 0.4rem;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  opacity: 0.6;
  border-radius: 8px;
  line-height: 1;
  transition: opacity 0.15s ease, transform 0.15s ease, background-color 0.15s ease;
  user-select: none;
  box-shadow: none !important;
}
.btn-toggle-pass:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.06);
}
.btn-toggle-pass:active {
  transform: translateY(-50%) scale(0.9);
}
.btn-toggle-pass .ico {
  width: 20px;
  height: 20px;
  stroke-width: 2.2;
}

/* ---------- cards & layout ---------- */
.card { background: var(--paper-trans); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1.5px solid rgba(26, 21, 48, 0.12); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.35rem 1.45rem; margin-bottom: 1.35rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; align-items: start; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 { margin-bottom: 1rem; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: .85rem; flex-wrap: wrap; margin-bottom: 1rem; }
.head-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.section-title { margin-top: .5rem; }
.monthnav { display: inline-flex; align-items: center; gap: .4rem; }
.monthnav form { margin: 0; }
.monthnav input[type=month],
.monthnav select.month-select {
  min-height: 38px;
  padding: .35rem .75rem;
  width: auto;
  font-weight: 800;
  border-radius: 10px;
  border: 1.5px solid rgba(26, 21, 48, 0.16);
  background: var(--paper);
  font-size: .92rem;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(26, 21, 48, 0.05);
}
.monthnav .btn[disabled],
.monthnav button[disabled] {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  box-shadow: none !important;
  transform: none !important;
}

/* Nepali Date Picker Field */
.nepali-date-field {
  margin-bottom: 0.85rem;
}
.nepali-date-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}
.nepali-date-head span {
  font-weight: 800;
  font-size: 0.9rem;
}
.nepali-quick-pills {
  display: flex;
  gap: 0.35rem;
}
.nepali-quick-pills .pill-btn {
  background: rgba(255, 255, 255, 0.82);
  border: 1.5px solid rgba(26, 21, 48, 0.15);
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 0.2rem 0.75rem;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(26, 21, 48, 0.05);
  transition: transform 0.1s ease, background 0.15s ease;
}
.nepali-quick-pills .pill-btn:hover {
  background: var(--coin-soft);
  transform: translateY(-1px);
}
.nepali-picker-row {
  display: grid;
  grid-template-columns: 75px 1fr 100px;
  gap: 0.4rem;
}
.nepali-picker-row select {
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  border: var(--line);
  background: var(--paper);
}
.nepali-date-preview {
  margin-top: 0.25rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

.flash { padding: .85rem 1.15rem; border: 1.5px solid rgba(26, 21, 48, 0.14); border-radius: 14px; margin-bottom: 1rem; font-weight: 700; background: var(--paper); box-shadow: 0 6px 18px -3px rgba(26, 21, 48, 0.06); }
.flash-ok { background: #c9f5e4; }
.flash-err { background: #ffd2cc; }
.flash-warn { background: var(--coin-soft); }

/* ---------- floating toast notifications ---------- */
.toast-container {
  position: fixed;
  top: 1.15rem;
  right: 1.25rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 420px;
  width: calc(100% - 2.5rem);
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  background: var(--paper);
  border: 1.5px solid rgba(26, 21, 48, 0.18);
  border-radius: 16px;
  box-shadow: 0 10px 25px -4px rgba(26, 21, 48, 0.12), 0 2px 6px rgba(26, 21, 48, 0.06);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--ink);
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast-ok {
  background: #dcfce7;
  border-color: #16a34a;
  color: #14532d;
  box-shadow: 4px 4px 0 #15803d;
}
.toast-err {
  background: #fee2e2;
  border-color: #dc2626;
  color: #7f1d1d;
  box-shadow: 4px 4px 0 #b91c1c;
}
.toast-warn {
  background: #fef3c7;
  border-color: #d97706;
  color: #78350f;
  box-shadow: 4px 4px 0 #b45309;
}
.toast-icon {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.toast-msg {
  flex: 1;
  line-height: 1.4;
}
.toast-close {
  background: none;
  border: none;
  padding: 0 0.25rem;
  font-size: 1.35rem;
  line-height: 1;
  color: inherit;
  opacity: 0.65;
  cursor: pointer;
  border-radius: 4px;
  transition: opacity 0.15s;
}
.toast-close:hover {
  opacity: 1;
}
.toast-fadeout {
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
}
@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@media (max-width: 640px) {
  .toast-container {
    top: 0.75rem;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: calc(100% - 1.5rem);
  }
}
.empty { background: #fffdf5; border: 2px dashed rgba(26, 21, 48, 0.22); border-radius: 16px; padding: 1.25rem; margin: 0; font-weight: 700; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding: 1.15rem 1.35rem;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(26, 21, 48, 0.15);
  border-radius: 20px;
  box-shadow: 0 6px 16px rgba(26, 21, 48, 0.05);
  text-decoration: none;
  transition: transform .12s, box-shadow .12s, background .12s;
}
.stat.link:hover {
  background: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 10px 22px -4px rgba(26, 21, 48, 0.08);
}
.stat-label { font-weight: 800; font-size: .82rem; color: var(--muted); display: inline-flex; gap: .35rem; align-items: center; }
.stat-num { font-family: var(--body); font-weight: 800; font-size: 1.55rem; letter-spacing: -.01em; line-height: 1.15; }
.stat.good { border-left: 5px solid var(--mint); background: rgba(218, 242, 228, 0.95); }
.stat.bad { border-left: 5px solid var(--coral); background: rgba(255, 222, 214, 0.95); }

.hero-net {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #ffd84d 0%, #ffc62e 100%);
  border: 1.5px solid var(--ink);
  border-radius: 22px;
  box-shadow: 0 12px 28px -4px rgba(255, 175, 40, 0.35), 2px 2px 0 var(--ink);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}
.hero-net.neg { background: linear-gradient(135deg, #ffc2b8 0%, #ffa89b 100%); }
.hero-label { margin: 0; font-weight: 800; font-size: .84rem; }
.hero-num { margin: 0; font-family: var(--body); font-weight: 800; font-size: clamp(1.6rem, 4.5vw, 2.2rem); line-height: 1.15; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.hero-sub { margin: .2rem 0 0; font-weight: 600; font-size: .84rem; color: var(--ink); }

.bars { display: grid; gap: .75rem; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 110px; align-items: center; gap: .75rem; font-weight: 800; font-family: var(--body); }
.bar-label { color: var(--ink); font-size: .95rem; }
.bar-track { height: 16px; background: rgba(26, 21, 48, 0.06); border: 1.5px solid rgba(26, 21, 48, 0.14); border-radius: 999px; overflow: hidden; box-shadow: none; }
.bar-fill { display: block; height: 100%; border-radius: 999px; }
.bar-fill.good { background: #10b981; }
.bar-fill.bad { background: #f43f5e; }
.bar-val { text-align: right; font-variant-numeric: tabular-nums; font-size: .98rem; font-weight: 800; color: var(--ink); }
.bar-val.good { color: #0d8253; }
.bar-val.bad { color: #d93829; }
.bars-heading { font-family: var(--body); font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; margin-bottom: .85rem; }

/* ---------- tables (enhanced visual hierarchy & scannability) ---------- */
.table-scroll {
  overflow-x: auto;
  border-radius: 14px;
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 1rem;
}
table:last-child { margin-bottom: 0; }
th, td {
  padding: .75rem .85rem;
  text-align: left;
  vertical-align: middle;
}
th {
  font-weight: 800;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.035em;
  color: #433e5c;
  border-bottom: 2px solid var(--ink);
  white-space: nowrap;
  background: rgba(26, 21, 48, 0.045);
}
td {
  border-bottom: 1px dashed rgba(26, 21, 48, 0.12);
  font-size: 0.92rem;
  transition: background 0.12s ease;
}
tbody tr:hover td {
  background: rgba(255, 222, 107, 0.14);
}
td.num, th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
td.num {
  font-weight: 700;
  color: var(--ink);
}
td.num.font-bold {
  font-weight: 800;
  font-size: 0.96rem;
}
td.act {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}
tfoot td {
  font-weight: 800;
  font-size: 0.95rem;
  border-top: 2px solid var(--ink);
  border-bottom: 0;
  background: rgba(255, 198, 46, 0.18);
}
.table-sub {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.25;
  margin-top: 0.15rem;
}
.table-primary-text {
  font-weight: 800;
  color: var(--ink);
  display: block;
  line-height: 1.3;
}
.tag { display: inline-block; padding: .12rem .65rem; border: 1.5px solid rgba(26, 21, 48, 0.18); border-radius: 999px; font-weight: 800; font-size: .85rem; }
.tag-good { background: #c9f5e4; }
.tag-bad { background: #ffd2cc; }

/* ---------- Canteen Menu Controls & Category Pills ---------- */
.canteen-menu-header {
  margin-bottom: 1rem;
}
.food-filter-controls {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.food-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: 2px 2px 0 var(--ink);
  padding: 0 .65rem;
  transition: border-color .15s, box-shadow .15s;
}
.food-search-wrap:focus-within {
  border-color: var(--coral);
  box-shadow: 2px 2px 0 var(--coral);
}
.food-search-wrap .search-icon {
  color: var(--muted);
  display: inline-flex;
  margin-right: .4rem;
  flex-shrink: 0;
}
.food-grid-search-input {
  border: none !important;
  outline: none !important;
  background: transparent !important;
  padding: .5rem 0 !important;
  min-height: auto !important;
  font: 700 .9rem var(--body) !important;
  color: var(--ink) !important;
  width: 100%;
}
.search-clear-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--muted);
  cursor: pointer;
  padding: 0 .25rem;
  line-height: 1;
}
.food-cat-pills {
  display: flex;
  gap: .4rem;
  overflow-x: auto;
  padding-bottom: .35rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.food-cat-pills::-webkit-scrollbar {
  display: none;
}
.food-cat-pill {
  white-space: nowrap;
  font: 800 .78rem var(--body);
  padding: .35rem .75rem;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 1.5px 1.5px 0 var(--ink);
  cursor: pointer;
  transition: all .12s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  flex-shrink: 0;
}
.food-cat-pill:hover {
  transform: translateY(-1px);
  background: var(--coin-soft);
}
.food-cat-pill.active {
  background: var(--ink);
  color: #ffde6b;
  transform: translateY(-1px);
  box-shadow: 2px 2px 0 rgba(0,0,0,0.25);
}

/* ---------- Food Cards & Media ---------- */
.food-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
  transition: opacity .2s ease;
}
.food-card {
  position: relative;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: 3px 3px 0 var(--ink);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: transform .22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow .22s ease, opacity .22s ease, filter .22s ease, border-color .15s ease;
}
.food-card:hover {
  transform: translateY(-2px);
  box-shadow: 4px 5px 0 var(--ink);
}
.food-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 200px;
  overflow: hidden;
  background: var(--coin-soft);
}
.food-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  max-height: 200px;
  object-fit: cover;
  object-position: center;
  border-bottom: 1.5px solid var(--ink);
}
.food-price-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: #ffde6b;
  color: var(--ink);
  font: 900 .76rem var(--body);
  padding: .15rem .45rem;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  box-shadow: 1px 1px 0 var(--ink);
  pointer-events: none;
  z-index: 2;
  letter-spacing: -0.01em;
}
.food-focus-dismiss {
  display: none;
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid var(--ink);
  box-shadow: 1px 1px 0 var(--ink);
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
  z-index: 5;
  align-items: center;
  justify-content: center;
}
.food-body {
  padding: .55rem .45rem .65rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
  justify-content: space-between;
}
.food-name {
  font: 800 .86rem / 1.22 var(--body);
  color: var(--ink);
  margin: 0 0 .15rem;
  width: 100%;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.1em;
  max-height: 2.5em;
  letter-spacing: -0.01em;
}
.food-card-price {
  font-weight: 800;
  font-size: .82rem;
  color: var(--ink);
  margin: 0 0 .35rem;
  text-align: center;
  width: 100%;
}
.food-card-price .muted {
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
}
.food-del-overlay { position: absolute; top: 6px; right: 6px; z-index: 5; margin: 0; }
.food-del-overlay .icon-btn { width: 28px; height: 28px; border-radius: 6px; }
.quick-eat-form { margin-top: auto; width: 100%; display: flex; justify-content: center; }
.btn-eat, .btn-eat-action {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  padding: .35rem .4rem;
  font: 800 .78rem var(--body);
  background: var(--coral);
  color: #fff;
  text-shadow: 1px 1px 0 rgba(26, 21, 48, 0.25);
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  box-shadow: 1.5px 1.5px 0 var(--ink);
  cursor: pointer;
  white-space: nowrap;
  transition: transform .06s, background .1s, box-shadow .06s;
  min-height: 32px;
}
.btn-eat:hover, .btn-eat-action:hover {
  background: #ff7261;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(255, 93, 74, 0.4), 1.5px 1.5px 0 var(--ink);
}
.btn-eat:active, .btn-eat-action:active {
  transform: translate(1px, 1px);
  box-shadow: 0.5px 0.5px 0 var(--ink);
}

/* ---------- Single Food Spotlight Focus Mode ---------- */
.food-grid.has-focus .food-card:not(.is-focused) {
  opacity: 0.26 !important;
  transform: scale(0.95) !important;
  filter: grayscale(40%) blur(0.3px) !important;
}
.food-grid.has-focus .food-card:not(.is-focused):hover {
  opacity: 0.65 !important;
  filter: none !important;
  transform: scale(0.98) !important;
}
.food-card.is-focused {
  opacity: 1 !important;
  transform: scale(1.08) translateY(-4px) !important;
  z-index: 35 !important;
  border: 2.5px solid var(--coral) !important;
  box-shadow: 0 16px 36px rgba(26, 21, 48, 0.32), 0 0 0 3px rgba(255, 93, 74, 0.45) !important;
  filter: none !important;
}
.food-card.is-focused .food-focus-dismiss {
  display: flex !important;
}
.food-card.is-focused .food-name {
  color: var(--coral) !important;
  font-size: .95rem !important;
  -webkit-line-clamp: unset !important;
  max-height: none !important;
  text-decoration: underline !important;
  text-decoration-color: #ffde6b !important;
  text-underline-offset: 3px !important;
}
.food-card.is-focused .btn-eat {
  min-height: 38px !important;
  font-size: .88rem !important;
  font-weight: 900 !important;
  padding: .45rem .6rem !important;
  box-shadow: 2px 2px 0 var(--ink), 0 4px 14px rgba(255, 93, 74, 0.45) !important;
  background: #ff5d4a !important;
}
.btn-eat:active, .btn-eat.btn-eating,
.btn-eat-action:active, .btn-eat-action.btn-eating {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(26, 21, 48, 0.1);
  background: #e04b38;
}

/* ==========================================================================
   Eye-Friendly Canteen Forms & Modern Food Record Ledger
   ========================================================================== */
.food-form-card {
  background: #ffffff !important;
  border: 2px solid #000000 !important;
  border-radius: 18px !important;
  box-shadow: 3px 3px 0 #000000 !important;
  padding: 1.25rem 1.35rem !important;
  transition: transform .15s ease, box-shadow .15s ease;
}
.food-form-card:hover {
  transform: translateY(-1px);
  box-shadow: 4px 4px 0 #000000 !important;
}
.canteen-form-card {
  border: 2px solid #000000 !important;
}
.canteen-form-card h2 svg {
  color: #4f46e5 !important;
}
.offgrid-form-card {
  border: 2px solid #000000 !important;
}
.offgrid-form-card h2 svg {
  color: #ea580c !important;
}
.food-form-card h2 {
  font-size: 1.05rem !important;
  font-weight: 800 !important;
  color: #1e293b !important;
  margin: 0 0 .25rem !important;
  display: flex;
  align-items: center;
  gap: .45rem;
}
.food-form-card p.muted {
  font-size: 0.84rem !important;
  color: #64748b !important;
  margin-bottom: 0.9rem !important;
}
.food-form-card .field span {
  font-size: 0.78rem !important;
  font-weight: 800 !important;
  color: #475569 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
  margin-bottom: 0.25rem !important;
}
.food-form-card input,
.food-form-card select {
  background: #f8fafc !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 10px !important;
  font-size: 0.92rem !important;
  font-weight: 600 !important;
  color: #1e293b !important;
  padding: 0.55rem 0.75rem !important;
  min-height: 42px !important;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.food-form-card input:focus,
.food-form-card select:focus {
  background: #ffffff !important;
  border-color: #4f46e5 !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14) !important;
  outline: none !important;
}
.offgrid-form-card input:focus {
  border-color: #ea580c !important;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.14) !important;
}
.btn-save-food {
  background: #4f46e5 !important;
  color: #ffffff !important;
  font-size: 0.88rem !important;
  font-weight: 800 !important;
  min-height: 42px !important;
  border: 2px solid #000000 !important;
  border-radius: 10px !important;
  box-shadow: 2px 2px 0 #000000 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  cursor: pointer !important;
  width: 100% !important;
  transition: transform .08s ease, background .15s ease, box-shadow .08s ease;
}
.btn-save-food:hover {
  background: #4338ca !important;
  transform: translateY(-1px) !important;
  box-shadow: 2px 3px 0 #000000 !important;
}
.btn-save-food:active {
  transform: translate(1px, 1px) !important;
  box-shadow: 1px 1px 0 #000000 !important;
}
.btn-save-offgrid {
  background: #ea580c !important;
  color: #ffffff !important;
  font-size: 0.88rem !important;
  font-weight: 800 !important;
  min-height: 42px !important;
  border: 2px solid #000000 !important;
  border-radius: 10px !important;
  box-shadow: 2px 2px 0 #000000 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  cursor: pointer !important;
  width: 100% !important;
  transition: transform .08s ease, background .15s ease, box-shadow .08s ease;
}
.btn-save-offgrid:hover {
  background: #c2410c !important;
  transform: translateY(-1px) !important;
  box-shadow: 2px 3px 0 #000000 !important;
}
.btn-save-offgrid:active {
  transform: translate(1px, 1px) !important;
  box-shadow: 1px 1px 0 #000000 !important;
}

/* Modern, Eye-Pleasing Monthly Food Ledger Table */
#food-ledger-card {
  background: #ffffff !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 20px !important;
  box-shadow: 0 4px 18px rgba(26, 21, 48, 0.04) !important;
  padding: 1.35rem 1.45rem !important;
}
#food-ledger-card .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}
#food-ledger-card .section-header h2 {
  color: #1e293b !important;
  font-size: 1.15rem !important;
  font-weight: 800 !important;
  margin: 0;
}
#food-ledger-card .table-search-bar {
  background: #f8fafc !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 0.4rem 0.65rem !important;
  margin-bottom: 0.85rem !important;
}
#food-ledger-card .table-search-input {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  font-size: 0.88rem !important;
  color: #1e293b !important;
}
#food-ledger-card .table-search-input:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15) !important;
}
#food-ledger-card .table-scroll {
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) !important;
}
#food-ledger-card table {
  margin-bottom: 0 !important;
}
#food-ledger-card th {
  background: #f8fafc !important;
  color: #475569 !important;
  font-size: 0.74rem !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  padding: 0.75rem 0.85rem !important;
  border-bottom: 1.5px solid #e2e8f0 !important;
}
#food-ledger-card td {
  padding: 0.75rem 0.85rem !important;
  border-bottom: 1px solid #f1f5f9 !important;
  font-size: 0.92rem !important;
  color: #1e293b !important;
}
#food-ledger-card tbody tr:hover td {
  background: #f8fafc !important;
}
#food-ledger-card tbody tr:last-child td {
  border-bottom: none !important;
}
#food-ledger-card .table-primary-text {
  color: #0f172a !important;
  font-weight: 700 !important;
}
#food-ledger-card .table-sub {
  color: #64748b !important;
  font-size: 0.78rem !important;
}
#food-ledger-card .text-bad {
  color: #b91c1c !important; /* Gentle deep crimson instead of eye-straining bright red */
  font-weight: 800 !important;
  font-size: 0.95rem !important;
}
#food-ledger-card tfoot td {
  background: #f8fafc !important; /* Soft slate tone instead of harsh yellow */
  border-top: 2px solid #cbd5e1 !important;
  color: #0f172a !important;
  padding: 0.85rem 0.85rem !important;
  font-size: 0.94rem !important;
}
#food-ledger-card tfoot strong {
  color: #0f172a !important;
}
#food-ledger-card tfoot #food-table-total {
  color: #b91c1c !important;
  font-size: 1.05rem !important;
  font-weight: 900 !important;
}

/* ---------- professional salary statement ---------- */
.statement {
  background: var(--paper);
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.statement-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 2px dashed rgba(26, 21, 48, 0.25);
}

.statement-brand-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.35rem;
}
.statement-brand-meta strong {
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}
.statement-period {
  text-align: right;
}
.statement-period-badge {
  display: inline-block;
  background: #fef3c7;
  border: 1.5px solid var(--ink);
  color: #78350f;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.25rem;
}

/* Statement Top Meta */
.statement-brand-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.statement-user-name {
  font-size: 1.25rem;
  font-weight: 800;
  display: block;
}
.statement-user-sub {
  font-size: 0.85rem;
  font-weight: 700;
}
.statement-period-range {
  font-size: 0.82rem;
  font-weight: 700;
}

/* 3-Pillar Executive KPI Cards */
.statement-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 820px) {
  .statement-kpi-row {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
}
.stat-kpi-card {
  background: #ffffff;
  border: 1.5px solid rgba(26, 21, 48, 0.14);
  border-radius: 18px;
  padding: 1.15rem 1.35rem;
  box-shadow: 0 8px 24px -4px rgba(26, 21, 48, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.stat-kpi-card.kpi-gross {
  background: #f0fdf4;
  border-color: rgba(21, 128, 61, 0.3);
  box-shadow: 0 8px 24px -4px rgba(21, 128, 61, 0.12);
}
.stat-kpi-card.kpi-deductions {
  background: #fff1f2;
  border-color: rgba(190, 18, 60, 0.3);
  box-shadow: 0 8px 24px -4px rgba(190, 18, 60, 0.12);
}
.stat-kpi-card.kpi-net {
  background: #ecfdf5;
  border-color: rgba(5, 150, 105, 0.3);
  box-shadow: 0 8px 24px -4px rgba(5, 150, 105, 0.15);
}
.stat-kpi-card.kpi-net.neg {
  background: #fff1f2;
  border-color: rgba(190, 18, 60, 0.3);
  box-shadow: 0 8px 24px -4px rgba(190, 18, 60, 0.15);
}
.stat-kpi-card .kpi-label {
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.kpi-gross .kpi-label { color: #166534; }
.kpi-deductions .kpi-label { color: #9f1239; }
.kpi-net .kpi-label { color: #065f46; }
.stat-kpi-card .kpi-num {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.kpi-net .kpi-num { color: #047857; }
.stat-kpi-card .kpi-sub {
  font-size: 0.8rem;
  font-weight: 700;
}

/* Visual Equation Bar */
.statement-equation-bar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 0.75rem;
  padding: 0.85rem 1.4rem;
  margin-bottom: 1.5rem;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1.5px solid rgba(26, 21, 48, 0.14);
  border-radius: 16px;
  box-shadow: 0 6px 20px -3px rgba(26, 21, 48, 0.05);
  flex-wrap: wrap;
}
.eq-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}
.eq-tag {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.05em;
}
.eq-val {
  font-size: 1.25rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.eq-gross .eq-val { color: #15803d; }
.eq-ded .eq-val { color: #be123c; }
.eq-net .eq-val { color: #047857; }
.eq-operator {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--muted);
}

.statement-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 820px) {
  .statement-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

.statement-box {
  background: #ffffff;
  border: 1.5px solid rgba(26, 21, 48, 0.14);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 24px -4px rgba(26, 21, 48, 0.06);
  display: flex;
  flex-direction: column;
}

.statement-box-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.15rem;
  border-bottom: 1.5px solid rgba(26, 21, 48, 0.12);
  font-weight: 800;
  font-size: 1rem;
}
.statement-box-head.earnings-head {
  background: #f0fdf4;
  color: #166534;
}
.statement-box-head.deductions-head {
  background: #fff1f2;
  color: #9f1239;
}
.statement-box-head .col-title {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.statement-box-head .badge-total {
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
}

.statement-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}
.statement-table td {
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid rgba(26, 21, 48, 0.08);
  font-size: 0.95rem;
  vertical-align: middle;
}
.statement-table tr:hover td {
  background: #fbfcfe;
}
.statement-table tr:last-child td {
  border-bottom: none;
}
.line-item-main {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.line-item-main strong {
  font-size: 0.96rem;
  color: #0f172a;
}
.line-item-sub {
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
  line-height: 1.3;
}
.muted-link {
  color: #475569;
  text-decoration: underline;
  font-weight: 700;
}
.statement-table td.num {
  font-size: 1.1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.statement-table tfoot td {
  background: #f8fafc;
  font-weight: 800;
  border-top: 2px solid var(--ink);
  border-bottom: none;
  font-size: 1rem;
  padding: 0.95rem 1.15rem;
}

/* History Table enhancements */
.history-month-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
}
.history-month-link:hover {
  text-decoration: underline;
}
.badge-current {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #1e40af;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}
.badge-net {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.badge-net.pos {
  background: #dcfce7;
  color: #166534;
}
.badge-net.neg {
  background: #ffe4e6;
  color: #9f1239;
}
tr.current-row td {
  background: #f0fdf4 !important;
}

/* Executive Net Pay Card (Modern Fintech Summary) */
.net-pay-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 1.6rem;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1.5px solid rgba(21, 128, 61, 0.4);
  border-radius: 20px;
  box-shadow: 0 10px 25px -4px rgba(21, 128, 61, 0.15);
  flex-wrap: wrap;
}
.net-pay-card.neg {
  background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
  border-color: rgba(190, 18, 60, 0.4);
  box-shadow: 0 10px 25px -4px rgba(190, 18, 60, 0.15);
}

.net-pay-left {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.net-pay-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 800;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #166534;
}
.net-pay-card.neg .net-pay-tag {
  color: #9f1239;
}

.net-pay-amount {
  font-family: var(--body);
  font-weight: 800;
  font-size: 2.15rem;
  line-height: 1.1;
  color: #14532d;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.net-pay-card.neg .net-pay-amount {
  color: #881337;
}

.net-pay-sub {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: #475569;
}
.net-pay-sub strong {
  color: var(--ink);
}

.net-pay-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  background: #ffffff;
  border: 1.5px solid #16a34a;
  color: #15803d;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.88rem;
  box-shadow: 0 2px 6px rgba(21, 128, 61, 0.12);
}
.net-pay-card.neg .net-pay-pill {
  border-color: #e11d48;
  color: #be123c;
  box-shadow: 0 2px 6px rgba(190, 18, 60, 0.12);
}

/* ============================================================
   SIMPLE BILLING / INVOICE TYPE PAYSLIP STYLES
   ============================================================ */

/* Filter Bar & Date Range Selector */
.bill-filter-bar {
  max-width: 920px;
  margin: 0 auto 1.5rem auto;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}
/* Quick Presets Bar on Salary Statement */
.quick-presets-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}
.quick-preset-label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #64607d);
  margin-right: 0.2rem;
}
.quick-preset-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--card-bg, #ffffff);
  border: 1.5px solid var(--border, #1a1530);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink, #1a1530);
  text-decoration: none;
  box-shadow: 1.5px 1.5px 0 var(--border, #1a1530);
  transition: all 0.15s ease;
}
.quick-preset-pill:hover {
  background: var(--coin, #ffc62e);
  transform: translate(-1px, -1px);
  box-shadow: 2px 2px 0 var(--border, #1a1530);
}
.quick-preset-pill.active {
  background: var(--coin, #ffc62e);
  color: var(--ink, #1a1530);
  box-shadow: 2px 2px 0 var(--border, #1a1530);
  border-color: var(--border, #1a1530);
}

/* Deficit / Negative Net Pay Alert */
.stmt-deficit-alert {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: #fff0f0;
  border: 2px solid #d32f2f;
  border-radius: var(--radius, 14px);
  box-shadow: 3px 3px 0 #d32f2f;
  color: #5a0c0c;
  margin-bottom: 1.25rem;
}
.stmt-deficit-alert .deficit-icon {
  flex-shrink: 0;
  color: #d32f2f;
  margin-top: 2px;
}
.stmt-deficit-alert .deficit-title {
  margin: 0 0 0.25rem 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #b71c1c;
}
.stmt-deficit-alert p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #491212;
}

.bill-filter-tabs {
  display: inline-flex;
  gap: 0.35rem;
  background: rgba(26, 21, 48, 0.06);
  padding: 5px;
  border-radius: 999px;
  border: 1.5px solid rgba(26, 21, 48, 0.1);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.filter-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.45rem 1.15rem;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--muted);
  text-decoration: none;
  border: none;
  background: transparent;
  transition: all 0.15s ease;
  text-align: center;
}
.filter-tab:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.6);
}
.filter-tab.active {
  background: var(--coin);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(255, 198, 46, 0.35), 1.5px 1.5px 0 var(--ink);
  border: 1.5px solid var(--ink);
}
@media (max-width: 520px) {
  .bill-filter-bar {
    margin-bottom: 1rem;
  }
  .bill-filter-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    gap: 0.2rem;
    padding: 4px;
    border-radius: 14px;
  }
  .filter-tab {
    font-size: 0.74rem;
    padding: 0.45rem 0.25rem;
    border-radius: 10px;
  }
  .filter-tab svg {
    display: none;
  }
}
.bill-filter-form {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}
.filter-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
}
.bill-select, .bill-input {
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.45rem 0.75rem;
  border: 1.5px solid rgba(26, 21, 48, 0.16);
  border-radius: 10px;
  background: #faf4e6;
  color: var(--ink);
}
.bill-select:focus, .bill-input:focus {
  outline: none;
  border-color: var(--ink);
}
.range-inputs {
  display: flex;
  align-items: flex-end;
  gap: 0.85rem;
  flex-wrap: wrap;
}
.range-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569;
}
.range-hints {
  font-size: 0.78rem;
  color: #64748b;
  width: 100%;
  margin-top: 0.25rem;
}

/* 3-Month Quarter Visual Picker */
.quarter-picker-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
}
.quarter-picker-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.quarter-picker-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--ink);
}
.quarter-picker-hint {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 500;
}
.quarter-pills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
  width: 100%;
}
.quarter-pill {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(26, 21, 48, 0.16);
  border-radius: 18px;
  padding: 0.95rem 1.15rem;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.14s cubic-bezier(.34, 1.56, .64, 1), box-shadow 0.14s, border-color 0.14s, background 0.14s;
  box-shadow: 0 4px 14px rgba(26, 21, 48, 0.05);
}
.quarter-pill:hover {
  border-color: var(--ink);
  background: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(26, 21, 48, 0.08), 2px 2px 0 var(--ink);
}
.quarter-pill.active {
  border: 1.5px solid var(--ink);
  background: var(--coin);
  box-shadow: 2px 2px 0 var(--ink);
}
.quarter-pill-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}
.quarter-pill-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--ink);
}
.quarter-pill-badge {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
}
.quarter-pill.active .quarter-pill-badge {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
}
.quarter-pill-months {
  font-size: 0.76rem;
  color: #64748b;
  margin-top: 0.25rem;
  font-weight: 500;
}
.quarter-pill.active .quarter-pill-months {
  color: #334155;
  font-weight: 700;
}
.quarter-older-form {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.25rem;
  padding-top: 0.5rem;
  border-top: 1px dashed #e2e8f0;
  flex-wrap: wrap;
}
.quarter-older-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
}
.quarter-select-compact {
  max-width: 420px;
  font-size: 0.84rem;
  padding: 0.35rem 0.65rem;
}

@media (max-width: 640px) {
  .quarter-picker-header {
    gap: 0.25rem;
    margin-bottom: 0.35rem;
  }
  .quarter-picker-title {
    font-size: 0.82rem;
  }
  .quarter-picker-hint {
    font-size: 0.72rem;
  }
  .quarter-pills-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
  }
  .quarter-pill {
    padding: 0.55rem 0.65rem;
    border-radius: 12px;
  }
  .quarter-pill.active {
    box-shadow: 0 3px 8px rgba(26, 21, 48, 0.1), 0 0 0 1.5px var(--ink);
  }
  .quarter-pill-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
  }
  .quarter-pill-name {
    font-size: 0.78rem;
    line-height: 1.2;
  }
  .quarter-pill-badge {
    font-size: 0.58rem;
    padding: 0.05rem 0.25rem;
    border-radius: 4px;
  }
  .quarter-pill-months {
    font-size: 0.68rem;
    margin-top: 0.15rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .quarter-older-form {
    gap: 0.35rem;
    margin-top: 0.35rem;
    padding-top: 0.35rem;
  }
  .quarter-older-label {
    font-size: 0.74rem;
    width: 100%;
  }
  .quarter-select-compact {
    width: 100%;
    max-width: 100%;
    font-size: 0.8rem;
    padding: 0.35rem 0.5rem;
  }
}

/* ========================================================
   SALARY STATEMENT (Billing Statement Table & Print)
   ======================================================== */
.stmt-sheet {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(26, 21, 48, 0.16);
  border-top: 5px solid var(--coral);
  border-radius: 26px;
  box-shadow: 0 16px 36px -8px rgba(26, 21, 48, 0.08), 0 4px 12px rgba(26, 21, 48, 0.03);
  padding: 2rem 2.25rem;
  max-width: 920px;
  margin: 0 auto 2.5rem auto;
  font-family: var(--body);
  color: var(--ink);
  line-height: 1.45;
}
@media (max-width: 640px) {
  .stmt-sheet {
    padding: 1.15rem 1rem;
    border-radius: 18px;
    box-shadow: 0 8px 20px rgba(26, 21, 48, 0.05);
  }
}

/* Statement Masthead */
.stmt-masthead {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 1rem;
  border-bottom: 1.5px solid rgba(26, 21, 48, 0.12);
  margin-bottom: 1.25rem;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.stmt-masthead-main {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.stmt-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--coin);
  border: 1.5px solid rgba(26, 21, 48, 0.18);
  padding: 0.18rem 0.6rem;
  border-radius: 8px;
  color: var(--ink);
}
.stmt-period-title {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--ink);
  margin: 0;
  font-family: inherit;
  line-height: 1.25;
}
.stmt-date-sub {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 600;
}
.stmt-masthead-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: right;
  font-size: 0.84rem;
}
.stmt-masthead-meta .meta-line {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
}
.stmt-masthead-meta .lbl {
  color: #64748b;
  font-weight: 600;
}
.stmt-masthead-meta .val {
  color: var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.stmt-masthead-meta .font-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Particulars Info Strip */
.stmt-particulars-bar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  background: #fcf7ed;
  border: 1.5px dashed rgba(26, 21, 48, 0.22);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: none;
}
.stmt-particulars-bar .particulars-col {
  padding: 0.85rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.stmt-particulars-bar .particulars-col:first-child {
  border-right: 1.5px dashed rgba(26, 21, 48, 0.18);
}
@media (max-width: 680px) {
  .stmt-particulars-bar {
    grid-template-columns: 1fr;
    margin-bottom: 1rem;
  }
  .stmt-particulars-bar .particulars-col:first-child {
    border-right: none;
    border-bottom: 2px dashed rgba(26, 21, 48, 0.22);
  }
  .stmt-particulars-bar .particulars-col {
    padding: 0.65rem 0.95rem;
  }
}
.part-lbl {
  font-size: 0.72rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.part-val {
  font-size: 0.95rem;
  color: var(--ink);
}
.part-sub {
  font-size: 0.8rem;
  color: #64748b;
}

/* Dual-Column Side-by-Side Ledger Table */
.stmt-desktop-view {
  display: block;
  border: 2px solid var(--ink);
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 14px rgba(26, 21, 48, 0.05);
}
.stmt-grid-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  color: var(--ink);
  margin-bottom: 0;
}
.stmt-grid-table .stmt-th-main th {
  padding: 0.75rem 1rem;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: #faf3e2;
  color: var(--ink);
  border-bottom: 2px solid var(--ink);
}
.stmt-grid-table .stmt-th-main th.th-earnings {
  border-right: 2px dashed rgba(26, 21, 48, 0.16);
  text-align: left;
}
.stmt-grid-table .stmt-th-main th.th-deductions {
  text-align: left;
}
.stmt-grid-table .stmt-th-sub th {
  background: rgba(26, 21, 48, 0.02);
  color: #475569;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.45rem 0.85rem;
  border-bottom: 1.5px solid rgba(26, 21, 48, 0.12);
  text-align: left;
}
.stmt-grid-table .stmt-th-sub th:nth-child(2) {
  border-right: 2px dashed rgba(26, 21, 48, 0.16);
  text-align: right;
}
.stmt-grid-table tbody td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px dashed rgba(26, 21, 48, 0.12);
  vertical-align: top;
}
.stmt-grid-table tbody td:nth-child(2) {
  border-right: 2px dashed rgba(26, 21, 48, 0.16);
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.stmt-grid-table .stmt-th-sub th:nth-child(4),
.stmt-grid-table tbody td:nth-child(4) {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.stmt-item-name {
  font-weight: 700;
  color: var(--ink);
}
.stmt-item-name a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.stmt-item-desc {
  font-size: 0.76rem;
  color: #64748b;
  margin-top: 0.15rem;
  line-height: 1.35;
}
.stmt-grid-table .stmt-subtotal-row td {
  background: #faf3e2;
  font-weight: 800;
  border-top: 1.5px solid rgba(26, 21, 48, 0.14);
  border-bottom: 1.5px solid rgba(26, 21, 48, 0.16);
  padding: 0.65rem 0.85rem;
}
.stmt-grid-table .stmt-subtotal-row td:nth-child(2) {
  border-right: 1.5px solid rgba(26, 21, 48, 0.14);
}
.stmt-subtotal-lbl {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.stmt-subtotal-val {
  font-size: 0.95rem;
  color: var(--ink);
}
.stmt-grid-table tfoot .stmt-total-strip td {
  background: #fde8a0;
  border-top: 2px solid var(--ink);
  border-bottom: none;
  padding: 0.85rem 1rem;
  vertical-align: middle;
}
.stmt-words-cell {
  border-right: 1.5px solid rgba(26, 21, 48, 0.14) !important;
  vertical-align: middle;
}
.words-lbl {
  font-size: 0.72rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.15rem;
}
.words-val {
  font-size: 0.92rem;
  font-weight: 700;
  font-style: italic;
  color: var(--ink);
  line-height: 1.4;
}
.stmt-grand-total-cell {
  text-align: right;
  vertical-align: middle;
}
.total-meta-wrap {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.65rem;
}
.total-caption {
  font-size: 0.9rem;
  font-weight: 900;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.total-amount {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  border-bottom: 3px double var(--ink);
  padding-bottom: 2px;
}
.text-danger {
  color: #dc2626;
}

/* Responsive View Switching for Statement */
.stmt-desktop-view {
  display: block;
}
.stmt-mobile-view {
  display: none;
}

@media (max-width: 720px) {
  .stmt-desktop-view {
    display: none !important;
  }
  .stmt-mobile-view {
    display: block !important;
  }

  .stmt-sheet {
    padding: 1.15rem 1rem !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 16px rgba(26, 21, 48, 0.06) !important;
    margin-bottom: 1.5rem !important;
  }
  .stmt-masthead {
    flex-direction: column;
    gap: 0.5rem;
    padding-bottom: 0.65rem;
    margin-bottom: 0.75rem;
  }
  .stmt-period-title {
    font-size: 1.15rem;
  }
  .stmt-date-sub {
    font-size: 0.76rem;
  }
  .stmt-masthead-meta {
    text-align: left;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    border-top: 1px dashed #e2e8f0;
    padding-top: 0.4rem;
    font-size: 0.76rem;
  }
  .stmt-masthead-meta .meta-line {
    justify-content: flex-start;
  }

  .stmt-mob-table-frame {
    background: #ffffff;
    border: 2px solid var(--ink);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 14px rgba(26, 21, 48, 0.05);
  }
  .stmt-mob-th {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  .stmt-mob-th.earnings-head {
    background: #f0fdf4;
    color: #166534;
    border-bottom: 1.5px solid rgba(26, 21, 48, 0.16);
  }
  .stmt-mob-th.deductions-head {
    background: #fff1f2;
    color: #9f1239;
    border-top: 1.5px solid rgba(26, 21, 48, 0.16);
    border-bottom: 1.5px solid rgba(26, 21, 48, 0.16);
  }
  .stmt-mob-th-title {
    font-weight: 800;
  }
  .stmt-mob-th-col {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
  }
  .stmt-mob-tr {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid rgba(26, 21, 48, 0.08);
    gap: 0.75rem;
  }
  .stmt-mob-td-name {
    flex: 1;
    min-width: 0;
  }
  .stmt-mob-td-amt {
    font-size: 0.92rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
    margin-top: 0.1rem;
  }
  .stmt-mob-subtotal-tr {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0.85rem;
    background: #e5d8bc;
    border-bottom: 1.5px solid rgba(26, 21, 48, 0.16);
    font-size: 0.84rem;
  }
  .stmt-mob-words-tr {
    background: #eee4cc;
    border-bottom: 1.5px solid rgba(26, 21, 48, 0.16);
    padding: 0.65rem 0.85rem;
  }
  .stmt-mob-words-tr .words-lbl {
    font-size: 0.7rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 0.15rem;
  }
  .stmt-mob-words-tr .words-val {
    font-size: 0.88rem;
    font-weight: 700;
    font-style: italic;
    color: var(--ink);
    line-height: 1.35;
  }
  .stmt-mob-total-tr {
    background: #fde8a0;
    border-top: 2px solid var(--ink);
    padding: 0.85rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
  }
  .stmt-mob-total-tr .total-caption {
    font-size: 0.9rem;
    font-weight: 900;
    color: var(--ink);
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  .stmt-mob-total-tr .total-amount {
    font-size: 1.55rem;
    font-weight: 900;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    border-bottom: 3.5px double var(--ink);
    line-height: 1.1;
    padding-bottom: 2px;
  }
}

/* Footer note */
.stmt-footer-note {
  font-size: 0.74rem;
  color: #94a3b8;
  text-align: center;
  border-top: 1px solid #f1f5f9;
  padding-top: 0.75rem;
  margin-top: 0.5rem;
  line-height: 1.45;
}

/* Previous Statements Table */
/* Previous Statements Container & Controls */
.stmt-history-section {
  border-radius: var(--radius);
}
.stmt-history-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  gap: 0.5rem;
}
.stmt-history-head h2 {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.stmt-history-desktop {
  display: block;
}
.stmt-history-mobile {
  display: none;
}

/* Desktop Statement Table */
.stmt-table-wrapper {
  border: 2px solid var(--ink);
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(26, 21, 48, 0.04);
}
.stmt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  color: var(--ink);
  margin-bottom: 0;
}
.stmt-table th {
  background: #faf3e2;
  color: var(--ink);
  font-weight: 800;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid rgba(26, 21, 48, 0.16);
}
.stmt-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px dashed rgba(26, 21, 48, 0.12);
  vertical-align: middle;
  background: #ffffff;
}
.stmt-table tbody tr:last-child td {
  border-bottom: none;
}
.stmt-table tbody tr:hover td {
  background: #fff9ea;
}
.stmt-table td.num, .stmt-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stmt-hist-badge {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--coin);
  border: 1.2px solid var(--ink);
  color: var(--ink);
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  box-shadow: 1px 1px 0 var(--ink);
  display: inline-block;
  vertical-align: middle;
}

/* Mobile On-Grid Stacked History Cards (fits 100% on phone, zero overflow) */
@media (max-width: 640px) {
  .stmt-history-desktop {
    display: none !important;
  }
  .stmt-history-mobile {
    display: flex !important;
    flex-direction: column;
    gap: 0.55rem;
  }
  .stmt-history-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.75rem 0.85rem;
    background: #ffffff;
    border: 1.5px solid rgba(26, 21, 48, 0.14);
    border-radius: 14px;
    text-decoration: none;
    color: var(--ink);
    box-shadow: 0 2px 6px rgba(26, 21, 48, 0.04);
    transition: transform 0.1s ease, box-shadow 0.1s ease, border-color 0.1s ease;
  }
  .stmt-history-card:hover, .stmt-history-card:active {
    background: #fffdf5;
    border-color: var(--ink);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(26, 21, 48, 0.08);
  }
  .stmt-history-card.active {
    background: #fef5d8;
    border: 1.5px solid var(--ink);
    box-shadow: 2px 2px 0 var(--ink);
  }
  .stmt-hist-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.4rem;
  }
  .stmt-hist-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    flex-wrap: wrap;
  }
  .stmt-hist-period {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--ink);
    line-height: 1.25;
  }
  .stmt-hist-net-badge {
    font-size: 0.98rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    color: #0d8253;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .stmt-hist-card-sub {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.78rem;
    flex-wrap: wrap;
  }
  .stmt-hist-range {
    color: var(--muted);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
  }
  .stmt-hist-breakdown {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.76rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
  }
}

/* Print Perfection: Strictly 1 Single Page */
@media print {
  @page {
    size: A4 portrait;
    margin: 10mm 12mm;
  }
  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 9.5pt !important;
    line-height: 1.35 !important;
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
  }
  .no-print, header, nav, .nav, .page-head, .bill-filter-bar, footer, .card, .stmt-mobile-view {
    display: none !important;
  }
  .stmt-desktop-view {
    display: block !important;
  }
  .wrap {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  .stmt-sheet {
    border: 1.5px solid #000000 !important;
    box-shadow: none !important;
    padding: 6mm 8mm !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    page-break-after: avoid !important;
    break-after: avoid !important;
  }
  .stmt-masthead {
    padding-bottom: 3mm !important;
    margin-bottom: 3mm !important;
    border-bottom: 1.5px solid #000000 !important;
  }
  .stmt-badge {
    border: 1px solid #000000 !important;
    background: transparent !important;
  }
  .stmt-period-title {
    font-size: 1.15rem !important;
    color: #000000 !important;
  }
  .stmt-particulars-bar {
    border: 1px solid #000000 !important;
    background: #ffffff !important;
    padding: 3mm 4mm !important;
    margin-bottom: 3mm !important;
  }
  .stmt-grid-table {
    border-collapse: collapse !important;
    width: 100% !important;
    margin-bottom: 3mm !important;
    border: 1.5px solid #000000 !important;
  }
  .stmt-grid-table .stmt-th-main th {
    background: #e2e8f0 !important;
    color: #000000 !important;
    border: 1px solid #000000 !important;
    padding: 3px 6px !important;
    font-size: 8.5pt !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .stmt-grid-table .stmt-th-sub th {
    background: #f1f5f9 !important;
    color: #000000 !important;
    border: 1px solid #000000 !important;
    padding: 3px 6px !important;
    font-size: 8pt !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .stmt-grid-table tbody td {
    padding: 3px 6px !important;
    border: 1px solid #000000 !important;
    font-size: 8pt !important;
  }
  .stmt-grid-table tbody td:nth-child(2),
  .stmt-grid-table .stmt-th-sub th:nth-child(2),
  .stmt-grid-table .stmt-subtotal-row td:nth-child(2),
  .stmt-words-cell {
    border-right: 1.5px solid #000000 !important;
  }
  .stmt-grid-table .stmt-subtotal-row td {
    background: #f8fafc !important;
    border-top: 1.5px solid #000000 !important;
    border-bottom: 1.5px solid #000000 !important;
    padding: 3px 6px !important;
    font-size: 8pt !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .stmt-grid-table tfoot .stmt-total-strip td {
    border-top: 1.5px solid #000000 !important;
    border-bottom: 2.5px double #000000 !important;
    padding: 4px 6px !important;
  }
  .total-amount {
    font-size: 1.25rem !important;
    color: #000000 !important;
    border-bottom: 2.5px double #000000 !important;
  }
  .stmt-link {
    text-decoration: none !important;
    color: #000000 !important;
  }
  .stmt-footer-note {
    font-size: 7pt !important;
    margin-top: 2mm !important;
    padding-top: 2mm !important;
    color: #444444 !important;
    border-top: 1px solid #999999 !important;
  }
}

/* ---------- auth ---------- */
.is-auth .wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 70px);
  padding: 3rem 1.25rem 2rem;
}
.auth-card {
  margin: 1.5rem auto 1rem;
  width: min(420px, 100%);
  background: var(--paper);
  border: 1.5px solid rgba(26, 21, 48, 0.14);
  border-radius: 20px;
  box-shadow: 0 12px 32px -6px rgba(26, 21, 48, 0.1), 0 2px 8px rgba(26, 21, 48, 0.04);
  padding: 1.4rem 1.25rem 1.25rem;
  display: grid;
  gap: 0.85rem;
}
.auth-logo {
  display: block;
  width: 68px;
  height: 68px;
  margin: 0 auto 0.25rem;
  filter: drop-shadow(0 2px 0 rgba(26,21,48,.12));
  animation: fbLogoPopUp 0.85s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  transform-origin: 50% 85%;
}
.auth-card .wordmark.big {
  font-size: 1.55rem;
  line-height: 1.15;
  margin: 0.1rem 0 0.25rem;
  text-align: center;
}
.auth-card p {
  margin: 0;
  line-height: 1.4;
}
.auth-card .muted.center {
  font-size: 0.84rem;
  color: var(--muted);
  max-width: 360px;
  margin: 0 auto;
}
.auth-card .field {
  gap: 0.3rem;
}
.auth-card .field input {
  padding: 0.5rem 0.75rem;
  min-height: 40px;
  font-size: 15px;
  border-radius: 8px;
}
.auth-card .btn-primary {
  min-height: 40px;
  font-size: 0.95rem;
  margin-top: 0.2rem;
  border-radius: 8px;
}
.auth-card-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
  margin-top: 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
}
.btn-resend-inline {
  background: none;
  border: none;
  padding: 0;
  color: var(--coral);
  font: 800 0.95rem var(--body);
  cursor: pointer;
  text-decoration: underline;
  transition: opacity 0.15s;
}
.btn-resend-inline:hover:not(:disabled) {
  opacity: 0.85;
}
.btn-resend-inline:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  text-decoration: none;
  color: var(--muted);
}
.otp-input {
  letter-spacing: 0.35em;
  font-size: 1.5rem;
  text-align: center;
  font-weight: 800;
  font-family: monospace, var(--body);
}
.dev-banner {
  background: #fef3c7;
  border: 2px dashed #d97706;
  color: #92400e;
  padding: .75rem;
  border-radius: 12px;
  font-size: .88rem;
  font-weight: 700;
  line-height: 1.4;
}
.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: btn-spin 0.65s linear infinite;
  vertical-align: middle;
}
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}
@keyframes field-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}
.shake {
  animation: field-shake 0.4s ease-in-out;
}
@keyframes stepIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.step-enter {
  animation: stepIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.verified-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: #dcfce7;
  border: 2px solid #16a34a;
  color: #15803d;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  text-align: center;
}
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}
input[type=number] {
  -moz-appearance: textfield;
}
@keyframes wobble { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }

/* ---------- mobile & responsive enhancements ---------- */
@media (max-width: 860px) {
  .grid-2 { grid-template-columns: 1fr; gap: 1.25rem; }
  .topbar { padding: .5rem .85rem; gap: .5rem; }
  .brand .wordmark { font-size: 1.65rem; }
  .who {
    order: 2;
    width: auto;
    margin-left: auto;
    gap: .45rem;
  }
  .who-name {
    font-size: .85rem;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .nav {
    order: 3;
    width: 100%;
    flex: none;
    display: flex;
    gap: .35rem;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: .2rem 0 .35rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a {
    flex: 0 0 auto;
    padding: .4rem .75rem;
    font-size: .88rem;
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: .45rem .65rem !important;
    min-height: 50px !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    gap: .4rem !important;
  }
  .topbar .nav { display: none !important; }
  .brand { gap: .35rem !important; }
  .brand-logo { width: 34px !important; height: 34px !important; }
  .brand .wordmark { font-size: 1.35rem !important; }
  
  .topbar-actions {
    display: inline-flex !important;
    align-items: center !important;
    gap: .3rem !important;
    flex-wrap: nowrap !important;
    flex-shrink: 0 !important;
  }
  .who-chip {
    padding: .28rem .45rem !important;
    font-size: .8rem !important;
    box-shadow: 1.5px 1.5px 0 var(--ink) !important;
  }
  .topbar-btn {
    width: 34px !important;
    height: 34px !important;
    border-radius: 9px !important;
    box-shadow: 1.5px 1.5px 0 var(--ink) !important;
  }
  .btn-logout {
    width: 34px !important;
    padding: 0 !important;
    justify-content: center !important;
  }
  .btn-logout-label {
    display: none !important;
  }
  .who { display: none !important; }

  .wrap { padding: .55rem .65rem 5.5rem !important; }
  h1 { font-size: 1.2rem; }
  h2 { font-size: 1.05rem; }
  .card { padding: .95rem 1rem; border-radius: 16px; margin-bottom: .85rem; box-shadow: 0 4px 14px rgba(26, 21, 48, 0.05); }
  
  /* Compact Header on Mobile */
  .page-head {
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: .5rem !important;
    margin-bottom: .45rem !important;
  }
  .page-head h1 { font-size: 1.3rem !important; margin: 0; }
  .page-head p.muted { display: none !important; }
  .monthnav {
    display: inline-flex !important;
    align-items: center !important;
    width: auto !important;
    background: var(--paper);
    border: 1.5px solid rgba(26, 21, 48, 0.16);
    border-radius: 12px;
    padding: .2rem .35rem;
    box-shadow: 0 2px 6px rgba(26, 21, 48, 0.04);
  }
  .monthnav form { flex: none; margin: 0; }
  .monthnav input[type=month],
  .monthnav select.month-select {
    width: auto;
    text-align: center;
    border: none;
    background: transparent;
    min-height: 28px;
    font-size: .84rem;
    font-weight: 800;
    padding: .1rem .25rem;
    cursor: pointer;
    box-shadow: none;
  }
  .monthnav .btn {
    min-width: 28px;
    min-height: 28px;
    padding: 0;
    display: grid;
    place-items: center;
  }

  /* Compact Net Hero Snapshot on Mobile (Zero Scrolling) */
  .hero-net {
    padding: .65rem .85rem !important;
    margin-bottom: .6rem !important;
    border-radius: 16px !important;
    border: 1.5px solid rgba(26, 21, 48, 0.16) !important;
    box-shadow: 0 6px 18px rgba(255, 198, 46, 0.35) !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    text-align: left !important;
    gap: .5rem !important;
  }
  .hero-net-details {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    min-width: 0;
  }
  .hero-net .hero-label {
    font-size: .68rem !important;
    text-transform: uppercase;
    letter-spacing: .04em;
    opacity: .85;
    margin: 0 !important;
  }
  .hero-net .hero-num {
    font-family: var(--body) !important;
    font-size: 1.55rem !important;
    font-weight: 800 !important;
    font-variant-numeric: tabular-nums !important;
    letter-spacing: -0.02em !important;
    margin: 0 !important;
    line-height: 1.05 !important;
  }
  .hero-net .hero-sub {
    font-size: .72rem !important;
    margin: 0 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--ink) !important;
  }
  .hero-net .hero-btn {
    width: auto !important;
    padding: .35rem .65rem !important;
    font-size: .78rem !important;
    min-height: 32px !important;
    border-radius: 10px !important;
    flex: none !important;
    box-shadow: 0 2px 4px rgba(26, 21, 48, 0.08) !important;
  }

  /* Hub Section Header */
  .hub-header {
    margin: .45rem 0 .35rem !important;
  }
  .hub-header .section-title {
    font-family: var(--body) !important;
    font-size: .95rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.01em !important;
    color: var(--ink) !important;
    margin: 0 !important;
  }
  .hub-badge {
    font-size: .65rem !important;
    padding: .1rem .4rem !important;
    font-weight: 800 !important;
  }

  /* The 8-card grid: Clean, user-friendly, high readability below ribbons */
  .dash-hub-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: .45rem !important;
    margin-bottom: .85rem !important;
  }
  .dash-hub-grid .nav-card {
    padding: .6rem .75rem !important;
    min-height: 56px !important;
    border-radius: 16px !important;
    border: 1.5px solid rgba(26, 21, 48, 0.12) !important;
    border-left: 4.5px solid var(--card-accent, var(--ink)) !important;
    border-top: none !important;
    box-shadow: 0 4px 12px rgba(26, 21, 48, 0.04) !important;
    gap: .55rem !important;
  }
  .dash-hub-grid .nav-card-icon-wrap {
    width: 34px !important;
    height: 34px !important;
    border-radius: 10px !important;
    border: 1.5px solid rgba(26, 21, 48, 0.14) !important;
    background: var(--coin-soft) !important;
    color: var(--ink) !important;
    box-shadow: 1px 1px 0 var(--ink) !important;
  }
  .dash-hub-grid .nav-card-icon-wrap svg {
    width: 17px !important;
    height: 17px !important;
  }
  .dash-hub-grid .nav-card-img {
    width: 20px !important;
    height: 20px !important;
  }
  .dash-hub-grid .nav-card-info {
    gap: .06rem !important;
  }
  .dash-hub-grid .nav-card-title {
    font-family: var(--body) !important;
    font-size: .83rem !important;
    font-weight: 800 !important;
    color: var(--ink) !important;
    line-height: 1.15 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .dash-hub-grid .nav-card-badge {
    display: none !important;
  }
  .dash-hub-grid .nav-card-val {
    font-family: var(--body) !important;
    font-size: .92rem !important;
    font-weight: 800 !important;
    font-variant-numeric: tabular-nums !important;
    letter-spacing: -0.01em !important;
    line-height: 1.1 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .dash-hub-grid .nav-card-val.val-good {
    color: #0d8253 !important;
  }
  .dash-hub-grid .nav-card-val.val-bad {
    color: #d93829 !important;
  }
  .dash-hub-grid .nav-card-val.val-neutral {
    color: var(--ink) !important;
  }
  .dash-hub-grid .nav-card-sub {
    display: none !important;
  }
  .dash-hub-grid .nav-card-arrow {
    display: none !important;
  }

  /* SSF / Leisure Tabs on Mobile */
  .tab-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .45rem;
  }
  .tab-item {
    padding: .5rem .6rem;
    font-size: .82rem;
    justify-content: center;
    text-align: center;
    border-radius: 10px;
    gap: .35rem;
  }
  .tab-item.tab-link {
    grid-column: 1 / -1;
    margin-left: 0;
    justify-content: center;
  }

  /* Table Horizontal Scrolling */
  .table-scroll {
    border-radius: 10px;
    border: 1.5px solid rgba(26,21,48,.18);
    -webkit-overflow-scrolling: touch;
  }
  th, td {
    padding: .5rem .4rem;
    font-size: .88rem;
  }

  /* Food Menu: 3-Column Grid on Mobile (< 640px) */
  .food-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: .42rem;
    margin-bottom: 1.25rem;
  }
  .food-card-media {
    width: 100% !important;
    height: 200px !important;
    max-height: 200px !important;
    overflow: hidden !important;
    background: var(--coin-soft);
  }
  .food-card-media img,
  .food-card img {
    display: block !important;
    width: 100% !important;
    height: 200px !important;
    max-height: 200px !important;
    object-fit: cover !important;
    object-position: center !important;
    border-bottom: 1.5px solid var(--ink) !important;
  }
}

@media (max-width: 540px) {
  /* Secondary Stats: Clean 2x2 Grid on Mobile */
  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: .65rem;
    margin-bottom: 1.25rem;
  }
  .stat {
    padding: .85rem;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(26, 21, 48, 0.05);
  }
  .stat-label { font-size: .75rem; gap: .25rem; }
  .stat-num { font-size: 1.55rem; }
  .stat-sub { font-size: .72rem; }

  /* Food Menu: App-Style 3-Column Grid on Mobile */
  .food-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: .42rem;
    margin-bottom: 1.25rem;
  }
  .food-card {
    border: 1.5px solid var(--ink);
    border-radius: 12px;
    box-shadow: 2px 2px 0 var(--ink);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .food-card-media {
    width: 100% !important;
    height: 195px !important;
    max-height: 195px !important;
    overflow: hidden !important;
    background: var(--coin-soft);
  }
  .food-card-media img,
  .food-card img {
    display: block !important;
    width: 100% !important;
    height: 195px !important;
    max-height: 195px !important;
    object-fit: cover !important;
    object-position: center !important;
    border-bottom: 1.5px solid var(--ink) !important;
  }
  .food-body {
    padding: .35rem .25rem .45rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    justify-content: space-between;
  }
  .food-name {
    font-size: .8rem;
    line-height: 1.18;
    margin-bottom: .15rem;
    min-height: 2.3em;
    max-height: 2.5em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .food-card-price {
    font-weight: 800;
    font-size: .74rem;
    color: var(--ink);
    margin: 0 0 .25rem;
    text-align: center;
    width: 100%;
  }
  .food-card-price .muted {
    font-size: .65rem;
    font-weight: 600;
  }
  .food-price-badge {
    font-size: .68rem;
    padding: .1rem .35rem;
    bottom: 4px;
    right: 4px;
  }
  .btn-eat {
    font-size: .74rem;
    padding: .3rem .15rem;
    min-height: 30px;
    border-radius: 7px;
  }
  .food-card.is-focused {
    transform: scale(1.06) translateY(-2px) !important;
  }
  .food-form-card,
  .canteen-form-card,
  .offgrid-form-card {
    border: 2px solid #000000 !important;
    box-shadow: 2.5px 2.5px 0 #000000 !important;
    border-radius: 16px !important;
    padding: 1rem 0.95rem !important;
  }

  @media (max-width: 360px) {
    .food-grid {
      gap: .3rem !important;
    }
    .food-card-media {
      height: 170px !important;
      max-height: 170px !important;
    }
    .food-card-media img,
    .food-card img {
      height: 170px !important;
      max-height: 170px !important;
    }
      max-height: none !important;
    }
    .food-body {
      padding: .3rem .15rem .35rem;
    }
    .food-name {
      font-size: .74rem;
    }
    .food-card-price {
      font-size: .7rem;
      margin: 0 0 .2rem;
    }
    .food-price-badge {
      font-size: .64rem;
      padding: 1px 4px;
    }
    .btn-eat {
      font-size: .68rem;
      min-height: 28px;
    }
  }

  /* Forms & Stack Rows */
  .row { grid-template-columns: 1fr; gap: .75rem; }
  .bar-row { grid-template-columns: 1fr 90px; }
  .bar-label { grid-column: 1 / -1; }
  .auth-card {
    margin-top: 2.5rem;
    padding: 1.25rem 1rem;
    border-radius: 20px;
    box-shadow: 0 10px 25px -4px rgba(26, 21, 48, 0.12);
  }
  .auth-logo { margin-top: -4.5rem; width: 110px; height: 110px; }
  
  /* Touch-friendly submit buttons */
  form button[type=submit] {
    width: 100%;
    min-height: 46px;
    justify-content: center;
  }
  input, select {
    font-size: 16px; /* Prevents auto-zoom in iOS Safari */
    min-height: 46px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-logo { animation: none; }
  .btn, .nav-card, .tap-card { transition: none; }
}

/* ---------- Quick Navigation Hub ---------- */
.hub-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1.25rem 0 .75rem;
}
.hub-header .section-title {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin: 0;
}
.hub-badge {
  font-size: .75rem;
  font-weight: 800;
  background: var(--coin-soft);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: .15rem .6rem;
  box-shadow: 2px 2px 0 var(--ink);
}
.dash-quick-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .9rem;
  margin: .75rem 0 1.5rem;
}
@media (max-width: 1080px) {
  .dash-quick-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.nav-card {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: 1rem 1.25rem;
  background: rgba(255, 252, 245, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(26, 21, 48, 0.12);
  border-left: 5px solid var(--card-accent, var(--ink));
  border-radius: 20px;
  box-shadow: 0 6px 18px -4px rgba(26, 21, 48, 0.04);
  text-decoration: none;
  color: var(--ink);
  transition: transform .14s cubic-bezier(.34, 1.56, .64, 1), box-shadow .14s, background .12s, border-color .12s;
  position: relative;
  min-height: 76px;
}
.nav-card:hover {
  transform: translateY(-3px) scale(1.015);
  box-shadow: 0 12px 26px -4px rgba(26, 21, 48, 0.08), 2px 2px 0 var(--ink);
  filter: brightness(1.03);
  border-color: var(--ink);
}
.nav-card:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 2px 6px rgba(26, 21, 48, 0.06);
}
.nav-card.is-idle {
  background: rgba(255, 252, 245, 0.70);
  border-left-width: 4px;
}
.nav-card.has-activity {
  background: rgba(255, 255, 255, 0.96);
  border-left-width: 6px;
  box-shadow: 0 8px 20px -4px rgba(26, 21, 48, 0.08), 1.5px 1.5px 0 var(--ink);
}
.card-food { background: rgba(255, 222, 214, 0.95); border-left-color: #ff5d4a; }
.card-food.is-idle { background: rgba(255, 245, 242, 0.75); border-left-color: #e58f84; }
.card-leisure { background: rgba(254, 235, 195, 0.95); border-left-color: #f59e0b; }
.card-leisure.is-idle { background: rgba(255, 250, 238, 0.75); border-left-color: #d1b17b; }
.card-salary { background: rgba(218, 242, 228, 0.95); border-left-color: #10b981; }
.card-ssf { background: rgba(220, 235, 252, 0.95); border-left-color: #3b82f6; }
.card-coaching { background: rgba(240, 226, 252, 0.95); border-left-color: #8e44ad; }
.card-coaching.is-idle { background: rgba(250, 245, 254, 0.75); border-left-color: #bfa4ce; }
.card-absences { background: rgba(254, 224, 224, 0.95); border-left-color: #e74c3c; }
.card-absences.is-idle { background: rgba(244, 250, 246, 0.85); border-left-color: #2fc592; }
.card-settings { background: rgba(235, 233, 240, 0.85); border-left-color: #5c6b73; }
.card-password { background: rgba(254, 245, 206, 0.85); border-left-color: #d4ac0d; }

.nav-card-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--coin-soft);
  border: 1.5px solid rgba(26, 21, 48, 0.14);
  color: var(--ink);
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: 1.5px 1.5px 0 var(--ink);
}
.nav-card-img {
  object-fit: contain;
}
.nav-card-info {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  min-width: 0;
  flex: 1;
}
.nav-card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .35rem;
}
.nav-card-title {
  font-family: var(--body);
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-card-badge {
  font-family: var(--body);
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .02em;
  padding: .1rem .45rem;
  border-radius: 999px;
  flex: none;
}
.nav-card-badge.tag-good { background: #e7f8f0; color: #0d8253; border: 1.5px solid #a8e5cc; }
.nav-card-badge.tag-bad { background: #fdeeee; color: #d93829; border: 1.5px solid #f7baba; }
.nav-card-badge.tag-neutral { background: rgba(26, 21, 48, 0.06); color: #5d587a; border: 1.5px solid rgba(26, 21, 48, 0.14); }

.nav-card-bottom-row {
  display: flex;
  align-items: baseline;
  gap: .45rem;
  flex-wrap: wrap;
}
.nav-card-val {
  font-family: var(--body);
  font-size: 1.15rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
}
.nav-card-val.val-good { color: #0d8253; }
.nav-card-val.val-bad { color: #d93829; }
.nav-card-val.val-neutral { color: var(--muted); font-weight: 700; }

.nav-card-sub {
  font-family: var(--body);
  font-size: .78rem;
  font-weight: 600;
  color: #655f7d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-card-arrow {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--muted);
  opacity: .5;
  transition: transform .1s, opacity .1s;
  flex: none;
}
.nav-card:hover .nav-card-arrow {
  opacity: 1;
  transform: translateX(3px);
  color: var(--ink);
}

/* ---------- Tap-to-Eat Canteen Menu ---------- */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.food-menu-section {
  background: var(--paper);
}
.tap-food-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1.25rem;
}
.tap-card {
  background: #ffffff;
  border: 2px solid var(--ink);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .12s, box-shadow .12s;
}
.tap-card:hover {
  transform: translateY(-2px);
  box-shadow: 4px 5px 0 var(--ink);
  background: #fff9ea;
}
.tap-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 400 / 250;
  overflow: hidden;
  background: var(--coin-soft);
  border-bottom: 2px solid var(--ink);
}
.tap-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.eaten-pill {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(26,21,48,.85);
  color: #fff;
  font-size: .78rem;
  font-weight: 800;
  padding: .2rem .55rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.4);
  backdrop-filter: blur(2px);
}
.eaten-pill.has-eaten {
  background: var(--mint);
  color: var(--ink);
  border: 1.5px solid rgba(26, 21, 48, 0.2);
}
.tap-content {
  padding: .85rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.tap-title {
  margin: 0 0 .2rem;
  font-size: 1.05rem;
  font-weight: 800;
}
.tap-price {
  margin: 0 0 .75rem;
  font-weight: 800;
  color: var(--ink);
}
.btn-eat-action {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .45rem .6rem;
  font: 800 .85rem var(--body);
  background: var(--coral);
  color: #fff;
  text-shadow: 1px 1px 0 rgba(26, 21, 48, 0.25);
  border: 1.5px solid rgba(26, 21, 48, 0.2);
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(255, 93, 74, 0.3), 1px 1px 0 var(--ink);
  cursor: pointer;
  transition: transform .06s, background .1s, box-shadow .06s;
}
.btn-eat-action:hover {
  background: #ff7261;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(255, 93, 74, 0.4), 1.5px 1.5px 0 var(--ink);
}
.btn-eat-action:active,
.btn-eat-action.btn-eating {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(26, 21, 48, 0.1);
  background: #e04b38;
}

/* Card Tap Animation */
@keyframes tapPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}
.tap-bump {
  animation: tapPop .25s ease-out;
}

/* Toast popup */
.tap-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: .8rem 1.6rem;
  border-radius: 999px;
  border: 2px solid var(--coin);
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  font-weight: 800;
  font-size: 1rem;
  z-index: 9999;
  pointer-events: none;
}
@keyframes toastFade {
  0% { opacity: 0; transform: translate(-50%, 15px); }
  15% { opacity: 1; transform: translate(-50%, 0); }
  85% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -10px); }
}
.toast-fade {
  animation: toastFade 2.4s forwards;
}

/* Off-Menu Expander Panel */
.off-menu-panel {
  background: var(--coin-soft);
  border: 2px dashed var(--ink);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.off-menu-panel h3 {
  margin-top: 0;
}

/* ---------- SSF & Leisure Tabs & Branding ---------- */
.tab-bar {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.tab-item {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1.1rem;
  background: var(--paper);
  border: 1.5px solid rgba(26, 21, 48, 0.14);
  border-radius: 12px;
  text-decoration: none;
  font-weight: 800;
  color: var(--ink);
  box-shadow: 0 2px 6px rgba(26, 21, 48, 0.05);
  transition: transform .08s, box-shadow .08s;
}
.tab-item:hover {
  background: var(--coin-soft);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(26, 21, 48, 0.08);
}
.tab-item.active {
  background: var(--ink);
  color: var(--coin);
}
.tab-item.tab-link {
  margin-left: auto;
  background: transparent;
  box-shadow: none;
  border-color: transparent;
}
.tab-item.tab-link:hover {
  background: var(--paper);
  border-color: rgba(26, 21, 48, 0.18);
  box-shadow: 0 2px 6px rgba(26, 21, 48, 0.06);
}
.inline-logo {
  border-radius: 4px;
  vertical-align: middle;
}
.ssf-head-logo {
  border-radius: 14px;
  border: 1.5px solid rgba(26, 21, 48, 0.16);
  background: #faf5e6;
  padding: 3px;
  box-shadow: 0 4px 10px rgba(26, 21, 48, 0.06);
}
.head-icon-circle {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  border: 1.5px solid rgba(26, 21, 48, 0.16);
  background: var(--coin-soft);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 10px rgba(26, 21, 48, 0.06);
}
.ssf-banner-card {
  background: linear-gradient(135deg, #fbf7ec 0%, #edf3fe 100%);
  border-left: 8px solid #2b59c3;
}
.ssf-card-grid {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
@media (max-width: 680px) {
  .ssf-card-grid { flex-direction: column; align-items: center; text-align: center; }
  .ssf-card-grid form { width: 100%; justify-content: center; }
}
.ssf-display-logo {
  width: 90px;
  height: 90px;
  object-fit: contain;
  background: #faf5e6;
  border: 1.5px solid rgba(26, 21, 48, 0.16);
  border-radius: 18px;
  padding: 8px;
  box-shadow: 0 6px 18px rgba(26, 21, 48, 0.06);
}
.notice-box {
  background: #eef5ff;
  border: 2px dashed #2b59c3;
  border-radius: 10px;
  padding: 1rem;
}
.notice-box p { margin: 0; }
.thumb-mini {
  border-radius: 6px;
  border: 1px solid var(--ink);
  object-fit: cover;
}
.gap-2 { gap: .5rem; }
.gap-3 { gap: 1rem; }
.items-center { align-items: center; }
.ml-auto { margin-left: auto; }
.w-full { width: 100%; }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: 1rem; }
.text-good { color: #169b6b; }
.text-bad { color: var(--coral); }
.font-bold { font-weight: 800; }
.net-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .75rem 1rem;
  background: var(--coin-soft);
  border: 2px solid var(--ink);
  border-radius: 10px;
  font-weight: 800;
  font-size: 1.15rem;
}

/* ---------- Mobile Bottom Navigation Bar ---------- */
.mobile-bottom-bar {
  display: none;
}
@media (max-width: 640px) {
  .mobile-bottom-bar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, #ffde6b 0%, #ffd043 100%);
    border-top: 2px solid var(--ink);
    box-shadow: 0 -4px 16px rgba(26, 21, 48, 0.1);
    z-index: 990;
    padding: .3rem .15rem;
    padding-bottom: max(.35rem, env(safe-area-inset-bottom));
  }
  .mob-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .15rem;
    padding: .3rem .1rem;
    text-decoration: none;
    color: var(--ink);
    font-size: .72rem;
    font-weight: 800;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    transition: color .12s, background .12s, transform .1s;
    user-select: none;
    min-height: 48px;
  }
  .mob-tab:hover {
    background: rgba(255, 255, 255, 0.45);
  }
  .mob-tab:active {
    transform: scale(0.92);
  }
  .mob-tab.active {
    color: var(--coin);
    background: var(--ink);
    border-radius: 12px;
    box-shadow: 1.5px 1.5px 0 rgba(26, 21, 48, 0.25);
    animation: mobTabBounce 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  .mob-tab.active svg {
    stroke: var(--coin);
    animation: mobIconPulse 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  .mob-tab.active svg, .mob-tab.active img {
    transform: scale(1.12);
  }
  @keyframes mobTabBounce {
    0% { transform: scale(0.9); }
    50% { transform: scale(1.06); }
    100% { transform: scale(1); }
  }
  @keyframes mobIconPulse {
    0% { transform: scale(0.85); }
    50% { transform: scale(1.22); }
    100% { transform: scale(1.12); }
  }
  .mob-tab svg {
    display: block;
  }
  .mob-tab-ssf-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid var(--ink);
    background: #faf5e6;
    padding: 1px;
  }
  .mob-tab-menu {
    color: var(--coral);
  }
  .mob-tab-menu svg {
    color: var(--coral);
  }
}

/* ---------- Mobile Sections Drawer / Sheet ---------- */
.nav-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 21, 48, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
  will-change: opacity;
}
.nav-drawer-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.nav-drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 85vh;
  background: var(--paper);
  border-top: 4px solid var(--ink);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -10px 32px rgba(26,21,48,.35);
  z-index: 1001;
  padding: 1.15rem 1rem max(1.25rem, env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateY(105%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.32s;
  will-change: transform;
}
.nav-drawer.open {
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
}
.nav-drawer-handle {
  width: 44px;
  height: 5px;
  background: rgba(26, 21, 48, 0.25);
  border-radius: 999px;
  margin: -0.35rem auto 0.85rem;
}
.nav-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: .6rem;
  border-bottom: 2px dashed rgba(26,21,48,.2);
}
.nav-drawer-title {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--display);
  font-size: 1.4rem;
  letter-spacing: .03em;
  color: var(--ink);
}
.nav-drawer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .65rem;
  margin-bottom: 1rem;
}
.drawer-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: .75rem .45rem;
  background: #faf5e6;
  border: 1.5px solid rgba(26, 21, 48, 0.14);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(26, 21, 48, 0.05);
  text-decoration: none;
  color: var(--ink);
  gap: .35rem;
  transition: transform .14s cubic-bezier(.34, 1.56, .64, 1), background .12s, box-shadow .12s, border-color .12s;
  position: relative;
}
.drawer-card:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: var(--ink);
  box-shadow: 0 6px 16px rgba(26, 21, 48, 0.1), 2px 2px 0 var(--ink);
}
.drawer-card:active {
  transform: translateY(1px) scale(0.96);
  box-shadow: 0 1px 3px rgba(26, 21, 48, 0.1);
}
.drawer-card.active {
  background: var(--coin);
  border-color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  font-weight: 800;
}
/* Staggered cascade entrance for drawer cards when opened */
.nav-drawer.open .drawer-card {
  animation: drawerCardIn 0.26s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.nav-drawer.open .drawer-card:nth-child(1) { animation-delay: 0.03s; }
.nav-drawer.open .drawer-card:nth-child(2) { animation-delay: 0.06s; }
.nav-drawer.open .drawer-card:nth-child(3) { animation-delay: 0.09s; }
.nav-drawer.open .drawer-card:nth-child(4) { animation-delay: 0.12s; }
.nav-drawer.open .drawer-card:nth-child(5) { animation-delay: 0.15s; }
.nav-drawer.open .drawer-card:nth-child(6) { animation-delay: 0.18s; }
.nav-drawer.open .drawer-card:nth-child(7) { animation-delay: 0.21s; }
.nav-drawer.open .drawer-card:nth-child(8) { animation-delay: 0.24s; }
.nav-drawer.open .drawer-card:nth-child(9) { animation-delay: 0.27s; }

@keyframes drawerCardIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.drawer-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1.5px solid rgba(26, 21, 48, 0.14);
  display: grid;
  place-items: center;
  box-shadow: none;
}
.drawer-label {
  font-size: .82rem;
  font-weight: 800;
  line-height: 1.15;
}
.drawer-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 2px dashed rgba(26,21,48,.2);
}
body.drawer-open {
  overflow: hidden;
}

/* ==========================================================================
   HOMEPAGE / LANDING PAGE (.is-landing)
   ========================================================================== */

.is-landing {
  background-color: #faf5e8;
  background-image: 
    radial-gradient(circle at 50% 80px, #ffdf78 0%, rgba(255, 223, 120, 0.35) 45%, transparent 75%),
    radial-gradient(rgba(26, 21, 48, 0.045) 1.5px, transparent 1.5px);
  background-size: 100% 750px, 18px 18px;
  background-repeat: no-repeat, repeat;
  overflow-x: hidden;
  width: 100%;
}

.is-landing .wrap,
.is-landing main.wrap {
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  display: block !important;
  min-height: auto !important;
  box-sizing: border-box;
  animation: none !important;
  transform: none !important;
  view-transition-name: none !important;
}

/* Entrance Animation (Comical Pop-Up App Logo) */
.app-splash-overlay {
  position: fixed;
  inset: 0;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  width: 100dvw;
  height: 100dvh;
  z-index: 999999;
  background: #ffc62e;
  background-image: 
    radial-gradient(circle at 50% 45%, #fff6d1 0%, #ffdf78 40%, #ffc62e 80%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1), transform 0.45s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.45s;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  will-change: opacity, transform;
}

.app-splash-overlay.splash-hidden {
  opacity: 0;
  transform: scale(1.08);
  pointer-events: none;
  visibility: hidden;
}

.splash-burst-rays {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 250vmax;
  height: 250vmax;
  background-image: repeating-conic-gradient(from 0deg at 50% 50%, rgba(255, 255, 255, 0.35) 0deg 15deg, transparent 15deg 30deg);
  transform: translate(-50%, -50%);
  animation: rotateSplashBurst 30s linear infinite;
  pointer-events: none;
}

@keyframes rotateSplashBurst {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.splash-content {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
  max-width: 360px;
}

.splash-coin-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 0.85rem;
}

.splash-logo-circle {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--ink);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 25px rgba(26, 21, 48, 0.18), 3.5px 3.5px 0 var(--ink);
  animation: fbLogoPopUp 0.85s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.splash-coin-img {
  width: 82px;
  height: 82px;
  display: block;
}

.splash-speech-bubble {
  background: #faf5e6;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 0.35rem 0.95rem;
  font-family: var(--body);
  font-weight: 800;
  font-size: 0.88rem;
  box-shadow: 0 4px 10px rgba(26, 21, 48, 0.12), 2px 2px 0 var(--ink);
  margin-bottom: 0.75rem;
  animation: fbBubblePopIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.25s both;
  position: relative;
}

.splash-speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--ink);
}

.splash-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.splash-sp {
  position: absolute;
  font-size: 1.4rem;
  animation: comicFloat 2.8s ease-in-out infinite;
}
.splash-sp.s1 { top: -10px; left: -20px; animation-delay: 0.1s; }
.splash-sp.s2 { top: 35%; right: -25px; animation-delay: 0.4s; }
.splash-sp.s3 { bottom: -10px; left: 10px; animation-delay: 0.8s; }

.splash-brand-group {
  animation: fbFadeUp 0.6s ease-out 0.35s both;
}

.splash-title {
  font-family: var(--display, 'Bangers', cursive);
  font-size: 2.2rem;
  color: var(--ink);
  letter-spacing: 1.5px;
  margin: 0;
  text-shadow: 0 2px 0 #ffffff;
}
.splash-title b {
  color: var(--coral);
}

.splash-tagline {
  font-family: var(--body);
  font-size: 0.85rem;
  font-weight: 800;
  color: #3b3552;
  margin: 0.2rem 0 0.55rem;
}

.splash-badge {
  display: inline-block;
  background: var(--coral);
  color: #ffffff;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 900;
  box-shadow: 1.5px 1.5px 0 var(--ink);
}

/* Pop-up Logo & Speech Bubble Animations */

@keyframes fbLogoPopUp {
  0% {
    opacity: 0;
    transform: scale(0.12) rotate(-10deg);
  }
  55% {
    opacity: 1;
    transform: scale(1.22) rotate(3deg);
  }
  75% {
    transform: scale(0.94) rotate(-1.5deg);
  }
  90% {
    transform: scale(1.04) rotate(0.5deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes fbBubblePopIn {
  0% {
    opacity: 0;
    transform: scale(0.2) translateY(14px);
  }
  65% {
    opacity: 1;
    transform: scale(1.15) translateY(-3px);
  }
  85% {
    transform: scale(0.96) translateY(1px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes fbFadeUp {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Landing Header / Sticky Topbar */
.landing-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(243, 234, 214, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1.5px solid rgba(26, 21, 48, 0.12);
  box-shadow: 0 4px 14px rgba(26, 21, 48, 0.04);
}

.landing-header-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.landing-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
}
.landing-brand:hover {
  background: transparent;
}
.landing-brand img {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.landing-nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.landing-nav-links a {
  text-decoration: none;
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--ink);
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  transition: background 0.1s, transform 0.08s;
}
.landing-nav-links a:hover {
  background: var(--coin);
}

.landing-header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* Hero Section (Facebook Style Pitch + Auth Card) */
.landing-hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  grid-template-areas:
    "pitch auth"
    "trust auth";
  gap: 1.5rem 3rem;
  align-items: center;
  max-width: 1060px;
  margin: 0 auto;
  padding: 3.5rem 1.25rem 3rem;
  box-sizing: border-box;
}

.comical-logo-hero {
  grid-area: comichero;
  width: 100%;
  max-width: 440px;
  margin: 0 auto 0.75rem;
  display: none; /* Shown first on phone */
}

.comical-bg-panel {
  position: relative;
  overflow: visible;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0.85rem 0.5rem 0.35rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* Continuously rotating comic action burst halo without blocky borders */
.comical-burst-rays {
  position: absolute;
  top: -45px;
  left: 50%;
  width: 320px;
  height: 320px;
  transform: translateX(-50%);
  background-image: repeating-conic-gradient(from 0deg at 50% 50%, rgba(255, 214, 70, 0.45) 0deg 15deg, transparent 15deg 30deg);
  animation: rotateComicBurst 35s linear infinite;
  border-radius: 50%;
  mask-image: radial-gradient(circle at 50% 50%, black 28%, transparent 70%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, black 28%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

@keyframes rotateComicBurst {
  from { transform: translateX(-50%) rotate(0deg); }
  to { transform: translateX(-50%) rotate(360deg); }
}

/* Comic Sticker Badge in top corner */
.comic-sticker-badge {
  position: absolute;
  top: 4px;
  right: 18px;
  z-index: 4;
  background: var(--coral);
  color: #ffffff;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-family: var(--body);
  font-size: 0.72rem;
  font-weight: 900;
  box-shadow: 2px 2px 0 var(--ink);
  transform: rotate(6deg);
  letter-spacing: 0.02em;
  animation: comicStickerWiggle 3.5s ease-in-out infinite;
}

@keyframes comicStickerWiggle {
  0%, 100% { transform: rotate(6deg); }
  50% { transform: rotate(-4deg) scale(1.06); }
}

/* Floating Comic Sparkles */
.comic-sparkle {
  position: absolute;
  font-size: 1.2rem;
  z-index: 3;
  pointer-events: none;
  user-select: none;
}
.comic-sparkle.s1 {
  top: 20%;
  left: 12%;
  animation: comicFloat 3.2s ease-in-out infinite;
}
.comic-sparkle.s2 {
  bottom: 22%;
  right: 14%;
  animation: comicFloat 3.8s ease-in-out infinite 0.7s;
}
.comic-sparkle.s3 {
  top: 24%;
  right: 18%;
  animation: comicFloat 4.2s ease-in-out infinite 1.4s;
}

@keyframes comicFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-7px) rotate(14deg); }
}

.comical-logo-stage {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Comic Speech Bubble with Pointer - Facebook-style Pop-in */
.comical-speech-bubble {
  position: relative;
  display: inline-block;
  background: #faf5e6;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-family: var(--body);
  font-weight: 800;
  font-size: 0.82rem;
  box-shadow: 0 4px 10px rgba(26, 21, 48, 0.1), 2px 2px 0 var(--ink);
  margin-bottom: 0.55rem;
  letter-spacing: -0.01em;
  animation: fbBubblePopIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both, comicBubbleBounce 2.6s ease-in-out infinite 0.95s;
  z-index: 3;
}

.comical-speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid var(--ink);
}

.comical-speech-bubble::before {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 4.5px solid transparent;
  border-right: 4.5px solid transparent;
  border-top: 5px solid #ffffff;
  z-index: 1;
}

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

/* Worried Coin with Facebook-Style Spring Pop-Up Animation */
.comical-coin-wrapper {
  position: relative;
  display: inline-block;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease;
}

.comical-coin-wrapper:hover {
  transform: scale(1.06);
}

.comical-coin-wrapper.coin-pop-boost {
  animation: fbLogoPopUp 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.comical-coin-anim {
  width: 86px;
  height: 86px;
  display: block;
  filter: drop-shadow(0 6px 14px rgba(255, 175, 40, 0.45)) drop-shadow(0 2px 0 var(--ink));
  animation: fbLogoPopUp 0.85s cubic-bezier(0.34, 1.56, 0.64, 1) both, comicCoinWobbleLoop 3.2s ease-in-out infinite 0.9s;
  transform-origin: 50% 85%;
}

@keyframes comicCoinWobbleLoop {
  0%, 100% {
    transform: translateY(0) rotate(-3deg);
  }
  25% {
    transform: translateY(-6px) rotate(4deg) scale(1.04);
  }
  50% {
    transform: translateY(0) rotate(-4deg);
  }
  75% {
    transform: translateY(-3px) rotate(3deg) scale(0.98);
  }
}

.comical-hero-text {
  position: relative;
  z-index: 3;
  margin-top: 0.45rem;
}

.comical-brand {
  font-family: var(--display, 'Bangers', cursive);
  font-size: 1.85rem;
  letter-spacing: 1px;
  color: var(--ink);
  line-height: 1.1;
  text-shadow: 0 2px 0 #ffffff;
}

.comical-brand b {
  color: var(--coral);
  display: inline-block;
  transform: rotate(-3deg);
  text-shadow: 1px 1px 0 var(--ink);
}

.comical-subtitle {
  font-size: 0.78rem;
  font-weight: 800;
  color: #3b3552;
  margin-top: 0.15rem;
  letter-spacing: 0.01em;
}

.landing-hero-pitch {
  grid-area: pitch;
  text-align: left;
}

.landing-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--coin);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 0.35rem 1.1rem;
  font-weight: 800;
  font-size: 0.84rem;
  box-shadow: 3px 3px 0 var(--ink);
  margin-bottom: 0.85rem;
}

.landing-hero-h1 {
  font-family: var(--font, 'Nunito', sans-serif);
  font-size: clamp(1.3rem, 2.8vw, 1.75rem);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0 0 0.75rem;
  color: #1a1530;
}

.landing-hero-desc {
  font-size: 0.94rem;
  font-weight: 600;
  color: #4a5568;
  line-height: 1.5;
  max-width: 520px;
  margin: 0 0 1.25rem;
}

.landing-trust-bar {
  grid-area: trust;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-weight: 800;
  font-size: 0.86rem;
  color: var(--ink);
}
.landing-trust-bar span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* Auth Card (Comfortable & Clean) */
.landing-auth-card-wrap {
  grid-area: auth;
  width: 100%;
  display: flex;
  justify-content: center;
}

.landing-auth-card {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid rgba(26, 21, 48, 0.16);
  border-top: 5px solid var(--coral);
  border-radius: 24px;
  box-shadow: 0 14px 34px -6px rgba(255, 175, 40, 0.28), 0 4px 14px rgba(26, 21, 48, 0.05);
  padding: 1.35rem 1.25rem;
  width: 100%;
  max-width: 395px;
  position: relative;
  text-align: left;
  box-sizing: border-box;
}

.auth-card-head {
  text-align: center;
  margin-bottom: 0.9rem;
}



.auth-card-title {
  font-family: var(--font, 'Nunito', sans-serif);
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 0 0.15rem;
  color: var(--ink);
}

.auth-card-sub {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
  margin: 0;
  line-height: 1.35;
}

/* Inline Alerts */
.home-alert {
  border-radius: 12px;
  padding: 0.55rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}
.alert-err {
  background: #fff5f5;
  border: 1.5px solid #e53e3e;
  color: #c53030;
}
.alert-ok {
  background: #f0fdf4;
  border: 1.5px solid #22c55e;
  color: #15803d;
}

.landing-auth-card .field input {
  font-size: 15px !important;
  min-height: 42px;
  padding: 0.55rem 0.8rem;
  border-radius: 12px;
  background: #ffffff;
  border: 1.5px solid rgba(26, 21, 48, 0.18);
  box-shadow: inset 0 1px 2px rgba(26, 21, 48, 0.04);
  touch-action: manipulation;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.landing-auth-card .field input:focus {
  border-color: var(--coral) !important;
  box-shadow: 0 0 0 3.5px rgba(255, 93, 74, 0.22) !important;
  outline: none;
}

/* Button with Animated Loading Bar */
.btn-login-submit {
  position: relative;
  overflow: hidden;
  width: 100%;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 800;
  padding: 0.65rem;
  min-height: 42px;
  border-radius: 12px;
  margin-top: 0.35rem;
  touch-action: manipulation;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #ff5d4a 0%, #ee4330 100%);
  color: #ffffff;
  border: 2px solid rgba(26, 21, 48, 0.3);
  box-shadow: 0 6px 18px -2px rgba(255, 93, 74, 0.45), 0 2px 0 rgba(26, 21, 48, 0.18);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn-login-submit:hover:not(:disabled) {
  transform: translateY(-1.5px);
  box-shadow: 0 8px 22px -2px rgba(255, 93, 74, 0.5), 0 2px 0 rgba(26, 21, 48, 0.18);
}

.btn-login-submit:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 3px 8px -1px rgba(255, 93, 74, 0.4), 0 1px 0 rgba(26, 21, 48, 0.18);
}

.btn-loading-bar {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.loading-bar-fill {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.2),
    rgba(255, 255, 255, 0.2) 12px,
    rgba(255, 255, 255, 0.4) 12px,
    rgba(255, 255, 255, 0.4) 24px
  );
  background-size: 34px 34px;
  animation: stripeMove 0.8s linear infinite;
}

@keyframes stripeMove {
  0% { background-position: 0 0; }
  100% { background-position: 34px 0; }
}

.loading-label {
  position: relative;
  z-index: 2;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.95rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.btn-login-submit.is-success {
  background: #16a34a !important;
  color: #ffffff !important;
  border-color: #14532d !important;
}

.home-login-links {
  text-align: center;
  margin: 0.65rem 0 0;
}

.btn-link-action {
  background: transparent;
  border: none;
  color: var(--coral);
  font-weight: 800;
  font-size: 0.86rem;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  text-decoration: underline;
  border-radius: 6px;
  display: inline-block;
  transition: opacity 0.15s;
}
.btn-link-action:hover {
  opacity: 0.8;
}

.home-login-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 0.65rem 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.home-login-divider::before,
.home-login-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1.5px solid rgba(26, 21, 48, 0.18);
}
.home-login-divider span {
  padding: 0 0.6rem;
}

.btn-register-link {
  width: 100%;
  justify-content: center;
  font-size: 0.88rem;
  padding: 0.5rem;
  min-height: 38px;
  border-radius: 9px;
  touch-action: manipulation;
}

/* Logged-in profile preview card */
.logged-in-card {
  text-align: center;
}

.user-avatar-circle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--coin);
  border: 2px solid var(--ink);
  display: inline-grid;
  place-items: center;
  box-shadow: 2px 2px 0 var(--ink);
  margin-bottom: 0.5rem;
}

.logged-in-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.logged-in-row .btn {
  justify-content: center;
}

.btn-home-logout {
  background: transparent;
  border: none;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.btn-home-logout:hover {
  color: var(--coral);
  background: rgba(26,21,48,0.06);
}

/* App Preview Snapshot Card */
.landing-preview-wrap {
  margin: 1rem auto 4.5rem;
  max-width: 900px;
}

.landing-preview-card {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid rgba(26, 21, 48, 0.16);
  border-radius: 26px;
  box-shadow: 0 16px 36px -6px rgba(26, 21, 48, 0.08), 0 4px 12px rgba(26, 21, 48, 0.03);
  overflow: hidden;
}

.preview-card-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.25rem;
  background: #faf3e2;
  border-bottom: 1.5px solid rgba(26, 21, 48, 0.14);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.preview-title-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
}

.preview-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  border: 1.5px solid var(--ink);
  display: inline-block;
}

.preview-tag {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  background: rgba(26,21,48,0.06);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
}

.preview-badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #d2f7e8;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 800;
  color: #1b5e20;
}

.preview-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 1.5rem;
}

.preview-stat-card {
  background: #ffffff;
  border: 1.5px solid rgba(26, 21, 48, 0.14);
  border-radius: 16px;
  padding: 1.15rem;
  box-shadow: 0 4px 14px rgba(26, 21, 48, 0.05);
}

.preview-stat-card.highlight-card {
  background: #fffdf0;
  border-color: rgba(245, 158, 11, 0.3);
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}

.stat-value {
  font-family: var(--display);
  font-size: 1.85rem;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 0.35rem;
}
.stat-value.stat-cut {
  color: var(--coral);
}
.stat-value.stat-net {
  color: #15803d;
}

.stat-sub {
  font-size: 0.82rem;
  font-weight: 700;
}
.stat-sub.text-blue {
  color: #2b6cb0;
}

.preview-workflow-strip {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  background: #fdfaf2;
  border-top: 2px dashed rgba(26,21,48,0.2);
  flex-wrap: wrap;
}

.workflow-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--ink);
}

.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 900;
}

/* Feature 4-Card Grid */
.landing-features-section {
  margin: 4rem 0;
}

.landing-section-head {
  text-align: center;
  margin-bottom: 2.25rem;
}

.landing-section-tag {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--coral);
  margin-bottom: 0.35rem;
}

.landing-section-title {
  font-family: var(--font, 'Nunito', sans-serif);
  font-size: clamp(1.35rem, 3.5vw, 1.85rem);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
  color: var(--ink);
}

.landing-section-sub {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
  max-width: 580px;
  margin: 0 auto;
}

.landing-features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.feature-card {
  border-radius: 22px;
  border: 1.5px solid rgba(26, 21, 48, 0.14);
  box-shadow: 0 6px 20px -4px rgba(26, 21, 48, 0.05);
  padding: 1.6rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px -4px rgba(26, 21, 48, 0.1);
}

.feature-card.feature-canteen {
  background: rgba(255, 222, 214, 0.95);
  border-left: 4.5px solid #ff5d4a;
}
.feature-card.feature-leisure {
  background: rgba(254, 235, 195, 0.95);
  border-left: 4.5px solid #f59e0b;
}
.feature-card.feature-cycles {
  background: rgba(220, 235, 252, 0.95);
  border-left: 4.5px solid #3b82f6;
}
.feature-card.feature-print {
  background: rgba(218, 242, 228, 0.95);
  border-left: 4.5px solid #10b981;
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 2px solid var(--ink);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 10px rgba(26, 21, 48, 0.08), 2px 2px 0 var(--ink);
  margin-bottom: 0.85rem;
}

.feature-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.45rem;
}

.feature-card p {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
  margin: 0;
}

/* FAQ Section */
.landing-faq-section {
  margin: 4.5rem 0;
}

.landing-faq-wrap {
  max-width: 800px;
  margin: 0 auto;
  display: grid;
  gap: 0.85rem;
}

.faq-item {
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px solid rgba(26, 21, 48, 0.12);
  border-radius: 18px;
  box-shadow: 0 4px 14px rgba(26, 21, 48, 0.04);
  overflow: hidden;
}

.faq-summary {
  font-weight: 800;
  font-size: 1.05rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
.faq-summary::-webkit-details-marker {
  display: none;
}
.faq-summary::after {
  content: "+";
  font-family: var(--display);
  font-size: 1.5rem;
  color: var(--coral);
}
details[open] .faq-summary::after {
  content: "–";
}
details[open] .faq-summary {
  background: #fffdf0;
  border-bottom: 1.5px solid rgba(26, 21, 48, 0.12);
}

.faq-body {
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.55;
}

/* Big Bottom CTA Card */
.landing-cta-banner {
  background: linear-gradient(135deg, #ffd84d 0%, #ffc62e 100%);
  border: 2px solid rgba(26, 21, 48, 0.18);
  border-radius: 28px;
  box-shadow: 0 16px 36px -6px rgba(255, 198, 46, 0.45), 0 4px 12px rgba(26, 21, 48, 0.04);
  padding: 3rem 1.5rem;
  text-align: center;
  max-width: 900px;
  margin: 4.5rem auto 2.5rem;
}

.landing-cta-banner h2 {
  font-family: var(--font, 'Nunito', sans-serif);
  font-size: clamp(1.4rem, 3.8vw, 1.95rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 0.65rem;
}

.landing-cta-banner p {
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.5;
  max-width: 540px;
  margin: 0 auto 1.5rem;
  color: var(--ink);
}

.landing-cta-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Landing Footer */
.landing-footer {
  border-top: 1.5px solid rgba(26, 21, 48, 0.12);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  padding: 1.5rem 1.25rem;
  margin-top: 2.5rem;
}

.landing-footer-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.landing-footer-copy {
  font-size: 0.84rem;
  color: var(--muted);
  font-weight: 700;
}

/* Mobile Sticky Bottom CTA for Landing */
.landing-mobile-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99;
  background: var(--paper);
  border-top: var(--line);
  padding: 0.65rem 1rem;
  box-shadow: 0 -4px 0 rgba(26,21,48,0.1);
}

@media (max-width: 860px) {
  .landing-hero-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "comichero"
      "auth"
      "pitch"
      "trust";
    gap: 0.75rem;
    padding: 0.65rem 0.65rem 1rem;
    text-align: center;
  }
  .comical-logo-hero {
    display: block;
    margin: 0 auto 0.25rem;
    max-width: 390px;
  }
  .landing-hero-pitch {
    text-align: center;
    margin-top: 0.25rem;
  }
  .landing-badge {
    font-size: 0.72rem;
    padding: 0.15rem 0.55rem;
    margin-bottom: 0.3rem;
    box-shadow: 1.5px 1.5px 0 var(--ink);
  }
  .landing-hero-h1 {
    font-family: var(--font, 'Nunito', sans-serif);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: -0.01em;
    margin: 0 0 0.25rem;
    text-align: center;
  }
  .landing-hero-desc {
    font-size: 0.8rem;
    line-height: 1.4;
    margin: 0 auto 0.5rem;
    text-align: center;
    max-width: 420px;
    color: var(--muted);
  }
  .landing-trust-bar {
    justify-content: center;
    gap: 0.35rem 0.75rem;
    font-size: 0.74rem;
    margin-top: 0.1rem;
  }
  .landing-auth-card {
    padding: 1.1rem 0.95rem;
    border-radius: 20px;
    border: 1.5px solid rgba(26, 21, 48, 0.14);
    border-top: 4.5px solid var(--coral);
    box-shadow: 0 10px 26px -4px rgba(255, 175, 40, 0.24), 0 2px 8px rgba(26, 21, 48, 0.04);
  }
  .auth-card-title {
    font-family: var(--font, 'Nunito', sans-serif);
    font-size: 1.18rem;
    font-weight: 800;
    margin-bottom: 0.15rem;
  }
  .auth-card-sub {
    font-size: 0.78rem;
  }
  .auth-card-head {
    margin-bottom: 0.65rem;
  }
  .landing-preview-wrap {
    margin: 1rem auto 1.25rem;
    padding: 0 0.5rem;
  }
  .landing-preview-card {
    border-radius: 20px;
    border: 1.5px solid rgba(26, 21, 48, 0.14);
    box-shadow: 0 8px 24px -4px rgba(26, 21, 48, 0.06);
  }
  .preview-card-topbar {
    padding: 0.55rem 0.8rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  .preview-title-box {
    font-size: 0.82rem;
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  .preview-stats-grid {
    grid-template-columns: 1fr;
    gap: 0.45rem;
    padding: 0.65rem;
  }
  .preview-stat-card {
    padding: 0.65rem 0.85rem;
    border-radius: 14px;
    border: 1.5px solid rgba(26, 21, 48, 0.1);
    box-shadow: 0 2px 8px rgba(26, 21, 48, 0.03);
  }
  .preview-stat-card:nth-child(1) {
    background: #fbf0ee;
    border-left: 4px solid #ff5d4a;
  }
  .preview-stat-card:nth-child(2) {
    background: #faf4e4;
    border-left: 4px solid #f59e0b;
  }
  .preview-stat-card:nth-child(3) {
    background: #eef8f2;
    border-left: 4px solid #16a34a;
  }
  .stat-label {
    font-size: 0.72rem;
    margin-bottom: 0.1rem;
  }
  .stat-value {
    font-size: 1.3rem;
    margin-bottom: 0.1rem;
  }
  .stat-sub {
    font-size: 0.75rem;
  }
  .preview-workflow-strip {
    padding: 0.55rem 0.8rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
  .workflow-step {
    font-size: 0.78rem;
  }
  .landing-features-section {
    margin: 1.5rem auto 1.75rem;
    padding: 0 0.5rem;
  }
  .landing-features-grid {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }
  .feature-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 0.95rem;
    border-radius: 18px;
    border: 1.5px solid rgba(26, 21, 48, 0.1);
    box-shadow: 0 4px 14px rgba(26, 21, 48, 0.04);
  }
  .feature-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    margin-bottom: 0;
    flex-shrink: 0;
  }
  .feature-card-content h3 {
    font-size: 0.92rem;
    margin: 0 0 0.2rem;
  }
  .feature-card-content p {
    font-size: 0.8rem;
    line-height: 1.35;
  }
  .landing-faq-section {
    margin: 1.25rem auto;
    padding: 0 0.5rem;
  }
  .landing-faq-wrap {
    gap: 0.5rem;
  }
  .faq-item {
    border-radius: 14px;
    border: 1.5px solid rgba(26, 21, 48, 0.1);
    box-shadow: 0 2px 8px rgba(26, 21, 48, 0.03);
  }
  .faq-summary {
    padding: 0.65rem 0.75rem;
    font-size: 0.85rem;
  }
  .faq-body {
    padding: 0.55rem 0.75rem 0.65rem;
    font-size: 0.8rem;
  }
  .landing-cta-banner {
    margin: 1.5rem 0.5rem 1rem;
    padding: 1.5rem 1rem;
    border-radius: 22px;
    border: 2px solid rgba(26, 21, 48, 0.18);
    box-shadow: 0 10px 24px -4px rgba(255, 198, 46, 0.35);
  }
  .landing-cta-banner h2 {
    font-family: var(--font, 'Nunito', sans-serif);
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.01em;
    margin-bottom: 0.3rem;
  }
  .landing-cta-banner p {
    font-size: 0.82rem;
    line-height: 1.4;
    margin: 0 auto 0.85rem;
  }
  .landing-cta-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
  .landing-cta-actions .btn {
    width: 100%;
    justify-content: center;
    min-height: 38px;
    font-size: 0.9rem;
  }
}

@media (max-width: 768px) {
  .landing-nav-links {
    display: none;
  }
  .landing-header-inner {
    padding: 0.45rem 0.75rem;
  }
  .landing-brand img {
    width: 28px;
    height: 28px;
  }
  .landing-brand .wordmark {
    font-size: 1.15rem;
  }
  .landing-header-actions .btn {
    padding: 0.3rem 0.55rem;
    font-size: 0.8rem;
    min-height: 30px;
  }
  .landing-footer {
    padding: 1.25rem 0.75rem;
  }
  .landing-footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  .landing-mobile-bar {
    display: none !important;
  }
  .is-landing .wrap {
    padding-bottom: 1.25rem !important;
  }
}

@media print {
  body { background: #fff; }
  .topbar, .foot, .no-print, .page-head .head-actions, .monthnav, .dash-quick-nav, .food-menu-section, .tab-bar, .mobile-bottom-bar, .nav-drawer, .nav-drawer-backdrop { display: none !important; }
  .card { box-shadow: none; }
  .wrap { padding: 0; }
}


/* ==========================================================================
   FEATURE: INSTANT TABLE LEDGER SEARCH & FILTER BAR
   ========================================================================== */
.table-search-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding: 0.45rem 0.65rem;
  background: rgba(26, 21, 48, 0.04);
  border: 1.5px solid rgba(26, 21, 48, 0.12);
  border-radius: 14px;
}
.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
}
.search-input-wrap .search-icon {
  position: absolute;
  left: 0.7rem;
  color: var(--muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}
.table-search-input {
  width: 100%;
  padding: 0.45rem 2rem 0.45rem 2.2rem !important;
  font-size: 0.88rem !important;
  border-radius: 10px !important;
  background: var(--paper) !important;
  border: 1.5px solid rgba(26, 21, 48, 0.14) !important;
  color: var(--ink) !important;
}
.table-search-input:focus {
  border-color: var(--coin) !important;
  box-shadow: 0 0 0 2px rgba(255, 198, 46, 0.25) !important;
}
.search-clear-btn {
  position: absolute;
  right: 0.5rem;
  background: none;
  border: none;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 50%;
}
.search-clear-btn:hover { color: var(--ink); }
.search-count-badge {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--coin);
  color: #1a1530;
  white-space: nowrap;
  flex-shrink: 0;
}
tr.row-filter-hidden { display: none !important; }
.search-no-match td {
  padding: 2rem !important;
  text-align: center;
  font-weight: 700;
  color: var(--muted);
}

/* ==========================================================================
   FEATURE: OFFLINE CLASSROOM PWA BANNER & PENDING SYNC
   ========================================================================== */
.offline-banner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1rem;
  background: #fff3cd;
  border: 1.5px solid #d97706;
  border-radius: 14px;
  margin-bottom: 1rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #78350f;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.15);
  animation: smoothSectionIn 0.25s ease both;
}
.offline-banner-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  color: #d97706;
}
.offline-banner-text { flex: 1; }
.offline-count-chip {
  background: #d97706;
  color: #fff;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-offline-pending {
  display: inline-block;
  background: #fef3c7;
  color: #b45309;
  border: 1px dashed #d97706;
  border-radius: 6px;
  padding: 0.1rem 0.4rem;
  font-size: 0.72rem;
  font-weight: 800;
  margin-left: 0.35rem;
  vertical-align: middle;
}


/* ==========================================================================
   APP-LIKE NATIVE TOUCH & FEEL (Disable web jitters, rubber-banding, tap flash)
   ========================================================================== */
html {
  overscroll-behavior-y: contain;
  -webkit-tap-highlight-color: transparent;
}
body {
  overscroll-behavior-y: contain;
  -webkit-touch-callout: none;
}

/* Eliminate accidental text highlight and touch delay on buttons & nav controls */
button, a, .btn, .nav-card, .mob-tab, .drawer-card, .icon-btn, .pill-btn, .quarter-pill, .tap-card, .who-chip, .monthnav-btn {
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

/* Allow text selection only on data tables, inputs, codes, and reading blocks */
input, textarea, select, .table-primary-text, .table-sub, td.num, .val, .words-val, .stmt-sheet {
  user-select: text;
  -webkit-user-select: text;
}

/* Safe-area insets for iPhone notch and Android gesture pill */
.topbar {
  padding-top: max(0.65rem, env(safe-area-inset-top));
}
.mobile-bottom-bar {
  padding-bottom: max(0.45rem, env(safe-area-inset-bottom));
}

/* Native App Top Navigation Progress Bar */
.app-nav-loader {
  position: fixed;
  top: 0;
  left: 0;
  height: 3.5px;
  width: 0;
  background: linear-gradient(90deg, #ff5d4a, #ffc62e, #2fc592);
  z-index: 9999999;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(255, 198, 46, 0.5);
  transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.15s ease;
}
.app-nav-loader.is-loading {
  opacity: 1;
  width: 75%;
}
.app-nav-loader.is-done {
  opacity: 1;
  width: 100%;
  transition: width 0.1s ease, opacity 0.2s ease 0.15s;
}


/* Slick App Native Page View Transition */
@keyframes appViewEnter {
  from {
    opacity: 0.88;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.app-page-view {
  animation: appViewEnter 0.16s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
