/* ============================================
   QR Room Service — Professional Admin Theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&display=swap');

/* ─── Design Tokens ─────────────────────────── */
:root {
  /* Brand */
  --blue-900: #0f172a;
  --blue-800: #1e1b4b;
  --blue-700: #312e81;
  --blue-600: #1a237e;
  --blue-500: #3730a3;
  --blue-400: #4f46e5;
  --blue-100: #e0e7ff;
  --blue-50:  #eef2ff;

  --orange:   #f97316;
  --orange-lt:#fff7ed;

  /* Neutrals */
  --gray-950: #0a0a0a;
  --gray-900: #111827;
  --gray-800: #1f2937;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --gray-50:  #f9fafb;
  --white:    #ffffff;

  /* Semantic */
  --success:    #059669;
  --success-lt: #d1fae5;
  --warning:    #d97706;
  --warning-lt: #fef3c7;
  --danger:     #dc2626;
  --danger-lt:  #fee2e2;
  --info:       #0284c7;
  --info-lt:    #e0f2fe;

  /* Layout */
  --sidebar-w:  260px;
  --sidebar-collapsed: 72px;
  --header-h:   64px;

  /* Misc */
  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  14px;
  --radius-xl:  20px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow:     0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.05);
  --shadow-lg:  0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);
  --shadow-xl:  0 20px 25px -5px rgba(0,0,0,.1), 0 10px 10px -5px rgba(0,0,0,.04);
  --transition: all .2s cubic-bezier(.4,0,.2,1);
}

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

/* ─── Base ───────────────────────────────────── */
body {
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  color: var(--gray-800);
  background: var(--gray-50);
  direction: rtl;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { font-family: 'Cairo', sans-serif; cursor: pointer; }
input, select, textarea { font-family: 'Cairo', sans-serif; }

/* ─── Scrollbar ──────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ════════════════════════════════════════════════
   LAYOUT
════════════════════════════════════════════════ */
.admin-body {
  display: flex;
  min-height: 100vh;
  background: var(--gray-50);
}

/* ─── Sidebar ────────────────────────────────── */
.admin-sidebar {
  width: var(--sidebar-w);
  background: var(--blue-900);
  color: var(--white);
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: width .3s cubic-bezier(.4,0,.2,1), transform .3s cubic-bezier(.4,0,.2,1), box-shadow .3s ease;
  overflow: hidden;
  box-shadow: -4px 0 24px rgba(0,0,0,.15);
}

.admin-sidebar.collapsed { width: var(--sidebar-collapsed); }

/* Sidebar header */
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
  min-height: 72px;
}

.sidebar-logo-wrap {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--blue-400), var(--orange));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(79,70,229,.4);
}

.sidebar-brand {
  overflow: hidden;
  transition: opacity .2s, width .2s;
  white-space: nowrap;
}
.sidebar-brand .name  { font-size: 15px; font-weight: 700; line-height: 1.2; }
.sidebar-brand .sub   { font-size: 11px; color: rgba(255,255,255,.45); margin-top: 1px; }
.admin-sidebar.collapsed .sidebar-brand { opacity: 0; width: 0; }

/* Sidebar nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0;
}

.nav-section-label {
  padding: 10px 18px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,.3);
  white-space: nowrap;
  overflow: hidden;
}
.admin-sidebar.collapsed .nav-section-label { opacity: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  color: rgba(255,255,255,.6);
  transition: var(--transition);
  border-radius: 0;
  position: relative;
  white-space: nowrap;
  text-decoration: none;
  margin: 1px 8px;
  border-radius: var(--radius-sm);
}

.nav-item:hover {
  background: rgba(255,255,255,.07);
  color: var(--white);
}

.nav-item.active {
  background: rgba(79,70,229,.25);
  color: var(--white);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  right: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--orange);
  border-radius: 99px 0 0 99px;
}

.nav-item-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-item.active .nav-item-icon {
  background: rgba(79,70,229,.3);
  color: var(--blue-100);
}

.nav-item-text {
  font-size: 13.5px;
  font-weight: 500;
  flex: 1;
  transition: opacity .2s;
}
.admin-sidebar.collapsed .nav-item-text { opacity: 0; width: 0; overflow: hidden; }

.nav-badge {
  background: var(--danger);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
  line-height: 1.4;
  transition: opacity .2s;
}
.admin-sidebar.collapsed .nav-badge { opacity: 0; }

/* Sidebar footer — user */
.sidebar-footer {
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-400), var(--blue-500));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
  color: var(--white);
}

.sidebar-user-info {
  overflow: hidden;
  flex: 1;
  transition: opacity .2s;
  white-space: nowrap;
}
.sidebar-user-info .uname { font-size: 13px; font-weight: 600; }
.sidebar-user-info .urole { font-size: 11px; color: rgba(255,255,255,.45); }
.admin-sidebar.collapsed .sidebar-user-info { opacity: 0; width: 0; }

/* Collapse toggle */
.sidebar-toggle {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.08);
  border: none;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.5);
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
  font-size: 13px;
}
.sidebar-toggle:hover { background: rgba(255,255,255,.14); color: var(--white); }
.admin-sidebar.collapsed .sidebar-toggle { transform: scaleX(-1); }

/* Tooltip when collapsed */
.admin-sidebar.collapsed .nav-item:hover::after {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%; transform: translateY(-50%);
  background: var(--gray-900);
  color: var(--white);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--shadow);
  z-index: 200;
}

/* ─── Main Content ───────────────────────────── */
.admin-main {
  flex: 1;
  margin-right: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-right .25s cubic-bezier(.4,0,.2,1);
}

.admin-body.sidebar-collapsed .admin-main { margin-right: var(--sidebar-collapsed); }

/* ─── Header ─────────────────────────────────── */
.admin-header {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 99;
  box-shadow: var(--shadow-sm);
}

/* Hamburger — mobile */
.header-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border: none;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  color: var(--gray-600);
  font-size: 16px;
  transition: var(--transition);
}
.header-hamburger:hover { background: var(--gray-200); }

/* Search */
.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-100);
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  padding: 8px 14px;
  flex: 1;
  max-width: 340px;
  transition: var(--transition);
}
.header-search:focus-within {
  border-color: var(--blue-400);
  background: var(--white);
  box-shadow: 0 0 0 3px var(--blue-50);
}
.header-search i { color: var(--gray-400); font-size: 14px; }
.header-search input {
  border: none;
  background: none;
  outline: none;
  font-size: 13.5px;
  color: var(--gray-800);
  width: 100%;
}
.header-search input::placeholder { color: var(--gray-400); }

/* Header right actions */
.header-actions { display: flex; align-items: center; gap: 8px; }

.header-btn {
  position: relative;
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--gray-100);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--gray-500);
  transition: var(--transition);
}
.header-btn:hover { background: var(--gray-200); color: var(--gray-700); }

.notif-dot {
  position: absolute;
  top: 6px; left: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--white);
}
.notif-count {
  position: absolute;
  top: 4px; left: 4px;
  min-width: 16px; height: 16px;
  background: var(--danger);
  color: var(--white);
  font-size: 9px;
  font-weight: 700;
  border-radius: 99px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--white);
  padding: 0 3px;
}

/* Header divider */
.header-divider {
  width: 1px;
  height: 28px;
  background: var(--gray-200);
  margin: 0 4px;
}

/* Header user chip */
.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  border: 1.5px solid transparent;
}
.header-user:hover { background: var(--gray-100); border-color: var(--gray-200); }

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-400));
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
  flex-shrink: 0;
}

.user-info { line-height: 1.25; }
.user-name { font-size: 13px; font-weight: 600; color: var(--gray-800); }
.user-role { font-size: 11px; color: var(--gray-500); }

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

/* Page header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.page-title-wrap h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1.2;
}

.page-subtitle {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 3px;
}

.page-actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 6px;
}
.breadcrumb a { color: var(--blue-500); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--gray-300); }

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

.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.stat-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.stat-card.c-blue::before   { background: linear-gradient(90deg, var(--blue-600), var(--blue-400)); }
.stat-card.c-green::before  { background: linear-gradient(90deg, #059669, #34d399); }
.stat-card.c-orange::before { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.stat-card.c-red::before    { background: linear-gradient(90deg, var(--danger), #f87171); }
.stat-card.c-purple::before { background: linear-gradient(90deg, #7c3aed, #a78bfa); }
.stat-card.c-teal::before   { background: linear-gradient(90deg, var(--info), #38bdf8); }

.stat-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.stat-icon-box {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.stat-card.c-blue   .stat-icon-box { background: var(--blue-50);  color: var(--blue-600); }
.stat-card.c-green  .stat-icon-box { background: var(--success-lt); color: var(--success); }
.stat-card.c-orange .stat-icon-box { background: var(--warning-lt); color: var(--warning); }
.stat-card.c-red    .stat-icon-box { background: var(--danger-lt);  color: var(--danger); }
.stat-card.c-purple .stat-icon-box { background: #f5f3ff; color: #7c3aed; }
.stat-card.c-teal   .stat-icon-box { background: var(--info-lt);   color: var(--info); }

.stat-trend {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 99px;
  display: flex; align-items: center; gap: 3px;
}
.stat-trend.up   { background: var(--success-lt); color: var(--success); }
.stat-trend.down { background: var(--danger-lt);  color: var(--danger); }
.stat-trend.neutral { background: var(--gray-100); color: var(--gray-500); }

.stat-value {
  font-size: 30px;
  font-weight: 900;
  color: var(--gray-900);
  line-height: 1;
  margin-bottom: 4px;
  font-feature-settings: "tnum";
}

.stat-label {
  font-size: 12.5px;
  color: var(--gray-500);
  font-weight: 500;
}

/* ════════════════════════════════════════════════
   CARDS & CONTAINERS
════════════════════════════════════════════════ */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title i {
  width: 28px; height: 28px;
  background: var(--blue-50);
  color: var(--blue-600);
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.card-actions { display: flex; gap: 8px; align-items: center; }

.card-body { padding: 20px; }
.card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
}

/* ════════════════════════════════════════════════
   TABLES
════════════════════════════════════════════════ */
.table-container {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}
.table-container .data-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 900px) {
  .table-header { flex-wrap: wrap; gap: 10px; }
  .table-actions { width: 100%; }
  .table-actions .header-search { flex: 1; }
  .data-table thead th, .data-table tbody td { padding: 10px 12px; font-size: 12.5px; }
}

.table-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--white);
}

.table-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
}

.table-actions { display: flex; gap: 8px; }

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

.data-table thead th {
  background: var(--gray-50);
  padding: 11px 16px;
  text-align: right;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .6px;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

.data-table tbody td {
  padding: 13px 16px;
  font-size: 13.5px;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr {
  transition: background .15s;
}
.data-table tbody tr:hover { background: var(--blue-50); }

/* Table row highlight for new/pending */
.data-table tbody tr.row-new {
  background: #fffbeb;
  border-right: 3px solid var(--warning);
}
.data-table tbody tr.row-new:hover { background: #fef3c7; }

/* Inline search */
.table-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-100);
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  transition: var(--transition);
}
.table-search:focus-within { border-color: var(--blue-400); background: var(--white); }
.table-search i { color: var(--gray-400); font-size: 13px; }
.table-search input {
  border: none; background: none; outline: none;
  font-size: 13px; color: var(--gray-700); width: 200px;
}

/* ════════════════════════════════════════════════
   STATUS BADGES
════════════════════════════════════════════════ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

/* Order statuses */
.status-badge.pending    { background: var(--warning-lt); color: #92400e; }
.status-badge.processing { background: var(--info-lt);    color: #075985; }
.status-badge.in_progress{ background: #f5f3ff;            color: #5b21b6; }
.status-badge.completed  { background: var(--success-lt); color: #065f46; }
.status-badge.cancelled  { background: var(--danger-lt);  color: #991b1b; }

/* Room statuses */
.status-badge.available   { background: var(--success-lt); color: #065f46; }
.status-badge.occupied    { background: var(--warning-lt); color: #92400e; }
.status-badge.maintenance { background: var(--danger-lt);  color: #991b1b; }
.status-badge.cleaning    { background: var(--info-lt);    color: #075985; }

/* Generic */
.status-badge.active   { background: var(--success-lt); color: #065f46; }
.status-badge.inactive { background: var(--gray-100);   color: var(--gray-500); }

/* Dot indicator */
.status-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .7;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════
   ACTION BUTTONS (table cells)
════════════════════════════════════════════════ */
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 32px; height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}
.action-btn span { display: none; }

.action-btn.view    { background: var(--info-lt);    color: var(--info); }
.action-btn.edit    { background: var(--warning-lt); color: var(--warning); }
.action-btn.delete  { background: var(--danger-lt);  color: var(--danger); }
.action-btn.success { background: var(--success-lt); color: var(--success); }
.action-btn.qr      { background: var(--blue-50);    color: var(--blue-600); }

.action-btn:hover { filter: brightness(.92); transform: scale(1.08); }

.btn-group { display: flex; gap: 6px; align-items: center; }

/* ════════════════════════════════════════════════
   BUTTONS
════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  line-height: 1;
  white-space: nowrap;
}

.btn-primary {
  background: var(--blue-600);
  color: var(--white);
  box-shadow: 0 1px 2px rgba(26,35,126,.3);
}
.btn-primary:hover {
  background: var(--blue-700);
  box-shadow: 0 4px 12px rgba(26,35,126,.3);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--white);
  color: var(--gray-700);
  border: 1.5px solid var(--gray-300);
}
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-400); }

.btn-success {
  background: var(--success);
  color: var(--white);
  box-shadow: 0 1px 2px rgba(5,150,105,.3);
}
.btn-success:hover { background: #047857; transform: translateY(-1px); }

.btn-danger {
  background: var(--danger);
  color: var(--white);
  box-shadow: 0 1px 2px rgba(220,38,38,.3);
}
.btn-danger:hover { background: #b91c1c; transform: translateY(-1px); }

.btn-warning {
  background: var(--warning);
  color: var(--white);
}
.btn-warning:hover { background: #b45309; }

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  border: 1.5px solid var(--gray-200);
}
.btn-ghost:hover { background: var(--gray-100); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-icon { padding: 8px; width: 36px; height: 36px; justify-content: center; }

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

/* ════════════════════════════════════════════════
   FORMS
════════════════════════════════════════════════ */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.form-label .required { color: var(--danger); margin-right: 2px; }

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--gray-800);
  background: var(--white);
  transition: var(--transition);
  line-height: 1.5;
}
/* legacy compat */
label { font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; display: block; }
.required { color: var(--danger); }

.form-control:focus {
  outline: none;
  border-color: var(--blue-400);
  box-shadow: 0 0 0 3px var(--blue-50);
}
.form-control.error { border-color: var(--danger); }
.form-control::placeholder { color: var(--gray-400); }

textarea.form-control {
  resize: vertical;
  min-height: 90px;
}
select.form-control { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 12px center; background-size: 16px; padding-left: 36px; }

.form-hint { font-size: 11.5px; color: var(--gray-500); margin-top: 4px; }
.form-error { font-size: 11.5px; color: var(--danger); margin-top: 4px; }

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

/* ════════════════════════════════════════════════
   MODALS
════════════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.5);
  backdrop-filter: blur(3px);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.active { display: flex; animation: fadeIn .15s ease; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  background: var(--white);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalSlide .2s cubic-bezier(.34,1.56,.64,1);
}

@keyframes modalSlide {
  from { transform: translateY(-16px) scale(.97); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-box-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--white);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  z-index: 1;
}
.modal-box-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
}

.modal-close {
  width: 30px; height: 30px;
  border: none;
  background: var(--gray-100);
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  color: var(--gray-500);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.modal-close:hover { background: var(--gray-200); color: var(--gray-700); }

.modal-box-body { padding: 22px; }

.modal-box-footer {
  padding: 16px 22px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--gray-50);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* ════════════════════════════════════════════════
   ALERTS
════════════════════════════════════════════════ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 13.5px;
  border-right: 4px solid;
}
.alert i { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

.alert-success { background: var(--success-lt); color: #064e3b; border-color: var(--success); }
.alert-danger  { background: var(--danger-lt);  color: #7f1d1d; border-color: var(--danger); }
.alert-warning { background: var(--warning-lt); color: #78350f; border-color: var(--warning); }
.alert-info    { background: var(--info-lt);    color: #0c4a6e; border-color: var(--info); }

/* ════════════════════════════════════════════════
   TABS
════════════════════════════════════════════════ */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 24px;
}

.tab {
  padding: 10px 20px;
  border: none;
  background: transparent;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 7px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.tab:hover { color: var(--blue-600); background: var(--blue-50); }
.tab.active { color: var(--blue-600); border-bottom-color: var(--blue-600); }

/* ════════════════════════════════════════════════
   QR CODE MODAL
════════════════════════════════════════════════ */
.qr-display-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
}

#qrCodeCanvas {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 8px solid var(--white);
  outline: 1px solid var(--gray-200);
}

.qr-room-label {
  margin-top: 14px;
  font-size: 18px;
  font-weight: 800;
  color: var(--gray-900);
}

.qr-url-text {
  margin-top: 6px;
  font-size: 11px;
  color: var(--gray-400);
  word-break: break-all;
  text-align: center;
  max-width: 280px;
}

.qr-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

/* ════════════════════════════════════════════════
   NOTIFICATION DROPDOWN
════════════════════════════════════════════════ */
.notif-dropdown {
  display: none;
  position: fixed;
  top: calc(var(--header-h) + 8px);
  left: 24px;
  width: 360px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--gray-200);
  z-index: 200;
  animation: modalSlide .2s ease;
}
.notif-dropdown.open { display: block; }

.notif-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.notif-header h4 { font-size: 14px; font-weight: 700; color: var(--gray-900); }
.notif-mark-all { font-size: 12px; color: var(--blue-500); cursor: pointer; background: none; border: none; }
.notif-mark-all:hover { text-decoration: underline; }

.notif-list { max-height: 320px; overflow-y: auto; }

.notif-item {
  display: flex;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: var(--transition);
}
.notif-item:hover { background: var(--gray-50); }
.notif-item.unread { background: var(--blue-50); }
.notif-item:last-child { border-bottom: none; }

.notif-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--warning-lt);
  color: var(--warning);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.notif-icon.type-new_order { background: var(--warning-lt); color: var(--warning); }
.notif-icon.type-status_change { background: var(--info-lt); color: var(--info); }
.notif-icon.type-system { background: var(--gray-100); color: var(--gray-500); }

.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 13px; font-weight: 600; color: var(--gray-800); }
.notif-msg   { font-size: 12px; color: var(--gray-500); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-time  { font-size: 11px; color: var(--gray-400); margin-top: 3px; }

.notif-footer {
  padding: 10px 18px;
  border-top: 1px solid var(--gray-100);
  text-align: center;
}
.notif-footer a { font-size: 12.5px; color: var(--blue-500); font-weight: 600; }

/* ════════════════════════════════════════════════
   EMPTY STATE
════════════════════════════════════════════════ */
.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--gray-400);
}
.empty-state .empty-icon {
  font-size: 52px;
  margin-bottom: 16px;
  opacity: .4;
}
.empty-state h3 { font-size: 16px; font-weight: 700; color: var(--gray-600); margin-bottom: 6px; }
.empty-state p  { font-size: 13px; }

/* ════════════════════════════════════════════════
   LOADING / SKELETON
════════════════════════════════════════════════ */
.spinner-ring {
  display: inline-block;
  width: 22px; height: 22px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--blue-600);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ════════════════════════════════════════════════
   TOAST NOTIFICATIONS
════════════════════════════════════════════════ */
#adminToastContainer {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  max-width: 360px;
}

.admin-toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--gray-900);
  color: var(--white);
  padding: 14px 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  animation: toastIn .3s cubic-bezier(.34,1.56,.64,1);
  border-right: 4px solid var(--blue-400);
}
.admin-toast.success { border-color: var(--success); }
.admin-toast.error   { border-color: var(--danger); }
.admin-toast.warning { border-color: var(--warning); }

@keyframes toastIn {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

.admin-toast .t-icon { font-size: 18px; flex-shrink: 0; }
.admin-toast .t-body { flex: 1; }
.admin-toast .t-title { font-size: 13.5px; font-weight: 700; }
.admin-toast .t-msg   { font-size: 12px; opacity: .75; margin-top: 2px; }

/* ════════════════════════════════════════════════
   LIVE INDICATOR (real-time polling badge)
════════════════════════════════════════════════ */
.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--success);
}
.live-dot::before {
  content: '';
  width: 7px; height: 7px;
  background: var(--success);
  border-radius: 50%;
  animation: livePulse 1.4s ease infinite;
}
@keyframes livePulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .4; transform: scale(.7); }
}

/* ════════════════════════════════════════════════
   FILTER BAR (shared layout for filter forms)
════════════════════════════════════════════════ */
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 20px;
}
.filter-bar .form-group { margin: 0; flex: 1 1 160px; min-width: 0; }
.filter-bar .btn        { flex-shrink: 0; align-self: flex-end; }

/* ════════════════════════════════════════════════
   LEGACY CLASS COMPATIBILITY
   (old pages before CSS standardization)
════════════════════════════════════════════════ */

/* Old pages use <h1 class="page-title"> */
h1.page-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1.2;
}

/* Old page-header uses plain <div> children */
.page-header > div:not([class]) {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.page-header > div:not([class]):last-child {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Old row highlight class (.row-new in new pages, .new-order in old) */
.data-table tbody tr.new-order {
  background: #fffbeb;
  border-right: 3px solid var(--warning);
}
.data-table tbody tr.new-order:hover { background: #fef3c7; }

/* Old table title class */
.table-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ════════════════════════════════════════════════
   MOBILE OVERLAY & SCROLL LOCK
════════════════════════════════════════════════ */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9997;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.sidebar-backdrop.show { display: block; }

body.sidebar-open { overflow: hidden; }

/* Mobile-only close button inside sidebar */
.sidebar-mobile-close {
  display: none;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255,255,255,.12);
  border-radius: 50%;
  color: rgba(255,255,255,.85);
  font-size: 15px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .2s;
  margin-right: auto;
}
.sidebar-mobile-close:hover { background: rgba(255,255,255,.22); color: var(--white); }

/* ════════════════════════════════════════════════
   RESPONSIVE — Tablet (≤ 1024px)
════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .page-content { padding: 20px; }
  .stats-grid   { grid-template-columns: repeat(3, 1fr); }
}

/* ════════════════════════════════════════════════
   RESPONSIVE — Mobile drawer (≤ 900px)
════════════════════════════════════════════════ */
@media (max-width: 900px) {
  /* ── Sidebar: slide-in drawer from right ── */
  .admin-sidebar {
    transform: translateX(calc(100% + 10px));
    width: 280px !important;
    z-index: 9999;
    box-shadow: none;
  }
  .admin-sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.3);
  }

  /* Force full content visible even if desktop had it collapsed */
  .admin-sidebar.collapsed                    { width: 280px !important; }
  .admin-sidebar.collapsed .sidebar-brand     { opacity: 1 !important; width: auto !important; }
  .admin-sidebar.collapsed .sidebar-user-info { opacity: 1 !important; width: auto !important; }
  .admin-sidebar.collapsed .nav-item-text     { opacity: 1 !important; width: auto !important; overflow: visible !important; }
  .admin-sidebar.collapsed .nav-badge         { opacity: 1 !important; }
  .admin-sidebar.collapsed .nav-section-label { opacity: 1 !important; }

  /* Show mobile close button, hide desktop collapse toggle */
  .sidebar-mobile-close { display: flex; }
  .sidebar-toggle       { display: none !important; }

  /* ── Main content: full width ── */
  .admin-main       { margin-right: 0 !important; }
  .header-hamburger { display: flex; }
  .header-search    { max-width: 200px; }

  /* ── Grid & spacing ── */
  .stats-grid   { grid-template-columns: repeat(2, 1fr); }
  .page-content { padding: 16px; }
  .form-row     { grid-template-columns: 1fr; }

  /* ── Tables ── */
  .table-search       { flex: 1; }
  .table-search input { width: 100%; min-width: 0; }

  /* ── Page header stacks vertically ── */
  .page-header  { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-actions { flex-wrap: wrap; gap: 8px; }

  /* ── Filter bars wrap ── */
  .filter-bar { flex-wrap: wrap; gap: 10px; }

  /* ── Nav touch targets ── */
  .nav-item { min-height: 46px; }
}

/* ════════════════════════════════════════════════
   RESPONSIVE — Small mobile (≤ 600px)
════════════════════════════════════════════════ */
@media (max-width: 600px) {
  /* ── Header ── */
  .admin-header {
    padding: 0 12px;
    gap: 8px;
    height: 58px;
    --header-h: 58px;
  }

  /* Hide desktop-only elements */
  .header-search,
  #fullscreenBtn,
  .header-divider { display: none !important; }

  /* User chip: avatar only */
  .user-info                { display: none; }
  .header-user              { padding: 5px 6px; gap: 0; }
  .header-user .fa-chevron-down { display: none; }

  /* Bigger touch targets */
  .header-btn       { width: 44px; height: 44px; }
  .header-hamburger { width: 44px; height: 44px; font-size: 18px; }

  /* ── Layout ── */
  .stats-grid   { grid-template-columns: 1fr; }
  .page-content { padding: 12px; }

  /* ── Typography ── */
  .page-title-wrap h1 { font-size: 18px; }
  .page-subtitle      { font-size: 12px; }

  /* ── Page actions ── */
  .page-actions { width: 100%; justify-content: flex-end; }

  /* ── Cards ── */
  .stat-card   { padding: 14px; }
  .stat-value  { font-size: 26px; }
  .card        { padding: 14px; }
  .card-header { padding: 12px 16px; }

  /* ── Tables ── */
  .data-table thead th,
  .data-table tbody td { padding: 8px 10px; font-size: 12px; }
  .btn-group  { gap: 3px; }
  .action-btn { width: 34px; height: 34px; font-size: 13px; }

  /* ── Modals → bottom sheet ── */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-box {
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 90vh;
  }
  .modal-box-header { border-radius: 20px 20px 0 0; }
  .modal-box-body   { padding: 16px; }
  .modal-box-footer {
    border-radius: 0;
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .modal-box-footer .btn { flex: 1; min-width: 90px; justify-content: center; }

  /* ── Dropdowns → full width ── */
  .notif-dropdown {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    border-radius: 16px 16px 0 0;
    top: 58px;
  }

  /* ── Toasts ── */
  #adminToastContainer { left: 10px; right: 10px; bottom: 14px; max-width: none; }
  .admin-toast { width: 100%; }

  /* ── Tabs → horizontal scroll ── */
  .tabs {
    overflow-x: auto;
    gap: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { white-space: nowrap; flex-shrink: 0; padding: 10px 16px; }
}

/* ════════════════════════════════════════════════
   RESPONSIVE — Very small (≤ 420px)
════════════════════════════════════════════════ */
@media (max-width: 420px) {
  .page-content       { padding: 10px; }
  .page-title-wrap h1 { font-size: 16px; }
  .stat-card          { padding: 12px; }
  .stat-value         { font-size: 22px; }
  .admin-sidebar      { width: 260px !important; }
}

/* ════════════════════════════════════════════════
   LEGACY RESPONSIVE (old pages compatibility)
════════════════════════════════════════════════ */
@media (max-width: 900px) {
  h1.page-title { font-size: 20px; }
  .page-header > div:not([class]):last-child { flex-wrap: wrap; }
  .filter-bar { padding: 12px 16px; gap: 10px; }
}
@media (max-width: 600px) {
  h1.page-title { font-size: 17px; }
  .page-header > div:not([class]) { width: 100%; }
  .page-header > div:not([class]):last-child { width: 100%; justify-content: flex-end; }
  .filter-bar { padding: 10px 12px; }
  .filter-bar .form-group { flex: 1 1 100%; }
}

/* ════════════════════════════════════════════════
   PRINT
════════════════════════════════════════════════ */
@media print {
  .admin-sidebar, .admin-header,
  .btn, .action-btn, .page-actions,
  .header-actions, #adminToastContainer { display: none !important; }
  .admin-main { margin-right: 0 !important; }
  .page-content { padding: 0 !important; }
  .card, .table-container { box-shadow: none; border: 1px solid #ccc; }
  body { background: white; }
}
