/* ================================================================
   MASAKIN OPS PORTAL — NLB Brand Design System v2
   Deep Royal Blue #0D1A45 · Ivory #FDFCF8 · Heritage Red #C62828
   Soft Beige #F5F1E6 · Charcoal #3A3A3A

   DAY mode  (06:00–19:00) → warm ivory, botanical elements, light & airy
   NIGHT mode (19:00–06:00) → deep navy gradient, botanical glow, lantern warmth

   Transitions: 1.8s ease on all color tokens when mode changes
   Mobile-first — kasir & SPV pakai HP.
   ================================================================ */

/* ── Root tokens ─────────────────────────────────────────────── */
:root {
  /* Brand core */
  --nlb-navy:    #0D1A45;
  --nlb-navy2:   #16265f;
  --nlb-ivory:   #FDFCF8;
  --nlb-beige:   #F5F1E6;
  --nlb-red:     #C62828;
  --nlb-char:    #3A3A3A;
  --nlb-grey:    #8a8577;
  /* compat aliases */
  --navy:        #0D1A45;
  --navy-2:      #16265f;
  --ivory:       #FDFCF8;
  --beige:       #F5F1E6;
  --red:         #C62828;
  --charcoal:    #3A3A3A;
  --grey:        #8a8577;
  --line:        #e7e3d8;
  --green:       #1c7a4d;
  --green-bg:    #e6f4ec;
  --amber:       #9a6a00;
  --amber-bg:    #fbf1d8;
  --grey-bg:     #f0eee7;
  --shadow:      0 6px 24px rgba(13,26,69,.10);
  --r:           16px;
  /* Design tokens */
  --surface:     #ffffff;
  --shadow-md:   0 6px 24px rgba(13,26,69,.10);
  --shadow-lg:   0 16px 44px rgba(13,26,69,.18);
  --r-lg:        22px;
  --ease:        cubic-bezier(.4,0,.2,1);
}

/* ── Global reset ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(175deg, var(--navy) 0%, #16265f 55%, #1b1b3f 100%);
  background-attachment: fixed;
  color: var(--charcoal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.55;
  min-height: 100vh;
  isolation: isolate;
  transition: background-color 2s var(--ease);
}

/* ── Botanical corner ornaments — SVG line-art, designed not raw photo ── */
/* Sprig illustration: navy stems+leaves, heritage-red bloom.
   Placed as deliberate corner accents, NOT tiled. */

/* Bottom-right — main sprig */
body::before {
  content: '';
  position: fixed;
  bottom: -10px; right: -10px;
  width: 200px; height: 265px;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 400' fill='none'><path d='M 150 390 C 148 320 138 240 105 100' stroke='%230D1A45' stroke-width='2.5' stroke-linecap='round' opacity='.75'/><path d='M 143 310 C 118 288 92 282 68 265' stroke='%230D1A45' stroke-width='1.8' stroke-linecap='round' opacity='.7'/><path d='M 138 240 C 110 220 88 215 65 200' stroke='%230D1A45' stroke-width='1.5' stroke-linecap='round' opacity='.65'/><path d='M 133 170 C 108 152 90 148 72 135' stroke='%230D1A45' stroke-width='1.3' stroke-linecap='round' opacity='.55'/><path d='M 147 340 C 172 315 198 308 222 292' stroke='%230D1A45' stroke-width='1.8' stroke-linecap='round' opacity='.7'/><path d='M 143 268 C 166 245 188 238 208 224' stroke='%230D1A45' stroke-width='1.5' stroke-linecap='round' opacity='.65'/><path d='M 138 195 C 158 175 176 168 194 155' stroke='%230D1A45' stroke-width='1.3' stroke-linecap='round' opacity='.55'/><ellipse cx='66' cy='268' rx='22' ry='10' transform='rotate(28 66 268)' stroke='%230D1A45' stroke-width='1.5' opacity='.68'/><path d='M 56 258 L 76 278' stroke='%230D1A45' stroke-width='.7' opacity='.35'/><ellipse cx='88' cy='252' rx='16' ry='8' transform='rotate(22 88 252)' stroke='%230D1A45' stroke-width='1.2' opacity='.55'/><ellipse cx='63' cy='203' rx='20' ry='9' transform='rotate(25 63 203)' stroke='%230D1A45' stroke-width='1.4' opacity='.62'/><ellipse cx='82' cy='188' rx='14' ry='7' transform='rotate(18 82 188)' stroke='%230D1A45' stroke-width='1.1' opacity='.52'/><ellipse cx='70' cy='137' rx='17' ry='8' transform='rotate(22 70 137)' stroke='%230D1A45' stroke-width='1.3' opacity='.58'/><ellipse cx='88' cy='124' rx='12' ry='5.5' transform='rotate(16 88 124)' stroke='%230D1A45' stroke-width='1.1' opacity='.48'/><ellipse cx='224' cy='294' rx='22' ry='10' transform='rotate(-32 224 294)' stroke='%230D1A45' stroke-width='1.5' opacity='.68'/><path d='M 214 284 L 234 304' stroke='%230D1A45' stroke-width='.7' opacity='.35'/><ellipse cx='205' cy='280' rx='16' ry='8' transform='rotate(-25 205 280)' stroke='%230D1A45' stroke-width='1.2' opacity='.55'/><ellipse cx='210' cy='225' rx='20' ry='9' transform='rotate(-35 210 225)' stroke='%230D1A45' stroke-width='1.4' opacity='.62'/><ellipse cx='192' cy='213' rx='14' ry='7' transform='rotate(-28 192 213)' stroke='%230D1A45' stroke-width='1.1' opacity='.52'/><ellipse cx='196' cy='157' rx='18' ry='8' transform='rotate(-40 196 157)' stroke='%230D1A45' stroke-width='1.3' opacity='.58'/><ellipse cx='178' cy='145' rx='13' ry='6' transform='rotate(-32 178 145)' stroke='%230D1A45' stroke-width='1.1' opacity='.48'/><ellipse cx='128' cy='170' rx='13' ry='6' transform='rotate(-58 128 170)' stroke='%230D1A45' stroke-width='1.2' opacity='.52'/><ellipse cx='162' cy='155' rx='12' ry='5.5' transform='rotate(52 162 155)' stroke='%230D1A45' stroke-width='1.1' opacity='.48'/><circle cx='105' cy='100' r='17' stroke='%23C62828' stroke-width='2' opacity='.72'/><circle cx='105' cy='100' r='6.5' fill='%23C62828' opacity='.42'/><line x1='105' y1='80' x2='105' y2='73' stroke='%23C62828' stroke-width='2' stroke-linecap='round' opacity='.62'/><line x1='105' y1='120' x2='105' y2='127' stroke='%23C62828' stroke-width='2' stroke-linecap='round' opacity='.62'/><line x1='85' y1='100' x2='78' y2='100' stroke='%23C62828' stroke-width='2' stroke-linecap='round' opacity='.62'/><line x1='125' y1='100' x2='132' y2='100' stroke='%23C62828' stroke-width='2' stroke-linecap='round' opacity='.62'/><line x1='91' y1='86' x2='85' y2='80' stroke='%23C62828' stroke-width='1.5' stroke-linecap='round' opacity='.52'/><line x1='119' y1='114' x2='125' y2='120' stroke='%23C62828' stroke-width='1.5' stroke-linecap='round' opacity='.52'/><line x1='91' y1='114' x2='85' y2='120' stroke='%23C62828' stroke-width='1.5' stroke-linecap='round' opacity='.52'/><line x1='119' y1='86' x2='125' y2='80' stroke='%23C62828' stroke-width='1.5' stroke-linecap='round' opacity='.52'/><circle cx='66' cy='258' r='7' stroke='%23C62828' stroke-width='1.4' opacity='.65'/><circle cx='66' cy='258' r='2.8' fill='%23C62828' opacity='.38'/><circle cx='224' cy='284' r='7' stroke='%23C62828' stroke-width='1.4' opacity='.65'/><circle cx='224' cy='284' r='2.8' fill='%23C62828' opacity='.38'/><circle cx='63' cy='195' r='5' stroke='%23C62828' stroke-width='1.2' opacity='.55'/><circle cx='210' cy='216' r='5' stroke='%23C62828' stroke-width='1.2' opacity='.55'/><circle cx='70' cy='128' r='4' stroke='%23C62828' stroke-width='1' opacity='.48'/><circle cx='196' cy='148' r='4' stroke='%23C62828' stroke-width='1' opacity='.48'/></svg>") bottom right / contain no-repeat;
  opacity: 0;
  pointer-events: none;
  z-index: -1;
  transition: opacity 2s var(--ease);
}

/* Top-left — smaller mirrored accent */
body::after {
  content: '';
  position: fixed;
  top: 58px; left: -8px;
  width: 130px; height: 172px;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 400' fill='none'><path d='M 150 390 C 148 320 138 240 105 100' stroke='%230D1A45' stroke-width='2.5' stroke-linecap='round' opacity='.75'/><path d='M 143 310 C 118 288 92 282 68 265' stroke='%230D1A45' stroke-width='1.8' stroke-linecap='round' opacity='.7'/><path d='M 147 340 C 172 315 198 308 222 292' stroke='%230D1A45' stroke-width='1.8' stroke-linecap='round' opacity='.7'/><ellipse cx='66' cy='268' rx='22' ry='10' transform='rotate(28 66 268)' stroke='%230D1A45' stroke-width='1.5' opacity='.65'/><ellipse cx='224' cy='294' rx='22' ry='10' transform='rotate(-32 224 294)' stroke='%230D1A45' stroke-width='1.5' opacity='.65'/><circle cx='105' cy='100' r='15' stroke='%23C62828' stroke-width='2' opacity='.68'/><circle cx='105' cy='100' r='5.5' fill='%23C62828' opacity='.38'/></svg>") top left / contain no-repeat;
  transform: rotate(180deg) scaleX(-1);
  opacity: 0;
  pointer-events: none;
  z-index: -1;
  transition: opacity 2s var(--ease);
}

/* DAY mode — clean warm cream, botanical corners visible */
[data-mode="day"] body {
  background: #f7f4ec;
}
[data-mode="day"] body::before { opacity: 0.11; }
[data-mode="day"] body::after  { opacity: 0.06; }

/* NIGHT body */
[data-mode="night"] body {
  background: linear-gradient(-45deg, #060a1e, #0d1a45, #14103a, #04101e);
  background-size: 400% 400%;
  background-attachment: fixed;
  animation: bgShift 22s ease infinite;
}
/* Night: botanical corners bleached to light so they show on dark bg */
[data-mode="night"] body::before { opacity: 0.07; filter: brightness(4) saturate(0.2); }
[data-mode="night"] body::after  { opacity: 0.05; filter: brightness(4) saturate(0.2); }

@keyframes bgShift {
  0%, 100% { background-position: 0% 50%; }
  50%       { background-position: 100% 50%; }
}

.serif { font-family: 'Playfair Display', Georgia, serif; }

/* ── Topbar ──────────────────────────────────────────────────── */
.topbar {
  background: var(--navy);
  color: var(--ivory);
  padding: 12px 18px 11px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 2.5px solid var(--red);
  overflow: hidden;
  transition: background 2s var(--ease);
}

/* Batik pattern overlay behind topbar */
.topbar > .topbar-pattern {
  position: absolute;
  inset: 0;
  background: url('../img/nlb-pattern.jpg') center/380px repeat;
  opacity: 0;
  pointer-events: none;
  transition: opacity 2s var(--ease);
}

[data-mode="night"] .topbar > .topbar-pattern { opacity: .07; }

/* NLB wordmark strip */
.topbar::after {
  content: 'NASI LEMAK BAHRU · MASAKIN GROUP';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  transform: translateY(100%);
  text-align: center;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .38em;
  color: var(--ivory);
  opacity: .42;
  padding: 5px 0;
  pointer-events: none;
  transition: opacity 2s var(--ease);
}

[data-mode="night"] .topbar::after { opacity: .55; }

.topbar > div:nth-child(2) { min-width: 0; flex: 1; position: relative; z-index: 1; }

.topbar .mark {
  width: 40px; height: 32px;
  border-radius: 9px;
  flex: 0 0 auto;
  /* logo is a white/light mark — needs a dark chip behind it (matches .brandblock .logo's
     navy treatment) or it disappears against the topbar's own light-ivory fallback */
  background: var(--navy-2) url('../logos/nlb.png') center/78% no-repeat;
  font-size: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.22);
  position: relative; z-index: 1;
  /* now a link (see gohome.html) — tap the logo to jump back to your own home page */
  display: block; text-decoration: none; cursor: pointer;
}
.topbar .mark:active { filter: brightness(1.15); }

/* ── Shared header icon buttons + ☰ nav panel (Marlen, 1 Aug 2026: "bagian atas
   yg sy tandain itu harus nya di buat sama yg page management di gabung aja" —
   every division home page gets the same header treatment as home-mgmt.html,
   and the old always-visible footer link row is retired in favour of this panel). */
.acct-btn {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
  background: rgba(255,255,255,.12); border: 1.5px solid rgba(255,255,255,.22);
  font-size: 15px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: #fff; text-decoration: none;
}
.acct-btn:active { background: rgba(255,255,255,.2); }
.nav-panel {
  display: none; flex-direction: column; gap: 1px;
  position: fixed; z-index: 250; top: 58px; left: 14px; right: 14px;
  max-height: 75vh; overflow-y: auto;
  background: rgba(8,14,38,.98); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.1); border-radius: 16px;
  padding: 8px; box-shadow: 0 16px 40px rgba(0,0,0,.35);
}
.nav-panel.open { display: flex; }
.nav-panel a {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 11px 12px; border-radius: 10px; font-size: 13px; font-weight: 700;
  color: rgba(255,255,255,.8); text-decoration: none;
}
.nav-panel a:active { background: rgba(255,255,255,.08); }
[data-mode="day"] .nav-panel { background: rgba(245,241,230,.96) !important; border-color: var(--line) !important; }
[data-mode="day"] .nav-panel a { color: var(--charcoal) !important; }
[data-mode="day"] .nav-panel a:active { background: rgba(13,26,69,.05) !important; }

.topbar .t {
  font-weight: 700; font-size: 15px; letter-spacing: .15px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.topbar .sub {
  font-size: 11px; opacity: .62; margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.topbar .right {
  margin-left: auto; font-size: 11.5px; opacity: .75;
  text-align: right; flex: 0 0 auto; white-space: nowrap;
  position: relative; z-index: 1;
}

/* Back link relocated next to the logo (see theme.js moveBackButton) — reads as a normal
   top-left back control instead of a stray link in the far top-right corner. */
.topbar a.topback {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 9px;
  background: rgba(255,255,255,.1);
  color: var(--ivory) !important;
  font-size: 17px; font-weight: 700;
  text-decoration: none !important;
  position: relative; z-index: 1;
  transition: background .15s;
}
.topbar a.topback:hover, .topbar a.topback:active { background: rgba(255,255,255,.2); }
/* the label text ("Kembali"/"Finance"/"Beranda") collapses — the ‹ chevron alone reads as "back" */
.topbar a.topback { font-size: 0; }
.topbar a.topback::before { content: '‹'; font-size: 20px; line-height: 1; }

/* ── Page wrapper card ───────────────────────────────────────── */
.wrap {
  max-width: 520px;
  margin: 16px auto 32px;
  padding: 22px 17px 42px;
  background: var(--beige);
  border-radius: 20px;
  box-shadow: 0 16px 44px rgba(0,0,0,.28);
  position: relative;
  overflow: hidden;
  transition: background 2s var(--ease), box-shadow 2s var(--ease);
}

.wrap-wide { max-width: 900px; }

/* Botanical corner ornament — satu titik, pojok kanan bawah */
.wrap::after {
  content: '';
  position: absolute;
  right: -14px; bottom: -16px;
  width: 110px; height: 136px;
  background: url('../img/nlb-floral.png') center/contain no-repeat;
  opacity: .055;
  pointer-events: none;
  transition: opacity 2s var(--ease), filter 2s var(--ease);
}

/* Day mode wrap */
[data-mode="day"] .wrap {
  background: #fdfcf8;
  box-shadow: 0 8px 32px rgba(13,26,69,.10);
}

/* Night mode wrap */
[data-mode="night"] .wrap {
  background: #f8f5ed;
  box-shadow: 0 24px 64px rgba(0,0,0,.5);
}

/* Night floral: slightly warmer, no pulse */
[data-mode="night"] .wrap::after {
  filter: brightness(0) saturate(100%) invert(80%) sepia(15%) saturate(200%) hue-rotate(15deg);
  opacity: .06;
}

/* ── Typography ──────────────────────────────────────────────── */
h1.page {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
  margin: 4px 0 12px;
  position: relative;
  padding-bottom: 11px;
}

h1.page::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 32px; height: 2.5px;
  background: var(--red);
  border-radius: 2px;
}


.lead {
  color: var(--grey);
  font-size: 13.5px;
  margin-bottom: 20px;
  line-height: 1.65;
}

/* Section group label with floral bullet */
.grp {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--grey);
  text-transform: uppercase;
  letter-spacing: .55px;
  margin: 22px 0 9px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.grp::before {
  content: '';
  display: inline-block;
  width: 3px; height: 3px;
  flex: 0 0 3px;
  background: var(--red);
  border-radius: 50%;
  opacity: .7;
}

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  animation: fadeup .38s var(--ease) both;
  transition: background 2s var(--ease), border-color 2s var(--ease);
}

.pad { padding: 20px; }

/* ── Forms ───────────────────────────────────────────────────── */
label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--navy);
  margin: 15px 0 6px;
}

input, select, textarea {
  width: 100%;
  padding: 11px 13px;
  /* 16px, not 14px. Safari on iOS auto-zooms any focused field under 16px and
     never zooms back out, so staff ended up panning a zoomed page through
     hundreds of fields — worst on so-kitchen (200+ items) and setor. */
  font-size: 16px;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  background: var(--ivory);
  font-family: inherit;
  color: var(--charcoal);
  transition: border-color .18s, box-shadow .18s;
}

/* 16px for the same reason as the rule above — this override was re-introducing the
   iOS auto-zoom on every report form's date field, which is the FIRST thing staff
   touch. Width goes up with it so the date text still fits at the larger size. */
input[type=date] { font-size: 16px; padding: 9px 11px; max-width: 190px; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(13,26,69,.08);
}

.hint { font-size: 11.5px; color: var(--grey); margin-top: 5px; line-height: 1.5; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Discount/voucher row */
.drow { display: grid; grid-template-columns: 1fr 84px 54px; gap: 7px; align-items: center; margin: 7px 0; }
.drow span { font-size: 12px; color: var(--charcoal); }
.drow input { padding: 8px 9px; font-size: 12.5px; text-align: right; }
.drow .hd { font-size: 10px; font-weight: 700; color: var(--grey); text-transform: uppercase; letter-spacing: .3px; text-align: right; }

/* System-calc readout */
.sysfield {
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(13,26,69,.06);
  border-radius: 10px; padding: 11px 13px; margin-top: 12px;
  border: 1px solid rgba(13,26,69,.08);
}
.sysfield .k { font-size: 12.5px; color: var(--grey); }
.sysfield .v { font-size: 15px; font-weight: 800; color: var(--navy); }

/* ── Buttons ─────────────────────────────────────────────────── */
/* `.btn-primary` is the primary CTA on 7 bar/moonroti daily forms but was
   never defined anywhere — those buttons fell back to a raw grey OS button.
   Aliased here rather than rewriting 7 pages, so future uses work too. */
.btn, .btn-primary {
  width: 100%; margin-top: 20px; padding: 15px;
  border: none; border-radius: 12px;
  background: var(--navy); color: #fff;
  font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: background .18s, transform .12s, box-shadow .18s;
  position: relative; overflow: hidden;
}

.btn::after, .btn-primary::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.1) 0%, transparent 60%);
  pointer-events: none;
}

.btn:hover, .btn-primary:hover { background: var(--navy-2); box-shadow: 0 6px 22px rgba(13,26,69,.28); }
.btn:active, .btn-primary:active { transform: scale(.99); }
.btn.red { background: var(--red); }
.btn.red:hover { background: #a82020; box-shadow: 0 6px 22px rgba(198,40,40,.28); }
.btn.ghost { background: #fff; color: var(--navy); border: 1.5px solid var(--navy); }

.btn:disabled, .btn-primary:disabled { opacity: .72; cursor: not-allowed; }

/* ── Loading state ────────────────────────────────────────────────
   Staff are on phones over patchy outlet wifi, and an upload with a photo in
   it can take many seconds. A button that only greys out reads as "nothing
   happened" and gets tapped again. This gives it visible motion — a sliding
   bar plus a spinning ring — so waiting looks like progress.

   Applied by theme.js as `.is-loading`, NOT by :disabled. The old rule here
   was `.btn:disabled::after`, which had two problems: it reached only .btn /
   .btn-primary, leaving .obtn/.vbtn/.pbtn/.btn-save/.send-btn (every finance
   and admin action) with no feedback at all; and it spun on ANY disabled
   button, including ones left permanently disabled after a successful submit
   — an animation promising progress that would never end.

   Everything below uses currentColor, so it works unchanged on navy-on-white
   buttons and white-on-navy ones without per-class variants. */
button.is-loading, a.is-loading, .is-loading {
  position: relative;
  overflow: hidden;
  cursor: progress;
}

/* A loading button must NOT wear the dimming that marks a dead one. `.btn:disabled`
   (0,2,0) out-specifies a bare `.is-loading` (0,1,0), so .btn/.btn-primary rendered
   visibly greyer than .obtn/.vbtn mid-submit; these selectors (0,3,0) settle it and
   keep every button class looking equally alive while it works. */
.btn.is-loading:disabled,
.btn-primary.is-loading:disabled,
button.is-loading:disabled { opacity: 1; }

/* The sliding bar. This is the part that reads as "it's moving". */
button.is-loading::before, .is-loading::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  height: 3px; width: 38%;
  background: currentColor;
  opacity: .55;
  border-radius: 3px;
  animation: mslide 1.1s ease-in-out infinite;
  pointer-events: none;
}

/* The mark, sitting after the label. Base = a plain ring, so a browser without
   mask support still gets sensible feedback rather than a solid block. */
button.is-loading::after, .is-loading::after {
  content: '';
  display: inline-block;
  width: 13px; height: 13px;
  margin-left: 9px; vertical-align: -2px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  opacity: .8;
  border-radius: 50%;
  animation: mspin .8s linear infinite;
  position: static; inset: auto;
  background: none;
}

/* Brandmark spinner. `nlb-spinner.png` is the NLB flower reduced to a pure alpha
   silhouette (the red mark only — the white halo baked into nlb-flower-clean.png
   is stripped, or masking it would yield a blob). Used as a MASK filled with
   currentColor, so the flower takes each button's own colour: white on the navy
   CTAs, navy on the white .vbtn, and it stays visible on the red buttons where a
   fixed heritage-red flower would vanish.

   It turns and breathes rather than just spinning — the bloom easing already used
   for .rolecard:hover — so it reads as the brandmark, not a generic throbber.

   The silhouette is deliberately the SOLID bloom, not the literal logo artwork.
   Masking the mark as-drawn put its starburst centre and deep petal notches at
   16px, where they close up and read as a GEAR — verified on screen, not guessed.
   Interior detail is filled and the outline kept, so six petals still read at
   button size. 18px, because at 16 the petals mush into a blob. */
@supports ((-webkit-mask-image: url('../img/nlb-spinner.png')) or (mask-image: url('../img/nlb-spinner.png'))) {
  button.is-loading::after, .is-loading::after {
    width: 18px; height: 18px;
    margin-left: 8px; vertical-align: -4px;
    border: none; border-radius: 0;
    background: currentColor;
    opacity: .92;
    -webkit-mask: url('../img/nlb-spinner.png') center / contain no-repeat;
            mask: url('../img/nlb-spinner.png') center / contain no-repeat;
    animation: mbloomspin 1.5s var(--ease, cubic-bezier(.4,0,.2,1)) infinite;
  }
}

@keyframes mslide {
  0%   { left: -38%; }
  100% { left: 100%; }
}

@keyframes mbloomspin {
  0%   { transform: rotate(0deg)   scale(.86); }
  50%  { transform: rotate(180deg) scale(1.06); }
  100% { transform: rotate(360deg) scale(.86); }
}

/* Respect the OS setting — keep the ring, drop the travelling bar. */
@media (prefers-reduced-motion: reduce) {
  button.is-loading::before, .is-loading::before { animation: none; left: 0; width: 100%; opacity: .3; }
  /* Keep the flower turning so there's still a sign of life, just calmly and
     without the scale pulse. */
  button.is-loading::after,  .is-loading::after  { animation: mspin 2.4s linear infinite; }
}

/* ── Upload zone ─────────────────────────────────────────────── */
.upload {
  border: 1.6px dashed var(--line);
  border-radius: 12px; padding: 24px;
  text-align: center; background: var(--ivory);
  cursor: pointer; color: var(--grey); font-size: 13px;
  position: relative; overflow: hidden;
  transition: border-color .18s, background .18s;
}


.upload:hover { border-color: var(--navy); background: #f6f3eb; }
.upload.filled { border-color: var(--green); background: var(--green-bg); color: var(--green); }
.upload img { max-width: 100%; border-radius: 8px; margin-top: 10px; }

/* ── Status banners ──────────────────────────────────────────── */
.check { margin-top: 14px; padding: 12px 14px; border-radius: 12px; font-size: 13px; display: none; }
.check.ok   { display: block; background: var(--green-bg); color: var(--green); border: 1px solid #bfe3cd; }
.check.warn { display: block; background: var(--amber-bg); color: var(--amber); border: 1px solid #ecd9a0; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.b-ok      { background: var(--green-bg);  color: var(--green); }
.b-warn    { background: var(--amber-bg);  color: var(--amber); }
.b-none    { background: var(--grey-bg);   color: var(--grey); }
.b-pending { background: #e7edfb;          color: var(--navy-2); }

/* ── Dashboard tiles ─────────────────────────────────────────── */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 16px 0 6px; }

.tile {
  background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 10px; text-align: center;
}

.tile .n {
  font-size: 22px; font-weight: 800; color: var(--navy);
  font-family: 'Playfair Display', serif; line-height: 1;
}
.tile .l { font-size: 11px; color: var(--grey); margin-top: 6px; font-weight: 600; }
.tile.warn .n { color: var(--amber); }

/* ── Attention banner ────────────────────────────────────────── */
.attn {
  background: var(--amber-bg); border: 1px solid #ecd9a0;
  border-radius: 14px; padding: 14px 16px; margin: 14px 0;
  font-size: 13px; color: var(--amber);
}
.attn b { color: var(--charcoal); }
.attn ul { margin: 8px 0 0 18px; }
.attn li { margin: 3px 0; }

/* ── List rows ───────────────────────────────────────────────── */
.list { margin-top: 14px; display: flex; flex-direction: column; gap: 9px; }

.rowc {
  background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 13px 15px;
  display: flex; align-items: center; gap: 12px;
}
.rowc .date { font-weight: 800; color: var(--navy); font-size: 13px; min-width: 52px; }
.rowc .date small { display: block; font-weight: 500; color: var(--grey); font-size: 10.5px; }
.rowc .mid { flex: 1; min-width: 0; }
.rowc .amt { font-weight: 800; color: var(--charcoal); font-size: 14.5px; }
.rowc .note { font-size: 11.5px; color: var(--grey); margin-top: 2px; }
.rowc .st { text-align: right; }
.rowc .vbtn {
  margin-top: 6px; font-size: 11px; padding: 5px 10px;
  border: 1px solid var(--navy); color: var(--navy);
  background: #fff; border-radius: 8px;
  cursor: pointer; font-weight: 600;
  transition: background .15s;
}
.rowc .vbtn:hover { background: var(--beige); }

/* ── Brand block ─────────────────────────────────────────────── */
.brandblock { text-align: center; margin: 12px 0 6px; }
.brandblock .logo {
  width: 68px; height: 68px; border-radius: 18px;
  background: var(--navy) url('../logos/nlb.png') center/78% no-repeat;
  margin: 0 auto 14px;
  box-shadow: 0 8px 24px rgba(13,26,69,.22);
  font-size: 0;
}

/* ── Role cards ──────────────────────────────────────────────── */
.roles { display: grid; gap: 14px; margin-top: 8px; }

.rolecard {
  display: flex; gap: 14px; align-items: center;
  text-decoration: none; color: inherit; padding: 18px;
  position: relative; overflow: hidden;
}


.rolecard .ic {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--navy); color: #fff;
  display: grid; place-items: center; font-size: 24px; flex: 0 0 auto;
  box-shadow: 0 4px 14px rgba(13,26,69,.2);
}
.rolecard .ic.red { background: var(--red); }
.rolecard h3 { color: var(--navy); font-size: 16px; margin-bottom: 3px; }
.rolecard p { font-size: 12.5px; color: var(--grey); line-height: 1.5; }
.rolecard .arw { margin-left: auto; color: var(--grey); font-size: 20px; }

/* ── Inline form section ─────────────────────────────────────── */
.frm {
  background: var(--beige); border: 1px solid var(--line);
  border-radius: 13px; padding: 13px; margin-top: 10px;
}
.frm .g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Inline row (admin/staff lists) */
.row {
  display: flex; justify-content: space-between; align-items: center;
  background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 13px;
  margin-bottom: 8px; gap: 8px;
}
/* `.rowcard` is the OTHER kind of row: a stacked card, not a flex line.
   Four dashboards (verify, qc-, kitchen-, blend-dashboard) each carried a
   private `.row{display:block}` that overrode the flex rule above — same name,
   opposite layout. A page that forgot the override silently inherited flex and
   collapsed; that already shipped once as a mobile bug (commit cefd058). Now
   it has its own name and lives here once instead of in four <style> blocks.
   Note it deliberately has NO `.rowcard .nm` rule: `.row .nm` (0,2,0) was
   beating those pages' own `.nm` (0,1,0), so their item names rendered
   charcoal/600 when the author had written navy/700. */
.rowcard {
  display: block; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 13px; margin-bottom: 8px;
}

.row .nm { font-size: 13px; font-weight: 600; color: var(--charcoal); }
.row .sb { font-size: 11px; color: var(--grey); margin-top: 2px; }
.row .off { opacity: .45; }

/* Mini action buttons */
.mini {
  border: 1px solid var(--line); background: #fff;
  border-radius: 9px; padding: 7px 11px;
  font-size: 11.5px; font-weight: 600; color: var(--navy-2);
  cursor: pointer; font-family: inherit; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.mini:hover { background: var(--beige); }
.mini.red { color: var(--red); }

.warn { color: var(--amber); font-size: 11.5px; margin-top: 8px; display: none; }
.okb {
  display: none; background: var(--green-bg); border: 1px solid #bfe3cd;
  color: var(--green); font-weight: 600; border-radius: 12px;
  padding: 11px 13px; margin-top: 10px; font-size: 13px;
}

/* Tabs */
.tabs { display: flex; gap: 8px; margin-top: 10px; }
.tabs button {
  flex: 1; padding: 12px;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; font-family: inherit;
  font-weight: 700; font-size: 13px; color: var(--grey);
  cursor: pointer; transition: all .18s;
}
.tabs button.on { border-color: var(--navy); color: var(--navy); background: rgba(13,26,69,.05); }

/* Invoice / purchase boxes */
.inv-box {
  background: var(--beige); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px;
}
.ord {
  background: #fff; border: 1px solid var(--line);
  border-radius: 13px; padding: 13px; margin-bottom: 9px;
}

/* ── Footer ──────────────────────────────────────────────────── */
.foot {
  text-align: center; font-size: 11px;
  color: var(--grey); margin-top: 28px; line-height: 1.7;
}
/* Footer tagline removed — brand already shown in the page header; keeps footer tight */

a.plain { color: var(--navy); text-decoration: none; transition: color .18s; }
a.plain:hover { color: var(--red); }
.muted { color: var(--grey); font-size: 12.5px; }
.demo-tag {
  display: inline-block; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700; padding: 2px 8px;
  border-radius: 6px; letter-spacing: .4px;
}

/* ── Animations ──────────────────────────────────────────────── */
@keyframes mspin { to { transform: rotate(360deg); } }
@keyframes fadeup {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes bloom {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.12); }
}
@keyframes floralPulse {
  0%, 100% { opacity: .07; }
  50%       { opacity: .11; }
}

.card { animation: fadeup .38s var(--ease) both; }
.roles .rolecard:nth-child(1) { animation: fadeup .35s var(--ease) .04s both; }
.roles .rolecard:nth-child(2) { animation: fadeup .35s var(--ease) .08s both; }
.roles .rolecard:nth-child(3) { animation: fadeup .35s var(--ease) .12s both; }
.roles .rolecard:nth-child(4) { animation: fadeup .35s var(--ease) .16s both; }
.roles .rolecard:nth-child(5) { animation: fadeup .35s var(--ease) .20s both; }
.roles .rolecard:nth-child(6) { animation: fadeup .35s var(--ease) .24s both; }
.roles .rolecard:nth-child(7) { animation: fadeup .35s var(--ease) .28s both; }
.roles .rolecard:nth-child(8) { animation: fadeup .35s var(--ease) .32s both; }

@media (hover: hover) {
  .rolecard { transition: transform .14s var(--ease), box-shadow .14s var(--ease); }
  .rolecard:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(13,26,69,.14); }
  .rolecard:hover .step { animation: bloom .5s var(--ease); }
}

/* ================================================================
   NIGHT MODE OVERRIDES
   ================================================================ */

[data-mode="night"] .card,
[data-mode="night"] .rowc,
[data-mode="night"] .tile,
[data-mode="night"] .row,
[data-mode="night"] .rowcard,
[data-mode="night"] .frm,
[data-mode="night"] .ord,
[data-mode="night"] .inv-box { background: #fff !important; }

[data-mode="night"] .check.ok,
[data-mode="night"] .check.warn { background: var(--ivory) !important; }

[data-mode="night"] input,
[data-mode="night"] select,
[data-mode="night"] textarea {
  background: var(--ivory) !important;
  border-color: #d5d0c5 !important;
  color: var(--charcoal) !important;
}

[data-mode="night"] .btn.ghost {
  background: #fff !important;
  color: var(--navy) !important;
  border-color: var(--navy) !important;
}

[data-mode="night"] a.plain { color: #4a6ca8; }
[data-mode="night"] .wrap { box-shadow: 0 24px 64px rgba(0,0,0,.55); }
[data-mode="night"] .b-pending { background: #1a2545; color: #8ca8e0; }
[data-mode="night"] .vbtn { background: var(--ivory) !important; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 420px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .row2  { grid-template-columns: 1fr; }
}

@media (min-width: 760px) {
  .wrap          { max-width: 640px; padding: 30px 28px 52px; margin: 28px auto 44px; border-radius: 24px; }
  .wrap-wide     { max-width: 980px; }
  .roles         { grid-template-columns: 1fr 1fr; gap: 13px; }
  .roles .rolecard { padding: 16px; }
  h1.page        { font-size: 28px; }
  .topbar        { padding: 14px 26px; }
}

@media (min-width: 1200px) {
  .wrap      { max-width: 700px; }
  .wrap-wide { max-width: 1100px; }
}

/* ══ Phase F — tampilan DESKTOP dibedakan dari HP ══
   Halaman dashboard/home (.wrap-wide) memakai lebar layar: kartu tugas jadi multi-kolom
   dan widget tampil sejajar tanpa perlu digeser. Halaman FORM tetap ramping (.wrap)
   supaya kolom isian tidak melar & tetap enak dibaca. Tampilan HP tidak berubah. */
@media (min-width: 1000px) {
  .wrap-wide .roles            { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .wrap-wide #widgets .wg-scroll { overflow-x: visible; }
  .wrap-wide #widgets .wg-card   { flex: 1 1 0; max-width: none; }
}
@media (min-width: 1500px) {
  .wrap-wide { max-width: 1240px; }
}

/* .theme-fab (floating Chat button) removed 1 Aug 2026 — see theme.js header
   comment. Nothing else references this class. */

/* ================================================================
   NLB BOTANICAL DIVIDER
   Usage: <div class="nlb-divider"><span class="nlb-divider-ico"></span></div>
   ================================================================ */
.nlb-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 22px 0; opacity: .55;
}
.nlb-divider::before, .nlb-divider::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(to right, transparent, var(--line), transparent);
}
.nlb-divider-ico {
  width: 18px; height: 18px;
  background: url('../img/nlb-floral.png') center/contain no-repeat;
  flex: 0 0 18px;
}

/* ── Phosphor icon sizing inside pcards ─────────────────── */
.pcard-ic i { font-size: 18px; line-height: 1; }
[data-mode="night"] .pcard-ic i { color: var(--ivory); }
[data-mode="day"]   .pcard-ic i { color: var(--navy); }

/* ── Priority list (role home) ──────────────────────────── */
.prio-section {
  font-size: 9.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; margin: 14px 0 8px;
  transition: color 2s var(--ease);
}
[data-mode="night"] .prio-section { color: rgba(253,252,248,.32); }
[data-mode="day"]   .prio-section { color: var(--grey); }

.prio-item {
  display: flex; align-items: flex-start; gap: 9px;
  border-radius: 10px; padding: 10px 11px; margin-bottom: 6px;
  border-left: 3px solid transparent;
}
[data-mode="night"] .prio-item { background: rgba(253,252,248,.06); }
[data-mode="day"]   .prio-item { background: #fff; box-shadow: 0 1px 4px rgba(13,26,69,.07); }
.prio-item.p-red   { border-left-color: var(--red); }
.prio-item.p-amber { border-left-color: #b45309; }
.prio-item.p-green { border-left-color: #15803d; }

.prio-body { flex: 1; min-width: 0; }
.prio-urg {
  display: inline-block; font-size: 7.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 4px; margin-bottom: 4px;
}
.urg-red   { background: rgba(198,40,40,.15); color: #ef4444; }
.urg-amber { background: rgba(180,83,9,.15);  color: #f59e0b; }
.urg-green { background: rgba(21,128,61,.15); color: #10b981; }
[data-mode="day"] .urg-red   { background: rgba(198,40,40,.1); color: var(--red); }
[data-mode="day"] .urg-amber { background: rgba(180,83,9,.1);  color: #92400e; }
[data-mode="day"] .urg-green { background: rgba(21,128,61,.1); color: #15803d; }

.prio-task {
  font-size: 12px; font-weight: 600; line-height: 1.35;
  transition: color 2s var(--ease);
}
[data-mode="night"] .prio-task { color: var(--ivory); }
[data-mode="day"]   .prio-task { color: var(--charcoal); }
.prio-task.done { text-decoration: line-through; opacity: .4; }

.prio-sub { font-size: 10px; margin-top: 2px; color: var(--grey); }
.prio-chev  { font-size: 13px; color: var(--grey); align-self: center; }
.prio-done-ic { font-size: 13px; color: #10b981; align-self: center; }
