/* ══════════════════════════════════════════════════════
   FINANCIAL DASHBOARD — style.css
   StarAdmin Palette:
     Primary:    #F29F67 (orange)  #1E1E2C (navy)
     Supporting: #3B8FF3 (blue)   #34B1AA (teal)   #E0B50F (yellow)
   Background: #F4F5FB · Surface: #FFFFFF
══════════════════════════════════════════════════════ */

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

:root {
    --orange:    #F29F67;
    --orange-dk: #d9834a;
    --navy:      #1E1E2C;
    --navy-lt:   #2a2a3d;
    --blue:      #3B8FF3;
    --teal:      #34B1AA;
    --yellow:    #E0B50F;
    --red:       #E95B5B;
    --green:     #2ec87d;

    --bg:        #F4F5FB;
    --surface:   #FFFFFF;
    --border:    #E8E8F0;
    --text:      #1E1E2C;
    --text-2:    #6B6B8A;
    --text-3:    #A8A8C0;

    --sidebar-w: 220px;
    --topbar-h:  60px;
    --subnav-h:  48px;
    --radius:    10px;
    --radius-sm: 6px;
    --shadow:    0 2px 12px rgba(30,30,44,.07);
    --shadow-md: 0 4px 20px rgba(30,30,44,.12);
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
    font-size: 13.5px;
}

/* ── SIDEBAR ─────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--navy);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 200;
    transition: width .25s;
    overflow: hidden;
}
.sidebar.collapsed { width: 56px; }
.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .ni + *,
.sidebar.collapsed .fs-label { opacity: 0; pointer-events: none; }
.sidebar.collapsed .nav-item { justify-content: center; }

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 18px 14px;
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.logo-icon { font-size: 22px; color: var(--orange); filter: drop-shadow(0 0 6px rgba(242,159,103,.35)); flex-shrink: 0; }
.logo-text  { font-size: 16px; font-weight: 700; color: #fff; white-space: nowrap; }

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; overflow-x: hidden; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); }

.nav-label {
    font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
    color: rgba(255,255,255,.3); padding: 10px 18px 5px; white-space: nowrap;
}
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 18px; color: rgba(255,255,255,.5);
    text-decoration: none; font-size: 13px; font-weight: 500;
    border-left: 3px solid transparent; transition: all .15s;
    white-space: nowrap; cursor: pointer;
}
.nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-item.active { background: rgba(242,159,103,.1); color: var(--orange); border-left-color: var(--orange); }
.ni { font-size: 14px; flex-shrink: 0; width: 18px; text-align: center; }

.sidebar-footer { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.07); }
.file-status { display: flex; flex-direction: column; gap: 8px; }
.fs-item { display: flex; align-items: center; gap: 8px; }
.fs-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; transition: background .3s;
}
.fs-dot.pending { background: rgba(255,255,255,.2); }
.fs-dot.loaded  { background: var(--green); box-shadow: 0 0 5px var(--green); }
.fs-dot.loading { background: var(--yellow); animation: pulse .8s infinite; }
.fs-label { font-size: 11.5px; color: rgba(255,255,255,.45); white-space: nowrap; }

/* ── MAIN ────────────────────────────────────────────── */
.main-wrap {
    margin-left: var(--sidebar-w);
    flex: 1; display: flex; flex-direction: column;
    min-height: 100vh; transition: margin-left .25s;
}
.sidebar.collapsed ~ .main-wrap { margin-left: 56px; }

/* ── TOPBAR ──────────────────────────────────────────── */
.topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px;
    padding: 0 24px;
    position: sticky; top: 0; z-index: 100;
    box-shadow: var(--shadow);
}
.menu-btn {
    background: none; border: none; font-size: 17px; color: var(--text-2);
    cursor: pointer; padding: 4px 6px; border-radius: 4px; flex-shrink: 0;
}
.menu-btn:hover { background: var(--bg); }
.greeting { flex: 1; }
.greeting-title { font-size: 14px; color: var(--text-2); }
.greeting-title strong { color: var(--text); }
.greeting-sub { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.upload-pill {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: var(--radius-sm);
    font-size: 12px; font-weight: 600; cursor: pointer;
    transition: all .2s; white-space: nowrap;
}
.upload-pill.dispatch {
    background: rgba(59,143,243,.1); color: var(--blue); border: 1px solid rgba(59,143,243,.25);
}
.upload-pill.dispatch:hover { background: rgba(59,143,243,.18); }
.upload-pill.dispatch.loaded { background: rgba(46,200,125,.1); color: var(--green); border-color: rgba(46,200,125,.25); }
.upload-pill.cashflow {
    background: rgba(242,159,103,.1); color: var(--orange); border: 1px solid rgba(242,159,103,.25);
}
.upload-pill.cashflow:hover { background: rgba(242,159,103,.18); }
.upload-pill.cashflow.loaded { background: rgba(46,200,125,.1); color: var(--green); border-color: rgba(46,200,125,.25); }
.pill-icon { font-size: 14px; }

.date-pill {
    padding: 5px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 11.5px; color: var(--text-2); background: var(--bg); white-space: nowrap;
}
.icon-btn { background: none; border: none; font-size: 16px; cursor: pointer; padding: 6px; border-radius: 6px; color: var(--text-2); }

/* ── SUBNAV ──────────────────────────────────────────── */
.subnav {
    height: var(--subnav-h);
    background: var(--surface); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
}
.tabs { display: flex; gap: 2px; }
.tab {
    background: none; border: none; padding: 7px 16px;
    font-size: 13px; font-weight: 500; color: var(--text-2);
    cursor: pointer; border-radius: var(--radius-sm); transition: all .15s; white-space: nowrap;
}
.tab:hover { background: var(--bg); color: var(--text); }
.tab.active { background: rgba(242,159,103,.12); color: var(--orange); font-weight: 600; }
.subnav-actions { display: flex; gap: 8px; }
.action-btn { padding: 6px 14px; font-size: 12px; font-weight: 500; border-radius: var(--radius-sm); cursor: pointer; transition: all .15s; }
.action-btn.filled { background: var(--navy); border: 1px solid var(--navy); color: #fff; }
.action-btn.filled:hover { background: var(--navy-lt); }

/* ── PAGE ────────────────────────────────────────────── */
.page { flex: 1; padding: 20px 24px; }

/* ── ERROR ───────────────────────────────────────────── */
.error-banner {
    background: rgba(233,91,91,.08); border: 1px solid var(--red);
    border-radius: var(--radius-sm); color: var(--red); padding: 10px 16px;
    font-size: 12.5px; margin-bottom: 16px;
}

/* ── UPLOAD HERO ─────────────────────────────────────── */
.upload-hero {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 16px; padding: 60px 20px; text-align: center;
}
.upload-hero-title { font-size: 22px; font-weight: 700; color: var(--text); }
.upload-hero-sub { font-size: 13px; color: var(--text-2); max-width: 480px; line-height: 1.6; }

.upload-cards { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }

.upload-card {
    width: 240px; background: var(--surface); border: 2px dashed var(--border);
    border-radius: var(--radius); padding: 32px 24px; cursor: pointer;
    transition: all .2s; display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.upload-card:hover { border-color: var(--orange); background: rgba(242,159,103,.03); }
.upload-card.loaded { border-style: solid; border-color: var(--green); }

.uc-icon { font-size: 36px; }
.uc-title { font-size: 14px; font-weight: 600; color: var(--text); }
.uc-sub { font-size: 11px; color: var(--text-3); }
.uc-status { font-size: 12px; color: var(--text-2); background: var(--bg); padding: 4px 12px; border-radius: 20px; }
.upload-card.loaded .uc-status { color: var(--green); background: rgba(46,200,125,.08); }

.upload-note { font-size: 11.5px; color: var(--text-3); }

/* ── KPI STRIP ───────────────────────────────────────── */
.kpi-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px; margin-bottom: 18px;
}
.kpi-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px 18px; box-shadow: var(--shadow); animation: fadeUp .35s ease both;
    transition: box-shadow .2s, transform .2s;
}
.kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.kpi-accent { width: 3px; height: 32px; border-radius: 2px; margin-right: 14px; flex-shrink: 0; }
.kpi-inner { display: flex; align-items: center; }
.kpi-label { font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--text-2); margin-bottom: 7px; }
.kpi-value { font-size: 21px; font-weight: 700; color: var(--text); line-height: 1; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-delta { font-size: 11px; font-weight: 500; }
.kpi-delta.pos { color: var(--green); }
.kpi-delta.neg { color: var(--red); }
.kpi-delta.neu { color: var(--text-3); }

/* ── LAYOUTS ─────────────────────────────────────────── */
.two-col   { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.four-col  { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 960px) {
    .two-col   { grid-template-columns: 1fr; }
    .three-col { grid-template-columns: 1fr 1fr; }
    .four-col  { grid-template-columns: 1fr 1fr; }
}

/* ── CARDS ───────────────────────────────────────────── */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.card.card-dark {
    background: var(--navy); border-color: var(--navy); padding: 22px;
}
.mini-card { padding: 16px; }

.card-hdr { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; gap: 12px; }
.card-title { font-size: 14px; font-weight: 700; color: var(--text); }
.card-dark .card-title { color: #fff; }
.card-sub { font-size: 11.5px; color: var(--text-2); margin-top: 3px; }

/* Dark card */
.dark-section-label { font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.4); margin-bottom: 14px; }
.dark-meta  { font-size: 11px; color: rgba(255,255,255,.4); margin-bottom: 3px; }
.dark-big   { font-size: 30px; font-weight: 700; color: var(--teal); margin-bottom: 10px; }
.dark-grid  { display: flex; gap: 20px; margin-top: 10px; }
.dark-dim   { font-size: 10.5px; color: rgba(255,255,255,.4); margin-bottom: 2px; }
.dark-val   { font-size: 13.5px; font-weight: 600; color: #fff; }

/* Legend */
.legend-row { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-2); flex-wrap: wrap; }
.ldot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.ml { margin-left: 10px; }

/* Badges */
.badge-teal   { font-size: 10px; font-weight: 600; padding: 3px 10px; border-radius: 20px; background: rgba(52,177,170,.12); color: var(--teal); }
.badge-yellow { font-size: 10px; font-weight: 600; padding: 3px 10px; border-radius: 20px; background: rgba(224,181,15,.12); color: var(--yellow); }
.badge-blue   { font-size: 10px; font-weight: 600; padding: 3px 10px; border-radius: 20px; background: rgba(59,143,243,.12); color: var(--blue); }

/* Chart sizes */
.chart-box    { position: relative; height: 240px; }
.chart-box-sm { position: relative; height: 170px; }
.chart-box-lg { position: relative; height: 300px; }

/* ── TAB PANELS ──────────────────────────────────────── */
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp .3s ease both; }

/* ── NO CASHFLOW ─────────────────────────────────────── */
.no-cashflow { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 60px 20px; text-align: center; }
.nc-icon  { font-size: 40px; }
.nc-title { font-size: 17px; font-weight: 700; color: var(--text); }
.nc-sub   { font-size: 12.5px; color: var(--text-2); max-width: 360px; line-height: 1.6; }

/* ── TABLE ───────────────────────────────────────────── */
.tbl-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--bg); }
th { padding: 10px 16px; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody tr { border-bottom: 1px solid var(--border); transition: background .12s; animation: fadeUp .3s ease both; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg); }
td { padding: 11px 16px; font-size: 12.5px; color: var(--text); }
.td-num  { font-family: 'Courier New', monospace; font-size: 12px; }
.td-pos  { color: var(--green); font-weight: 600; }
.td-neg  { color: var(--red); font-weight: 600; }
.td-warn { color: var(--yellow); font-weight: 600; }
.cat-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 8px; vertical-align: middle; }

/* Mini bar in table */
.bar-wrap { display: flex; align-items: center; gap: 8px; }
.bar-bg   { flex: 1; height: 5px; background: var(--border); border-radius: 3px; max-width: 90px; }
.bar-fill { height: 100%; border-radius: 3px; }

/* ── ANIMATIONS ──────────────────────────────────────── */
@keyframes fadeUp { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
@keyframes pulse  { 0%,100% { opacity:1; } 50% { opacity:.3; } }

/* ══════════════════════════════════════════════════════
   AI INSIGHTS — Gemma 4 Integration
══════════════════════════════════════════════════════ */

/* Sidebar badge */
.ai-pill-badge {
    margin-left: auto;
    font-size: 9px; font-weight: 700; letter-spacing: .06em;
    background: var(--orange); color: #fff;
    padding: 2px 6px; border-radius: 10px;
}

/* Tab button style */
.tab-ai { color: var(--orange) !important; font-weight: 600 !important; }
.tab-ai.active { background: rgba(242,159,103,.15) !important; }

/* Setup Bar */
.ai-setup-bar {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 20px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 20px; margin-bottom: 14px; flex-wrap: wrap;
    box-shadow: var(--shadow);
}
.ai-setup-left { display: flex; align-items: center; gap: 14px; }
.ai-logo {
    font-size: 24px; color: var(--orange);
    filter: drop-shadow(0 0 8px rgba(242,159,103,.5));
    flex-shrink: 0;
}
.ai-logo-sm { font-size: 12px; color: var(--orange); }
.ai-setup-title { font-size: 14px; font-weight: 700; color: var(--text); }
.ai-setup-sub   { font-size: 11.5px; color: var(--text-2); margin-top: 2px; }
.ai-link { color: var(--blue); text-decoration: none; font-weight: 500; }
.ai-link:hover { text-decoration: underline; }

.ai-key-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-key-input {
    width: 280px; padding: 8px 14px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 12.5px; font-family: 'Courier New', monospace;
    color: var(--text); background: var(--bg);
    outline: none; transition: border-color .15s;
}
.ai-key-input:focus { border-color: var(--orange); }
.ai-save-btn {
    padding: 8px 18px; background: var(--orange); color: #fff;
    border: none; border-radius: var(--radius-sm); font-size: 12.5px;
    font-weight: 600; cursor: pointer; transition: background .2s;
    white-space: nowrap;
}
.ai-save-btn:hover { background: var(--orange-dk); }
.ai-key-status { font-size: 12px; font-weight: 500; }
.ai-key-status.ok  { color: var(--green); }
.ai-key-status.err { color: var(--red); }

/* Action bar */
.ai-action-bar {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 16px; flex-wrap: wrap;
}
.ai-model-tag {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; color: var(--text-2);
    border: 1px solid var(--border); padding: 5px 12px;
    border-radius: 20px; background: var(--surface);
    font-weight: 500;
}
.ai-generate-btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, var(--orange), #e8854a);
    color: #fff; border: none; border-radius: var(--radius-sm);
    font-size: 13.5px; font-weight: 700; cursor: pointer;
    box-shadow: 0 4px 14px rgba(242,159,103,.35);
    transition: all .2s; letter-spacing: .02em;
}
.ai-generate-btn:hover  { box-shadow: 0 6px 20px rgba(242,159,103,.5); transform: translateY(-1px); }
.ai-generate-btn:active { transform: translateY(0); }
.ai-generate-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.ai-clear-btn {
    padding: 8px 16px; background: none; border: 1px solid var(--border);
    border-radius: var(--radius-sm); font-size: 12.5px; color: var(--text-2);
    cursor: pointer; transition: all .15s;
}
.ai-clear-btn:hover { border-color: var(--red); color: var(--red); }

/* Loading */
.ai-loading {
    display: flex; justify-content: center; padding: 60px 20px;
}
.ai-loading-inner { text-align: center; }
.ai-spinner {
    width: 44px; height: 44px;
    border: 3px solid rgba(242,159,103,.2);
    border-top-color: var(--orange);
    border-radius: 50%; animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.ai-loading-text { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.ai-loading-sub  { font-size: 12px; color: var(--text-3); }

/* Summary strip */
.ai-summary-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px; margin-bottom: 16px;
}
.ai-summary-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px 16px;
    border-left: 4px solid var(--orange);
    animation: fadeUp .35s ease both;
}
.ai-summary-card.critical { border-left-color: var(--red); }
.ai-summary-card.warning  { border-left-color: var(--yellow); }
.ai-summary-card.positive { border-left-color: var(--green); }
.ai-summary-card.info     { border-left-color: var(--blue); }
.ai-sum-icon  { font-size: 20px; margin-bottom: 6px; }
.ai-sum-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--text-2); margin-bottom: 4px; }
.ai-sum-value { font-size: 17px; font-weight: 700; color: var(--text); line-height: 1.2; }

/* Insights grid */
.ai-insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 14px; margin-bottom: 16px;
}
.ai-insight-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 18px;
    box-shadow: var(--shadow); animation: fadeUp .4s ease both;
    transition: box-shadow .2s, transform .2s;
    position: relative; overflow: hidden;
}
.ai-insight-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.ai-insight-card.critical::before { background: var(--red); }
.ai-insight-card.warning::before  { background: var(--yellow); }
.ai-insight-card.positive::before { background: var(--green); }
.ai-insight-card.info::before     { background: var(--blue); }
.ai-insight-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.ai-card-top { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.ai-card-emoji { font-size: 22px; line-height: 1; flex-shrink: 0; margin-top: 1px; }
.ai-card-meta  { flex: 1; }
.ai-card-title { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.3; margin-bottom: 3px; }
.ai-card-sev {
    display: inline-block; font-size: 9.5px; font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase; padding: 2px 8px;
    border-radius: 10px;
}
.sev-critical { background: rgba(233,91,91,.12); color: var(--red); }
.sev-warning  { background: rgba(224,181,15,.12); color: #c49900; }
.sev-positive { background: rgba(46,200,125,.12); color: #1fa863; }
.sev-info     { background: rgba(59,143,243,.12); color: var(--blue); }

.ai-card-body { font-size: 13px; color: var(--text-2); line-height: 1.6; margin-bottom: 12px; }
.ai-card-action {
    display: flex; align-items: flex-start; gap: 8px;
    background: var(--bg); border-radius: var(--radius-sm);
    padding: 10px 12px; font-size: 12px; color: var(--text);
    border-left: 3px solid var(--orange);
}
.ai-card-action-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.ai-card-action-text { line-height: 1.5; }
.ai-card-number { font-size: 18px; font-weight: 700; color: var(--orange); margin-bottom: 2px; }
.ai-card-number-label { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }

/* Follow-up chat */
.ai-followup-card { margin-top: 0; }
.ai-chat-area {
    max-height: 320px; overflow-y: auto; margin-bottom: 12px;
    display: flex; flex-direction: column; gap: 10px;
}
.ai-chat-area:empty { display: none; }
.chat-msg {
    padding: 10px 14px; border-radius: 8px;
    font-size: 13px; line-height: 1.6; max-width: 85%;
    animation: fadeUp .3s ease both;
}
.chat-msg.user {
    background: rgba(242,159,103,.12); color: var(--text);
    align-self: flex-end; border-bottom-right-radius: 2px;
    font-weight: 500;
}
.chat-msg.ai {
    background: var(--bg); color: var(--text);
    align-self: flex-start; border-bottom-left-radius: 2px;
    border-left: 3px solid var(--orange);
}
.chat-msg.thinking {
    background: rgba(52,177,170,.08); color: var(--teal);
    align-self: flex-start; font-size: 12px; font-style: italic;
}
.ai-input-row { display: flex; gap: 8px; }
.ai-followup-input {
    flex: 1; padding: 10px 14px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 13px; color: var(--text); background: var(--bg);
    outline: none; transition: border-color .15s;
}
.ai-followup-input:focus { border-color: var(--orange); }
.ai-send-btn {
    padding: 10px 20px; background: var(--navy); color: #fff;
    border: none; border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 600; cursor: pointer;
    transition: background .15s; white-space: nowrap;
}
.ai-send-btn:hover { background: var(--navy-lt); }

/* Empty state */
.ai-empty {
    display: flex; flex-direction: column; align-items: center;
    gap: 12px; padding: 60px 20px; text-align: center;
}
.ai-empty-icon  { font-size: 44px; color: var(--orange); filter: drop-shadow(0 0 12px rgba(242,159,103,.35)); }
.ai-empty-title { font-size: 18px; font-weight: 700; color: var(--text); }
.ai-empty-sub   { font-size: 13px; color: var(--text-2); max-width: 380px; line-height: 1.6; }

/* ══ ataeru.cloud Branding ══════════════════════════════ */
.logo-dot {
    color: var(--orange);
    font-weight: 300;
}
.logo-text {
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.01em;
    white-space: nowrap;
}
.brand-name {
    font-weight: 700;
    color: var(--orange);
    letter-spacing: -0.01em;
}
.logo-icon {
    font-size: 20px;
    color: var(--orange);
    filter: drop-shadow(0 0 8px rgba(242,159,103,.5));
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════
   PRODUCTION ANALYSIS MODULE
══════════════════════════════════════════════════════ */

.tab-prod { color: #34B1AA !important; font-weight: 600 !important; }
.tab-prod.active { background: rgba(52,177,170,.12) !important; }

/* Connector card */
.prod-connector { margin-bottom: 14px; }
.prod-connector-header {
    display: flex; align-items: center; gap: 14px; margin-bottom: 16px;
}
.prod-logo { font-size: 28px; flex-shrink: 0; }
.prod-status-dot {
    width: 10px; height: 10px; border-radius: 50%;
    margin-left: auto; flex-shrink: 0;
    background: var(--border); transition: all .3s;
}
.prod-status-dot.connected { background: var(--green); box-shadow: 0 0 6px var(--green); }
.prod-status-dot.loading   { background: var(--yellow); animation: pulse .8s infinite; }
.prod-status-dot.error     { background: var(--red); }

.prod-url-row {
    display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap;
}
.prod-url-input {
    flex: 1; min-width: 280px; padding: 10px 14px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 12.5px; color: var(--text); background: var(--bg);
    outline: none; font-family: 'Courier New', monospace;
    transition: border-color .15s;
}
.prod-url-input:focus { border-color: var(--teal); }

.prod-connect-btn {
    padding: 10px 22px;
    background: linear-gradient(135deg, var(--teal), #2a9991);
    color: #fff; border: none; border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 700; cursor: pointer;
    box-shadow: 0 4px 12px rgba(52,177,170,.3);
    transition: all .2s; white-space: nowrap;
}
.prod-connect-btn:hover { box-shadow: 0 6px 18px rgba(52,177,170,.45); transform: translateY(-1px); }
.prod-connect-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.prod-refresh-btn {
    padding: 10px 14px; background: none;
    border: 1px solid var(--teal); border-radius: var(--radius-sm);
    color: var(--teal); font-size: 16px; cursor: pointer;
    transition: all .15s;
}
.prod-refresh-btn:hover { background: rgba(52,177,170,.08); }

.prod-hint {
    font-size: 11.5px; color: var(--text-3);
    background: var(--bg); padding: 8px 12px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--teal);
}

/* Sheet selector */
.prod-sheet-selector { margin-bottom: 14px; }
.prod-select-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sel-btn {
    padding: 5px 12px; background: none;
    border: 1px solid var(--border); border-radius: 20px;
    font-size: 12px; color: var(--text-2); cursor: pointer;
    transition: all .15s;
}
.sel-btn:hover { border-color: var(--teal); color: var(--teal); }
.prod-load-btn {
    padding: 8px 18px; background: var(--navy);
    border: none; border-radius: var(--radius-sm);
    color: #fff; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: background .15s; white-space: nowrap;
}
.prod-load-btn:hover { background: var(--navy-lt); }
.prod-load-btn:disabled { opacity: .6; cursor: not-allowed; }

/* Sheet chips */
.sheet-chips {
    display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px;
}
.sheet-chip {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 14px; border-radius: 20px;
    border: 1.5px solid var(--border); background: var(--bg);
    font-size: 12.5px; color: var(--text-2); cursor: pointer;
    transition: all .15s; user-select: none;
}
.sheet-chip:hover { border-color: var(--teal); color: var(--teal); }
.sheet-chip.selected {
    border-color: var(--teal); background: rgba(52,177,170,.1);
    color: var(--teal); font-weight: 600;
}
.chip-check { font-size: 14px; }
.chip-rows { font-size: 10.5px; color: var(--text-3); margin-left: 2px; }
.sheet-chip.selected .chip-rows { color: var(--teal); opacity: .7; }

/* Data strip */
.prod-data-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px; margin-bottom: 16px;
}
.prod-kpi {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px 16px;
    border-top: 3px solid var(--teal);
    animation: fadeUp .3s ease both;
}
.prod-kpi-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--text-2); margin-bottom: 6px; }
.prod-kpi-value { font-size: 20px; font-weight: 700; color: var(--text); }
.prod-kpi-sub   { font-size: 11px; color: var(--text-3); margin-top: 3px; }

/* Sheets grid — preview tables */
.prod-sheets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 14px; margin-bottom: 16px;
}
.prod-sheet-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.prod-sheet-card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; background: var(--navy); color: #fff;
}
.prod-sheet-name { font-size: 13px; font-weight: 600; }
.prod-sheet-meta { font-size: 11px; color: rgba(255,255,255,.5); }
.prod-table-wrap { overflow-x: auto; max-height: 280px; overflow-y: auto; }
.prod-table-wrap table { width: 100%; border-collapse: collapse; }
.prod-table-wrap th {
    padding: 8px 12px; font-size: 10.5px; font-weight: 600;
    text-transform: uppercase; color: var(--text-2); background: var(--bg);
    border-bottom: 1px solid var(--border); white-space: nowrap; text-align: left;
    position: sticky; top: 0;
}
.prod-table-wrap td {
    padding: 8px 12px; font-size: 12px; color: var(--text);
    border-bottom: 1px solid var(--border); white-space: nowrap;
}
.prod-table-wrap tr:last-child td { border-bottom: none; }
.prod-table-wrap tr:hover td { background: var(--bg); }
.td-num-prod { font-family: 'Courier New', monospace; text-align: right; }

/* Q&A card */
.prod-qa-card { }
.quick-queries {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-bottom: 14px; align-items: center;
}
.qq-label { font-size: 11px; color: var(--text-3); font-weight: 500; white-space: nowrap; }
.qq-pill {
    padding: 5px 12px; background: rgba(52,177,170,.08);
    border: 1px solid rgba(52,177,170,.25); border-radius: 20px;
    font-size: 12px; color: var(--teal); cursor: pointer;
    transition: all .15s; white-space: nowrap;
}
.qq-pill:hover { background: rgba(52,177,170,.18); border-color: var(--teal); }

/* ── Auth / Sign Out ─────────────────────────────────── */
.logout-btn-top {
    padding: 6px 14px;
    background: rgba(233,91,91,.08);
    border: 1px solid rgba(233,91,91,.2);
    border-radius: var(--radius-sm);
    color: var(--red);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}
.logout-btn-top:hover {
    background: rgba(233,91,91,.15);
    border-color: var(--red);
}
