/* ================================================================
   Oak Ribs POS — Global Design System
   ================================================================ */

@import url('https://www.dafont.com/alte-haas-grotesk.font');

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
  /* Colors */
  --bg-base:        #0A0A0A;
  --bg-surface:     #141414;
  --bg-card:        #1C1C1C;
  --bg-card-hover:  #242424;
  --bg-input:       #1A1A1A;
  --bg-modal:       #181818;

  --primary:        #E8500A;
  --primary-hover:  #FF5E1A;
  --primary-light:  rgba(232, 80, 10, 0.15);
  --primary-glow:   rgba(232, 80, 10, 0.35);

  --accent:         #FFB347;
  --accent-light:   rgba(255, 179, 71, 0.12);

  --success:        #22C55E;
  --success-light:  rgba(34, 197, 94, 0.12);
  --danger:         #EF4444;
  --danger-light:   rgba(239, 68, 68, 0.12);
  --warning:        #F59E0B;
  --warning-light:  rgba(245, 158, 11, 0.12);
  --info:           #3B82F6;
  --info-light:     rgba(59, 130, 246, 0.12);

  --text-primary:   #F0F0F0;
  --text-secondary: #A0A0A0;
  --text-muted:     #606060;
  --text-inverse:   #0A0A0A;

  --border:         rgba(255,255,255,0.06);
  --border-focus:   rgba(232, 80, 10, 0.6);
  --divider:        rgba(255,255,255,0.05);

  /* Spacing */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  32px;
  --space-2xl: 48px;

  /* Border Radius */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.6);
  --shadow-primary: 0 4px 20px rgba(232, 80, 10, 0.3);

  /* Transitions */
  --transition: 0.2s ease;
  --transition-slow: 0.35s ease;

  /* Sidebar */
  --sidebar-width: 240px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Alte Haas Grotesk', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* ── Typography ─────────────────────────────────────────────── */
h1 { font-size: 1.75rem; font-weight: 800; }
h2 { font-size: 1.375rem; font-weight: 700; }
h3 { font-size: 1.125rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }
p  { color: var(--text-secondary); }
a  { color: var(--primary); text-decoration: none; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Alte Haas Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  user-select: none;
}

.btn-primary {
  background: #690B22 ;
  color: #fff;
}
.btn-primary:hover { background: #be002c; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-card-hover); border-color: rgba(255,255,255,0.12); }

.btn-danger {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.25);
}
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover { background: #16a34a; transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-card); color: var(--text-primary); }

.btn-sm { padding: 6px 12px; font-size: 0.8rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-full { width: 100%; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }

.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

/* ── Inputs & Forms ─────────────────────────────────────────── */
.form-group { margin-bottom: var(--space-md); }
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.form-control {
  width: 100%;
  background: #d9d9d9fb;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  color: #333;
  font-family: 'Alte Haas Grotesk', sans-serif;
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: #c6c5c5;
}
.form-control::placeholder { color: var(--text-muted); }
.form-control option { background: var(--bg-card); }

select.form-control { cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23606060' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

textarea.form-control { resize: vertical; min-height: 80px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}
.card-hover:hover {
  border-color: rgba(255,255,255,0.1);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  transition: all var(--transition);
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge-green       { background: var(--success-light); color: var(--success); }
.badge-red         { background: var(--danger-light); color: var(--danger); }
.badge-green-dark  { background: rgba(22, 163, 74, 0.15); color: #16a34a; }
.badge-orange      { background: var(--primary-light); color: var(--primary); }
.badge-blue        { background: var(--info-light); color: var(--info); }
.badge-gray        { background: rgba(160,160,160,0.12); color: var(--text-secondary); }
.badge-accent      { background: var(--accent-light); color: var(--accent); }
.badge-ready       { background: var(--success-light); color: var(--success); }
.badge-soldout     { background: rgba(239,68,68,0.1); color: var(--danger); }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-md);
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition-slow);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-modal);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.92) translateY(20px);
  transition: transform var(--transition-slow);
  box-shadow: var(--shadow-lg);
}
.modal-overlay.active .modal { transform: scale(1) translateY(0); }
.modal-lg { max-width: 700px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-lg);
}
.modal-title { font-size: 1.125rem; font-weight: 700; }
.modal-close {
  background: var(--bg-card); border: none; cursor: pointer;
  color: var(--text-secondary); font-size: 1.1rem;
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--danger-light); color: var(--danger); }
.modal-footer {
  display: flex; gap: var(--space-sm); justify-content: flex-end;
  margin-top: var(--space-lg); padding-top: var(--space-lg);
  border-top: 1px solid var(--divider);
}

/* ── Table ──────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--bg-surface);
  padding: 12px 16px;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
thead th:last-child { border-radius: 0 var(--radius-sm) 0 0; }
tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--divider);
  font-size: 0.9rem;
  color: var(--text-primary);
}
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: rgba(255,255,255,0.025); }
tbody tr:last-child td { border-bottom: none; }
.table-actions { display: flex; gap: 6px; }

/* ── Sidebar Layout ─────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition-slow);
}
.sidebar-brand {
  padding: var(--space-xl) var(--space-lg);
  border-bottom: 1px solid var(--border);
}
.sidebar-logo {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: 1px;
}
.sidebar-tagline { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.sidebar-nav { padding: var(--space-md) var(--space-sm); flex: 1; overflow-y: auto; }
.nav-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: var(--space-sm) var(--space-sm) var(--space-xs);
  margin-top: var(--space-sm);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px var(--space-md);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  margin-bottom: 2px;
}
.nav-item:hover { background: var(--bg-card); color: var(--text-primary); }
.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}
.nav-item .nav-icon { font-size: 1.1rem; min-width: 20px; text-align: center; }
.sidebar-footer {
  padding: var(--space-md);
  border-top: 1px solid var(--border);
}
.user-info {
  display: flex; align-items: center; gap: 10px;
  padding: var(--space-sm) var(--space-sm);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
}
.user-avatar {
  width: 36px; height: 36px;
  background: var(--primary-light);
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: var(--primary);
  font-weight: 700;
}
.user-name { font-size: 0.85rem; font-weight: 600; }
.user-role { font-size: 0.72rem; color: var(--text-muted); text-transform: capitalize; }

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Page Header ─────────────────────────────────────────────── */
.page-header {
  padding: var(--space-xl) var(--space-xl) var(--space-lg);
  border-bottom: 1px solid var(--divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
}
.page-header-left h1 { font-size: 1.5rem; }
.page-header-left p { font-size: 0.875rem; margin-top: 2px; }

/* ── Page Content ────────────────────────────────────────────── */
.page-content { padding: var(--space-xl); flex: 1; }

/* ── Search Bar ──────────────────────────────────────────────── */
.search-wrapper {
  position: relative;
  flex: 1;
  max-width: 360px;
}
.search-wrapper .search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none; font-size: 0.9rem;
}
.search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px 10px 36px;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition);
}
.search-input:focus { border-color: var(--border-focus); }
.search-input::placeholder { color: var(--text-muted); }

/* ── Stat Cards ──────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}
.stat-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  margin-bottom: var(--space-sm);
}
.stat-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.stat-value { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); margin-top: 2px; }

/* ── Empty State ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-xl);
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: var(--space-md); display: block; }
.empty-state h3 { color: var(--text-secondary); margin-bottom: var(--space-sm); }

/* ── Toast Notifications ─────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  transform: translateX(120%);
  transition: transform var(--transition-slow);
  max-width: 320px;
}
.toast.show { transform: translateX(0); }
.toast-success { border-left: 3px solid var(--success); }
.toast-success .toast-icon { color: var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-error .toast-icon { color: var(--danger); }
.toast-info { border-left: 3px solid var(--info); }
.toast-info .toast-icon { color: var(--info); }
.toast-icon { font-size: 1rem; font-weight: 700; }

/* ── Radio / Checkbox Pills ──────────────────────────────────── */
.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pill-option { position: relative; }
.pill-option input[type="radio"],
.pill-option input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; }
.pill-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}
.pill-label:hover { border-color: rgba(255,255,255,0.12); background: var(--bg-card-hover); }
.pill-option input:checked + .pill-label {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

/* ── Divider ─────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--divider);
  margin: var(--space-md) 0;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-header { padding: var(--space-md); }
  .page-content { padding: var(--space-md); }
}
