:root {
  --navy: #144774;
  --blue: #4e8bb8;
  --charcoal: #232325;
  --ink: #232325;
  --muted: #6b7c8a;
  --line: #d7dde3;
  --pale: #f4f6f8;
  --success: #1f7a4d;
  --danger: #9e3b1b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  font-family: Manrope, "Segoe UI", sans-serif;
  background-color: #f7f8fa;
  background-image:
    linear-gradient(rgba(20, 71, 116, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 71, 116, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
}
.topbar {
  min-height: 88px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e5eaef;
  padding: 14px clamp(20px, 5vw, 70px);
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand-logo {
  height: 46px;
  width: auto;
  display: block;
  flex-shrink: 0;
}
.brand-copy h1 {
  font-family: Sora, Manrope, sans-serif;
  font-size: 22px;
  letter-spacing: -0.3px;
  color: var(--navy);
}
.brand-copy .eyebrow {
  color: var(--blue);
  letter-spacing: 1.6px;
}
h1, h2, h3, p { margin: 0; }
h1 { font-family: Sora, Manrope, sans-serif; font-size: 25px; letter-spacing: -0.4px; }
h2 { margin-top: 2px; font-family: Sora, Manrope, sans-serif; font-size: 20px; letter-spacing: -0.25px; color: var(--navy); }
h3 { font-family: Sora, Manrope, sans-serif; font-size: 14px; color: var(--navy); }
.eyebrow { font-size: 10px; letter-spacing: 1.5px; font-weight: 800; text-transform: uppercase; }
.eyebrow.accent, .teal { color: var(--blue); }
.header-note {
  margin-left: auto;
  font-size: 11px;
  line-height: 1.55;
  text-align: right;
  color: var(--muted);
}
.header-note a { color: var(--navy); font-weight: 700; text-decoration: none; }
.header-note span { color: #8a97a5; }
.workspace { width: min(1240px, calc(100% - 32px)); margin: 28px auto 56px; display: grid; gap: 18px; }
.two-column, .bi-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.panel {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #e3ebf2;
  border-radius: 4px;
  box-shadow: 0 10px 28px rgba(20, 71, 116, 0.06);
  padding: 22px;
}
.flow { display: grid; gap: 14px; }
.section-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.section-heading h2 { font-size: 18px; }
.customer-grid { display: grid; grid-template-columns: 2fr 1.5fr auto auto; gap: 10px; align-items: end; }
.customer-grid label { min-width: 0; }
label { display: grid; gap: 7px; font-size: 12px; font-weight: 750; color: #486581; }
input, select, textarea, button { font: inherit; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
  border-radius: 4px;
  padding: 10px 11px;
  font-size: 13px;
  outline: none;
  transition: 0.2s;
}
textarea { resize: vertical; line-height: 1.4; }
input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(78, 139, 184, 0.18);
}
button {
  border: 0;
  border-radius: 4px;
  padding: 11px 14px;
  background: var(--charcoal);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  box-shadow: none;
  transition: transform 0.15s, background 0.15s;
  white-space: nowrap;
}
button:hover { transform: translateY(-1px); background: #141416; }
button.secondary { background: #eef4f9; color: var(--navy); }
button.secondary:hover { background: #e1ebf3; }
button:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.helper { color: var(--muted); font-size: 11px; line-height: 1.55; }
.helper code { font-size: 10px; color: #486581; background: #f0f4f8; padding: 2px 4px; border-radius: 4px; }
.status-dot { color: #486581; background: #f0f4f8; border-radius: 100px; padding: 6px 10px; font-size: 10px; white-space: nowrap; }
.status-dot.ready { background: #dcfce7; color: var(--success); }
.file-picker {
  border: 1px dashed #9fb3c8;
  background: #f8fbfd;
  border-radius: 4px;
  padding: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.file-picker span { color: var(--muted); }
.file-picker strong { background: var(--navy); color: white; border-radius: 4px; padding: 7px 9px; font-size: 11px; }
.file-picker input { display: none; }
.file-picker.compact { min-width: 240px; }
.or { display: flex; align-items: center; color: #9fb3c8; font-size: 11px; text-align: center; }
.or:before, .or:after { content: ""; height: 1px; background: #e3ebf2; flex: 1; margin: 0 10px; }
.report-choice { grid-template-rows: auto auto auto 1fr auto; }
.button-row, .command-row, .conversion-row { display: flex; gap: 10px; }
.command-row input { flex: 1; }
.hidden { display: none; }
.preview-section { display: grid; gap: 18px; }
.preview-heading { align-items: center; }
.output-status { color: var(--success); font-size: 12px; font-weight: 700; text-align: right; }
.output-status a { color: var(--navy); }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.metric {
  min-height: 96px;
  padding: 16px;
  border-radius: 4px;
  background: linear-gradient(145deg, #fff, #eef5fb);
  border: 1px solid #d9e6f1;
}
.metric:nth-child(2n) {
  background: linear-gradient(145deg, #fff, #f4f6f8);
  border-color: #e3ebf2;
}
.metric-label { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.7px; }
.metric-value { margin-top: 9px; color: var(--navy); font-size: 21px; line-height: 1.1; font-weight: 800; overflow-wrap: anywhere; }
.bi-layout { grid-template-columns: 1.5fr 0.9fr; }
.chart-panel, .insight-panel { min-height: 250px; }
.bar-chart { margin-top: 17px; display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr auto; align-items: center; gap: 10px; font-size: 11px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #486581; }
.bar-track { height: 13px; border-radius: 8px; background: #eaf2f7; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--navy), var(--blue)); }
.bar-value { color: var(--navy); font-weight: 750; text-align: right; }
.insight-panel { background: linear-gradient(155deg, #fff, #eef5fb); }
.insight-panel p { color: #334e68; line-height: 1.6; font-size: 14px; margin-top: 20px; }
.insight-panel dl { margin: 24px 0 0; display: grid; gap: 8px; }
.insight-panel dl div { display: flex; justify-content: space-between; font-size: 11px; border-top: 1px solid #d7e6f1; padding-top: 8px; }
.insight-panel dt { color: var(--muted); }
.insight-panel dd { margin: 0; color: var(--navy); font-weight: 800; }
.data-panel { padding: 0; overflow: hidden; }
.table-heading { display: flex; justify-content: space-between; align-items: center; padding: 17px 20px 14px; }
.table-heading span { color: var(--muted); font-size: 11px; }
.table-wrap { overflow: auto; max-height: 420px; border-top: 1px solid #e3ebf2; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th { position: sticky; top: 0; background: var(--navy); color: #fff; font-size: 10px; text-align: left; letter-spacing: 0.25px; z-index: 1; }
th, td { padding: 10px 12px; border-bottom: 1px solid #edf2f7; white-space: nowrap; }
td { color: #486581; }
tbody tr:nth-child(even) { background: #fafcfd; }
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 420px;
  background: var(--charcoal);
  color: #fff;
  border-radius: 4px;
  padding: 12px 15px;
  box-shadow: 0 12px 32px rgba(20, 71, 116, 0.25);
  font-size: 12px;
  line-height: 1.45;
  z-index: 10;
}
.toast.error { background: var(--danger); }
@media (max-width: 850px) {
  .customer-grid, .two-column, .bi-layout { grid-template-columns: 1fr; }
  .customer-grid button { width: 100%; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .header-note { display: none; }
  .topbar { padding: 14px 16px; }
  .workspace { width: min(100% - 22px, 1240px); margin: 12px auto 30px; }
  .panel { padding: 17px; }
  .brand-logo { height: 40px; }
}
@media (max-width: 480px) {
  .metrics { grid-template-columns: 1fr; }
  .button-row, .conversion-row { flex-direction: column; }
  .file-picker.compact { min-width: 0; }
  .topbar { min-height: 76px; flex-wrap: wrap; }
  h1 { font-size: 18px; }
  .brand-copy { min-width: 0; }
}
.user-badge { display: flex; align-items: center; gap: 12px; margin-left: 16px; }
.user-badge #userEmail { color: var(--muted); font-size: 12px; }
button.secondary.small { padding: 7px 11px; font-size: 11px; }
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background-color: #f7f8fa;
  background-image:
    linear-gradient(rgba(20, 71, 116, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 71, 116, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  margin: 0;
  font-family: Manrope, "Segoe UI", sans-serif;
}
.login-card {
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(20, 71, 116, 0.12);
  border: 1px solid #e5eaef;
  padding: 40px 44px;
  text-align: center;
  max-width: 400px;
  display: grid;
  gap: 14px;
  justify-items: center;
}
.login-card .brand-logo { height: 56px; }
.login-card h1 { font-family: Sora, Manrope, sans-serif; font-size: 20px; color: var(--navy); }
.login-card .muted { color: var(--muted); font-size: 13px; line-height: 1.5; }
.google-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--charcoal);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  padding: 12px 20px;
  border-radius: 4px;
  margin-top: 6px;
}
.google-btn:hover { background: #141416; }
