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

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

:root {
  --red: #C84B2F;
  --dark: #2C2C2A;
  --gray: #888780;
  --light-gray: #f5f4f0;
  --border: #e0ddd6;
  --font: 'Plus Jakarta Sans', sans-serif;
  --font-heading: 'Plus Jakarta Sans', sans-serif;
}

body { font-family: var(--font); background: var(--light-gray); color: var(--dark); }

/* ── LAYOUT ──────────────────────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }
.main { flex: 1; display: flex; flex-direction: column; overflow: auto; }

/* ── SIDEBAR ─────────────────────────────────────────────────────────────── */
.sidebar {
  width: 210px; flex-shrink: 0; background: var(--dark);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sb-logo { padding: 1.25rem; border-bottom: 0.5px solid rgba(255,255,255,0.08); }
.sb-logo-text { font-family: var(--font-heading); font-weight: 800; font-size: 18px; color: white; letter-spacing: -0.3px; }
.sb-accent { color: var(--red); }
.sb-restaurant { padding: 1rem 1.25rem; border-bottom: 0.5px solid rgba(255,255,255,0.08); }
.sb-rest-name { font-family: var(--font-heading); font-weight: 700; font-size: 13px; color: white; }
.sb-rest-url { font-size: 11px; color: rgba(255,255,255,0.35); margin-top: 2px; }
.sb-nav { flex: 1; padding: 0.75rem 0; }
.sb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 1.25rem; font-size: 13px; color: rgba(255,255,255,0.5);
  text-decoration: none; border-left: 2px solid transparent;
  transition: all 0.12s;
}
.sb-item:hover { color: white; background: rgba(255,255,255,0.05); }
.sb-item.active { color: white; background: rgba(200,75,47,0.15); border-left-color: var(--red); }
.sb-badge { background: var(--red); color: white; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 10px; margin-left: auto; }
.sb-bottom { padding: 1rem 1.25rem; border-top: 0.5px solid rgba(255,255,255,0.08); }
.sb-user { display: flex; align-items: center; gap: 8px; }
.sb-avatar { width: 28px; height: 28px; border-radius: 8px; background: var(--red); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: white; flex-shrink: 0; }
.sb-user-name { font-size: 12px; color: rgba(255,255,255,0.6); }
.sb-logout { font-size: 11px; color: rgba(255,255,255,0.35); text-decoration: none; }
.sb-logout:hover { color: rgba(255,255,255,0.7); }

/* ── TOPBAR ──────────────────────────────────────────────────────────────── */
.topbar { background: white; border-bottom: 0.5px solid var(--border); padding: 0.85rem 1.5rem; display: flex; align-items: center; justify-content: space-between; }
.topbar-title { font-family: var(--font-heading); font-weight: 800; font-size: 16px; color: var(--dark); }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.live-indicator { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--gray); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #639922; }

/* ── CONTENT ─────────────────────────────────────────────────────────────── */
.content { padding: 1.25rem 1.5rem; flex: 1; }

/* ── BUTTONS ─────────────────────────────────────────────────────────────── */
.btn-primary { background: var(--red); color: white; border: none; padding: 9px 18px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; font-family: var(--font); text-decoration: none; display: inline-block; transition: opacity 0.15s; }
.btn-primary:hover { opacity: 0.88; }
.btn-outline { background: white; color: var(--dark); border: 1.5px solid var(--border); padding: 9px 18px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; font-family: var(--font); text-decoration: none; display: inline-block; transition: background 0.12s; }
.btn-outline:hover { background: var(--light-gray); }
.btn-sm { padding: 7px 13px; font-size: 12px; }
.btn-full { width: 100%; text-align: center; }
.btn-icon { width: 28px; height: 28px; border-radius: 6px; border: 1.5px solid var(--border); background: white; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.btn-icon:hover { background: var(--light-gray); }

/* ── STATS ───────────────────────────────────────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 1.25rem; }
.stat-card { background: white; border: 0.5px solid var(--border); border-radius: 12px; padding: 1rem; }
.stat-label { font-size: 11px; color: var(--gray); margin-bottom: 0.4rem; }
.stat-val { font-family: var(--font-heading); font-weight: 800; font-size: 24px; color: var(--dark); letter-spacing: -0.5px; }

/* ── GRID ────────────────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ── PANEL ───────────────────────────────────────────────────────────────── */
.panel { background: white; border: 0.5px solid var(--border); border-radius: 12px; overflow: hidden; }
.panel-head { padding: 0.85rem 1rem; border-bottom: 0.5px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.panel-title { font-family: var(--font-heading); font-weight: 700; font-size: 13px; color: var(--dark); }
.panel-link { font-size: 11px; color: var(--red); text-decoration: none; }

/* ── ORDINI (home) ───────────────────────────────────────────────────────── */
.order-row { display: flex; align-items: center; gap: 10px; padding: 0.75rem 1rem; border-bottom: 0.5px solid var(--border); }
.order-row:last-child { border-bottom: none; }
.order-table { font-family: var(--font-heading); font-weight: 800; font-size: 13px; color: var(--dark); min-width: 28px; }
.order-body { flex: 1; }
.order-dishes { font-size: 12px; font-weight: 500; color: var(--dark); }
.order-time { font-size: 11px; color: var(--gray); margin-top: 1px; }
.order-total { font-family: var(--font-heading); font-weight: 800; font-size: 13px; color: var(--dark); margin-right: 8px; }

/* ── PILLS ───────────────────────────────────────────────────────────────── */
.pill { font-size: 10px; font-weight: 500; padding: 3px 8px; border-radius: 20px; white-space: nowrap; }
.pill-new { background: #FAECE7; color: #993C1D; border: 0.5px solid #F0997B; }
.pill-preparing { background: #FAEEDA; color: #854F0B; border: 0.5px solid #EF9F27; }
.pill-served { background: #EAF3DE; color: #3B6D11; border: 0.5px solid #97C459; }
.pill-cancelled { background: #f5f4f0; color: var(--gray); border: 0.5px solid var(--border); }
.pill-draft { background: #f5f4f0; color: var(--gray); border: 0.5px solid var(--border); }

/* ── QUICK ACTIONS ───────────────────────────────────────────────────────── */
.quick-actions { padding: 0.5rem; }
.quick-action { display: flex; align-items: center; gap: 12px; padding: 0.85rem; border-radius: 8px; text-decoration: none; color: var(--dark); transition: background 0.12s; }
.quick-action:hover { background: var(--light-gray); }
.qa-icon { width: 36px; height: 36px; border-radius: 8px; background: var(--light-gray); border: 0.5px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.qa-title { font-size: 13px; font-weight: 500; }
.qa-sub { font-size: 11px; color: var(--gray); margin-top: 1px; }

/* ── MENU LIST ───────────────────────────────────────────────────────────── */
.cat-section { border-bottom: 0.5px solid var(--border); }
.cat-section:last-child { border-bottom: none; }
.cat-head { padding: 0.65rem 1rem; background: var(--light-gray); display: flex; align-items: center; justify-content: space-between; }
.cat-name { font-size: 11px; font-weight: 500; color: var(--gray); text-transform: uppercase; letter-spacing: 0.8px; }
.cat-count { font-size: 10px; color: var(--gray); }
.menu-row { display: flex; align-items: center; gap: 10px; padding: 0.65rem 1rem; border-bottom: 0.5px solid var(--border); }
.menu-row:last-child { border-bottom: none; }
.menu-emoji-placeholder { font-size: 16px; }
.menu-row-info { flex: 1; min-width: 0; }
.menu-row-name { font-size: 13px; font-weight: 500; color: var(--dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-row-price { font-size: 11px; color: var(--gray); margin-top: 1px; }
.allergen-list { display: flex; gap: 4px; flex-wrap: wrap; margin-right: 8px; }
.allergen-tag { background: var(--light-gray); color: var(--gray); font-size: 9px; padding: 2px 5px; border-radius: 4px; border: 0.5px solid var(--border); }
.empty-cat { padding: 0.85rem 1rem; font-size: 12px; color: var(--gray); }
.empty-cat a { color: var(--red); }
.empty-state { font-size: 13px; color: var(--gray); text-align: center; padding: 2rem; }

/* ── TOGGLE ──────────────────────────────────────────────────────────────── */
.toggle-wrap { position: relative; width: 34px; height: 19px; flex-shrink: 0; cursor: pointer; }
.toggle-input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider { position: absolute; inset: 0; background: var(--border); border-radius: 10px; transition: background 0.15s; }
.toggle-slider::after { content: ''; position: absolute; top: 2.5px; left: 2.5px; width: 14px; height: 14px; border-radius: 50%; background: white; transition: left 0.15s; }
.toggle-input:checked + .toggle-slider { background: var(--red); }
.toggle-input:checked + .toggle-slider::after { left: 17.5px; }

/* ── FORM ────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 11px; color: var(--gray); margin-bottom: 4px; }
.form-input { width: 100%; border: 1.5px solid var(--border); border-radius: 8px; padding: 9px 11px; font-size: 13px; font-family: var(--font); color: var(--dark); outline: none; background: white; }
.form-input:focus { border-color: var(--red); }
textarea.form-input { resize: vertical; }
.form-hint { font-size: 11px; color: var(--gray); margin-top: 4px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 1.5rem; }

/* ── KANBAN ──────────────────────────────────────────────────────────────── */
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.kanban-col { display: flex; flex-direction: column; gap: 10px; }
.kanban-head { padding: 0.75rem 1rem; border-radius: 10px; display: flex; align-items: center; justify-content: space-between; font-family: var(--font-heading); font-weight: 700; font-size: 13px; }
.kanban-new { background: #FAECE7; color: #993C1D; }
.kanban-prep { background: #FAEEDA; color: #854F0B; }
.kanban-done { background: #EAF3DE; color: #3B6D11; }
.kanban-empty { font-size: 12px; color: var(--gray); text-align: center; padding: 1rem; }
.order-card { background: white; border: 0.5px solid var(--border); border-radius: 10px; padding: 0.85rem 1rem; display: flex; flex-direction: column; gap: 8px; }
.order-card-done { opacity: 0.6; }
.order-card-head { display: flex; align-items: center; justify-content: space-between; }
.order-card-table { font-family: var(--font-heading); font-weight: 800; font-size: 14px; }
.order-card-time { font-size: 11px; color: var(--gray); }
.order-card-item { font-size: 12px; color: #5F5E5A; line-height: 1.6; }
.order-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.order-card-total { font-family: var(--font-heading); font-weight: 800; font-size: 14px; }

/* ── MODAL ───────────────────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(44,44,42,0.45); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-box { background: white; border-radius: 14px; padding: 1.5rem; width: 340px; max-width: 95%; }
.modal-title { font-family: var(--font-heading); font-weight: 800; font-size: 15px; color: var(--dark); margin-bottom: 1.25rem; }
.modal-actions { display: flex; gap: 8px; margin-top: 1.25rem; }
.modal-actions .btn-outline, .modal-actions .btn-primary { flex: 1; text-align: center; }

/* ── MESSAGES ────────────────────────────────────────────────────────────── */
.messages { padding: 0.75rem 1.5rem 0; }
.message { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 6px; }
.message-error { background: #FCEBEB; color: #A32D2D; border: 0.5px solid #F09595; }
.message-success { background: #EAF3DE; color: #3B6D11; border: 0.5px solid #97C459; }

/* ── LOGIN PAGE ──────────────────────────────────────────────────────────── */
.login-page { background: var(--light-gray); display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-wrap { width: 100%; max-width: 380px; padding: 1rem; }
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo-text { font-family: var(--font-heading); font-weight: 800; font-size: 24px; color: var(--dark); }
.login-card { background: white; border: 0.5px solid var(--border); border-radius: 16px; padding: 2rem; }
.login-title { font-family: var(--font-heading); font-weight: 800; font-size: 20px; margin-bottom: 0.25rem; }
.login-sub { font-size: 13px; color: var(--gray); margin-bottom: 1.5rem; }
.login-form { display: flex; flex-direction: column; gap: 1rem; }
.login-footer { text-align: center; font-size: 12px; color: var(--gray); margin-top: 1rem; }
.login-footer a { color: var(--red); }
.alert { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 1rem; }
.alert-error { background: #FCEBEB; color: #A32D2D; border: 0.5px solid #F09595; }


/* ── MOBILE ──────────────────────────────────────────────────────────────── */
.mobile-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: var(--dark);
  position: sticky;
  top: 0;
  z-index: 50;
}
.mobile-topbar-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 16px;
  color: white;
}
.hamburger {
  width: 40px; height: 40px;
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: white; border-radius: 2px;
}
.sb-close {
  display: none;
  background: none; border: none; color: rgba(255,255,255,0.6);
  font-size: 18px; cursor: pointer; margin-left: auto;
}
.sb-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}
.sb-overlay.open { display: block; }

@media (max-width: 768px) {
  #featured-wrap,
  #featured-wrap + span {
    display: none !important;
  }
  .sidebar {
    position: fixed;
    left: -220px;
    top: 0; bottom: 0;
    z-index: 100;
    transition: left 0.25s ease;
    height: 100vh;
  }
  .sidebar.open { left: 0; }
  .sb-close { display: block; }
  .sb-logo { display: flex; align-items: center; }
  .mobile-topbar { display: flex; }
  .layout { flex-direction: column; }
  .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: 1fr; }
  .form-row-2 { grid-template-columns: 1fr; }
}


/* ── RIORDINO ────────────────────────────────────────────────────────────── */
.reorder-btns { display: flex; flex-direction: row; gap: 4px; flex-shrink: 0; }
.reorder-btn {
  width: 28px; height: 28px; border-radius: 7px;
  border: 1.5px solid var(--border); background: white;
  cursor: pointer; font-size: 16px; display: flex;
  align-items: center; justify-content: center;
  color: var(--gray); line-height: 1; padding: 0;
  transition: all 0.12s;
}
.reorder-btn:hover { background: var(--red); color: white; border-color: var(--red); }

@media (max-width: 768px) {
  .allergen-list { display: none; }
  .status-pill { display: none; }
  .menu-row-name { 
    white-space: normal; 
    overflow: visible; 
    text-overflow: unset;
    font-size: 13px;
  }
  .menu-row { 
    padding: 0.5rem 0.75rem; 
    gap: 8px; 
    flex-wrap: nowrap;
  }
  .menu-row-info { 
    min-width: 0; 
    flex: 1;
  }
  .menu-row-icon { display: none; }
  .reorder-btns { gap: 4px; }
  .reorder-btn { width: 36px; height: 36px; font-size: 18px; }
  .cat-head { padding: 0.75rem; }
  .cat-name { font-size: 12px; }
  .btn-icon { width: 36px; height: 36px; }
  .topbar { flex-wrap: wrap; gap: 8px; padding: 0.75rem 1rem; }
  .topbar-actions { gap: 6px; }
  .btn-sm { padding: 7px 10px; font-size: 11px; }
}

@media (max-width: 768px) {
  .kanban {
    grid-template-columns: 1fr !important;
  }
}

.kanban-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 768px) {
  .kanban-4 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  #btn-toggle-sidebar { display: none; }
}


.sb-qr-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 10px;
  background: #C84B2F;
  color: white;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s;
}
.sb-qr-btn:hover { opacity: 0.85; }

.stats-section-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 14px;
  color: var(--dark);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--red);
  display: inline-block;
}

/* ── FEATURED STAR BTN ───────────────────────────────────────────────── */
.featured-star-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  border-radius: 6px;
  opacity: 0.25;
  transition: opacity 0.2s, transform 0.15s;
  line-height: 1;
  flex-shrink: 0;
}

.featured-star-btn:hover {
  opacity: 0.7;
  transform: scale(1.2);
}

.featured-star-btn.active {
  opacity: 1;
  transform: scale(1.1);
  animation: starPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes starPop {
  from { transform: scale(0.5); }
  to { transform: scale(1.1); }
}

@media (max-width: 768px) {
  .featured-star-btn {
    font-size: 16px;
    padding: 4px 6px;
    opacity: 0.3;
  }
}