/* =========================================================
   VIVID CATERING — ADMIN STUDIO STYLES
   Liquid-Glass Hospitality Operations Console
========================================================= */
:root {
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  --brand: #F26B21;
  --brand-warm: #F7941D;
  --brand-green: #0E8A44;
  --brand-red: #D92B2B;
  --brand-glow: rgba(242, 107, 33, 0.25);

  --bg: #F6F3EE;
  --surface: #FFFFFF;
  --surface-2: #FAF7F3;
  --ink: #161412;
  --muted: #5F5851;
  --subtle: #8C847B;
  --border: rgba(22, 20, 18, 0.09);
  --glass-bg: rgba(255, 255, 255, 0.76);
  --glass-border: rgba(255, 255, 255, 0.92);
  --shadow: 0 14px 36px rgba(22, 20, 18, 0.07);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B0A09;
  --surface: #151311;
  --surface-2: #1C1917;
  --ink: #F7F4EF;
  --muted: #B6AEA4;
  --subtle: #857D74;
  --border: rgba(255, 255, 255, 0.09);
  --glass-bg: rgba(24, 21, 19, 0.72);
  --glass-border: rgba(255, 255, 255, 0.14);
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}
h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; letter-spacing: -0.015em; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
input, select, textarea {
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 13px;
  width: 100%;
  outline: none;
  transition: border-color 0.2s ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); }

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(185%);
  -webkit-backdrop-filter: blur(24px) saturate(185%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  border-radius: 22px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 9999px;
  font-size: 0.86rem;
  font-weight: 600;
  transition: transform 0.2s var(--ease), box-shadow 0.2s ease, background-color 0.2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-warm));
  color: #FFFFFF;
  box-shadow: 0 8px 22px var(--brand-glow);
}
.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-danger {
  background: rgba(217, 43, 43, 0.12);
  color: var(--brand-red);
}
.btn-sm { padding: 7px 14px; font-size: 0.8rem; }

/* =========================================================
   PIN LOCK SCREEN
========================================================= */
.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at top right, rgba(242, 107, 33, 0.18), transparent 45%), var(--bg);
}
.lock-screen[hidden] { display: none; }
.lock-card {
  width: 100%;
  max-width: 400px;
  padding: 38px 32px;
  text-align: center;
}
.lock-card img { height: 64px; margin: 0 auto 18px; }
.lock-card h1 { font-size: 2rem; margin-bottom: 6px; }
.lock-card p { font-size: 0.9rem; color: var(--muted); margin-bottom: 24px; }
.pin-input {
  text-align: center;
  font-size: 1.5rem;
  letter-spacing: 0.45em;
  font-weight: 700;
  padding: 14px;
  margin-bottom: 14px;
}
.lock-error {
  color: var(--brand-red);
  font-size: 0.84rem;
  min-height: 20px;
  margin-bottom: 10px;
}
.lock-hint {
  margin-top: 16px;
  font-size: 0.78rem;
  color: var(--subtle);
}

/* =========================================================
   APP SHELL (SIDEBAR + MAIN WORKSPACE)
========================================================= */
.studio {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
}
@media (min-width: 960px) {
  .studio { grid-template-columns: 264px 1fr; }
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: auto;
}
@media (min-width: 960px) {
  .sidebar { height: 100vh; }
}

.sb-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px;
}
.sb-brand img { height: 42px; width: auto; }
.sb-brand .logo-dark { display: none; }
html[data-theme="dark"] .sb-brand .logo-light { display: none; }
html[data-theme="dark"] .sb-brand .logo-dark { display: block; }
.sb-title { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 700; line-height: 1.1; }
.sb-badge { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--brand); font-weight: 700; }

.sb-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
@media (min-width: 960px) {
  .sb-nav { flex-direction: column; flex: 1; }
}
.sb-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.2s ease;
  text-align: left;
}
.sb-btn:hover { background: var(--surface-2); color: var(--ink); }
.sb-btn.active {
  background: linear-gradient(135deg, rgba(242, 107, 33, 0.14), rgba(247, 148, 29, 0.08));
  color: var(--brand);
}
.sb-count {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--border);
}

.sb-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* Main Area */
.workspace {
  padding: 24px clamp(18px, 3vw, 38px) 60px;
  max-width: 1280px;
  width: 100%;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 20px;
  margin-bottom: 28px;
  border-radius: 9999px;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--brand-green);
  background: rgba(14, 138, 68, 0.12);
  padding: 5px 12px;
  border-radius: 999px;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Panels */
.panel { display: none; }
.panel.active { display: block; }
.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.panel-head h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); line-height: 1.1; }
.panel-head p { color: var(--muted); font-size: 0.92rem; margin-top: 4px; }

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 16px;
  margin-bottom: 26px;
}
@media (min-width: 640px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .kpi-grid { grid-template-columns: repeat(4, 1fr); } }
.kpi {
  padding: 22px;
}
.kpi-label { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--subtle); font-weight: 700; }
.kpi-val { font-family: var(--font-serif); font-size: 2.2rem; font-weight: 700; color: var(--brand); margin: 6px 0 4px; line-height: 1.05; }
.kpi-sub { font-size: 0.82rem; color: var(--muted); }

/* 2-Column Split Layouts */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.menu-studio { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start; }
@media (min-width: 960px) { .menu-studio { grid-template-columns: 290px 1fr; } }

.menu-list {
  display: grid;
  gap: 8px;
}
.menu-list-item {
  padding: 13px 16px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: left;
  transition: all 0.2s ease;
}
.menu-list-item:hover { border-color: var(--brand); }
.menu-list-item.active {
  border-color: var(--brand);
  background: linear-gradient(135deg, rgba(242, 107, 33, 0.12), rgba(247, 148, 29, 0.04));
}
.menu-list-item strong { display: block; font-size: 0.94rem; }
.menu-list-item span { font-size: 0.78rem; color: var(--brand); font-weight: 600; }

.editor-card { padding: 26px; display: grid; gap: 18px; }
.form-2 { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 640px) { .form-2 { grid-template-columns: 1fr 1fr; } }
.field label { display: block; font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 6px; }

.sec-box {
  padding: 18px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: grid;
  gap: 10px;
}
.sec-box-head { display: flex; gap: 10px; align-items: center; }
.dish-row { display: flex; gap: 8px; align-items: center; }

/* Table / Inquiries */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--subtle); }
.status-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
}
.st-New { background: rgba(242, 107, 33, 0.16); color: var(--brand); }
.st-Quoted { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.st-Confirmed { background: rgba(14, 138, 68, 0.16); color: var(--brand-green); }
.st-Completed { background: rgba(120, 113, 108, 0.18); color: var(--muted); }

/* Quote Calculator */
.calc-summary {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.calc-total {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--brand);
  line-height: 1.05;
}
.calc-preview {
  white-space: pre-wrap;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  color: var(--ink);
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: 0 14px 36px rgba(0,0,0,0.3);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: all 0.3s var(--ease);
}
.toast.show { opacity: 1; transform: translateY(0); }
