/* ── Reset & Base ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #f5f6fa; color: #2d3436; font-size: 14px; }
a { color: #0984e3; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navbar ── */
.navbar { display: flex; justify-content: space-between; align-items: center; background: #2d3436; padding: 0 20px; height: 48px; position: sticky; top: 0; z-index: 100; }
.nav-left { display: flex; align-items: center; gap: 4px; }
.nav-brand { color: #fff; font-weight: 700; font-size: 15px; margin-right: 20px; }
.nav-brand:hover { text-decoration: none; }
.nav-link { color: #b2bec3; padding: 12px 14px; font-size: 13px; font-weight: 500; }
.nav-link:hover { color: #fff; text-decoration: none; }
.nav-link.active { color: #fff; border-bottom: 2px solid #0984e3; }
.nav-right { display: flex; align-items: center; gap: 12px; }
.date-form { display: flex; align-items: center; gap: 6px; }
.date-form label { color: #b2bec3; font-size: 12px; }
.date-form input[type="date"] { background: #636e72; border: 1px solid #636e72; color: #fff; padding: 4px 8px; border-radius: 4px; font-size: 12px; }
.logout { color: #d63031 !important; font-size: 12px; }

/* ── Container ── */
.container { max-width: 1400px; margin: 20px auto; padding: 0 20px; }
.date-range-label { color: #636e72; font-size: 13px; margin-bottom: 16px; }

/* ── Cards ── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.card { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.card .label { font-size: 12px; color: #636e72; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.card .value { font-size: 28px; font-weight: 700; color: #2d3436; }
.card .sub { font-size: 12px; color: #636e72; margin-top: 4px; }

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.08); margin-bottom: 24px; }
th { background: #dfe6e9; text-align: left; padding: 10px 14px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; color: #636e72; cursor: pointer; white-space: nowrap; }
th a { color: #636e72; }
td { padding: 10px 14px; border-top: 1px solid #f1f2f6; font-size: 13px; }
tr:hover { background: #f8f9fb; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.sort-arrow { font-size: 10px; margin-left: 2px; }

/* ── Section headers ── */
h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
h2 { font-size: 17px; font-weight: 600; margin: 24px 0 12px; color: #2d3436; }
h3 { font-size: 14px; font-weight: 600; margin: 16px 0 8px; color: #636e72; }

/* ── Badges ── */
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.badge-green { background: #d4edda; color: #155724; }
.badge-red { background: #f8d7da; color: #721c24; }
.badge-yellow { background: #fff3cd; color: #856404; }
.badge-gray { background: #e2e3e5; color: #383d41; }

/* ── Bar charts (inline) ── */
.bar-container { width: 100%; background: #f1f2f6; border-radius: 3px; height: 18px; position: relative; }
.bar-fill { height: 100%; border-radius: 3px; background: #0984e3; }
.bar-fill.green { background: #00b894; }
.bar-fill.red { background: #d63031; }
.bar-fill.yellow { background: #fdcb6e; }
.bar-label { position: absolute; right: 6px; top: 1px; font-size: 11px; font-weight: 600; color: #2d3436; }

/* ── Login ── */
.login-body { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: #2d3436; }
.login-box { background: #fff; padding: 40px; border-radius: 12px; width: 360px; box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.login-box h2 { text-align: center; margin-bottom: 24px; font-size: 22px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 500; color: #636e72; }
.form-group input { width: 100%; padding: 10px 12px; border: 1px solid #dfe6e9; border-radius: 6px; font-size: 14px; }
.form-group input:focus { outline: none; border-color: #0984e3; box-shadow: 0 0 0 3px rgba(9,132,227,0.15); }
.btn { width: 100%; padding: 10px; background: #0984e3; color: #fff; border: none; border-radius: 6px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn:hover { background: #0872c4; }
.error { background: #f8d7da; color: #721c24; padding: 10px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; text-align: center; }

/* ── Comparison View ── */
.compare-header { background: #fff; padding: 16px 20px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); margin-bottom: 16px; display: flex; gap: 24px; flex-wrap: wrap; align-items: center; }
.compare-header .meta { font-size: 13px; color: #636e72; }
.compare-header .meta strong { color: #2d3436; }
.compare-tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.compare-tabs a { padding: 8px 16px; background: #dfe6e9; border-radius: 6px 6px 0 0; font-size: 13px; font-weight: 500; color: #636e72; }
.compare-tabs a.active { background: #fff; color: #2d3436; font-weight: 600; }
.compare-tabs a:hover { text-decoration: none; color: #2d3436; }
.compare-panes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; height: calc(100vh - 200px); }
.pane { background: #fff; border-radius: 8px; overflow-y: auto; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.pane-title { font-size: 13px; font-weight: 700; text-transform: uppercase; color: #636e72; letter-spacing: 0.5px; margin-bottom: 12px; position: sticky; top: 0; background: #fff; padding-bottom: 8px; border-bottom: 1px solid #f1f2f6; }

/* Script pane */
.section-header { font-size: 12px; font-weight: 700; color: #0984e3; margin: 16px 0 6px; padding: 4px 8px; background: #f0f7ff; border-radius: 4px; }
.script-sentence { padding: 6px 10px; margin: 2px 0; border-radius: 4px; font-size: 13px; line-height: 1.5; cursor: default; }
.script-sentence.green { background: #d4edda; cursor: pointer; }
.script-sentence.red { background: #f8d7da; }
.script-sentence .matched-quote { display: block; font-size: 11px; color: #155724; font-style: italic; margin-top: 2px; opacity: 0.8; }

/* Transcript pane */
.call-divider { border-top: 2px solid #636e72; margin: 16px 0 8px; padding-top: 8px; }
.call-divider:first-child { border-top: none; margin-top: 0; }
.call-divider-label { font-size: 12px; font-weight: 700; color: #2d3436; background: #dfe6e9; padding: 4px 10px; border-radius: 4px; display: inline-block; }
.transcript-utt { padding: 6px 10px; margin: 2px 0; border-radius: 4px; font-size: 13px; line-height: 1.5; }
.transcript-utt.green { background: #d4edda; cursor: pointer; }
.transcript-utt.yellow { background: #fff3cd; }
.transcript-utt.gray { background: #e2e3e5; }
.transcript-utt .utt-meta { font-size: 11px; font-weight: 600; color: #636e72; margin-right: 6px; }
.transcript-utt .utt-meta.rep { color: #0984e3; }
.transcript-utt .utt-meta.client { color: #6c5ce7; }

/* Click-to-scroll highlight */
.temp-highlight { outline: 3px solid #fdcb6e; font-weight: 700; transition: outline 0.3s; }

/* ── Chart containers ── */
.chart-container { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); margin-bottom: 24px; }
.chart-container canvas { max-height: 400px; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .compare-panes { grid-template-columns: 1fr; height: auto; }
    .pane { max-height: 50vh; }
    .cards { grid-template-columns: 1fr 1fr; }
}
