:root {
  --forest: #0e3b2e;
  --forest-deep: #08241c;
  --forest-soft: #165140;
  --ivory: #faf7f2;
  --ivory-card: #ffffff;
  --ivory-muted: #f2ece1;
  --gold: #c9a227;
  --gold-soft: #f5ebd0;
  --ink: #1a2421;
  --muted: #5d6b66;
  --border: #e3dccf;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --warn: #b54708;
  --warn-bg: #fffaeb;
  --ok: #067647;
  --ok-bg: #ecfdf3;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(14, 59, 46, 0.08);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: var(--ivory);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .serif {
  font-family: 'Playfair Display', Georgia, serif;
  margin: 0;
}

.hidden {
  display: none !important;
}

/* Auth Screen */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at top right, #184e3e 0%, var(--forest-deep) 70%);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--ivory-card);
  border-radius: 18px;
  padding: 32px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(201, 162, 39, 0.35);
}

.auth-brand {
  text-align: center;
  margin-bottom: 24px;
}

.auth-brand img {
  height: 58px;
  object-fit: contain;
  margin-bottom: 8px;
}

.auth-brand h1 {
  font-size: 1.55rem;
  color: var(--forest);
}

.auth-tagline {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 4px 0 0;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  background: var(--gold-soft);
  color: #71540a;
}

/* Forms & Buttons */
.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--forest);
  margin-bottom: 5px;
}

.input, .select, .textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 0.92rem;
  background: #fff;
  color: var(--ink);
}

.input:focus, .select:focus, .textarea:focus {
  outline: 2px solid rgba(201, 162, 39, 0.35);
  border-color: var(--gold);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: 0.16s ease;
}

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

.btn-primary {
  background: var(--forest);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--forest-soft);
}

.btn-gold {
  background: var(--gold);
  color: #1c1604;
}

.btn-gold:hover:not(:disabled) {
  filter: brightness(1.06);
}

.btn-outline {
  background: #fff;
  border-color: var(--border);
  color: var(--ink);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--forest);
  color: var(--forest);
}

.btn-wa {
  background: #16a34a;
  color: #fff;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-sm {
  padding: 6px 11px;
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
}

.alert {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.84rem;
  margin-bottom: 14px;
}

.alert-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #fecdca;
}

.alert-ok {
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid #abefc6;
}

.alert-warn {
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid #fedf89;
}

/* App Shell */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--forest);
  color: #fff;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 2px solid var(--gold);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.topbar-left img {
  height: 36px;
  flex-shrink: 0;
  border-radius: 6px;
  background: #fff;
  padding: 2px 6px;
}

.topbar-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-sub {
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.78);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.role-chip {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(201, 162, 39, 0.22);
  color: #f9df8a;
  border: 1px solid rgba(201, 162, 39, 0.5);
}

.desktop-nav {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.nav-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 12px 16px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.nav-tab.is-active {
  color: var(--forest);
  border-bottom-color: var(--gold);
}

.main-wrap {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 18px 88px;
  flex: 1;
}

/* Cards & Grids */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.card {
  background: var(--ivory-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  min-width: 0;
  overflow-wrap: anywhere;
  box-shadow: 0 2px 10px rgba(14, 59, 46, 0.04);
}

.card-hero {
  background: linear-gradient(135deg, var(--forest) 0%, #175240 100%);
  color: #fff;
  border-color: var(--gold);
}

.stat-value {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--forest);
}

.stat-label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* 6-Day Strip */
.day-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.day-pill {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
}

.day-pill.is-active {
  background: var(--forest);
  color: #fff;
  border-color: var(--gold);
}

.day-pill .day-name {
  font-size: 0.74rem;
  opacity: 0.8;
}

.day-pill .day-num {
  font-size: 1.15rem;
  font-weight: 700;
}

.day-pill .day-cnt {
  font-size: 0.72rem;
  margin-top: 2px;
  color: var(--gold);
  font-weight: 700;
}

/* Attention & Status Chips */
.chip {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 700;
}

.chip-enquiry { background: #eff8ff; color: #175cd3; }
.chip-confirmed { background: #ecfdf3; color: #067647; }
.chip-completed { background: #f2f4f7; color: #344054; }
.chip-draft { background: #f2f4f7; color: #475467; }
.chip-sent { background: #fffaeb; color: #b54708; }
.chip-changes_requested { background: #fef3f2; color: #b42318; }
.chip-approved { background: #ecfdf3; color: #067647; }

.attention-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 8px;
  border-left: 4px solid var(--gold);
  background: var(--ivory);
  margin-bottom: 8px;
  cursor: pointer;
}

.attention-item.urg-high { border-left-color: var(--danger); background: #fff6f5; }
.attention-item.urg-medium { border-left-color: var(--warn); background: #fffcf3; }

/* Veg/Non-Veg indicator */
.diet-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 2px;
  border: 1.5px solid #067647;
  position: relative;
  flex-shrink: 0;
}

.diet-dot::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: #067647;
}

.diet-dot.nonveg {
  border-color: #b42318;
}

.diet-dot.nonveg::after {
  background: #b42318;
}

/* Dish rows & Category pills */
.pill-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.filter-pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.filter-pill.is-active {
  background: var(--forest);
  color: #fff;
  border-color: var(--forest);
}

.dish-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 245px), 1fr));
  gap: 10px;
}

.dish-tile {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.dish-tile-names {
  font-size: 0.88rem;
  font-weight: 600;
}

.dish-tile-sub {
  font-size: 0.77rem;
  color: var(--muted);
  margin-top: 2px;
}

/* Calendar Grid */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.cal-head {
  text-align: center;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted);
  padding: 4px;
}

.cal-cell {
  min-height: 76px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  font-size: 0.76rem;
}

.cal-cell.has-events {
  border-color: var(--gold);
  background: #fffdf6;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 36, 28, 0.65);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-box {
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* Menu Card 9 Themes (PRD F5.1) */
.menu-card-preview {
  padding: 28px;
  border-radius: 12px;
  border: 2px solid var(--gold);
  background: #fffdf8;
}

.theme-royal { background: linear-gradient(180deg, #1b0c2e, #2b1345); color: #f8e7b2; border-color: #d4af37; }
.theme-banana { background: #143d24; color: #f4f7e8; border-color: #84b86a; }
.theme-rani { background: #fff0f6; color: #6a0f3b; border-color: #d63384; }
.theme-letterhead { background: #ffffff; color: #1a2421; border: 2px solid #0e3b2e; }
.theme-ivory { background: #faf5eb; color: #362712; border: 3px double #b68c2e; }
.theme-palace { background: #2c1512; color: #fae7c8; border-color: #d9a05b; }
.theme-marigold { background: #fff8e7; color: #5c2a00; border: 2px solid #f59e0b; }
.theme-slate { background: #182026; color: #eef2f6; border-color: #64748b; }
.theme-photogrid { background: #f8faf8; color: #0e3b2e; border-color: #0e3b2e; }

/* Mobile Bottom Nav */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: #fff;
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -4px 16px rgba(14, 59, 46, 0.08);
}

.mobile-bottom-nav button {
  flex: 1 1 0;
  min-width: 0;
  border: none;
  background: none;
  padding: 11px 4px;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-bottom-nav button.is-active {
  color: var(--forest);
  font-weight: 700;
}

.menu-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 16px;
  font-size: 0.88rem;
}

@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .grid-2 { grid-template-columns: 1fr; }
  .day-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .desktop-nav { display: none; }
  .mobile-bottom-nav { display: flex; }
}

@media (max-width: 600px) {
  .auth-card { padding: 22px 18px; }
  .topbar { padding: 10px 12px; }
  .topbar-right { width: 100%; justify-content: space-between; gap: 6px; }
  .main-wrap { padding: 14px 12px 84px; }
  .card { padding: 14px; }
  .grid-4 { grid-template-columns: 1fr; }
  .day-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-value { font-size: 1.45rem; }
  .menu-card-preview { padding: 16px; }
  .menu-card-grid { grid-template-columns: 1fr; }
  .cal-grid { min-width: 540px; }
  .modal-backdrop { padding: 8px; }
  .modal-box { padding: 14px; max-height: 92dvh; }
  .attention-item { flex-direction: column; align-items: flex-start; }
}

@media print {
  .topbar, .desktop-nav, .mobile-bottom-nav, .no-print { display: none !important; }
  body { background: #fff; }
  .modal-backdrop { position: static; background: none; padding: 0; }
  .modal-box { max-height: none; box-shadow: none; padding: 0; }
}

.desk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.desk-table th, .desk-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.desk-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--ivory);
}

.subtab-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.table-scroll {
  overflow-x: auto;
}

