:root {
  --bg: #06101c;
  --surface: #0b1a29;
  --surface-2: #102235;
  --line: rgba(151, 179, 204, 0.16);
  --text: #eff7fb;
  --muted: #8fa6b8;
  --accent: #35d3b4;
  --accent-soft: rgba(53, 211, 180, 0.12);
  --blue: #69a9ff;
  --danger: #ff746c;
  --warning: #f7c76b;
  --radius: 18px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 84% -10%, rgba(43, 119, 180, 0.19), transparent 30rem),
    radial-gradient(circle at -8% 32%, rgba(53, 211, 180, 0.08), transparent 26rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { cursor: pointer; }

.topbar {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 26px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-row { display: flex; align-items: center; gap: 13px; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--accent), #2089a9);
  color: #031316;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: -0.03em;
  box-shadow: 0 12px 34px rgba(53, 211, 180, 0.18);
}

h1, h2, p { margin: 0; }
h1 { font-size: clamp(19px, 3vw, 25px); letter-spacing: -0.035em; }
h2 { font-size: clamp(22px, 3vw, 30px); letter-spacing: -0.04em; }
.eyebrow, .control-label, .metric-label {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.17em;
}
.eyebrow { margin-bottom: 4px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.dashboard-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 8px 0 40px;
}

.control-strip {
  min-height: 112px;
  padding: 22px 24px;
  display: grid;
  grid-template-columns: 1.3fr 1fr auto;
  align-items: center;
  gap: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(115deg, rgba(16, 34, 53, 0.98), rgba(8, 24, 38, 0.95));
  box-shadow: var(--shadow);
}

.control-label { color: var(--muted); margin-bottom: 8px; }
.date-range { display: flex; gap: 10px; font-size: 20px; font-weight: 750; letter-spacing: -0.025em; }
.status-block { display: flex; align-items: center; gap: 11px; }
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--warning);
  box-shadow: 0 0 0 6px rgba(247, 199, 107, 0.08);
}
.status-dot.live { background: var(--accent); box-shadow: 0 0 0 6px var(--accent-soft); }
.status-dot.error { background: var(--danger); box-shadow: 0 0 0 6px rgba(255, 116, 108, 0.08); }

.primary-button, .ghost-button {
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 760;
}
.primary-button {
  background: var(--accent);
  color: #041515;
  box-shadow: 0 10px 28px rgba(53, 211, 180, 0.16);
}
.primary-button:hover { filter: brightness(1.06); transform: translateY(-1px); }
.primary-button:disabled { cursor: wait; opacity: 0.6; transform: none; }
.ghost-button { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.refresh-button { min-width: 180px; }
.spinning { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 16px 0;
}
.metric-card {
  min-height: 144px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(11, 26, 41, 0.84);
}
.metric-card.accent { background: linear-gradient(145deg, rgba(53, 211, 180, 0.14), rgba(11, 26, 41, 0.92)); }
.metric-label { color: var(--muted); }
.metric-value { margin-top: 16px; font-size: clamp(27px, 4vw, 38px); font-weight: 820; letter-spacing: -0.045em; }
.metric-unit { color: var(--muted); font-size: 18px; }
.metric-foot { margin-top: 5px; color: var(--muted); font-size: 12px; }

.rate-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(9, 23, 37, 0.93);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.panel-heading { padding: 24px; display: flex; align-items: end; justify-content: space-between; border-bottom: 1px solid var(--line); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 13px 18px; color: var(--muted); font-size: 10px; letter-spacing: 0.12em; text-align: left; background: rgba(255, 255, 255, 0.018); }
td { padding: 18px; border-top: 1px solid var(--line); vertical-align: middle; }
tbody tr:first-child td { border-top: 0; }
tbody tr:hover { background: rgba(255, 255, 255, 0.018); }
.rank-badge { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-weight: 800; }
.rank-badge.first { background: var(--accent-soft); color: var(--accent); border-color: rgba(53, 211, 180, 0.3); }
.hotel-name { color: var(--text); font-weight: 760; text-decoration: none; }
.hotel-name:hover { color: var(--accent); }
.hotel-meta, .room-meta { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.provider-badge { display: inline-flex; margin-left: 5px; padding: 2px 6px; border-radius: 999px; font-size: 9px; font-weight: 800; letter-spacing: 0.04em; vertical-align: 1px; }
.provider-badge.traveloka { color: #86c2ff; background: rgba(105, 169, 255, 0.12); }
.provider-badge.agoda { color: #ffaaa5; background: rgba(255, 116, 108, 0.12); }
.provider-badge.tiket { color: #ffe171; background: rgba(255, 209, 64, 0.12); }
.price-column { text-align: right; }
.net-price { font-size: 19px; font-weight: 820; letter-spacing: -0.025em; white-space: nowrap; }
.net-label { display: block; margin-top: 3px; color: var(--accent); font-size: 10px; }
.delta { display: inline-flex; padding: 5px 8px; border-radius: 8px; font-size: 11px; font-weight: 750; background: rgba(143, 166, 184, 0.09); color: var(--muted); white-space: nowrap; }
.delta.down { color: var(--accent); background: var(--accent-soft); }
.delta.up { color: var(--danger); background: rgba(255, 116, 108, 0.09); }
.status-pill { display: inline-flex; margin-top: 5px; padding: 4px 7px; border-radius: 999px; background: rgba(255, 116, 108, 0.09); color: var(--danger); font-size: 10px; }
.loading-row td { padding: 46px; color: var(--muted); text-align: center; }
.loader { display: inline-block; width: 14px; height: 14px; margin-right: 8px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: -2px; }
.mobile-rate-list { display: none; }

.dashboard-footer { display: flex; justify-content: space-between; gap: 20px; padding: 16px 3px 0; color: var(--muted); font-size: 11px; }
.toast { position: fixed; right: 20px; bottom: 20px; max-width: 340px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 12px; background: #12263a; color: var(--text); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(10px); transition: 180ms ease; }
.toast.show { opacity: 1; transform: translateY(0); }

.login-body { display: grid; place-items: center; }
.login-shell { width: min(440px, calc(100% - 36px)); padding: 40px 0; }
.login-card { padding: 34px; border: 1px solid var(--line); border-radius: 24px; background: rgba(11, 26, 41, 0.94); box-shadow: var(--shadow); }
.login-card .brand-mark { margin-bottom: 24px; }
.login-card h1 { margin-bottom: 8px; font-size: 28px; }
.login-form { display: grid; gap: 16px; margin-top: 26px; }
.login-form label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.login-form input { width: 100%; border: 1px solid var(--line); border-radius: 11px; background: #071523; color: var(--text); padding: 12px 13px; outline: none; }
.login-form input:focus { border-color: rgba(53, 211, 180, 0.6); box-shadow: 0 0 0 3px var(--accent-soft); }
.alert { margin-top: 18px; padding: 10px 12px; border-radius: 10px; background: rgba(255, 116, 108, 0.09); color: #ffaaa5; font-size: 12px; }

@media (max-width: 820px) {
  .control-strip { grid-template-columns: 1fr 1fr; }
  .refresh-button { grid-column: 1 / -1; width: 100%; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 118px; }
  .metric-value { margin-top: 10px; }
  .table-wrap { display: none; }
  .mobile-rate-list { display: grid; gap: 10px; padding: 14px; }
  .mobile-card { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, 0.018); }
  .mobile-card-head, .mobile-card-price { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
  .mobile-card-price { align-items: end; margin-top: 15px; }
  .dashboard-footer { flex-direction: column; }
}

@media (max-width: 520px) {
  .topbar, .dashboard-shell { width: min(100% - 24px, 1180px); }
  .topbar { padding-top: 18px; }
  .control-strip { grid-template-columns: 1fr; padding: 18px; }
  .refresh-button { grid-column: auto; }
  .panel-heading { align-items: start; flex-direction: column; gap: 8px; }
  .date-range { font-size: 17px; }
  .login-card { padding: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
