/* SitePulse Dashboard — Custom Styles */

/* Terminal output panel */
.terminal {
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
    scrollbar-width: thin;
    scrollbar-color: #475569 #0F172A;
}

.terminal::-webkit-scrollbar {
    width: 6px;
}
.terminal::-webkit-scrollbar-track {
    background: #0F172A;
}
.terminal::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 3px;
}

/* Task card hover */
.task-card {
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.task-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Button disabled state */
button:disabled {
    cursor: not-allowed;
}

/* Smooth transitions */
a, button {
    transition: all 0.15s ease;
}

/* ─── KPI Dashboard Cards ──────────────────────────────────── */

.kpi-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.kpi-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}
.kpi-value {
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.2;
}
.kpi-label {
    font-size: 0.75rem;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}
.kpi-sub {
    font-size: 0.75rem;
    color: #94A3B8;
    margin-top: 0.375rem;
}
.kpi-trend-up { color: #10B981; }
.kpi-trend-down { color: #EF4444; }

/* ─── Parsed Terminal Output ───────────────────────────────── */

.terminal .line-success { color: #34D399; }
.terminal .line-error   { color: #F87171; font-weight: 600; }
.terminal .line-warning { color: #FBBF24; }
.terminal .line-info    { color: #60A5FA; }
.terminal .line-sep     { color: #475569; opacity: 0.6; }
.terminal .line-metric  { color: #E2E8F0; }
.terminal .line-metric .metric-key { color: #94A3B8; }
.terminal .line-metric .metric-val { color: #F1F5F9; font-weight: 600; }

/* Summary card after task run */
.run-summary {
    background: #1E293B;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-left: 3px solid #2563EB;
}
.run-summary.success { border-left-color: #10B981; }
.run-summary.failure { border-left-color: #EF4444; }
.run-summary .summary-kv {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    padding: 0.125rem 0;
}
.run-summary .summary-kv .sk { color: #94A3B8; }
.run-summary .summary-kv .sv { color: #F1F5F9; font-weight: 500; }

/* ─── Overdue Badge ────────────────────────────────────────── */

.overdue-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.625rem;
    font-weight: 600;
    color: #EF4444;
    background: #FEF2F2;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.overdue-dot {
    width: 6px;
    height: 6px;
    background: #EF4444;
    border-radius: 50%;
    animation: pulse-dot 1.5s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ─── Report Preview Table ─────────────────────────────────── */

.preview-table {
    width: 100%;
    font-size: 0.75rem;
    border-collapse: collapse;
}
.preview-table th {
    background: #F8FAFC;
    color: #64748B;
    text-align: left;
    padding: 0.375rem 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.625rem;
    border-bottom: 1px solid #E2E8F0;
    white-space: nowrap;
}
.preview-table td {
    padding: 0.375rem 0.5rem;
    border-bottom: 1px solid #F1F5F9;
    color: #334155;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.preview-table tr:hover td {
    background: #F8FAFC;
}

/* Summary stats bar for reports */
.stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.6875rem;
    background: #F1F5F9;
    color: #475569;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    white-space: nowrap;
}
.stat-pill .stat-val { font-weight: 600; color: #0F172A; }

/* Chart container */
.kpi-chart-container {
    position: relative;
    width: 80px;
    height: 80px;
}

/* ─── History Table ───────────────────────────────────────── */

.history-table {
    width: 100%;
    font-size: 0.8125rem;
    border-collapse: separate;
    border-spacing: 0;
}
.history-table thead th {
    background: #F8FAFC;
    color: #64748B;
    font-weight: 600;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.625rem 0.75rem;
    text-align: left;
    border-bottom: 2px solid #E2E8F0;
    position: sticky;
    top: 0;
    z-index: 1;
}
.history-table tbody td {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid #F1F5F9;
    color: #334155;
    vertical-align: middle;
}
.history-table tbody tr:hover td {
    background: #F8FAFC;
}

/* Status badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
}
.status-badge.success {
    color: #059669;
    background: #ECFDF5;
}
.status-badge.warning {
    color: #D97706;
    background: #FFFBEB;
}
.status-badge.failure {
    color: #DC2626;
    background: #FEF2F2;
}

/* Duration badge */
.duration-badge {
    font-size: 0.6875rem;
    color: #64748B;
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', monospace;
}

/* ─── Schedule Timeline ──────────────────────────────────── */

.timeline-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #F1F5F9;
}
.timeline-item:last-child {
    border-bottom: none;
}
.timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.timeline-dot.overdue { background: #EF4444; }
.timeline-dot.upcoming { background: #FBBF24; }
.timeline-dot.on-track { background: #10B981; }
.timeline-dot.never { background: #D1D5DB; }

.timeline-bar {
    height: 4px;
    border-radius: 2px;
    background: #E2E8F0;
    flex-grow: 1;
    position: relative;
    min-width: 40px;
    max-width: 120px;
}
.timeline-bar .bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* ─── Trend Chart Containers ────────────────────────────── */

.trend-chart-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.trend-chart-card h3 {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #0F172A;
    margin-bottom: 0.75rem;
}
.trend-chart-container {
    position: relative;
    height: 180px;
}

/* ─── Task Filter Tabs ──────────────────────────────────── */

.filter-tab {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    color: #64748B;
    background: #F1F5F9;
}
.filter-tab:hover {
    background: #E2E8F0;
    color: #334155;
}
.filter-tab.active {
    background: #2563EB;
    color: white;
}
.filter-tab .tab-count {
    margin-left: 0.375rem;
    font-size: 0.625rem;
    opacity: 0.7;
}

/* ─── Comparison Page ────────────────────────────────────── */

.compare-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    text-align: center;
}
.compare-val {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}
.compare-label {
    font-size: 0.6875rem;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}
.compare-sub {
    font-size: 0.75rem;
    color: #94A3B8;
    margin-top: 0.25rem;
}
.compare-select {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    border: 1px solid #E2E8F0;
    border-radius: 0.5rem;
    background: white;
    color: #0F172A;
}
.compare-select:focus {
    outline: none;
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.compare-chart-container {
    position: relative;
    height: 220px;
}

/* Grade Distribution Bars */
.grade-bar-track {
    flex-grow: 1;
    height: 8px;
    border-radius: 4px;
    background: #F1F5F9;
    overflow: hidden;
}
.grade-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}
.grade-bar-fill.before {
    background: #CBD5E1;
}
.grade-bar-fill.after {
    background: #2563EB;
}

/* ─── Leaderboard ────────────────────────────────────────── */

.podium-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.8125rem;
    font-weight: 700;
    flex-shrink: 0;
}
.podium-rank.gold {
    background: linear-gradient(135deg, #FDE68A, #F59E0B);
    color: #78350F;
}
.podium-rank.silver {
    background: linear-gradient(135deg, #E5E7EB, #9CA3AF);
    color: #374151;
}
.podium-rank.bronze {
    background: linear-gradient(135deg, #FED7AA, #EA580C);
    color: #7C2D12;
}

.lb-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.6875rem;
    font-weight: 600;
    background: #F1F5F9;
    color: #64748B;
}
.lb-rank.top-3 {
    background: #FEF3C7;
    color: #92400E;
}

.health-score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 700;
}
.health-score-badge.inline {
    min-width: 28px;
    height: 28px;
    font-size: 0.75rem;
    border-radius: 0.375rem;
}
.health-score-badge.excellent {
    background: #ECFDF5;
    color: #059669;
}
.health-score-badge.good {
    background: #EFF6FF;
    color: #2563EB;
}
.health-score-badge.fair {
    background: #FFFBEB;
    color: #D97706;
}
.health-score-badge.poor {
    background: #FEF2F2;
    color: #DC2626;
}

.lb-stat {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}
.lb-stat-label {
    color: #94A3B8;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.lb-stat-value {
    font-size: 0.875rem;
    font-weight: 600;
}

/* ─── Email Preview ──────────────────────────────────────── */

.email-preview-frame {
    border: 1px solid #E2E8F0;
    border-radius: 0.5rem;
    overflow: hidden;
}

/* ─── Client Results Dashboard ──────────────────────────────── */

/* Hero strip */
.hero-strip {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    background: linear-gradient(135deg, #0F172A 0%, #1E3A5F 60%, #1E40AF 100%);
    border-radius: 1rem;
    padding: 1.75rem 2rem;
    color: white;
}
.hero-strip-inner {}
.hero-eyebrow {
    font-size: 1rem;
    color: #CBD5E1;
    margin-bottom: 0.375rem;
}
.hero-eyebrow strong {
    color: white;
}
.hero-tagline {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}
.hero-admin-badge {
    background: rgba(255,255,255,0.12);
    color: #94A3B8;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    border: 1px solid rgba(255,255,255,0.15);
    flex-shrink: 0;
    margin-top: 0.25rem;
}

/* Impact cards */
.impact-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.impact-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}
.impact-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}
.impact-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748B;
}
.impact-delta {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
    margin: 0.25rem 0 0.125rem;
}
.impact-delta-up    { color: #10B981; }
.impact-delta-down  { color: #EF4444; }
.impact-delta-neutral { color: #94A3B8; font-size: 1rem; font-weight: 500; }
.impact-sub {
    font-size: 0.75rem;
    color: #94A3B8;
    margin-top: 0.25rem;
    min-height: 1.5rem;
}

/* Impact progress bars */
.impact-bar-track {
    height: 6px;
    background: #F1F5F9;
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}
.impact-bar-baseline {
    position: absolute;
    left: 0; top: 0; height: 100%;
    background: #CBD5E1;
    border-radius: 3px;
    transition: width 0.6s ease;
}
.impact-bar-current {
    position: absolute;
    left: 0; top: 0; height: 100%;
    background: #2563EB;
    border-radius: 3px;
    transition: width 0.6s ease;
}
.impact-bar-current.impact-bar-red {
    background: #EF4444;
}
.impact-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.625rem;
    color: #94A3B8;
    margin-top: 0.25rem;
}

/* Monthly timeline */
.timeline-entry {
    transition: background 0.1s;
}
.timeline-entry:hover {
    background: #F8FAFC;
}

/* Health panel */
.health-panel-card {
    background: white;
    border-radius: 0.875rem;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.health-panel-icon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.health-panel-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748B;
}
.health-panel-value {
    font-size: 1rem;
    font-weight: 700;
    color: #0F172A;
}
.health-panel-sub {
    font-size: 0.75rem;
    color: #94A3B8;
}
.health-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.health-dot-green { background: #10B981; }
.health-dot-amber { background: #F59E0B; }
.health-dot-red   { background: #EF4444; }
.health-dot-gray  { background: #CBD5E1; }
