/* Authority Intelligence Dashboard — extracted from pvs-dashboard-mockup.html */
:root {
    --navy: #284d96;
    --navy-light: #3a6bc5;
    --blue: #4F81BD;
    --blue-light: #7BA7D7;
    --teal: #2B8C96;
    --light-bg: #F4F6F9;
    --card-bg: #FFFFFF;
    --text: #2D3748;
    --text-light: #718096;
    --border: #E2E8F0;
    --success: #48BB78;
    --warning: #ECC94B;
    --danger: #F56565;
    --orange: #ED8936;
    --positive: #48BB78;
    --negative: #F56565;
    --neutral: #A0AEC0;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--light-bg); color: var(--text); line-height: 1.6; }
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.header { background: linear-gradient(135deg, var(--navy), var(--navy-light)); color: white; padding: 16px 32px; display: flex; justify-content: space-between; align-items: center; }
.header h1 { font-size: 20px; font-weight: 700; }
.header .subtitle { opacity: 0.8; font-size: 13px; margin-top: 2px; }
.header nav { display: flex; gap: 20px; align-items: center; }
.header nav a { color: rgba(255,255,255,0.85); font-size: 14px; font-weight: 500; }
.header nav a:hover { color: white; text-decoration: none; }
.header .client-info { text-align: right; font-size: 13px; }
.header .client-name { font-weight: 600; font-size: 16px; }
.header .cycle { opacity: 0.8; }

/* Nav tabs */
.nav-tabs { background: white; border-bottom: 2px solid var(--border); display: flex; padding: 0 32px; gap: 0; }
.nav-tab { padding: 14px 24px; font-size: 14px; font-weight: 500; color: var(--text-light); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all 0.2s; text-decoration: none; }
.nav-tab:hover { color: var(--navy); text-decoration: none; }
.nav-tab.active { color: var(--navy); border-bottom-color: var(--blue); font-weight: 600; }

/* Container */
.container { max-width: 1440px; margin: 0 auto; padding: 24px; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* KPI cards */
.summary-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi-card { background: var(--card-bg); border-radius: 12px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); text-align: center; position: relative; overflow: hidden; }
.kpi-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; }
.kpi-card.pvs::before { background: var(--blue); }
.kpi-card.vis::before { background: var(--teal); }
.kpi-card.tier::before { background: var(--success); }
.kpi-card.drift::before { background: var(--warning); }
.kpi-card.delta::before { background: var(--orange); }
.kpi-card.sentiment::before { background: var(--teal); }
.kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-light); margin-bottom: 6px; }
.kpi-value { font-size: 36px; font-weight: 800; color: var(--navy); }
.kpi-sub { font-size: 12px; color: var(--text-light); margin-top: 4px; }
.delta-pos { color: var(--success); }
.delta-neg { color: var(--danger); }

/* Chart cards */
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.chart-card { background: var(--card-bg); border-radius: 12px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.chart-card.full { grid-column: 1 / -1; }
.chart-card h3 { font-size: 15px; font-weight: 600; color: var(--navy); margin-bottom: 4px; }
.chart-card .chart-desc { font-size: 12px; color: var(--text-light); margin-bottom: 16px; }
.chart-wrap { position: relative; height: 320px; }
.chart-wrap.tall { height: 420px; }

/* Dimension bars */
.dim-row { display: flex; align-items: center; margin-bottom: 12px; }
.dim-label { width: 220px; font-size: 13px; font-weight: 500; color: var(--text); }
.dim-label small { color: var(--text-light); font-weight: 400; }
.dim-bar-wrap { flex: 1; height: 28px; background: #EDF2F7; border-radius: 6px; overflow: hidden; }
.dim-bar { height: 100%; border-radius: 6px; transition: width 1s ease; display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; }
.dim-bar span { font-size: 12px; font-weight: 700; color: white; }
.dim-score { width: 80px; text-align: right; font-size: 14px; font-weight: 600; color: var(--navy); margin-left: 12px; }

/* Sentiment bar */
.sentiment-bar-wrap { display: flex; border-radius: 8px; overflow: hidden; margin: 16px 0; }
.sentiment-segment { display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: white; transition: width 0.8s ease; }
.sentiment-segment.positive { background: var(--positive); }
.sentiment-segment.neutral { background: var(--neutral); }
.sentiment-segment.negative { background: var(--negative); }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { background: var(--light-bg); text-align: left; padding: 10px 12px; font-weight: 600; color: var(--navy); border-bottom: 2px solid var(--border); font-size: 12px; }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:hover td { background: #f7fafc; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.badge-owned { background: #C6F6D5; color: #22543D; }
.badge-tier1 { background: #BEE3F8; color: #2A4365; }
.badge-tier2 { background: #FEFCBF; color: #744210; }
.badge-unknown { background: #EDF2F7; color: #4A5568; }
.badge-positive { background: #C6F6D5; color: #22543D; }
.badge-negative { background: #FED7D7; color: #742A2A; }
.badge-neutral { background: #EDF2F7; color: #4A5568; }
.badge-tier-low { background: #FED7D7; color: #742A2A; }
.badge-tier-fragmented { background: #FEFCBF; color: #744210; }
.badge-tier-emerging { background: #BEE3F8; color: #2A4365; }
.badge-tier-strong { background: #C6F6D5; color: #22543D; }
.badge-tier-leader { background: #C6F6D5; color: #22543D; }
/* Full tier-name aliases — templates emit badge-tier-{{ tier|lower|replace(' ','-') }} */
.badge-tier-low-authority-signal { background: #FED7D7; color: #742A2A; }
.badge-tier-fragmented-signal { background: #FEFCBF; color: #744210; }
.badge-tier-emerging-visibility { background: #BEE3F8; color: #2A4365; }
.badge-tier-strong-presence { background: #C6F6D5; color: #22543D; }
.badge-tier-authority-leader { background: #C6F6D5; color: #22543D; }

.engine-icon { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.engine-chatgpt { background: #10A37F; }
.engine-claude { background: #D97706; }
.engine-gemini { background: #4285F4; }
.engine-perplexity { background: #20808D; }
.engine-google_aio { background: #EA4335; }

/* Callouts */
.callout { background: #FFFBEB; border: 1px solid #F6E05E; border-radius: 8px; padding: 16px 20px; margin-bottom: 20px; font-size: 13px; }
.callout-title { font-weight: 600; color: #975A16; margin-bottom: 4px; }
.callout-body { color: #744210; }
.callout.info { background: #EBF8FF; border-color: #90CDF4; }
.callout.info .callout-title { color: #2A4365; }
.callout.info .callout-body { color: #2C5282; }

/* Drift cards */
.drift-card { border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-bottom: 12px; background: white; }
.drift-card.severity-high { border-left: 4px solid var(--danger); }
.drift-card.severity-medium { border-left: 4px solid var(--warning); }
.drift-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.drift-title { font-weight: 600; font-size: 14px; }
.drift-meta { font-size: 12px; color: var(--text-light); margin-bottom: 8px; }
.drift-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; font-size: 13px; }
.drift-box { background: var(--light-bg); padding: 10px; border-radius: 6px; }
.drift-box-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-light); margin-bottom: 4px; }

/* Citations */
.citation-split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.citation-list-card { background: var(--card-bg); border-radius: 12px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.citation-list-card.best { border-top: 4px solid var(--success); }
.citation-list-card.worst { border-top: 4px solid var(--danger); }
.citation-list-card h3 { margin-bottom: 12px; font-size: 15px; font-weight: 600; }
.citation-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.citation-item:last-child { border-bottom: none; }
.citation-detail { flex: 1; }
.citation-url { font-size: 13px; font-weight: 600; color: var(--navy); word-break: break-all; }
.citation-meta { font-size: 11px; color: var(--text-light); margin-top: 2px; }
.citation-score-pill { display: flex; flex-direction: column; align-items: center; min-width: 50px; }
.citation-score-value { font-size: 20px; font-weight: 800; }
.citation-score-label { font-size: 9px; text-transform: uppercase; color: var(--text-light); }
.score-good { color: var(--success); }
.score-bad { color: var(--danger); }

.rank-num { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; font-size: 12px; font-weight: 700; color: white; }
.rank-best { background: var(--success); }
.rank-worst { background: var(--danger); }

/* Client cards grid */
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; margin-bottom: 24px; }
.client-card { background: var(--card-bg); border-radius: 12px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); border-left: 4px solid var(--navy); transition: transform 0.15s, box-shadow 0.15s; }
.client-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.client-card h3 { font-size: 18px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.client-card .client-meta { font-size: 13px; color: var(--text-light); margin-bottom: 16px; }
.client-card .pvs-big { font-size: 42px; font-weight: 900; color: var(--navy); line-height: 1; }
.client-card .pvs-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-light); margin-top: 4px; }
.client-card .stats-row { display: flex; gap: 20px; margin-top: 16px; font-size: 13px; }
.client-card .stat-item { display: flex; flex-direction: column; }
.client-card .stat-label { font-size: 10px; text-transform: uppercase; color: var(--text-light); }
.client-card .stat-value { font-weight: 600; color: var(--text); }

/* Login */
.login-container { max-width: 400px; margin: 120px auto; padding: 40px; background: white; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); text-align: center; }
.login-container h2 { color: var(--navy); margin-bottom: 8px; }
.login-container p { color: var(--text-light); font-size: 14px; margin-bottom: 24px; }
.login-container input[type="password"] { width: 100%; padding: 12px 16px; border: 2px solid var(--border); border-radius: 8px; font-size: 14px; margin-bottom: 16px; }
.login-container input[type="password"]:focus { border-color: var(--blue); outline: none; }
.login-container button { width: 100%; padding: 12px; background: var(--navy); color: white; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.login-container button:hover { background: var(--navy-light); }
.login-error { color: var(--danger); font-size: 13px; margin-bottom: 12px; }

/* No data */
.no-data { text-align: center; padding: 32px; color: var(--text-light); font-size: 14px; }

/* Footer */
.footer { text-align: center; padding: 24px; color: var(--text-light); font-size: 12px; border-top: 1px solid var(--border); margin-top: 32px; }

/* Responsive */
@media (max-width: 1024px) {
    .summary-row { grid-template-columns: repeat(3, 1fr); }
    .chart-grid, .citation-split { grid-template-columns: 1fr; }
    .client-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .summary-row { grid-template-columns: 1fr 1fr; }
    .nav-tabs { overflow-x: auto; }
    .header { flex-direction: column; gap: 8px; }
}
