/* ============================================================
   TIFFIN DIARY — Spotify-Inspired Design System
   DESIGN.md: Dark immersive surfaces, Spotify Green accent,
   pill geometry, Inter font, heavy elevation shadows.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {
  /* Backgrounds — depth through shade */
  --bg-base:    #121212;   /* deepest layer */
  --bg-surface: #181818;   /* cards, sidebar, containers */
  --bg-mid:     #1f1f1f;   /* interactive surfaces, buttons */
  --bg-card:    #252525;   /* elevated card surface */
  --bg-card-alt:#272727;   /* alternate card surface */

  /* Accent */
  --green:      #1ed760;   /* Spotify Green — CTAs, active, play */
  --green-dark: #1db954;   /* border/hover variant */

  /* Text */
  --text-base:  #ffffff;   /* primary text */
  --text-muted: #b3b3b3;   /* secondary / inactive */
  --text-light: #cbcbcb;   /* slightly brighter secondary */

  /* Semantic */
  --text-error:   #f3727f;
  --text-warning: #ffa42b;
  --text-info:    #539df5;

  /* Meal accents (kept from original for meal-type identity) */
  --lunch:      #D4A017;   /* amber gold — lunch dots */
  --lunch-soft: rgba(212,160,23,0.15);
  --dinner:     #1ed760;   /* Spotify Green — dinner aligns with brand */
  --dinner-soft:rgba(30,215,96,0.12);

  /* Borders */
  --border:     #4d4d4d;
  --border-light:#7c7c7c;

  /* Shadows — heavy for dark theme */
  --shadow-card:   rgba(0,0,0,0.3) 0px 8px 8px;
  --shadow-dialog: rgba(0,0,0,0.5) 0px 8px 24px;
  --shadow-inset:  rgb(18,18,18) 0px 1px 0px, rgb(124,124,124) 0px 0px 0px 1px inset;

  /* Geometry */
  --radius-sm:   4px;
  --radius:      8px;
  --radius-lg:   12px;
  --radius-pill: 9999px;
  --radius-btn:  500px;
  --radius-circle:50%;
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg-base);
  color: var(--text-base);
  font-family: 'Inter', 'Helvetica Neue', helvetica, arial, sans-serif;
  font-size: 14px;
  line-height: normal;
  min-height: 100vh;
  padding-bottom: 40px;
  -webkit-font-smoothing: antialiased;
}

input, button, textarea, select {
  font-family: inherit;
}

/* ============================================================
   3. LAYOUT
   ============================================================ */
.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 18px 16px 0;
}

/* ============================================================
   4. HEADER
   ============================================================ */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

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

.brand h1 {
  font-size: 18px;
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-base);
}

.brand span {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Circular icon buttons */
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-circle);
  border: 1px solid var(--border);
  background: var(--bg-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
  color: var(--text-muted);
}

.icon-btn:hover {
  background: var(--bg-card);
  border-color: var(--border-light);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* User avatar — circular */
.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-circle);
  border: 1px solid var(--green-dark);
  background: var(--bg-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  overflow: hidden;
  transition: border-color 0.15s;
}

.user-avatar:hover {
  border-color: var(--green);
}

.user-avatar-initials {
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ============================================================
   5. HERO CARD
   ============================================================ */
.hero-card {
  background: var(--bg-surface);
  color: var(--text-base);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(255,255,255,0.04);
}

.mlabel {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.4px;
  font-weight: 600;
}

.hero-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 8px;
}

.hero-amt {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-base);
  letter-spacing: -0.02em;
}

.hero-count {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 400;
}

/* Month navigation */
.month-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.month-nav button {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-circle);
  border: 1px solid var(--border);
  background: var(--bg-mid);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background 0.15s, color 0.15s;
}

.month-nav button:hover {
  background: var(--bg-card);
  color: var(--text-base);
}

.month-nav .mname {
  font-size: 12px;
  min-width: 64px;
  text-align: center;
  color: var(--text-base);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Decorative shape */
.dabba-deco {
  position: absolute;
  right: -10px;
  bottom: -14px;
  opacity: 0.06;
}

/* Export button — dark pill */
.export-btn {
  margin-top: 16px;
  width: 100%;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-mid);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.export-btn:hover {
  background: var(--bg-card);
  color: var(--text-base);
  border-color: var(--border-light);
}

.export-btn svg {
  width: 14px;
  height: 14px;
}

/* ============================================================
   6. TODAY ADD — STEPPER CARD
   ============================================================ */
.today-add {
  background: var(--bg-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid rgba(255,255,255,0.04);
}

.today-add .ta-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.4px;
  margin-bottom: 12px;
  padding-left: 2px;
}

.stepper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px;
}

.stepper-row + .stepper-row {
  border-top: 1px solid rgba(255,255,255,0.06);
}

.sr-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.meal-chip {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-circle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.meal-chip.lunch  { background: var(--lunch-soft); }
.meal-chip.dinner { background: var(--dinner-soft); }

.sr-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-base);
}

.sr-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Stepper controls */
.stepper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.step-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-circle);
  border: 1px solid var(--border);
  cursor: pointer;
  background: var(--bg-mid);
  color: var(--text-muted);
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  transition: background 0.12s, color 0.12s, border-color 0.12s, transform 0.1s;
}

.step-btn:active {
  transform: scale(0.90);
}

.step-btn.minus:hover {
  background: var(--bg-card);
  color: var(--text-base);
  border-color: var(--border-light);
}

/* Plus buttons — Spotify Green accent */
.step-btn.plus.lunch {
  background: var(--lunch);
  color: #000;
  border-color: var(--lunch);
}

.step-btn.plus.dinner {
  background: var(--green);
  color: #000;
  border-color: var(--green);
}

.step-btn.plus.lunch:hover {
  background: #e6b520;
  border-color: #e6b520;
}

.step-btn.plus.dinner:hover {
  background: #1fdf68;
  border-color: #1fdf68;
}

.step-val {
  font-size: 16px;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
  color: var(--text-base);
}

/* ============================================================
   7. HINT TEXT
   ============================================================ */
.hint {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 4px 10px 12px;
  line-height: 1.6;
}

/* ============================================================
   8. BREAKDOWN CHIPS
   ============================================================ */
.breakdown {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.bd-chip {
  flex: 1;
  background: var(--bg-surface);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow-card);
  text-align: center;
  border: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
}

.bd-chip:hover { background: var(--bg-mid); }

.bd-chip .n {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-base);
}

.bd-chip .l {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.4px;
  margin-top: 3px;
  font-weight: 600;
}

/* ============================================================
   9. CALENDAR CARD
   ============================================================ */
.cal-card {
  background: var(--bg-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 16px;
  margin-bottom: 14px;
  border: 1px solid rgba(255,255,255,0.04);
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 8px;
}

.cal-weekdays div {
  text-align: center;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.cal-cell {
  aspect-ratio: 1/1;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  background: transparent;
  transition: background 0.12s;
}

.cal-cell:hover:not(.empty) {
  background: var(--bg-mid);
}

.cal-cell.empty { cursor: default; }

.cal-cell .dnum {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.cal-cell.has-data .dnum {
  color: var(--text-base);
}

.cal-cell.has-data {
  background: var(--bg-mid);
}

/* Today highlight — green ring */
.cal-cell.today {
  box-shadow: inset 0 0 0 1.5px var(--green);
}

.cal-cell.today .dnum {
  color: var(--green);
}

/* Tiffin dots */
.cal-dots {
  display: flex;
  gap: 2px;
  margin-top: 3px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 30px;
}

.cal-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.cal-dot.lunch  { background: var(--lunch); }
.cal-dot.dinner { background: var(--green); }

.cal-more {
  font-size: 8px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Note marker — red dot */
.note-mark {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-error);
}

/* ============================================================
   10. OVERLAYS / BOTTOM SHEETS
   ============================================================ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
  backdrop-filter: blur(4px);
}

.overlay.open { display: flex; }

.sheet {
  background: var(--bg-surface);
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 20px 20px 0 0;
  padding: 24px 20px 32px;
  box-shadow: var(--shadow-dialog);
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* Sheet drag handle */
.sheet::before {
  content: '';
  display: block;
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: var(--radius-pill);
  margin: 0 auto 20px;
}

.sheet h3 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-base);
  letter-spacing: -0.01em;
}

.sheet .sheet-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  font-weight: 400;
}

/* Form fields */
.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: none;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-mid);
  color: var(--text-base);
  box-shadow: var(--shadow-inset);
  resize: vertical;
  transition: box-shadow 0.15s;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  box-shadow: rgb(18,18,18) 0px 1px 0px, var(--green-dark) 0px 0px 0px 1px inset;
}

.field textarea {
  min-height: 72px;
  line-height: 1.5;
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(179,179,179,0.4);
}

/* Sheet action buttons */
.sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.sheet-actions button {
  flex: 1;
  padding: 13px 16px;
  border-radius: var(--radius-pill);
  border: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.1s, opacity 0.15s;
}

.sheet-actions button:active { transform: scale(0.97); }

.sheet-actions button svg {
  width: 15px;
  height: 15px;
}

/* Primary — Spotify Green */
.btn-primary {
  background: var(--green);
  color: #000000;
}

.btn-primary:hover { opacity: 0.9; }

/* Ghost — dark pill */
.btn-ghost {
  background: var(--bg-mid);
  color: var(--text-base);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--bg-card);
  border-color: var(--border-light);
}

/* Danger */
.btn-danger {
  background: rgba(243,114,127,0.12);
  color: var(--text-error);
  border: 1px solid rgba(243,114,127,0.25);
}

.btn-danger:hover {
  background: rgba(243,114,127,0.2);
}

/* Day total row */
.day-total {
  display: flex;
  justify-content: space-between;
  padding-top: 12px;
  margin-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 13px;
  color: var(--text-muted);
}

.day-total b {
  color: var(--green);
  font-size: 15px;
  font-weight: 700;
}

/* Export preview */
.export-preview {
  background: var(--bg-mid);
  border: none;
  box-shadow: var(--shadow-inset);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  font-family: inherit;
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 16px;
  color: var(--text-light);
}

/* ============================================================
   11. SETTINGS SHEET
   ============================================================ */
.settings-user {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--bg-mid);
  border-radius: var(--radius);
  margin-bottom: 20px;
  border: 1px solid rgba(255,255,255,0.06);
}

.settings-user-avatar {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-circle);
  overflow: hidden;
  background: var(--bg-card);
  border: 2px solid var(--green-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--green);
  flex-shrink: 0;
  letter-spacing: 0.05em;
}

.settings-user-info { flex: 1; min-width: 0; }

.settings-user-email {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-base);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   12. SAVE INDICATOR
   ============================================================ */
.save-indicator {
  position: fixed;
  top: 14px;
  right: 14px;
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  z-index: 70;
}

.save-indicator.show { opacity: 1; }

/* ============================================================
   13. TOAST
   ============================================================ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--bg-card);
  color: var(--text-base);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transition: all 0.25s ease;
  pointer-events: none;
  z-index: 60;
  box-shadow: var(--shadow-dialog);
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   14. LOADING SCREEN
   ============================================================ */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}

.loading-screen.hidden { display: none; }

.loading-text {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ============================================================
   15. LOGIN SCREEN — shadcn-inspired two-panel layout
   ============================================================ */
#loginScreen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  background: var(--bg-base);
}

#loginScreen.hidden { display: none; }

/* ---- Left brand panel ---- */
.login-brand-panel {
  display: none; /* hidden on mobile */
  flex: 1;
  background: var(--bg-surface);
  border-right: 1px solid rgba(255,255,255,0.06);
  position: relative;
  overflow: hidden;
}

@media (min-width: 768px) {
  .login-brand-panel { display: flex; align-items: center; justify-content: center; }
}

.lbp-inner {
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  position: relative;
  z-index: 1;
}

/* Brand wordmark in left panel */
.lbp-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-base);
  letter-spacing: -0.01em;
}

/* Decorative dot grid */
.lbp-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

/* Radial fade from center over the dots */
.lbp-dots::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 50%, transparent 30%, var(--bg-surface) 100%);
}

/* Quote block in left panel */
.lbp-quote {
  margin: 0;
  position: relative;
  z-index: 1;
}

.lbp-quote p {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-base);
  line-height: 1.45;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.lbp-quote footer {
  font-size: 13px;
  color: var(--text-muted);
  font-style: normal;
}

/* Opening quote decoration */
.lbp-quote p::before {
  content: '\201C';
  font-size: 60px;
  line-height: 0;
  vertical-align: -24px;
  color: var(--green);
  margin-right: 4px;
  font-weight: 700;
}

/* ---- Right form panel ---- */
.login-form-panel {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
}

@media (min-width: 768px) {
  .login-form-panel {
    width: 420px;
    flex-shrink: 0;
    padding: 40px 48px;
  }
}

.lfp-inner {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Mobile-only logo (hidden on desktop where left panel shows) */
.login-mobile-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-base);
  margin-bottom: 32px;
  letter-spacing: -0.01em;
}

@media (min-width: 768px) {
  .login-mobile-logo { display: none; }
}

/* Heading block */
.lfp-heading { margin-bottom: 24px; }

.login-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-base);
  margin: 0 0 6px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.login-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* Auth error alert — shadcn Alert style */
.auth-error {
  display: none;
  align-items: flex-start;
  gap: 10px;
  background: rgba(243,114,127,0.08);
  color: var(--text-error);
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid rgba(243,114,127,0.2);
  line-height: 1.5;
}

.auth-error svg {
  flex-shrink: 0;
  margin-top: 1px;
  opacity: 0.9;
}

/* Auth form */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}

/* Individual form field — shadcn Field pattern */
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-base);
  letter-spacing: 0.01em;
}

/* Input wrapper — icon + input side by side */
.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}

/* shadcn Input style */
.auth-input {
  width: 100%;
  height: 40px;
  padding: 0 40px 0 36px;  /* left room for icon, right room for toggle */
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-base);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

/* Password field — full left padding */
.auth-input-wrap:not(.pwd-wrapper) .auth-input { padding-right: 14px; }

.auth-input::placeholder { color: rgba(179,179,179,0.35); }

.auth-input:focus {
  border-color: var(--border-light);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.05);
}

/* Password visibility toggle */
.pwd-toggle {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s;
}

.pwd-toggle:hover { color: var(--text-base); }
.pwd-toggle svg { width: 16px; height: 16px; }

/* shadcn-style primary button */
.auth-btn {
  width: 100%;
  height: 40px;
  padding: 0 16px;
  margin-top: 4px;
  background: var(--green);
  color: #000000;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.15s, transform 0.1s;
}

.auth-btn:hover { opacity: 0.92; }
.auth-btn:active { transform: scale(0.99); }
.auth-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.auth-btn-arrow {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.auth-btn:hover .auth-btn-arrow { transform: translateX(3px); }

/* Divider — "or" line */
.auth-divider {
  position: relative;
  display: flex;
  align-items: center;
  margin: 20px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.08);
}

.auth-divider span {
  padding: 0 12px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Toggle sign-in / sign-up */
.auth-toggle {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.auth-toggle a {
  color: var(--text-base);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  cursor: pointer;
  margin-left: 4px;
  transition: color 0.15s;
}

.auth-toggle a:hover { color: var(--green); }

/* Footer micro-text */
.login-footer {
  font-size: 11px;
  color: rgba(179,179,179,0.3);
  text-align: center;
  line-height: 1.6;
  margin: 0;
}

.login-footer a {
  color: rgba(179,179,179,0.45);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
}

.login-footer a:hover { color: var(--text-muted); }


/* ============================================================
   16. SPINNER
   ============================================================ */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.12);
  border-top-color: var(--text-base);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   17. SCROLLBAR — Spotify style
   ============================================================ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ============================================================
   18. RESPONSIVE
   ============================================================ */
@media (max-width: 425px) {
  .login-card { padding: 32px 20px; }
  .hero-amt   { font-size: 28px; }
  .bd-chip .n { font-size: 15px; }
}

/* ============================================================
   19. BALANCE STRIP
   ============================================================ */
.balance-strip {
  background: var(--bg-surface);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin: 0 0 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.balance-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

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

.balance-row--net {
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 2px;
}

.balance-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.balance-paid-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-base);
}

/* carry-forward sub-row */
.balance-carry-row {
  display: flex;
  align-items: center;
}

.balance-carry-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.4;
}

.balance-carry-label.credit { color: var(--green); }
.balance-carry-label.due    { color: var(--text-error); }

.balance-net-val {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.balance-net-val.credit  { color: var(--green); }
.balance-net-val.due     { color: var(--text-error); }
.balance-net-val.settled { color: var(--green); }

/* Tiffin count hint shown inside credit balance */
.balance-tiffin-hint {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  opacity: 0.85;
}

/* Balance strip button group */
.balance-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  flex-shrink: 0;
}

/* Record Payment button */
.record-payment-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  background: rgba(30,215,96,0.1);
  border: 1px solid rgba(30,215,96,0.25);
  border-radius: var(--radius-pill);
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.record-payment-btn:hover {
  background: rgba(30,215,96,0.18);
  border-color: rgba(30,215,96,0.45);
}

.record-payment-btn:active { transform: scale(0.97); }

/* Settle button — amber/warm tone */
.settle-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(255,164,43,0.1);
  border: 1px solid rgba(255,164,43,0.28);
  border-radius: var(--radius-pill);
  color: var(--text-warning);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.settle-btn:hover {
  background: rgba(255,164,43,0.18);
  border-color: rgba(255,164,43,0.5);
}

.settle-btn:active { transform: scale(0.97); }

/* ============================================================
   20. PAYMENT HISTORY (inside payment overlay)
   ============================================================ */
.payment-history {
  margin-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 16px;
}

.ph-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.payment-history-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.payment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  gap: 8px;
}

.payment-row:last-child { border-bottom: none; }

.pr-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.pr-date {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-base);
}

.pr-note {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pr-note--settle {
  color: var(--text-warning);
  font-weight: 600;
}

.pr-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.pr-amt {
  font-size: 14px;
  font-weight: 700;
  color: var(--green);
}

.pr-del {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}

.pr-del:hover {
  color: var(--text-error);
  background: rgba(243,114,127,0.1);
}

.ph-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  margin-top: 4px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.ph-total-row b {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-base);
}

