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

:root {
  --bg-dark: #0c0f14;
  --bg-sidebar: #12151c;
  --bg-main: #f7f6f3;
  --bg-card: #ffffff;
  --bg-card-hover: #fafaf8;
  --text-primary: #1a1a1a;
  --text-secondary: #6b7280;
  --text-light: #9ca3af;
  --text-sidebar: #94a3b8;
  --text-sidebar-active: #f8fafc;
  --accent: #e67e22;
  --accent-hover: #d35400;
  --accent-light: rgba(230, 126, 34, 0.1);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --border: #e5e7eb;
  --border-light: #f0f0ee;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ---- SIDEBAR ---- */
.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  min-height: 100vh;
  padding: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  border-right: 1px solid rgba(255,255,255,0.06);
}

.sidebar-brand {
  padding: 28px 24px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-brand h1 {
  font-size: 20px;
  color: #f8fafc;
  font-weight: 700;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-brand h1 .brand-icon {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.sidebar-brand .brand-subtitle {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--text-sidebar);
  margin-top: 4px;
  font-weight: 400;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.sidebar-org {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-org-name {
  font-size: 13px;
  color: #cbd5e1;
  font-weight: 500;
}

.sidebar-org-meta {
  font-size: 11px;
  color: var(--text-sidebar);
  margin-top: 2px;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
}

.sidebar-nav-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #475569;
  padding: 8px 12px 6px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-sidebar);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s ease;
  margin-bottom: 2px;
  font-weight: 400;
}

.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: #e2e8f0;
}

.nav-item.active {
  background: rgba(230, 126, 34, 0.15);
  color: var(--accent);
  font-weight: 500;
}

.nav-item .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 15px;
  opacity: 0.7;
}

.nav-item.active .nav-icon {
  opacity: 1;
}

.nav-badge {
  margin-left: auto;
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 600;
}

/* ---- MAIN CONTENT ---- */
.main {
  margin-left: 260px;
  flex: 1;
  min-height: 100vh;
  padding: 32px 40px;
  max-width: calc(100% - 260px);
}

.page-header {
  margin-bottom: 32px;
}

.page-header h2 {
  font-size: 26px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.page-header .page-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ---- STAT CARDS ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

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

.stat-card .stat-label {
  font-size: 12px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
  margin-bottom: 8px;
}

.stat-card .stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}

.stat-card .stat-detail {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ---- CARDS / PANELS ---- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow: hidden;
}

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

.card-header h3 {
  font-size: 16px;
}

.card-body {
  padding: 20px 24px;
}

.card-body.no-pad {
  padding: 0;
}

/* ---- MENU CARDS ---- */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.menu-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.menu-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--accent);
}

.menu-card .menu-type-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.menu-type-badge.food { background: #fef3c7; color: #92400e; }
.menu-type-badge.drink { background: #dbeafe; color: #1e40af; }
.menu-type-badge.seasonal { background: #d1fae5; color: #065f46; }
.menu-type-badge.happy-hour { background: #fce7f3; color: #9d174d; }

.menu-card h3 {
  font-size: 18px;
  margin-bottom: 6px;
}

.menu-card .menu-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.menu-card .menu-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-light);
}

.menu-card .menu-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ---- VERSION TIMELINE ---- */
.version-timeline {
  position: relative;
  padding-left: 24px;
}

.version-timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}

.version-item {
  position: relative;
  padding: 16px 20px;
  margin-bottom: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
}

.version-item:hover {
  border-color: var(--accent);
}

.version-item::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 22px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-card);
}

.version-item.published::before {
  background: var(--success);
  border-color: var(--success);
}

.version-item.draft::before {
  background: var(--warning);
  border-color: var(--warning);
}

.version-item.archived::before {
  background: var(--text-light);
  border-color: var(--text-light);
}

.version-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.version-header h4 {
  font-size: 15px;
}

/* ---- STATUS BADGES ---- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-published { background: #d1fae5; color: #065f46; }
.badge-draft { background: #fef3c7; color: #92400e; }
.badge-archived { background: #e5e7eb; color: #4b5563; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-completed { background: #d1fae5; color: #065f46; }
.badge-processing { background: #dbeafe; color: #1e40af; }
.badge-failed { background: #fee2e2; color: #991b1b; }

/* ---- TABLE ---- */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  font-weight: 600;
  border-bottom: 1px solid var(--border-light);
  background: #fafaf9;
}

.data-table td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border-light);
}

.data-table tr:hover td {
  background: var(--bg-card-hover);
}

.data-table .item-price {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  color: var(--text-primary);
}

.data-table .item-override {
  color: var(--accent);
  font-weight: 600;
}

.data-table .item-unavailable {
  color: var(--danger);
  text-decoration: line-through;
  opacity: 0.6;
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(230, 126, 34, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #059669;
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

.btn-danger:hover {
  background: var(--danger);
  color: white;
}

/* ---- SECTION EDITOR ---- */
.section-block {
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 12px;
}

.section-header h3 {
  font-size: 17px;
  color: var(--text-primary);
}

.section-header .section-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
}

.item-row {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  transition: background 0.15s ease;
}

.item-row:hover {
  background: var(--bg-card-hover);
}

.item-info {
  flex: 1;
}

.item-name {
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 2px;
}

.item-description {
  font-size: 12px;
  color: var(--text-secondary);
}

.item-tags {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.item-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 500;
}

.item-price-col {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 600;
  min-width: 80px;
  text-align: right;
}

/* ---- OVERRIDES PANEL ---- */
.override-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.location-select {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.location-chip {
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: 'DM Sans', sans-serif;
}

.location-chip:hover {
  border-color: var(--accent);
}

.location-chip.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ---- PRINT QUEUE ---- */
.print-item {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}

.print-item:last-child { border-bottom: none; }

.print-info { flex: 1; }

.print-info .print-title {
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 2px;
}

.print-info .print-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ---- FORMS / MODALS ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 90%;
  max-width: 520px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  transform: translateY(10px);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal h3 {
  font-size: 18px;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  transition: border-color 0.15s ease;
  background: var(--bg-main);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}

/* ---- EMPTY STATE ---- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}

.empty-state .empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-state p {
  font-size: 14px;
}

/* ---- BREADCRUMBS ---- */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 13px;
}

.breadcrumbs a {
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
}

.breadcrumbs a:hover {
  color: var(--accent);
}

.breadcrumbs .sep {
  color: var(--text-light);
}

.breadcrumbs .current {
  color: var(--text-primary);
  font-weight: 500;
}

/* ---- UTILITY ---- */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.text-sm { font-size: 13px; }
.text-muted { color: var(--text-secondary); }

/* ---- LOADING ---- */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-center {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 20px 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .menu-grid { grid-template-columns: 1fr; }
  .override-grid { grid-template-columns: 1fr; }
}
