/* ============================================================
   RMS Design System — VNM Revenue Management System
   ============================================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
  --bg:           #0b0d10;
  --surface:      #14171c;
  --surface-el:   #1a1f27;
  --border:       #2a3040;
  --accent-red:   #dc2626;
  --accent-gold:  #f5b14a;
  --accent-blue:  #3b82f6;
  --text-primary: #f1f5f9;
  --text-muted:   #9aa0a6;
  --green:        #22c55e;
  --red:          #ef4444;
  --gold:         #eab308;
  --nav-w:        64px;
  --nav-w-exp:    220px;
  --topbar-h:     56px;
  --radius:       8px;
  --radius-sm:    4px;
  --shadow:       0 2px 12px rgba(0,0,0,.4);
}

/* ---------- Base Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Left Nav Rail ---------- */
.nav-rail {
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  width: var(--nav-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 200ms ease;
}

.nav-rail:hover {
  width: var(--nav-w-exp);
}

.nav-logo {
  display: flex;
  align-items: center;
  padding: 0 16px;
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  overflow: hidden;
  white-space: nowrap;
}

.nav-logo-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
}

.nav-logo-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-gold);
  letter-spacing: .04em;
  margin-left: 12px;
  opacity: 0;
  transition: opacity 150ms ease;
  white-space: nowrap;
}

.nav-rail:hover .nav-logo-text { opacity: 1; }

.nav-items {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-item {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 16px;
  cursor: pointer;
  border-radius: 0;
  transition: background 120ms ease;
  text-decoration: none;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}

.nav-item:hover {
  background: var(--surface-el);
  color: var(--text-primary);
  text-decoration: none;
}

.nav-item.active {
  background: rgba(59,130,246,.12);
  color: var(--accent-blue);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--accent-blue);
  border-radius: 0 2px 2px 0;
}

.nav-icon {
  font-size: 16px;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}

.nav-label {
  font-size: 13px;
  font-weight: 500;
  margin-left: 10px;
  opacity: 0;
  transition: opacity 150ms ease;
}

.nav-rail:hover .nav-label { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  opacity: 0;
  transition: opacity 150ms ease;
}

.nav-rail:hover .nav-badge { opacity: 1; }

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 16px 16px 4px;
  opacity: 0;
  transition: opacity 150ms ease;
  white-space: nowrap;
}

.nav-rail:hover .nav-section-label { opacity: 1; }

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 12px;
}

/* ---------- Top Bar ---------- */
.top-bar {
  position: fixed;
  top: 0;
  left: var(--nav-w);
  right: 0;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 40;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
}

.top-bar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  flex-shrink: 0;
}

.top-bar-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  flex-shrink: 0;
}

.top-bar-spacer { flex: 1; }

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.date-range-group .rms-input {
  width: 130px;
  padding: 5px 10px;
  font-size: 12px;
}

.date-range-sep {
  color: var(--text-muted);
  font-size: 12px;
}

.hotel-selector-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hotel-selector-wrap .rms-select {
  width: 180px;
  font-size: 12px;
  padding: 5px 10px;
}

/* User menu */
.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: border-color 120ms;
  position: relative;
}

.user-menu-trigger:hover { border-color: var(--border); }

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface-el);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 180px;
  z-index: 100;
  overflow: hidden;
}

.user-dropdown a {
  display: block;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-primary);
  text-decoration: none;
  transition: background 120ms;
}

.user-dropdown a:hover { background: var(--border); }

/* ---------- Main Content ---------- */
.main-content {
  margin-left: var(--nav-w);
  margin-top: var(--topbar-h);
  padding: 24px;
  max-width: 1600px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---------- KPI Tiles ---------- */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: default;
  transition: border-color 120ms;
}

.kpi-tile:hover { border-color: var(--accent-blue); }

.kpi-tile.clickable { cursor: pointer; }

.kpi-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-bottom: 10px;
}

.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 2px 6px;
  border-radius: 10px;
}

.kpi-delta.up {
  background: rgba(34,197,94,.15);
  color: var(--green);
}

.kpi-delta.down {
  background: rgba(239,68,68,.15);
  color: var(--red);
}

.kpi-delta.neutral {
  background: rgba(154,160,166,.12);
  color: var(--text-muted);
}

.kpi-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Period toggle inside KPI */
.kpi-period-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}

.kpi-period-tab {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 100ms, color 100ms;
}

.kpi-period-tab.active {
  background: var(--accent-blue);
  color: #fff;
}

/* ---------- Cards & Panels ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.rms-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.rms-table thead tr {
  background: var(--surface-el);
  border-bottom: 1px solid var(--border);
}

.rms-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
}

.rms-table th:hover { color: var(--text-primary); }

.rms-table th.sorted { color: var(--accent-blue); }

.rms-table th.sorted::after {
  content: ' ↑';
  font-size: 10px;
}

.rms-table th.sorted.desc::after { content: ' ↓'; }

.rms-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 80ms;
}

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

.rms-table tbody tr:hover { background: var(--surface-el); }

.rms-table tbody tr.expanded-row { background: rgba(59,130,246,.04); }

.rms-table td {
  padding: 11px 14px;
  color: var(--text-primary);
  vertical-align: middle;
}

.rms-table td.muted { color: var(--text-muted); }

/* Row tint for comp grid */
.rms-table tbody tr.row-high { background: rgba(239,68,68,.06); }
.rms-table tbody tr.row-high:hover { background: rgba(239,68,68,.10); }
.rms-table tbody tr.row-low  { background: rgba(34,197,94,.06); }
.rms-table tbody tr.row-low:hover { background: rgba(34,197,94,.10); }

/* Expandable detail row */
.detail-row td { padding: 0; }
.detail-content {
  background: var(--bg);
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------- Badges & Tags ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.badge-red    { background: rgba(239,68,68,.18);  color: var(--red); }
.badge-gold   { background: rgba(234,179,8,.18);  color: var(--gold); }
.badge-blue   { background: rgba(59,130,246,.18); color: var(--accent-blue); }
.badge-green  { background: rgba(34,197,94,.18);  color: var(--green); }
.badge-muted  { background: rgba(154,160,166,.12); color: var(--text-muted); }
.badge-purple { background: rgba(168,85,247,.18); color: #c084fc; }

/* Status dots */
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-green  { background: var(--green); box-shadow: 0 0 4px var(--green); }
.dot-gold   { background: var(--gold); box-shadow: 0 0 4px var(--gold); }
.dot-red    { background: var(--red); box-shadow: 0 0 4px var(--red); }
.dot-muted  { background: var(--text-muted); }

/* Severity circle indicators */
.sev-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.sev-dot.sev-red  { background: var(--red); }
.sev-dot.sev-gold { background: var(--gold); }
.sev-dot.sev-blue { background: var(--accent-blue); }

/* ---------- Alert Styles ---------- */
.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-left: 3px solid transparent;
  border-bottom: 1px solid var(--border);
  transition: background 100ms;
}
.alert-item:last-child { border-bottom: none; }
.alert-item:hover { background: var(--surface-el); }

.alert-red  { border-left-color: var(--red); }
.alert-gold { border-left-color: var(--gold); }
.alert-blue { border-left-color: var(--accent-blue); }
.alert-ack  { opacity: .5; }

.alert-body { flex: 1; min-width: 0; }
.alert-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.alert-detail { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.alert-meta  { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.alert-time  { font-size: 11px; color: var(--text-muted); }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 14px;
  transition: opacity 120ms, background 120ms;
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--accent-blue);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: #2563eb; }

.btn-gold {
  background: var(--accent-gold);
  color: #000;
}
.btn-gold:hover:not(:disabled) { background: #e69d30; }

.btn-green {
  background: var(--green);
  color: #000;
}
.btn-green:hover:not(:disabled) { background: #16a34a; }

.btn-danger {
  background: var(--red);
  color: #fff;
}
.btn-danger:hover:not(:disabled) { background: #dc2626; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) { background: var(--surface-el); color: var(--text-primary); }

.btn-sm { padding: 4px 10px; font-size: 11px; }
.btn-lg { padding: 10px 20px; font-size: 14px; }

.btn-icon {
  padding: 6px;
  width: 30px;
  height: 30px;
}

/* ---------- Form Elements ---------- */
.rms-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.rms-input,
.rms-select,
.rms-textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  padding: 8px 12px;
  width: 100%;
  transition: border-color 120ms;
  outline: none;
}

.rms-input:focus,
.rms-select:focus,
.rms-textarea:focus {
  border-color: var(--accent-blue);
}

.rms-input::placeholder { color: var(--text-muted); }

.rms-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239aa0a6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.rms-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-group { margin-bottom: 16px; }

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

.form-error {
  font-size: 11px;
  color: var(--red);
  margin-top: 4px;
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(2px);
}

.modal-overlay.hidden { display: none; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,.6);
}

.modal-lg { max-width: 760px; }
.modal-sm { max-width: 400px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}
.modal-close:hover { color: var(--text-primary); }

.modal-body { padding: 24px; }

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

/* ---------- Heatmap Cells ---------- */
.heatmap-cell {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 2px;
}

/* ---------- Toast Notifications ---------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--surface-el);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 340px;
  pointer-events: all;
  animation: slideInRight .2s ease;
  border-left: 3px solid var(--border);
}

.toast.toast-success { border-left-color: var(--green); }
.toast.toast-error   { border-left-color: var(--red); }
.toast.toast-info    { border-left-color: var(--accent-blue); }
.toast.toast-warn    { border-left-color: var(--gold); }

.toast.fade-out { animation: fadeOut .3s ease forwards; }

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

@keyframes fadeOut {
  to { opacity: 0; transform: translateY(8px); }
}

/* ---------- Filters Bar ---------- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.filter-bar .rms-input,
.filter-bar .rms-select {
  width: auto;
  min-width: 120px;
  font-size: 12px;
  padding: 6px 10px;
}

.filter-bar .rms-select { padding-right: 24px; }

.filter-sep {
  color: var(--border);
  font-size: 18px;
  font-weight: 300;
}

/* ---------- Tab Controls ---------- */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.tab-btn {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 120ms, border-color 120ms;
}

.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Grid Layouts ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.col-2-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.col-sidebar { display: grid; grid-template-columns: 280px 1fr; gap: 20px; }

/* ---------- Utility Classes ---------- */
.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mono-num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }
.text-muted { color: var(--text-muted); }
.text-green { color: var(--green); }
.text-red   { color: var(--red); }
.text-gold  { color: var(--gold); }
.text-blue  { color: var(--accent-blue); }
.text-small { font-size: 11px; }
.text-xs    { font-size: 10px; }
.font-bold  { font-weight: 700; }
.font-semi  { font-weight: 600; }

.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.flex-1 { flex: 1; }

.w-full { width: 100%; }
.hidden { display: none !important; }

/* ---------- Empty States ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
  gap: 10px;
}

.empty-state-icon { font-size: 36px; opacity: .4; }
.empty-state-text { font-size: 13px; }

/* ---------- Loading / Skeleton ---------- */
.skeleton {
  background: var(--surface-el);
  border-radius: var(--radius-sm);
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  0%   { opacity: .5; }
  50%  { opacity: 1; }
  100% { opacity: .5; }
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

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

/* ---------- Recommendation Cards ---------- */
.reco-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.reco-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  border-top: 3px solid var(--border);
  transition: border-top-color 120ms;
}

.reco-card.status-open    { border-top-color: var(--gold); }
.reco-card.status-applied { border-top-color: var(--green); }
.reco-card.status-snoozed,
.reco-card.status-dismissed { border-top-color: var(--text-muted); opacity: .6; }

.reco-hotel  { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.reco-rule   { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-gold); margin-bottom: 8px; }
.reco-detail { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin-bottom: 12px; }
.reco-suggest { font-size: 12px; color: var(--text-primary); background: var(--surface-el); border-radius: var(--radius-sm); padding: 8px 10px; margin-bottom: 14px; }
.reco-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Health Gauges ---------- */
.gauge-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.gauge-label { font-size: 12px; color: var(--text-muted); width: 80px; flex-shrink: 0; }
.gauge-bar-wrap { flex: 1; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.gauge-bar { height: 100%; border-radius: 4px; transition: width .3s ease; }
.gauge-value { font-size: 12px; color: var(--text-primary); font-variant-numeric: tabular-nums; width: 44px; text-align: right; flex-shrink: 0; }

.gauge-bar.ok     { background: var(--green); }
.gauge-bar.warn   { background: var(--gold); }
.gauge-bar.danger { background: var(--red); }

/* ---------- Scraper Cards ---------- */
.scraper-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.scraper-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.scraper-name { font-size: 13px; font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.scraper-age  { font-size: 24px; font-weight: 700; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.scraper-age.ok   { color: var(--green); }
.scraper-age.warn { color: var(--gold); }
.scraper-age.bad  { color: var(--red); }
.scraper-meta { font-size: 11px; color: var(--text-muted); }

/* ---------- Login Page ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px 44px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo-main {
  font-size: 26px;
  font-weight: 800;
  color: var(--accent-gold);
  letter-spacing: .04em;
}

.login-logo-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.login-error {
  background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.3);
  border-radius: var(--radius-sm);
  color: var(--red);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* ---------- Sidebar Hotel List ---------- */
.sidebar-hotel-list {
  overflow-y: auto;
  flex: 1;
  margin-top: 10px;
}

.sidebar-hotel-item {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
  transition: background 100ms, color 100ms;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-left: 2px solid transparent;
}

.sidebar-hotel-item:hover { background: var(--surface-el); color: var(--text-primary); }
.sidebar-hotel-item.selected { background: rgba(59,130,246,.1); color: var(--accent-blue); border-left-color: var(--accent-blue); }

/* ---------- Pricing Tier Table ---------- */
.tier-table { width: 100%; border-collapse: collapse; }
.tier-table th, .tier-table td { padding: 12px 16px; border: 1px solid var(--border); }
.tier-table th { background: var(--surface-el); font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--text-muted); }
.tier-table .tier-pct { color: var(--accent-gold); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tier-table input { background: transparent; border: 1px solid var(--accent-blue); border-radius: var(--radius-sm); padding: 4px 8px; color: var(--text-primary); font-size: 13px; font-family: inherit; width: 80px; }

/* ---------- User Table ---------- */
.role-badge-admin { background: rgba(245,177,74,.15); color: var(--accent-gold); }
.role-badge-user  { background: rgba(59,130,246,.12); color: var(--accent-blue); }

/* ---------- Inline Chart Popover ---------- */
.price-popover {
  position: fixed;
  background: var(--surface-el);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  z-index: 150;
  padding: 12px;
  width: 320px;
}

/* ---------- Confirmation Modal Warning ---------- */
.confirm-warning {
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.25);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  color: #fca5a5;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ---------- Auto-refresh Indicator ---------- */
.refresh-indicator {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---------- Audit JSON Viewer ---------- */
.json-viewer {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #a8c3e8;
  overflow-x: auto;
  white-space: pre;
  max-height: 200px;
  overflow-y: auto;
}

/* ---------- Mobile Bottom Nav ---------- */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 50;
  align-items: center;
  justify-content: space-around;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: color 120ms;
  flex: 1;
  text-align: center;
}

.bottom-nav-item.active { color: var(--accent-blue); }
.bottom-nav-item .bnav-icon { font-size: 18px; }

/* ---------- Responsive Breakpoints ---------- */
@media (max-width: 768px) {
  .nav-rail { display: none; }
  .bottom-nav { display: flex; }

  .top-bar {
    left: 0;
    padding: 0 14px;
  }

  .main-content {
    margin-left: 0;
    padding: 14px;
    padding-bottom: 80px; /* room for bottom nav */
  }

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

  .laptop-only { display: none !important; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .col-2-3 { grid-template-columns: 1fr; }
  .col-sidebar { grid-template-columns: 1fr; }
  .reco-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }

  .date-range-group { display: none; }
  .hotel-selector-wrap { display: none; }

  .modal { max-width: 100%; }
  .modal-overlay { padding: 12px; align-items: flex-end; }
  .modal { border-radius: 16px 16px 0 0; max-height: 85vh; }

  .rms-table th, .rms-table td { padding: 8px 10px; font-size: 12px; }
}

@media (max-width: 1100px) {
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Convention Dot Marker ---------- */
.conv-marker {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-gold);
  vertical-align: middle;
  margin-left: 2px;
}

/* Scrollbar styling for consistency */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3a4255; }
