/* ============================================================================
   LORDS AND KINGS AUTOMATED PURCHASE — HARVEST & HYPERMARKET GLASS STUDIO
   Double-Bezel Frosted Glass UI over Full-Bleed Grocery Panorama
   ============================================================================ */

:root {
  --backdrop-img: url('assets/grocery_backdrop.jpg');
  --bg-fallback: #06150f;
  --glass-outer: rgba(15, 38, 29, 0.56);
  --glass-outer-border: rgba(245, 196, 81, 0.28);
  --glass-core: rgba(9, 25, 19, 0.84);
  --glass-elevated: rgba(16, 40, 31, 0.90);
  --glass-border: rgba(148, 226, 185, 0.16);
  --glass-hover: rgba(34, 197, 94, 0.14);
  --text-main: #f8fafc;
  --text-muted: #a7c4b5;
  --accent-gold: #f59e0b;
  --accent-gold-bright: #fde68a;
  --accent-emerald: #10b981;
  --accent-emerald-bright: #34d399;
  --accent-blue: #38bdf8;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #22c55e;
  --shadow-glass: 0 24px 60px rgba(0, 0, 0, 0.55);
  --radius-bezel: 22px;
  --radius-core: 17px;
  --scrim-bg: radial-gradient(circle at 50% 45%, rgba(6, 22, 16, 0.42) 0%, rgba(4, 14, 10, 0.72) 100%);
  --input-bg: rgba(7, 20, 15, 0.82);
  --table-head-bg: rgba(15, 39, 29, 0.94);
  --table-row-hover: rgba(34, 197, 94, 0.09);
}

body.theme-daylight-market {
  --backdrop-img: url('assets/grocery_backdrop_alt.jpg');
  --bg-fallback: #eef6f0;
  --glass-outer: rgba(255, 255, 255, 0.62);
  --glass-outer-border: rgba(16, 185, 129, 0.34);
  --glass-core: rgba(255, 253, 248, 0.91);
  --glass-elevated: rgba(255, 255, 255, 0.96);
  --glass-border: rgba(15, 23, 42, 0.12);
  --glass-hover: rgba(16, 185, 129, 0.10);
  --text-main: #0f1f18;
  --text-muted: #4b6559;
  --accent-gold: #d97706;
  --accent-gold-bright: #b45309;
  --accent-emerald: #059669;
  --accent-emerald-bright: #047857;
  --shadow-glass: 0 20px 50px rgba(15, 38, 29, 0.16);
  --scrim-bg: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.16) 0%, rgba(232, 244, 236, 0.34) 100%);
  --input-bg: rgba(255, 255, 255, 0.95);
  --table-head-bg: rgba(236, 247, 240, 0.95);
  --table-row-hover: rgba(16, 185, 129, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-fallback);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

.hidden {
  display: none !important;
}

/* ============================================================================
   FULL-BLEED GROCERY PANORAMA BACKDROP
   ============================================================================ */
.grocery-backdrop-layer {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: var(--backdrop-img);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  transform: scale(1.02);
  transition: background-image 0.4s ease;
}

.grocery-backdrop-scrim {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--scrim-bg);
  pointer-events: none;
}

/* ============================================================================
   DOUBLE-BEZEL ("DOPPELRAND") FROSTED GLASS PRIMITIVES
   ============================================================================ */
.double-bezel {
  background: var(--glass-outer);
  border: 1px solid var(--glass-outer-border);
  border-radius: var(--radius-bezel);
  padding: 6px;
  box-shadow: var(--shadow-glass);
  backdrop-filter: blur(22px) saturate(165%);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
}

.double-bezel-sm {
  background: var(--glass-outer);
  border: 1px solid var(--glass-outer-border);
  border-radius: 18px;
  padding: 4px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px) saturate(155%);
  -webkit-backdrop-filter: blur(18px) saturate(155%);
}

.bezel-core {
  background: var(--glass-core);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-core);
  padding: 18px 22px;
}

.double-bezel-sm > .bezel-core {
  border-radius: 14px;
}

.panel-flex-col {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
  overflow: hidden;
}

/* ============================================================================
   DEDICATED 4-SECOND INTERACTIVE MULTI-WEATHER PORTAL SCREEN
   ============================================================================ */
.splash-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 72px 24px 24px;
  overflow: hidden;
  background: #f6f2e8;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.splash-overlay.splash-fading {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-weather-scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

/* Stacked Full-Viewport Scene Layers with GPU 600ms Crossfade + Subtle Scale */
.splash-bg-layer {
  position: absolute;
  inset: -3%;
  width: 106%;
  height: 106%;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1.04) translate3d(0, 0, 0);
  transition: opacity 600ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.splash-bg-layer.is-active {
  opacity: 1;
  transform: scale(1) translate3d(0, 0, 0);
}

.scene-daytime {
  background-image: url('assets/splash_sunny_bg.png?v=3');
}

.scene-sunny {
  background-image: url('assets/splash_sunny_bg.png?v=3');
}

.scene-rainy {
  background-image: url('assets/splash_sunny_bg.png?v=3');
  filter: saturate(0.42) brightness(0.68) contrast(1.08);
}

.scene-winter {
  background-image: url('assets/splash_sunny_bg.png?v=3');
  filter: saturate(0.26) brightness(1.05) contrast(0.92);
}

.scene-grocery {
  background-image: url('assets/grocery_backdrop.jpg');
}

.splash-overlay.weather-grocery .scene-grocery.is-active {
  animation: groceryAmbientDrift 16s ease-in-out infinite;
}

@keyframes groceryAmbientDrift {
  0%, 100% { transform: scale(1.02) translate3d(0, 0, 0); }
  50% { transform: scale(1.055) translate3d(-0.6%, -0.4%, 0); }
}

/* Atmospheric Color Grading Overlay per Weather */
.splash-atmo-grade {
  position: absolute;
  inset: 0;
  transition: opacity 600ms ease, background 600ms ease;
}

.splash-overlay.weather-sunny .splash-atmo-grade {
  background: linear-gradient(180deg, rgba(254, 249, 195, 0.08) 0%, rgba(255, 255, 255, 0.02) 60%, rgba(245, 158, 11, 0.06) 100%);
}

.splash-overlay.weather-daytime-custom .splash-atmo-grade {
  background: rgba(255, 253, 240, 0.05);
}

.splash-overlay.weather-rainy .splash-atmo-grade {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.56) 0%, rgba(30, 41, 59, 0.36) 52%, rgba(15, 23, 42, 0.62) 100%);
}

.splash-overlay.weather-winter .splash-atmo-grade {
  background: linear-gradient(180deg, rgba(148, 197, 233, 0.52) 0%, rgba(224, 242, 254, 0.36) 50%, rgba(241, 245, 249, 0.58) 100%);
}

.splash-overlay.weather-grocery .splash-atmo-grade {
  background: radial-gradient(circle at 50% 50%, rgba(255, 252, 245, 0.14) 0%, rgba(15, 36, 25, 0.18) 100%);
}

/* Warm Right-Side Sunlight Glow + Pulsing Shimmer (Sunny & Daytime) */
.splash-sun-shimmer {
  position: absolute;
  top: -12%;
  right: 2%;
  width: 52vw;
  height: 52vw;
  min-width: 340px;
  min-height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 251, 235, 0.58) 0%, rgba(253, 224, 71, 0.32) 30%, rgba(251, 146, 60, 0.12) 55%, transparent 74%);
  opacity: 0;
  transform: scale(0.92) translate3d(0, 0, 0);
  transition: opacity 600ms ease;
  will-change: transform, opacity;
}

.splash-overlay.weather-sunny .splash-sun-shimmer,
.splash-overlay.weather-daytime-custom .splash-sun-shimmer {
  opacity: 1;
  animation: sunShimmerPulse 4.6s ease-in-out infinite;
}

@keyframes sunShimmerPulse {
  0%, 100% { transform: scale(1) translate3d(0, 0, 0); opacity: 0.72; }
  50% { transform: scale(1.07) translate3d(-1%, 1%, 0); opacity: 1; }
}

/* Gentle Shoreline Wave-Drift Shimmer Along Ocean Mid-Ground */
.splash-shore-waves {
  position: absolute;
  top: 50%;
  left: -6%;
  right: -6%;
  height: 24%;
  background: linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.18) 30%, rgba(186, 230, 253, 0.24) 55%, rgba(255, 255, 255, 0.16) 76%, transparent 100%);
  opacity: 0;
  will-change: transform, opacity;
  transition: opacity 600ms ease;
}

.splash-overlay.weather-sunny .splash-shore-waves,
.splash-overlay.weather-daytime-custom .splash-shore-waves {
  opacity: 0.58;
  animation: shoreWaveSunny 6.5s ease-in-out infinite;
}

.splash-overlay.weather-rainy .splash-shore-waves {
  opacity: 0.45;
  background: linear-gradient(180deg, transparent 0%, rgba(148, 163, 184, 0.28) 32%, rgba(71, 85, 105, 0.34) 58%, transparent 100%);
  animation: shoreWaveChoppy 2.8s ease-in-out infinite;
}

.splash-overlay.weather-winter .splash-shore-waves {
  opacity: 0.48;
  background: linear-gradient(180deg, transparent 0%, rgba(224, 242, 254, 0.40) 42%, rgba(186, 230, 253, 0.28) 68%, transparent 100%);
  animation: shoreWaveWinter 9s ease-in-out infinite;
}

@keyframes shoreWaveSunny {
  0%, 100% { transform: translate3d(-1.5%, 0, 0) scaleY(1); }
  50% { transform: translate3d(1.5%, -4px, 0) scaleY(1.08); }
}

@keyframes shoreWaveChoppy {
  0%, 100% { transform: translate3d(-2%, 2px, 0) scaleY(0.95); }
  50% { transform: translate3d(2%, -6px, 0) scaleY(1.14); }
}

@keyframes shoreWaveWinter {
  0%, 100% { transform: translate3d(-1%, 0, 0) scaleY(1); }
  50% { transform: translate3d(1%, -2px, 0) scaleY(1.04); }
}

/* Frost / Snow-Dusted Sand Glaze (Winter Mode) */
.splash-winter-frost {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 600ms ease;
  background:
    linear-gradient(180deg, rgba(224, 242, 254, 0.14) 0%, transparent 44%, rgba(240, 249, 255, 0.56) 76%, rgba(248, 250, 252, 0.84) 100%),
    radial-gradient(circle at 50% 45%, transparent 54%, rgba(186, 230, 253, 0.44) 100%);
}

.splash-overlay.weather-winter .splash-winter-frost {
  opacity: 1;
}

.splash-weather-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 4;
}

/* Top Scene Switcher Pill Bar */
.splash-weather-pills {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9650;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  max-width: calc(100vw - 24px);
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(255, 255, 255, 0.78);
  padding: 6px 10px;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14);
}

.weather-pill {
  background: rgba(255, 255, 255, 0.62);
  border: 1.5px solid rgba(15, 36, 25, 0.12);
  color: #1e3a2f;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s ease, background 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.weather-pill:hover {
  background: rgba(6, 95, 70, 0.10);
  border-color: rgba(6, 95, 70, 0.36);
  transform: translateY(-1px);
}

.weather-pill.active {
  background: linear-gradient(135deg, #065f46, #047857);
  color: #ffffff;
  border-color: #10b981;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.42), 0 0 0 2px rgba(16, 185, 129, 0.18);
}

#wpDaytime.active,
#wpSunny.active {
  background: linear-gradient(135deg, #d97706, #b45309);
  border-color: #fbbf24;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.44), 0 0 0 2px rgba(251, 191, 36, 0.24);
}

#wpRainy.active {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  border-color: #60a5fa;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.44), 0 0 0 2px rgba(96, 165, 250, 0.24);
}

#wpWinter.active {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border-color: #7dd3fc;
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.42), 0 0 0 2px rgba(125, 211, 252, 0.26);
}

#wpLiveChennai.active {
  background: linear-gradient(135deg, #0f766e, #0d9488);
  border-color: #2dd4bf;
  box-shadow: 0 4px 16px rgba(13, 148, 136, 0.42), 0 0 0 2px rgba(45, 212, 191, 0.24);
}

.chennai-temp-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.14);
  font-size: 10.5px;
  font-weight: 700;
}

#wpLiveChennai.active .chennai-temp-badge {
  background: rgba(255, 255, 255, 0.24);
}

.weather-pill.auto-matched:not(.active) {
  border-color: #14b8a6;
  background: rgba(20, 184, 166, 0.12);
  color: #0f766e;
  box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.16);
}

/* Stage Layout */
.splash-stage-wrap {
  width: 100%;
  max-width: 1380px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 10;
}

/* Synchronized Corner Characters */
.splash-char-actor {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  position: fixed;
  bottom: 20px;
  z-index: 9600;
  user-select: none;
  will-change: transform;
}

.splash-char-left {
  left: 26px;
}

.splash-char-right {
  right: 26px;
}

.splash-char-actor.char-react {
  animation: charActorBounce 0.64s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes charActorBounce {
  0% { transform: translateY(0) scale(1); }
  32% { transform: translateY(-13px) scale(1.045); }
  62% { transform: translateY(2px) scale(0.98, 1.02); }
  100% { transform: translateY(0) scale(1); }
}

/* Reactive Sparkle Burst Above Character */
.char-sparkle-burst {
  position: absolute;
  top: 18px;
  left: 50%;
  width: 110px;
  height: 36px;
  transform: translateX(-50%);
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  opacity: 0;
}

.char-sparkle-burst span {
  font-size: 16px;
  display: inline-block;
}

.splash-char-actor.char-react .char-sparkle-burst {
  animation: sparkleBurstPop 0.72s ease-out forwards;
}

@keyframes sparkleBurstPop {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(0.6); }
  35% { opacity: 1; transform: translate(-50%, -10px) scale(1.18); }
  100% { opacity: 0; transform: translate(-50%, -26px) scale(0.85); }
}

.char-juice-rig {
  position: relative;
  display: inline-block;
  filter: drop-shadow(0 16px 24px rgba(15, 23, 42, 0.36));
  transition: filter 0.55s ease;
  will-change: transform;
}

/* Weather-Synced Rim Lighting on Corner Characters */
.splash-overlay.weather-sunny .char-juice-rig,
.splash-overlay.weather-daytime-custom .char-juice-rig {
  filter: drop-shadow(4px -2px 10px rgba(251, 191, 36, 0.54))
          drop-shadow(0 16px 24px rgba(120, 53, 15, 0.36));
}

.splash-overlay.weather-rainy .char-juice-rig {
  filter: drop-shadow(0 0 12px rgba(96, 165, 250, 0.48))
          drop-shadow(0 16px 24px rgba(15, 23, 42, 0.58))
          brightness(0.92) saturate(0.88);
}

.splash-overlay.weather-winter .char-juice-rig {
  filter: drop-shadow(0 0 14px rgba(186, 230, 253, 0.68))
          drop-shadow(0 16px 22px rgba(30, 58, 138, 0.34))
          brightness(1.03) saturate(0.92);
}

.splash-overlay.weather-grocery .char-juice-rig {
  filter: drop-shadow(0 16px 26px rgba(15, 36, 25, 0.34));
}

/* Grounding Contact Shadow Under Character Feet */
.char-contact-shadow {
  width: 112px;
  height: 18px;
  margin-top: -8px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(15, 23, 42, 0.44) 0%, rgba(15, 23, 42, 0.16) 56%, transparent 78%);
  filter: blur(2px);
  pointer-events: none;
  transition: background 0.5s ease, transform 0.5s ease;
}

.splash-overlay.weather-rainy .char-contact-shadow {
  background: radial-gradient(ellipse at center, rgba(15, 23, 42, 0.62) 0%, rgba(30, 58, 138, 0.24) 58%, transparent 80%);
}

.splash-overlay.weather-winter .char-contact-shadow {
  background: radial-gradient(ellipse at center, rgba(30, 58, 138, 0.34) 0%, rgba(125, 211, 252, 0.18) 58%, transparent 80%);
}

/* Idle Phase-Offset Breathing (3s-4s ease-in-out infinite) */
.char-sip-girl {
  width: 132px;
  height: 280px;
  animation: charSipBobGirl 3.4s ease-in-out infinite;
  transform-origin: bottom center;
}

.char-sip-boy {
  width: 103px;
  height: 280px;
  animation: charSipBobBoy 3.85s ease-in-out infinite 0.9s;
  transform-origin: bottom center;
}

@keyframes charSipBobGirl {
  0%, 100% { transform: translateY(0) scaleY(1); }
  50% { transform: translateY(-4px) scaleY(1.012); }
}

@keyframes charSipBobBoy {
  0%, 100% { transform: translateY(0) scaleY(1); }
  50% { transform: translateY(-4.5px) scaleY(1.014); }
}

.splash-char-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.splash-char-img.frame-sip {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  animation: spriteMouthSip 0.65s ease-in-out infinite;
}

.char-sip-boy .splash-char-img.frame-sip {
  animation-delay: 0.25s;
}

.splash-char-img.frame-blink {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  animation: spriteEyeBlink 2.1s ease-in-out infinite;
}

.char-sip-boy .splash-char-img.frame-blink {
  animation-delay: 0.85s;
}

@keyframes spriteMouthSip {
  0%, 100% { opacity: 0; }
  45%, 65% { opacity: 1; }
}

@keyframes spriteEyeBlink {
  0%, 38%, 54%, 86%, 100% { opacity: 0; }
  44%, 48% { opacity: 1; }
  92%, 95% { opacity: 1; }
}

.char-juice-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.straw-sip-flow {
  animation: strawLiquidClimb 0.75s linear infinite;
}

@keyframes strawLiquidClimb {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -25; }
}

.cup-bob-group {
  animation: cupTiltSip 1.45s ease-in-out infinite;
  transform-origin: 90px 115px;
}

.arm-cup-sip-left {
  animation: armLiftSipL 1.45s ease-in-out infinite;
  transform-origin: 100px 128px;
}

.arm-cup-sip-right {
  animation: armLiftSipR 1.45s ease-in-out infinite 0.35s;
  transform-origin: 12px 128px;
}

@keyframes armLiftSipL {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  45% { transform: translateY(-2.5px) rotate(-2.5deg); }
}

@keyframes armLiftSipR {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  45% { transform: translateY(-2.5px) rotate(2.5deg); }
}

.oj-liquid-drain {
  animation: juiceDrainLevel 4s ease-in-out infinite;
  transform-origin: bottom center;
}

@keyframes juiceDrainLevel {
  0% { transform: translateY(0px); }
  65% { transform: translateY(15px); }
  90% { transform: translateY(20px); }
  100% { transform: translateY(0px); }
}

.sip-mouth-pulse {
  animation: lipPuckerSip 0.75s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes lipPuckerSip {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.84, 1.12); }
}

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

.oj-bubble {
  animation: ojBubbleRise 1.3s ease-in infinite;
}
.oj-bubble.b2 { animation-delay: 0.4s; }
.oj-bubble.b3 { animation-delay: 0.8s; }

@keyframes ojBubbleRise {
  0% { transform: translateY(4px); opacity: 0; }
  30% { opacity: 0.95; }
  100% { transform: translateY(-18px); opacity: 0; }
}

/* Center High-Contrast Frosted Card (Stationary & Non-Overlapping) */
.splash-bezel-outer {
  max-width: 680px;
  width: 100%;
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 2px solid rgba(245, 158, 11, 0.62);
  border-radius: 30px;
  padding: 10px;
  box-shadow: 0 28px 80px rgba(15, 36, 25, 0.22), 0 0 40px rgba(255, 255, 255, 0.35);
}

.splash-bezel-big {
  width: min(820px, calc(100vw - 340px));
  max-width: 820px;
  min-height: auto;
  display: flex;
  flex-direction: column;
}

.splash-bezel-inner {
  background: rgba(255, 252, 246, 0.92);
  border: 1px solid rgba(16, 185, 129, 0.26);
  border-radius: 22px;
  padding: 40px 36px;
  text-align: center;
  color: #0f2419;
}

.splash-inner-big {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 42px 44px;
}

@media (max-width: 1120px) {
  .splash-char-left { left: 14px; }
  .splash-char-right { right: 14px; }
  .char-sip-girl { width: 110px; height: 234px; }
  .char-sip-boy { width: 86px; height: 234px; }
  .char-contact-shadow { width: 96px; height: 15px; }
  .splash-bezel-big { width: min(740px, calc(100vw - 268px)); }
}

@media (max-width: 880px) {
  .splash-overlay {
    overflow-y: auto;
    align-items: flex-start;
    padding: 86px 14px 24px;
  }
  .splash-stage-wrap {
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px 24px;
  }
  .splash-bezel-big {
    order: 1;
    flex-basis: 100%;
    width: 100%;
    max-width: 560px;
  }
  .splash-inner-big {
    padding: 28px 20px;
  }
  .splash-char-actor {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
  }
  .splash-char-left { order: 2; }
  .splash-char-right { order: 3; }
  .char-sip-girl { width: 96px; height: 204px; }
  .char-sip-boy { width: 76px; height: 204px; }
  .char-contact-shadow { width: 84px; height: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .splash-bg-layer,
  .splash-atmo-grade,
  .splash-sun-shimmer,
  .splash-shore-waves,
  .splash-winter-frost,
  .char-juice-rig,
  .splash-char-actor.char-react,
  .splash-char-actor.char-react .char-sparkle-burst,
  .splash-char-img.frame-sip,
  .splash-char-img.frame-blink,
  .straw-sip-flow,
  .cup-bob-group,
  .arm-cup-sip-left,
  .arm-cup-sip-right,
  .oj-liquid-drain,
  .sip-mouth-pulse,
  .oj-bubble {
    animation: none !important;
  }
  .splash-bg-layer,
  .splash-atmo-grade,
  .splash-sun-shimmer,
  .splash-winter-frost {
    transition-duration: 0.01ms !important;
  }
}

.crest-svg {
  width: 78px;
  height: 78px;
  filter: drop-shadow(0 8px 20px rgba(245, 158, 11, 0.4));
}

.splash-title {
  font-family: 'Playfair Display', 'Inter', serif;
  font-size: clamp(24px, 3.6vw, 34px);
  font-weight: 800;
  margin: 12px 0 6px;
  background: linear-gradient(135deg, #fef3c7 0%, #f59e0b 55%, #34d399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.splash-subtitle {
  font-size: 13.5px;
  color: #1e3a2f;
  margin-bottom: 18px;
}

.splash-items-ribbon {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 22px;
}

.splash-items-ribbon span {
  background: rgba(16, 185, 129, 0.10);
  border: 1px solid rgba(16, 185, 129, 0.28);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #064e3b;
}

.splash-loader-track {
  width: 460px;
  max-width: 90%;
  height: 9px;
  border-radius: 999px;
  background: rgba(15, 36, 25, 0.12);
  margin: 0 auto 14px;
  overflow: hidden;
}

.splash-loader-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f97316, #fbbf24, #10b981);
  animation: splashProgress 4s linear forwards;
}

.splash-countdown-label {
  font-size: 12px;
  font-weight: 600;
  color: #065f46;
  margin-bottom: 16px;
  letter-spacing: 0.04em;
}

@keyframes splashProgress {
  to { width: 100%; }
}

/* ============================================================================
   TOP GLASS HEADER + NAVIGATION TABS + DATE/TIME + PROFILE CIRCLE
   ============================================================================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 400;
  background: var(--glass-core);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  border-bottom: 1px solid var(--glass-outer-border);
  padding: 10px 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-crest {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(16, 185, 129, 0.2));
  border: 1px solid rgba(245, 196, 81, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-text h1 {
  font-family: 'Playfair Display', 'Inter', serif;
  font-size: 19px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.brand-text .subtitle {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-gold);
  letter-spacing: 0.3px;
}

.main-nav-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
}

.nav-tab-pill {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  padding: 8px 18px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s ease;
}

.nav-tab-pill:hover {
  color: var(--text-main);
  background: var(--glass-hover);
}

.nav-tab-pill.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.88), rgba(5, 150, 105, 0.95));
  color: #ffffff;
  border-color: rgba(253, 230, 138, 0.55);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pills-cluster {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.live-datetime-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 196, 81, 0.32);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}

/* PROFILE CIRCLE TOP-RIGHT & ICON POPOVER */
.profile-anchor {
  position: relative;
}

.profile-circle-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--accent-gold);
  background: linear-gradient(135deg, #10b981, #047857);
  color: #ffffff;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0;
  overflow: visible;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
  transition: transform 0.2s ease;
}

.profile-circle-btn:hover {
  transform: scale(1.06);
}

.profile-circle-img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
}

.profile-circle-emoji {
  font-size: 20px;
}

.profile-online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #06150f;
}

.profile-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 280px;
  background: var(--glass-elevated);
  border: 1px solid var(--glass-outer-border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow-glass);
  backdrop-filter: blur(24px);
  z-index: 1200;
}

.profile-popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--glass-border);
}

.user-role-tag {
  display: block;
  font-size: 11px;
  color: var(--accent-gold);
  font-weight: 600;
}

.profile-popover-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin: 10px 0 6px;
}

.profile-icon-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.icon-choice-btn {
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: all 0.15s ease;
}

.icon-choice-btn:hover {
  border-color: var(--accent-gold);
  transform: translateY(-2px);
}

.icon-choice-btn img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.companion-mini-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

/* ============================================================================
   BUTTONS, INPUTS & BADGES
   ============================================================================ */
.main-container {
  flex: 1;
  padding: 20px 24px 60px;
  max-width: 1620px;
  width: 100%;
  margin: 0 auto;
}

.btn {
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.18s ease;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-gold {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #111827;
  font-weight: 700;
  border-color: rgba(253, 230, 138, 0.65);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.28);
}
.btn-gold:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-emerald-glow {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-weight: 700;
  border-color: rgba(167, 243, 208, 0.5);
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.35);
}
.btn-emerald-glow:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-glass, .btn-outline, .btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--glass-border);
  color: var(--text-main);
}
.btn-glass:hover:not(:disabled), .btn-outline:hover:not(:disabled) {
  background: var(--glass-hover);
  border-color: var(--accent-emerald);
}

.btn-primary {
  background: var(--accent-emerald);
  color: #ffffff;
}

.btn-success {
  background: #16a34a;
  color: #ffffff;
}

.btn-danger-soft {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.btn-xs { padding: 4px 10px; font-size: 11.5px; border-radius: 8px; }
.btn-sm { padding: 7px 13px; font-size: 12.5px; border-radius: 9px; }
.btn-md { padding: 10px 16px; font-size: 13.5px; }
.btn-lg { padding: 12px 22px; font-size: 14.5px; border-radius: 12px; }
.btn-block { width: 100%; }

.input, .select, .input-glass, .select-glass {
  width: 100%;
  padding: 9px 13px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: var(--input-bg);
  color: var(--text-main);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input:focus, .select:focus, .input-glass:focus, .select-glass:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.16);
}

.input-sm { padding: 6px 10px; font-size: 12.5px; width: auto; }
.select-compact { width: auto; min-width: 240px; padding: 6px 12px; font-size: 13px; font-weight: 600; }

.text-muted { color: var(--text-muted); font-size: 13px; }
.small { font-size: 12px; }

.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.badge-green { background: rgba(34, 197, 94, 0.18); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.35); }
.badge-blue { background: rgba(56, 189, 248, 0.18); color: #7dd3fc; border: 1px solid rgba(56, 189, 248, 0.35); }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.badge-orange { background: rgba(249, 115, 22, 0.2); color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.4); }
.badge-info, .badge-secondary { background: rgba(148, 163, 184, 0.16); color: var(--text-muted); border: 1px solid var(--glass-border); }

body.theme-daylight-market .badge-green { background: #dcfce7; color: #166534; border-color: #86efac; }
body.theme-daylight-market .badge-blue { background: #e0f2fe; color: #0369a1; border-color: #7dd3fc; }
body.theme-daylight-market .badge-warning { background: #fef3c7; color: #92400e; border-color: #fcd34d; }

.close-btn {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
}

/* ============================================================================
   1. LOGIN SCREEN (SPLASH + PEDESTAL CHARACTERS + OPERATOR/ADMIN PORTAL)
   ============================================================================ */
.login-hero-shell {
  max-width: 1120px;
  margin: 18px auto 0;
}

.login-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 28px;
  padding: 28px;
  align-items: center;
}

.hero-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--accent-gold);
  margin-bottom: 8px;
}

.hero-brand-title {
  font-family: 'Playfair Display', 'Inter', serif;
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 10px;
  color: var(--text-main);
}

.hero-brand-desc {
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 14px;
}

.hero-engine-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.4);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-emerald-bright);
  margin-bottom: 18px;
}

.pulsing-dot-green {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
}

.login-characters-stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.character-pedestal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: all 0.25s ease;
}

.character-pedestal-card:hover,
.character-pedestal-card.active-companion {
  border-color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.10);
  transform: translateY(-4px);
}

.pedestal-char-img {
  height: 168px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.45));
  z-index: 2;
}

.pedestal-base {
  width: 84%;
  height: 14px;
  margin-top: -8px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(52, 211, 153, 0.38), rgba(245, 158, 11, 0.08) 70%);
  border: 1px solid rgba(253, 230, 138, 0.35);
}

.pedestal-tag {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.login-form-panel {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 24px;
}

.login-form-panel h3 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
}

.quick-profiles-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.quick-profile-tile {
  border: 1.5px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 10px 6px;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.quick-profile-tile:hover,
.quick-profile-tile.active {
  border-color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.14);
}

.qp-thumb {
  width: 42px;
  height: 48px;
  object-fit: contain;
}

.qp-crown {
  height: 48px;
  display: flex;
  align-items: center;
  font-size: 30px;
}

.quick-profile-tile strong { font-size: 13px; }
.quick-profile-tile span { font-size: 10.5px; color: var(--text-muted); }

.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.login-selectors-row {
  display: flex;
  gap: 10px;
}

/* ============================================================================
   TAB 1: HOME DASHBOARD (5 KPI CARDS + ADMIN-ONLY 5th CARD + HISTORY TABLE)
   ============================================================================ */
.home-welcome-strip {
  margin-bottom: 18px;
}

.home-strip-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.section-heading {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 2px;
}

.home-quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.kpi-bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.kpi-core {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
}

.kpi-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-grocery-badge {
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
}

.kpi-value {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.text-gold {
  color: var(--accent-gold-bright) !important;
}

.kpi-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

.kpi-admin-card {
  border-color: rgba(245, 196, 81, 0.55) !important;
  box-shadow: 0 12px 34px rgba(245, 158, 11, 0.18);
}

.admin-crown-pill {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  color: #111827;
}

.panel-header-glass {
  padding: 16px 20px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-header-glass h3 {
  font-size: 16px;
  font-weight: 800;
}

.history-controls-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.date-filter-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  padding: 4px 8px;
  border-radius: 10px;
}

.filter-lbl {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent-gold);
}

.date-filter-group input[type="date"] {
  width: 128px;
  padding: 4px 6px;
  font-size: 12px;
}

.history-controls-bar select {
  width: auto;
  min-width: 160px;
  padding: 6px 10px;
  font-size: 12px;
}

.table-container-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table.glass-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table.glass-table th {
  background: var(--table-head-bg);
  color: var(--text-muted);
  padding: 11px 14px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
}

.data-table.glass-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--glass-border);
  vertical-align: middle;
  color: var(--text-main);
}

.data-table.glass-table tbody tr:hover {
  background: var(--table-row-hover);
}

.grn-proof-chip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: var(--accent-emerald-bright);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.operator-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.operator-mini-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #111827;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================================
   TAB 2: PURCHASE TAB — SEARCH BAR + 3D FLOATING STORE TILES + OCR WORKSTATION
   ============================================================================ */
.store-tiles-section {
  margin-bottom: 16px;
}

.store-search-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.floating-search-wrap {
  position: relative;
  min-width: min(100%, 360px);
}

.search-glass-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  pointer-events: none;
}

.search-wide {
  padding-left: 36px !important;
}

.floating-store-tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 12px;
}

.floating-store-tile {
  position: relative;
  text-align: left;
  padding: 13px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.floating-store-tile:hover {
  transform: translateY(-5px);
  border-color: var(--accent-gold);
  box-shadow: 0 14px 28px rgba(245, 158, 11, 0.18);
  background: rgba(245, 158, 11, 0.10);
}

.floating-store-tile.active {
  transform: translateY(-4px);
  border: 1.5px solid var(--accent-emerald-bright);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.24), rgba(5, 150, 105, 0.12));
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.28);
}

.tile-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tile-awning-icon { font-size: 20px; }

.tile-code-pill {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.16);
  color: var(--accent-gold-bright);
}

.tile-shop-name {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.25;
}

.tile-shop-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.store-bar-glass {
  margin-bottom: 16px;
}

.store-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 18px;
}

.store-select-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.active-store-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
  flex-shrink: 0;
}

.store-bar-kicker {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-emerald-bright);
}

.active-store-name {
  font-size: 15px;
  font-weight: 800;
}

.store-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.indicator-green { color: #22c55e; }

.drawer-glass {
  background: var(--glass-core);
  border: 1px dashed var(--accent-gold);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
  backdrop-filter: blur(18px);
}
.drawer-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.drawer-desc { font-size: 12.5px; color: var(--text-muted); margin-bottom: 12px; }

.workstation-grid {
  display: grid;
  grid-template-columns: 375px 1fr;
  gap: 18px;
  align-items: stretch;
}

.upload-dropzone {
  margin: 16px 18px 12px;
  padding: 26px 14px;
  border: 2px dashed rgba(245, 196, 81, 0.45);
  border-radius: 14px;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  transition: all 0.2s ease;
}

.upload-dropzone:hover {
  border-color: var(--accent-emerald-bright);
  background: rgba(16, 185, 129, 0.10);
}

.upload-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 6px;
}

.mobile-upload-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.mobile-upload-actions .btn { flex: 1; }

.test-bills-section {
  margin: 14px 18px 18px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
}

.test-bill-btn {
  justify-content: space-between;
  text-align: left;
  width: 100%;
}

.bill-preview-box { padding: 10px 18px; }
.bill-preview-box img {
  width: 100%;
  max-height: 290px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  margin-top: 6px;
}

.empty-state-glass {
  padding: 64px 20px;
  text-align: center;
  margin: auto 0;
}
.empty-groceries-icon { font-size: 40px; margin-bottom: 10px; }

/* VERIFIED GRN PROOF STAMP & CHIKPUK AUTOMATION ENGINE STEPPER */
.grn-proof-banner {
  margin: 14px 18px 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.24), rgba(245, 158, 11, 0.12));
  border: 1.5px solid rgba(52, 211, 153, 0.6);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.grn-proof-seal {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #10b981;
  color: #ffffff;
  font-size: 20px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.grn-proof-details { flex: 1; }
.grn-proof-title { font-size: 14px; font-weight: 800; color: var(--accent-emerald-bright); }
.grn-proof-meta { font-size: 12px; color: var(--text-main); margin-top: 2px; }

.automation-banner-glass {
  margin: 14px 18px 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(2, 132, 199, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.4);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auto-stepper-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.auto-step {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
}

.auto-step span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
}

.auto-step.active {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}
.auto-step.active span { background: var(--accent-blue); color: #0f172a; }
.auto-step.done {
  border-color: var(--accent-emerald);
  color: var(--accent-emerald-bright);
  background: rgba(16, 185, 129, 0.14);
}
.auto-step.done span { background: #10b981; color: #ffffff; }

.auto-progress-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.auto-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981, #38bdf8);
  transition: width 0.35s ease;
}

.auto-log-box {
  max-height: 68px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 6px 10px;
  white-space: pre-wrap;
}

.bill-header-meta-glass {
  margin: 12px 18px 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
}

.meta-inputs-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.meta-inputs-wrap label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.bill-color-legend-glass {
  margin: 10px 18px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.legend-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
}
.legend-chip.blue { background: rgba(59, 130, 246, 0.18); color: #93c5fd; border-color: rgba(59, 130, 246, 0.4); }
.legend-chip.red { background: rgba(239, 68, 68, 0.18); color: #fca5a5; border-color: rgba(239, 68, 68, 0.4); }
.legend-chip.yellow { background: rgba(245, 158, 11, 0.18); color: #fde68a; border-color: rgba(245, 158, 11, 0.4); }
.legend-chip.green { background: rgba(34, 197, 94, 0.18); color: #86efac; border-color: rgba(34, 197, 94, 0.4); }

.glass-footer-bar {
  padding: 14px 18px;
  border-top: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: auto;
}

.financial-summary-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12.5px;
}

.grand-total-pill, .updated-total-pill, .due-deduction-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.05);
}

.updated-total-pill {
  border-color: rgba(34, 197, 94, 0.55);
  background: rgba(34, 197, 94, 0.14);
}
.updated-total-pill strong { color: #4ade80; font-size: 18px; }

.due-deduction-pill {
  border-color: rgba(239, 68, 68, 0.55);
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
}

.table-actions-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.submit-direct-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
}

.submit-direct-check input {
  accent-color: var(--accent-emerald);
  width: 15px;
  height: 15px;
}

/* ============================================================================
   TAB 3: INVENTORY PAGE (TEXT-ONLY PRODUCT NAMES — ZERO IMAGES)
   ============================================================================ */
.inventory-filter-section {
  padding: 14px 20px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.inv-store-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.inv-store-pill {
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  padding: 6px 13px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.inv-store-pill:hover {
  border-color: var(--accent-gold);
  color: var(--text-main);
}

.inv-store-pill.active {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #111827;
  font-weight: 700;
  border-color: transparent;
}

.inv-search-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.inv-search-row select {
  width: auto;
  min-width: 210px;
}

.inv-pagination-bar {
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--glass-border);
}

/* ============================================================================
   CORNER APPRECIATION POP-UP (USES EXACT girl_clean.png & boy_clean.png)
   ============================================================================ */
.corner-cheer-popup {
  position: fixed;
  bottom: 16px;
  z-index: 10050;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  pointer-events: auto;
  animation: cheerPopSlide 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.corner-cheer-popup.corner-left {
  left: 18px;
  flex-direction: row-reverse;
}

.corner-cheer-popup.corner-right {
  right: 18px;
  flex-direction: row;
}

@keyframes cheerPopSlide {
  0% { opacity: 0; transform: translateY(45px) scale(0.88); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes cheerGoldPulse {
  0%, 100% { box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65), 0 0 18px rgba(245, 196, 81, 0.35); }
  50% { box-shadow: 0 22px 54px rgba(0, 0, 0, 0.7), 0 0 32px rgba(245, 196, 81, 0.65); }
}

.cheer-character-img {
  height: 195px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.6));
  flex-shrink: 0;
}

.cheer-bubble-glass {
  position: relative;
  max-width: 295px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(8, 28, 21, 0.96);
  border: 1.5px solid rgba(245, 196, 81, 0.78);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65), 0 0 24px rgba(245, 196, 81, 0.42);
  animation: cheerGoldPulse 2.4s ease-in-out infinite;
  backdrop-filter: blur(20px);
  color: #f8fafc;
  margin-bottom: 34px;
}

.cheer-close-btn {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
}

.cheer-milestone-pill {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  color: #111827;
  margin-bottom: 6px;
}

.cheer-bubble-glass h4 {
  font-size: 18px;
  font-weight: 800;
  color: #34d399;
  margin-bottom: 4px;
}

.cheer-bubble-glass p {
  font-size: 12.5px;
  line-height: 1.4;
  color: #e2e8f0;
  margin-bottom: 8px;
}

.cheer-proof-mini {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.14);
  padding: 4px 8px;
  border-radius: 6px;
}

.cheer-grocery-burst {
  position: absolute;
  inset: -16px;
  pointer-events: none;
}

.cg-item {
  position: absolute;
  font-size: 20px;
  animation: floatGrocery 2.6s ease-in-out infinite;
}
.cg-1 { top: 4px; left: 10%; animation-delay: 0s; }
.cg-2 { top: -10px; right: 20%; animation-delay: 0.3s; }
.cg-3 { top: 38%; right: -6px; animation-delay: 0.6s; }
.cg-4 { bottom: 32%; left: -8px; animation-delay: 0.9s; }
.cg-5 { top: 18%; left: 45%; animation-delay: 1.2s; }

@keyframes floatGrocery {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-8px) rotate(8deg); }
}

/* ============================================================================
   PRESERVED MULTI-PAGE, PICKER, EXPORT & TABLE ROW STATES
   ============================================================================ */
.multi-page-section {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px;
  margin: 14px 18px 0;
}
.multi-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--glass-border);
}
.pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
  gap: 10px;
  max-height: 240px;
  overflow-y: auto;
}
.page-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1.5px solid var(--glass-border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.page-card-header { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px; font-size: 10px; }
.page-card-badge { background: var(--accent-emerald); color: #fff; padding: 2px 6px; border-radius: 4px; font-weight: 700; }
.page-card-remove { background: none; border: none; color: #f87171; cursor: pointer; font-weight: 700; }
.page-card-thumb { width: 100%; height: 95px; object-fit: cover; cursor: zoom-in; }
.page-card-footer { padding: 4px 6px; font-size: 10px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-add-card {
  border: 1.5px dashed var(--glass-border);
  border-radius: 8px;
  min-height: 115px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 11px;
}

.bill-view-tabs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  border-bottom: 1px solid var(--glass-border);
  flex-wrap: wrap;
  gap: 8px;
}
.view-tabs-left { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.view-tab {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--glass-border);
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.view-tab.active { background: var(--accent-emerald); color: #fff; border-color: transparent; }

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--glass-border);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-box { padding: 24px 18px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }

.dropdown-container { position: relative; display: inline-block; }
.export-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 260px;
  background: var(--glass-elevated);
  border: 1px solid var(--glass-outer-border);
  border-radius: 12px;
  box-shadow: var(--shadow-glass);
  padding: 6px;
  z-index: 1500;
}
.export-dropdown-menu.export-dropdown-up { top: auto; bottom: calc(100% + 8px); right: auto; left: 0; }
.export-menu-header { font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); padding: 6px 8px; border-bottom: 1px solid var(--glass-border); margin-bottom: 4px; }
.export-menu-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 8px;
  border-radius: 8px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.export-menu-item:hover { background: var(--glass-hover); }
.export-menu-item strong { display: block; font-size: 12.5px; }
.export-menu-item small { display: block; font-size: 10.5px; color: var(--text-muted); }

/* MODALS */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 12, 9, 0.72);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6000;
}
.modal-box.glass-modal {
  background: var(--glass-elevated);
  border: 1px solid var(--glass-outer-border);
  color: var(--text-main);
  padding: 26px;
  border-radius: 20px;
  max-width: 480px;
  width: 92%;
  text-align: center;
  box-shadow: var(--shadow-glass);
}
.modal-icon { font-size: 44px; margin-bottom: 8px; }
.modal-highlight {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.4);
  padding: 12px;
  border-radius: 10px;
  margin: 14px 0;
}
.modal-highlight strong { font-family: 'JetBrains Mono', monospace; color: var(--accent-emerald-bright); }
.glass-mini-stat {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}
.glass-mini-stat div { font-size: 11px; color: var(--text-muted); }
.glass-mini-stat strong { font-size: 20px; color: var(--accent-gold-bright); }

.image-modal-box { max-width: 90vw !important; width: 840px; max-height: 90vh; display: flex; flex-direction: column; }
.image-modal-content { overflow: auto; max-height: 74vh; display: flex; justify-content: center; background: #040d0a; border-radius: 8px; padding: 8px; }
.image-modal-content img { max-width: 100%; height: auto; object-fit: contain; }

.picker-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--glass-border);
  cursor: pointer;
}
.picker-item:hover { background: var(--glass-hover); }
.picker-item-name { font-weight: 700; font-size: 13px; color: var(--text-main); }
.picker-item-meta { font-size: 11px; color: var(--text-muted); }
.picker-item-price { font-weight: 800; color: var(--accent-emerald-bright); }

.sku-name { font-weight: 700; font-size: 12.5px; color: var(--text-main); }
.sku-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.suggestion-box { background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.4); border-radius: 8px; padding: 8px; }
.new-prod-box { background: rgba(249, 115, 22, 0.12); border: 1px solid rgba(249, 115, 22, 0.4); border-radius: 8px; padding: 8px; }
.row-due-full { background-color: rgba(239, 68, 68, 0.10) !important; border-left: 3px solid #ef4444; }
.row-due-partial { background-color: rgba(245, 158, 11, 0.10) !important; border-left: 3px solid #f59e0b; }
.row-free { background-color: rgba(59, 130, 246, 0.10) !important; border-left: 3px solid #3b82f6; }
.sno-due-circle { display: inline-flex; width: 22px; height: 22px; border: 2px solid #ef4444; border-radius: 50%; align-items: center; justify-content: center; font-weight: 800; color: #f87171; }
.badge-due { background: #dc2626; color: #fff; padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 800; cursor: pointer; }
.badge-due-partial { background: #d97706; }
.badge-due-counter { background: #dc2626; color: #fff; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }

.alert { padding: 10px 12px; border-radius: 8px; font-size: 12.5px; border: 1px solid var(--glass-border); margin-top: 8px; }
.alert-success { background: rgba(34, 197, 94, 0.18); border-color: rgba(34, 197, 94, 0.45); color: #86efac; }
.alert-danger { background: rgba(239, 68, 68, 0.18); border-color: rgba(239, 68, 68, 0.45); color: #fca5a5; }

/* ============================================================================
   RESPONSIVE PHONE & TABLET LAYOUT (<= 920px)
   ============================================================================ */
@media (max-width: 920px) {
  .app-header {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 14px;
    gap: 10px;
  }

  .main-nav-tabs {
    width: 100%;
    justify-content: space-between;
  }
  .nav-tab-pill { flex: 1; justify-content: center; padding: 7px 8px; font-size: 12px; }

  .header-right {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .status-pills-cluster { order: 3; width: 100%; justify-content: flex-start; }

  .main-container { padding: 12px; }

  .login-grid {
    grid-template-columns: 1fr;
    padding: 16px;
  }
  .pedestal-char-img { height: 120px; }

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

  .floating-store-tiles-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

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

  .cheer-character-img { height: 135px; }
  .cheer-bubble-glass { max-width: 215px; padding: 10px 12px; margin-bottom: 16px; }
}

/* ==============================================================================
   3D HARDCOVER PURCHASE LEDGER BOOK (ENTERED INVOICES KPI)
   ============================================================================== */

.book-search-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.book-chapter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.book-chapter-pill {
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.book-chapter-pill:hover {
  border-color: var(--accent-gold);
  transform: translateY(-1px);
}
.book-chapter-pill.active {
  background: linear-gradient(135deg, #065f46, #047857);
  color: #fef3c7;
  border-color: #f59e0b;
  box-shadow: 0 3px 10px rgba(4, 120, 87, 0.3);
}

.ledger-book-viewport {
  perspective: 2200px;
  margin: 6px 0 14px 0;
}

.ledger-book-shell {
  position: relative;
  transform-style: preserve-3d;
  border-radius: 16px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #0c2b1f 0%, #113a2a 50%, #092117 100%);
  border: 2px solid rgba(217, 119, 6, 0.65);
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.38),
    inset 0 0 0 1px rgba(253, 230, 138, 0.25);
}

.ledger-book-cover {
  position: absolute;
  inset: 10px 14px;
  z-index: 40;
  border-radius: 10px;
  background: linear-gradient(145deg, #0b291e 0%, #061811 100%);
  border: 2px solid #d97706;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: left center;
  backface-visibility: hidden;
  pointer-events: none;
  box-shadow: 12px 12px 35px rgba(0, 0, 0, 0.55);
}

.ledger-book-cover.is-opening {
  animation: bookCoverSwingOpen 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.ledger-book-cover.is-opened {
  display: none;
}

@keyframes bookCoverSwingOpen {
  0% {
    transform: rotateY(0deg);
    opacity: 1;
  }
  75% {
    transform: rotateY(-128deg);
    opacity: 0.92;
  }
  100% {
    transform: rotateY(-165deg);
    opacity: 0;
  }
}

.cover-gold-frame {
  border: 2px double rgba(245, 158, 11, 0.7);
  border-radius: 12px;
  padding: 28px 44px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: radial-gradient(circle at center, rgba(245, 158, 11, 0.08), transparent 70%);
}
.cover-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #fde68a;
}
.cover-subtitle {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #a7f3d0;
}
.cover-hint {
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f59e0b;
}

.ledger-book-spread {
  position: relative;
  display: grid;
  grid-template-columns: 27% 10px 1fr;
  min-height: 470px;
  border-radius: 8px;
  background: #fdfaf2;
  color: #1a2820;
  box-shadow:
    -5px 0 0 #e9e2cf,
    -9px 0 0 #d9d0b8,
    5px 0 0 #e9e2cf,
    9px 0 0 #d9d0b8,
    0 10px 28px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  transform-style: preserve-3d;
}

.book-page {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: #fdfaf2;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 21px,
    rgba(16, 85, 58, 0.05) 22px
  );
  color: #1a2820;
}

.book-page-left {
  background-image:
    linear-gradient(to left, rgba(0, 0, 0, 0.09) 0%, transparent 18px),
    repeating-linear-gradient(to bottom, transparent, transparent 31px, rgba(16, 85, 58, 0.05) 32px);
  border-right: 1px solid rgba(180, 165, 130, 0.45);
}

.book-page-right {
  background-image:
    linear-gradient(to right, rgba(0, 0, 0, 0.08) 0%, transparent 20px),
    repeating-linear-gradient(to bottom, transparent, transparent 31px, rgba(16, 85, 58, 0.05) 32px);
}

.book-center-spine {
  background: linear-gradient(
    90deg,
    #d5ccb4 0%,
    #a89d82 32%,
    #574e3b 50%,
    #a89d82 68%,
    #dfd7c2 100%
  );
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.35);
}

.book-turn-leaf {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  left: 32%;
  z-index: 30;
  background: linear-gradient(90deg, #ede5cf 0%, #fdfaf2 20%, #f5eedc 100%);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.28);
  transform-origin: left center;
  backface-visibility: hidden;
  pointer-events: none;
}

.book-turn-leaf.flipping-rtl {
  animation: bookPageFlipRtl 0.52s cubic-bezier(0.32, 0.72, 0.32, 1) forwards;
}

.book-turn-leaf.flipping-ltr {
  animation: bookPageFlipLtr 0.52s cubic-bezier(0.32, 0.72, 0.32, 1) forwards;
}

@keyframes bookPageFlipRtl {
  0% { transform: rotateY(0deg); opacity: 0.96; }
  50% { transform: rotateY(-90deg); opacity: 0.85; }
  100% { transform: rotateY(-175deg); opacity: 0; }
}

@keyframes bookPageFlipLtr {
  0% { transform: rotateY(-175deg); opacity: 0.92; }
  50% { transform: rotateY(-90deg); opacity: 0.95; }
  100% { transform: rotateY(0deg); opacity: 0; }
}

.book-ledger-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  line-height: 1.15;
  color: #18261e;
}
.book-ledger-table th {
  text-align: left;
  padding: 4px 5px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #065f46;
  border-top: 2px solid #065f46;
  border-bottom: 2px solid #065f46;
  background: rgba(16, 185, 129, 0.08);
  white-space: nowrap;
}
.book-ledger-table td {
  padding: 2.5px 5px;
  border-bottom: 1px solid rgba(16, 85, 58, 0.12);
  vertical-align: middle;
  white-space: nowrap;
}
.book-prod-cell {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.book-ledger-table tr:hover td {
  background: rgba(245, 158, 11, 0.08);
}

.book-turn-leaf {
  left: 28%;
}

.book-meta-card {
  background: rgba(6, 95, 70, 0.06);
  border: 1px solid rgba(6, 95, 70, 0.22);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.book-page-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed rgba(100, 90, 65, 0.35);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #5c5340;
}

.book-turn-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

@media (max-width: 960px) {
  .ledger-book-spread {
    grid-template-columns: 1fr;
  }
  .book-center-spine {
    height: 10px;
    width: 100%;
  }
  .book-page-left {
    border-right: none;
    border-bottom: 1px solid rgba(180, 165, 130, 0.45);
  }
}
