/* =================================================================
   INTELLIGENT MONITOR — Pivotree Design System
   Compact / smaller font scale for dense monitoring data
   ================================================================= */

@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Domine:wght@400;600;700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap");

:root {
    --pv-navy:    #001F5B;
    --pv-aqua:    #009BDE;
    --pv-green:   #3FAE2A;
    --pv-red:     #D61B5D;
    --pv-purple:  #9364CC;
    --pv-yellow:  #FFB819;

    --pv-navy-50:   #E5E9F1;
    --pv-navy-100:  #B8C0D6;
    --pv-navy-400:  #2D3F77;
    --pv-navy-600:  #001949;
    --pv-navy-700:  #001237;
    --pv-navy-800:  #000B22;

    --pv-aqua-50:  #E5F4FB;
    --pv-aqua-700: #006FA0;
    --pv-green-50: #E7F6E5;
    --pv-green-700:#2A7A1B;
    --pv-red-50:   #FBE4EC;
    --pv-red-700:  #99143F;
    --pv-purple-50:#EFE9F7;
    --pv-purple-700:#634088;
    --pv-yellow-50:#FFF5E0;
    --pv-yellow-700:#B67E10;

    --pv-white:    #FFFFFF;
    --pv-paper:    #FAFAFB;
    --pv-cloud:    #F2F3F6;
    --pv-silver:   #E4E6EC;
    --pv-mist:     #C7CBD6;
    --pv-slate:    #7B8194;
    --pv-graphite: #3F4557;
    --pv-ink:      #14162A;

    --fg1: var(--pv-ink);
    --fg2: var(--pv-graphite);
    --fg3: var(--pv-slate);
    --border-subtle: var(--pv-silver);

    --font-sans: "Montserrat", "Helvetica Neue", Arial, sans-serif;
    --font-serif: "Domine", Georgia, serif;
    --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

    /* Compact type scale — 1 size smaller than the prototype */
    --text-2xs: 0.6875rem;  /* 11px */
    --text-xs:  0.75rem;    /* 12px */
    --text-sm:  0.8125rem;  /* 13px */
    --text-base:0.875rem;   /* 14px */
    --text-md:  1rem;       /* 16px */
    --text-lg:  1.125rem;   /* 18px */
    --text-xl:  1.375rem;   /* 22px */
    --text-2xl: 1.75rem;    /* 28px */
    --text-3xl: 2rem;       /* 32px */

    --weight-regular: 400;
    --weight-medium:  500;
    --weight-semibold:600;
    --weight-bold:    700;

    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-pill: 999px;

    --shadow-xs: 0 1px 2px rgba(20,22,42,0.06);
    --shadow-sm: 0 2px 6px rgba(20,22,42,0.08);
    --shadow-md: 0 8px 24px rgba(20,22,42,0.08), 0 2px 6px rgba(20,22,42,0.06);
    --shadow-focus: 0 0 0 3px rgba(0,155,222,0.35);

    --space-1: 3px;
    --space-2: 6px;
    --space-3: 10px;
    --space-4: 14px;
    --space-5: 18px;
    --space-6: 22px;
    --space-8: 28px;

    --dur-fast: 100ms;
    --dur-base: 180ms;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    color: var(--fg1);
    background: var(--pv-paper);
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.app-container { min-height: 100vh; display: flex; flex-direction: column; }

/* Header */
.header {
    display: flex;
    align-items: center;
    padding: 0 20px;
    background: var(--pv-navy);
    gap: 20px;
    min-height: 52px;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
    min-width: 0;
    overflow: visible;
}

.brand-wordmark {
    height: 22px;
    width: auto;
    display: block;
}

.app-brand-name {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: rgba(255,255,255,0.55);
    border-left: 1px solid rgba(255,255,255,0.2);
    padding-left: 10px;
    white-space: nowrap;
}

.tenant-name-badge {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    padding: 2px 8px;
    white-space: nowrap;
}

.logo { display: flex; align-items: center; gap: 7px; }

.logo-text {
    font-size: var(--text-sm);
    font-weight: var(--weight-bold);
    color: var(--pv-white);
    letter-spacing: 0.03em;
}

.tenant-title {
    flex: 1;
    text-align: center;
    font-family: var(--font-serif);
    font-size: var(--text-lg);
    font-weight: var(--weight-bold);
    color: var(--pv-yellow);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.last-updated {
    font-size: var(--text-xs);
    color: var(--pv-navy-100);
    font-family: var(--font-mono);
}

.time-filter {
    padding: 4px 8px;
    border: 1px solid var(--pv-navy-400);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: var(--text-xs);
    background: var(--pv-navy-600);
    color: var(--pv-white);
    cursor: pointer;
}

.refresh-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: var(--pv-green);
    color: var(--pv-white);
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    cursor: pointer;
    transition: background var(--dur-base) var(--ease-out);
}

.refresh-btn:hover { background: var(--pv-green-700); }

.refresh-btn.small {
    padding: 4px 10px;
    font-size: var(--text-2xs);
}

.refresh-icon { font-size: var(--text-sm); }
.refresh-icon.spinning { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.connection-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: var(--text-xs);
    color: var(--pv-navy-100);
}

.connection-status.connected { color: var(--pv-green); }
.connection-status.error { color: var(--pv-red); }

.auth-user-badge {
    font-size: var(--text-xs);
    color: var(--pv-navy-100);
}
.auth-user-badge a { color: inherit; text-decoration: underline; }

/* Auth gate — shown instead of the dashboard when there's no session and no
   API key; matches the sign-in card used by the other JumpCloud-enabled
   Launchpad apps (navy gradient backdrop, white card, btn-secondary). */
.auth-gate {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(160deg, var(--pv-navy) 0%, var(--pv-navy-800) 100%);
}
.auth-card {
    width: 100%;
    max-width: 380px;
    background: var(--pv-white);
    border-radius: 16px;
    padding: 36px 32px;
    box-shadow: 0 20px 60px rgba(0, 11, 34, 0.35);
    text-align: center;
}
.auth-logo { display: block; height: 48px; margin: 0 auto 22px; }
.auth-card h1 { font-size: 21px; margin: 0 0 4px; color: var(--pv-navy); }
.auth-card .auth-subtitle { color: var(--pv-slate); font-size: 14px; margin: 0 0 24px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 11px 20px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.btn-secondary {
    background: var(--pv-white);
    color: var(--pv-navy);
    border-color: var(--pv-silver);
}
.btn-secondary:hover { border-color: var(--pv-aqua); text-decoration: none; }
.btn-block { width: 100%; }

/* Sidebar */
.main-layout { display: flex; flex: 1; }

.sidebar {
    width: 210px;
    background: var(--pv-white);
    border-right: 1px solid var(--border-subtle);
    padding: 12px 0;
    overflow-y: auto;
}

.nav-section { margin-bottom: 18px; }

.nav-section-title {
    display: block;
    padding: 4px 16px 6px;
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
    color: var(--fg3);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    color: var(--fg2);
    text-decoration: none;
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    transition: all var(--dur-base) var(--ease-out);
    border-left: 3px solid transparent;
}

.nav-item:hover { background: var(--pv-cloud); color: var(--pv-navy); }

.nav-item.active {
    background: var(--pv-yellow-50);
    color: var(--pv-navy);
    border-left-color: var(--pv-yellow);
    font-weight: var(--weight-semibold);
}

.nav-dot {
    width: 7px;
    height: 7px;
    background: var(--pv-mist);
    border-radius: 50%;
    flex-shrink: 0;
}

.nav-item.active .nav-dot, .nav-dot.active-dot { background: var(--pv-yellow); }

/* API Status */
.api-status-list { padding: 0 16px; }

.api-status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: var(--text-xs);
    color: var(--fg2);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 18px;
    overflow-y: auto;
    background: var(--pv-paper);
}

.view { display: none; }
.view.active { display: block; }

/* Metric Cards */
.metric-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.metric-card {
    background: var(--pv-white);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
}

.metric-card:nth-child(1)::before { background: var(--pv-aqua); }
.metric-card:nth-child(2)::before { background: var(--pv-red); }
.metric-card:nth-child(3)::before { background: var(--pv-yellow); }
.metric-card:nth-child(4)::before { background: var(--pv-green); }

.metric-label {
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
    color: var(--fg3);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.metric-value {
    font-family: var(--font-serif);
    font-size: var(--text-2xl);
    font-weight: var(--weight-bold);
    line-height: 1.1;
}

.metric-value.blue   { color: var(--pv-aqua); }
.metric-value.red    { color: var(--pv-red); }
.metric-value.yellow { color: var(--pv-yellow-700); }
.metric-value.green  { color: var(--pv-green); }
.metric-value.purple { color: var(--pv-purple); }
.metric-value.gray   { color: var(--fg3); }

.metric-sub { font-size: var(--text-2xs); color: var(--fg3); }

.metric-band {
    display: inline-block;
    font-size: var(--text-2xs);
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    margin-top: 4px;
    width: fit-content;
}
.metric-band.healthy  { background: rgba(0,180,100,0.12);  color: var(--pv-green); }
.metric-band.moderate { background: rgba(200,150,0,0.12);  color: var(--pv-yellow-700, #A87800); }
.metric-band.elevated { background: rgba(245,124,0,0.12);  color: #F57C00; }
.metric-band.critical { background: rgba(220,50,50,0.12);  color: var(--pv-red); }

.metric-justify-label {
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
    color: var(--fg3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 8px;
}

.metric-justify {
    font-size: var(--text-xs);
    color: var(--fg2);
    line-height: 1.4;
}

/* Run button inside AI Diagnosis placeholder */
.diag-run-btn {
    margin-top: 12px;
    font-size: var(--text-xs);
    padding: 7px 16px;
}

/* Diagnostics view sections */
.diag-section {
    margin-bottom: 28px;
}

.diag-section-label {
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
    color: var(--fg3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding-bottom: 8px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border-subtle);
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
}

/* Panels */
.panel {
    background: var(--pv-white);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
    margin-bottom: 18px;
}

.panel.full-width { grid-column: 1 / -1; }

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.panel-header.standalone {
    margin-bottom: 16px;
    padding: 0;
    background: none;
    box-shadow: none;
    border: none;
}

.panel-title {
    font-size: var(--text-xs);
    font-weight: var(--weight-bold);
    color: var(--pv-navy);
    display: flex;
    align-items: center;
    gap: 6px;
}

.panel-sub { font-size: var(--text-2xs); color: var(--fg3); }
.panel-timestamp { font-size: var(--text-2xs); color: var(--fg3); }

.view-title {
    font-family: var(--font-serif);
    font-size: var(--text-lg);
    font-weight: var(--weight-bold);
    color: var(--pv-navy);
}

/* Panel Filters */
.panel-filters { display: flex; align-items: center; gap: 8px; }
.panel-filters label { font-size: var(--text-xs); color: var(--fg3); }
.panel-filters select {
    padding: 4px 8px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: var(--text-xs);
    background: var(--pv-white);
}

/* Status Dots */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.status-dot.green     { background: var(--pv-green); }
.status-dot.red       { background: var(--pv-red); }
.status-dot.yellow    { background: var(--pv-yellow); }
.status-dot.blue      { background: var(--pv-aqua); }
.status-dot.purple    { background: var(--pv-purple); }
.status-dot.gray      { background: var(--pv-mist); }
.status-dot.connecting { background: var(--pv-yellow); animation: pulse 1.2s ease-in-out infinite; }

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; }

.data-table th {
    text-align: left;
    padding: 8px 10px;
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
    color: var(--fg3);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom: 2px solid var(--border-subtle);
    background: var(--pv-cloud);
    white-space: nowrap;
}

.data-table td {
    padding: 7px 10px;
    font-size: var(--text-xs);
    border-bottom: 1px solid var(--pv-silver);
    color: var(--fg1);
    vertical-align: middle;
}

.data-table tbody tr:hover { background: var(--pv-cloud); }

.loading-cell {
    padding: 20px;
    text-align: center;
    color: var(--fg3);
    font-size: var(--text-xs);
    font-style: italic;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 7px;
    border-radius: var(--radius-pill);
    font-size: var(--text-2xs);
    font-weight: var(--weight-semibold);
    white-space: nowrap;
}

.status-badge.completed, .status-badge.succeeded {
    background: var(--pv-green-50); color: var(--pv-green-700);
}
.status-badge.processing, .status-badge.running, .status-badge.queued {
    background: var(--pv-yellow-50); color: var(--pv-yellow-700);
}
.status-badge.failed, .status-badge.error {
    background: var(--pv-red-50); color: var(--pv-red-700);
}
.status-badge.waiting, .status-badge.submitted {
    background: var(--pv-aqua-50); color: var(--pv-aqua-700);
}
.status-badge.completedwitherrors {
    background: var(--pv-yellow-50); color: var(--pv-yellow-700);
}
.status-badge.completedwithnorecords {
    background: var(--pv-cloud); color: var(--fg3);
}

.status-badge::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

/* Action Buttons */
.action-btn {
    padding: 3px 8px;
    background: var(--pv-white);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xs);
    font-family: var(--font-sans);
    font-size: var(--text-2xs);
    font-weight: var(--weight-medium);
    color: var(--fg2);
    cursor: pointer;
    transition: all var(--dur-fast) var(--ease-out);
    white-space: nowrap;
}

.action-btn:hover { background: var(--pv-navy); color: var(--pv-white); border-color: var(--pv-navy); }

.action-btn.danger:hover { background: var(--pv-red); border-color: var(--pv-red); color: white; }

/* Attention List */
.attention-list { display: flex; flex-direction: column; gap: 8px; }

.attention-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    border-left: 3px solid;
}

.attention-item.critical {
    background: var(--pv-red-50);
    border-color: var(--pv-red);
}
.attention-item.warning {
    background: var(--pv-yellow-50);
    border-color: var(--pv-yellow);
}

.attention-info h4 { font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--pv-navy); }
.attention-info p  { font-size: var(--text-2xs); color: var(--fg2); margin-top: 2px; }

.view-btn {
    padding: 3px 8px;
    background: var(--pv-white);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xs);
    font-size: var(--text-2xs);
    color: var(--fg2);
    cursor: pointer;
}

.view-btn:hover { background: var(--pv-cloud); }

/* Error Summary Cards */
.error-summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.error-summary-card {
    background: var(--pv-white);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: relative;
    overflow: hidden;
}

.error-summary-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
}

.error-summary-card.critical::before { background: var(--pv-red); }
.error-summary-card.warning::before  { background: var(--pv-yellow); }
.error-summary-card.info::before     { background: var(--pv-aqua); }
.error-summary-card.resolved::before { background: var(--pv-green); }

.error-category { font-size: var(--text-2xs); font-weight: var(--weight-bold); color: var(--fg3); text-transform: uppercase; letter-spacing: 0.04em; }
.error-count { font-family: var(--font-serif); font-size: var(--text-2xl); font-weight: var(--weight-bold); }
.error-count.critical { color: var(--pv-red); }
.error-count.warning  { color: var(--pv-yellow-700); }
.error-count.info     { color: var(--pv-aqua); }
.error-count.resolved { color: var(--pv-green); }
.error-trend { font-size: var(--text-2xs); color: var(--fg3); }

/* Enhanced Error Card Styles */
.error-card-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.error-icon { font-size: 14px; opacity: 0.8; }
.error-breakdown { margin-top: 4px; }
.error-today { 
    font-size: var(--text-2xs); 
    color: var(--fg3);
    background: rgba(0,0,0,0.04);
    padding: 2px 6px;
    border-radius: var(--radius-xs);
}

/* Daily Overview Strip */
.daily-overview-strip {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    overflow-x: auto;
    padding: 4px 0;
}
.daily-strip-item {
    flex: 1;
    min-width: 100px;
    background: var(--pv-white);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}
.daily-strip-item:hover { 
    border-color: var(--pv-aqua);
    box-shadow: var(--shadow-sm);
}
.daily-strip-item.active {
    border-color: var(--pv-aqua);
    background: rgba(0, 155, 222, 0.05);
}
.daily-strip-item.today {
    border-color: var(--pv-navy);
    border-width: 2px;
}
.dsi-day { 
    font-size: var(--text-2xs); 
    font-weight: var(--weight-bold); 
    color: var(--fg3); 
    text-transform: uppercase;
    margin-bottom: 2px;
}
.dsi-date { 
    font-size: var(--text-2xs); 
    color: var(--fg3); 
    margin-bottom: 6px;
}
.dsi-counts { 
    display: flex; 
    justify-content: center; 
    gap: 8px; 
}
.dsi-count { 
    display: flex; 
    flex-direction: column; 
    align-items: center;
    font-size: var(--text-2xs);
}
.dsi-count.error { color: var(--pv-red); }
.dsi-count.warning { color: var(--pv-yellow-700); }
.dsi-count.info { color: var(--pv-aqua); }
.dsi-count-num { font-weight: var(--weight-bold); font-size: var(--text-xs); }

/* Timeline Controls */
.timeline-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}
.timeline-sort-indicator {
    font-size: var(--text-2xs);
    color: var(--fg3);
    padding: 3px 8px;
    background: var(--pv-cloud);
    border-radius: var(--radius-xs);
}
.action-btn.small {
    padding: 4px 10px;
    font-size: var(--text-2xs);
}

/* Error Timeline Grouped */
.error-timeline-grouped { display: flex; flex-direction: column; gap: 12px; }

.day-group {
    background: var(--pv-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
}
.day-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--pv-cloud);
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}
.day-group-header:hover { background: #E8EAEE; }
.day-group-header.collapsed + .day-group-events { display: none; }

.dgh-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.dgh-toggle {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--fg3);
    transition: transform 0.2s ease;
}
.day-group-header.collapsed .dgh-toggle { transform: rotate(-90deg); }
.dgh-date {
    font-weight: var(--weight-semibold);
    font-size: var(--text-xs);
    color: var(--pv-navy);
}
.dgh-date-label {
    font-size: var(--text-2xs);
    color: var(--fg3);
    margin-left: 6px;
}
.dgh-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.dgh-summary {
    display: flex;
    gap: 10px;
    font-size: var(--text-2xs);
}
.dgh-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-weight: var(--weight-semibold);
}
.dgh-badge.error { background: rgba(214, 27, 93, 0.1); color: var(--pv-red); }
.dgh-badge.warning { background: rgba(255, 184, 25, 0.15); color: var(--pv-yellow-700); }
.dgh-badge.info { background: rgba(0, 155, 222, 0.1); color: var(--pv-aqua); }
.dgh-total {
    font-size: var(--text-2xs);
    color: var(--fg3);
}

.day-group-events {
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Error Timeline */
.error-timeline { display: flex; flex-direction: column; gap: 10px; }

.error-timeline-item {
    display: flex;
    gap: 12px;
    padding: 10px 12px;
    background: var(--pv-cloud);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--pv-red);
}

.error-timeline-item.warning { border-left-color: var(--pv-yellow); }
.error-timeline-item.info    { border-left-color: var(--pv-aqua); }

.error-time {
    flex-shrink: 0;
    width: 90px;
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    color: var(--fg3);
    padding-top: 2px;
}

.error-content { flex: 1; }
.error-title {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: var(--pv-navy);
    margin-bottom: 4px;
}

.error-detail {
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    color: var(--fg2);
    background: var(--pv-white);
    padding: 6px 8px;
    border-radius: var(--radius-xs);
    margin-bottom: 5px;
    word-break: break-word;
    max-height: 60px;
    overflow: hidden;
    line-height: 1.5;
}

.error-source {
    font-size: var(--text-2xs);
    color: var(--fg3);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.error-actions { display: flex; gap: 5px; flex-shrink: 0; align-items: flex-start; }

/* Error Header with AI Fix Button */
.error-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 4px;
}

.ai-fix-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    font-size: var(--text-2xs);
    font-weight: var(--weight-medium);
    color: var(--pv-purple);
    background: var(--pv-purple-50);
    border: 1px solid var(--pv-purple-200);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--dur-fast);
    flex-shrink: 0;
}

.ai-fix-btn:hover {
    background: var(--pv-purple-100);
    border-color: var(--pv-purple);
    transform: translateY(-1px);
}

.ai-fix-btn svg {
    opacity: 0.8;
}

/* AI Modal Styles */
.ai-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
}

.ai-modal-overlay.closing {
    animation: fadeOut 0.2s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.ai-modal {
    background: var(--pv-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.ai-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    background: linear-gradient(135deg, var(--pv-purple-50), var(--pv-aqua-50));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.ai-modal-header h3 {
    margin: 0;
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
    color: var(--pv-navy);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--fg3);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color var(--dur-fast);
}

.ai-modal-close:hover {
    color: var(--pv-red);
}

.ai-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.ai-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.ai-modal-btn {
    padding: 8px 16px;
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--dur-fast);
    background: var(--pv-purple);
    color: white;
    border: none;
}

.ai-modal-btn:hover {
    background: var(--pv-purple-700);
}

/* AI Loading State */
.ai-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.ai-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--pv-purple-100);
    border-top-color: var(--pv-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

.ai-loading p {
    color: var(--fg2);
    font-size: var(--text-sm);
    margin: 0;
}

/* AI Error State */
.ai-error {
    padding: 20px;
    background: var(--pv-red-50);
    border: 1px solid var(--pv-red-200);
    border-radius: var(--radius-md);
    color: var(--pv-red-700);
}

.ai-error code {
    background: var(--pv-red-100);
    padding: 2px 6px;
    border-radius: var(--radius-xs);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
}

/* AI Suggestion Content */
.ai-suggestion {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-error-context {
    padding: 12px;
    background: var(--pv-cloud);
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    color: var(--fg2);
    border-left: 3px solid var(--pv-red);
}

.ai-suggestion-content {
    font-size: var(--text-sm);
    color: var(--fg1);
    line-height: 1.6;
}

.ai-suggestion-content strong {
    color: var(--pv-navy);
    display: block;
    margin-top: 12px;
    margin-bottom: 4px;
}

.ai-suggestion-content strong:first-child {
    margin-top: 0;
}

.ai-suggestion-content code {
    background: var(--pv-purple-50);
    color: var(--pv-purple-700);
    padding: 2px 6px;
    border-radius: var(--radius-xs);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
}

.ai-suggestion-content ul, .ai-suggestion-content ol {
    margin: 8px 0;
    padding-left: 20px;
}

.ai-suggestion-content li {
    margin: 4px 0;
}

/* AI Diagnostics Section */
.ai-diagnostics-section {
    background: linear-gradient(135deg, var(--pv-purple-50), var(--pv-aqua-50));
    border: 1px solid var(--pv-purple-200);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 18px;
}

.ai-diagnostics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.ai-diagnostics-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-diagnostics-title svg {
    color: var(--pv-purple);
}

.ai-diagnostics-title h3 {
    margin: 0;
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
    color: var(--pv-navy);
}

.ai-analyze-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: white;
    background: var(--pv-purple);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--dur-fast);
}

.ai-analyze-all-btn:hover {
    background: var(--pv-purple-700);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.ai-diagnostics-content {
    min-height: 60px;
}

.ai-diagnostics-placeholder {
    text-align: center;
    padding: 16px;
    color: var(--fg3);
    font-size: var(--text-sm);
}

.ai-diagnostics-placeholder p {
    margin: 0 0 6px 0;
}

.ai-diagnostics-placeholder .ai-hint {
    font-size: var(--text-xs);
    opacity: 0.8;
}

.ai-diagnostics-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-diagnostic-card {
    background: var(--pv-white);
    border-radius: var(--radius-md);
    padding: 14px;
    border-left: 3px solid var(--pv-purple);
}

.ai-diagnostic-card.error {
    border-left-color: var(--pv-red);
}

.ai-diagnostic-card.warning {
    border-left-color: var(--pv-yellow);
}

.ai-diagnostic-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.ai-diagnostic-title {
    font-weight: var(--weight-semibold);
    color: var(--pv-navy);
    font-size: var(--text-sm);
}

.ai-diagnostic-count {
    font-size: var(--text-2xs);
    color: var(--fg3);
    background: var(--pv-cloud);
    padding: 2px 8px;
    border-radius: var(--radius-pill);
}

.ai-diagnostic-fix {
    font-size: var(--text-xs);
    color: var(--fg2);
    line-height: 1.5;
}

.ai-diagnostic-fix strong {
    color: var(--pv-navy);
}

/* Error Groups Container */
.error-groups-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.error-group-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: var(--pv-cloud);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--pv-red);
    cursor: pointer;
    transition: all var(--dur-fast);
}

.error-group-card:hover {
    background: var(--pv-white);
    box-shadow: var(--shadow-sm);
}

.error-group-card.warning {
    border-left-color: var(--pv-yellow);
}

.error-group-card.info {
    border-left-color: var(--pv-aqua);
}

.error-group-count {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    padding: 8px;
    background: var(--pv-red-50);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.error-group-card.warning .error-group-count {
    background: var(--pv-yellow-50);
}

.error-group-card.info .error-group-count {
    background: var(--pv-aqua-50);
}

.error-group-count-num {
    font-size: var(--text-lg);
    font-weight: var(--weight-bold);
    color: var(--pv-red);
}

.error-group-card.warning .error-group-count-num {
    color: var(--pv-yellow-700);
}

.error-group-card.info .error-group-count-num {
    color: var(--pv-aqua-700);
}

.error-group-count-label {
    font-size: var(--text-2xs);
    color: var(--fg3);
}

.error-group-content {
    flex: 1;
    min-width: 0;
}

.error-group-title {
    font-weight: var(--weight-semibold);
    color: var(--pv-navy);
    font-size: var(--text-sm);
    margin-bottom: 4px;
}

.error-group-message {
    font-size: var(--text-xs);
    color: var(--fg2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
    font-family: var(--font-mono);
}

.error-group-meta {
    display: flex;
    gap: 12px;
    font-size: var(--text-2xs);
    color: var(--fg3);
}

.error-group-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.error-group-ai-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    font-size: var(--text-2xs);
    font-weight: var(--weight-medium);
    color: var(--pv-purple);
    background: var(--pv-purple-50);
    border: 1px solid var(--pv-purple-200);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--dur-fast);
}

.error-group-ai-btn:hover {
    background: var(--pv-purple-100);
    border-color: var(--pv-purple);
}

.error-group-expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    font-size: var(--text-2xs);
    color: var(--fg2);
    background: var(--pv-white);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--dur-fast);
}

.error-group-expand-btn:hover {
    background: var(--pv-cloud);
}

/* Chart Containers */
.chart-container { height: 180px; position: relative; }
.chart-container.pie-chart { display: flex; justify-content: center; align-items: center; }

/* ============================================
   SCHEDULER VIEW — Redesigned Components
   ============================================ */

/* Header Actions */
.sched-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sched-view-toggle {
    display: flex;
    background: var(--pv-cloud);
    border-radius: var(--radius-sm);
    padding: 2px;
    gap: 2px;
}

.sched-view-toggle .toggle-btn {
    padding: 5px 10px;
    background: transparent;
    border: none;
    border-radius: var(--radius-xs);
    font-size: var(--text-sm);
    color: var(--fg3);
    cursor: pointer;
    transition: all var(--dur-fast) var(--ease-out);
}

.sched-view-toggle .toggle-btn:hover {
    color: var(--pv-navy);
}

.sched-view-toggle .toggle-btn.active {
    background: var(--pv-white);
    color: var(--pv-navy);
    box-shadow: var(--shadow-xs);
}

/* Scheduler Metrics Grid */
.sched-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}

.sched-metric-card {
    background: var(--pv-white);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}

.sched-metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.sched-metric-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sched-metric-icon.blue   { background: var(--pv-aqua-50); color: var(--pv-aqua); }
.sched-metric-icon.green  { background: var(--pv-green-50); color: var(--pv-green); }
.sched-metric-icon.yellow { background: var(--pv-yellow-50); color: var(--pv-yellow-700); }
.sched-metric-icon.purple { background: var(--pv-purple-50); color: var(--pv-purple); }
.sched-metric-icon.red    { background: var(--pv-red-50); color: var(--pv-red); }

.sched-metric-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sched-metric-value {
    font-size: var(--text-xl);
    font-weight: var(--weight-bold);
    color: var(--pv-navy);
    line-height: 1.1;
}

.sched-metric-label {
    font-size: var(--text-2xs);
    color: var(--fg3);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Timeline Panel */
.sched-timeline-panel {
    margin-bottom: 18px;
    background: linear-gradient(to bottom, var(--pv-white), var(--pv-paper));
}

.sched-timeline {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 24px 16px 32px;
    overflow-x: auto;
    position: relative;
    min-height: 140px;
}

.sched-timeline::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 24px;
    right: 24px;
    height: 3px;
    background: linear-gradient(90deg, var(--pv-navy) 0%, var(--pv-aqua) 50%, var(--pv-silver) 100%);
    border-radius: 2px;
    z-index: 0;
}

.sched-timeline-loading {
    padding: 20px;
    text-align: center;
    color: var(--fg3);
    font-size: var(--text-xs);
    width: 100%;
}

/* NOW Marker - Prominent vertical line */
.sched-timeline-now {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px;
    min-width: 70px;
}

.sched-timeline-now-line {
    width: 3px;
    height: 80px;
    background: linear-gradient(to bottom, var(--pv-navy), var(--pv-aqua));
    border-radius: 2px;
    position: relative;
}

.sched-timeline-now-line::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: var(--pv-navy);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(0, 31, 91, 0.2), 0 0 12px rgba(0, 155, 222, 0.4);
    animation: nowPulse 2s ease-in-out infinite;
}

.sched-timeline-now-label {
    margin-top: 8px;
    padding: 4px 12px;
    background: var(--pv-navy);
    color: var(--pv-white);
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

@keyframes nowPulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(0, 31, 91, 0.2), 0 0 12px rgba(0, 155, 222, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(0, 31, 91, 0.1), 0 0 20px rgba(0, 155, 222, 0.6); }
}

/* Timeline Items */
.sched-timeline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 12px;
    position: relative;
    z-index: 1;
    min-width: 110px;
    cursor: pointer;
    transition: all var(--dur-base) var(--ease-out);
}

.sched-timeline-item:nth-child(odd) {
    margin-top: -50px;
}

.sched-timeline-item:nth-child(even) {
    margin-top: 50px;
}

.sched-timeline-item:nth-child(odd) .sched-timeline-content {
    order: -1;
    margin-bottom: 10px;
}

.sched-timeline-item:nth-child(even) .sched-timeline-content {
    margin-top: 10px;
}

.sched-timeline-item:hover {
    transform: scale(1.05);
}

.sched-timeline-item:hover .sched-timeline-dot {
    transform: scale(1.2);
}

.sched-timeline-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--pv-aqua);
    border: 3px solid var(--pv-white);
    box-shadow: var(--shadow-sm), 0 0 0 2px var(--pv-aqua-50);
    transition: all var(--dur-fast) var(--ease-out);
    flex-shrink: 0;
}

.sched-timeline-item.overdue .sched-timeline-dot {
    background: var(--pv-red);
    box-shadow: var(--shadow-sm), 0 0 0 2px var(--pv-red-50);
    animation: overdueGlow 1.5s ease-in-out infinite;
}

@keyframes overdueGlow {
    0%, 100% { box-shadow: var(--shadow-sm), 0 0 0 2px var(--pv-red-50); }
    50% { box-shadow: var(--shadow-sm), 0 0 8px 4px rgba(214, 27, 93, 0.3); }
}

.sched-timeline-item.soon .sched-timeline-dot {
    background: var(--pv-green);
    box-shadow: var(--shadow-sm), 0 0 0 2px var(--pv-green-50);
}

.sched-timeline-item.running .sched-timeline-dot {
    background: var(--pv-aqua);
    box-shadow: var(--shadow-sm), 0 0 0 2px var(--pv-aqua-50);
    animation: runningPulse 1.2s ease-in-out infinite;
}

@keyframes runningPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.sched-timeline-item.later .sched-timeline-dot {
    background: var(--pv-purple);
    box-shadow: var(--shadow-sm), 0 0 0 2px var(--pv-purple-50);
}

.sched-timeline-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.sched-timeline-time {
    font-size: var(--text-xs);
    font-family: var(--font-mono);
    font-weight: var(--weight-semibold);
    color: var(--pv-navy);
    white-space: nowrap;
    background: var(--pv-white);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-xs);
}

.sched-timeline-item.overdue .sched-timeline-time {
    color: var(--pv-red);
    background: var(--pv-red-50);
}

.sched-timeline-item.soon .sched-timeline-time {
    color: var(--pv-green-700);
    background: var(--pv-green-50);
}

.sched-timeline-item.running .sched-timeline-time {
    color: var(--pv-aqua-700);
    background: var(--pv-aqua-50);
}

.sched-timeline-item.running .sched-timeline-relative {
    color: var(--pv-aqua-700);
    font-weight: var(--weight-medium);
}

.sched-timeline-relative {
    font-size: var(--text-2xs);
    color: var(--fg3);
    white-space: nowrap;
}

.sched-timeline-item.overdue .sched-timeline-relative {
    color: var(--pv-red);
    font-weight: var(--weight-semibold);
}

.sched-timeline-name {
    font-size: var(--text-2xs);
    color: var(--fg2);
    font-weight: var(--weight-medium);
    text-align: center;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: var(--pv-cloud);
    padding: 2px 6px;
    border-radius: var(--radius-xs);
}

.sched-timeline-empty {
    padding: 24px;
    text-align: center;
    color: var(--fg3);
    font-size: var(--text-xs);
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.sched-timeline-empty svg {
    opacity: 0.3;
}

/* Filter Bar */
.sched-filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.sched-search-box {
    flex: 1;
    min-width: 200px;
}

.sched-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: var(--text-xs);
    background: var(--pv-white);
    transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}

.sched-search-input:focus {
    outline: none;
    border-color: var(--pv-aqua);
    box-shadow: var(--shadow-focus);
}

.sched-filters {
    display: flex;
    gap: 8px;
}

.sched-filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: var(--text-xs);
    background: var(--pv-white);
    cursor: pointer;
}

.sched-count {
    font-size: var(--text-xs);
    color: var(--fg3);
    margin-left: auto;
}

/* Scheduler Cards Container */
.sched-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 14px;
}

.sched-cards-loading {
    grid-column: 1 / -1;
    padding: 40px;
    text-align: center;
    color: var(--fg3);
    font-size: var(--text-xs);
}

.sched-cards-empty {
    grid-column: 1 / -1;
    padding: 40px;
    text-align: center;
    color: var(--fg3);
}

/* Individual Scheduler Card */
.sched-card {
    background: var(--pv-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}

.sched-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.sched-card-header {
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--pv-silver);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.sched-card-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 4px;
    flex-shrink: 0;
}

.sched-card-status.active { background: var(--pv-green); }
.sched-card-status.running { background: var(--pv-aqua); animation: runningPulse 1.2s ease-in-out infinite; }
.sched-card-status.inactive { background: var(--pv-mist); }
.sched-card-status.never-run { background: var(--pv-yellow); }
.sched-card-status.overdue { background: var(--pv-red); animation: pulse 1.5s ease-in-out infinite; }
.sched-card-status.stale { background: var(--pv-slate); }

.sched-card-info {
    flex: 1;
    min-width: 0;
}

.sched-card-name {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--pv-navy);
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sched-card-id {
    font-size: var(--text-2xs);
    font-family: var(--font-mono);
    color: var(--fg3);
}

.sched-card-badge {
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    font-size: var(--text-2xs);
    font-weight: var(--weight-semibold);
    flex-shrink: 0;
}

.sched-card-badge.active { background: var(--pv-green-50); color: var(--pv-green-700); }
.sched-card-badge.running { background: var(--pv-aqua-50); color: var(--pv-aqua-700); }
.sched-card-badge.inactive { background: var(--pv-cloud); color: var(--fg3); }
.sched-card-badge.never-run { background: var(--pv-yellow-50); color: var(--pv-yellow-700); }
.sched-card-badge.overdue { background: var(--pv-red-50); color: var(--pv-red-700); }
.sched-card-badge.stale { background: var(--pv-cloud); color: var(--pv-slate); }

.sched-card-body {
    padding: 14px 16px;
}

.sched-card-url {
    font-size: var(--text-2xs);
    font-family: var(--font-mono);
    color: var(--fg2);
    background: var(--pv-cloud);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sched-card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.sched-card-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sched-card-stat-label {
    font-size: var(--text-2xs);
    color: var(--fg3);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.sched-card-stat-value {
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    color: var(--pv-navy);
    font-family: var(--font-mono);
}

.sched-card-stat-value.highlight {
    color: var(--pv-green);
}

.sched-card-stat-value.dim {
    color: var(--fg3);
}

.sched-card-footer {
    padding: 10px 16px;
    background: var(--pv-cloud);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sched-card-history {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sched-card-history-label {
    font-size: var(--text-2xs);
    color: var(--fg3);
}

/* Improved History Sparkline */
.history-sparkline {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 20px;
}

.sparkline-bar {
    width: 4px;
    background: var(--pv-aqua);
    border-radius: 1px;
    opacity: 0.7;
    transition: opacity var(--dur-fast) var(--ease-out);
}

.sparkline-bar:hover {
    opacity: 1;
}

.sched-card-invocations {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: var(--text-2xs);
    color: var(--fg2);
}

.sched-card-invocations strong {
    color: var(--pv-purple);
    font-weight: var(--weight-semibold);
}

/* Table View Specifics */
.sched-table-container {
    overflow-x: auto;
}

.sched-data-table .status-cell {
    width: 40px;
    text-align: center;
}

/* API Health Panel */
.api-health-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.api-health-card {
    padding: 12px;
    background: var(--pv-cloud);
    border-radius: var(--radius-md);
    border-left: 3px solid;
}

.api-health-card.ok     { border-color: var(--pv-green); }
.api-health-card.error  { border-color: var(--pv-red); }

.api-health-title {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: var(--pv-navy);
    margin-bottom: 4px;
}

.api-health-detail {
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    color: var(--fg2);
}

/* Log Search */
.log-search {
    padding: 4px 10px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: var(--text-xs);
    background: var(--pv-white);
    min-width: 180px;
}

.log-search:focus {
    outline: none;
    border-color: var(--pv-aqua);
    box-shadow: var(--shadow-focus);
}

/* Skeleton loading */
.skeleton-row {
    height: 46px;
    background: linear-gradient(90deg, var(--pv-cloud) 25%, var(--pv-silver) 50%, var(--pv-cloud) 75%);
    background-size: 200% 100%;
    border-radius: var(--radius-sm);
    animation: shimmer 1.5s infinite;
    margin-bottom: 6px;
}

@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,31,91,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal {
    background: var(--pv-white);
    border-radius: var(--radius-lg);
    width: 700px;
    max-width: 95vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 { font-size: var(--text-sm); font-weight: var(--weight-bold); color: var(--pv-navy); }

.modal-close {
    background: none;
    border: none;
    font-size: var(--text-md);
    cursor: pointer;
    color: var(--fg3);
    line-height: 1;
}

.modal-body {
    padding: 16px 18px;
    overflow-y: auto;
    flex: 1;
}

.modal-error-item {
    padding: 10px 12px;
    background: var(--pv-red-50);
    border-left: 3px solid var(--pv-red);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
}

.modal-error-item .error-code {
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
    color: var(--pv-red);
    text-transform: uppercase;
    margin-bottom: 3px;
}

.modal-error-item .error-msg {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--fg1);
    word-break: break-word;
}

.modal-error-item .error-meta {
    font-size: var(--text-2xs);
    color: var(--fg3);
    margin-top: 5px;
}

.no-errors { text-align: center; padding: 20px; color: var(--pv-green); font-size: var(--text-sm); }

/* Activity Calendar */
.activity-calendar { width: 100%; }

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cal-day-header {
    text-align: center;
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
    color: var(--fg3);
    padding: 4px 0;
    letter-spacing: 0.04em;
}

.cal-day {
    min-height: 62px;
    border-radius: var(--radius-sm);
    background: var(--pv-cloud);
    border: 1px solid var(--border-subtle);
    padding: 4px 5px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    cursor: default;
    transition: border-color var(--dur-fast);
}

.cal-day:hover { border-color: var(--pv-aqua); }

.cal-day.today { border-color: var(--pv-yellow); background: var(--pv-yellow-50); }

.cal-day.empty { background: transparent; border-color: transparent; }

/* Health state backgrounds */
.cal-day--good    { background: #edf7eb; border-color: #b8e0b2; }
.cal-day--bad     { background: #fdeef4; border-color: #f3b3ca; }
.cal-day--warning { background: #fff8e8; border-color: #ffe2a8; }

.cal-day-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.cal-health {
    font-size: 10px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cal-health.good { background: var(--pv-green); color: white; }
.cal-health.bad  { background: var(--pv-red);   color: white; }
.cal-health.warn { background: var(--pv-yellow); color: var(--pv-ink); }

.cal-day-num {
    font-size: var(--text-2xs);
    font-weight: var(--weight-semibold);
    color: var(--fg2);
    line-height: 1;
}

.cal-day.today .cal-day-num { color: var(--pv-yellow-700); font-weight: var(--weight-bold); }

.cal-bars { display: flex; flex-direction: column; gap: 2px; flex: 1; justify-content: flex-end; }

.cal-bar {
    height: 5px;
    border-radius: 2px;
    min-width: 4px;
    max-width: 100%;
}

.cal-bar.tasks    { background: var(--pv-aqua); }
.cal-bar.sched    { background: var(--pv-green); }
.cal-bar.errors   { background: var(--pv-red); }

.cal-counts {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.cal-pill {
    font-size: 9px;
    font-weight: 600;
    padding: 1px 4px;
    border-radius: 999px;
    line-height: 1.4;
}

.cal-pill.tasks  { background: var(--pv-aqua-50); color: var(--pv-aqua-700); }
.cal-pill.sched  { background: var(--pv-green-50); color: var(--pv-green-700); }
.cal-pill.errors { background: var(--pv-red-50); color: var(--pv-red-700); }

/* Responsive */
@media (max-width: 1100px) {
    .metric-cards, .error-summary-cards { grid-template-columns: repeat(2, 1fr); }
    .content-grid { grid-template-columns: 1fr; }
    .sched-metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .sched-cards-container { grid-template-columns: 1fr; }
    .sched-filter-bar { flex-direction: column; align-items: stretch; }
    .sched-filters { flex-wrap: wrap; }
    .sched-count { margin-left: 0; margin-top: 8px; }
}

@media (max-width: 768px) {
    .sched-metrics-grid { grid-template-columns: 1fr; }
    .sched-metric-card { padding: 12px 14px; }
    .sched-metric-icon { width: 38px; height: 38px; }
    .sched-timeline { overflow-x: scroll; padding-bottom: 8px; }
    .sched-card-stats { grid-template-columns: 1fr; gap: 8px; }
}

/* Processing badge (matches health check app's "N processing" pill) */
.processing-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    background: var(--pv-yellow-50);
    border: 1px solid var(--pv-yellow);
    border-radius: 99px;
    font-size: var(--text-2xs);
    font-weight: var(--weight-semibold);
    color: var(--pv-yellow-700);
}

.processing-badge .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--pv-yellow);
    animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(0.8); }
}

/* AI Diagnosis panel */
.ai-diagnosis-placeholder {
    padding: 18px;
    color: var(--fg2);
    font-size: var(--text-xs);
    line-height: 1.6;
}

.diagnosis-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 14px;
}

.diagnosis-overall-score {
    font-family: var(--font-sans);
    font-size: 2.4rem;
    font-weight: var(--weight-bold);
    line-height: 1;
}

.diagnosis-risk-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 99px;
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.diagnosis-risk-pill.risk-healthy  { background: var(--pv-green-50);  color: var(--pv-green-700); }
.diagnosis-risk-pill.risk-moderate { background: var(--pv-yellow-50); color: var(--pv-yellow-700); }
.diagnosis-risk-pill.risk-elevated { background: color-mix(in srgb, var(--pv-orange, #F57C00) 12%, transparent); color: var(--pv-orange, #F57C00); }
.diagnosis-risk-pill.risk-critical { background: var(--pv-red-50);    color: var(--pv-red-700); }

.diagnosis-summary {
    padding: 0 18px 12px;
    font-size: var(--text-xs);
    color: var(--fg1);
    line-height: 1.7;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 12px;
}

.diagnosis-section-label {
    padding: 0 18px 6px;
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--fg3);
}

.diagnosis-issues {
    margin: 0 18px 14px;
    padding-left: 18px;
    font-size: var(--text-xs);
    color: var(--fg2);
    line-height: 1.8;
}

.diagnosis-action {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0 18px 14px;
    padding: 10px 14px;
    background: var(--pv-aqua-50);
    border-left: 3px solid var(--pv-aqua);
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    color: var(--fg1);
}

.diagnosis-action-label {
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
    color: var(--pv-aqua-700);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.diagnosis-findings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    padding: 0 18px 14px;
}

.diagnosis-finding {
    padding: 10px 12px;
    background: var(--pv-cloud);
    border-radius: var(--radius-md);
    border-left: 3px solid;
}
.diagnosis-finding.risk-healthy  { border-color: var(--pv-green); }
.diagnosis-finding.risk-moderate { border-color: var(--pv-yellow); }
.diagnosis-finding.risk-elevated { border-color: #F57C00; }
.diagnosis-finding.risk-critical { border-color: var(--pv-red); }

.diagnosis-finding-label {
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
    text-transform: uppercase;
    color: var(--fg3);
    margin-bottom: 4px;
}

.diagnosis-finding-score {
    font-size: var(--text-md);
    font-weight: var(--weight-bold);
}

.diagnosis-finding-desc {
    font-size: var(--text-2xs);
    color: var(--fg3);
    margin-top: 3px;
}

/* =================================================================
   REDESIGNED OVERVIEW — Additional Styles
   ================================================================= */

/* Health Strip */
.health-strip {
    background: var(--pv-navy);
    border-radius: var(--radius-lg);
    padding: 12px 18px;
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.health-strip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.health-strip-title {
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.health-strip-link {
    font-size: var(--text-2xs);
    color: var(--pv-aqua);
    text-decoration: none;
    font-weight: var(--weight-medium);
}

.health-strip-link:hover { text-decoration: underline; }

.health-scores-row {
    display: flex;
    gap: 16px;
    align-items: center;
}

.health-score-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    min-width: 70px;
}

.hsm-value {
    font-family: var(--font-serif);
    font-size: var(--text-md);
    font-weight: var(--weight-bold);
    color: var(--pv-white);
}

.hsm-value.healthy  { color: var(--pv-green); }
.hsm-value.moderate { color: var(--pv-yellow); }
.hsm-value.elevated { color: #F57C00; }
.hsm-value.critical { color: var(--pv-red); }

.hsm-label {
    font-size: var(--text-2xs);
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.health-score-overall {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 20px;
    background: var(--pv-aqua);
    border-radius: var(--radius-md);
    margin-left: auto;
}

.hso-value {
    font-family: var(--font-serif);
    font-size: var(--text-xl);
    font-weight: var(--weight-bold);
    color: var(--pv-white);
}

.hso-label {
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
    color: rgba(255,255,255,0.85);
    letter-spacing: 0.06em;
}

/* 6-column metric cards */
.metric-cards.metric-cards-6 {
    grid-template-columns: repeat(6, 1fr);
}

/* 7-column metric cards */
.metric-cards.metric-cards-7 {
    grid-template-columns: repeat(7, 1fr);
}

/* Grouped metric cards layout */
.metric-groups {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    align-items: stretch;
}

.metric-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Tasks group takes more space since it has 4 cards */
.metric-group:first-child {
    flex: 4;
}

/* Single-card groups share remaining space equally */
.metric-group:not(:first-child) {
    flex: 1;
}

.metric-group-label {
    font-size: var(--text-2xs);
    font-weight: var(--weight-semibold);
    color: var(--fg3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-left: 12px;
}

.metric-group-cards {
    display: flex;
    gap: 10px;
    flex: 1;
    padding-left: 10px;
}

.metric-group-cards .metric-card {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

/* Colored left border for groups */
.metric-group:nth-child(1) .metric-group-cards {
    border-left: 3px solid var(--pv-aqua);
}

.metric-group:nth-child(2) .metric-group-cards {
    border-left: 3px solid var(--pv-purple);
}

.metric-group:nth-child(3) .metric-group-cards {
    border-left: 3px solid var(--pv-yellow);
}

.metric-group:nth-child(4) .metric-group-cards {
    border-left: 3px solid var(--pv-green);
}

.metric-card.clickable {
    cursor: pointer;
    transition: transform var(--dur-fast), box-shadow var(--dur-fast);
}

.metric-card.clickable:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Additional metric card colors */
.metric-card:nth-child(5)::before { background: var(--pv-purple); }
.metric-card:nth-child(6)::before { background: var(--pv-slate); }

/* 3-column content grid */
.content-grid.content-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* 2-column content grid */
.content-grid.content-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

/* 4-column content grid */
.content-grid.content-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Anomaly badge */
.anomaly-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: var(--pv-red-50);
    color: var(--pv-red);
    font-size: var(--text-2xs);
    font-weight: var(--weight-semibold);
    border-radius: var(--radius-pill);
    animation: anomaly-pulse 2s ease-in-out infinite;
}

@keyframes anomaly-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ML Anomaly Detection feature grid */
.ml-feature-grid {
    display: grid;
    gap: 6px;
}

.ml-feature-row {
    display: grid;
    grid-template-columns: 180px 40px 1fr 52px;
    align-items: center;
    gap: 10px;
    padding: 5px 8px;
    border-radius: var(--radius-sm);
}

.ml-feature-highlight {
    background: var(--pv-red-50, rgba(214, 27, 93, 0.06));
}

.ml-feature-label {
    font-size: var(--text-xs);
    color: var(--fg1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ml-feature-val {
    font-size: var(--text-xs);
    color: var(--fg2);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.ml-feature-bar-track {
    background: var(--border);
    border-radius: 4px;
    height: 5px;
    overflow: hidden;
}

.ml-feature-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
    min-width: 2px;
}

.ml-feature-dev {
    font-size: var(--text-2xs);
    font-variant-numeric: tabular-nums;
    text-align: right;
    font-weight: var(--weight-semibold);
}

/* Compact lists */
.attention-list.compact {
    max-height: 140px;
    overflow-y: auto;
}

.attention-list.compact .attention-item {
    padding: 6px 8px;
    font-size: var(--text-2xs);
}

.upcoming-schedules.compact {
    max-height: 140px;
}

.upcoming-schedules.compact .schedule-item {
    padding: 4px 0;
}

/* Panel link */
.panel-link {
    font-size: var(--text-2xs);
    color: var(--pv-aqua);
    text-decoration: none;
    font-weight: var(--weight-medium);
}

.panel-link:hover { text-decoration: underline; }

/* Section Headers */
.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    margin-top: 8px;
}

.section-title {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--fg2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-title::after {
    content: "";
    display: inline-block;
    height: 1px;
    background: var(--border-subtle);
    margin-left: 12px;
    flex: 1;
    min-width: 40px;
}

/* Recent Activity Lists */
.recent-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
}

.recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: var(--pv-cloud);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--pv-aqua);
    font-size: var(--text-xs);
}

.recent-item.error {
    border-left-color: var(--pv-red);
}

.recent-item.success {
    border-left-color: var(--pv-green);
}

.recent-item.warning {
    border-left-color: var(--pv-yellow);
}

.recent-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.recent-item-title {
    font-weight: var(--weight-medium);
    color: var(--fg1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-item-sub {
    font-size: var(--text-2xs);
    color: var(--fg3);
}

.recent-item-time {
    font-size: var(--text-2xs);
    color: var(--fg3);
    white-space: nowrap;
}

.recent-item-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    margin-left: 8px;
    flex-shrink: 0;
}

.recent-item-meta .status-badge {
    font-size: var(--text-2xs);
    padding: 2px 6px;
}

.recent-list-empty {
    padding: 20px;
    text-align: center;
    color: var(--fg3);
    font-size: var(--text-xs);
}

/* Upcoming Schedules */
.upcoming-schedules {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
}

.schedule-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: var(--pv-cloud);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--pv-purple);
}

.schedule-item-name {
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    color: var(--pv-navy);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.schedule-item-time {
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    color: var(--fg3);
    white-space: nowrap;
}

/* Error Breakdown Mini */
.error-breakdown-mini {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.ebm-item {
    flex: 1;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    text-align: center;
}

.ebm-item.critical { background: var(--pv-red-50); }
.ebm-item.warning  { background: var(--pv-yellow-50); }
.ebm-item.info     { background: var(--pv-aqua-50); }

.ebm-count {
    display: block;
    font-family: var(--font-serif);
    font-size: var(--text-md);
    font-weight: var(--weight-bold);
}

.ebm-item.critical .ebm-count { color: var(--pv-red); }
.ebm-item.warning .ebm-count  { color: var(--pv-yellow-700); }
.ebm-item.info .ebm-count     { color: var(--pv-aqua-700); }

.ebm-label {
    font-size: var(--text-2xs);
    color: var(--fg3);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Recent Errors Mini */
.recent-errors-mini {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 110px;
    overflow-y: auto;
}

.error-mini-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: var(--pv-cloud);
    border-radius: var(--radius-xs);
    font-size: var(--text-2xs);
}

.error-mini-item .emi-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.error-mini-item.error .emi-dot   { background: var(--pv-red); }
.error-mini-item.warning .emi-dot { background: var(--pv-yellow); }
.error-mini-item.info .emi-dot    { background: var(--pv-aqua); }

.error-mini-item .emi-text {
    flex: 1;
    color: var(--fg2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.error-mini-item .emi-time {
    color: var(--fg3);
    font-family: var(--font-mono);
    flex-shrink: 0;
}

/* Task Type Pills */
.task-type-pill {
    display: inline-flex;
    padding: 2px 6px;
    background: var(--pv-aqua-50);
    color: var(--pv-aqua-700);
    border-radius: var(--radius-xs);
    font-size: var(--text-2xs);
    font-weight: var(--weight-medium);
    white-space: nowrap;
}

/* Responsive for 6 columns */
@media (max-width: 1400px) {
    .metric-cards.metric-cards-6 { grid-template-columns: repeat(3, 1fr); }
    .metric-cards.metric-cards-7 { grid-template-columns: repeat(4, 1fr); }
    .content-grid.content-grid-3 { grid-template-columns: 1fr 1fr; }
    .content-grid.content-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1100px) {
    .metric-cards.metric-cards-6 { grid-template-columns: repeat(2, 1fr); }
    .metric-cards.metric-cards-7 { grid-template-columns: repeat(2, 1fr); }
    .content-grid.content-grid-2 { grid-template-columns: 1fr; }
    .content-grid.content-grid-3 { grid-template-columns: 1fr; }
    .content-grid.content-grid-4 { grid-template-columns: 1fr; }
    .health-scores-row { flex-wrap: wrap; }
    .health-score-overall { margin-left: 0; margin-top: 8px; }
    .metric-groups { flex-wrap: wrap; }
    .metric-group:first-child { flex-basis: 100%; }
    .metric-group:not(:first-child) { flex: 1; min-width: 140px; }
}

@media (max-width: 768px) {
    .metric-groups { flex-direction: column; }
    .metric-group { flex-basis: auto !important; }
}

/* =================================================================
   Settings View
   ================================================================= */

.settings-panels-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    align-items: start;
}

@media (max-width: 1200px) {
    .settings-panels-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .settings-panels-grid {
        grid-template-columns: 1fr;
    }
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    padding-top: var(--space-4);
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
}

.settings-hint {
    width: 100%;
    font-size: var(--text-2xs);
    color: var(--fg3);
    padding-left: 0;
    margin-top: -4px;
}

.settings-row label {
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--fg2);
    flex: 0 0 140px;
}

.settings-input {
    flex: 1;
    min-width: 0;
    padding: 5px 10px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--fg1);
    background: var(--pv-white);
    text-align: right;
}

.settings-input:focus {
    outline: none;
    border-color: var(--pv-aqua);
    box-shadow: var(--shadow-focus);
}

.settings-actions {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding-top: var(--space-2);
}

.settings-save-status {
    font-size: var(--text-xs);
    color: var(--pv-green);
}

/* =================================================================
   Error Decoder — Human-Readable Error Interpretation
   ================================================================= */

.error-decoder-content {
    min-height: 100px;
}

.error-decoder-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.error-decoder-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.6;
}

.error-decoder-empty h4 {
    font-size: var(--text-md);
    font-weight: var(--weight-semibold);
    color: var(--pv-green);
    margin-bottom: 6px;
}

.error-decoder-empty p {
    font-size: var(--text-xs);
    color: var(--fg3);
}

.error-decoder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 14px;
}

.decoded-error-card {
    background: var(--pv-cloud);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    border-left: 4px solid var(--pv-slate);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.decoded-error-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Category-based border colors */
.decoded-error-card.category-configuration { border-left-color: var(--pv-purple); }
.decoded-error-card.category-data-quality  { border-left-color: var(--pv-red); }
.decoded-error-card.category-integration   { border-left-color: var(--pv-aqua); }
.decoded-error-card.category-processing    { border-left-color: var(--pv-yellow); }
.decoded-error-card.category-system        { border-left-color: var(--pv-slate); }
.decoded-error-card.category-security      { border-left-color: #E91E63; }
.decoded-error-card.category-performance   { border-left-color: #FF9800; }
.decoded-error-card.category-general       { border-left-color: var(--pv-mist); }

.decoded-error-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.decoded-error-icon {
    font-size: 18px;
}

.decoded-error-type {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: var(--pv-navy);
}

.decoded-error-time {
    font-size: var(--text-2xs);
    color: var(--fg3);
    font-family: var(--font-mono);
    margin-left: auto;
}

.decoded-error-message {
    margin-bottom: 10px;
    padding: 8px 10px;
    background: var(--pv-white);
    border-radius: var(--radius-xs);
    border-left: 3px solid var(--pv-red);
}

.decoded-error-rule-name {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: var(--text-xs);
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.decoded-error-rule-name strong {
    color: var(--fg1);
    font-weight: var(--weight-medium);
    white-space: nowrap;
}

.rule-name-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.rule-name-chip {
    display: inline-block;
    padding: 1px 7px;
    background: var(--pv-purple-100, #ede9fe);
    color: var(--pv-purple-700, #6d28d9);
    border-radius: 10px;
    font-size: var(--text-2xs);
    font-weight: var(--weight-medium);
    font-family: var(--font-mono);
    white-space: nowrap;
}

.rule-name-chip.more {
    background: var(--bg2);
    color: var(--fg2);
}

.decoded-error-message code {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--fg1);
    word-break: break-word;
    white-space: pre-wrap;
}

.decoded-error-explanation,
.decoded-error-suggestion {
    font-size: var(--text-xs);
    line-height: 1.5;
    margin-bottom: 6px;
    color: var(--fg2);
}

/* AI loading shimmer while waiting for generated text */
.decoded-error-explanation.ai-loading .ai-text,
.decoded-error-suggestion.ai-loading .ai-text {
    display: inline-block;
    background: linear-gradient(90deg, var(--border) 25%, var(--bg2) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: ai-shimmer 1.4s infinite;
    border-radius: 3px;
    color: transparent;
    min-width: 160px;
    height: 0.9em;
    vertical-align: middle;
}

@keyframes ai-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.decoded-error-explanation strong,
.decoded-error-suggestion strong {
    color: var(--fg1);
    font-weight: var(--weight-medium);
}

.decoded-error-suggestion {
    color: var(--pv-green-700);
    margin-bottom: 0;
}

.decoded-error-actions {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.swarm-card-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.swarm-card-link {
    font-size: var(--text-3xs, 10px);
    color: var(--pv-aqua);
    text-decoration: none;
    white-space: nowrap;
}

.swarm-card-link:hover {
    text-decoration: underline;
}

.swarm-card-link code {
    font-size: inherit;
    opacity: 0.8;
}

.swarm-card-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 99px;
    font-size: var(--text-3xs, 10px);
    font-weight: var(--weight-semibold);
    white-space: nowrap;
}

.swarm-card-status-badge.status-processing {
    background: color-mix(in srgb, var(--pv-aqua) 15%, transparent);
    color: var(--pv-aqua);
    border: 1px solid color-mix(in srgb, var(--pv-aqua) 30%, transparent);
}

.swarm-card-status-badge.status-completed {
    background: color-mix(in srgb, var(--pv-green) 15%, transparent);
    color: var(--pv-green);
    border: 1px solid color-mix(in srgb, var(--pv-green) 30%, transparent);
}

.swarm-card-status-badge.status-error {
    background: color-mix(in srgb, var(--pv-red) 15%, transparent);
    color: var(--pv-red);
    border: 1px solid color-mix(in srgb, var(--pv-red) 30%, transparent);
}

.swarm-card-status-badge.status-warning {
    background: color-mix(in srgb, var(--pv-orange) 15%, transparent);
    color: var(--pv-orange);
    border: 1px solid color-mix(in srgb, var(--pv-orange) 30%, transparent);
}

@keyframes swarm-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.55; }
}

.swarm-card-status-badge.pulse {
    animation: swarm-pulse 1.8s ease-in-out infinite;
}

.swarm-ai-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--pv-navy);
    color: var(--pv-white);
    border: none;
    border-radius: var(--radius-xs);
    font-size: var(--text-2xs);
    font-weight: var(--weight-semibold);
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    white-space: nowrap;
}

.swarm-ai-btn:hover {
    background: var(--pv-aqua);
    color: var(--pv-navy);
}

.swarm-ai-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.required-asterisk {
    color: var(--pv-red);
    font-weight: var(--weight-bold);
    margin-left: 2px;
}

.swarm-file-hint {
    font-size: var(--text-3xs, 10px);
    color: var(--pv-orange);
    margin-top: 4px;
}

/* Swarm AI preview modal */
.swarm-preview {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.swarm-preview-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.swarm-preview-label {
    font-size: var(--text-2xs);
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fg3);
}

.swarm-preview-value {
    font-size: var(--text-xs);
    color: var(--fg1);
    line-height: 1.5;
}

.swarm-preview-value code {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    word-break: break-word;
    white-space: pre-wrap;
}

.swarm-preview-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-top: 4px;
    border-top: 1px solid var(--border-subtle);
}

.swarm-file-upload-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.swarm-file-btn {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: var(--bg2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xs);
    font-size: var(--text-xs);
    color: var(--fg2);
    white-space: nowrap;
}

.swarm-file-btn:hover { border-color: var(--pv-aqua); color: var(--pv-aqua); }

.swarm-file-names {
    font-size: var(--text-2xs);
    color: var(--fg3);
    font-style: italic;
}

/* Rule name inline inside message box */
.decoded-error-rule-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}

/* Swarm AI Tasks panel */
.swarm-tasks-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 4px 0;
}

.swarm-task-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg2);
    border: 1px solid var(--border-subtle);
    flex-wrap: wrap;
}

.swarm-task-row.swarm-task-active {
    border-left: 3px solid var(--pv-aqua);
}

.swarm-task-main {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.swarm-task-type {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: var(--fg1);
}

.swarm-task-agent,
.swarm-task-agents {
    font-size: var(--text-2xs);
    color: var(--fg3);
}

.swarm-task-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.swarm-task-time {
    font-size: var(--text-2xs);
    color: var(--fg3);
}

.swarm-task-id {
    font-size: var(--text-2xs);
    color: var(--fg3);
    font-family: var(--font-mono);
}

.swarm-task-link {
    font-size: var(--text-2xs);
    color: var(--pv-aqua);
    text-decoration: none;
}

.swarm-task-link:hover { text-decoration: underline; }

.decoded-error-raw {
    margin-top: 10px;
    font-size: var(--text-2xs);
}

.decoded-error-raw summary {
    cursor: pointer;
    color: var(--fg3);
    font-weight: var(--weight-medium);
    padding: 4px 0;
}

.decoded-error-raw summary:hover {
    color: var(--pv-aqua);
}

.decoded-error-raw code {
    display: block;
    margin-top: 6px;
    padding: 8px 10px;
    background: var(--pv-white);
    border-radius: var(--radius-xs);
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    color: var(--fg2);
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 80px;
    overflow-y: auto;
}

/* Error Patterns List */
.error-patterns-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
}

.error-pattern-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    background: var(--pv-cloud);
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}

.error-pattern-item:hover {
    background: var(--pv-silver);
}

.pattern-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pattern-icon {
    font-size: 16px;
}

.pattern-title {
    flex: 1;
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    color: var(--pv-navy);
}

.pattern-count {
    font-size: var(--text-sm);
    font-weight: var(--weight-bold);
    color: var(--pv-red);
    background: var(--pv-red-50);
    padding: 2px 8px;
    border-radius: var(--radius-pill);
}

.pattern-meta {
    display: flex;
    gap: 12px;
    font-size: var(--text-2xs);
    color: var(--fg3);
}

.pattern-meta span {
    display: flex;
    align-items: center;
    gap: 3px;
}

/* Quick Fixes List */
.quick-fixes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
}

.quick-fix-item {
    padding: 12px 14px;
    background: var(--pv-cloud);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--pv-aqua);
}

.quick-fix-item.priority-high {
    border-left-color: var(--pv-red);
    background: var(--pv-red-50);
}

.quick-fix-item.priority-medium {
    border-left-color: var(--pv-yellow);
    background: var(--pv-yellow-50);
}

.quick-fix-item.priority-low {
    border-left-color: var(--pv-green);
    background: var(--pv-green-50);
}

.fix-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.fix-icon {
    font-size: 16px;
}

.fix-title {
    flex: 1;
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: var(--pv-navy);
}

.fix-priority {
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
    padding: 2px 6px;
    border-radius: var(--radius-xs);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.quick-fix-item.priority-high .fix-priority {
    background: var(--pv-red);
    color: var(--pv-white);
}

.quick-fix-item.priority-medium .fix-priority {
    background: var(--pv-yellow);
    color: var(--pv-navy);
}

.quick-fix-item.priority-low .fix-priority {
    background: var(--pv-green);
    color: var(--pv-white);
}

.fix-description {
    font-size: var(--text-xs);
    color: var(--fg2);
    margin-bottom: 6px;
}

.fix-action {
    font-size: var(--text-xs);
    color: var(--pv-aqua-700);
    font-weight: var(--weight-medium);
}

/* Grouped Error Decoder Enhancements */
.decoded-error-count {
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
    padding: 2px 8px;
    background: var(--pv-red);
    color: var(--pv-white);
    border-radius: var(--radius-pill);
}

.decoded-error-entities,
.decoded-error-rules {
    font-size: var(--text-xs);
    color: var(--fg2);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-subtle);
}

.decoded-error-entities strong,
.decoded-error-rules strong {
    color: var(--fg1);
    font-weight: var(--weight-medium);
}

.entity-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.entity-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    background: var(--pv-white);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xs);
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    color: var(--fg2);
    cursor: default;
}

.entity-chip:hover {
    background: var(--pv-aqua-50);
    border-color: var(--pv-aqua);
}

.entity-chip.more {
    background: var(--pv-cloud);
    color: var(--fg3);
    font-family: var(--font-sans);
    font-weight: var(--weight-medium);
}

.raw-messages {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.raw-messages code {
    display: block;
    padding: 6px 8px;
    background: var(--pv-white);
    border-radius: var(--radius-xs);
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    color: var(--fg2);
    white-space: pre-wrap;
    word-break: break-all;
    border-left: 2px solid var(--pv-mist);
}

/* Responsive adjustments for error decoder */
@media (max-width: 900px) {
    .error-decoder-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------------------------------------------------------------------------
   Notifications view
   --------------------------------------------------------------------------- */

.notif-smtp-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--text-sm);
    color: var(--fg2);
    padding: 4px 0;
}

.notif-smtp-status code {
    background: var(--bg3);
    padding: 1px 5px;
    border-radius: var(--radius-xs);
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    color: var(--fg1);
}

.notif-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.notif-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--text-sm);
    color: var(--fg1);
    cursor: pointer;
    user-select: none;
}

.notif-checkbox-label.notif-disabled {
    opacity: 0.5;
    cursor: default;
}

.notif-checkbox-label input[type="checkbox"] {
    accent-color: var(--pv-blue);
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.notif-loading {
    color: var(--fg3);
    font-size: var(--text-sm);
}

.notif-subscriber-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 10px;
    background: var(--bg2);
    transition: box-shadow 0.15s;
}

.notif-subscriber-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.notif-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.notif-card-identity {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notif-email {
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--fg1);
}

.notif-name {
    font-size: var(--text-xs);
    color: var(--fg3);
}

.notif-card-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.notif-card-types {
    margin-top: 8px;
    font-size: var(--text-xs);
    color: var(--fg2);
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.notif-types-label {
    color: var(--fg3);
    white-space: nowrap;
}

.notif-types-value {
    color: var(--fg2);
}

.notif-card-edit {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.notif-edit-btn {
    background: none;
    border: none;
    color: var(--pv-blue);
    font-size: var(--text-xs);
    cursor: pointer;
    padding: 4px 0;
    margin-top: 6px;
    opacity: 0.7;
}

.notif-edit-btn:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Active alerts panel */
.alert-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-subtle);
}
.alert-row:last-child { border-bottom: 0; }

.alert-sev-badge {
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fff;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    min-width: 64px;
    text-align: center;
    flex-shrink: 0;
}
.alert-sev-critical { background: var(--pv-red); }
.alert-sev-warning  { background: var(--pv-yellow); color: #5a3a00; }

.alert-body { flex: 1; min-width: 0; }
.alert-label {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--fg);
}
.alert-detail {
    font-size: var(--text-xs);
    color: var(--fg3);
    margin-top: 2px;
}

.alert-notif-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    flex-shrink: 0;
}
.alert-notif-badge {
    font-size: var(--text-2xs);
    font-weight: var(--weight-semibold);
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}
.notif-sent    { background: var(--pv-green-50); color: var(--pv-green-700); }
.notif-pending { background: var(--pv-cloud);    color: var(--fg3); }
.alert-notif-time {
    font-size: var(--text-2xs);
    color: var(--fg3);
}

.alert-empty {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 24px 16px;
    color: var(--fg3);
    font-size: var(--text-sm);
}
.alert-empty-icon {
    font-size: 18px;
    color: var(--pv-green);
    font-weight: var(--weight-bold);
}

.action-btn.danger {
    color: var(--pv-red);
    border-color: var(--pv-red);
    opacity: 0.8;
}

.action-btn.danger:hover {
    background: var(--pv-red);
    color: white;
    opacity: 1;
}

