/* DRR - Modern Luxury Hospitality Design Tokens & Theme */
:root {
  --bg-primary: #f5f6f8;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #fcfcfd;
  --bg-modal: #ffffff;
  
  --border-subtle: #e5e7eb;
  --border-focus: #c89b2b;
  --border-highlight: rgba(184, 134, 11, 0.35);

  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --text-gold: #9a6e08;

  --accent-gold: #c89b2b;
  --accent-gold-dark: #9a6e08;
  --accent-gold-light: #fef3c7;
  --accent-gold-glow: rgba(200, 155, 43, 0.18);
  --accent-emerald: #059669;
  --accent-emerald-glow: rgba(5, 150, 105, 0.14);
  --accent-rose: #e11d48;
  --accent-rose-glow: rgba(225, 29, 72, 0.14);
  --accent-cyan: #0284c7;
  --accent-indigo: #4f46e5;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-card-hover: 0 10px 24px -6px rgba(15, 23, 42, 0.1), 0 4px 10px -2px rgba(15, 23, 42, 0.04);
  --shadow-glow-gold: 0 4px 14px rgba(184, 134, 11, 0.25);
  --shadow-glow-emerald: 0 4px 14px rgba(5, 150, 105, 0.22);
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: #f7f3e8;
}
::-webkit-scrollbar-thumb {
  background: rgba(197, 155, 39, 0.4);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-gold);
}

/* App Container Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Persistent Left Sidebar Navigation (Desktop) / Drawer (Mobile) */
.sidebar {
  width: 248px;
  background: #ffffff;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 120;
  transform: translateX(0);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar.drawer-open {
  transform: translateX(0);
}

.brand-section {
  height: 58px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.brand-logo-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #c89b2b, #9a6e08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(184, 134, 11, 0.28);
  flex-shrink: 0;
}

.brand-info h1 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--text-primary);
  line-height: 1.15;
}

.brand-info p {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
}

/* Sidebar Department Filter Tabs (All / F&B / Housekeeping) */
.sidebar-dept-tabs {
  display: grid;
  grid-template-columns: auto 1fr 1.25fr;
  gap: 4px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-subtle);
  background: #f9fafb;
  flex-shrink: 0;
}

.sidebar-dept-tab {
  border: 1px solid transparent;
  background: transparent;
  color: #4b5563;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 7px;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.sidebar-dept-tab:hover {
  background: #ffffff;
  color: #111827;
  border-color: #e5e7eb;
}

.sidebar-dept-tab.active {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.14);
}

.sidebar-dept-tab.dept-fb.active {
  background: #fef3c7;
  color: #92400e;
  border-color: #f59e0b;
}

.sidebar-dept-tab.dept-hk.active {
  background: #d1fae5;
  color: #065f46;
  border-color: #10b981;
}

.nav-menu {
  flex: 1;
  padding: 10px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-dept-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-dept-fb {
  background: linear-gradient(180deg, rgba(254, 249, 231, 0.72) 0%, rgba(255, 255, 255, 0.4) 100%);
  border: 1px solid rgba(245, 158, 11, 0.24);
  border-left: 3px solid #d97706;
  border-radius: 10px;
  padding: 6px 5px;
}

.nav-dept-hk {
  background: linear-gradient(180deg, rgba(236, 253, 245, 0.78) 0%, rgba(255, 255, 255, 0.4) 100%);
  border: 1px solid rgba(16, 185, 129, 0.24);
  border-left: 3px solid #059669;
  border-radius: 10px;
  padding: 6px 5px;
}

.nav-dept-shared {
  border-top: 1px solid #f3f4f6;
  padding-top: 4px;
}

.nav-dept-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px 5px 8px;
}

.nav-dept-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.nav-dept-dot.dot-fb {
  background: #d97706;
}

.nav-dept-dot.dot-hk {
  background: #059669;
}

.nav-dept-title {
  font-size: 10.5px;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.75px;
  color: #374151;
}

.nav-dept-pill {
  margin-left: auto;
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  letter-spacing: 0.4px;
}

.nav-dept-pill.pill-fb {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.nav-dept-pill.pill-hk {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

/* Department-Separated Audit Log Switcher & Filters */
.audit-dept-switcher {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.audit-dept-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px;
  border-radius: 12px;
  border: 1.5px solid var(--border-subtle);
  background: #ffffff;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.audit-dept-btn:hover {
  border-color: #cbd5e1;
  color: var(--text-primary);
  transform: translateY(-1px);
}

.audit-dept-btn.dept-fb.active {
  background: #fef3c7;
  color: #92400e;
  border-color: #f59e0b;
  box-shadow: 0 3px 10px rgba(245, 158, 11, 0.18);
}

.audit-dept-btn.dept-hk.active {
  background: #d1fae5;
  color: #065f46;
  border-color: #10b981;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.18);
}

.audit-dept-count {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: inherit;
}

.audit-filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-subtle, #f8fafc);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-dept-hk .nav-item.active {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #064e3b;
}

.nav-dept-hk .nav-item.active i {
  color: #059669;
}

.nav-label {
  font-size: 10px;
  text-transform: uppercase;
  color: #9ca3af;
  font-weight: 700;
  letter-spacing: 0.9px;
  padding: 6px 10px 4px 10px;
}

.nav-dept-launchpad .nav-label {
  padding-top: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border-radius: 8px;
  color: #4b5563;
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.nav-item i {
  width: 16px;
  text-align: center;
  font-size: 13.5px;
  color: #6b7280;
  transition: color 0.15s ease;
}

.nav-item:hover {
  color: #111827;
  background: #f3f4f6;
}

.nav-item:hover i {
  color: #111827;
}

.nav-item.active {
  color: #111827;
  background: #fef9e7;
  border-color: #fde68a;
  font-weight: 700;
}

.nav-item.active i {
  color: #b45309;
}

.nav-badge {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
}

.nav-item.active .nav-badge {
  background: #fde68a;
  color: #92400e;
}

.user-profile {
  padding: 12px 14px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fafafa;
  transition: background 0.15s ease;
}

.user-profile:hover {
  background: #f3f4f6;
}

.avatar-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #111827;
  color: #fbbf24;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11.5px;
  flex-shrink: 0;
}

.user-meta h4 {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.user-meta p {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Main Content Area (Beside Persistent Sidebar) */
.main-wrapper {
  margin-left: 248px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  color: #374151;
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
}

.topbar-brand-pill {
  display: none;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 10px 4px 5px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  transition: all 0.18s ease;
  flex-shrink: 0;
}

.topbar-brand-pill:hover {
  border-color: var(--accent-gold);
  box-shadow: 0 2px 8px rgba(184, 134, 11, 0.14);
}

/* Header Bar */
.topbar {
  height: 58px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.page-title {
  min-width: 0;
}

.page-title h2 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.25px;
  color: var(--text-primary);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-title p {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

/* Content Container */
.content-body {
  padding: 12px 20px 40px 20px;
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

/* Tab Panels */
.tab-content {
  display: none;
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Card System */
.resort-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.resort-card:hover {
  border-color: rgba(212, 175, 55, 0.5);
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
}

/* Metric / KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.kpi-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

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

.kpi-meta p {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}

.kpi-meta h3 {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--text-primary);
  line-height: 1.2;
}

.kpi-subtext {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.kpi-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.icon-gold {
  background: #fef9e7;
  color: #b45309;
  border: 1px solid #fde68a;
}
.icon-emerald {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}
.icon-rose {
  background: #fff1f2;
  color: #e11d48;
  border: 1px solid #fecdd3;
}
.icon-indigo {
  background: #eef2ff;
  color: #4f46e5;
  border: 1px solid #c7d2fe;
}
.icon-cyan {
  background: #f0f9ff;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
  outline: none;
  transition: all 0.18s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #c89b2b, #9a6e08);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(184, 134, 11, 0.28);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(184, 134, 11, 0.38);
}

.btn-secondary {
  background: #ffffff;
  color: #374151;
  border: 1px solid #d1d5db;
}

.btn-secondary:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  color: #111827;
}

.btn-danger {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
}

.btn-danger:hover {
  background: #e11d48;
  color: #ffffff;
  border-color: #e11d48;
}

.btn-emerald {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.btn-emerald:hover {
  background: #059669;
  color: #ffffff;
  border-color: #059669;
}

.btn-sm {
  padding: 6px 11px;
  font-size: 12px;
  height: 33px;
  border-radius: var(--radius-sm);
}

/* Search and Filters Bar */
.filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  background: #ffffff;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-input-wrap input {
  width: 100%;
  height: 38px;
  padding: 8px 12px 8px 36px;
  background: #f9fafb;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: all 0.16s ease;
}

.search-input-wrap input:focus {
  background: #ffffff;
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px var(--accent-gold-glow);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
}

.filter-select {
  height: 38px;
  padding: 6px 12px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
}

.filter-select:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px var(--accent-gold-glow);
}

/* Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: #ffffff;
}

.resort-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.resort-table th {
  background: #f8fafc;
  padding: 11px 14px;
  color: #475569;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.6px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.resort-table td {
  padding: 11px 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: var(--text-primary);
}

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

.resort-table tbody tr:hover td {
  background: #f9fafb;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.badge-emerald {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-rose {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
}

.badge-gold {
  background: #fef9e7;
  color: #9a6e08;
  border: 1px solid #fde68a;
}

.badge-indigo {
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}

.badge-cyan {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.badge-violet {
  background: #f5f3ff;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.badge-orange {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.badge-teal {
  background: #f0fdfa;
  color: #0f766e;
  border: 1px solid #99f6e4;
}

.badge-pink {
  background: #fdf2f8;
  color: #be185d;
  border: 1px solid #fbcfe8;
}

.badge-muted {
  background: #f3f4f6;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

/* 100-Room Matrix Floor Grid */
.floor-section {
  margin-bottom: 24px;
}

.floor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.floor-header h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-gold);
}

.rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.room-tile {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 85px;
  box-shadow: 0 2px 8px rgba(180, 140, 40, 0.08);
}

.room-tile:hover {
  transform: translateY(-2px);
  border-color: var(--accent-gold);
  box-shadow: 0 6px 16px rgba(212, 175, 55, 0.22);
  background: #fffdf7;
}

.room-tile.occupied {
  border-left: 4px solid var(--accent-emerald);
}

.room-tile.vacant-clean {
  border-left: 4px solid var(--accent-cyan);
}

.room-tile.vacant-dirty {
  border-left: 4px solid var(--accent-rose);
}

.room-tile.out-of-order {
  border-left: 4px solid var(--text-muted);
  opacity: 0.6;
}

.room-num {
  font-weight: 800;
  font-size: 15px;
  color: var(--text-primary);
}

.room-status-indicator {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.room-guest-tag {
  font-size: 10px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Modals (Child Action Windows — Stack Above Workspace Window) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(30, 27, 20, 0.5);
  backdrop-filter: blur(8px);
  z-index: 1600;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: var(--bg-modal);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(140, 105, 20, 0.22);
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(90deg, #fdf9ee, #ffffff);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Form Controls */
.form-group {
  margin-bottom: 18px;
}

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

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13.5px;
  outline: none;
}

.form-control:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px var(--accent-gold-glow);
}

.form-row {
  display: flex;
  gap: 14px;
}

.form-row .form-group {
  flex: 1;
}

/* Recipe BOM Cards */
.recipe-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s;
}

.recipe-card:hover {
  border-color: var(--accent-gold);
}

.recipe-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.recipe-price-tag {
  text-align: right;
}

.recipe-price-tag .price {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-gold);
}

.recipe-price-tag .cost {
  font-size: 11px;
  color: var(--text-muted);
}

.bom-list {
  background: #fdf9ee;
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin: 12px 0;
  font-size: 12.5px;
}

.bom-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(212, 175, 55, 0.25);
}

.bom-row:last-child {
  border-bottom: none;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-modal);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-gold);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(140, 105, 20, 0.18);
  min-width: 300px;
  font-size: 13px;
  color: var(--text-primary);
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toast.toast-success {
  border-left-color: var(--accent-emerald);
}

.toast.toast-error {
  border-left-color: var(--accent-rose);
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Responsive & Mobile-First PWA Styles */
.mobile-menu-btn,
.mobile-drawer-close,
.mobile-bottom-nav,
.mobile-drawer-overlay {
  display: none;
}

/* Role Switcher Pill */
.role-switcher-pill {
  display: inline-flex;
  align-items: center;
  background: #f3f4f6;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 2px;
  height: 33px;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

.role-opt {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.role-opt.active {
  background: linear-gradient(135deg, #d4af37, #a67c0e);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.35);
}

/* Offline Network Banner */
.offline-banner {
  background: linear-gradient(90deg, #996515, #b8860b);
  color: #ffffff;
  padding: 8px 20px;
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
}

.kitchen-subview {
  display: none;
}

.kitchen-subview.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

/* Horizontal Scrollable Category Chips */
.category-chips-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.cat-chip {
  flex: 0 0 auto;
  background: #fdf9ee;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.cat-chip:hover {
  border-color: var(--accent-gold);
  background: #fffdf7;
}

.cat-chip.active {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.24), rgba(243, 229, 171, 0.5));
  color: #7c5805;
  border-color: var(--accent-gold);
  font-weight: 700;
}

/* Bulk Edit Banner */
.bulk-edit-banner {
  background: linear-gradient(90deg, #fff8e1, #fffdf7);
  border: 1px solid var(--accent-gold);
  border-left: 4px solid var(--accent-gold-dark);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.row-action-btns {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}

.row-zero-stock td {
  background: rgba(212, 175, 55, 0.03);
}

/* Daily Usage & Requisition Grids */
.usage-split-grid,
.req-workspace-grid,
.dashboard-two-col {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 22px;
  margin-bottom: 24px;
}

.batch-usage-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.usage-summary-bar {
  background: #fdf9ee;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.live-calc-box {
  background: #fdf9ee;
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13px;
}

.chip-btn {
  background: #fdf9ee;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
}

.chip-btn:hover {
  background: var(--accent-gold);
  color: #ffffff;
}

/* Requisition Window Styles */
.req-window-banner {
  background: linear-gradient(135deg, #fffdf7 0%, #fdf6de 100%);
  border: 1px solid var(--border-highlight);
  border-left: 5px solid var(--accent-gold);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  margin-bottom: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  box-shadow: var(--shadow-card);
}

.req-add-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  background: #fdf9ee;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.req-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: 0 2px 10px rgba(180, 140, 40, 0.08);
}

.req-card-pending {
  border-left: 4px solid var(--accent-gold);
  background: linear-gradient(180deg, #fffdf9 0%, #ffffff 100%);
}

/* Compact 4-Step Daily Workflow Strip */
.workflow-stepper-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 6px 10px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 10px;
}

.workflow-stepper-head {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-bottom: 0;
}

.workflow-stepper-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
  padding-right: 10px;
  border-right: 1px solid #e5e7eb;
  white-space: nowrap;
}

.workflow-stepper-title i {
  color: #b45309;
  font-size: 12px;
}

.workflow-stepper-sub {
  display: none;
}

.workflow-steps-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.workflow-step-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: all 0.16s ease;
  width: 100%;
  min-height: 36px;
}

.workflow-step-btn:hover {
  background: #ffffff;
  border-color: var(--accent-gold);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.workflow-step-num {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.workflow-step-info {
  flex: 1;
  min-width: 0;
}

.workflow-step-info strong {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workflow-step-info span {
  display: none;
}

.workflow-step-arrow {
  color: #9ca3af;
  font-size: 10px;
  flex-shrink: 0;
  transition: transform 0.16s ease, color 0.16s ease;
}

.workflow-step-btn:hover .workflow-step-arrow {
  color: #b45309;
  transform: translateX(2px);
}

/* Hide legacy floating window taskbar (replaced by persistent sidebar + mobile bottom nav) */
.window-taskbar {
  display: none !important;
}

@media (max-width: 1024px) {
  .sidebar {
    width: 270px;
    transform: translateX(-105%);
    z-index: 1200;
    box-shadow: 8px 0 32px rgba(15, 23, 42, 0.16);
  }

  .sidebar.drawer-open {
    transform: translateX(0);
  }

  .mobile-drawer-overlay.active {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(3px);
    z-index: 1150;
  }

  .mobile-drawer-close {
    display: inline-flex;
    margin-left: auto;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--text-secondary);
    cursor: pointer;
  }

  .mobile-menu-btn,
  .topbar-brand-pill {
    display: inline-flex;
  }

  .main-wrapper {
    margin-left: 0;
    padding-bottom: 72px;
  }

  .mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(62px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid #e5e7eb !important;
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08) !important;
    z-index: 1100;
    justify-content: space-around;
    align-items: center;
  }

  .mob-nav-btn {
    flex: 1;
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-muted);
    font-size: 10.5px;
    font-weight: 600;
    padding: 6px 2px;
    min-height: 44px;
    cursor: pointer;
    touch-action: manipulation;
  }

  .mob-nav-btn i {
    font-size: 17px;
  }

  .mob-nav-btn.active {
    color: #8a6408;
    font-weight: 800;
  }

  .mob-nav-badge {
    position: absolute;
    top: -6px;
    right: -10px;
    background: #c62828;
    color: #ffffff;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 999px;
  }

  .workflow-steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1100px) {
  .usage-split-grid,
  .req-workspace-grid,
  .dashboard-two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .topbar {
    height: auto;
    min-height: 54px;
    padding: 8px 12px;
    gap: 8px;
  }

  .page-title h2 {
    font-size: 14.5px;
  }

  .page-title p,
  .hide-sm {
    display: none;
  }

  .content-body {
    padding: 12px 12px 84px 12px;
  }

  .workflow-stepper-card {
    padding: 8px 10px;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .workflow-stepper-title {
    border-right: none;
    padding-right: 0;
  }

  .workflow-steps-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .hub-hero-banner {
    padding: 10px 12px;
    gap: 8px;
  }

  .hub-group-pills {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .hub-hero-right {
    max-width: 100%;
    width: 100%;
  }

  .resort-card {
    padding: 14px;
    border-radius: var(--radius-md);
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 14px;
  }

  .hub-pulse-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .hub-pulse-grid .kpi-card {
    padding: 11px 12px;
    gap: 9px;
  }

  .hub-pulse-grid .kpi-icon-box {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  .hub-pulse-grid .kpi-meta h3 {
    font-size: 16px;
  }

  .hub-pulse-chevron {
    display: none;
  }

  .kpi-card {
    padding: 12px;
  }

  .kpi-meta h3 {
    font-size: 18px;
  }

  .kpi-icon-box {
    width: 34px;
    height: 34px;
    font-size: 15px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  /* Prevent iOS zoom on input focus */
  .form-control,
  .filter-select,
  .search-input-wrap input {
    font-size: 16px;
  }

  /* Mobile Card Layout for Kitchen Stock Ledger Table */
  .kitchen-ledger-table thead {
    display: none;
  }

  .kitchen-ledger-table,
  .kitchen-ledger-table tbody,
  .kitchen-ledger-table tr,
  .kitchen-ledger-table td {
    display: block;
    width: 100%;
  }

  .kitchen-ledger-table tr.kitchen-item-row {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(180, 140, 40, 0.08);
  }

  .kitchen-ledger-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(212, 175, 55, 0.2);
    text-align: right;
  }

  .kitchen-ledger-table td:last-child {
    border-bottom: none;
    padding-top: 10px;
    justify-content: flex-end;
  }

  .kitchen-ledger-table td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    text-align: left;
    margin-right: 12px;
  }

  .row-action-btns {
    width: 100%;
    justify-content: space-between;
  }

  .row-action-btns .btn {
    flex: 1;
    justify-content: center;
    padding: 8px 10px;
  }

  /* Bottom Sheet Modals on Mobile */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal-box {
    max-width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
  }

  /* Fixed Mobile Bottom Navigation Bar */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(62px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 253, 247, 0.98);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-highlight);
    box-shadow: 0 -4px 20px rgba(180, 140, 40, 0.14);
    z-index: 1100;
    justify-content: space-around;
    align-items: center;
  }

  .mob-nav-btn {
    flex: 1;
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-muted);
    font-size: 10.5px;
    font-weight: 600;
    padding: 6px 2px;
    cursor: pointer;
  }

  .mob-nav-btn i {
    font-size: 17px;
  }

  .mob-nav-btn.active {
    color: #8a6408;
    font-weight: 800;
  }

  .mob-nav-badge {
    position: absolute;
    top: -6px;
    right: -10px;
    background: #c62828;
    color: #ffffff;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 999px;
  }

  .toast-container {
    bottom: 74px;
    left: 12px;
    right: 12px;
  }

  .toast {
    min-width: 0;
    width: 100%;
  }
}

/* =========================================================================
   CENTRAL COMMAND DASHBOARD HUB & MULTI-LEVEL WINDOW MANAGER UX
   ========================================================================= */

.home-dashboard-hub {
  display: none;
  animation: fadeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.home-dashboard-hub.active {
  display: block;
}

/* Compact Operations Toolbar (Filter Pills + Search) */
.hub-hero-banner {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 6px 10px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  box-shadow: var(--shadow-card);
}

.hub-hero-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.hub-hero-right {
  flex: 1;
  min-width: 220px;
  max-width: 320px;
  display: flex;
  align-items: center;
}

.hub-search-box {
  position: relative;
  width: 100%;
}

.hub-search-box i {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 12px;
}

.hub-search-box input {
  width: 100%;
  height: 30px;
  padding: 4px 10px 4px 30px;
  border-radius: 7px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  outline: none;
  transition: all 0.16s ease;
}

.hub-search-box input:focus {
  background: #ffffff;
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 2px var(--accent-gold-glow);
}

.hub-group-pills {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  align-items: center;
}

.hub-group-pill {
  background: #f3f4f6;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.hub-group-pill:hover {
  background: #e5e7eb;
  color: var(--text-primary);
}

.hub-group-pill.active {
  background: #111827;
  color: #ffffff;
}

/* Compact 4-Column Live KPI Pulse Strip */
.hub-pulse-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.hub-pulse-grid .kpi-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-card);
  transition: all 0.16s ease;
}

.hub-pulse-grid .kpi-card:hover {
  transform: translateY(-1px);
  border-color: var(--accent-gold);
  box-shadow: var(--shadow-card-hover);
}

.hub-pulse-grid .kpi-icon-box {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.hub-pulse-grid .kpi-meta {
  flex: 1;
  min-width: 0;
}

.hub-pulse-grid .kpi-meta p {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 1px;
}

.hub-pulse-grid .kpi-meta h3 {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.15;
  letter-spacing: -0.3px;
  margin-bottom: 1px;
}

.hub-pulse-grid .kpi-subtext {
  font-size: 10.5px;
  color: var(--text-secondary);
  display: block;
  margin-top: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hub-pulse-chevron {
  color: #9ca3af;
  font-size: 11px;
  flex-shrink: 0;
  transition: transform 0.16s ease, color 0.16s ease;
}

.hub-pulse-grid .kpi-card:hover .hub-pulse-chevron {
  color: var(--accent-gold-dark);
  transform: translateX(2px);
}

/* Dashboard Modules Grid — Minimal, High-Signal Tiles */
.hub-modules-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.hub-module-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

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

.hub-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hub-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.hub-card-title-group {
  flex: 1;
  min-width: 0;
}

.hub-card-title-group h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.25;
  letter-spacing: -0.15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hub-group-tag {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-muted);
  display: block;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hub-card-body {
  display: none;
}

.hub-subwindows-box {
  display: none;
}

.hub-card-footer {
  display: none;
}

@media (max-width: 1100px) {
  .hub-modules-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .hub-modules-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .hub-pulse-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .hub-pulse-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================================
   APPLICATION WORKSPACE WINDOW OVERLAY (OPENS WHEN CLICKING ANY DASHBOARD OPTION)
   ========================================================================= */

.app-window-backdrop {
  position: static;
  background: transparent;
  backdrop-filter: none;
  z-index: auto;
  display: none;
  padding: 0;
  animation: fadeIn 0.2s ease;
}

.app-window-backdrop.active {
  display: block;
}

.app-workspace-window {
  width: 100%;
  max-width: 100%;
  height: auto;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: visible;
  transition: all 0.22s ease;
}

.app-workspace-window.maximized {
  max-width: 100%;
  width: 100%;
  height: auto;
  border-radius: 0;
  border: none;
}

.app-window-backdrop.maximized-mode {
  padding: 0;
}

@keyframes windowOpenAnim {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.app-window-titlebar {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-shrink: 0;
  user-select: none;
}

.win-titlebar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.win-traffic-lights,
#win-maximize-btn {
  display: none !important;
}

.win-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.95);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.win-dot:hover {
  transform: scale(1.14);
}

.win-dot-close {
  background: #e53935;
  box-shadow: 0 2px 6px rgba(229, 57, 53, 0.4);
}

.win-dot-min {
  background: #f9a825;
  box-shadow: 0 2px 6px rgba(249, 168, 37, 0.4);
}

.win-dot-max {
  background: #2e7d32;
  box-shadow: 0 2px 6px rgba(46, 125, 50, 0.4);
}

.win-title-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.win-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #d4af37, #9a7209);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(212, 175, 55, 0.35);
}

.win-title-text {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.win-breadcrumb-trail {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.win-crumb {
  cursor: pointer;
  color: var(--text-secondary);
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}

.win-crumb:hover {
  background: rgba(212, 175, 55, 0.2);
  color: var(--text-gold);
}

.win-crumb.active {
  color: var(--text-gold);
  font-weight: 800;
  background: rgba(212, 175, 55, 0.16);
}

.win-titlebar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.app-window-body {
  flex: 1;
  overflow: visible;
  padding: 0;
  background: transparent;
}

/* =========================================================================
   DYNAMIC SUB-OPTIONS LAUNCHER INSIDE OPEN WINDOW ("AND SO ON" DRILL-DOWN)
   ========================================================================= */

.window-suboptions-launcher {
  background: linear-gradient(135deg, #fffdf7 0%, #fdf7e4 100%);
  border: 1.5px solid rgba(212, 175, 55, 0.5);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 22px;
  box-shadow: 0 4px 16px rgba(180, 140, 40, 0.08);
}

.win-subopt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.win-subopt-title {
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-gold);
  display: flex;
  align-items: center;
  gap: 8px;
}

.win-subopt-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 10px;
}

.win-subopt-card {
  background: #ffffff;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.win-subopt-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-gold);
  background: #fffdf7;
  box-shadow: 0 6px 16px rgba(212, 175, 55, 0.2);
}

.win-subopt-card.active {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.22), rgba(243, 229, 171, 0.45));
  border-color: var(--accent-gold-dark);
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.25);
}

.win-subopt-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(212, 175, 55, 0.16);
  color: var(--text-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.win-subopt-card.active .win-subopt-icon {
  background: linear-gradient(135deg, #d4af37, #a67c0e);
  color: #ffffff;
}

.win-subopt-info h5 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

.win-subopt-info span {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

/* Focused Sub-Window Banner */
.subwindow-focus-banner {
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.18), rgba(255, 253, 247, 0.9));
  border: 1px solid var(--accent-gold);
  border-left: 4px solid var(--accent-gold-dark);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* Floating Taskbar / Dock for Minimized or Active Windows */
.window-taskbar {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1550;
  background: rgba(255, 253, 247, 0.96);
  backdrop-filter: blur(16px);
  border: 1.5px solid var(--accent-gold);
  border-radius: 999px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 12px 32px rgba(44, 34, 8, 0.25);
  max-width: 94vw;
  overflow-x: auto;
}

.taskbar-home-btn {
  background: linear-gradient(135deg, #d4af37, #a67c0e);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.taskbar-windows-list {
  display: flex;
  align-items: center;
  gap: 6px;
}

.taskbar-win-pill {
  background: #fdf8ea;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.taskbar-win-pill.active {
  border-color: var(--accent-gold-dark);
  background: rgba(212, 175, 55, 0.22);
  font-weight: 700;
}

.taskbar-win-pill:hover {
  border-color: var(--accent-gold);
  background: #ffffff;
}

@media (max-width: 768px) {
  .hub-modules-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .hub-hero-banner {
    padding: 16px;
  }

  .hub-hero-left h2 {
    font-size: 18px;
  }

  .app-window-backdrop {
    padding: 0;
  }

  .app-workspace-window {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 0;
    border: none;
  }

  .app-window-titlebar {
    padding: 10px 12px;
  }

  .app-window-body {
    padding: 0;
  }

  .window-taskbar {
    bottom: 68px;
  }
}

/* =========================================================================
   GLOBAL APPLICATION LOADER (TOP PROGRESS BAR + CENTERED GLASS SPINNER)
   ========================================================================= */

.global-top-loader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  background: rgba(200, 155, 43, 0.14);
  overflow: hidden;
}

.global-top-loader.active {
  opacity: 1;
}

.global-top-loader-bar {
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, #c89b2b, #9a6e08, #f59e0b, transparent);
  animation: topLoaderSlide 1.15s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes topLoaderSlide {
  0% {
    left: -40%;
  }
  100% {
    left: 100%;
  }
}

.global-app-loader {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 246, 248, 0.58);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.global-app-loader.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.global-loader-card {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 12px 32px -6px rgba(15, 23, 42, 0.16), 0 4px 10px -2px rgba(15, 23, 42, 0.06);
}

.global-loader-spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid #f3f4f6;
  border-top-color: #c89b2b;
  border-right-color: #9a6e08;
  animation: globalSpin 0.7s linear infinite;
  flex-shrink: 0;
}

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

.global-loader-text {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  letter-spacing: -0.1px;
  white-space: nowrap;
}

/* =========================================================================
   NON-BLOCKING SEARCH CONTROLS & TABLE PAGINATION BAR
   ========================================================================= */

.search-input-wrap.has-right-controls input {
  padding-right: 60px;
}

.search-inline-spinner {
  position: absolute;
  right: 34px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent-gold-dark, #a67c0e);
  font-size: 13px;
  pointer-events: none;
}

.search-clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: #e5e7eb;
  color: #4b5563;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.search-clear-btn:hover {
  background: #d1d5db;
  color: #111827;
}

.table-loading-subtle {
  opacity: 0.55;
  transition: opacity 0.15s ease;
}

.pagination-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 10px 14px;
  background: #fdfbf5;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.pagination-info {
  font-weight: 600;
  color: var(--text-primary);
}

.pagination-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pagination-size-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.page-size-select {
  height: 32px;
  padding: 4px 8px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  background: #ffffff;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.pagination-pages {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 9px;
  border-radius: 7px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.page-btn:hover:not(:disabled):not(.active) {
  border-color: var(--accent-gold);
  background: #fdf8ea;
  color: var(--text-primary);
}

.page-btn.active {
  background: linear-gradient(135deg, #c89b2b, #9a6e08);
  border-color: #9a6e08;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(154, 110, 8, 0.25);
}

.page-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.page-ellipsis {
  padding: 0 4px;
  color: var(--text-muted);
  font-weight: 600;
  user-select: none;
}

@media (max-width: 768px) {
  .pagination-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .pagination-controls {
    justify-content: space-between;
  }
}


/* =========================================================================
   SMART CULINARY MENU SEARCH, AUTOCOMPLETE & INTELLIGENCE FILTERS
   ========================================================================= */

.km-smart-search-shell {
  margin-bottom: 14px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #fffdf8 0%, #faf6eb 100%);
  border: 1px solid rgba(200, 155, 43, 0.28);
  border-radius: 12px;
}

.km-search-scope-group {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
  flex-shrink: 0;
}

.km-scope-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.km-scope-btn:hover {
  color: var(--text-primary);
  background: #f9fafb;
}

.km-scope-btn.active {
  background: linear-gradient(135deg, #c89b2b, #9a6e08);
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(154, 110, 8, 0.25);
}

.km-smart-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.km-status-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.km-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.km-status-pill:hover {
  border-color: var(--accent-gold);
  background: #fdf8ea;
}

.km-status-pill.active {
  background: #1f2937;
  border-color: #1f2937;
  color: #ffffff;
}

.km-status-pill.km-pill-warn.active {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #ffffff;
}

.km-status-pill.km-pill-ok.active {
  background: #15803d;
  border-color: #15803d;
  color: #ffffff;
}

.km-status-pill.km-pill-cost.active {
  background: #a16207;
  border-color: #a16207;
  color: #ffffff;
}

.km-pill-cnt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.08);
}

.km-status-pill.active .km-pill-cnt {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.km-filter-right-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.km-sort-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.km-active-ing-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(200, 155, 43, 0.16);
  border: 1px solid rgba(154, 110, 8, 0.45);
  color: #7c5806;
  font-size: 11.5px;
  font-weight: 700;
}

.km-active-ing-chip button {
  border: none;
  background: rgba(124, 88, 6, 0.15);
  color: #7c5806;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 10px;
}

.km-active-ing-chip button:hover {
  background: #7c5806;
  color: #ffffff;
}

/* Floating Autocomplete Suggestions Popover */
.km-suggestions-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 80;
  background: #ffffff;
  border: 1px solid rgba(200, 155, 43, 0.35);
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.16);
  max-height: 360px;
  overflow-y: auto;
  padding: 10px;
}

.km-sug-section-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  padding: 4px 8px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.km-sug-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text-primary);
  transition: background 0.12s ease;
}

.km-sug-item:hover,
.km-sug-item.focused {
  background: #fdf8ea;
}

.km-sug-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.km-quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 6px 8px;
}

.km-quick-tag {
  border: 1px solid rgba(200, 155, 43, 0.35);
  background: #fffdf6;
  color: #7c5806;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}

.km-quick-tag:hover {
  background: #c89b2b;
  border-color: #c89b2b;
  color: #ffffff;
}

/* Interactive Ingredient Pills & Highlighted Matches */
.km-ing-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  margin: 2px 4px 2px 0;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.km-ing-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
}

.km-ing-pill.km-ing-match {
  border-color: #b45309 !important;
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.22);
}

mark.km-highlight {
  background: #fde68a;
  color: #78350f;
  padding: 0 2px;
  border-radius: 3px;
  font-weight: 700;
}

@media (max-width: 768px) {
  .km-smart-filter-row {
    flex-direction: column;
    align-items: stretch;
  }

  .km-filter-right-controls {
    justify-content: space-between;
  }
}


/* =========================================================================
   COMPACT SINGLE-ROW MODULE SUB-VIEW TAB BAR
   ========================================================================= */

.module-subtabs-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  padding: 5px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}

.module-subtab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.module-subtab-btn i {
  font-size: 12px;
  opacity: 0.78;
}

.module-subtab-btn:hover {
  background: #faf6eb;
  color: var(--text-primary);
}

.module-subtab-btn.active {
  background: linear-gradient(135deg, #c89b2b, #9a6e08);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(154, 110, 8, 0.22);
}

.module-subtab-btn.active i {
  opacity: 1;
}

/* =========================================================================
   ENHANCED MOBILE-FIRST ERGONOMICS & PWA STANDALONE POLISH
   ========================================================================= */

button,
a,
.hub-module-card,
.kpi-card,
.workflow-step-btn,
.nav-item {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(212, 175, 55, 0.16);
}

body.drawer-scroll-lock {
  overflow: hidden;
  touch-action: none;
}

/* Safe-area insets when launched as an installed standalone PWA */
@media (display-mode: standalone) {
  .topbar {
    padding-top: max(8px, env(safe-area-inset-top, 0px));
  }

  .sidebar {
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

@media (max-width: 1024px) {
  .sidebar {
    padding-bottom: env(safe-area-inset-bottom, 0px);
    overscroll-behavior: contain;
  }

  .main-wrapper {
    padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 768px) {
  .topbar {
    padding: 8px 10px;
    gap: 6px;
  }

  .topbar-actions {
    gap: 5px;
  }

  .topbar-actions .btn {
    padding: 6px 9px;
    min-height: 36px;
  }

  #active-user-pill {
    max-width: 128px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #topbar-user-role-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 74px;
    display: inline-block;
    vertical-align: bottom;
  }

  .mobile-menu-btn {
    width: 38px;
    height: 38px;
  }

  /* Prevent iOS Safari zoom on input/select/textarea focus (even with inline font-size) */
  input.form-control,
  select.form-control,
  textarea.form-control,
  .filter-select,
  .search-input-wrap input,
  .hub-search-box input {
    font-size: 16px !important;
  }

  /* Responsive horizontal scroll for module subtabs on mobile */
  .module-subtabs-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 4px;
    padding: 4px;
  }

  .module-subtabs-bar::-webkit-scrollbar {
    display: none;
  }

  .module-subtab-btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 8px 11px;
    font-size: 12px;
    min-height: 36px;
  }

  /* Card headers & filter toolbars wrap cleanly without horizontal overflow */
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .toolbar-row {
    gap: 8px;
  }

  .toolbar-row > select.form-control,
  .toolbar-row > .filter-select,
  .toolbar-row > div[style*="min-width"] {
    flex: 1 1 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  /* Override wide inline CSS grid min-widths that would overflow narrow phones */
  #kitchen-recipes-grid,
  #fba-category-cards,
  #rbac-quick-switch-list,
  #rbac-role-modules-grid {
    grid-template-columns: 1fr !important;
  }

  #hkr-rooms-grid {
    grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)) !important;
    gap: 8px !important;
  }

  /* Window titlebar mobile ergonomics */
  .app-window-titlebar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
  }

  .app-window-controls {
    margin-left: auto;
  }

  /* Bottom-sheet modal polish with sticky header and safe-area footer */
  .modal-box {
    max-height: 92dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .modal-header {
    padding: 14px 16px;
    flex-shrink: 0;
  }

  .modal-header h3 {
    font-size: 15px;
  }

  .modal-close {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .modal-body {
    padding: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
  }

  .modal-footer {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .modal-footer .btn {
    flex: 1 1 auto;
    justify-content: center;
    min-height: 40px;
  }

  .form-row > .form-group {
    max-width: 100% !important;
    width: 100%;
  }

  /* Compact table cells for horizontal scroll on mobile */
  .resort-table th,
  .resort-table td {
    padding: 9px 10px;
    font-size: 12.5px;
  }

  .toast-container {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 480px) {
  .hide-xs {
    display: none !important;
  }

  .topbar-brand-pill {
    padding: 3px;
  }

  .page-title h2 {
    font-size: 13.5px;
  }

  .workflow-step-btn {
    padding: 8px;
    gap: 7px;
  }

  .workflow-step-info strong {
    font-size: 12px;
  }

  .workflow-step-info span {
    font-size: 10.5px;
  }

  .workflow-step-arrow {
    display: none;
  }

  .hub-pulse-grid .kpi-meta h3 {
    font-size: 14.5px;
  }

  .hub-pulse-grid .kpi-meta p {
    font-size: 10.5px;
  }
}

@media (max-width: 360px) {
  .workflow-steps-grid,
  .kpi-grid,
  .hub-pulse-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== INITIAL SESSION & ROLE BOOT LOADER ==================== */
.app-boot-loader {
  position: fixed;
  inset: 0;
  z-index: 9900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at top, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.99));
  backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.app-boot-loader.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.app-boot-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 340px;
  padding: 32px 28px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(212, 175, 55, 0.28);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.app-boot-spinner-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.app-boot-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(212, 175, 55, 0.18);
  border-top-color: #d4af37;
  border-right-color: #f3d778;
  animation: globalSpin 0.85s cubic-bezier(0.55, 0.2, 0.45, 0.8) infinite;
}

.app-boot-logo {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: linear-gradient(135deg, #d4af37, #b4860b);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  box-shadow: 0 8px 20px rgba(180, 134, 11, 0.35);
}

.app-boot-title {
  font-size: 17px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.app-boot-subtitle {
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(226, 232, 240, 0.78);
  margin-bottom: 18px;
  min-height: 18px;
}

.app-boot-bar {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.app-boot-bar-fill {
  width: 45%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #b4860b, #f3d778, #d4af37);
  animation: bootBarSlide 1.2s ease-in-out infinite;
}

@keyframes bootBarSlide {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(260%);
  }
}

/* ==================== MANDATORY AUTHENTICATION SIGN-IN GATE ==================== */
body.auth-locked .app-container,
body.auth-locked .window-taskbar,
body.auth-locked .mobile-bottom-nav {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
}

.auth-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 9800;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at top, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.97));
  backdrop-filter: blur(10px);
}

.auth-gate-overlay.active {
  display: flex;
}

.auth-gate-card {
  width: 100%;
  max-width: 430px;
  background: var(--bg-card, #ffffff);
  border: 1.5px solid rgba(212, 175, 55, 0.45);
  border-radius: 18px;
  padding: 30px 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.auth-gate-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.auth-gate-logo {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: linear-gradient(135deg, #d4af37, #b4860b);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 8px 18px rgba(180, 134, 11, 0.28);
  flex-shrink: 0;
}

.auth-gate-error {
  display: none;
  background: rgba(220, 38, 38, 0.09);
  border: 1px solid rgba(220, 38, 38, 0.35);
  color: #b91c1c;
  font-size: 12.5px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 14px;
}

.auth-gate-error.visible {
  display: block;
}

