/* =====================================================
   DataLens — style.css  (v2 — Beautiful Edition)
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Syne:wght@600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand:         #14b8a6;
  --brand-dark:    #0d9488;
  --brand-light:   #5eead4;
  --brand-glow:    rgba(20,184,166,0.35);
  --accent:        #6366f1;
  --bg:            #030712;
  --bg2:           #0d1117;
  --bg3:           #161b22;
  --bg4:           #1c2330;
  --border:        rgba(255,255,255,0.07);
  --border-brand:  rgba(20,184,166,0.3);
  --text:          #f1f5f9;
  --text-2:        rgba(255,255,255,0.6);
  --text-3:        rgba(255,255,255,0.3);
  --text-4:        rgba(255,255,255,0.15);
  --r:             14px;
  --r-sm:          8px;
  --r-xs:          6px;
  --shadow:        0 4px 32px rgba(0,0,0,0.5);
  --shadow-brand:  0 0 40px rgba(20,184,166,0.2);
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ── Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand); }
::selection { background: rgba(20,184,166,0.25); }

/* ── Utils ─────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Glass card ────────────────────────────────────── */
.card {
  background: linear-gradient(135deg, rgba(22,27,34,0.9) 0%, rgba(13,17,23,0.95) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.06);
}
.card-glow { box-shadow: var(--shadow), var(--shadow-brand), inset 0 1px 0 rgba(255,255,255,0.06); }

/* ── Buttons ───────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 18px; border-radius: var(--r-sm); border: none;
  cursor: pointer; font-family: 'Inter', sans-serif; font-size: 0.86rem;
  font-weight: 500; transition: all 0.2s ease; text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, #0f766e 0%, var(--brand) 60%, var(--brand-light) 100%);
  background-size: 200% 100%; background-position: 0% 0%;
  color: #fff; font-weight: 600; letter-spacing: 0.01em;
  box-shadow: 0 2px 20px rgba(20,184,166,0.3);
}
.btn-primary:hover { background-position: 100% 0%; box-shadow: 0 4px 30px rgba(20,184,166,0.5); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-2); }
.btn-ghost:hover { border-color: var(--border-brand); color: var(--brand-light); background: rgba(20,184,166,0.05); }
.btn-sm { padding: 7px 13px; font-size: 0.78rem; border-radius: var(--r-xs); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ── Inputs ────────────────────────────────────────── */
input, select {
  font-family: 'Inter', sans-serif; font-size: 0.875rem;
  background: rgba(8,12,16,0.7);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--text); padding: 11px 14px; width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s; outline: none;
  -webkit-appearance: none; appearance: none;
}
input:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(20,184,166,0.12); }
input::placeholder { color: var(--text-4); }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2314b8a6' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; cursor: pointer;
}
select option { background: var(--bg3); color: var(--text); }
label { display: block; font-size: 0.72rem; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 7px; }

/* ── Badges ────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; font-family: 'JetBrains Mono', monospace; font-size: 0.65rem; padding: 3px 9px; border-radius: 99px; font-weight: 500; }
.badge-number  { background: rgba(20,184,166,0.12);  color: #5eead4; border: 1px solid rgba(20,184,166,0.2); }
.badge-string  { background: rgba(139,92,246,0.12);  color: #c4b5fd; border: 1px solid rgba(139,92,246,0.2); }
.badge-date    { background: rgba(245,158,11,0.12);  color: #fcd34d; border: 1px solid rgba(245,158,11,0.2); }
.badge-boolean { background: rgba(239,68,68,0.12);   color: #fca5a5; border: 1px solid rgba(239,68,68,0.2); }

/* ── Animations ────────────────────────────────────── */
@keyframes fadeIn  { from{opacity:0}             to{opacity:1} }
@keyframes slideUp { from{opacity:0;transform:translateY(22px)} to{opacity:1;transform:translateY(0)} }
@keyframes float   { 0%,100%{transform:translateY(0) rotate(0deg)} 50%{transform:translateY(-12px) rotate(2deg)} }
@keyframes spin    { to{transform:rotate(360deg)} }
@keyframes pulse   { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(0.95)} }
@keyframes shimmer { 0%{background-position:-400px 0} 100%{background-position:400px 0} }
@keyframes gradMove{ 0%,100%{background-position:0% 50%} 50%{background-position:100% 50%} }
@keyframes glow    { 0%,100%{box-shadow:0 0 20px rgba(20,184,166,0.2)} 50%{box-shadow:0 0 40px rgba(20,184,166,0.5)} }

.fade-in   { animation: fadeIn  0.5s ease forwards; }
.slide-up  { animation: slideUp 0.5s cubic-bezier(0.16,1,0.3,1) forwards; }
.floating  { animation: float   6s ease-in-out infinite; }
.spinning  { animation: spin    0.8s linear infinite; }

/* =====================================================
   PAGE: AUTH
   ===================================================== */
#page-auth {
  min-height: 100vh; display: flex; position: relative; overflow: hidden;
}

/* Animated mesh background */
.auth-bg {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
.auth-bg-blob {
  position: absolute; border-radius: 50%; filter: blur(80px);
}
.blob1 { width:700px; height:700px; top:-20%; left:-15%; background:radial-gradient(circle,rgba(20,184,166,0.12),transparent 70%); animation: gradMove 8s ease-in-out infinite; }
.blob2 { width:500px; height:500px; bottom:-10%; right:-10%; background:radial-gradient(circle,rgba(99,102,241,0.08),transparent 70%); animation: gradMove 10s ease-in-out infinite reverse; }
.blob3 { width:300px; height:300px; top:40%; left:35%; background:radial-gradient(circle,rgba(245,158,11,0.05),transparent 70%); animation: gradMove 12s ease-in-out infinite; }

.auth-grid-lines {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* Hero panel */
.auth-hero {
  display: none; flex-direction: column; justify-content: space-between;
  padding: 52px 56px; width: 54%; position: relative; z-index: 1;
}
@media(min-width:880px) { .auth-hero { display: flex; } }

.auth-logo { display: flex; align-items: center; gap: 11px; }
.auth-logo-icon {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand-light));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 24px rgba(20,184,166,0.4); animation: glow 3s ease-in-out infinite;
}
.auth-logo-text { font-family: 'Syne', sans-serif; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 99px;
  background: rgba(13,17,23,0.7); border: 1px solid rgba(20,184,166,0.25);
  color: var(--brand-light); font-size: 0.73rem; font-weight: 500; margin-bottom: 24px;
}
.chip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); animation: pulse 2s ease-in-out infinite; display: inline-block; }

.auth-hero-heading {
  font-family: 'Syne', sans-serif;
  font-size: clamp(2.4rem, 3.8vw, 3.8rem);
  font-weight: 800; line-height: 1.05; letter-spacing: -0.03em;
}
.gradient-text {
  background: linear-gradient(135deg, var(--brand-light) 0%, var(--brand) 50%, #818cf8 100%);
  background-size: 200% auto; -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; animation: gradMove 4s ease-in-out infinite;
}
.auth-hero-sub { color: var(--text-2); font-size: 1rem; font-weight: 300; line-height: 1.75; margin-top: 18px; max-width: 420px; }

.auth-features { margin-top: 36px; display: flex; flex-direction: column; gap: 18px; }
.auth-feature { display: flex; align-items: flex-start; gap: 14px; }
.auth-feature-icon {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0; margin-top: 1px;
  background: rgba(20,184,166,0.08); border: 1px solid rgba(20,184,166,0.15);
  display: flex; align-items: center; justify-content: center;
}
.auth-feature-title { font-size: 0.875rem; font-weight: 600; color: rgba(255,255,255,0.9); }
.auth-feature-desc  { font-size: 0.775rem; color: var(--text-3); margin-top: 3px; line-height: 1.5; }

/* Floating preview card */
.auth-preview-card { max-width: 270px; }
.preview-card-inner { padding: 18px; }
.preview-label { font-family: 'JetBrains Mono', monospace; font-size: 0.68rem; color: var(--text-4); margin-bottom: 14px; }
.preview-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.preview-row:last-child { border-bottom: none; padding-bottom: 0; }
.preview-col { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: var(--text-2); }

/* Auth card panel */
.auth-panel { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 24px; position: relative; z-index: 1; }
.auth-card  { width: 100%; max-width: 430px; padding: 36px; }

.auth-card-title { font-family: 'Syne', sans-serif; font-size: 1.5rem; font-weight: 700; margin-bottom: 6px; }
.auth-card-sub   { font-size: 0.85rem; color: var(--text-3); margin-bottom: 28px; }

.auth-tabs { display: flex; background: rgba(8,12,16,0.6); border-radius: 10px; padding: 4px; gap: 4px; margin-bottom: 28px; }
.auth-tab {
  flex: 1; padding: 9px; border-radius: 7px; border: none; cursor: pointer;
  font-size: 0.86rem; font-weight: 500; font-family: 'Inter', sans-serif;
  background: transparent; color: var(--text-3); transition: all 0.2s;
}
.auth-tab.active { background: linear-gradient(135deg, var(--brand-dark), var(--brand)); color: #fff; box-shadow: 0 2px 14px rgba(20,184,166,0.3); }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.form-group { display: flex; flex-direction: column; }
.input-wrap { position: relative; }
.input-wrap .icon-left  { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-4); pointer-events: none; }
.input-wrap input { padding-left: 38px; }
.eye-btn { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-3); padding: 2px; transition: color 0.2s; }
.eye-btn:hover { color: var(--text-2); }

.form-hint { font-size: 0.72rem; color: var(--text-4); margin-top: 5px; }

.auth-divider { display: flex; align-items: center; gap: 12px; margin: 6px 0; }
.auth-divider::before, .auth-divider::after { content:''; flex:1; height:1px; background: var(--border); }
.auth-divider span { font-size: 0.72rem; color: var(--text-4); }

.google-btn {
  width: 100%; background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 11px 16px; display: flex; align-items: center;
  justify-content: center; gap: 10px; cursor: pointer; color: var(--text-2);
  font-size: 0.86rem; font-family: 'Inter', sans-serif; font-weight: 500; transition: all 0.2s;
}
.google-btn:hover { border-color: rgba(255,255,255,0.15); background: rgba(255,255,255,0.06); color: var(--text); }

.auth-msg { display: none; padding: 11px 14px; border-radius: var(--r-sm); font-size: 0.84rem; margin-bottom: 8px; line-height: 1.5; }
.auth-msg.error   { display: block; background: rgba(239,68,68,0.08);    border: 1px solid rgba(239,68,68,0.2);    color: #fca5a5; }
.auth-msg.success { display: block; background: rgba(20,184,166,0.08);   border: 1px solid rgba(20,184,166,0.2);   color: var(--brand-light); }

.auth-footer { text-align: center; font-size: 0.72rem; color: var(--text-4); margin-top: 18px; line-height: 1.6; }

/* =====================================================
   PAGE: APP
   ===================================================== */
#page-app { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ───────────────────────────────────────── */
.sidebar {
  width: 248px; flex-shrink: 0; height: 100%;
  background: linear-gradient(180deg, rgba(13,17,23,0.98) 0%, rgba(8,12,16,0.98) 100%);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  position: relative;
}
.sidebar::after { content:''; position:absolute; top:0; right:0; width:1px; height:100%; background:linear-gradient(180deg,transparent,rgba(20,184,166,0.15),transparent); pointer-events:none; }

.sidebar-logo { height: 64px; display: flex; align-items: center; gap: 11px; padding: 0 20px; border-bottom: 1px solid var(--border); }
.sidebar-logo-icon { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--brand-dark), var(--brand-light)); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 16px rgba(20,184,166,0.3); }
.sidebar-logo-text { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1.1rem; letter-spacing: -0.02em; }

.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-label { font-size: 0.63rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-4); padding: 10px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 10px;
  border-radius: 8px; cursor: pointer; color: var(--text-3); font-size: 0.85rem; font-weight: 500;
  transition: all 0.15s; border: none; background: none; width: 100%; text-align: left;
  position: relative; margin-bottom: 2px;
}
.nav-item svg { flex-shrink: 0; }
.nav-item:hover:not(:disabled) { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-item.active { color: var(--brand-light); background: linear-gradient(135deg, rgba(20,184,166,0.1), rgba(20,184,166,0.05)); }
.nav-item.active::before { content:''; position:absolute; left:0; top:20%; height:60%; width:2px; background:linear-gradient(180deg,var(--brand-light),var(--brand)); border-radius:0 2px 2px 0; }
.nav-item:disabled { opacity: 0.28; cursor: not-allowed; }

.sidebar-section { margin-top: 8px; }
.sidebar-divider { height: 1px; background: var(--border); margin: 8px 10px; }

.sidebar-footer { padding: 12px 10px; border-top: 1px solid var(--border); }
.user-card { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 9px; background: rgba(255,255,255,0.03); border: 1px solid var(--border); margin-bottom: 8px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-dark), var(--brand-light)); display: flex; align-items: center; justify-content: center; font-family: 'Syne', sans-serif; font-weight: 700; font-size: 0.85rem; flex-shrink: 0; box-shadow: 0 0 12px rgba(20,184,166,0.3); }
.user-email { font-size: 0.75rem; color: rgba(255,255,255,0.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 142px; font-weight: 500; }
.user-plan  { font-size: 0.62rem; color: var(--text-4); margin-top: 2px; }
.logout-btn { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 10px; border-radius: 8px; border: none; background: none; cursor: pointer; color: rgba(252,165,165,0.5); font-size: 0.84rem; font-family: 'Inter', sans-serif; transition: all 0.15s; font-weight: 500; }
.logout-btn:hover { color: #fca5a5; background: rgba(239,68,68,0.06); }

/* ── Main content ──────────────────────────────────── */
.main-content { flex: 1; overflow-y: auto; background: var(--bg); position: relative; }

/* Subtle top gradient */
.main-content::before { content:''; position:fixed; top:0; left:248px; right:0; height:1px; background:linear-gradient(90deg,transparent,rgba(20,184,166,0.15),transparent); pointer-events:none; z-index:10; }

.view { display: none; padding: 40px 44px; animation: fadeIn 0.35s ease; min-height: 100vh; }
.view.active { display: block; }

/* Page headings */
.page-title { font-family: 'Syne', sans-serif; font-size: 1.9rem; font-weight: 800; color: var(--text); letter-spacing: -0.03em; }
.page-sub   { color: var(--text-3); font-size: 0.875rem; margin-top: 5px; line-height: 1.5; }

/* ── UPLOAD VIEW ───────────────────────────────────── */
.upload-wrap { max-width: 640px; margin: 0 auto; }
.upload-heading { margin-bottom: 32px; }

.drop-zone {
  border: 1.5px dashed rgba(255,255,255,0.1);
  border-radius: var(--r); padding: 70px 32px; text-align: center; cursor: pointer;
  transition: all 0.3s ease; position: relative; overflow: hidden;
}
.drop-zone::before { content:''; position:absolute; inset:0; background:radial-gradient(circle at 50% 50%, rgba(20,184,166,0.03), transparent 70%); opacity:0; transition:opacity 0.3s; }
.drop-zone:hover::before, .drop-zone.dragover::before { opacity: 1; }
.drop-zone:hover, .drop-zone.dragover { border-color: var(--brand); background: rgba(20,184,166,0.02); box-shadow: 0 0 40px rgba(20,184,166,0.06), inset 0 0 40px rgba(20,184,166,0.02); }

.drop-icon-wrap {
  position: relative; width: 80px; height: 80px; margin: 0 auto 24px;
}
.drop-icon-bg {
  width: 80px; height: 80px; border-radius: 22px;
  background: linear-gradient(135deg, rgba(20,184,166,0.1), rgba(20,184,166,0.05));
  border: 1px solid rgba(20,184,166,0.2);
  display: flex; align-items: center; justify-content: center; color: var(--brand);
}
.drop-icon-badge {
  position: absolute; top: -4px; right: -4px; width: 22px; height: 22px;
  border-radius: 50%; background: var(--brand); display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; border: 2px solid var(--bg);
}

.drop-title { font-family: 'Syne', sans-serif; font-size: 1.15rem; font-weight: 700; color: var(--text); }
.drop-sub   { color: var(--text-3); font-size: 0.86rem; margin-top: 8px; line-height: 1.6; }
.drop-sub .link { color: var(--brand); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.drop-meta  { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 20px; }
.drop-meta-item { display: flex; align-items: center; gap: 5px; font-size: 0.73rem; color: var(--text-4); background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 99px; padding: 4px 10px; }

#file-input { display: none; }

.parsing-state { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.parse-spinner { width: 46px; height: 46px; border: 3px solid rgba(20,184,166,0.1); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.7s linear infinite; }
.parse-text  { color: var(--text-2); font-size: 0.9rem; font-weight: 500; }
.parse-sub   { color: var(--text-4); font-size: 0.78rem; }

.error-box { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; background: rgba(239,68,68,0.07); border: 1px solid rgba(239,68,68,0.18); border-radius: var(--r-sm); color: #fca5a5; font-size: 0.84rem; margin-top: 16px; line-height: 1.5; }

.hint-box { margin-top: 28px; padding: 20px; }
.hint-label { font-size: 0.68rem; font-weight: 600; color: var(--text-4); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 12px; }
.hint-code  { font-family: 'JetBrains Mono', monospace; font-size: 0.73rem; color: rgba(255,255,255,0.45); line-height: 1.8; overflow-x: auto; }
.hint-code .csv-header { color: var(--brand-light); }
.hint-code .csv-row    { color: rgba(255,255,255,0.4); }

/* ── OVERVIEW VIEW ─────────────────────────────────── */
.overview-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 32px; flex-wrap: wrap; }
.overview-file-pill { display: flex; align-items: center; gap: 7px; color: var(--brand); font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; margin-bottom: 6px; }
.overview-file-size { color: var(--text-4); margin-left: 4px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 14px; margin-bottom: 32px; }
.stat-card  { padding: 20px 22px; transition: transform 0.2s, box-shadow 0.2s; cursor: default; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow), 0 0 20px rgba(20,184,166,0.06); }
.stat-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.stat-label { font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); }
.stat-icon  { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.stat-value { font-family: 'Syne', sans-serif; font-size: 2.1rem; font-weight: 800; color: var(--text); letter-spacing: -0.03em; line-height: 1; }
.stat-sub   { font-size: 0.72rem; color: var(--text-4); margin-top: 4px; }

/* Column table */
.section-title { font-family: 'Syne', sans-serif; font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.section-badge { background: rgba(20,184,166,0.1); border: 1px solid rgba(20,184,166,0.2); color: var(--brand); font-size: 0.68rem; font-family: 'JetBrains Mono', monospace; padding: 2px 8px; border-radius: 99px; }

.col-table-wrap { margin-bottom: 24px; }
.col-table-scroll { overflow-x: auto; border-radius: var(--r); border: 1px solid var(--border); }
.col-table { width: 100%; border-collapse: collapse; }
.col-table th { padding: 12px 16px; text-align: left; font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); background: rgba(8,12,16,0.8); border-bottom: 1px solid var(--border); white-space: nowrap; }
.col-table td { padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.03); font-size: 0.82rem; vertical-align: middle; }
.col-table tr:last-child td { border-bottom: none; }
.col-table tr:hover td { background: rgba(20,184,166,0.02); }
.col-name   { font-family: 'JetBrains Mono', monospace; font-weight: 500; color: rgba(255,255,255,0.88); font-size: 0.78rem; }
.col-num    { font-family: 'JetBrains Mono', monospace; color: var(--text-3); font-size: 0.78rem; }
.null-warn  { color: #fcd34d !important; }
.sample-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.sample-chip  { font-family: 'JetBrains Mono', monospace; font-size: 0.65rem; background: rgba(255,255,255,0.04); color: var(--text-3); padding: 2px 8px; border-radius: 4px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.quick-card { padding: 20px 22px; cursor: pointer; transition: all 0.2s; }
.quick-card:hover { border-color: var(--border-brand); transform: translateY(-2px); box-shadow: var(--shadow), 0 0 24px rgba(20,184,166,0.06); }
.quick-card-icon { width: 38px; height: 38px; border-radius: 10px; background: rgba(20,184,166,0.08); border: 1px solid rgba(20,184,166,0.15); display: flex; align-items: center; justify-content: center; color: var(--brand); margin-bottom: 14px; }
.quick-card-title { font-weight: 600; font-size: 0.9rem; color: var(--text); margin-bottom: 4px; }
.quick-card-desc  { font-size: 0.78rem; color: var(--text-3); line-height: 1.5; }

/* ── TABLE VIEW ────────────────────────────────────── */
.table-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.search-box { position: relative; }
.search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-4); pointer-events: none; }
.search-box input { padding-left: 34px; width: 220px; padding-top: 9px; padding-bottom: 9px; }

.table-container { border-radius: var(--r); border: 1px solid var(--border); overflow: hidden; }
.table-scroll    { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.data-table th {
  position: sticky; top: 0; z-index: 2;
  background: rgba(8,12,16,0.97); border-bottom: 1px solid var(--border);
  padding: 12px 16px; text-align: left; font-size: 0.65rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--brand);
  font-family: 'Inter', sans-serif;
}
.data-table td { padding: 10px 16px; font-size: 0.78rem; font-family: 'JetBrains Mono', monospace; color: var(--text-2); border-bottom: 1px solid rgba(255,255,255,0.025); max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.data-table tbody tr:hover td { background: rgba(20,184,166,0.025); color: rgba(255,255,255,0.9); }
.data-table tr:last-child td { border-bottom: none; }
.row-num    { color: var(--text-4) !important; text-align: center !important; font-size: 0.68rem !important; }
.cell-null  { color: var(--text-4) !important; font-style: italic; }

.pagination { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: rgba(8,12,16,0.5); border-top: 1px solid var(--border); }
.page-info  { font-size: 0.76rem; color: var(--text-3); }
.page-btns  { display: flex; align-items: center; gap: 4px; }
.page-btn   { min-width: 30px; height: 30px; border: 1px solid var(--border); background: transparent; border-radius: var(--r-xs); cursor: pointer; color: var(--text-3); font-size: 0.76rem; font-family: 'Inter', sans-serif; transition: all 0.15s; display: flex; align-items: center; justify-content: center; padding: 0 6px; }
.page-btn:hover:not(:disabled) { border-color: var(--border-brand); color: var(--brand-light); background: rgba(20,184,166,0.05); }
.page-btn.current { background: linear-gradient(135deg, var(--brand-dark), var(--brand)); border-color: var(--brand); color: #fff; box-shadow: 0 2px 10px rgba(20,184,166,0.3); }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── CHART VIEW ────────────────────────────────────── */
.chart-layout { display: grid; grid-template-columns: 290px 1fr; gap: 20px; align-items: start; }
@media(max-width:840px) { .chart-layout { grid-template-columns: 1fr; } }

.controls-panel { padding: 22px; position: sticky; top: 0; }
.controls-title { font-family: 'Syne', sans-serif; font-size: 0.9rem; font-weight: 700; color: var(--text); margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }

.chart-type-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin-bottom: 2px; }
.chart-type-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px;
  border: 1px solid var(--border); border-radius: 9px; background: rgba(8,12,16,0.5);
  cursor: pointer; color: var(--text-3); font-size: 0.68rem; font-family: 'Inter', sans-serif;
  font-weight: 500; transition: all 0.15s;
}
.chart-type-btn:hover { color: var(--text-2); border-color: rgba(255,255,255,0.12); background: rgba(255,255,255,0.03); }
.chart-type-btn.active { background: linear-gradient(135deg, rgba(15,118,110,0.4), rgba(20,184,166,0.2)); border-color: var(--brand); color: var(--brand-light); box-shadow: 0 0 16px rgba(20,184,166,0.15); }

.control-group { margin-top: 16px; }
.control-divider { height: 1px; background: var(--border); margin: 18px 0; }

.agg-info { font-size: 0.72rem; color: var(--text-4); margin-top: 6px; line-height: 1.5; padding: 8px 10px; background: rgba(245,158,11,0.04); border-radius: var(--r-xs); border: 1px solid rgba(245,158,11,0.1); }

/* Chart canvas card */
.chart-canvas-card { padding: 26px; }
.chart-meta { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; gap: 12px; }
.chart-title    { font-family: 'Syne', sans-serif; font-size: 1.05rem; font-weight: 700; color: var(--text); }
.chart-subtitle { font-size: 0.76rem; color: var(--text-3); margin-top: 3px; }
.chart-count    { font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; color: var(--brand); background: rgba(20,184,166,0.08); border: 1px solid rgba(20,184,166,0.15); padding: 4px 10px; border-radius: 99px; white-space: nowrap; }

.chart-area { height: 360px; position: relative; }
.chart-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 12px; color: var(--text-4); }
.chart-empty svg { opacity: 0.2; }
.chart-empty p { font-size: 0.85rem; }

.warn-box { display: flex; align-items: flex-start; gap: 10px; padding: 13px 16px; background: rgba(245,158,11,0.07); border: 1px solid rgba(245,158,11,0.18); border-radius: var(--r-sm); color: #fcd34d; font-size: 0.83rem; margin-bottom: 18px; line-height: 1.5; }

/* ── CSV Source Links ──────────────────────────────── */
.hint-box {
  margin-top: 20px;
  padding: 20px 22px;
}
.hint-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}
.csv-sources {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media(max-width:600px){ .csv-sources { grid-template-columns: 1fr; } }

.csv-source-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}
.csv-source-link:hover {
  border-color: var(--border-brand);
  background: rgba(20,184,166,0.04);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.csv-source-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  border: 1px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.csv-source-name {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.csv-source-desc {
  font-size: 0.72rem;
  color: var(--text-3);
  line-height: 1.4;
}
.csv-source-arrow {
  margin-left: auto;
  color: var(--text-4);
  flex-shrink: 0;
  transition: transform 0.2s, color 0.2s;
}
.csv-source-link:hover .csv-source-arrow {
  color: var(--brand);
  transform: translate(2px, -2px);
}
