/* ═══════════════════════════════════════════════════════
   HotelLens — style.css
   Hotel Owner Oversight Platform
   ═══════════════════════════════════════════════════════ */

:root, [data-theme="dark"] {
  --bg: #0c0f18; --bg-card: #141a2a; --bg-input: #0e1322; --bg-sidebar: #101728;
  --bg-header: rgba(12,15,24,0.92); --border: rgba(255,255,255,0.1);
  --border-focus: rgba(212,175,55,0.5);
  --text: #f7fafc; --text2: #cbd5e0; --text3: #a0aec0;
  --accent: #d4af37; --accent-dim: rgba(212,175,55,0.12); --accent-glow: rgba(212,175,55,0.3);
  --green: #68d391; --green-dim: rgba(104,211,145,0.12);
  --yellow: #f6e05e; --yellow-dim: rgba(246,224,94,0.12);
  --orange: #f6ad55; --orange-dim: rgba(246,173,85,0.12);
  --red: #feb2b2; --red-dim: rgba(254,178,178,0.12);
  --blue: #90cdf4; --blue-dim: rgba(144,205,244,0.12);
  --bar-track: rgba(255,255,255,0.08);
  --radius: 10px; --radius-sm: 6px;
  --font: 'DM Sans', -apple-system, sans-serif; --mono: 'JetBrains Mono', monospace;
}
[data-theme="light"] {
  --bg: #f4f1ec; --bg-card: #ffffff; --bg-input: #f7f5f0; --bg-sidebar: #1a1f2e;
  --bg-header: rgba(255,255,255,0.92); --border: rgba(0,0,0,0.08);
  --border-focus: rgba(180,140,20,0.5);
  --text: #1a202c; --text2: #4a5568; --text3: #a0aec0;
  --accent: #b08c14; --accent-dim: rgba(176,140,20,0.08); --accent-glow: rgba(176,140,20,0.2);
  --green: #38a169; --green-dim: rgba(56,161,105,0.08);
  --yellow: #d69e2e; --yellow-dim: rgba(214,158,46,0.08);
  --orange: #dd6b20; --orange-dim: rgba(221,107,32,0.08);
  --red: #e53e3e; --red-dim: rgba(229,62,62,0.06);
  --blue: #3182ce; --blue-dim: rgba(49,130,206,0.08);
  --bar-track: rgba(0,0,0,0.04);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; -webkit-font-smoothing: antialiased; display: flex; transition: background 0.3s, color 0.3s; }
::-webkit-scrollbar { width: 5px; } ::-webkit-scrollbar-track { background: transparent; } ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 3px; }

.sidebar { width: 210px; min-height: 100vh; background: var(--bg-sidebar); border-right: 1px solid rgba(255,255,255,0.1); display: flex; flex-direction: column; position: fixed; z-index: 50; }
.sidebar-brand { padding: 18px 14px 12px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-logo { font-size: 18px; font-weight: 700; color: var(--accent); }
.sidebar-sub { font-size: 10px; color: #a0aec0; margin-top: 1px; }
.sidebar-nav { flex: 1; padding: 8px 6px; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500; color: #cbd5e0; cursor: pointer; border: none; background: none; width: 100%; text-align: left; font-family: var(--font); transition: all 0.15s; }
.nav-item:hover { background: rgba(255,255,255,0.06); color: #f7fafc; }
.nav-item.active { background: var(--accent-dim); color: var(--accent); }
.nav-icon { font-size: 13px; width: 18px; text-align: center; }
.sidebar-links { padding: 4px 6px; border-top: 1px solid rgba(255,255,255,0.1); }
.sidebar-link { display: flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: var(--radius-sm); font-size: 11px; color: #cbd5e0; text-decoration: none; transition: all 0.15s; }
.sidebar-link:hover { background: rgba(255,255,255,0.06); color: #f7fafc; }
.sidebar-footer { padding: 10px 12px; border-top: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: space-between; }
.sidebar-tag { font-size: 9px; color: #a0aec0; }
.theme-btn { width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.06); color: #cbd5e0; cursor: pointer; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.theme-btn:hover { border-color: var(--accent); color: var(--accent); }

.main-wrap { flex: 1; margin-left: 210px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { height: 48px; display: flex; align-items: center; padding: 0 20px; background: var(--bg-header); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40; gap: 10px; }
.topbar-title { font-size: 13px; font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 7px; }
.topbar-badge { font-size: 9px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent-dim); color: var(--accent); border: 1px solid var(--accent-glow); }
.topbar-hotel { font-size: 11px; color: var(--text3); }
.menu-toggle { display: none; background: none; border: none; color: var(--text); font-size: 18px; cursor: pointer; }
.content { padding: 20px; flex: 1; max-width: 1140px; }

.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 10px; margin-bottom: 16px; }
.kpi { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px; }
.kpi-label { font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text3); margin-bottom: 3px; }
.kpi-val { font-size: 22px; font-weight: 700; font-family: var(--mono); letter-spacing: -1px; }
.kpi-sub { font-size: 10px; color: var(--text3); margin-top: 1px; }

.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px; margin-bottom: 10px; }
.card-label { font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text3); margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

.tbl { width: 100%; border-collapse: collapse; font-size: 11px; }
.tbl thead th { text-align: left; padding: 6px 9px; font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text3); border-bottom: 1px solid var(--border); }
.tbl tbody td { padding: 7px 9px; border-bottom: 1px solid var(--border); }

.badge { display: inline-block; padding: 2px 7px; border-radius: 999px; font-size: 9px; font-weight: 600; }
.badge-green { background: var(--green-dim); color: var(--green); }
.badge-yellow { background: var(--yellow-dim); color: var(--yellow); }
.badge-orange { background: var(--orange-dim); color: var(--orange); }
.badge-red { background: var(--red-dim); color: var(--red); }
.badge-blue { background: var(--blue-dim); color: var(--blue); }
.badge-gold { background: var(--accent-dim); color: var(--accent); }
.badge-gray { background: rgba(160,174,192,0.1); color: var(--text3); }

.prog-wrap { display: flex; align-items: center; gap: 6px; }
.prog-track { flex: 1; height: 5px; border-radius: 3px; background: var(--bar-track); overflow: hidden; }
.prog-fill { height: 100%; border-radius: 3px; transition: width 0.4s; }
.prog-pct { font-size: 11px; font-weight: 600; font-family: var(--mono); min-width: 26px; text-align: right; }

.stat-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 11px; border-bottom: 1px solid var(--border); }
.stat-row:last-child { border-bottom: none; }

.alert { padding: 8px 11px; border-radius: var(--radius-sm); font-size: 11px; margin-bottom: 8px; display: flex; align-items: flex-start; gap: 6px; }
.alert-red { background: var(--red-dim); color: var(--red); border: 1px solid rgba(252,129,129,0.15); }
.alert-yellow { background: var(--yellow-dim); color: var(--yellow); border: 1px solid rgba(236,201,75,0.15); }
.alert-green { background: var(--green-dim); color: var(--green); border: 1px solid rgba(72,187,120,0.15); }
.alert-gold { background: var(--accent-dim); color: var(--accent); border: 1px solid var(--accent-glow); }

.grade-box { text-align: center; padding: 16px; }
.grade-letter { font-size: 48px; font-weight: 800; font-family: var(--mono); }
.grade-score { font-size: 12px; color: var(--text3); margin-top: 2px; }
.grade-trend { font-size: 11px; margin-top: 4px; font-weight: 600; }

.drift-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px; margin-bottom: 8px; border-left: 3px solid var(--orange); }
.drift-card.severe { border-left-color: var(--red); }
.drift-title { font-size: 12px; font-weight: 600; margin-bottom: 3px; }
.drift-detail { font-size: 11px; color: var(--text2); line-height: 1.6; }

.sec-title { font-size: 16px; font-weight: 700; margin-bottom: 3px; }
.sec-desc { font-size: 11px; color: var(--text3); margin-bottom: 14px; }

.btn { padding: 5px 11px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: transparent; color: var(--text2); cursor: pointer; font-size: 11px; font-weight: 500; font-family: var(--font); transition: all 0.15s; }
.btn:hover { border-color: var(--accent-glow); color: var(--text); }
.btn-accent { background: var(--accent-dim); border-color: var(--accent-glow); color: var(--accent); }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); position: fixed; } .sidebar.open { transform: translateX(0); }
  .main-wrap { margin-left: 0; } .menu-toggle { display: block; }
  .content { padding: 12px; } .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
