/* ============================================================
   DailyMenu — Design System
   ============================================================ */

:root {
  --bg:           #f8f9fa;
  --bg-card:      #ffffff;
  --bg-hover:     #f1f3f5;
  --border:       #dee2e6;
  --text:         #212529;
  --text-muted:   #6c757d;
  --primary:      #2563eb;
  --primary-dark: #1d4ed8;
  --primary-bg:   #eff6ff;
  --success:      #16a34a;
  --success-bg:   #f0fdf4;
  --danger:       #dc2626;
  --danger-bg:    #fef2f2;
  --warning:      #d97706;
  --warning-bg:   #fffbeb;
  --radius:       10px;
  --radius-sm:    6px;
  --shadow:       0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-lg:    0 10px 25px rgba(0,0,0,.1);
  --font:         'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 1rem;
}

/* ── Layout ──────────────────────────────────────────────── */
.page { min-height: 100vh; display: flex; flex-direction: column; }

.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
.container--narrow { max-width: 480px; }
.container--wide   { max-width: 1300px; }

/* ── Navbar ──────────────────────────────────────────────── */
.navbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: .75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.navbar__logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -.02em;
}

.navbar__nav { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.card--glow { box-shadow: 0 0 0 3px rgba(37,99,235,.1), var(--shadow-lg); }
.card--sm   { padding: 1rem; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .5rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn--success { background: var(--success); color: #fff; }
.btn--success:hover:not(:disabled) { background: #15803d; }
.btn--danger  { background: var(--danger);  color: #fff; }
.btn--danger:hover:not(:disabled)  { background: #b91c1c; }
.btn--ghost   { background: transparent; border-color: var(--border); color: var(--text); }
.btn--ghost:hover:not(:disabled)   { background: var(--bg-hover); }
.btn--secondary { background: var(--bg-hover); border-color: var(--border); color: var(--text); }
.btn--secondary:hover:not(:disabled) { background: var(--border); }
.btn--full { width: 100%; }
.btn--lg   { padding: .7rem 1.4rem; font-size: 1rem; }
.btn--sm   { padding: .3rem .7rem; font-size: .8rem; }

/* ── Forms ───────────────────────────────────────────────── */
.form-group   { margin-bottom: 1.1rem; }
.form-label   { display: block; font-size: .875rem; font-weight: 600; margin-bottom: .35rem; color: var(--text); }
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: .55rem .8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-family: var(--font);
  background: var(--bg-card);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-textarea { resize: vertical; min-height: 80px; }

/* ── Tabs ────────────────────────────────────────────────── */
.tabs { display: flex; gap: .25rem; border-bottom: 2px solid var(--border); margin-bottom: 1.25rem; }
.tab-btn {
  padding: .55rem 1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color .15s, border-color .15s;
}
.tab-btn--active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel--active { display: block; }

/* ── Dashboard tabs ──────────────────────────────────────── */
.dash-tabs { display: flex; gap: .5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.dash-tab {
  padding: .6rem 1.2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all .15s;
}
.dash-tab--active { background: var(--primary); color: #fff; border-color: var(--primary); }
.dash-view { display: block; }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  padding: 1rem;
}
.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.75rem;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal--wide { max-width: 820px; }
.modal__title { font-size: 1.25rem; font-weight: 700; margin-bottom: 1.25rem; }
.modal__actions { display: flex; justify-content: flex-end; gap: .75rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* ── Lang switcher ───────────────────────────────────────── */
.lang-switcher { display: flex; gap: .25rem; }
.lang-switcher__btn {
  padding: .25rem .55rem;
  border-radius: var(--radius-sm);
  font-size: .78rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: all .15s;
}
.lang-switcher__btn--active {
  background: var(--primary-bg);
  color: var(--primary);
  border-color: var(--primary);
}
.lang-switcher__btn:hover:not(.lang-switcher__btn--active) { background: var(--bg-hover); }

/* ── Menu grid ───────────────────────────────────────────── */
.menu-col {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.menu-col__title {
  font-weight: 700;
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  margin-bottom: .75rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--border);
}

/* ── Menu item card ──────────────────────────────────────── */
.menu-item-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .6rem .75rem;
  margin-bottom: .5rem;
  background: var(--bg);
  cursor: pointer;
  transition: all .15s;
  position: relative;
}
.menu-item-card:hover { border-color: var(--primary); background: var(--primary-bg); }
.menu-item-card--selected {
  border-color: var(--primary);
  background: var(--primary-bg);
  box-shadow: 0 0 0 2px rgba(37,99,235,.15);
}
.menu-item-card--selected::after {
  content: '✓';
  position: absolute;
  top: .4rem;
  right: .6rem;
  color: var(--primary);
  font-weight: 700;
}
.menu-item-card__name  { font-weight: 600; font-size: .95rem; }
.menu-item-card__desc  { font-size: .8rem; color: var(--text-muted); margin-top: .2rem; }
.menu-item-card__price { font-size: .85rem; font-weight: 700; color: var(--primary); margin-top: .3rem; }

/* ── Package card ────────────────────────────────────────── */
.pkg-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  margin-bottom: .75rem;
  cursor: pointer;
  transition: all .15s;
  background: var(--bg-card);
}
.pkg-card:hover { border-color: var(--primary); }
.pkg-card--selected { border-color: var(--primary); background: var(--primary-bg); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.pkg-card__label { font-size: 1.1rem; font-weight: 700; }
.pkg-card__price { font-size: 1.25rem; font-weight: 800; color: var(--primary); float: right; }
.pkg-card__items { margin-top: .6rem; font-size: .875rem; color: var(--text-muted); }

/* ── Order report ────────────────────────────────────────── */
.report-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.report-table th, .report-table td { padding: .6rem .75rem; text-align: left; border-bottom: 1px solid var(--border); }
.report-table th { font-weight: 700; color: var(--text-muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.report-table tr:last-child td { border-bottom: none; }
.report-table tr:hover td { background: var(--bg-hover); }

/* ── Deadline banner ─────────────────────────────────────── */
.deadline-banner {
  background: var(--warning-bg);
  border: 1px solid #fcd34d;
  border-radius: var(--radius-sm);
  padding: .6rem 1rem;
  font-size: .875rem;
  color: var(--warning);
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* ── Calendar strip ──────────────────────────────────────── */
.cal-day {
  flex-shrink: 0;
  width: 54px;
  padding: .45rem .3rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  background: var(--bg-card);
  user-select: none;
}
.cal-day:hover           { border-color: var(--primary); }
.cal-day--selected       { border-color: var(--primary); background: var(--primary-bg); }
.cal-day--available      { border-color: var(--success); }
.cal-day--available.cal-day--selected { background: var(--success-bg); border-color: var(--success); }
.cal-day--empty          { opacity: .45; cursor: default; }
.cal-day__name { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.cal-day__num  { font-size: 1.1rem; font-weight: 800; line-height: 1.2; }
.cal-day__mon  { font-size: .68rem; color: var(--text-muted); }
.cal-day__dot  { font-size: .7rem; min-height: .9rem; }

/* ── Quantity control ─────────────────────────────────────── */
.qty-control { display: flex; align-items: center; gap: .4rem; }
.qty-btn {
  width: 2rem; height: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 1.1rem; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s; flex-shrink: 0;
}
.qty-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Toasts ──────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  pointer-events: none;
}
.toast {
  padding: .75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  color: #fff;
  box-shadow: var(--shadow-lg);
  animation: toastIn .25s ease;
  pointer-events: auto;
  max-width: 320px;
}
.toast--success { background: var(--success); }
.toast--error   { background: var(--danger); }
.toast--info    { background: var(--primary); }

/* ── Spinner ─────────────────────────────────────────────── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}
.spinner--dark {
  border-color: rgba(0,0,0,.15);
  border-top-color: var(--primary);
}

/* ── Utilities ───────────────────────────────────────────── */
.hidden { display: none !important; }
.flex   { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.mb-1  { margin-bottom: .5rem; }
.mb-2  { margin-bottom: 1rem; }
.mb-3  { margin-bottom: 1.5rem; }
.mt-1  { margin-top: .5rem; }
.mt-2  { margin-top: 1rem; }
.mt-3  { margin-top: 1.5rem; }
.text-muted   { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-center  { text-align: center; }
.font-bold    { font-weight: 700; }
.font-display { font-weight: 800; letter-spacing: -.02em; }
.w-full       { width: 100%; }

/* ── Animations ──────────────────────────────────────────── */
@keyframes toastIn  { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:none; } }
@keyframes spin     { to { transform:rotate(360deg); } }
@keyframes fadeIn   { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
.animate-in { animation: fadeIn .35s ease both; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .navbar { padding: .6rem 1rem; }
  .navbar__logo { font-size: 1.1rem; }
  .modal { padding: 1.25rem; }
  .modal--wide { max-width: 100%; }
  #items-grid { grid-template-columns: 1fr !important; }
  .btn--lg { padding: .65rem 1rem; }
  .dash-tabs { gap: .35rem; }
  .dash-tab  { padding: .5rem .75rem; font-size: .82rem; }
}

@media (max-width: 480px) {
  .container { padding: 0 .9rem; }
  .card { padding: 1.1rem; }
}