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

:root {
    /* Abound Brand Colors */
    --primary: #5B5BA9;
    --primary-light: #7474B8;
    --primary-dark: #4A4A8A;
    --accent: #00B8D4;
    --accent-light: #E0F7FA;

    /* Semantic Colors */
    --success: #2E7D32;
    --success-bg: #E8F5E9;
    --warning: #F57C00;
    --warning-bg: #FFF3E0;
    --muted: #78909C;
    --muted-bg: #ECEFF1;
    --danger: #C62828;
    --danger-bg: #FFEBEE;

    /* Neutrals - high contrast for accessibility */
    --bg: #FAFAFA;
    --card-bg: #FFFFFF;
    --text: #1a1a1a;
    --text-secondary: #374151;
    --text-light: #4b5563;
    --border: #E0E0E0;
    --border-light: #F5F5F5;

    /* Consolidated Type Scale */
    --text-xs: 0.75rem;    /* 12px — labels, badges, timestamps */
    --text-sm: 0.875rem;   /* 14px — secondary text, metadata, buttons */
    --text-base: 1rem;     /* 16px — body text, card content */
    --text-lg: 1.25rem;    /* 20px — section headers */
    --text-xl: 1.5rem;     /* 24px — dashboard title */
    --text-hero: 1.75rem;  /* 28px — hero metric values */
}

body {
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
}

.hidden {
    display: none !important;
}

/* ========================================
   Password Overlay
   ======================================== */

#password-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.password-modal {
    background: white;
    padding: 3rem;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}

.password-modal h2 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.password-modal p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.password-modal input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: var(--text-base);
    border: 2px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.password-modal input:focus {
    outline: none;
    border-color: var(--primary);
}

.password-modal button {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: var(--text-base);
    font-weight: 600;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.password-modal button:hover {
    background: var(--primary-light);
}

.password-modal button:active {
    transform: scale(0.98);
}

.password-modal .error {
    color: var(--danger);
    margin-top: 1rem;
    font-size: var(--text-sm);
}

/* ========================================
   Dashboard Layout
   ======================================== */

#dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.logo {
    height: 48px;
    width: auto;
    margin-bottom: 1rem;
}

header h1 {
    color: var(--primary);
    font-size: var(--text-hero);
    font-weight: 700;
    margin-bottom: 0.25rem;
    letter-spacing: -0.01em;
}

header .subtitle {
    color: var(--text-secondary);
    font-size: var(--text-base);
    font-weight: 400;
}

header .last-updated {
    color: var(--text-light);
    font-size: var(--text-sm);
    margin-top: 0.75rem;
}

/* ========================================
   Strategy Context Cards
   ======================================== */

.strategy-context {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.context-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.context-card h3 {
    color: var(--primary);
    margin-bottom: 0.625rem;
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.context-card p {
    color: var(--text-secondary);
    font-size: var(--text-base);
    line-height: 1.65;
}

.context-card.timeline {
    border-left-color: var(--accent);
}

/* ========================================
   Executive Briefing (AI-generated)
   ======================================== */

.executive-briefing {
    background: linear-gradient(135deg, #F3F0FF 0%, #EDE9FE 100%);
    border: 1px solid #C4B5FD;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.briefing-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.briefing-icon {
    width: 20px;
    height: 20px;
    color: #7C3AED;
}

.briefing-label {
    font-size: var(--text-xs);
    font-weight: 700;
    color: #7C3AED;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.briefing-date {
    margin-left: auto;
    font-size: var(--text-xs);
    color: #8B5CF6;
}

.briefing-refresh-btn {
    background: none;
    border: 1px solid #C4B5FD;
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    color: #7C3AED;
    display: flex;
    align-items: center;
    transition: background 0.2s, border-color 0.2s;
}

.briefing-refresh-btn:hover {
    background: #EDE9FE;
    border-color: #8B5CF6;
}

.briefing-refresh-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.briefing-refresh-btn.spinning .briefing-refresh-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.briefing-refresh-icon {
    width: 14px;
    height: 14px;
}

.briefing-text {
    font-size: var(--text-base);
    color: var(--text);
    line-height: 1.7;
    margin: 0;
}

.briefing-text ul {
    margin: 0;
    padding-left: 1.25rem;
    list-style: disc;
}

.briefing-text li {
    margin-bottom: 0.35rem;
    line-height: 1.5;
}

.executive-counts {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #DDD6FE;
    flex-wrap: wrap;
}

.compact-count {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: rgba(255,255,255,0.6);
    border-radius: 4px;
}

.compact-count strong {
    font-weight: 700;
}

.compact-count.needs-attention {
    color: var(--warning);
}

.compact-count.trend-up {
    color: var(--success);
}

.compact-count.trend-down {
    color: var(--danger);
}

/* ========================================
   Attention Strip
   ======================================== */

.attention-strip {
    margin-bottom: 1.5rem;
}

.attention-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    background: none;
    border: none;
    padding: 0.5rem 0;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--warning);
    cursor: pointer;
    transition: color 0.2s;
}

.attention-toggle:hover {
    color: #e65100;
}

.attention-badge {
    background: var(--warning);
    color: white;
    font-size: var(--text-xs);
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.attention-toggle-chevron {
    width: 16px;
    height: 16px;
    margin-left: auto;
    transition: transform 0.2s ease;
}

.attention-toggle[aria-expanded="false"] .attention-toggle-chevron {
    transform: rotate(-90deg);
}

.attention-content.collapsed {
    display: none;
}

.attention-icon {
    width: 18px;
    height: 18px;
    color: var(--warning);
}

.attention-label {
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--warning);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.attention-items {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
}

.attention-card {
    flex: 0 0 auto;
    min-width: 220px;
    max-width: 300px;
    background: var(--warning-bg);
    border: 1px solid #FFCC80;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.attention-card:hover {
    box-shadow: 0 4px 12px rgba(245, 124, 0, 0.15);
}

.attention-card-reason {
    font-size: var(--text-xs);
    color: var(--warning);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.25rem;
}

.attention-card-metric {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.attention-card-desc {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ========================================
   Section AI Summary
   ======================================== */

.section-ai-summary {
    background: linear-gradient(135deg, #F3F0FF 0%, #EDE9FE 100%);
    border-left: 3px solid #8B5CF6;
    border-radius: 0 8px 8px 0;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    font-size: var(--text-sm);
    color: var(--text);
    line-height: 1.6;
}

.section-ai-summary:empty {
    display: none;
}

.section-ai-summary .ai-label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: #7C3AED;
    margin-bottom: 0.25rem;
    display: block;
}

/* ========================================
   Metrics Sections
   ======================================== */

.metrics-section {
    margin-bottom: 3rem;
}

.metrics-section h2 {
    color: var(--primary);
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: 0.375rem;
    letter-spacing: -0.01em;
}

.section-question {
    color: var(--text-light);
    font-style: italic;
    margin-bottom: 1rem;
    font-size: var(--text-sm);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.25rem;
}

/* ========================================
   Metric Cards — Redesigned
   ======================================== */

.metric-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid var(--border-light);
    transition: box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
}

.metric-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: var(--border);
}

/* Post-conversion: distinct but readable */
.metric-card.post-conversion {
    opacity: 1;
    background: #F8FAFC;
    border: 1px dashed var(--border);
}

.metric-card.post-conversion:hover {
    border-color: var(--text-light);
}

.metric-card.post-conversion .metric-value-hero {
    color: var(--muted);
}

/* Metric Header */
.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.metric-title-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    flex: 1;
}

.metric-card h4 {
    color: var(--text);
    font-size: var(--text-base);
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
    padding: 0;
    border: none;
}

/* Status Badges */
.metric-status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.metric-status.has-baseline {
    background: var(--success-bg);
    color: var(--success);
}

.metric-status.needs-baseline {
    background: var(--warning-bg);
    color: var(--warning);
}

.metric-status.post-conversion {
    background: var(--muted-bg);
    color: var(--muted);
}

.metric-status .status-icon {
    width: 12px;
    height: 12px;
    stroke-width: 2.5;
}

/* Hero Value Layout */
.metric-values {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
}

.metric-value-hero {
    font-size: var(--text-hero);
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.metric-value-secondary {
    font-size: var(--text-xs);
    color: var(--text-light);
    display: flex;
    gap: 1rem;
}

.metric-value-secondary span {
    display: inline-flex;
    gap: 0.25rem;
}

.metric-value-secondary strong {
    font-weight: 600;
}

/* Progress Bar */
.metric-progress {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.metric-progress-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.metric-progress-fill.over-target {
    background: var(--success);
}

.metric-progress-fill.under-half {
    background: var(--warning);
}

/* Trend Indicators */
.trend-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.375rem;
    font-size: var(--text-sm);
    font-weight: 600;
}

.trend-indicator .trend-icon {
    width: 18px;
    height: 18px;
}

.trend-indicator.trend-up {
    color: #2E7D32;
}

.trend-indicator.trend-down {
    color: #C62828;
}

.trend-indicator.trend-stable {
    color: var(--muted);
}

/* Qualitative Insight — Simplified */
.qualitative-compact {
    background: var(--accent-light);
    border: 1px solid #B2EBF2;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin-top: 0.75rem;
}

.qualitative-compact-text {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.5;
    font-style: italic;
    margin: 0;
}

.qualitative-compact-attr {
    font-style: normal;
    font-weight: 600;
    color: #00838F;
    font-size: var(--text-xs);
    white-space: nowrap;
}

.qualitative-compact-link {
    display: inline-block;
    font-size: var(--text-xs);
    color: var(--primary);
    text-decoration: none;
    margin-top: 0.375rem;
    font-weight: 500;
}

.qualitative-compact-link:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}

/* Collapsible Details Section */
.metric-details-toggle {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background: none;
    border: none;
    padding: 0.5rem 0;
    font-size: var(--text-xs);
    color: var(--text-light);
    cursor: pointer;
    margin-top: auto;
    padding-top: 0.5rem;
    min-height: 44px;
    transition: color 0.2s;
}

.metric-details-toggle:hover {
    color: var(--primary);
}

.metric-details-toggle .details-chevron {
    width: 14px;
    height: 14px;
    transition: transform 0.2s;
}

.metric-details-toggle[aria-expanded="true"] .details-chevron {
    transform: rotate(90deg);
}

.metric-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.metric-details.expanded {
    max-height: 500px;
}

.metric-details-content {
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
}

/* Owner/Contact inside details */
.metric-owner {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    margin-bottom: 0.75rem;
}

.owner-label,
.contact-label {
    font-size: var(--text-xs);
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.owner-name {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text);
}

.owner-title {
    font-size: var(--text-xs);
    color: var(--text-light);
    font-weight: 400;
}

.metric-contact {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    margin-bottom: 0.75rem;
}

.contact-name {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

/* Why It Matters */
.metric-why {
    margin-top: 0.75rem;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.6;
}

.metric-why strong {
    color: var(--text-light);
    font-weight: 600;
}

/* Sub-metrics breakdown */
.metric-sub-breakdown {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--muted-bg);
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

.sub-breakdown-label {
    display: block;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.sub-breakdown-items {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.sub-breakdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sub-item-name {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.sub-item-value {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text);
    background: white;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
}

/* ========================================
   Time-Series Charts
   ======================================== */

.metric-chart-container {
    height: 100px;
    margin-top: 0.75rem;
    position: relative;
}

.metric-chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

.metric-chart-container.single-point {
    height: auto;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.metric-chart-container .chart-placeholder {
    font-size: var(--text-xs);
    color: var(--text-light);
    font-style: italic;
    text-align: center;
    padding: 0.5rem;
}

/* ========================================
   Tooltip Styles
   ======================================== */

.tooltip-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--border);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
    transition: background 0.2s;
}

.tooltip-trigger:hover {
    background: var(--primary);
}

.tooltip-trigger:hover .tooltip-icon {
    color: white;
}

.tooltip-icon {
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--text-light);
    font-style: italic;
    font-family: Georgia, serif;
    line-height: 1;
}

.tooltip-content {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    width: 320px;
    padding: 1rem;
    background: var(--text);
    color: white;
    font-size: var(--text-sm);
    line-height: 1.55;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 100;
    font-weight: 400;
    text-align: left;
}

.tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: var(--text);
}

.tooltip-trigger:hover .tooltip-content,
.tooltip-trigger:focus .tooltip-content {
    opacity: 1;
    visibility: visible;
}

.metric-card:nth-child(odd) .tooltip-content {
    left: 0;
    transform: translateX(0);
}

.metric-card:nth-child(odd) .tooltip-content::after {
    left: 12px;
    transform: translateX(0);
}

/* ========================================
   Insight Cards (grid-spanning)
   ======================================== */

.insight-card {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, var(--accent-light) 0%, #B2EBF2 100%);
    border: 1px solid #80DEEA;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 0.75rem;
}

.insight-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.insight-icon {
    font-size: var(--text-base);
}

.insight-label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.insight-text {
    font-size: var(--text-base);
    color: var(--text);
    font-style: italic;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.insight-author {
    font-size: var(--text-sm);
    color: var(--text-light);
    text-align: right;
}

/* ========================================
   Footer
   ======================================== */

footer {
    text-align: center;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border);
    color: var(--text-light);
    font-size: var(--text-sm);
}

footer p {
    margin-bottom: 0.25rem;
}

footer a {
    color: var(--primary);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* ========================================
   Accessibility Focus States
   ======================================== */

button:focus-visible,
input:focus-visible,
a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.tooltip-trigger:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ========================================
   Loading State
   ======================================== */

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* ========================================
   AI Summarization Styles
   ======================================== */

.ai-badge {
    background: linear-gradient(135deg, #8B5CF6, #6366F1);
    color: white;
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    margin-right: 0.5rem;
}

.ai-icon {
    color: #8B5CF6 !important;
}

.toggle-view-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: var(--text-sm);
    cursor: pointer;
    padding: 0.25rem 0;
    margin-top: 0.5rem;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.toggle-view-btn:hover {
    color: #4747a0;
}

.qualitative-original.hidden,
.qualitative-summary.hidden {
    display: none;
}

/* ========================================
   Admin Panel Styles
   ======================================== */

#admin-panel {
    background: linear-gradient(135deg, #FFF7ED, #FFEDD5);
    border: 2px solid #F97316;
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 2rem;
}

#admin-panel.hidden {
    display: none;
}

.admin-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.admin-header h3 {
    margin: 0;
    color: #C2410C;
    font-size: var(--text-base);
    font-weight: 700;
}

.admin-icon {
    width: 20px;
    height: 20px;
    color: #EA580C;
}

.admin-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.admin-info {
    flex: 1;
    min-width: 200px;
}

.admin-info p {
    margin: 0;
    font-size: var(--text-sm);
    color: #9A3412;
}

.admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #F97316;
    color: white;
    border: none;
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.admin-btn:hover:not(:disabled) {
    background: #EA580C;
}

.admin-btn:disabled {
    background: #FDBA74;
    cursor: not-allowed;
}

.admin-btn .btn-icon {
    width: 16px;
    height: 16px;
}

.admin-btn-briefing {
    background: #7C3AED;
}

.admin-btn-briefing:hover:not(:disabled) {
    background: #6D28D9;
}

.admin-btn-briefing:disabled {
    background: #C4B5FD;
}

.admin-status {
    width: 100%;
    margin: 0;
    margin-top: 0.5rem;
    font-size: var(--text-xs);
    color: #9A3412;
    font-style: italic;
}

/* ========================================
   Filter Bar Styles
   ======================================== */

.filter-bar {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.filter-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    padding: 0.5rem 0;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    transition: color 0.2s;
}

.filter-toggle:hover {
    color: var(--primary-dark);
}

.filter-toggle-icon {
    width: 18px;
    height: 18px;
}

.filter-toggle-chevron {
    width: 16px;
    height: 16px;
    margin-left: auto;
    transition: transform 0.2s ease;
}

.filter-toggle[aria-expanded="false"] .filter-toggle-chevron {
    transform: rotate(-90deg);
}

.filter-content {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease, margin 0.3s ease;
    max-height: 500px;
    opacity: 1;
    margin-top: 1rem;
}

.filter-content.collapsed {
    max-height: 0;
    opacity: 0;
    margin: 0;
    pointer-events: none;
}

.filter-search {
    position: relative;
    margin-bottom: 1rem;
}

.filter-search .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-light);
    pointer-events: none;
}

#search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    font-size: var(--text-base);
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

#search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(91, 91, 169, 0.1);
}

#search-input::placeholder {
    color: var(--text-light);
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: flex-start;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-pill {
    padding: 0.4rem 0.875rem;
    font-size: var(--text-sm);
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.filter-pill:hover {
    border-color: var(--primary-light);
    color: var(--primary);
}

.filter-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.filter-pill:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

#owner-filter {
    padding: 0.4rem 2rem 0.4rem 0.875rem;
    font-size: var(--text-sm);
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg);
    color: var(--text-secondary);
    cursor: pointer;
    appearance: none;
    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='%234b5563' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    min-width: 140px;
}

#owner-filter:hover {
    border-color: var(--primary-light);
}

#owner-filter:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(91, 91, 169, 0.1);
}

.filter-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

#filter-count {
    font-size: var(--text-sm);
    color: var(--text-light);
}

.clear-btn {
    padding: 0.375rem 0.75rem;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--primary);
    background: none;
    border: 1px solid var(--primary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.clear-btn:hover {
    background: var(--primary);
    color: white;
}

.clear-btn.hidden {
    display: none;
}

.metrics-section.section-hidden {
    display: none;
}

.metric-card.metric-hidden {
    display: none;
}

/* ========================================
   Team Insights Section
   ======================================== */

.insights-bar {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.insights-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    background: none;
    border: none;
    padding: 0.5rem 0;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
    transition: color 0.2s;
}

.insights-toggle:hover {
    color: #00838F;
}

.insights-toggle-icon {
    width: 18px;
    height: 18px;
    color: var(--accent);
}

.insights-badge {
    background: var(--accent);
    color: white;
    font-size: var(--text-xs);
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.insights-toggle-chevron {
    width: 16px;
    height: 16px;
    margin-left: auto;
    transition: transform 0.2s ease;
}

.insights-toggle[aria-expanded="false"] .insights-toggle-chevron {
    transform: rotate(-90deg);
}

.insights-content {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease, margin 0.3s ease;
    max-height: 1000px;
    opacity: 1;
    margin-top: 1rem;
}

.insights-content.collapsed {
    max-height: 0;
    opacity: 0;
    margin: 0;
    pointer-events: none;
}

.insights-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.insight-item {
    background: linear-gradient(135deg, var(--accent-light) 0%, #E0F7FA 100%);
    border: 1px solid #80DEEA;
    border-radius: 8px;
    padding: 1rem;
    transition: box-shadow 0.2s;
}

.insight-item:hover {
    box-shadow: 0 4px 12px rgba(0, 184, 212, 0.15);
}

.insight-item-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.insight-item-author {
    font-size: var(--text-xs);
    font-weight: 700;
    color: #00838F;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.insight-item-metric {
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-light);
}

.insight-item-month {
    margin-left: auto;
    font-size: var(--text-xs);
    font-weight: 600;
    color: #00838F;
    background: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.insight-item-text {
    font-size: var(--text-sm);
    color: var(--text);
    line-height: 1.55;
    font-style: italic;
    margin: 0;
}

.insight-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0, 184, 212, 0.2);
}

.insight-item-link {
    font-size: var(--text-sm);
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s;
}

.insight-item-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.insight-item-link .link-icon {
    width: 14px;
    height: 14px;
}

.insight-item .toggle-view-btn {
    font-size: var(--text-xs);
    margin: 0;
    padding: 0;
}

.insights-empty {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-light);
    font-style: italic;
}

/* ========================================
   Member Feedback Section
   ======================================== */

.member-feedback-bar {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.member-feedback-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    background: none;
    border: none;
    padding: 0.5rem 0;
    font-size: var(--text-sm);
    font-weight: 600;
    color: #D4A017;
    cursor: pointer;
    transition: color 0.2s;
}

.member-feedback-toggle:hover {
    color: #B8860B;
}

.member-feedback-toggle-icon {
    width: 18px;
    height: 18px;
    color: #D4A017;
}

.member-feedback-badge {
    background: #D4A017;
    color: white;
    font-size: var(--text-xs);
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.member-feedback-toggle-chevron {
    width: 16px;
    height: 16px;
    margin-left: auto;
    transition: transform 0.2s ease;
}

.member-feedback-toggle[aria-expanded="false"] .member-feedback-toggle-chevron {
    transform: rotate(-90deg);
}

.member-feedback-content {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease, margin 0.3s ease;
    max-height: 2000px;
    opacity: 1;
    margin-top: 1rem;
}

.member-feedback-content.collapsed {
    max-height: 0;
    opacity: 0;
    margin: 0;
    pointer-events: none;
}

.member-feedback-filters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.member-feedback-filters select {
    padding: 0.5rem 2rem 0.5rem 0.875rem;
    font-size: var(--text-sm);
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text-secondary);
    cursor: pointer;
    appearance: none;
    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='%234b5563' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    min-width: 140px;
}

.member-feedback-filters select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(91, 91, 169, 0.1);
}

.member-feedback-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
}

.comment-card {
    background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
    border: 1px solid #FCD34D;
    border-radius: 10px;
    padding: 1.25rem;
    transition: box-shadow 0.2s, transform 0.1s;
}

.comment-card:hover {
    box-shadow: 0 4px 16px rgba(212, 160, 23, 0.15);
    transform: translateY(-1px);
}

.comment-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.comment-card-rating {
    display: flex;
    gap: 2px;
}

.star {
    font-size: var(--text-base);
}

.star.filled {
    color: #D4A017;
}

.star.empty {
    color: #E5E7EB;
}

.comment-card-meta {
    text-align: right;
}

.comment-card-branch {
    font-size: var(--text-xs);
    font-weight: 600;
    color: #92400E;
    display: block;
}

.comment-card-month {
    font-size: var(--text-xs);
    color: var(--text-light);
}

.comment-card-text {
    font-size: var(--text-sm);
    color: var(--text);
    line-height: 1.55;
    margin: 0;
    font-style: italic;
}

.comment-card-text.truncated::after {
    content: '...';
}

.comment-card-expand {
    background: none;
    border: none;
    color: var(--primary);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    margin-top: 0.5rem;
    display: inline-block;
}

.comment-card-expand:hover {
    text-decoration: underline;
}

.load-more-btn {
    display: block;
    width: 100%;
    max-width: 200px;
    margin: 1.5rem auto 0;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.load-more-btn:hover {
    background: var(--primary-dark);
}

.load-more-btn.hidden {
    display: none;
}

/* ========================================
   Sticky Section Navigator
   ======================================== */

.section-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.section-nav.visible {
    transform: translateY(0);
}

.section-nav.hidden {
    display: block !important;
    transform: translateY(-100%);
}

.section-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.section-nav-pill {
    padding: 0.5rem 1rem;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.section-nav-pill:hover {
    border-color: var(--primary-light);
    color: var(--primary);
    background: white;
}

.section-nav-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ========================================
   Offline / Error States
   ======================================== */

.offline-banner {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border: 1px solid #F59E0B;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
}

.offline-banner-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.offline-banner-icon {
    width: 20px;
    height: 20px;
    color: #B45309;
    flex-shrink: 0;
}

.offline-banner-text {
    flex: 1;
    font-size: var(--text-sm);
    color: #92400E;
}

.offline-banner-text strong {
    font-weight: 700;
}

.retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: var(--text-sm);
    font-weight: 600;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}

.retry-btn:hover:not(:disabled) {
    background: var(--primary-dark);
}

.retry-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.retry-btn.loading .retry-btn-icon {
    animation: spin 1s linear infinite;
}

.retry-btn-icon {
    width: 16px;
    height: 16px;
}

.retry-btn-small {
    padding: 0.375rem 0.75rem;
    font-size: var(--text-xs);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
}

.error-state-icon {
    width: 48px;
    height: 48px;
    color: var(--danger);
    margin-bottom: 1rem;
}

.error-state-message {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text);
    margin: 0 0 0.5rem 0;
}

.error-state-detail {
    font-size: var(--text-sm);
    color: var(--text-light);
    margin: 0 0 1.5rem 0;
}

/* ========================================
   Responsive — Tablet/Mobile
   ======================================== */

@media (max-width: 768px) {
    #dashboard {
        padding: 1.5rem 1rem;
    }

    header h1 {
        font-size: var(--text-xl);
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .metric-value-hero {
        font-size: var(--text-xl);
    }

    .tooltip-content {
        width: 260px;
        left: -100px;
        transform: none;
    }

    .tooltip-content::after {
        left: 112px;
    }

    .metric-card:nth-child(odd) .tooltip-content {
        left: -10px;
    }

    .metric-card:nth-child(odd) .tooltip-content::after {
        left: 22px;
    }

    /* Charts */
    .metric-chart-container {
        height: 90px;
    }

    /* Admin */
    .admin-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-btn {
        width: 100%;
        justify-content: center;
    }

    /* Filters */
    .filter-bar {
        padding: 1rem;
    }

    .filter-row {
        flex-direction: column;
        gap: 1rem;
    }

    .filter-group {
        width: 100%;
    }

    .filter-pills {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }

    #owner-filter {
        width: 100%;
    }

    .filter-summary {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .clear-btn {
        width: 100%;
        text-align: center;
    }

    /* Insights */
    .insights-bar {
        padding: 1rem;
    }

    .insight-item-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .insight-item-month {
        margin-left: 0;
        margin-top: 0.25rem;
    }

    /* Member Feedback */
    .member-feedback-bar {
        padding: 1rem;
    }

    .member-feedback-list {
        grid-template-columns: 1fr;
    }

    .member-feedback-filters {
        flex-direction: column;
    }

    .member-feedback-filters select {
        width: 100%;
    }

    .comment-card-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .comment-card-meta {
        text-align: left;
    }

    /* Section Nav */
    .section-nav {
        position: relative;
    }

    .section-nav-inner {
        padding: 0.5rem;
        gap: 0.375rem;
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
    }

    .section-nav-pill {
        padding: 0.5rem 0.75rem;
        font-size: var(--text-xs);
        flex-shrink: 0;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Attention strip */
    .attention-card {
        min-width: 200px;
    }

    /* Scroll indicators */
    .section-nav::before,
    .section-nav::after {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        width: 24px;
        pointer-events: none;
        z-index: 10;
        opacity: 0;
        transition: opacity 0.2s ease;
    }

    .section-nav::before {
        left: 0;
        background: linear-gradient(to right, rgba(255,255,255,0.95), transparent);
    }

    .section-nav::after {
        right: 0;
        background: linear-gradient(to left, rgba(255,255,255,0.95), transparent);
    }

    .section-nav.scroll-left::before {
        opacity: 1;
    }

    .section-nav.scroll-right::after {
        opacity: 1;
    }

    /* Filter pills scroll indicators */
    .filter-group {
        position: relative;
    }

    .filter-group::before,
    .filter-group::after {
        content: '';
        position: absolute;
        top: 1.5rem;
        bottom: 0;
        width: 20px;
        pointer-events: none;
        z-index: 5;
        opacity: 0;
        transition: opacity 0.2s ease;
    }

    .filter-group::before {
        left: 0;
        background: linear-gradient(to right, var(--card-bg), transparent);
    }

    .filter-group::after {
        right: 0;
        background: linear-gradient(to left, var(--card-bg), transparent);
    }

    .filter-group.scroll-left::before {
        opacity: 1;
    }

    .filter-group.scroll-right::after {
        opacity: 1;
    }

    .filter-pill {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .executive-counts {
        flex-direction: column;
        gap: 0.5rem;
    }

    .attention-card {
        min-width: 180px;
    }
}

/* Legacy qualitative styles (kept for compatibility) */
.qualitative-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: var(--accent-light);
    border: 1px solid #80DEEA;
    border-radius: 6px;
    font-size: var(--text-xs);
    color: #00838F;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.qualitative-icon {
    width: 14px;
    height: 14px;
    stroke-width: 2;
    color: #00838F;
}

.qualitative-compact-header {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.25rem;
}

.qualitative-compact-icon {
    width: 14px;
    height: 14px;
    color: #00838F;
}

.qualitative-compact-label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: #00838F;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.qualitative-list {
    margin: 0;
    padding-left: 1.25rem;
    font-style: italic;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.5;
}

.qualitative-list li {
    margin-bottom: 0.375rem;
}

.qualitative-list li:last-child {
    margin-bottom: 0;
}

.qualitative-content {
    background: linear-gradient(135deg, var(--accent-light) 0%, #E0F7FA 100%);
    border: 1px solid #80DEEA;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.qualitative-header {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.5rem;
}

.qualitative-label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: #00838F;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.qualitative-text {
    font-size: var(--text-sm);
    color: var(--text);
    line-height: 1.55;
    font-style: italic;
    margin: 0;
}
