/* ============================================================
   Restaurant ERP - Main Stylesheet
   Mobile-first | Bootstrap 5.3 override | Professional theme
   ============================================================ */

/* ---- DESIGN TOKENS ---------------------------------------- */
:root {
  --primary:        #8B1A1A;
  --primary-dark:   #6B0F0F;
  --primary-light:  #B33A3A;
  --secondary:      #D4AF37;
  --secondary-dark: #B8942C;
  --accent:         #FF6B35;
  --success:        #28a745;
  --danger:         #dc3545;
  --warning:        #ffc107;
  --info:           #17a2b8;

  --bg-body:        #f4f1ec;
  --bg-card:        #ffffff;
  --bg-sidebar:     #1a0a0a;
  --bg-header:      #ffffff;
  --text-main:      #2c1a1a;
  --text-muted:     #7a6060;
  --text-sidebar:   #e8d5d5;
  --border-color:   #e0d5c8;

  --sidebar-width:  260px;
  --header-height:  60px;
  --radius:         10px;
  --radius-sm:      6px;
  --shadow:         0 2px 12px rgba(139,26,26,0.08);
  --shadow-md:      0 4px 20px rgba(139,26,26,0.12);
  --shadow-card:    0 1px 6px rgba(0,0,0,0.06);
  --transition:     0.2s ease;
}

/* ---- RESET & BASE ----------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-body);
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ---- LAYOUT ----------------------------------------------- */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1040;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform var(--transition);
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: #4a1a1a transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #4a1a1a; border-radius: 4px; }

.sidebar-brand {
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--header-height);
}
.sidebar-brand img { width: 36px; height: 36px; object-fit: contain; border-radius: 8px; }
.sidebar-brand-text { flex: 1; overflow: hidden; }
.sidebar-brand-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-brand-sub {
  font-size: 10px;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-nav { flex: 1; padding: 8px 0; }
.nav-section-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,0.35);
  padding: 14px 16px 4px;
}
.sidebar-nav .nav-item { margin: 1px 8px; }
.sidebar-nav .nav-link {
  color: var(--text-sidebar);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.sidebar-nav .nav-link i { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-nav .nav-link:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.sidebar-nav .nav-link.active {
  background: var(--primary);
  color: #fff;
}
.sidebar-nav .nav-link .badge {
  margin-left: auto;
  font-size: 10px;
}

/* Collapsible sub-nav */
.sidebar-nav .nav-submenu { padding-left: 10px; }
.sidebar-nav .nav-submenu .nav-link {
  font-size: 12px;
  padding: 7px 12px;
  color: rgba(232,213,213,0.75);
}
.sidebar-nav .nav-submenu .nav-link.active { background: rgba(139,26,26,0.6); color: #fff; }
.sidebar-nav .has-submenu > .nav-link .submenu-arrow {
  margin-left: auto;
  transition: transform var(--transition);
}
.sidebar-nav .has-submenu.open > .nav-link .submenu-arrow {
  transform: rotate(180deg);
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
}
.sidebar-user-avatar {
  width: 34px; height: 34px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 10px; color: var(--secondary); text-transform: capitalize; }

/* Main content area */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  max-width: calc(100vw - var(--sidebar-width));
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition);
}

@media (max-width: 991px) {
  .main-content {
    margin-left: 0;
    max-width: 100vw;
  }
}

/* Header */
.app-header {
  height: var(--header-height);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.sidebar-toggle-btn {
  display: none;
  border: none;
  background: none;
  padding: 6px;
  font-size: 20px;
  color: var(--primary);
  cursor: pointer;
}
.app-header .page-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  flex: 1;
}
.app-header .header-actions { display: flex; align-items: center; gap: 10px; }
.header-date-time { font-size: 12px; color: var(--text-muted); text-align: right; line-height: 1.3; }

/* Page content */
.page-content {
  flex: 1;
  padding: 20px;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* ---- CARDS ----------------------------------------------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border-color);
  padding: 14px 18px;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card-header .card-title { margin: 0; font-size: 15px; font-weight: 700; color: var(--text-main); }
.card-body { padding: 18px; }
.card-footer { background: transparent; border-top: 1px solid var(--border-color); padding: 12px 18px; }

/* Stat cards for dashboard */
.stat-card {
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  color: #fff;
}
.stat-card::after {
  content: '';
  position: absolute;
  right: -20px; top: -20px;
  width: 80px; height: 80px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
}
.stat-card .stat-icon {
  font-size: 28px;
  margin-bottom: 8px;
  opacity: 0.9;
}
.stat-card .stat-value { font-size: 22px; font-weight: 700; line-height: 1; }
.stat-card .stat-label { font-size: 12px; opacity: 0.85; margin-top: 4px; }
.stat-card .stat-change { font-size: 11px; margin-top: 6px; opacity: 0.8; }
.stat-primary { background: linear-gradient(135deg, var(--primary), var(--primary-light)); }
.stat-success { background: linear-gradient(135deg, #28a745, #34c75a); }
.stat-warning { background: linear-gradient(135deg, #e6a817, #ffc107); }
.stat-info    { background: linear-gradient(135deg, #0d7fa0, #17a2b8); }
.stat-purple  { background: linear-gradient(135deg, #5a2d8e, #8b4fcc); }

/* ---- BUTTONS --------------------------------------------- */
.btn { border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; transition: all var(--transition); }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover, .btn-primary:focus { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); }
.btn-secondary-gold { background: var(--secondary); border-color: var(--secondary); color: #1a1a1a; }
.btn-secondary-gold:hover { background: var(--secondary-dark); border-color: var(--secondary-dark); }
.btn-sm { font-size: 12px; padding: 4px 10px; }
.btn-icon { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.btn-action { width: 28px; height: 28px; padding: 0; border-radius: 6px; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }

/* ---- TABLES ---------------------------------------------- */
.table-responsive { border-radius: var(--radius-sm); overflow: hidden; }
.table { margin: 0; }
.table thead th {
  background: #f9f5f0;
  color: var(--text-main);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border-color);
  padding: 12px 14px;
  white-space: nowrap;
}
.table tbody td { padding: 11px 14px; vertical-align: middle; border-color: #f0e8df; font-size: 13px; }
.table tbody tr:hover td { background: #fdf8f3; }
.table-striped tbody tr:nth-of-type(odd) td { background: #faf6f1; }

/* ---- FORMS ----------------------------------------------- */
.form-label { font-size: 13px; font-weight: 600; color: var(--text-main); margin-bottom: 5px; }
.form-control, .form-select {
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
  padding: 8px 12px;
  color: var(--text-main);
  transition: border-color var(--transition), box-shadow var(--transition);
  background-color: #fff;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139,26,26,0.12);
  outline: none;
}
.form-control::placeholder { color: #b0a090; }
.input-group-text {
  background: #f4f1ec;
  border-color: var(--border-color);
  font-size: 13px;
  color: var(--text-muted);
}
.form-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--primary);
  margin-bottom: 14px;
}

/* ---- BADGES ---------------------------------------------- */
.badge { font-size: 11px; font-weight: 600; border-radius: 20px; padding: 4px 9px; }
.badge-status-active    { background: #d4edda; color: #155724; }
.badge-status-hidden    { background: #e2e3e5; color: #383d41; }
.badge-status-cancelled { background: #f8d7da; color: #721c24; }
.badge-status-free      { background: #d4edda; color: #155724; }
.badge-status-occupied  { background: #fff3cd; color: #856404; }
.badge-status-open      { background: #cce5ff; color: #004085; }
.badge-status-billed    { background: #fff3cd; color: #856404; }
.badge-status-paid      { background: #d4edda; color: #155724; }
.badge-dine-in  { background: #d4edda; color: #155724; }
.badge-parcel   { background: #cce5ff; color: #004085; }

/* ---- MODALS ---------------------------------------------- */
.modal-content { border-radius: var(--radius); border: none; box-shadow: var(--shadow-md); }
.modal-header { border-bottom: 1px solid var(--border-color); padding: 16px 20px; }
.modal-header .modal-title { font-weight: 700; font-size: 16px; color: var(--text-main); }
.modal-body { padding: 20px; }
.modal-footer { border-top: 1px solid var(--border-color); padding: 14px 20px; }
.modal-header.bg-danger .modal-title,
.modal-header.bg-danger .btn-close { color: #fff; filter: brightness(0) invert(1); }
.modal-confirm-icon { font-size: 48px; margin-bottom: 12px; }

/* ---- ALERTS ---------------------------------------------- */
.alert { border-radius: var(--radius-sm); font-size: 13px; border: none; }
.alert-success { background: #d4edda; color: #155724; }
.alert-danger   { background: #f8d7da; color: #721c24; }
.alert-warning  { background: #fff3cd; color: #856404; }
.alert-info     { background: #d1ecf1; color: #0c5460; }

/* ---- PAGINATION ------------------------------------------ */
.pagination .page-link {
  color: var(--primary);
  border-color: var(--border-color);
  font-size: 12px;
  padding: 5px 10px;
}
.pagination .page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
}

/* ---- MENU TILE GRID (Waiter Order Page) ------------------- */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}
.menu-tile {
  background: #fff;
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.menu-tile:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow); }
.menu-tile.selected {
  border-color: var(--primary);
  background: #fdf0f0;
}
.menu-tile-image {
  width: 56px; height: 56px;
  object-fit: cover;
  border-radius: 8px;
  margin: 0 auto 8px;
  display: block;
  background: #f4f1ec;
}
.menu-tile-image-placeholder {
  width: 56px; height: 56px;
  background: #f4f1ec;
  border-radius: 8px;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--primary);
}
.menu-tile-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.menu-tile-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}
.menu-tile-qty-badge {
  position: absolute;
  top: -6px; right: -6px;
  background: var(--primary);
  color: #fff;
  width: 22px; height: 22px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* Category tabs for menu */
.category-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; -ms-overflow-style: none; }
.category-tabs::-webkit-scrollbar { display: none; }
.category-tab {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  background: #fff;
  border: 1.5px solid var(--border-color);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition);
  white-space: nowrap;
}
.category-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Order summary panel */
.order-summary { border-radius: var(--radius); background: #fff; border: 1.5px solid var(--border-color); }
.order-summary-header {
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--radius) var(--radius) 0 0;
  font-weight: 700;
  font-size: 14px;
}
.order-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-bottom: 1px solid #f0e8df;
}
.order-item-row:last-child { border-bottom: none; }
.order-item-name { flex: 1; font-size: 13px; font-weight: 500; }
.order-item-qty { font-size: 13px; font-weight: 700; color: var(--primary); min-width: 30px; text-align: center; }
.order-item-total { font-size: 13px; font-weight: 600; min-width: 60px; text-align: right; }
.qty-ctrl { display: flex; align-items: center; gap: 4px; }
.qty-btn {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--border-color);
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.qty-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Table grid (visual selection) */
.table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px; }
.table-tile {
  background: #fff;
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.table-tile.free  { border-color: #28a745; }
.table-tile.occupied { border-color: #dc3545; background: #fff5f5; }
.table-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.table-tile-name { font-size: 13px; font-weight: 700; color: var(--text-main); }
.table-tile-cap  { font-size: 11px; color: var(--text-muted); }
.table-tile-dot  { width: 10px; height: 10px; border-radius: 50%; margin: 4px auto; }
.table-tile.free .table-tile-dot  { background: #28a745; }
.table-tile.occupied .table-tile-dot { background: #dc3545; }

/* KOT card (Kitchen) */
.kot-card {
  background: #fff;
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
  transition: box-shadow var(--transition);
}
.kot-card:hover { box-shadow: var(--shadow-md); }
.kot-card-header {
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.kot-card-header.parcel-header { background: #0d6efd; }
.kot-card-body { padding: 12px 14px; }
.kot-item-row { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed #f0e8df; font-size: 13px; }
.kot-item-row:last-child { border-bottom: none; }
.kot-timer { font-size: 11px; opacity: 0.9; }

/* ---- PURCHASE LINE ITEMS ---------------------------------- */
.purchase-line-item { background: #faf6f1; border-radius: var(--radius-sm); padding: 12px; margin-bottom: 8px; border: 1px solid var(--border-color); }
.purchase-totals-row { font-weight: 700; border-top: 2px solid var(--border-color); padding-top: 10px; }

/* ---- LEDGER TABLE ---------------------------------------- */
.ledger-debit  { color: var(--danger); font-weight: 600; }
.ledger-credit { color: var(--success); font-weight: 600; }
.ledger-balance-positive { color: var(--danger); font-weight: 700; }
.ledger-balance-zero     { color: var(--success); font-weight: 700; }

/* ---- LOGIN PAGE ------------------------------------------ */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #1a0a0a 0%, #3d1515 50%, #1a0a0a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo img { width: 70px; height: 70px; object-fit: contain; border-radius: 14px; margin-bottom: 12px; }
.login-logo h1 { font-size: 22px; font-weight: 800; color: var(--primary); margin: 0; }
.login-logo p  { font-size: 12px; color: var(--text-muted); margin: 4px 0 0; }

/* ---- MOBILE CARDS (replaces table on < 768px) ------------- */
.mobile-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-card);
}
.mobile-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.mobile-card-title { font-size: 14px; font-weight: 700; color: var(--text-main); }
.mobile-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  padding: 3px 0;
  border-bottom: 1px solid #f4f0ea;
}
.mobile-card-row:last-child { border-bottom: none; }
.mobile-card-label { color: var(--text-muted); font-weight: 500; }
.mobile-card-value { font-weight: 600; color: var(--text-main); }

/* Show/hide based on viewport */
.desktop-only { display: none !important; }
.mobile-only  { display: block !important; }
@media (min-width: 768px) {
  .desktop-only { display: block !important; }
  .mobile-only  { display: none !important; }
  .desktop-table { display: table !important; }
  .mobile-cards-list { display: none !important; }
}
@media (max-width: 767px) {
  .desktop-table  { display: none !important; }
  .mobile-cards-list { display: block !important; }
}

/* ---- MISC UTILITIES --------------------------------------- */
.text-primary-custom { color: var(--primary) !important; }
.text-secondary-custom { color: var(--secondary) !important; }
.bg-primary-custom { background: var(--primary) !important; }
.section-divider { border: none; border-top: 2px solid var(--border-color); margin: 20px 0; }
.required-star { color: var(--danger); margin-left: 2px; }
.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-muted);
}
.empty-state i { font-size: 48px; margin-bottom: 12px; color: #d0c0b0; }
.empty-state h5 { font-size: 16px; color: var(--text-muted); }
.empty-state p { font-size: 13px; }
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(255,255,255,0.8);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
}
.spinner-border-primary { color: var(--primary); }

/* Date filters row */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: #fff;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}
.filter-bar .filter-btn {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid var(--border-color);
  background: #fff;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.filter-bar .filter-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---- MOBILE RESPONSIVE ------------------------------------ */
@media (max-width: 991px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 1050;
  }
  .sidebar.show { transform: translateX(0); }
  .sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1045;
  }
  .sidebar-backdrop.show { display: block; }
  .main-content { margin-left: 0; }
  .sidebar-toggle-btn { display: flex; }
  .page-content { padding: 12px; }
  .app-header { padding: 0 12px; }
  .menu-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
  .menu-tile { padding: 10px 6px; }
  .menu-tile-image, .menu-tile-image-placeholder { width: 44px; height: 44px; }
}

@media (max-width: 576px) {
  .card-body { padding: 12px; }
  .card-header { padding: 10px 12px; }
  .page-content { padding: 10px 8px; }
  .menu-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 6px; }
  .stat-card { padding: 14px; }
  .stat-card .stat-value { font-size: 18px; }
  .login-card { padding: 28px 20px; }
}

/* Notification dot */
.notif-dot {
  position: absolute;
  top: 4px; right: 4px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  animation: pulse-notif 1.5s infinite;
}
@keyframes pulse-notif {
  0%   { transform: scale(1); opacity: 1; }
  50%  { transform: scale(1.3); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

/* Search box */
.search-box { position: relative; }
.search-box .form-control { padding-left: 34px; }
.search-box .search-icon {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Toasts (non-blocking success/error) */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; }
.toast-custom {
  min-width: 260px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  border-left: 4px solid var(--primary);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: slideInRight 0.3s ease;
}
.toast-custom.success { border-left-color: var(--success); }
.toast-custom.error   { border-left-color: var(--danger); }
.toast-custom.warning { border-left-color: var(--warning); }
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Print button special */
.btn-print {
  background: linear-gradient(135deg, #2c3e50, #3d5266);
  color: #fff;
  border: none;
}
.btn-print:hover { background: linear-gradient(135deg, #1a2535, #2d3f52); color: #fff; }
