* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7fa;
  color: #1a2332;
  line-height: 1.5;
}
.hidden { display: none !important; }
.muted { color: #64748b; font-size: 14px; }
.hint { color: #94a3b8; font-size: 12px; font-weight: normal; }

/* Topbar */
.topbar {
  background: #1a2332;
  color: white;
  padding: 14px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo { font-weight: 700; font-size: 18px; }
.logo span { color: #4ade80; }
.user { font-size: 14px; opacity: 0.9; display: flex; gap: 12px; align-items: center; }
.link-btn {
  background: none; border: none; color: inherit; cursor: pointer;
  text-decoration: underline; opacity: 0.7; font: inherit;
}
.link-btn:hover { opacity: 1; }

/* Container */
.container { max-width: 1280px; margin: 0 auto; padding: 24px 32px; }
.container.narrow { max-width: 720px; }

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}
.header h1 { font-size: 24px; }
.subtitle { color: #64748b; font-size: 14px; margin-top: 4px; }
.header-controls { display: flex; gap: 12px; align-items: center; }
.inline-label {
  display: flex; gap: 8px; align-items: center;
  background: white; padding: 8px 14px; border-radius: 8px;
  border: 1px solid #e2e8f0; font-size: 14px;
}
.inline-label input { border: none; outline: none; font: inherit; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: white; padding: 20px; border-radius: 12px; border: 1px solid #e2e8f0;
}
.stat-card.skeleton { height: 100px; background: linear-gradient(90deg, #f1f5f9, #e2e8f0, #f1f5f9); background-size: 400%; animation: pulse 1.5s infinite; }
@keyframes pulse { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.stat-label { font-size: 12px; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 28px; font-weight: 700; margin-top: 8px; }
.stat-change { font-size: 13px; margin-top: 4px; }
.up { color: #16a34a; }
.down { color: #dc2626; }
.neutral { color: #64748b; }

/* Alert banner */
.alert-banner {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-left: 4px solid #f97316;
  padding: 16px 20px;
  border-radius: 8px;
  margin-bottom: 24px;
  font-size: 14px;
}
.alert-banner strong { color: #c2410c; }

/* Grid */
.grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
@media (max-width: 1000px) {
  .grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* Cards */
.card { background: white; border-radius: 12px; border: 1px solid #e2e8f0; overflow: hidden; }
.card-header {
  padding: 16px 20px; border-bottom: 1px solid #f1f5f9;
  display: flex; justify-content: space-between; align-items: center;
}
.card-header h2 { font-size: 16px; font-weight: 600; }
.card-header .meta { font-size: 12px; color: #64748b; }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead { background: #f8fafc; }
th {
  text-align: left; padding: 10px 20px;
  font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px;
  font-weight: 600;
}
th.num, td.num { text-align: right; }
td { padding: 14px 20px; border-top: 1px solid #f1f5f9; font-size: 14px; }
td.hotel-name { font-weight: 500; }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600;
}
.badge-yours { background: #dbeafe; color: #1e40af; }
.badge-cheap { background: #dcfce7; color: #15803d; }
.badge-expensive { background: #fee2e2; color: #b91c1c; }
tr.your-hotel { background: #f0f9ff; }
.empty { padding: 32px; text-align: center; color: #94a3b8; }

/* Chart */
.chart-area { padding: 20px; height: 240px; position: relative; }
#history-chart { width: 100%; height: 100%; }

/* Recommendation */
.recommendation { padding: 20px; }
.reco-pill {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; margin-bottom: 12px;
  background: #dcfce7; color: #15803d;
}
.reco-pill.warn { background: #fef3c7; color: #a16207; }
.reco-price { font-size: 36px; font-weight: 700; margin: 8px 0; }
.reco-detail { font-size: 13px; color: #64748b; line-height: 1.6; }

/* Alerts list */
.alerts-list { padding: 8px 0; }
.alert-item {
  padding: 12px 20px; border-bottom: 1px solid #f1f5f9; font-size: 13px;
}
.alert-item:last-child { border-bottom: none; }
.alert-item .time { color: #94a3b8; font-size: 11px; margin-top: 2px; }

/* Buttons */
.btn-primary {
  background: #1a2332; color: white; border: none;
  padding: 12px 24px; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  display: inline-block; text-decoration: none;
}
.btn-primary:hover { background: #2d3a4f; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary.btn-disabled {
  opacity: 0.5; cursor: not-allowed; pointer-events: none;
}
.btn-secondary {
  background: white; color: #1a2332; border: 1px solid #cbd5e1;
  padding: 10px 16px; border-radius: 8px;
  font-size: 14px; font-weight: 500; cursor: pointer;
}
.btn-secondary:hover { background: #f8fafc; }
.btn-link {
  background: none; border: none; color: #64748b;
  padding: 10px 16px; cursor: pointer; font: inherit;
}

/* Auth */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1a2332 0%, #0f172a 100%);
  padding: 24px;
}
.auth-card {
  background: white; padding: 40px; border-radius: 16px;
  width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.logo-big { font-size: 28px; font-weight: 700; color: #1a2332; }
.logo-big span { color: #16a34a; }
.auth-sub { color: #64748b; margin-top: 4px; margin-bottom: 24px; font-size: 14px; }

.tab-row {
  display: flex; gap: 8px; margin-bottom: 24px;
  border-bottom: 1px solid #e2e8f0;
}
.tab {
  background: none; border: none; padding: 12px 20px; cursor: pointer;
  font: inherit; color: #64748b; border-bottom: 2px solid transparent;
}
.tab.active { color: #1a2332; border-bottom-color: #1a2332; font-weight: 600; }

.auth-form { display: none; flex-direction: column; gap: 12px; }
.auth-form.active { display: flex; }
.auth-form label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; color: #475569; font-weight: 500;
}
.auth-form input {
  padding: 10px 14px; border: 1px solid #cbd5e1; border-radius: 8px;
  font-size: 15px; outline: none;
}
.auth-form input:focus { border-color: #1a2332; }

.form-error {
  color: #dc2626; font-size: 13px; min-height: 18px;
}

/* Onboarding */
.step-indicator {
  display: flex; gap: 12px; margin-bottom: 32px;
  background: white; padding: 16px; border-radius: 12px;
  border: 1px solid #e2e8f0;
}
.step {
  flex: 1; display: flex; gap: 10px; align-items: center;
  font-size: 14px; color: #94a3b8;
}
.step span {
  width: 28px; height: 28px; border-radius: 50%;
  background: #e2e8f0; color: #64748b;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px;
}
.step.active { color: #1a2332; font-weight: 600; }
.step.active span { background: #1a2332; color: white; }
.step.done span { background: #16a34a; color: white; }
.step.done span::before { content: "✓"; }

.onboarding-step { display: none; }
.onboarding-step.active { display: block; }
.onboarding-step h1 { font-size: 22px; margin-bottom: 8px; }
.onboarding-step > p { margin-bottom: 20px; }
.onboarding-step label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; color: #475569; font-weight: 500;
  margin-bottom: 14px;
}
.onboarding-step input, .onboarding-step select, .onboarding-step textarea {
  padding: 10px 14px; border: 1px solid #cbd5e1; border-radius: 8px;
  font-size: 15px; outline: none; background: white;
}
.onboarding-step input:focus { border-color: #1a2332; }
.onboarding-step .row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.onboarding-step .row label { margin-bottom: 0; }
.step-actions { display: flex; justify-content: space-between; margin-top: 24px; }

/* Search wizard for competitor picking */
.search-filters {
  display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 16px;
  background: #f8fafc; padding: 16px; border-radius: 8px;
  margin-bottom: 16px;
}
.search-filters label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12px; color: #475569; font-weight: 500; margin-bottom: 0;
}
.star-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 10px; background: white; border: 1px solid #cbd5e1;
  border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 500;
  user-select: none;
}
.pill:has(input:checked) { background: #1a2332; color: white; border-color: #1a2332; }
.pill input { margin: 0; cursor: pointer; }
.search-actions {
  display: flex; align-items: center; gap: 16px; margin-bottom: 16px;
}
.hotel-pick-list {
  max-height: 480px; overflow-y: auto;
  border: 1px solid #e2e8f0; border-radius: 8px; background: white;
}
.hotel-card {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-bottom: 1px solid #f1f5f9;
  cursor: pointer; transition: background 0.1s;
}
.hotel-card:last-child { border-bottom: none; }
.hotel-card:hover { background: #f8fafc; }
.hotel-card.picked { background: #f0f9ff; }
.hotel-card.disabled { opacity: 0.4; cursor: not-allowed; }
.hotel-card input { margin-top: 4px; cursor: pointer; transform: scale(1.2); }
.hotel-card.disabled input { cursor: not-allowed; }
.hotel-card-body { flex: 1; min-width: 0; }
.hotel-card-name { font-weight: 500; font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hotel-card-name .star { color: #f59e0b; font-size: 12px; font-weight: 600; }
.hotel-card-name .ptype { color: #94a3b8; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
.hotel-card-meta { font-size: 12px; color: #64748b; margin-top: 2px; }
.hotel-card-addr { font-size: 11px; color: #94a3b8; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: #1a2332; color: white;
  border-radius: 8px; margin-top: 16px;
}

.competitor-form {
  display: grid; grid-template-columns: 1fr 2fr auto; gap: 8px;
  background: #f8fafc; padding: 12px; border-radius: 8px; margin: 16px 0;
}
.competitor-form input {
  padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 6px;
  font-size: 14px; outline: none;
}
.competitor-pill {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; background: white; border: 1px solid #e2e8f0;
  border-radius: 8px; margin-bottom: 6px; font-size: 14px;
}
.competitor-pill .pill-name { font-weight: 500; }
.competitor-pill .pill-url { color: #64748b; font-size: 12px; }
.competitor-pill .remove {
  background: none; border: none; color: #dc2626; cursor: pointer;
  font-size: 18px; padding: 4px 8px;
}
.counter { color: #64748b; font-size: 13px; text-align: right; margin: 8px 0 16px; }

.done-card { text-align: center; padding: 40px 20px; }
.done-icon {
  width: 64px; height: 64px; border-radius: 50%; background: #16a34a;
  color: white; font-size: 32px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}

.footer-note { text-align: center; color: #94a3b8; font-size: 12px; padding: 24px; }

/* Rate parity (Google Hotels multi-OTA) */
.btn-mini {
  background: white; border: 1px solid #cbd5e1; padding: 6px 10px;
  border-radius: 6px; font-size: 12px; cursor: pointer; color: #1a2332;
}
.btn-mini:hover { background: #f8fafc; }
.btn-mini:disabled { opacity: 0.5; cursor: not-allowed; }
.ota-content { padding: 0; }
.ota-summary {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: #f1f5f9; padding: 1px;
}
.ota-stat { background: white; padding: 12px 16px; text-align: center; }
.ota-stat-label { font-size: 10px; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; }
.ota-stat-value { font-size: 18px; font-weight: 700; margin-top: 4px; }
tr.ota-official { background: #f0f9ff; font-weight: 600; }
.ota-link {
  color: #2563eb; text-decoration: none; font-size: 12px;
}
.ota-link:hover { text-decoration: underline; }
.ota-foot {
  font-size: 11px; color: #94a3b8; padding: 12px 20px;
  border-top: 1px solid #f1f5f9; background: #f8fafc;
}
