/* 
 * APIs Hub | Global Design System 🪐
 * Premium Dark Theme & Refined Glassmorphism Transitions.
 */

:root {
    --bg-dark: #0d1117;
    --bg-card: #161b22;
    --bg-accent: #21262d;
    --primary: #58a6ff;
    --primary-glow: rgba(88, 166, 255, 0.15);
    --secondary: #238636;
    --secondary-glow: rgba(35, 134, 54, 0.15);
    --text-main: #c9d1d9;
    --text-dim: #8b949e;
    --border: #30363d;
    --danger: #f85149;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-mono: 'Fira Code', -apple-system, BlinkMacSystemFont, monospace;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

main { max-width: 1400px; margin: 0 auto; padding: 40px 20px; }
body.full-screen main { max-width: none; padding: 20px 40px; }

/* Typography & Headers */
.section-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 30px; display: flex; align-items: center; gap: 12px; color: #fff; }

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    transition: var(--transition);
}

.card .section-title.small { font-size: 1rem; border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 15px; }

/* Form Elements */
input, select, textarea {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-main);
    padding: 10px 14px;
    font-size: 0.9rem;
    transition: var(--transition);
    outline: none;
}

input[type="date"], input[type="datetime-local"], .flatpickr-input, input[readonly] { 
    cursor: pointer !important; 
    padding-right: 10px;
}

input[type="date"]::-webkit-calendar-picker-indicator, 
input[type="datetime-local"]::-webkit-calendar-picker-indicator { 
    filter: invert(1) brightness(0.6);
    cursor: pointer;
    opacity: 0.6;
    transition: var(--transition);
}

input[type="date"]::-webkit-calendar-picker-indicator:hover, 
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover { 
    filter: invert(1) brightness(1);
    opacity: 1;
}



input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    background: rgba(88,166,255,0.05);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

select option {
    background-color: var(--bg-card);
    color: var(--text-main);
}

/* Switches */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--bg-accent); transition: .4s; border-radius: 24px; border: 1px solid var(--border); }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: var(--text-dim); transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--primary-glow); border-color: var(--primary); }
input:checked + .slider:before { transform: translateX(20px); background-color: var(--primary); }

.switch-mini { position: relative; display: inline-block; width: 34px; height: 18px; cursor: pointer; }
.switch-mini input { opacity: 0; width: 0; height: 0; }
.slider-mini { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(255,255,255,0.05); transition: .4s; border-radius: 18px; border: 1px solid var(--border); }
.slider-mini:before { position: absolute; content: ""; height: 12px; width: 12px; left: 2px; bottom: 2px; background-color: var(--text-dim); transition: .4s; border-radius: 50%; }
input:checked + .slider-mini { background-color: var(--primary-glow); border-color: var(--primary); }
input:checked + .slider-mini:before { transform: translateX(16px); background-color: var(--primary); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--bg-accent); color: var(--text-main); border: 1px solid var(--border); padding: 10px 20px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 0.9rem; transition: var(--transition); }
.btn:hover { background: #30363d; border-color: #484f58; transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; border: none; }

.btn-mini { background: var(--bg-accent); border: 1px solid var(--border); border-radius: 8px; padding: 4px; cursor: pointer; color: var(--text-dim); transition: var(--transition); }
.btn-mini:hover { color: #fff; border-color: var(--primary); }

.explore-btn, .dim-btn, .next-btn, .btn-expand, [onclick] { cursor: pointer; }

/* Tab System */
.tab-nav { display: flex; gap: 10px; margin-bottom: 30px; border-bottom: 1px solid var(--border); padding-bottom: 10px; overflow-x: auto; }
.tab { padding: 12px 24px; cursor: pointer; border-radius: 10px; font-size: 0.9rem; color: var(--text-dim); transition: all 0.2s; white-space: nowrap; display: flex; align-items: center; gap: 8px; margin-bottom: -11px; }
.tab.active { background: var(--bg-card); color: var(--primary); font-weight: 600; border: 1px solid var(--border); border-bottom-color: var(--bg-card); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Grid Layouts */
.settings-horizontal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; margin-bottom: 20px; }
.compact-card { padding: 20px; display: flex; flex-direction: column; min-height: 120px; }

.marketing-split-layout { display: grid; grid-template-columns: 67% 33%; gap: 20px; margin-top: 20px; }
@media (max-width: 1024px) { .marketing-split-layout { grid-template-columns: 1fr; } }

.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.asset-grid.three-cols { grid-template-columns: repeat(3, 1fr); }
.asset-grid.compact { grid-template-columns: 1fr; max-height: 480px; overflow-y: auto; padding-right: 5px; }

.asset-item { background: rgba(255,255,255,0.02); border: 1px solid var(--border); border-radius: 12px; padding: 12px; transition: var(--transition); position: relative; overflow: hidden; }
.asset-item.synced { border-color: var(--secondary); background: rgba(35, 134, 54, 0.05); }

.asset-item.is-new { border-color: var(--primary); background: rgba(88, 166, 255, 0.05); }
.asset-item.is-new::after { content: 'NEW'; position: absolute; top: 0; right: 0; background: var(--primary); color: #fff; font-size: 0.5rem; font-weight: 800; padding: 2px 6px; border-bottom-left-radius: 6px; }

.asset-item.lost-access { border-color: var(--danger); background: rgba(248, 81, 73, 0.05); opacity: 0.8; }
.asset-item.lost-access::after { content: 'LOST ACCESS'; position: absolute; top: 0; right: 0; background: var(--danger); color: #fff; font-size: 0.5rem; font-weight: 800; padding: 2px 6px; border-bottom-left-radius: 6px; }

.asset-text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hierarchy Indicator */
.granularity-compact-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.level-indicator {
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    color: var(--text-dim);
}
.level-indicator i { display: flex; }
.level-indicator.active { background: var(--primary-glow); border-color: var(--primary); color: var(--primary); }
.level-indicator.inactive { opacity: 0.3; }

/* Rule System */
.rule-item-grid { display: grid; grid-template-columns: repeat(3, 1fr) 24px; gap: 8px; background: rgba(0,0,0,0.2); padding: 8px; border-radius: 10px; margin-bottom: 8px; align-items: center; }
.rule-group-label { font-size: 0.6rem; color: var(--text-dim); margin-bottom: 2px; font-weight: bold; text-transform: uppercase; }

.metric-config-grid { display: grid; grid-template-columns: 1fr; gap: 15px; }
.metric-config-card { background: rgba(255,255,255,0.02); border: 1px solid var(--border); border-radius: 14px; padding: 15px; opacity: 0.6; transition: var(--transition); }
.metric-config-card.active { opacity: 1; border-color: var(--primary); }

.strategy-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-accent);
    border-radius: 10px;
    border: 1px solid var(--border);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
}
.strategy-option input { width: 14px; height: 14px; margin: 0; }

/* Global Utilities */
.status-badge-inline { display: none; padding: 6px 12px; background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 8px; font-size: 0.75rem; font-weight: 600; }
.btn-save-fixed { position: fixed; bottom: 30px; right: 30px; z-index: 1000; padding: 12px 30px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); background: var(--primary); color: #fff; border: none; border-radius: 15px; font-weight: 700; cursor: pointer; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--bg-accent); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border); }

.empty-state { padding: 40px; text-align: center; color: var(--text-dim); background: rgba(0,0,0,0.1); border-radius: 12px; border: 1px dashed var(--border); }
.loading-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.8); display: none; flex-direction: column; align-items: center; justify-content: center; z-index: 10000; backdrop-filter: blur(5px); }
.spinner { width: 30px; height: 30px; border: 3px solid var(--bg-accent); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Status Indicators */
.dot-indicator { width: 8px; height: 8px; border-radius: 50%; display: inline-block; position: relative; }
.dot-online { background: var(--secondary); box-shadow: 0 0 10px var(--secondary); }
.dot-online::after {
    content: '';
    position: absolute;
    width: 100%; height: 100%;
    border-radius: 50%;
    border: 1px solid var(--secondary);
    animation: status-pulse 2s infinite;
}

@keyframes status-pulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(3); opacity: 0; }
}

.mini-badge { display: flex; align-items: center; gap: 4px; font-size: 0.65rem; font-weight: 600; padding: 2px 6px; border-radius: 4px; background: rgba(255,255,255,0.03); border: 1px solid var(--border); }
.job-mini-stats { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

.level-indicator-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    border: 1px solid var(--border);
    color: var(--text-dim);
    transition: var(--transition);
    cursor: default;
}

.level-indicator-dot.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

.level-indicator-dot.inactive {
    opacity: 0.3;
}

.disabled-btn {
    opacity: 0.2;
    cursor: not-allowed !important;
    filter: grayscale(1);
}

/* Performance Badges */
.badge-excellent { background: rgba(63, 185, 80, 0.15); color: #3fb950; padding: 2px 6px; border-radius: 6px; border: 1px solid rgba(63, 185, 80, 0.3); font-weight: 700; font-size: 0.65rem; }
.badge-good { background: rgba(56, 139, 253, 0.15); color: #58a6ff; padding: 2px 6px; border-radius: 6px; border: 1px solid rgba(56, 139, 253, 0.3); font-weight: 700; font-size: 0.65rem; }
.badge-average { background: rgba(210, 153, 34, 0.15); color: #d29922; padding: 2px 6px; border-radius: 6px; border: 1px solid rgba(210, 153, 34, 0.3); font-weight: 700; font-size: 0.65rem; }
.badge-bad { background: rgba(248, 81, 73, 0.15); color: #f85149; padding: 2px 6px; border-radius: 6px; border: 1px solid rgba(248, 81, 73, 0.3); font-weight: 700; font-size: 0.65rem; }

/* Sparkline Presentation */
.sparkline-inline {
    width: 80px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 5px;
}

.spark-loading {
    width: 14px;
    height: 14px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    opacity: 0.5;
}


/* Table Refinement */
table { width: 100%; border-collapse: collapse; margin-bottom: 20px; table-layout: auto; }
th { text-align: left; padding: 10px 15px; border-bottom: 1px solid var(--border); font-size: 0.65rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 800; }
td { padding: 10px 15px; border-bottom: 1px solid var(--border); font-size: 0.8rem; vertical-align: middle; }
.account-cell, .campaign-cell { word-break: break-word; white-space: normal; line-height: 1.3; }
.nested-table { margin: 0; background: rgba(0,0,0,0.15); }
.nested-table th { background: rgba(0,0,0,0.2); }

/* Flatpickr Premium Dark Theme */
.flatpickr-calendar { background: var(--bg-card) !important; color: var(--text-main) !important; border: 1px solid var(--border) !important; box-shadow: 0 10px 40px rgba(0,0,0,0.5) !important; backdrop-filter: blur(10px); border-radius: 14px !important; margin-top: 5px; }
.flatpickr-calendar:before, .flatpickr-calendar:after { border-bottom-color: var(--border) !important; }
.flatpickr-month { color: #fff !important; fill: #fff !important; }
.flatpickr-current-month { font-weight: 700 !important; }
.flatpickr-weekday { color: var(--text-dim) !important; font-weight: 700 !important; font-size: 0.7rem !important; }
.flatpickr-day { color: var(--text-main) !important; border-radius: 8px !important; }
.flatpickr-day:hover { background: var(--bg-accent) !important; border-color: var(--border) !important; }
.flatpickr-day.today { border: 1px solid var(--primary) !important; color: var(--primary) !important; background: var(--primary-glow) !important; }
.flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange { background: var(--primary) !important; border-color: var(--primary) !important; color: #fff !important; box-shadow: 0 0 15px var(--primary-glow) !important; }
.flatpickr-day.flatpickr-disabled { color: rgba(255,255,255,0.05) !important; pointer-events: none; }
.flatpickr-months .flatpickr-prev-month, .flatpickr-months .flatpickr-next-month { fill: var(--text-dim) !important; }
.flatpickr-months .flatpickr-prev-month:hover, .flatpickr-months .flatpickr-next-month:hover { fill: #fff !important; }

/* Report View Specific Styles */
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 30px; }
.card-stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; text-align: center; transition: var(--transition); }
.card-stat:hover { transform: translateY(-2px); border-color: var(--primary); }
.stat-label { font-size: 0.75rem; font-weight: 600; color: var(--text-dim); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.stat-value { font-size: 1.75rem; font-weight: 700; color: #fff; }

.report-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 25px; margin-bottom: 30px; }
.table-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; padding-bottom: 15px; border-bottom: 1px solid var(--border); }
.table-title { font-size: 1.1rem; font-weight: 600; display: flex; align-items: center; gap: 10px; }

.btn-expand { background: rgba(88, 166, 255, 0.1); border: 1px solid rgba(88, 166, 255, 0.2); color: var(--primary); padding: 6px; border-radius: 6px; cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; }
.btn-expand:hover { background: var(--primary); color: #fff; transform: scale(1.1); }
.btn-expand.active { background: var(--primary); color: #fff; box-shadow: 0 0 10px var(--primary-glow); }

.next-btn { color: #8b5cf6; background: rgba(139, 92, 246, 0.1); border-color: rgba(139, 92, 246, 0.2); }
.next-btn:hover, .next-btn.active { background: #8b5cf6; }
.dim-btn { color: #1877F2; background: rgba(24, 119, 242, 0.1); border-color: rgba(24, 119, 242, 0.2); }
.dim-btn:hover, .dim-btn.active { background: #1877F2; }

.nested-container { padding: 25px; border-left: 3px solid var(--primary); margin: 10px 0 20px 20px; border-radius: 0 12px 12px 0; background: rgba(255, 255, 255, 0.01); }
.breakdown-title { font-size: 0.9rem; font-weight: 600; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; color: var(--text-main); }

.controls-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 15px 25px; margin-bottom: 25px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }

.loader-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; height: 100vh; background: rgba(10, 12, 16, 0.8); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 1000; flex-direction: column; gap: 20px; }
.spinner { width: 40px; height: 40px; border: 3px solid rgba(88, 166, 255, 0.1); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.badge-excellent-text { color: #3fb950; font-weight: 700; text-shadow: 0 0 10px rgba(63, 185, 80, 0.3); }
.badge-bad-text { color: #f85149; }

#cache-badge { background: rgba(88, 166, 255, 0.1); color: var(--primary); padding: 4px 8px; border-radius: 4px; margin-right: 15px; border: 1px solid rgba(88, 166, 255, 0.2); font-weight: 600; font-size: 0.7rem; display: inline-flex; align-items: center; gap: 5px; }
#empty-msg i { width: 48px; height: 48px; margin-bottom: 15px; opacity: 0.3; }

/* Utilities */
.meta-blue-icon { color: #1877F2; }
.loader-text { color: var(--primary); font-weight: 500; letter-spacing: 1px; }
.control-icon { width: 18px; color: var(--text-dim); }
.date-separator { color: var(--text-dim); }
.table-meta { font-size: 0.8rem; color: var(--text-dim); display: flex; align-items: center; }
.table-scroll-area { overflow-x: auto; }
.text-center { text-align: center !important; }

/* Fixed Table column classes */
.col-actions { width: 85px; border-right: 1px solid var(--border); text-align: center; }
.col-account { width: 150px; min-width: 150px; }
.col-campaign { width: 250px; min-width: 250px; }
.col-status { width: 80px; text-align: center; }

/* Flex & Alignment Utilities */
.header-flex { display: flex; justify-content: flex-start; align-items: center; gap: 8px; }
.header-flex-end { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.metric-flex-end { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.btn-group-center { display: flex; gap: 4px; justify-content: center; align-items: center; height: 100%; }
.cell-no-padding { padding: 0 !important; }

/* Interactivity Utilities */
.clickable { cursor: pointer; }
.clickable-text { color: var(--meta-blue); font-weight: 600; cursor: pointer; }
.clickable-text:hover { text-decoration: underline; }
.disabled-btn { opacity: 0.2; cursor: not-allowed !important; pointer-events: none; }

/* Status Badges */
.status-badge { font-size: 0.5rem; font-weight: 800; padding: 2px 6px; border-radius: 4px; text-transform: uppercase; border: 1px solid transparent; }
.badge-scheduled { background: rgba(245, 158, 11, 0.1); color: #f59e0b; border-color: rgba(245, 158, 11, 0.2); }
.badge-processing { background: var(--primary-glow); color: var(--primary); border-color: rgba(88, 166, 255, 0.2); }
.badge-failed { background: rgba(248, 81, 73, 0.1); color: var(--danger); border-color: rgba(248, 81, 73, 0.2); }
.badge-completed { background: var(--secondary-glow); color: #4ade80; border-color: rgba(35, 134, 54, 0.2); }
.badge-cancelled { background: rgba(255, 255, 255, 0.05); color: #8b949e; border-color: rgba(255, 255, 255, 0.1); }

.job-history-dots { display: flex; gap: 4px; margin-top: 10px; align-items: center; border-top: 1px dotted rgba(255,255,255,0.05); padding-top: 10px; }
.history-dot { width: 8px; height: 8px; border-radius: 50%; opacity: 0.8; transition: transform 0.2s; }
.history-dot:hover { transform: scale(1.4); opacity: 1; outline: 2px solid #fff; }

/* Status Dot Colors */
.dot-1, .dot-scheduled { background: #f59e0b; }
.dot-2, .dot-processing { background: var(--primary); }
.dot-3, .dot-completed { background: #4ade80; }
.dot-4, .dot-failed { background: var(--danger); }
.dot-5, .dot-delayed { background: #8b949e; }
.dot-6, .dot-cancelled { background: #f0883e; }
.dot-unknown { background: #333; }


/* Dashboard Specific Utilities */
.channel-pill-label { font-size: 0.6rem; color: var(--text-dim); display: block; text-transform: uppercase; }
.channel-pill-value { font-size: 0.9rem; }
.entity-breakdown-list { display: flex; flex-direction: column; gap: 4px; }

/* Job Queues */
.job-sync-window { display: flex; align-items: center; gap: 4px; }
.window-label { font-size: 0.6rem; color: var(--text-dim); font-weight: 700; letter-spacing: 0.05em; margin-right: 4px; }
.window-value { font-size: 0.75rem; color: var(--primary); font-family: var(--font-mono); font-weight: 600; }
/* Modal & Interactive Dialogs */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; z-index: 20000; }
.modal-content { background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px; width: 90%; max-width: 500px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); animation: modalIn 0.3s ease-out; overflow: hidden; }
@keyframes modalIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal-header { padding: 20px 25px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: rgba(255, 255, 255, 0.02); }
.modal-header h3 { margin: 0; font-size: 1rem; font-weight: 800; color: #fff; letter-spacing: -0.01em; }
.modal-close { background: none; border: none; color: var(--text-dim); font-size: 1.5rem; cursor: pointer; line-height: 1; transition: var(--transition); }
.modal-close:hover { color: #fff; transform: rotate(90deg); }

.modal-body { padding: 25px; color: var(--text-dim); font-size: 0.9rem; line-height: 1.6; }
.modal-footer { padding: 20px 25px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 12px; background: rgba(255, 255, 255, 0.02); }

/* Custom Checkboxes */
.checkbox-container { display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; margin-bottom: 15px; padding: 12px; background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border); border-radius: 12px; transition: var(--transition); }
.checkbox-container:hover { background: rgba(255, 255, 255, 0.05); border-color: var(--primary); }
.checkbox-container input { display: none; }
.checkmark { width: 22px; height: 22px; background: rgba(255, 255, 255, 0.05); border: 2px solid var(--border); border-radius: 6px; position: relative; transition: var(--transition); }
.checkbox-container input:checked ~ .checkmark { background: var(--primary); border-color: var(--primary); }
.checkmark:after { content: ""; position: absolute; display: none; left: 7px; top: 3px; width: 5px; height: 10px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.checkbox-container input:checked ~ .checkmark:after { display: block; }

.modal-info-box { padding: 15px; background: rgba(88, 166, 255, 0.05); border-left: 4px solid var(--primary); border-radius: 8px; margin-bottom: 20px; }
.modal-info-label { font-size: 0.65rem; color: var(--primary); font-weight: 800; text-transform: uppercase; margin-bottom: 4px; }
.modal-info-value { font-size: 0.85rem; color: #fff; font-weight: 600; }

/* Job Card Diagnostics (High-Fidelity) */
.job-metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 15px 0; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 15px; }
.job-metric-label { font-size: 0.6rem; color: var(--text-dim); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; display: block; margin-bottom: 4px; }
.job-metric-value { font-size: 0.8rem; color: #fff; font-weight: 700; font-family: var(--font-mono); }
.job-metric-value.highlight { color: var(--primary); }

.job-section-label { font-size: 0.65rem; color: var(--text-dim); font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; margin: 15px 0 8px 0; display: block; }
.job-box { background: rgba(0, 0, 0, 0.2); border: 1px solid rgba(255,255,255,0.05); border-radius: 8px; padding: 12px; font-size: 0.8rem; line-height: 1.4; color: #fff; }
.job-status-box { font-weight: 600; }
.job-payload-box { font-family: var(--font-mono); background: rgba(0, 0, 0, 0.4); color: #4ade80; font-size: 0.75rem; white-space: pre-wrap; word-break: break-all; }

.job-header-flex { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,0.03); padding-bottom: 12px; margin-bottom: 15px; }
.job-title-path { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 0.95rem; color: var(--secondary); }
.job-path-sep { color: var(--text-dim); opacity: 0.4; font-weight: 400; font-size: 0.8rem; }
.job-entity-name { color: var(--primary); }
.job-id-tag { background: rgba(255,255,255,0.05); padding: 2px 6px; border-radius: 4px; color: var(--text-dim); font-size: 0.7rem; font-family: var(--font-mono); font-weight: 400; }

/* Collapsible States */
.pipeline-card { padding: 0 !important; cursor: pointer; transition: var(--transition); overflow: hidden; }
.pipeline-card:hover { border-color: rgba(255,255,255,0.15); background: rgba(255,255,255,0.03); }
.job-summary-header { padding: 15px 20px; display: flex; align-items: center; justify-content: space-between; position: relative; }
.job-summary-left { display: flex; align-items: center; gap: 12px; }
.job-summary-right { display: flex; align-items: center; gap: 15px; text-align: right; }
.job-summary-title { font-weight: 800; font-size: 0.9rem; color: #fff; letter-spacing: 0.02em; }
.job-latest-activity { font-size: 0.7rem; color: var(--text-dim); display: block; }

.job-details-pane { padding: 20px; border-top: 1px solid rgba(255,255,255,0.05); background: rgba(0, 0, 0, 0.1); display: none; }
.pipeline-card.expanded .job-details-pane { display: block; }
.pipeline-card.expanded .summary-chevron { transform: rotate(180deg); }
.summary-chevron { transition: var(--transition); color: var(--text-dim); }

.clickable:hover { background: rgba(255,255,255,0.03); }
.sort-icon, .nested-sort-icon { font-size: 0.7rem; opacity: 0.3; transition: all 0.2s; margin-left: 4px; }
.clickable:hover .sort-icon, .clickable:hover .nested-sort-icon { opacity: 0.7; }
th.clickable { user-select: none; }
th.clickable:active { background: rgba(255,255,255,0.1); }



