/* ============================================================
   Q.Hotel Management — Enterprise Theme v2
   ============================================================ */
:root {
  --brand-primary: #1e3a8a;     /* deep indigo */
  --brand-primary-600: #1e40af;
  --brand-primary-700: #1d4ed8;
  --brand-accent: #0ea5e9;      /* sky */
  --brand-success: #16a34a;
  --brand-warning: #f59e0b;
  --brand-danger:  #dc2626;
  --brand-info:    #0891b2;

  --sidebar-bg: #0f172a;          /* slate-900 */
  --sidebar-bg-hover: #1e293b;    /* slate-800 */
  --sidebar-fg: #cbd5e1;          /* slate-300 */
  --sidebar-fg-muted: #64748b;    /* slate-500 */
  --sidebar-active-bg: #1e40af;
  --sidebar-active-fg: #ffffff;
  --sidebar-width: 248px;
  --sidebar-width-collapsed: 68px;
  --topbar-height: 60px;

  --content-bg: #f1f5f9;          /* slate-100 */
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,.04);
  --shadow-md: 0 2px 6px -1px rgba(0,0,0,.06), 0 1px 3px -1px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

* { box-sizing: border-box; }

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--content-bg);
  margin: 0; padding: 0;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-primary-700); text-decoration: none; }
a:hover { color: var(--brand-primary-600); text-decoration: underline; }

/* =================== LAYOUT =================== */
.app-shell { display: flex; min-height: 100vh; }

/* =================== SIDEBAR =================== */
.app-sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: width .2s ease;
  display: flex;
  flex-direction: column;
}
.app-sidebar.collapsed { width: var(--sidebar-width-collapsed); }
.app-sidebar.collapsed .sidebar-text,
.app-sidebar.collapsed .sidebar-section-title,
.app-sidebar.collapsed .sidebar-brand-text { display: none; }
.app-sidebar.collapsed .sidebar-link { justify-content: center; padding-left: 0; padding-right: 0; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
}
.sidebar-brand i { font-size: 1.4rem; color: var(--brand-accent); }
.sidebar-brand:hover { text-decoration: none; color: #fff; }

.sidebar-section-title {
  padding: 16px 20px 6px;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--sidebar-fg-muted);
  font-weight: 600;
}

.sidebar-nav { list-style: none; padding: 0; margin: 0; flex: 1; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 20px;
  color: var(--sidebar-fg);
  font-size: .9rem;
  border-left: 3px solid transparent;
  transition: all .15s ease;
}
.sidebar-link i { font-size: 1.05rem; width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-link:hover { background: var(--sidebar-bg-hover); color: #fff; text-decoration: none; }
.sidebar-link.active {
  background: rgba(30,64,175,.18);
  color: #fff;
  border-left-color: var(--brand-accent);
}

.sidebar-footer {
  padding: 12px 20px;
  border-top: 1px solid rgba(255,255,255,.06);
  font-size: .75rem;
  color: var(--sidebar-fg-muted);
}

/* =================== MAIN COL =================== */
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* =================== TOPBAR =================== */
.app-topbar {
  height: var(--topbar-height);
  background: var(--card-bg);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-toggle { background: none; border: none; color: var(--text-secondary); font-size: 1.3rem; cursor: pointer; padding: 6px 10px; border-radius: var(--radius-sm); }
.topbar-toggle:hover { background: var(--content-bg); }

.topbar-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}
.topbar-search input {
  width: 100%;
  padding: 8px 14px 8px 38px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  background: var(--content-bg);
  font-size: .9rem;
}
.topbar-search input:focus { outline: none; border-color: var(--brand-primary); background: #fff; box-shadow: 0 0 0 3px rgba(30,64,175,.1); }
.topbar-search i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.topbar-btn {
  background: none; border: none; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text-secondary); cursor: pointer; position: relative; font-size: 1.1rem;
}
.topbar-btn:hover { background: var(--content-bg); }
.topbar-btn .badge-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--brand-danger);
}

.topbar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 12px 4px 4px; border-radius: 999px; cursor: pointer;
  border: 1px solid transparent;
}
.topbar-user:hover { background: var(--content-bg); border-color: var(--card-border); }
.topbar-user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: .85rem;
}
.topbar-user-name { font-size: .85rem; font-weight: 500; }
.topbar-user-role { font-size: .7rem; color: var(--text-muted); }

/* =================== CONTENT =================== */
.app-content { padding: 24px 28px; flex: 1; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.page-title { font-size: 1.45rem; font-weight: 700; margin: 0; color: var(--text-primary); letter-spacing: -.01em; }
.page-subtitle { font-size: .9rem; color: var(--text-muted); margin-top: 4px; }
.breadcrumbs { font-size: .8rem; color: var(--text-muted); margin-bottom: 6px; }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs .sep { margin: 0 6px; }

/* =================== CARDS =================== */
.card-elev {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-elev-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-elev-header h5 { margin: 0; font-size: 1rem; font-weight: 600; }
.card-elev-body { padding: 20px; }

/* =================== STAT TILES =================== */
.stat-tile {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  transition: transform .15s ease, box-shadow .15s ease;
}
.stat-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-tile .stat-meta { flex: 1; }
.stat-tile .stat-label { font-size: .75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.stat-tile .stat-value { font-size: 1.85rem; font-weight: 700; margin-top: 4px; color: var(--text-primary); letter-spacing: -.02em; }
.stat-tile .stat-trend { font-size: .75rem; margin-top: 6px; }
.stat-tile .stat-trend.up { color: var(--brand-success); }
.stat-tile .stat-trend.down { color: var(--brand-danger); }
.stat-tile .stat-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
}
.stat-icon.icon-blue   { background: rgba(14,165,233,.12); color: var(--brand-accent); }
.stat-icon.icon-green  { background: rgba(22,163,74,.12); color: var(--brand-success); }
.stat-icon.icon-red    { background: rgba(220,38,38,.12); color: var(--brand-danger); }
.stat-icon.icon-amber  { background: rgba(245,158,11,.12); color: var(--brand-warning); }
.stat-icon.icon-indigo { background: rgba(30,64,175,.12); color: var(--brand-primary-700); }
.stat-icon.icon-cyan   { background: rgba(8,145,178,.12); color: var(--brand-info); }

/* =================== BUTTONS =================== */
.btn { font-weight: 500; border-radius: var(--radius-md); padding: 7px 14px; font-size: .875rem; transition: all .15s ease; }
.btn-primary { background: var(--brand-primary-700); border-color: var(--brand-primary-700); }
.btn-primary:hover, .btn-primary:focus { background: var(--brand-primary-600); border-color: var(--brand-primary-600); box-shadow: 0 0 0 3px rgba(30,64,175,.15); }
.btn-success { background: var(--brand-success); border-color: var(--brand-success); }
.btn-warning { background: var(--brand-warning); border-color: var(--brand-warning); color: #fff; }
.btn-warning:hover { background: #d97706; border-color: #d97706; color: #fff; }
.btn-danger { background: var(--brand-danger); border-color: var(--brand-danger); }
.btn-outline-primary { color: var(--brand-primary-700); border-color: var(--card-border); }
.btn-outline-primary:hover { background: var(--brand-primary-700); border-color: var(--brand-primary-700); }
.btn-sm { padding: 4px 10px; font-size: .8rem; }

/* =================== TABLES =================== */
.table { color: var(--text-primary); font-size: .875rem; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: 12px 14px; vertical-align: middle; border-bottom-color: var(--card-border); }
.table thead th {
  background: #f8fafc;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 2px solid var(--card-border);
}
.table-hover tbody tr:hover { background: #f8fafc; }
.table-elev { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.table-elev .table { margin: 0; }

/* =================== FORMS =================== */
.form-control, .form-select {
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: .875rem;
  background: #fff;
  color: var(--text-primary);
}
.form-control:focus, .form-select:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 3px rgba(30,64,175,.1); }
.form-label { font-size: .8rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 4px; }

/* =================== BADGES =================== */
.badge-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 600;
  border: 1px solid transparent;
}
.badge-pill.dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.badge-danger  { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.badge-warning { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.badge-info    { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.badge-muted   { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.badge-dark    { background: #1e293b; color: #fff; }

/* =================== ROOM GRID (FRS color codes) =================== */
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; }
.room-card {
  border-radius: var(--radius-md);
  padding: 14px 8px;
  text-align: center;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(0,0,0,.05);
  transition: transform .12s ease, box-shadow .12s ease;
  position: relative;
}
.room-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.room-card .num { font-size: 1.25rem; line-height: 1.2; }
.room-card .type { font-size: .7rem; opacity: .9; margin-top: 2px; font-weight: 500; }
.room-card .status-pip { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: #fff; opacity: .8; }
.room-status-1 { background: linear-gradient(135deg, #16a34a, #15803d); }
.room-status-2 { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.room-status-3 { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
.room-status-4 { background: linear-gradient(135deg, #0ea5e9, #0284c7); }
.room-status-5 { background: linear-gradient(135deg, #fb923c, #ea580c); }
.room-status-6 { background: linear-gradient(135deg, #64748b, #475569); }

.legend-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .72rem; font-weight: 500; background: #f1f5f9; color: var(--text-secondary); margin-right: 4px; }
.legend-chip .swatch { width: 10px; height: 10px; border-radius: 50%; }

/* =================== BOOKING STATUS =================== */
.booking-status-1 { background: #fef3c7; color: #b45309; }
.booking-status-2 { background: #dbeafe; color: #1e40af; }
.booking-status-3 { background: #dcfce7; color: #15803d; }
.booking-status-4 { background: #e2e8f0; color: #334155; }
.booking-status-5 { background: #fee2e2; color: #b91c1c; }
.booking-status-6 { background: #1f2937; color: #fff; }

/* =================== LOGIN =================== */
.login-shell { min-height: 100vh; display: flex; align-items: stretch; background: var(--content-bg); }
.login-brand-panel {
  flex: 1.2;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #1d4ed8 100%);
  color: #fff;
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.login-brand-panel::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(14,165,233,.25), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(168,85,247,.2), transparent 40%);
  pointer-events: none;
}
.login-brand-content { position: relative; z-index: 1; max-width: 480px; }
.login-brand-logo { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
.login-brand-tagline { font-size: 2.25rem; font-weight: 700; line-height: 1.2; margin: 24px 0 16px; letter-spacing: -.02em; }
.login-brand-desc { font-size: 1rem; opacity: .8; line-height: 1.55; }
.login-brand-features { list-style: none; padding: 0; margin: 32px 0; }
.login-brand-features li { padding: 8px 0; display: flex; align-items: center; gap: 12px; opacity: .92; }
.login-brand-features i { color: var(--brand-accent); font-size: 1.1rem; }
.login-brand-footer { position: relative; z-index: 1; font-size: .8rem; opacity: .6; }
.login-form-panel { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-form-card { width: 100%; max-width: 400px; }
.login-form-card h2 { font-size: 1.6rem; font-weight: 700; margin-bottom: 6px; }
.login-form-card .sub { color: var(--text-muted); margin-bottom: 28px; }
@media (max-width: 992px) {
  .login-brand-panel { display: none; }
}

/* =================== UTIL =================== */
.text-muted-2 { color: var(--text-muted); }
.section-title { font-size: 1rem; font-weight: 600; margin-bottom: 14px; color: var(--text-primary); }
.divider { height: 1px; background: var(--card-border); margin: 16px 0; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state i { font-size: 2.5rem; opacity: .4; }
.empty-state p { margin-top: 10px; font-size: .9rem; }

/* PWA install button */
.pwa-install-btn {
  background: rgba(14,165,233,.1);
  color: var(--brand-accent);
  border: 1px solid rgba(14,165,233,.3);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: .8rem;
  font-weight: 500;
  display: none;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.pwa-install-btn.visible { display: inline-flex; }
.pwa-install-btn:hover { background: rgba(14,165,233,.18); }

/* =================== ALERTS =================== */
.alert { border-radius: var(--radius-md); border: 1px solid transparent; padding: 12px 16px; font-size: .875rem; }
.alert-success { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.alert-danger { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.alert-warning { background: #fef3c7; color: #b45309; border-color: #fde68a; }

@media (max-width: 768px) {
  .app-sidebar { position: fixed; z-index: 1000; transform: translateX(-100%); }
  .app-sidebar.open { transform: translateX(0); }
  .app-content { padding: 16px; }
  .page-header { flex-direction: column; align-items: flex-start; }
}
