/* ==========================================================================
   GuinRank V7 — YouTube Evergreen Score & Content Durability Engine
   File: wwwroot/style/pages/youtube/evergreen-score.css
   Standards: Zero-Scroll Trap Modal, 100% Theme Variables, Quantum Tooltips
   ========================================================================== */

/* --- Container & Ambient Atmosphere --- */
.evergreen-container {
    max-width: 1360px;
    margin: 0 auto;
    padding: 24px 20px 80px;
    position: relative;
    transition: max-width 0.3s ease;
}

.evergreen-container.is-wide-mode {
    max-width: 100% !important;
    width: 100% !important;
}

[v-cloak] {
    display: none !important;
}

/* --- Global Lucide SVG alignment & sizing --- */
#evergreen-score-app svg.lucide {
    width: 1em;
    height: 1em;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

.hero-ambient-glow {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 720px;
    height: 340px;
    background: radial-gradient(circle, color-mix(in srgb, var(--primary-color) 16%, transparent) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    filter: blur(50px);
}

/* --- 1. Presentation Hero (console-hero) --- */
.console-hero {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 880px;
    margin: 0 auto 32px;
    padding-top: 6px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: var(--primary-light);
    border: 1px solid var(--primary-border-light);
    border-radius: 999px;
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 16px;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.hero-badge i,
.hero-badge svg {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
    flex-shrink: 0;
}

.hero-title {
    font-size: 34px;
    font-weight: 900;
    line-height: 1.25;
    color: var(--text-main);
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.hero-title .gradient-text {
    background: linear-gradient(135deg, var(--primary-color), color-mix(in srgb, var(--primary-color) 60%, #38bdf8));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-description {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-muted);
    margin: 0 auto 24px;
    max-width: 760px;
}

.hero-features-belt {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.belt-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
}

.belt-item i,
.belt-item svg {
    width: 14px !important;
    height: 14px !important;
    max-width: 14px !important;
    max-height: 14px !important;
    color: var(--primary-color);
    flex-shrink: 0;
}

/* --- 2. Command Hub / Control Section --- */
.cese-search-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: 10;
}

.cese-search-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.cese-search-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cese-search-title i,
.cese-search-title svg {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
    color: var(--primary-color);
    flex-shrink: 0;
}

.btn-layout-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-layout-toggle i,
.btn-layout-toggle svg {
    width: 15px !important;
    height: 15px !important;
    max-width: 15px !important;
    max-height: 15px !important;
    flex-shrink: 0;
}

.btn-layout-toggle:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
}

.btn-icon i,
.btn-icon svg {
    width: 15px !important;
    height: 15px !important;
    max-width: 15px !important;
    max-height: 15px !important;
    flex-shrink: 0;
}

/* =========================================================================
   Unified Search Bar & Channel Switcher Standard
   ========================================================================= */
.unified-search-container {
    max-width: 1040px;
    margin: 0 auto;
    position: relative;
    z-index: 40;
}

.unified-search-bar {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border: 1.5px solid var(--border-color);
    border-radius: 20px;
    padding: 6px 10px;
    box-shadow: var(--shadow-md), 0 0 0 1px var(--primary-border-light);
    gap: 6px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.unified-search-bar:focus-within {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md), 0 0 0 3px var(--primary-light);
}

.search-segment {
    display: flex;
    align-items: center;
    position: relative;
}

.dropdown-segment {
    cursor: pointer;
}

.channel-segment {
    flex-shrink: 0;
}

.segment-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 12px;
    transition: background 0.2s ease;
}

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

.channel-avatar-wrapper {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
    border: 1.5px solid var(--primary-border-light);
    flex-shrink: 0;
    background: var(--bg-body);
}

.channel-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.segment-label-group {
    display: flex;
    flex-direction: column;
    text-align: start;
    min-width: 90px;
    max-width: 160px;
}

.segment-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
}

.segment-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chevron-icon {
    font-size: 14px;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    transition: transform 0.2s ease;
}

.chevron-icon i,
.chevron-icon svg {
    width: 14px !important;
    height: 14px !important;
    max-width: 14px !important;
    max-height: 14px !important;
    flex-shrink: 0;
}

.search-divider {
    width: 1px;
    height: 30px;
    background: var(--border-color);
    margin: 0 4px;
    flex-shrink: 0;
}

.input-segment {
    flex: 1;
    min-width: 180px;
    padding: 0 8px;
    gap: 8px;
}

.input-icon {
    color: var(--text-muted);
    font-size: 16px;
    display: inline-flex;
    align-items: center;
}

.input-icon i,
.input-icon svg {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
    flex-shrink: 0;
}

.search-input-field {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: var(--text-main);
    padding: 8px 0;
    font-family: inherit;
}

.search-input-field::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.input-clear-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-clear-btn:hover {
    color: var(--text-main);
    background: var(--primary-light);
}

.input-clear-btn i,
.input-clear-btn svg {
    width: 14px !important;
    height: 14px !important;
    max-width: 14px !important;
    max-height: 14px !important;
    flex-shrink: 0;
}

.round-search-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, color-mix(in srgb, var(--primary-color) 85%, #000) 100%);
    color: #fff;
    border: none;
    border-radius: 14px;
    padding: 10px 22px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--primary-color) 40%, transparent);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    font-family: inherit;
}

.round-search-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px color-mix(in srgb, var(--primary-color) 50%, transparent);
}

.round-search-btn:active:not(:disabled) {
    transform: translateY(0);
}

.round-search-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.round-search-btn i,
.round-search-btn svg {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
    flex-shrink: 0;
}

.btn-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.credit-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 7px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.credit-badge i,
.credit-badge svg {
    width: 12px !important;
    height: 12px !important;
    max-width: 12px !important;
    max-height: 12px !important;
    flex-shrink: 0;
}

/* Glass Menus for Channel Dropdown */
.glass-menu {
    position: absolute;
    top: calc(100% + 10px);
    inset-inline-start: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--primary-border-light);
    min-width: 270px;
    max-height: 320px;
    overflow-y: auto;
    z-index: 1000;
    padding: 8px;
    backdrop-filter: blur(16px);
}

.dropdown-header {
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.dropdown-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.dropdown-item:hover {
    background: var(--primary-light);
}

.dropdown-item.is-selected {
    background: color-mix(in srgb, var(--primary-light) 75%, transparent);
    font-weight: 700;
}

.dropdown-empty {
    padding: 16px 12px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

.item-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

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

.item-name {
    font-size: 13px;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 700;
}

.item-sub {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: monospace;
}

.check-icon {
    color: var(--primary-color);
    font-size: 14px;
    margin-inline-start: auto;
    display: inline-flex;
    align-items: center;
}

.check-icon i,
.check-icon svg {
    width: 14px !important;
    height: 14px !important;
    max-width: 14px !important;
    max-height: 14px !important;
    flex-shrink: 0;
}

.dropdown-footer {
    padding: 8px 12px;
    border-top: 1px solid var(--border-color);
    margin-top: 4px;
}

.add-channel-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.add-channel-link:hover {
    text-decoration: underline;
}

.add-channel-link i,
.add-channel-link svg {
    width: 14px !important;
    height: 14px !important;
    max-width: 14px !important;
    max-height: 14px !important;
    flex-shrink: 0;
}

/* Progress Overlay */
.cese-fetching-overlay {
    display: none;
    background: var(--primary-light);
    border: 1px dashed var(--primary-border-light);
    border-radius: 14px;
    padding: 18px 20px;
    margin-top: 18px;
    flex-direction: column;
    gap: 10px;
    animation: fadeInProgress 0.3s ease;
}

.cese-fetching-overlay.active {
    display: flex;
}

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

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

.cese-fetching-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.cese-fetching-title i,
.cese-fetching-title svg {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    flex-shrink: 0;
}

.cese-fetching-pct {
    font-size: 18px;
    font-weight: 900;
    color: var(--primary-color);
    font-family: monospace;
}

.cese-progress-bg {
    width: 100%;
    height: 8px;
    background: color-mix(in srgb, var(--primary-color) 15%, transparent);
    border-radius: 10px;
    overflow: hidden;
}

.cese-progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 10px;
    transition: width 0.4s ease;
}

.error-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    color: #ef4444;
    font-size: 14px;
    font-weight: 700;
    margin-top: 16px;
}

.error-banner i,
.error-banner svg {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    flex-shrink: 0;
}

.btn-close-error {
    margin-inline-start: auto;
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close-error i,
.btn-close-error svg {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
    flex-shrink: 0;
}

/* =========================================================================
   Standard GuinRank Bento Features Cluster (6 Cards - console-features)
   ========================================================================= */
.console-features {
    max-width: 1040px;
    margin: 36px auto 0;
    position: relative;
    z-index: 1;
}

.bento-features-cluster {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(140px, auto);
    gap: 16px;
}

.bento-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 22px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.bento-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-border-light);
    box-shadow: var(--shadow-md);
}

.bc-wide-top {
    grid-column: span 2;
}

.bc-wide-mid {
    grid-column: span 2;
}

.bc-tall {
    grid-row: span 2;
}

.dashed-ring-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1.5px dashed var(--primary-color);
    padding: 3px;
    margin-bottom: 14px;
    flex-shrink: 0;
}

.bc-icon-wrapper {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.bc-icon-wrapper i,
.bc-icon-wrapper svg {
    width: 20px !important;
    height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    flex-shrink: 0;
}

.bc-content {
    position: relative;
    z-index: 2;
}

.bc-title {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--text-main);
}

.bc-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

.bento-decor-icon {
    position: absolute;
    bottom: -10px;
    opacity: 0.08;
    color: var(--text-main);
    pointer-events: none;
    z-index: 1;
}

.bento-decor-icon i,
.bento-decor-icon svg {
    width: 80px !important;
    height: 80px !important;
    max-width: 80px !important;
    max-height: 80px !important;
    flex-shrink: 0;
}

[dir="rtl"] .bento-decor-icon, html[dir="rtl"] .bento-decor-icon {
    left: 18px;
    right: auto;
}

[dir="ltr"] .bento-decor-icon, html[dir="ltr"] .bento-decor-icon {
    right: 18px;
    left: auto;
}

/* CSS Keyframe Animations */
.anim-spin { animation: bento-spin 3s linear infinite; }
.anim-pulse { animation: bento-pulse 2s ease-in-out infinite; }
.anim-float { animation: bento-float 3s ease-in-out infinite; }
.anim-glow { animation: bento-glow 2s alternate infinite; }
.anim-tilt { animation: bento-tilt 3s ease-in-out infinite; }
.anim-bounce { animation: bento-bounce 2s infinite; }

@keyframes bento-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes bento-pulse { 0%, 100% { transform: scale(1); opacity: 0.08; } 50% { transform: scale(1.08); opacity: 0.16; } }
@keyframes bento-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes bento-glow { from { filter: drop-shadow(0 0 2px var(--primary-color)); } to { filter: drop-shadow(0 0 12px var(--primary-color)); } }
@keyframes bento-tilt { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(6deg); } }
@keyframes bento-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* Wide Mode & Responsive Adaptations */
.evergreen-container.is-wide-mode .unified-search-container,
.evergreen-container.is-wide-mode .console-features {
    max-width: 100% !important;
}

@media (max-width: 900px) {
    .bento-features-cluster {
        grid-template-columns: repeat(2, 1fr);
    }
    .bc-wide-top,
    .bc-wide-mid {
        grid-column: span 2;
    }
    .bc-tall {
        grid-row: span 1;
    }
}

@media (max-width: 680px) {
    .unified-search-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        border-radius: 16px;
    }
    .search-divider {
        display: none;
    }
    .channel-segment {
        width: 100%;
    }
    .segment-trigger {
        width: 100%;
        justify-content: space-between;
    }
    .input-segment {
        width: 100%;
        padding: 4px 0;
    }
    .round-search-btn {
        width: 100%;
        justify-content: center;
    }
    .bento-features-cluster {
        grid-template-columns: 1fr;
    }
    .bc-wide-top,
    .bc-wide-mid {
        grid-column: span 1;
    }
}

/* --- 4. Active Analysis Studio (cese-data-wrapper) --- */
.cese-data-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Channel Top Bar */
.channel-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding: 18px 24px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
}

.csb-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.csb-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

.csb-name-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.csb-name {
    font-size: 18px;
    font-weight: 900;
    color: var(--text-main);
    margin: 0;
}

.csb-audited-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    background: var(--primary-light);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-color);
}

.csb-audited-badge i,
.csb-audited-badge svg {
    width: 13px !important;
    height: 13px !important;
    max-width: 13px !important;
    max-height: 13px !important;
    flex-shrink: 0;
}

.csb-subs {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 2px;
}

.csb-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-tool-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-tool-action:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-tool-action i,
.btn-tool-action svg {
    width: 15px !important;
    height: 15px !important;
    max-width: 15px !important;
    max-height: 15px !important;
    flex-shrink: 0;
}

/* Master KPI Grid */
.cese-master-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

@media (max-width: 1100px) {
    .cese-master-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 580px) {
    .cese-master-grid { grid-template-columns: 1fr; }
}

.cese-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 22px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.cese-card-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-icon-wrap i,
.kpi-icon-wrap svg {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    color: var(--primary-color);
    flex-shrink: 0;
}

.cese-metric-hero {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.cese-metric-val {
    font-size: 32px;
    font-weight: 900;
    color: var(--text-main);
    line-height: 1;
}

.metric-denom {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-muted);
}

.metric-unit {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-muted);
}

.cese-metric-sub {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.cese-metric-sub i,
.cese-metric-sub svg {
    width: 13px !important;
    height: 13px !important;
    max-width: 13px !important;
    max-height: 13px !important;
    flex-shrink: 0;
}

.sub-good {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.sub-blue {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
}

.sub-warn {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.text-danger {
    color: #ef4444 !important;
}

.cese-metric-desc {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-muted);
    margin-top: auto;
}

/* Charts Grid */
.cese-charts-grid {
    display: grid;
    grid-template-columns: 1.6fr 1.1fr;
    gap: 20px;
}

@media (max-width: 992px) {
    .cese-charts-grid { grid-template-columns: 1fr; }
}

.cese-chart-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.cese-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

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

.chart-icon-wrap i,
.chart-icon-wrap svg {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    color: var(--primary-color);
    flex-shrink: 0;
}

.chart-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
}

.chart-legend-custom {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dot-evergreen { background: #10b981; }
.dot-trend { background: #f59e0b; }

.badge-sub-clean {
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.chart-render-target {
    width: 100%;
    min-height: 280px;
}

.cese-lifespan-desc {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    margin: 12px 0 0;
}

/* AI Strategic Note Box */
.cese-insight-box {
    margin-top: 18px;
    padding: 16px;
    background: var(--primary-light);
    border: 1px dashed var(--primary-border-light);
    border-radius: 14px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.cese-insight-icon-wrap {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--primary-color) 20%, transparent);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cese-insight-icon-wrap i,
.cese-insight-icon-wrap svg {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    flex-shrink: 0;
}

.cese-insight-text strong {
    color: var(--primary-color);
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 800;
}

.cese-insight-text p {
    font-size: 12px;
    color: var(--text-main);
    line-height: 1.6;
    margin: 0;
}

/* --- Table Card & Audit Rows --- */
.cese-table-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.cese-table-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    background: var(--bg-body);
}

.table-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-icon-wrap i,
.table-icon-wrap svg {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    color: var(--primary-color);
    flex-shrink: 0;
}

.cese-table-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
}

.table-controls-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-pills-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-filter-pill {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 999px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-filter-pill:hover,
.btn-filter-pill.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.table-search-wrap {
    position: relative;
}

.search-icon-sm {
    position: absolute;
    top: 50%;
    inset-inline-start: 10px;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}

.table-search-input {
    padding: 6px 12px 6px 30px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 12px;
    color: var(--text-main);
    outline: none;
    font-family: inherit;
    width: 180px;
    transition: border-color 0.2s, width 0.2s;
}

.table-search-input:focus {
    border-color: var(--primary-color);
    width: 220px;
}

[dir="rtl"] .table-search-input {
    padding: 6px 30px 6px 12px;
}

.cese-table-wrap {
    overflow-x: auto;
}

.cese-table {
    width: 100%;
    border-collapse: collapse;
    text-align: start;
}

.cese-table th {
    background: var(--card-bg);
    padding: 14px 20px;
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.cese-table td {
    padding: 14px 20px;
    font-size: 13px;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.cese-table-row:hover td {
    background: color-mix(in srgb, var(--primary-light) 40%, transparent);
}

.vid-title-cell {
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 460px;
}

.vid-thumb-wrap {
    width: 68px;
    height: 42px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-body);
}

.vid-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vid-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.vid-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    transition: color 0.2s;
}

.vid-name:hover {
    color: var(--primary-color);
}

.vid-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.meta-separator {
    opacity: 0.5;
}

.badge-outdated-year {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 6px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    color: #ef4444;
    font-size: 10px;
    font-weight: 800;
}

.badge-outdated-year i,
.badge-outdated-year svg {
    width: 10px !important;
    height: 10px !important;
    max-width: 10px !important;
    max-height: 10px !important;
    flex-shrink: 0;
}

/* Badges */
.cese-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.cese-badge i,
.cese-badge svg {
    width: 14px !important;
    height: 14px !important;
    max-width: 14px !important;
    max-height: 14px !important;
    flex-shrink: 0;
}

.bg-evergreen {
    background: rgba(16, 185, 129, 0.14);
    color: #10b981;
}

.bg-slow {
    background: rgba(59, 130, 246, 0.14);
    color: #3b82f6;
}

.bg-trend {
    background: rgba(245, 158, 11, 0.14);
    color: #f59e0b;
}

.bg-expired {
    background: rgba(239, 68, 68, 0.14);
    color: #ef4444;
}

/* Score Bar */
.eg-score-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 120px;
}

.eg-score-val {
    font-size: 14px;
    font-weight: 900;
    min-width: 24px;
}

.eg-score-val.success { color: #10b981; }
.eg-score-val.blue { color: #3b82f6; }
.eg-score-val.warning { color: #f59e0b; }
.eg-score-val.danger { color: #ef4444; }

.eg-bar-bg {
    flex: 1;
    height: 6px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.eg-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s;
}

.fill-success { background: #10b981; }
.fill-blue { background: #3b82f6; }
.fill-warning { background: #f59e0b; }
.fill-danger { background: #ef4444; }

.daily-views-cell {
    display: flex;
    flex-direction: column;
}

.daily-val {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-main);
}

.daily-sub {
    font-size: 10px;
    color: var(--text-muted);
}

/* Action Buttons in Table */
.btn-ai-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--primary-light);
    border: 1px solid var(--primary-border-light);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 800;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-ai-action i,
.btn-ai-action svg {
    width: 14px !important;
    height: 14px !important;
    max-width: 14px !important;
    max-height: 14px !important;
    flex-shrink: 0;
}

.btn-ai-action:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-ai-secondary {
    background: var(--bg-body);
    border-color: var(--border-color);
    color: var(--text-muted);
}

.btn-ai-secondary:hover {
    border-color: #10b981;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.table-empty-td {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* --- 5. Compliance Footer Notice --- */
.compliance-footer-card {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    padding: 22px;
    background: color-mix(in srgb, var(--card-bg) 95%, var(--primary-color) 5%);
    border: 1px solid var(--primary-border-light);
    border-radius: 18px;
    margin-top: 10px;
}

.cfc-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--primary-light);
    border: 1px solid var(--primary-border-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cfc-icon i,
.cfc-icon svg {
    width: 20px !important;
    height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    flex-shrink: 0;
}

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

.cfc-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-main);
    margin: 0 0 6px;
}

.cfc-text {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0 0 10px;
}

.cfc-links {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 700;
    flex-wrap: wrap;
}

.cfc-links a {
    color: var(--primary-color);
    text-decoration: none;
    transition: opacity 0.2s;
}

.cfc-links a:hover {
    text-decoration: underline;
}

.cfc-links span {
    color: var(--text-muted);
    opacity: 0.5;
}

.btn-link-clean {
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
}

.btn-link-clean:hover {
    text-decoration: underline;
}

/* ==========================================================================
   6. ZERO-SCROLL TRAP ROOT-LEVEL MODAL STYLES (Strict Architectural Mandate)
   ========================================================================== */
html.modal-open,
body.modal-open {
    overflow: hidden !important;
    height: 100vh !important;
}

.custom-modal-backdrop {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999 !important;
    margin: 0 !important;
    padding: 20px !important;
    background: rgba(0, 0, 0, 0.65) !important;
    backdrop-filter: blur(12px) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInModalBackdrop 0.25s ease;
}

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

.custom-modal-card {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 24px !important;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.45) !important;
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
    animation: zoomInModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes zoomInModal {
    from { transform: scale(0.94); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.custom-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    background: var(--bg-body);
}

.cmh-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.cmh-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--primary-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cmh-icon i,
.cmh-icon svg {
    width: 20px !important;
    height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    flex-shrink: 0;
}

.cmh-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
}

.cmh-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 480px;
}

.btn-modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-modal-close i,
.btn-modal-close svg {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    flex-shrink: 0;
}

.btn-modal-close:hover {
    background: var(--card-bg);
    color: var(--text-main);
}

.custom-modal-body {
    padding: 24px;
    overflow-y: auto !important;
    max-height: calc(85vh - 135px);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Modal Inner Components */
.modal-diagnostic-card {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 16px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 14px;
}

.mdc-metric {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mdc-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.mdc-value {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-main);
}

.modal-alert-box {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 13px;
}

.alert-warn {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #f59e0b;
}

.alert-warn strong {
    display: block;
    margin-bottom: 2px;
}

.alert-warn p {
    margin: 0;
    font-size: 12px;
    color: var(--text-main);
}

.modal-field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal-field-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-main);
}

.modal-field-label i,
.modal-field-label svg {
    width: 15px !important;
    height: 15px !important;
    max-width: 15px !important;
    max-height: 15px !important;
    color: var(--primary-color);
    flex-shrink: 0;
}

.suggested-title-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--bg-body);
    border: 2px dashed var(--primary-color);
    border-radius: 12px;
    gap: 12px;
}

.suggested-title-text {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-main);
}

.btn-copy-code {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.2s;
}

.btn-copy-code i,
.btn-copy-code svg {
    width: 13px !important;
    height: 13px !important;
    max-width: 13px !important;
    max-height: 13px !important;
    flex-shrink: 0;
}

.btn-copy-code:hover {
    opacity: 0.9;
}

.action-steps-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-step-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
    flex-shrink: 0;
}

.step-content strong {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-main);
    display: block;
    margin-bottom: 2px;
}

.step-content p {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

.custom-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    background: var(--bg-body);
}

.btn-primary-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary-action i,
.btn-primary-action svg {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
    flex-shrink: 0;
}

.btn-primary-action:hover {
    filter: brightness(1.08);
}

.btn-secondary-action {
    padding: 10px 18px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary-action:hover {
    background: var(--bg-body);
}

/* Compliance Details */
.compliance-details-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.compliance-clause h4 {
    font-size: 14px;
    font-weight: 800;
    color: var(--primary-color);
    margin: 0 0 6px;
}

.compliance-clause p {
    font-size: 13px;
    color: var(--text-main);
    line-height: 1.6;
    margin: 0;
}

/* --- ApexCharts Quantum Custom Tooltip --- */
.quantum-evergreen-tooltip {
    background: rgba(18, 22, 34, 0.85) !important;
    backdrop-filter: blur(14px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 12px !important;
    padding: 12px 14px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
    color: #fff !important;
    font-family: inherit !important;
    min-width: 170px;
}

.qet-title {
    font-size: 12px;
    font-weight: 800;
    color: #94a3b8;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.qet-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    padding: 3px 0;
}

.qet-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #cbd5e1;
}

.qet-val {
    font-weight: 800;
    color: #fff;
}

