/* ─── Restaurant SaaS — Design System ─────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Lato:wght@300;400;500;600&display=swap');

:root {
  --primary:    #C8102E;
  --secondary:  #1B1B1B;
  --accent:     #F4A024;
  --bg:         #F8F5F0;
  --sidebar-bg: #1B1B1B;
  --radius:     12px;
  --font-head:  'Playfair Display', serif;
  --font-body:  'Lato', sans-serif;

  /* Derived */
  --primary-10: color-mix(in srgb, var(--primary) 10%, white);
  --primary-20: color-mix(in srgb, var(--primary) 20%, white);
  --accent-10:  color-mix(in srgb, var(--accent) 10%, white);

  /* Neutrals */
  --surface:    #FFFFFF;
  --border:     #E8E0D8;
  --muted:      #9E8E7E;
  --text:       #2C2C2C;
  --text-light: #6B5E52;

  /* Status */
  --green:  #1A9E5A;
  --yellow: #F4A024;
  --red:    #C8102E;
  --blue:   #1A6EBE;
  --purple: #7B3FCF;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  /* Sidebar */
  --sidebar-w: 260px;
  --topbar-h:  64px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.10), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.14), 0 4px 8px rgba(0,0,0,.06);
  --shadow-xl: 0 20px 60px rgba(0,0,0,.18);

  --transition: 200ms cubic-bezier(.4,0,.2,1);
}

/* ─── Reset ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; }

/* ─── Layout ──────────────────────────────────────────────────────────── */
.app-body { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-6) var(--space-5);
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-logo {
  width: 44px; height: 44px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.sidebar-logo-text {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--primary);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head);
  font-size: 1.5rem; font-weight: 700;
  flex-shrink: 0;
}

.sidebar-brand-name {
  display: block;
  color: white;
  font-family: var(--font-head);
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.2;
}

.sidebar-brand-role {
  display: block;
  color: rgba(255,255,255,.45);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-4) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px var(--space-4);
  border-radius: var(--radius);
  color: rgba(255,255,255,.6);
  transition: all var(--transition);
  font-size: .875rem;
  font-weight: 500;
}

.nav-item:hover {
  background: rgba(255,255,255,.07);
  color: white;
}

.nav-item.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(200,16,46,.35);
}

.nav-icon { font-size: 1.2rem !important; }
.sidebar-separator {
  height: 1px;
  background: rgba(255,255,255,.08);
  margin: var(--space-3) var(--space-4);
}

.sidebar-footer {
  padding: var(--space-4) var(--space-3);
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.user-chip { display: flex; align-items: center; gap: var(--space-3); flex: 1; min-width: 0; }
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .875rem;
  flex-shrink: 0;
}
.user-info { min-width: 0; }
.user-name { display: block; color: white; font-size: .8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { display: block; color: rgba(255,255,255,.4); font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; }

.logout-btn {
  color: rgba(255,255,255,.4);
  padding: var(--space-2);
  border-radius: 8px;
  transition: all var(--transition);
  flex-shrink: 0;
}
.logout-btn:hover { background: rgba(255,255,255,.08); color: white; }

/* Main wrap */
.main-wrap {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  gap: var(--space-4);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.menu-toggle {
  display: none;
  color: var(--text);
  padding: var(--space-2);
  border-radius: 8px;
}

.topbar-title {
  flex: 1;
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}

.topbar-actions { display: flex; align-items: center; gap: var(--space-3); }
.topbar-time { color: var(--muted); font-size: .85rem; font-weight: 500; }

.page-content { padding: var(--space-6); flex: 1; }

/* ─── Cards ───────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.card-body { padding: var(--space-6); }

/* ─── Stat Cards ──────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: var(--space-5) var(--space-6);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem !important;
  flex-shrink: 0;
}

.stat-icon.green  { background: color-mix(in srgb, var(--green) 12%, white);  color: var(--green); }
.stat-icon.red    { background: color-mix(in srgb, var(--red) 12%, white);    color: var(--red); }
.stat-icon.yellow { background: color-mix(in srgb, var(--yellow) 12%, white); color: var(--yellow); }
.stat-icon.blue   { background: color-mix(in srgb, var(--blue) 12%, white);   color: var(--blue); }
.stat-icon.purple { background: color-mix(in srgb, var(--purple) 12%, white); color: var(--purple); }
.stat-icon.primary{ background: var(--primary-10); color: var(--primary); }

.stat-info { flex: 1; min-width: 0; }
.stat-value { font-family: var(--font-head); font-size: 1.75rem; font-weight: 700; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: .8rem; margin-top: 2px; }
.stat-trend { font-size: .78rem; font-weight: 600; margin-top: var(--space-2); }
.stat-trend.up   { color: var(--green); }
.stat-trend.down { color: var(--red); }

/* ─── Tables ──────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: var(--space-3) var(--space-4); text-align: left; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: var(--bg); border-bottom: 2px solid var(--border); white-space: nowrap; }
td { padding: var(--space-4); border-bottom: 1px solid var(--border); font-size: .875rem; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }

/* ─── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 9px var(--space-5);
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 600;
  font-family: var(--font-body);
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
  border: none;
}

.btn-primary { background: var(--primary); color: white; box-shadow: 0 2px 8px rgba(200,16,46,.25); }
.btn-primary:hover { background: color-mix(in srgb, var(--primary) 85%, black); box-shadow: 0 4px 16px rgba(200,16,46,.35); transform: translateY(-1px); }

.btn-secondary { background: var(--bg); color: var(--text); border: 1.5px solid var(--border); }
.btn-secondary:hover { background: var(--border); }

.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { background: color-mix(in srgb, var(--accent) 85%, black); }

.btn-green { background: var(--green); color: white; }
.btn-green:hover { background: color-mix(in srgb, var(--green) 85%, black); }

.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--bg); }

.btn-sm { padding: 6px var(--space-4); font-size: .8rem; }
.btn-lg { padding: 13px var(--space-8); font-size: 1rem; }
.btn-icon { padding: 9px; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* ─── Forms ───────────────────────────────────────────────────────────── */
.form-group { margin-bottom: var(--space-5); }
.form-label { display: block; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-light); margin-bottom: var(--space-2); }
.form-control {
  width: 100%;
  padding: 10px var(--space-4);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-10); }
.form-control::placeholder { color: var(--muted); }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%239E8E7E' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { font-size: .78rem; color: var(--muted); margin-top: var(--space-1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ─── Badges ──────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}
.badge-pending    { background: color-mix(in srgb,var(--yellow) 15%, white); color: #8a5a00; }
.badge-confirmed  { background: color-mix(in srgb,var(--blue) 15%, white);   color: var(--blue); }
.badge-preparing  { background: color-mix(in srgb,var(--accent) 15%, white); color: #7a5000; }
.badge-ready      { background: color-mix(in srgb,var(--green) 15%, white);  color: var(--green); }
.badge-served     { background: color-mix(in srgb,var(--purple) 15%, white); color: var(--purple); }
.badge-billed     { background: color-mix(in srgb,var(--primary) 15%, white);color: var(--primary); }
.badge-paid       { background: color-mix(in srgb,var(--green) 15%, white);  color: var(--green); }
.badge-cancelled  { background: #f5f5f5; color: var(--muted); }
.badge-available  { background: color-mix(in srgb,var(--green) 15%, white);  color: var(--green); }
.badge-occupied   { background: color-mix(in srgb,var(--red) 15%, white);    color: var(--red); }
.badge-reserved   { background: color-mix(in srgb,var(--blue) 15%, white);   color: var(--blue); }

/* ─── Flash messages ─────────────────────────────────────────────────── */
.flash {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  font-size: .875rem;
  font-weight: 500;
  animation: slideDown .3s ease;
}
.flash-success { background: color-mix(in srgb,var(--green) 10%, white); color: var(--green); border-left: 4px solid var(--green); }
.flash-error   { background: color-mix(in srgb,var(--red)   10%, white); color: var(--red);   border-left: 4px solid var(--red); }
.flash-close   { margin-left: auto; color: inherit; opacity: .6; padding: 2px; border-radius: 4px; }
.flash-close:hover { opacity: 1; }

@keyframes slideDown { from { opacity:0; transform:translateY(-12px); } to { opacity:1; transform:none; } }

/* ─── Table Map (Waiter) ─────────────────────────────────────────────── */
.tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: var(--space-4);
}

.table-tile {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.table-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.table-tile.available { border-color: var(--green); }
.table-tile.occupied  { border-color: var(--red); background: color-mix(in srgb,var(--red) 4%, white); }
.table-tile.reserved  { border-color: var(--blue); background: color-mix(in srgb,var(--blue) 4%, white); }
.table-tile.cleaning  { border-color: var(--yellow); background: color-mix(in srgb,var(--yellow) 4%, white); }

.table-number {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}
.table-name { font-size: .72rem; color: var(--muted); }
.table-cap  { font-size: .72rem; color: var(--muted); margin-top: 2px; }
.table-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  position: absolute;
  top: 8px; right: 8px;
}
.table-tile.available .table-status-dot { background: var(--green); }
.table-tile.occupied  .table-status-dot { background: var(--red); animation: pulse 2s infinite; }
.table-tile.reserved  .table-status-dot { background: var(--blue); }
.table-tile.cleaning  .table-status-dot { background: var(--yellow); }

.table-order-info { margin-top: var(--space-2); font-size: .72rem; color: var(--primary); font-weight: 600; }

@keyframes pulse {
  0%,100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.4); opacity: .7; }
}

/* ─── Kitchen Cards ──────────────────────────────────────────────────── */
.kitchen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

.kitchen-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 2px solid var(--border);
  overflow: hidden;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.kitchen-card.urgent { border-color: var(--red); }
.kitchen-card.preparing { border-color: var(--yellow); }

.kitchen-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.kitchen-table { font-family: var(--font-head); font-size: 1rem; font-weight: 700; }
.kitchen-timer { font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.kitchen-timer.ok     { background: color-mix(in srgb,var(--green) 15%,white); color: var(--green); }
.kitchen-timer.warn   { background: color-mix(in srgb,var(--yellow) 15%,white); color: #8a5a00; }
.kitchen-timer.urgent { background: color-mix(in srgb,var(--red) 15%,white); color: var(--red); animation: pulse 1.5s infinite; }

.kitchen-card-body { padding: var(--space-4); }
.kitchen-item-name { font-size: 1.1rem; font-weight: 700; font-family: var(--font-head); }
.kitchen-item-qty  { font-size: 1.4rem; font-weight: 700; color: var(--primary); }
.kitchen-item-notes { font-size: .8rem; color: var(--muted); font-style: italic; margin-top: 4px; }

.kitchen-card-footer {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
  display: flex;
  gap: var(--space-2);
}

/* ─── Order Panel ────────────────────────────────────────────────────── */
.order-panel {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--space-5);
  height: calc(100vh - var(--topbar-h) - var(--space-6) * 2);
}

.menu-panel { overflow-y: auto; padding-right: var(--space-2); }
.cart-panel {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.cart-header {
  padding: var(--space-5) var(--space-5);
  border-bottom: 1px solid var(--border);
  background: var(--sidebar-bg);
  color: white;
}

.cart-title { font-family: var(--font-head); font-size: 1.1rem; font-weight: 700; }
.cart-subtitle { font-size: .8rem; opacity: .6; }
.cart-items { flex: 1; overflow-y: auto; padding: var(--space-4); }

.cart-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}
.cart-item:last-child { border-bottom: none; }
.cart-item-name { font-size: .875rem; font-weight: 600; flex: 1; }
.cart-item-price { font-size: .875rem; font-weight: 700; color: var(--primary); }
.cart-item-qty { font-size: .78rem; color: var(--muted); }
.cart-item-notes { font-size: .72rem; color: var(--muted); font-style: italic; }

.cart-footer {
  padding: var(--space-5);
  border-top: 2px solid var(--border);
  background: var(--bg);
}

.cart-totals { margin-bottom: var(--space-4); }
.cart-row { display: flex; justify-content: space-between; font-size: .875rem; margin-bottom: var(--space-2); }
.cart-row.total { font-size: 1.1rem; font-weight: 700; font-family: var(--font-head); color: var(--primary); border-top: 1px solid var(--border); padding-top: var(--space-2); }

/* Menu items */
.menu-category-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 700;
  margin: var(--space-5) 0 var(--space-3);
  color: var(--text);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--border);
}

.menu-cat-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: .9rem !important;
}

.menu-items-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-3);
}

.menu-item-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.menu-item-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.menu-item-card.unavailable { opacity: .45; pointer-events: none; }

.menu-item-img {
  width: 60px; height: 60px;
  border-radius: 10px;
  object-fit: cover;
  margin: 0 auto var(--space-2);
}

.menu-item-emoji {
  width: 60px; height: 60px;
  border-radius: 10px;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto var(--space-2);
}

.menu-item-name { font-size: .8rem; font-weight: 700; line-height: 1.3; margin-bottom: 4px; }
.menu-item-price { font-size: .95rem; font-weight: 700; color: var(--primary); font-family: var(--font-head); }

/* Cashier */
.payment-modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.payment-modal.open { opacity: 1; pointer-events: all; }
.payment-box {
  background: var(--surface);
  border-radius: calc(var(--radius) * 1.5);
  box-shadow: var(--shadow-xl);
  width: 90%;
  max-width: 460px;
  overflow: hidden;
  transform: scale(.95);
  transition: transform var(--transition);
}
.payment-modal.open .payment-box { transform: scale(1); }

.payment-header {
  background: var(--sidebar-bg);
  color: white;
  padding: var(--space-5) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.payment-body { padding: var(--space-6); }

/* ─── Login page ─────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 480px;
  background: var(--bg);
}

.login-hero {
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-10);
  position: relative;
  overflow: hidden;
}

.login-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(200,16,46,.25) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(244,160,36,.15) 0%, transparent 50%);
}

.login-hero-content { position: relative; z-index: 1; text-align: center; }
.login-hero-icon { font-size: 5rem !important; color: var(--primary); margin-bottom: var(--space-5); }
.login-hero-title { font-family: var(--font-head); font-size: 2.5rem; font-weight: 700; color: white; line-height: 1.2; margin-bottom: var(--space-4); }
.login-hero-sub { color: rgba(255,255,255,.55); font-size: 1rem; max-width: 320px; }

.login-form-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-10) var(--space-8);
  background: white;
}

.login-logo-area { text-align: center; margin-bottom: var(--space-8); }
.login-logo-area img { height: 60px; margin: 0 auto var(--space-3); }
.login-tagline { color: var(--muted); font-size: .875rem; }
.login-title { font-family: var(--font-head); font-size: 1.8rem; font-weight: 700; margin-bottom: var(--space-2); }

/* ─── Modals ──────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--surface);
  border-radius: calc(var(--radius) * 1.5);
  box-shadow: var(--shadow-xl);
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(.97);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1);
}
.modal-overlay.open .modal { transform: none; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
}
.modal-title { font-family: var(--font-head); font-size: 1.1rem; font-weight: 700; }
.modal-close { color: var(--muted); padding: 4px; border-radius: 6px; }
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: var(--space-6); }
.modal-footer { padding: var(--space-5) var(--space-6); border-top: 1px solid var(--border); display: flex; gap: var(--space-3); justify-content: flex-end; }

/* ─── Color Swatch ───────────────────────────────────────────────────── */
.color-swatch { display: flex; align-items: center; gap: var(--space-3); }
.color-swatch input[type=color] { width: 44px; height: 44px; border-radius: var(--radius); border: 1.5px solid var(--border); padding: 2px; cursor: pointer; background: none; }

/* ─── Tabs ────────────────────────────────────────────────────────────── */
.tab-nav { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: var(--space-5); }
.tab-btn { padding: 10px var(--space-5); border-radius: var(--radius) var(--radius) 0 0; font-size: .875rem; font-weight: 600; color: var(--muted); cursor: pointer; border: none; background: none; transition: all var(--transition); }
.tab-btn:hover { color: var(--text); background: var(--bg); }
.tab-btn.active { color: var(--primary); border-bottom: 2px solid var(--primary); margin-bottom: -2px; background: var(--surface); }

/* ─── Receipt ─────────────────────────────────────────────────────────── */
@media print {
  body * { visibility: hidden; }
  .receipt-print, .receipt-print * { visibility: visible; }
  .receipt-print { position: fixed; top: 0; left: 0; width: 100%; }
  .no-print { display: none !important; }
}

.receipt {
  background: white;
  max-width: 320px;
  margin: 0 auto;
  padding: var(--space-6);
  font-family: 'Courier New', monospace;
  font-size: .85rem;
}

.receipt-divider { border: none; border-top: 1px dashed var(--border); margin: var(--space-4) 0; }

/* ─── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .order-panel { grid-template-columns: 1fr; height: auto; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .main-wrap { margin-left: 0; }
  .menu-toggle { display: flex; }
  .login-page { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-content { padding: var(--space-4); }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .tables-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}

/* ─── Utilities ──────────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.w-full { width: 100%; }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }
.mt-auto { margin-top: auto; }
.text-muted { color: var(--muted); }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .75rem; }
.font-bold { font-weight: 700; }
.font-head { font-family: var(--font-head); }
.text-primary { color: var(--primary); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.d-none { display: none !important; }
.overflow-hidden { overflow: hidden; }
.rounded { border-radius: var(--radius); }
.shadow { box-shadow: var(--shadow-md); }
.text-center { text-align: center; }
.text-right { text-align: right; }
