/* =====================================================
   BBQ Portal - Main Stylesheet
   Ember & Smoke Theme
   ===================================================== */

/* Fonts loaded locally via fonts.css — no internet required */

/* ---- CSS Variables ---- */
:root {
  --ember:        #E8571A;
  --ember-dark:   #C44A12;
  --ember-light:  #FF7A42;
  --ember-glow:   rgba(232, 87, 26, 0.15);
  --coal:         #1A1A2E;
  --coal-mid:     #252540;
  --coal-light:   #2E2E50;
  --smoke:        #6B7280;
  --ash:          #9CA3AF;
  --cream:        #FFF8F3;
  --white:        #FFFFFF;
  --surface:      #FFFFFF;
  --surface-2:    #FFF3EC;
  --border:       #F0E8E0;
  --text-dark:    #1C1C1C;
  --text-mid:     #4B5563;
  --text-light:   #9CA3AF;
  --success:      #10B981;
  --success-bg:   #D1FAE5;
  --warning:      #F59E0B;
  --warning-bg:   #FEF3C7;
  --danger:       #EF4444;
  --danger-bg:    #FEE2E2;
  --info:         #3B82F6;
  --info-bg:      #DBEAFE;
  --sidebar-w:    260px;
  --topbar-h:     64px;
  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 2px 12px rgba(0,0,0,0.08);
  --shadow-md:    0 4px 24px rgba(0,0,0,0.12);
  --shadow-lg:    0 8px 40px rgba(0,0,0,0.16);
  --transition:   all 0.22s cubic-bezier(.4,0,.2,1);
}

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

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--cream);
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; }

/* =====================================================
   AUTH / LOGIN PAGE
   ===================================================== */
.auth-body {
  min-height: 100vh;
  background: var(--coal);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.auth-bg-pattern {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(ellipse 80% 60% at 20% 40%, rgba(232,87,26,.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 70%, rgba(232,87,26,.10) 0%, transparent 50%);
  pointer-events: none;
}

.auth-card {
  background: var(--coal-mid);
  border: 1px solid rgba(232,87,26,.2);
  border-radius: 20px;
  padding: 48px 44px;
  width: 420px;
  max-width: calc(100vw - 32px);
  position: relative;
  z-index: 1;
  box-shadow: 0 24px 80px rgba(0,0,0,.5), 0 0 60px rgba(232,87,26,.08);
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}
.auth-logo .flame-icon {
  width: 64px; height: 64px;
  background: linear-gradient(145deg, var(--ember-light), var(--ember-dark));
  border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 32px;
  box-shadow: 0 8px 32px rgba(232,87,26,.4);
  margin-bottom: 16px;
}
.auth-logo h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem; font-weight: 700;
  color: var(--white);
  line-height: 1.2;
}
.auth-logo p {
  font-size: .8rem; color: var(--ash);
  margin-top: 4px; letter-spacing: .05em; text-transform: uppercase;
}

.auth-title { font-size: 1.05rem; font-weight: 600; color: var(--white); margin-bottom: 6px; }
.auth-sub   { font-size: .85rem; color: var(--ash); margin-bottom: 28px; }

.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: .8rem; font-weight: 600;
  color: var(--ash); margin-bottom: 8px; letter-spacing: .04em; text-transform: uppercase;
}

.input-wrap { position: relative; }
.input-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--smoke); font-size: 16px; pointer-events: none;
}
.form-control {
  width: 100%; padding: 12px 14px 12px 42px;
  background: var(--coal-light);
  border: 1.5px solid rgba(255,255,255,.08);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: .9rem;
  transition: var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--ember);
  box-shadow: 0 0 0 3px var(--ember-glow);
  background: rgba(255,255,255,.05);
}
.form-control::placeholder { color: var(--smoke); }

.btn-login {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, var(--ember), var(--ember-dark));
  border: none; border-radius: var(--radius-sm);
  color: var(--white); font-size: .95rem; font-weight: 600;
  letter-spacing: .02em;
  margin-top: 8px;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(232,87,26,.3);
}
.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(232,87,26,.45);
}
.btn-login:active { transform: translateY(0); }

.auth-error {
  background: rgba(239,68,68,.15); border: 1px solid rgba(239,68,68,.3);
  color: #FCA5A5; border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: .85rem; margin-bottom: 18px;
}

/* =====================================================
   LAYOUT: SIDEBAR + TOPBAR
   ===================================================== */
.layout { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--coal);
  position: fixed; top: 0; left: 0; bottom: 0;
  display: flex; flex-direction: column;
  z-index: 100;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}

.sidebar-header {
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.sidebar-logo { display: flex; align-items: center; gap: 12px; }
.sidebar-logo .logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(145deg, var(--ember-light), var(--ember-dark));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(232,87,26,.35);
}
.sidebar-logo-text h2 {
  font-family: 'Playfair Display', serif;
  font-size: .95rem; font-weight: 700;
  color: var(--white); line-height: 1.2;
}
.sidebar-logo-text span {
  font-size: .68rem; color: var(--ember);
  text-transform: uppercase; letter-spacing: .08em; font-weight: 600;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 16px 0; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

.nav-section-label {
  font-size: .65rem; font-weight: 700; color: rgba(255,255,255,.25);
  text-transform: uppercase; letter-spacing: .12em;
  padding: 10px 20px 6px;
}

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 20px;
  color: rgba(255,255,255,.55);
  font-size: .875rem; font-weight: 500;
  border-radius: 0;
  margin: 1px 10px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}
.nav-item .nav-icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
  transition: var(--transition);
}
.nav-item:hover {
  background: rgba(255,255,255,.06);
  color: var(--white);
}
.nav-item.active {
  background: var(--ember-glow);
  color: var(--ember-light);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; background: var(--ember);
  border-radius: 0 2px 2px 0;
  margin-left: -10px;
}
.nav-badge {
  margin-left: auto;
  background: var(--ember); color: #fff;
  font-size: .65rem; font-weight: 700;
  padding: 2px 7px; border-radius: 20px;
  line-height: 1.4;
}

.sidebar-footer {
  padding: 16px 10px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.sidebar-user:hover { background: rgba(255,255,255,.06); }
.user-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--ember), var(--ember-dark));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: white;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-info strong { display: block; font-size: .8rem; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info span   { font-size: .72rem; color: var(--smoke); }
.user-logout { color: var(--smoke); font-size: 14px; transition: var(--transition); }
.user-logout:hover { color: var(--danger); }

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

.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 8px rgba(0,0,0,.05);
}
.topbar-toggle { display: none; }
.topbar-breadcrumb { flex: 1; }
.topbar-breadcrumb h1 { font-size: 1.05rem; font-weight: 700; color: var(--text-dark); }
.topbar-breadcrumb p  { font-size: .78rem; color: var(--text-light); margin-top: 1px; }

.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-time {
  font-size: .8rem; color: var(--text-mid); font-weight: 500;
  background: var(--cream); padding: 6px 12px; border-radius: 20px;
  border: 1px solid var(--border);
}

/* ---- Page Content ---- */
.page-content { flex: 1; padding: 28px; }

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

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex; align-items: flex-start; gap: 16px;
  transition: var(--transition);
  position: relative; overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
  background: var(--color, var(--ember));
  border-radius: 0 0 var(--radius) var(--radius);
}
.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: 22px; flex-shrink: 0;
}
.stat-body { flex: 1; min-width: 0; }
.stat-label { font-size: .75rem; font-weight: 600; color: var(--text-light); text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 1.6rem; font-weight: 700; color: var(--text-dark); line-height: 1.2; margin: 3px 0; }
.stat-sub   { font-size: .75rem; color: var(--text-light); }
.stat-trend { font-size: .72rem; font-weight: 600; }
.stat-trend.up   { color: var(--success); }
.stat-trend.down { color: var(--danger);  }

/* Color variants */
.stat-card.orange  { --color: var(--ember);   }
.stat-card.orange  .stat-icon { background: var(--ember-glow); }
.stat-card.green   { --color: var(--success); }
.stat-card.green   .stat-icon { background: var(--success-bg); }
.stat-card.blue    { --color: var(--info);    }
.stat-card.blue    .stat-icon { background: var(--info-bg); }
.stat-card.yellow  { --color: var(--warning); }
.stat-card.yellow  .stat-icon { background: var(--warning-bg); }
.stat-card.purple  { --color: #8B5CF6;        }
.stat-card.purple  .stat-icon { background: #EDE9FE; }

/* =====================================================
   CARDS & SECTIONS
   ===================================================== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-title { font-size: .95rem; font-weight: 700; color: var(--text-dark); }
.card-sub   { font-size: .78rem; color: var(--text-light); margin-top: 2px; }
.card-body  { padding: 22px; }

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: .85rem; font-weight: 600;
  border: none; outline: none;
  transition: var(--transition);
  line-height: 1;
  cursor: pointer;
}
.btn-sm  { padding: 6px 12px; font-size: .78rem; }
.btn-lg  { padding: 12px 24px; font-size: .95rem; }
.btn-icon{ padding: 8px; }
.btn-block { width: 100%; justify-content: center; }

.btn-primary   { background: var(--ember); color: #fff; box-shadow: 0 2px 10px rgba(232,87,26,.25); }
.btn-primary:hover   { background: var(--ember-dark); box-shadow: 0 4px 18px rgba(232,87,26,.35); transform: translateY(-1px); }
.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover   { filter: brightness(1.1); }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover    { filter: brightness(1.1); }
.btn-warning   { background: var(--warning); color: #fff; }
.btn-outline   { background: transparent; color: var(--ember); border: 1.5px solid var(--ember); }
.btn-outline:hover   { background: var(--ember-glow); }
.btn-ghost     { background: var(--cream); color: var(--text-mid); border: 1.5px solid var(--border); }
.btn-ghost:hover     { background: var(--border); }
.btn-dark      { background: var(--coal); color: #fff; }
.btn-dark:hover      { background: var(--coal-mid); }

/* =====================================================
   TABLES
   ===================================================== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--cream);
  font-size: .72rem; font-weight: 700; color: var(--text-light);
  text-transform: uppercase; letter-spacing: .06em;
  padding: 12px 16px; text-align: left;
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 13px 16px;
  font-size: .86rem; color: var(--text-mid);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--cream); }
tbody tr.highlight td { background: rgba(232,87,26,.04); }

/* =====================================================
   BADGES / STATUS
   ===================================================== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px;
  font-size: .72rem; font-weight: 600;
  white-space: nowrap;
}
.badge-pending   { background: var(--warning-bg); color: #92400E; }
.badge-preparing { background: var(--info-bg);    color: #1E40AF; }
.badge-ready     { background: #E9D5FF;           color: #6D28D9; }
.badge-delivered { background: var(--success-bg); color: #065F46; }
.badge-cancelled { background: var(--danger-bg);  color: #991B1B; }
.badge-paid      { background: var(--success-bg); color: #065F46; }
.badge-cash      { background: #D1FAE5; color: #065F46; }
.badge-card      { background: var(--info-bg);    color: #1E40AF; }
.badge-online    { background: #E9D5FF;           color: #6D28D9; }
.badge-dine-in   { background: #FEF3C7; color: #92400E; }
.badge-takeaway  { background: #DBEAFE; color: #1E40AF; }
.badge-delivery  { background: var(--ember-glow); color: var(--ember-dark); }
.badge::before { content: '●'; font-size: 8px; }

/* =====================================================
   FORM ELEMENTS
   ===================================================== */
.field-group { margin-bottom: 18px; }
.field-label {
  display: block; font-size: .78rem; font-weight: 600;
  color: var(--text-mid); margin-bottom: 7px;
}
.field-required::after { content: ' *'; color: var(--ember); }

.field-input, .field-select, .field-textarea {
  width: 100%; padding: 10px 14px;
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dark);
  font-size: .875rem;
  outline: none;
  transition: var(--transition);
}
.field-input:focus, .field-select:focus, .field-textarea:focus {
  border-color: var(--ember);
  background: var(--white);
  box-shadow: 0 0 0 3px var(--ember-glow);
}
.field-textarea { resize: vertical; min-height: 90px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* =====================================================
   PRODUCT ITEMS GRID (CREATE ORDER)
   ===================================================== */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.item-card {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  user-select: none;
}
.item-card:hover {
  border-color: var(--ember-light);
  box-shadow: 0 4px 16px rgba(232,87,26,.15);
  transform: translateY(-2px);
}
.item-card.selected {
  border-color: var(--ember);
  box-shadow: 0 0 0 3px var(--ember-glow), 0 4px 16px rgba(232,87,26,.2);
}
.item-card.unavailable { opacity: .45; pointer-events: none; }

.item-img {
  width: 100%; aspect-ratio: 1;
  object-fit: cover; display: block;
  background: var(--cream);
}
.item-img-placeholder {
  width: 100%; aspect-ratio: 1;
  background: linear-gradient(135deg, var(--cream), #FFE8D6);
  display: flex; align-items: center; justify-content: center;
  font-size: 44px;
}
.item-body { padding: 10px; }
.item-name { font-size: .8rem; font-weight: 600; color: var(--text-dark); line-height: 1.3; }
.item-price { font-size: .85rem; font-weight: 700; color: var(--ember); margin-top: 3px; }
.item-badge-wrap {
  position: absolute; top: 7px; right: 7px;
}
.item-qty-badge {
  background: var(--ember); color: white;
  font-size: .72rem; font-weight: 700;
  width: 22px; height: 22px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

/* Category tabs */
.cat-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.cat-tab {
  padding: 7px 14px;
  border-radius: 20px;
  font-size: .8rem; font-weight: 500;
  background: var(--white); border: 1.5px solid var(--border);
  color: var(--text-mid);
  cursor: pointer; transition: var(--transition);
}
.cat-tab:hover  { border-color: var(--ember-light); color: var(--ember); }
.cat-tab.active { background: var(--ember); border-color: var(--ember); color: white; }

/* =====================================================
   ORDER CART PANEL
   ===================================================== */
.order-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
  align-items: start;
}

.cart-panel {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: sticky; top: calc(var(--topbar-h) + 20px);
  display: flex; flex-direction: column;
  max-height: calc(100vh - var(--topbar-h) - 56px);
}
.cart-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.cart-title { font-size: .9rem; font-weight: 700; color: var(--text-dark); }
.cart-count {
  background: var(--ember-glow); color: var(--ember);
  font-size: .75rem; font-weight: 700;
  padding: 3px 9px; border-radius: 20px;
}
.cart-items { flex: 1; overflow-y: auto; padding: 12px; }
.cart-items::-webkit-scrollbar { width: 4px; }
.cart-items::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.cart-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); margin-bottom: 8px;
  background: var(--cream);
}
.cart-item-name { flex: 1; font-size: .82rem; font-weight: 600; color: var(--text-dark); }
.cart-item-price { font-size: .8rem; color: var(--text-mid); }
.cart-item-sub   { font-size: .78rem; color: var(--ember); font-weight: 600; min-width: 58px; text-align: right; }
.qty-ctrl { display: flex; align-items: center; gap: 4px; }
.qty-btn {
  width: 24px; height: 24px;
  border-radius: 6px; border: 1.5px solid var(--border);
  background: var(--white); color: var(--text-mid);
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--transition);
  line-height: 1;
}
.qty-btn:hover { border-color: var(--ember); color: var(--ember); }
.qty-val { font-size: .85rem; font-weight: 700; color: var(--text-dark); min-width: 18px; text-align: center; }

.cart-empty {
  text-align: center; padding: 40px 20px;
  color: var(--text-light);
}
.cart-empty .empty-icon { font-size: 48px; margin-bottom: 10px; }
.cart-empty p { font-size: .85rem; }

.cart-footer { padding: 14px 18px; border-top: 1px solid var(--border); }
.cart-totals { margin-bottom: 14px; }
.cart-line {
  display: flex; justify-content: space-between;
  font-size: .82rem; color: var(--text-mid); margin-bottom: 6px;
}
.cart-line.total {
  font-size: .95rem; font-weight: 700;
  color: var(--text-dark); margin-top: 8px; padding-top: 8px;
  border-top: 1.5px solid var(--border);
}
.cart-line.total .amount { color: var(--ember); }

/* =====================================================
   PRODUCT MANAGEMENT
   ===================================================== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.product-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
}
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.product-card-img {
  width: 100%; aspect-ratio: 16/10;
  object-fit: cover; background: var(--cream);
}
.product-card-img-placeholder {
  width: 100%; aspect-ratio: 16/10;
  background: linear-gradient(135deg, #FFF3EC, #FFE0C8);
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
}
.product-card-body { padding: 14px; }
.product-card-name { font-size: .9rem; font-weight: 700; color: var(--text-dark); margin-bottom: 4px; }
.product-card-cat  { font-size: .73rem; color: var(--ember); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.product-card-price{ font-size: 1rem; font-weight: 700; color: var(--coal); margin: 8px 0 10px; }
.product-card-actions { display: flex; gap: 8px; }

/* =====================================================
   FILTERS BAR
   ===================================================== */
.filter-bar {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  padding: 16px 20px;
  background: var(--cream);
  border-bottom: 1px solid var(--border);
}
.filter-bar .field-input,
.filter-bar .field-select { max-width: 200px; padding: 8px 12px; }
.filter-bar .search-input { min-width: 240px; }
.filter-actions { display: flex; gap: 8px; margin-left: auto; }

/* =====================================================
   MODALS
   ===================================================== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  display: none; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(3px);
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 540px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  animation: modalIn .22s cubic-bezier(.4,0,.2,1);
}
.modal-lg { max-width: 740px; }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 1rem; font-weight: 700; color: var(--text-dark); }
.modal-close {
  width: 32px; height: 32px;
  border-radius: 8px; border: none;
  background: var(--cream); color: var(--text-mid);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; cursor: pointer; transition: var(--transition);
}
.modal-close:hover { background: var(--danger-bg); color: var(--danger); }
.modal-body   { padding: 22px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* =====================================================
   RECEIPT / THERMAL PRINT
   ===================================================== */
@media print {
  body > * { display: none !important; }
  .print-receipt { display: block !important; }
}
.print-receipt {
  display: none;
  width: 80mm; margin: 0 auto;
  font-family: 'Courier New', monospace;
  font-size: 11px; color: #000;
}
.receipt-title { text-align: center; font-weight: bold; font-size: 14px; }
.receipt-sub   { text-align: center; font-size: 10px; }
.receipt-divider { border: none; border-top: 1px dashed #000; margin: 6px 0; }
.receipt-table { width: 100%; }
.receipt-table td { padding: 2px 0; }
.receipt-table .r { text-align: right; }
.receipt-total { font-weight: bold; font-size: 13px; }
.receipt-footer { text-align: center; font-size: 10px; margin-top: 8px; }

/* =====================================================
   REVENUE CHARTS
   ===================================================== */
.chart-wrap { position: relative; padding: 8px 0; }
.chart-bars { display: flex; align-items: flex-end; gap: 8px; height: 140px; }
.chart-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.chart-bar {
  width: 100%; border-radius: 4px 4px 0 0;
  background: linear-gradient(to top, var(--ember-dark), var(--ember-light));
  transition: height .5s cubic-bezier(.4,0,.2,1);
  min-height: 4px;
  cursor: pointer; position: relative;
}
.chart-bar:hover { filter: brightness(1.1); }
.chart-bar-label { font-size: .65rem; color: var(--text-light); white-space: nowrap; }
.chart-bar-val   { font-size: .65rem; font-weight: 700; color: var(--ember); white-space: nowrap; }

/* =====================================================
   TOAST NOTIFICATIONS
   ===================================================== */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 9999;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--coal);
  color: var(--white);
  padding: 12px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: .85rem; font-weight: 500;
  min-width: 260px; max-width: 360px;
  animation: toastIn .3s cubic-bezier(.4,0,.2,1);
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger);  }
.toast.info    { border-left: 3px solid var(--info);    }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: none; }
}

/* =====================================================
   UTILITIES
   ===================================================== */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-ember  { color: var(--ember); }
.text-muted  { color: var(--text-light); }
.text-success{ color: var(--success); }
.text-danger { color: var(--danger); }
.fw-bold     { font-weight: 700; }
.d-flex      { display: flex; }
.align-center{ align-items: center; }
.gap-2       { gap: 8px; }
.gap-3       { gap: 12px; }
.mb-0        { margin-bottom: 0; }
.mb-2        { margin-bottom: 8px; }
.mb-3        { margin-bottom: 12px; }
.mb-4        { margin-bottom: 18px; }
.mb-5        { margin-bottom: 24px; }
.mt-3        { margin-top: 12px; }
.mt-4        { margin-top: 18px; }
.p-0         { padding: 0; }
.page-heading{
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem; font-weight: 700; color: var(--text-dark);
}
.page-desc { font-size: .85rem; color: var(--text-light); margin-top: 4px; }

.empty-state {
  text-align: center; padding: 64px 24px;
  color: var(--text-light);
}
.empty-state .empty-icon { font-size: 56px; margin-bottom: 12px; }
.empty-state h3 { font-size: 1rem; font-weight: 600; color: var(--text-mid); }
.empty-state p  { font-size: .85rem; margin-top: 6px; }

.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* Pulse for live indicator */
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.5} }
.live-dot {
  width: 8px; height: 8px; background: var(--success);
  border-radius: 50%; animation: pulse 2s infinite;
  display: inline-block; margin-right: 6px;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1024px) {
  .order-layout { grid-template-columns: 1fr; }
  .cart-panel { position: static; max-height: 500px; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar {
    width: 260px;
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .main-wrap { margin-left: 0; }
  .topbar-toggle { display: flex; }
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .items-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: 1fr 1fr; }
}
