:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  background: #eef2f7;
  color: #101828;
  --ink: #101828;
  --muted: #667085;
  --soft: #f8fafc;
  --card: rgba(255, 255, 255, 0.82);
  --card-strong: rgba(255, 255, 255, 0.95);
  --line: rgba(148, 163, 184, 0.28);
  --blue: #0f6bff;
  --blue-2: #4f8cff;
  --navy: #10182f;
  --green: #15c779;
  --warning: #f59e0b;
  --danger: #dc2626;
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --shadow-lg: 0 30px 90px rgba(15, 23, 42, 0.14);
  --shadow-md: 0 18px 50px rgba(15, 23, 42, 0.10);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #eef2f7; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 0%, rgba(79, 140, 255, 0.24), transparent 34rem),
    radial-gradient(circle at 88% 8%, rgba(21, 199, 121, 0.18), transparent 30rem),
    linear-gradient(135deg, #f7f9fc 0%, #eef2f7 46%, #f8fafc 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(16, 24, 47, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(16, 24, 47, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.52), transparent 78%);
}

.ambient {
  position: fixed;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(16px);
  opacity: 0.35;
  z-index: 0;
}
.ambient-one { left: -120px; top: 80px; background: #9cc1ff; }
.ambient-two { right: -90px; top: 240px; background: #9ff2c9; }

button, input, textarea, select { font: inherit; }
button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
  cursor: pointer;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  color: #fff;
  box-shadow: 0 12px 26px rgba(15, 107, 255, 0.26);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}
button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 16px 34px rgba(15, 107, 255, 0.30); }
button:active:not(:disabled) { transform: translateY(0); }
button:disabled { opacity: 0.46; cursor: not-allowed; box-shadow: none; }
button.secondary { background: #10182f; box-shadow: 0 12px 26px rgba(16, 24, 47, 0.20); }
button.ghost { background: rgba(16, 24, 47, 0.08); color: var(--ink); box-shadow: none; }

.app {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 24px 0 56px;
}
.hidden { display: none !important; }

.topbar {
  position: sticky;
  top: 14px;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 34px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 16px 44px rgba(15, 23, 42, 0.08);
}

.brand-lockup, .login-brand, .topbar-actions, .status-card, .panel-heading, .input-header, .actions, .results-header, .results-toolbar, .results-controls, .view-mode-group, .config-badges, .test-header {
  display: flex;
  align-items: center;
}
.brand-lockup { gap: 12px; padding-left: 4px; }
.brand-lockup strong { display: block; font-size: 15px; }
.brand-lockup span:not(.brand-mark) { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  color: #fff;
  font-weight: 950;
  background: conic-gradient(from 140deg, #0f6bff, #6ee7b7, #111827, #0f6bff);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.38), 0 12px 28px rgba(15, 107, 255, 0.25);
}
.topbar-actions { gap: 10px; }
.status-card {
  gap: 10px;
  padding: 9px 14px;
  min-width: 178px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.78);
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(21, 199, 121, 0.15), 0 0 22px rgba(21, 199, 121, 0.45);
}
.status-card strong { display: block; font-size: 13px; }
.status-card small { display: block; color: var(--muted); font-size: 11px; min-height: 13px; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: stretch;
  margin-bottom: 26px;
}
.hero-copy {
  position: relative;
  overflow: hidden;
  padding: 38px;
  border: 1px solid rgba(255,255,255,0.70);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(255,255,255,0.84), rgba(255,255,255,0.58));
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
}
.hero-copy::after {
  content: "";
  position: absolute;
  right: -110px;
  bottom: -130px;
  width: 310px;
  height: 310px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(15, 107, 255, 0.28), transparent 68%);
}
.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
}
h1, h2, p { margin-top: 0; }
h1 {
  position: relative;
  z-index: 1;
  max-width: 790px;
  margin-bottom: 16px;
  font-size: clamp(42px, 6vw, 76px);
  line-height: 0.94;
  letter-spacing: -0.065em;
}
h2 { margin-bottom: 0; font-size: 24px; line-height: 1.08; letter-spacing: -0.035em; }
.description {
  position: relative;
  z-index: 1;
  max-width: 760px;
  color: #475467;
  font-size: 17px;
  line-height: 1.62;
  margin-bottom: 0;
}
.hero-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 250px;
  padding: 28px;
  color: #fff;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 16% 18%, rgba(110, 231, 183, 0.42), transparent 36%),
    linear-gradient(145deg, #111827 0%, #17203a 52%, #0f6bff 145%);
  box-shadow: 0 30px 90px rgba(16, 24, 47, 0.28);
}
.hero-card-kicker { color: rgba(255,255,255,0.62); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.12em; }
.hero-card strong { margin: 12px 0 10px; font-size: 30px; line-height: 1; letter-spacing: -0.045em; }
.hero-card p { color: rgba(255,255,255,0.72); margin: 0; line-height: 1.45; }

.tab-nav {
  display: inline-flex;
  gap: 6px;
  margin-bottom: 18px;
  padding: 6px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  background: rgba(255,255,255,0.58);
  backdrop-filter: blur(16px);
}
.tab-btn {
  color: #667085;
  background: transparent;
  box-shadow: none;
  padding: 11px 18px;
}
.tab-btn:hover { color: var(--ink); transform: none; box-shadow: none; }
.tab-btn.active { color: #fff; background: #10182f; box-shadow: 0 10px 24px rgba(16, 24, 47, 0.18); }

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: start;
}
.panel, .message, .mini-card, .config-status, .test-result {
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(20px) saturate(1.15);
}
.panel { padding: 24px; margin-bottom: 18px; }
.input-panel { min-height: 490px; }
.panel-heading { justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.soft-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  color: #344054;
  font-size: 13px;
  font-weight: 800;
  background: rgba(16, 24, 47, 0.06);
}

.input-header { justify-content: space-between; gap: 12px; margin-bottom: 10px; }
label { display: block; font-weight: 850; margin-bottom: 8px; letter-spacing: -0.01em; }
.input-header label { margin-bottom: 0; }
#txtFile { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; pointer-events: none; }
.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 999px;
  padding: 9px 14px;
  background: rgba(15, 107, 255, 0.10);
  color: #0f58d6;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s ease, transform 0.18s ease;
}
.file-button:hover { background: rgba(15, 107, 255, 0.16); transform: translateY(-1px); }

textarea, .form-group input[type="text"], .form-group input[type="password"], .form-group select {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.38);
  border-radius: 20px;
  padding: 16px 17px;
  outline: none;
  background: rgba(255,255,255,0.72);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.70);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
textarea {
  min-height: 258px;
  resize: vertical;
  line-height: 1.55;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 15px;
}
textarea::placeholder, input::placeholder { color: #98a2b3; }
textarea:focus, .form-group input:focus, .form-group select:focus {
  border-color: rgba(15, 107, 255, 0.75);
  background: rgba(255,255,255,0.92);
  box-shadow: 0 0 0 5px rgba(15, 107, 255, 0.12), inset 0 1px 0 rgba(255,255,255,0.80);
}

.actions { flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.primary-actions { justify-content: space-between; }
.primary-actions #consultButton { min-width: 210px; }
.side-panel { display: grid; gap: 14px; }
.mini-card {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 14px;
  padding: 18px;
}
.mini-card strong { display: block; margin-bottom: 6px; letter-spacing: -0.015em; }
.mini-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.mini-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  color: #0f58d6;
  font-size: 13px;
  font-weight: 950;
  background: rgba(15, 107, 255, 0.10);
}
.accent-card { background: linear-gradient(145deg, rgba(16, 24, 47, 0.96), rgba(25, 38, 72, 0.92)); color: #fff; }
.accent-card p { color: rgba(255,255,255,0.70); }
.accent-card .mini-icon { background: rgba(255,255,255,0.12); color: #fff; }

.message {
  padding: 15px 18px;
  margin-bottom: 18px;
  color: #9a3412;
  border-color: rgba(251, 146, 60, 0.36);
  background: rgba(255, 247, 237, 0.82);
}
.message.message-success { color: #067647; border-color: rgba(34, 197, 94, 0.26); background: rgba(240, 253, 244, 0.86); }

.results { overflow: visible; }
.results-header { justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.results-toolbar {
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 22px;
  background: rgba(248, 250, 252, 0.68);
}
.results-controls { flex-wrap: wrap; gap: 14px 18px; }
.view-mode-group { gap: 10px; }
.control-label {
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #667085;
  cursor: default;
}
.radio-inline, .checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-weight: 760;
  font-size: 14px;
  color: #344054;
  cursor: pointer;
}
.radio-inline input, .checkbox-inline input { accent-color: var(--blue); cursor: pointer; }
.column-picker-group { position: relative; }
.column-picker-group summary { cursor: pointer; list-style: none; }
.column-picker-group summary::-webkit-details-marker { display: none; }
.column-picker-group summary::after { content: "  ↓"; }
.column-picker-list {
  position: absolute;
  z-index: 10;
  top: 30px;
  left: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 10px 16px;
  width: min(460px, calc(100vw - 64px));
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 18px;
  background: rgba(255,255,255,0.96);
  box-shadow: var(--shadow-md);
}
.export-actions { margin-top: 0; justify-content: flex-end; }
.table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 20px;
  background: rgba(255,255,255,0.58);
}
table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 980px; }
th, td { padding: 14px; border-bottom: 1px solid rgba(148, 163, 184, 0.18); text-align: left; vertical-align: top; }
th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(248, 250, 252, 0.96);
  color: #667085;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
td { color: #344054; font-size: 14px; }
tbody tr:hover td { background: rgba(15, 107, 255, 0.035); }
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
  background: rgba(21, 199, 121, 0.14);
  color: #067647;
}
.badge.mock { background: #e0f2fe; color: #075985; }
.badge.warn { background: rgba(245, 158, 11, 0.16); color: #92400e; }

.config-panel { max-width: 980px; }
.config-form { margin-top: 22px; }
.form-group { margin-bottom: 18px; }
.form-group label { font-weight: 850; margin-bottom: 7px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-hint { display: block; color: var(--muted); font-size: 12px; margin-top: 6px; }
.file-input-visible {
  display: block;
  width: 100%;
  border: 1px dashed rgba(148, 163, 184, 0.58);
  border-radius: 18px;
  padding: 13px 14px;
  cursor: pointer;
  background: rgba(248,250,252,0.72);
}
.file-input-visible:hover { border-color: rgba(15, 107, 255, 0.72); }
.config-status { padding: 18px; margin: 20px 0; background: rgba(248,250,252,0.75); box-shadow: none; }
.config-status-loading { color: var(--muted); }
.config-status-error { color: var(--danger); }
.config-state-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.config-state-item { padding: 14px; border-radius: 18px; background: rgba(255,255,255,0.72); }
.config-label { display: block; margin-bottom: 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 900; }
.config-badges { flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.config-detail { font-size: 12px; color: #475467; margin-top: 6px; }
.config-detail code, .config-sources code, .test-detail code { font-family: ui-monospace, monospace; background: rgba(16,24,47,0.07); padding: 2px 6px; border-radius: 7px; }
.config-sources { font-size: 11px; color: #98a2b3; display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.test-result { margin-top: 16px; padding: 16px 18px; box-shadow: none; }
.test-result.test-ok { background: rgba(240,253,244,0.88); color: #067647; }
.test-result.test-fail { background: rgba(255,247,237,0.88); color: #9a3412; }
.test-header { gap: 10px; margin-bottom: 7px; }
.test-message { font-size: 14px; }
.test-detail { font-size: 12px; margin-top: 6px; opacity: 0.85; }

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 15%, rgba(15, 107, 255, 0.28), transparent 34rem),
    radial-gradient(circle at 80% 80%, rgba(21, 199, 121, 0.18), transparent 30rem),
    rgba(16, 24, 47, 0.72);
  backdrop-filter: blur(10px);
}
.login-card {
  width: min(450px, 100%);
  padding: 30px;
  border: 1px solid rgba(255,255,255,0.62);
  border-radius: 30px;
  background: rgba(255,255,255,0.88);
  box-shadow: 0 34px 100px rgba(0,0,0,0.28);
  backdrop-filter: blur(22px) saturate(1.2);
}
.login-brand { gap: 14px; margin-bottom: 12px; }
.login-card h2 { font-size: 28px; margin: 0; }
.login-card .description { margin-bottom: 20px; font-size: 14px; }
.login-actions button { width: 100%; }

@media (max-width: 920px) {
  .hero, .workspace-grid { grid-template-columns: 1fr; }
  .hero-card { min-height: 190px; }
  .side-panel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mini-card { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .app { width: min(100% - 24px, 1180px); padding-top: 12px; }
  .topbar { align-items: flex-start; border-radius: 24px; flex-direction: column; }
  .topbar-actions { width: 100%; justify-content: space-between; }
  .hero-copy { padding: 26px; }
  h1 { font-size: 42px; }
  .side-panel, .form-row, .config-state-grid { grid-template-columns: 1fr; }
  .panel { padding: 18px; }
  .results-toolbar { align-items: stretch; flex-direction: column; }
  .export-actions { justify-content: flex-start; }
  .column-picker-list { position: static; margin-top: 10px; grid-template-columns: 1fr; width: 100%; }
}
