/* ============================================================
   Desert Sky Digital — placeholder brand palette.
   Swap these five values for your exact hex codes once you have them
   (from your site's CSS, or send me the logo file and I'll match it).
   ============================================================ */
:root {
  --brand-header-bg: #0f1c2e;   /* dark navy from the logo background */
  --brand-accent: #d9a35c;      /* warm gold, matches "DIGITAL" + accent lines */
  --brand-accent-2: #2c4a6e;    /* deeper sky blue from the badge gradient */
  --brand-page-bg: #f7f6f3;     /* warm neutral, sand */
  --brand-success: #1baf7a;

  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --text-on-dark: #f0ead8;      /* cream, matches "DESERT SKY" text */
  --surface-card: #ffffff;
  --border: #e5e3de;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--brand-page-bg);
  color: var(--text-primary);
}

/* ---------- Header ---------- */
header.site-header {
  background: var(--brand-header-bg);
  color: var(--text-on-dark);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-logo-img { height: 44px; width: auto; display: block; }
.brand-subtitle {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-on-dark);
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.header-actions { display: flex; align-items: center; gap: 14px; }
.header-actions button {
  background: transparent;
  border: 1px solid rgba(247,246,243,0.3);
  color: var(--text-on-dark);
  padding: 6px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
}
.header-actions button:hover { background: rgba(247,246,243,0.1); }

/* ---------- Layout ---------- */
main { max-width: 1040px; margin: 0 auto; padding: 24px; }

.controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
select, input[type="date"] {
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-card);
  font-size: 14px;
  color: var(--text-primary);
}
.date-controls { display: flex; align-items: center; gap: 8px; }

/* ---------- Cards ---------- */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.metric-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.metric-label { font-size: 13px; color: var(--text-secondary); margin: 0 0 6px; }
.metric-value { font-size: 28px; font-weight: 700; margin: 0; }
.metric-value.muted { color: var(--text-muted); font-weight: 500; }
.metric-delta { font-size: 12px; margin: 6px 0 0; }
.metric-delta.up { color: var(--brand-success); }
.metric-delta.down { color: #d03b3b; }
.metric-delta.neutral { color: var(--text-muted); }

.panel {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}
.panel-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--text-primary);
}

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

table.simple-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.simple-table td { padding: 7px 0; border-top: 1px solid var(--border); }
table.simple-table tr:first-child td { border-top: none; }
table.simple-table td:last-child { text-align: right; color: var(--text-secondary); }

.health-bar-track { height: 6px; background: var(--brand-page-bg); border-radius: 3px; margin-top: 4px; }
.health-bar-fill { height: 6px; background: var(--brand-success); border-radius: 3px; }
.health-row { margin-bottom: 10px; }
.health-row-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-secondary); }

.empty-note { font-size: 13px; color: var(--text-muted); }

/* ---------- Tabs ---------- */
.tab-bar { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tab-btn {
  background: transparent;
  border: none;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab-btn.active { color: var(--brand-accent); border-bottom-color: var(--brand-accent); }
.tab-btn:hover:not(.active) { color: var(--text-primary); }

/* ---------- AI Insights ---------- */
.insights-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.insight-btn {
  padding: 10px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-card);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.insight-btn:hover { border-color: var(--brand-accent); color: var(--brand-accent); }
.insight-btn:disabled { opacity: 0.5; cursor: default; }
.insights-body { font-size: 14px; line-height: 1.65; white-space: pre-wrap; color: var(--text-primary); }
.insights-loading { font-size: 13px; color: var(--text-muted); }

/* ---------- Login page ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-page-bg);
}
.login-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  width: 320px;
  text-align: center;
}
.login-card .brand-logo-text { color: var(--text-primary); margin-bottom: 22px; font-size: 18px; }
.login-card input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 10px;
  font-size: 14px;
}
.login-card button {
  width: 100%;
  padding: 10px;
  border-radius: var(--radius);
  border: none;
  background: var(--brand-accent);
  color: white;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
}
.login-card button:hover { opacity: 0.92; }
.login-error { color: #d03b3b; font-size: 13px; margin-top: 10px; min-height: 16px; }

@media (max-width: 700px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
}
