﻿/* Admin Portal Styles */

/* Admin Layout */
.admin-layout { display: flex; min-height: 100vh; background: #f1f3f5; }

.admin-sidebar {
    width: 280px;
    background: #001f40;
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}
    .admin-sidebar.collapsed {
        width: 78px;
        background: #001f40;
        color: #fff;
        display: flex;
        flex-direction: column;
        position: fixed;
        height: 100vh;
        z-index: 100;
    }
.admin-sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: #001f40;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.admin-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.logo-img {
    height: 28px;
    filter: brightness(0) invert(1);
}
.admin-logo svg { width: 36px; height: 36px; color: #e85a24; }
.admin-logo-text { display: flex; flex-direction: column; }
.admin-brand { font-size: 1.25rem; font-weight: 700; color: #fff; }
.admin-product { font-size: 0.75rem; color: rgba(255, 255, 255, 0.5); text-transform: uppercase; letter-spacing: 1px; }

.admin-nav { flex: 1; overflow-y: auto; padding: 1rem 0; }
.admin-nav-section { margin-bottom: 1.5rem; }
.admin-nav-section-title { display: block; padding: 0 1.5rem; font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: rgba(255, 255, 255, 0.4); margin-bottom: 0.5rem; }

.admin-nav-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1.5rem; color: rgba(255, 255, 255, 0.7); text-decoration: none; font-size: 0.875rem; border-left: 3px solid transparent; transition: all 0.2s ease; }
.admin-nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.admin-nav-item:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.admin-nav-item.active { background: rgba(232, 90, 36, 0.15); color: #e85a24; border-left-color: #e85a24; }
.admin-nav-item.active svg { color: #e85a24; }

.admin-sidebar-footer { padding: 1rem 1.5rem; border-top: 1px solid rgba(255, 255, 255, 0.1); }

.back-to-app { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; background: rgba(255, 255, 255, 0.05); border-radius: 8px; color: rgba(255, 255, 255, 0.7); text-decoration: none; font-size: 0.85rem; margin-bottom: 1rem; transition: all 0.2s ease; }
.back-to-app svg { width: 18px; height: 18px; }
.back-to-app:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.admin-sidebar.collapsed .back-to-app {
    width: 48px; 
    height: 48px;
    padding: 0; 
    gap: 0;
    margin: 0 auto 1rem auto; 
    justify-content: center; 
}

.admin-sidebar.collapsed .back-to-app {
    border-radius: 12px;
}

    .admin-sidebar.collapsed .back-to-app svg {
        width: 20px;
        height: 20px;
    }

    .admin-sidebar.collapsed .back-to-app .nav-text,
    .admin-sidebar.collapsed .back-to-app span:not(.nav-icon) {
        display: none !important;
    }


.admin-user-info { display: flex; align-items: center; gap: 0.75rem; }
.admin-user-avatar { width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(135deg, #e85a24, #d14d1a); display: flex; align-items: center; justify-content: center; font-size: 0.85rem; font-weight: 600; color: #fff; }
.admin-user-details { display: flex; flex-direction: column; }
.admin-user-name { font-size: 0.875rem; font-weight: 500; color: #fff; }
.admin-user-role { font-size: 0.7rem; color: rgba(255, 255, 255, 0.5); }

.admin-content { flex: 1; margin-left: 280px; min-height: 100vh; }

.admin-layout.sidebar-collapsed .admin-content {
    margin-left: 78px;
}


/* Admin Mobile */
.admin-mobile-header { display: none; position: fixed; top: 0; left: 0; right: 0; height: 60px; background: linear-gradient(135deg, #1a1f2e 0%, #0d1117 100%); z-index: 1000; padding: 0 1rem; align-items: center; }
.admin-mobile-header .menu-toggle { width: 44px; height: 44px; border: none; background: rgba(255, 255, 255, 0.1); border-radius: 10px; color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.admin-mobile-header .menu-toggle svg { width: 24px; height: 24px; }
.admin-mobile-header .mobile-title { flex: 1; text-align: center; font-size: 1.1rem; font-weight: 600; color: #fff; }
.admin-mobile-header .mobile-spacer { width: 44px; }
.admin-sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 998; backdrop-filter: blur(2px); }

/* Admin Page */
.admin-page, .dashboard-page { padding: 2rem; }

/* Admin Stats Grid */
.admin-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; margin-bottom: 2rem; }

.admin-stat-card { background: #fff; border-radius: 16px; padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; border: 1px solid #dee2e6; position: relative; overflow: hidden; }
.admin-stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; }
.admin-stat-card.total::before { background: linear-gradient(90deg, #002d5c, #003d7a); }
.admin-stat-card.critical::before { background: linear-gradient(90deg, #dc3545, #e85a6b); }
.admin-stat-card.active::before { background: linear-gradient(90deg, #17a2b8, #20c9e0); }
.admin-stat-card.resolved::before { background: linear-gradient(90deg, #28a745, #34d058); }
.admin-stat-card.stat-skeleton::before { background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%); background-size: 200% 100%; animation: skeleton-shimmer 1.5s infinite; }

.admin-stat-card .stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.admin-stat-card .stat-icon svg { width: 24px; height: 24px; }
.admin-stat-card.total .stat-icon { background: rgba(0, 45, 92, 0.1); color: #002d5c; }
.admin-stat-card.critical .stat-icon { background: rgba(220, 53, 69, 0.1); color: #dc3545; }
.admin-stat-card.active .stat-icon { background: rgba(23, 162, 184, 0.1); color: #17a2b8; }
.admin-stat-card.resolved .stat-icon { background: rgba(40, 167, 69, 0.1); color: #28a745; }

.admin-stat-card .stat-content { display: flex; flex-direction: column; }
.admin-stat-card .stat-value { font-size: 2rem; font-weight: 700; color: #002d5c; }
.admin-stat-card .stat-label { font-size: 0.85rem; color: #6c757d; }

.stat-trend { display: flex; align-items: center; gap: 0.375rem; font-size: 0.8rem; font-weight: 500; }
.stat-trend svg { width: 14px; height: 14px; }
.stat-trend.up { color: #28a745; }
.stat-trend.down { color: #dc3545; }
.stat-breakdown { display: flex; gap: 1rem; font-size: 0.8rem; color: #6c757d; }

/* Charts Row */
.charts-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-bottom: 2rem; }
.chart-card { background: #fff; border-radius: 16px; padding: 1.5rem; border: 1px solid #dee2e6; }
.chart-card-header { margin-bottom: 1.5rem; display: flex; justify-content: space-between; align-items: flex-start; }
.chart-card-header h3 { font-size: 1rem; font-weight: 600; color: #002d5c; margin: 0 0 0.25rem 0; }
.chart-card-header .card-subtitle { font-size: 0.8rem; color: #6c757d; display: block; }
.chart-card-header .view-all { font-size: 0.85rem; color: #e85a24; text-decoration: none; }

/* Severity Chart */
.severity-chart { display: flex; flex-direction: column; gap: 1rem; }
.severity-bar-container { display: flex; flex-direction: column; gap: 0.375rem; }
.bar-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: #495057; }
.bar-wrapper { display: flex; align-items: center; gap: 0.5rem; }
.bar { height: 8px; border-radius: 4px; min-width: 4px; }
.bar-sev0 { background: linear-gradient(90deg, #dc3545, #e85a6b); }
.bar-sev1 { background: linear-gradient(90deg, #fd7e14, #ff9248); }
.bar-sev2 { background: linear-gradient(90deg, #ffc107, #ffd043); }
.bar-low { background: linear-gradient(90deg, #28a745, #34d058); }
.bar-sev3 { background: linear-gradient(90deg, #17a2b8, #20c9e0); }
.bar-value { font-size: 0.75rem; color: #6c757d; font-weight: 500; }

/* Donut Chart */
.StatusName-chart { display: flex; align-items: center; gap: 1.5rem; }
.donut-container { position: relative; width: 120px; height: 120px; }
.donut { transform: rotate(-90deg); }
.segment-open { stroke: #dc3545; }
.segment-acknowledged { stroke: #ffc107; }
.segment-inprogress { stroke: #17a2b8; }
.segment-resolved { stroke: #28a745; }
.segment-closed { stroke: #6c757d; }
.donut-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }
.donut-value { display: block; font-size: 1.5rem; font-weight: 700; color: #002d5c; }
.donut-label { font-size: 0.7rem; color: #6c757d; }

.StatusName-legend { display: flex; flex-direction: column; gap: 0.5rem; }
.legend-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; }
.legend-label { color: #495057; flex: 1; }
.legend-value { font-weight: 600; color: #002d5c; }

/* Customer List */
.customer-list { display: flex; flex-direction: column; gap: 0.75rem; }
.customer-item { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem; background: #f8f9fa; border-radius: 8px; }
.customer-info { display: flex; align-items: center; gap: 0.75rem; }
.customer-avatar { width: 36px; height: 36px; border-radius: 8px; background: #002d5c; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 600; color: #fff; }
.customer-details { display: flex; flex-direction: column; }
.customer-stats { text-align: right; }
.alert-count { font-size: 1.25rem; font-weight: 700; color: #002d5c; }
.alert-label { display: block; font-size: 0.65rem; color: #6c757d; text-transform: uppercase; }

/* Bottom Row */
.bottom-row { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }
.activity-card, .metrics-card { background: #fff; border-radius: 16px; padding: 1.5rem; border: 1px solid #dee2e6; }

/* Activity List */
.activity-list { display: flex; flex-direction: column; gap: 0.75rem; }
.activity-item { display: flex; align-items: center; gap: 1rem; padding: 0.75rem; border-radius: 8px; }
.activity-item:hover { background: #f8f9fa; }
.activity-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.activity-icon svg { width: 18px; height: 18px; }
.activity-icon.icon-critical { background: rgba(220, 53, 69, 0.1); color: #dc3545; }
.activity-icon.icon-high { background: rgba(253, 126, 20, 0.1); color: #fd7e14; }
.activity-icon.icon-medium { background: rgba(255, 193, 7, 0.1); color: #ffc107; }
.activity-icon.icon-low { background: rgba(40, 167, 69, 0.1); color: #28a745; }
.activity-icon.icon-info { background: rgba(23, 162, 184, 0.1); color: #17a2b8; }
.activity-content { flex: 1; }
.activity-title { display: block; font-size: 0.875rem; font-weight: 500; color: #212529; }
.activity-meta { font-size: 0.75rem; color: #6c757d; }
.activity-badge { padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 0.7rem; font-weight: 500; text-transform: capitalize; }
.badge-open { background: #f8d7da; color: #842029; }
.badge-acknowledged { background: #fff3cd; color: #664d03; }
.badge-inprogress { background: #cff4fc; color: #055160; }
.badge-resolved { background: #d1e7dd; color: #0f5132; }

/* Metrics */
.metrics-list { display: flex; flex-direction: column; gap: 1.25rem; }
.metric-item { display: flex; flex-direction: column; gap: 0.5rem; }
.metric-info { display: flex; justify-content: space-between; }
.metric-bar { height: 8px; background: #e9ecef; border-radius: 4px; overflow: hidden; }
.metric-fill { height: 100%; background: linear-gradient(90deg, #fd7e14, #ffc107); border-radius: 4px; }
.metric-fill.good { background: linear-gradient(90deg, #28a745, #34d058); }

/* Users Grid */
.users-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.user-card { background: #fff; border-radius: 16px; padding: 1.5rem; border: 1px solid #dee2e6; }
.user-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; }
.user-avatar.large { width: 56px; height: 56px; border-radius: 14px; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; font-weight: 600; color: #fff; }
.user-avatar.Admin { background: linear-gradient(135deg, #002d5c, #003d7a); }
.user-avatar.Analyst { background: linear-gradient(135deg, #e85a24, #ff7043); }
.user-avatar.Viewer { background: linear-gradient(135deg, #28a745, #34d058); }
.user-StatusName { display: flex; align-items: center; gap: 0.375rem; font-size: 0.75rem; }
.user-StatusName .StatusName-dot { width: 8px; height: 8px; border-radius: 50%; }
.user-StatusName.online .StatusName-dot { background: #28a745; }
.user-StatusName.online { color: #28a745; }
.user-StatusName.offline .StatusName-dot { background: #adb5bd; }
.user-StatusName.offline { color: #6c757d; }
.user-card-body { margin-bottom: 1rem; }
.user-card-body .user-name { font-size: 1.1rem; font-weight: 600; color: #002d5c; margin: 0 0 0.25rem 0; display: block; }
.user-card-body .user-email { font-size: 0.85rem; color: #6c757d; display: block; margin-bottom: 0.75rem; }
.user-role-badge { display: inline-block; padding: 0.25rem 0.75rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; text-transform: capitalize; }
.user-role-badge.Admin { background: rgba(0, 45, 92, 0.1); color: #002d5c; }
.user-role-badge.Analyst { background: rgba(232, 90, 36, 0.1); color: #e85a24; }
.user-role-badge.Viewer { background: rgba(40, 167, 69, 0.1); color: #28a745; }
.user-card-stats { display: flex; gap: 2rem; padding: 1rem 0; border-top: 1px solid #e9ecef; border-bottom: 1px solid #e9ecef; margin-bottom: 1rem; }
.user-stat { text-align: center; }
.user-stat .stat-value { display: block; font-size: 1.25rem; font-weight: 700; color: #002d5c; }
.user-stat .stat-label { font-size: 0.7rem; color: #6c757d; text-transform: uppercase; }
.user-card-actions { display: flex; gap: 0.5rem; }
.user-card-actions .btn { flex: 1; justify-content: center; }
.user-card-actions .btn.danger { color: #dc3545; }
.user-card-actions .btn.danger:hover { background: rgba(220, 53, 69, 0.1); }

/* Table */
.table-container { background: #fff; border-radius: 16px; border: 1px solid #dee2e6; overflow: hidden; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { padding: 1rem 1.25rem; text-align: left; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: #6c757d; background: #f8f9fa; border-bottom: 1px solid #dee2e6; }
.admin-table td { padding: 1rem 1.25rem; border-bottom: 1px solid #e9ecef; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover { background: #f8f9fa; }

[data-theme="dark"] .table-container { background: var(--bg-secondary); border-color: var(--border-color); }
[data-theme="dark"] .admin-table th { background: var(--bg-tertiary); color: var(--text-secondary); border-bottom-color: var(--border-color); }
[data-theme="dark"] .admin-table td { border-bottom-color: var(--border-color); color: var(--text-primary); }
[data-theme="dark"] .admin-table tr:hover { background: var(--bg-tertiary); }
.customer-cell { display: flex; align-items: center; gap: 0.75rem; }
.code-badge { padding: 0.25rem 0.5rem; background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 4px; font-size: 0.8rem; color: #495057; }
.alert-count-badge { padding: 0.25rem 0.625rem; border-radius: 12px; font-size: 0.8rem; font-weight: 600; background: #e9ecef; color: #495057; }
.alert-count-badge.high { background: #f8d7da; color: #842029; }
.StatusName-pill { padding: 0.25rem 0.75rem; border-radius: 12px; font-size: 0.75rem; font-weight: 500; }
.StatusName-pill.active { background: #d1e7dd; color: #0f5132; }
.table-actions { display: flex; gap: 0.375rem; }
.table-actions .icon-btn { width: 32px; height: 32px; border: 1px solid #dee2e6; background: #fff; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: #6c757d; cursor: pointer; }
.table-actions .icon-btn svg { width: 16px; height: 16px; }
.table-actions .icon-btn:hover { background: #f8f9fa; color: #002d5c; border-color: #002d5c; }
.table-actions .icon-btn.danger:hover { background: #f8d7da; color: #dc3545; border-color: #dc3545; }

/* Settings */
.settings-sections { display: flex; flex-direction: column; gap: 1.5rem; }
.settings-section { background: #fff; border-radius: 16px; border: 1px solid #dee2e6; overflow: hidden; }
.section-header { display: flex; align-items: center; gap: 1rem; padding: 1.25rem 1.5rem; background: #f8f9fa; border-bottom: 1px solid #e9ecef; }
.section-header svg { width: 24px; height: 24px; color: #002d5c; }
.section-header h3 { font-size: 1rem; font-weight: 600; color: #002d5c; margin: 0; }
.section-header p { font-size: 0.8rem; color: #6c757d; margin: 0; }
.settings-form { padding: 0.5rem 0; }
.setting-row { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.5rem; border-bottom: 1px solid #f1f3f5; }
.setting-row:last-child { border-bottom: none; }
.setting-info label { display: block; font-size: 0.9rem; font-weight: 500; color: #212529; margin-bottom: 0.125rem; }
.setting-description { font-size: 0.8rem; color: #6c757d; }
.toggle { position: relative; display: inline-block; width: 48px; height: 26px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: #dee2e6; border-radius: 26px; transition: 0.3s; }
.toggle-slider::before { position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: 0.3s; }
.toggle input:checked + .toggle-slider { background: #28a745; }
.toggle input:checked + .toggle-slider::before { transform: translateX(22px); }
.setting-select { padding: 0.5rem 1rem; border: 1px solid #dee2e6; border-radius: 6px; font-size: 0.9rem; min-width: 150px; background: #fff; }
.settings-footer { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid #e9ecef; }

/* Admin Mobile Responsive */
@media (max-width: 768px) {
    .admin-mobile-header { display: flex; }
    .admin-sidebar-overlay { display: block; }
    .admin-sidebar { transform: translateX(-100%); transition: transform 0.3s ease; z-index: 999; }
    .admin-sidebar.mobile-open { transform: translateX(0); }
    .admin-content { margin-left: 0; padding-top: 60px; }
    .admin-page, .dashboard-page { padding: 1rem; }
    .admin-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .charts-row { grid-template-columns: 1fr; }
    .bottom-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .admin-stats-grid { grid-template-columns: 1fr; }
}

/* ── Customer Statistics Page ─────────────────────────────────────────── */
.cs-loading { display: flex; justify-content: center; padding: 4rem; }

/* KPI row */
.cs-kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-bottom: 1.5rem; }
.cs-kpi-card { background: #fff; border-radius: 16px; padding: 1.5rem; border: 1px solid #dee2e6; display: flex; align-items: center; gap: 1rem; }
.cs-kpi-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cs-kpi-icon svg { width: 22px; height: 22px; }
.cs-kpi-blue  { background: rgba(0, 45, 92, 0.1); color: #002d5c; }
.cs-kpi-orange { background: rgba(232, 90, 36, 0.1); color: #e85a24; }
.cs-kpi-green  { background: rgba(40, 167, 69, 0.1); color: #28a745; }
.cs-kpi-body { display: flex; flex-direction: column; min-width: 0; }
.cs-kpi-value { font-size: 1.75rem; font-weight: 700; color: #002d5c; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-kpi-label { font-size: 0.78rem; color: #6c757d; margin-top: 0.25rem; }

/* ── Alert Statistics Page — compact KPI cards ── */
.as-kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.as-kpi-card { background: #fff; border-radius: 12px; padding: 1rem; border: 1px solid #dee2e6; display: flex; align-items: center; gap: 0.75rem; }
.as-kpi-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.as-kpi-icon svg { width: 18px; height: 18px; }
.as-kpi-blue { background: rgba(0, 45, 92, 0.1); color: #002d5c; }
.as-kpi-orange { background: rgba(232, 90, 36, 0.1); color: #e85a24; }
.as-kpi-green { background: rgba(40, 167, 69, 0.1); color: #28a745; }
.as-kpi-red { background: rgba(220, 53, 69, 0.1); color: #dc3545; }
.as-kpi-purple { background: rgba(111, 66, 193, 0.1); color: #6f42c1; }
.as-kpi-body { display: flex; flex-direction: column; min-width: 0; }
.as-kpi-value { font-size: 1.4rem; font-weight: 700; color: #002d5c; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.as-kpi-label { font-size: 0.7rem; color: #6c757d; margin-top: 0.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1200px) { .as-kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .as-kpi-grid { grid-template-columns: 1fr; } }

/* ── Alert Statistics Page — Trend + Severity charts ── */
.as-charts-row { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; margin-bottom: 2rem; }
@media (max-width: 992px) { .as-charts-row { grid-template-columns: 1fr; } }

.as-trend-interval-switch { display: flex; gap: 0.35rem; }
.as-interval-btn { border: 1px solid #dee2e6; background: #fff; color: #495057; font-size: 0.75rem; padding: 0.3rem 0.65rem; border-radius: 6px; cursor: pointer; transition: all 0.15s ease; }
.as-interval-btn:hover { background: #f8f9fa; }
.as-interval-btn.active { background: #002d5c; color: #fff; border-color: #002d5c; }

.as-trend-chart { display: flex; flex-direction: column; gap: 0.5rem; }
.as-trend-svg { width: 100%; height: 220px; }
.as-trend-gridline { stroke: #eef1f4; stroke-width: 1; }
.as-trend-line { fill: none; stroke-width: 2.5; }
.as-trend-total { stroke: #002d5c; }
.as-trend-critical { stroke: #dc3545; }
.as-trend-error { stroke: #fd7e14; }
.as-trend-warning { stroke: #ffc107; }
.as-trend-labels { display: flex; justify-content: space-between; font-size: 0.65rem; color: #6c757d; overflow: hidden; }
.as-trend-labels span { white-space: nowrap; }
.as-trend-legend { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-top: 0.5rem; }
.as-legend-item { display: flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: #495057; }
.as-legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.as-legend-total { background: #002d5c; }
.as-legend-critical { background: #dc3545; }
.as-legend-error { background: #fd7e14; }
.as-legend-warning { background: #ffc107; }

.as-severity-chart { display: flex; align-items: center; gap: 1.5rem; }
.as-severity-legend { display: flex; flex-direction: column; gap: 0.6rem; flex: 1; }
.as-severity-dot-critical { background: #dc3545; }
.as-severity-dot-error { background: #fd7e14; }
.as-severity-dot-warning { background: #ffc107; }
.as-severity-dot-info { background: #17a2b8; }
.as-severity-segment-critical { stroke: #dc3545; }
.as-severity-segment-error { stroke: #fd7e14; }
.as-severity-segment-warning { stroke: #ffc107; }
.as-severity-segment-info { stroke: #17a2b8; }

.as-tables-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 992px) { .as-tables-row { grid-template-columns: 1fr; } }
.as-table-card .admin-table { margin-top: 0.5rem; }
.as-table-card .chart-card-header { margin-bottom: 0.75rem; }

/* ── SDM Portal — compact overview ── */
.sdm-compact-row { margin-bottom: 1.25rem; gap: 1rem; }
.sdm-card { padding: 1rem 1.25rem; }
.sdm-card .chart-card-header { margin-bottom: 0.75rem; }
.sdm-search { margin-bottom: 0; min-width: 260px; }
.sdm-kpi-clickable { cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.sdm-kpi-clickable:hover { border-color: #002d5c; }
.sdm-kpi-selected { border-color: #e85a24; box-shadow: 0 0 0 1px #e85a24; }
.sdm-severity-chart { gap: 0.5rem; }
.sdm-clickable { cursor: pointer; padding: 0.2rem 0.4rem; border-radius: 6px; transition: background 0.15s; }
.sdm-clickable:hover, .sdm-row-selected { background: rgba(0, 45, 92, 0.05); }
.sdm-row-selected .bar-label { font-weight: 600; color: #002d5c; }
.bar-sev4 { background: linear-gradient(90deg, #6c757d, #adb5bd); }
.sdm-mini-table th, .sdm-mini-table td { padding: 0.45rem 0.6rem; font-size: 0.8rem; }
.sdm-ellipsis { max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sdm-nowrap { white-space: nowrap; }
.sdm-empty { color: #6c757d; font-size: 0.8rem; text-align: center; }
.sdm-sev-chip { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 10px; font-size: 0.72rem; font-weight: 600; }
.sdm-code { margin-left: 0.5rem; font-size: 0.7rem; }
.sdm-detail-header { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.5rem; }
.sdm-grid-wrap { margin-bottom: 1.5rem; }
.sdm-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.sdm-link { text-decoration: none; color: inherit; }
.sdm-link-title { font-size: 0.9rem; font-weight: 600; color: #002d5c; }
.sdm-link-arrow { width: 16px; height: 16px; margin-left: auto; color: #adb5bd; flex-shrink: 0; }
.sdm-link:hover .sdm-link-arrow { color: #002d5c; }
[data-theme="dark"] .sdm-link-title { color: var(--text-primary); }

/* SDM — customer name + FAK link */
.sdm-customer-cell { display: inline-flex; align-items: center; gap: 0.35rem; min-width: 0; max-width: 100%; }
.sdm-customer-cell .fak-arrow { display: inline-flex; color: #e85a24; flex-shrink: 0; }
.sdm-customer-cell .fak-arrow:hover { color: #002d5c; }
.sdm-customer-cell .sdm-reports-link { display: inline-flex; color: #2b6cd4; flex-shrink: 0; }
.sdm-customer-cell .sdm-reports-link:hover { color: #002d5c; }
.sdm-header-link { margin-left: 0.75rem; font-size: 0.82rem; font-weight: 600; color: #2b6cd4; text-decoration: none; }
.sdm-header-link:hover { text-decoration: underline; }

/* SDM — environment performance */
.sdm-perf { --sdm-perf-c: #2b6cd4; }
.sdm-perf-kpis { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .sdm-perf-kpis { grid-template-columns: repeat(2, 1fr); } }
.sdm-perf-section-title { font-size: 0.78rem; font-weight: 600; color: #495057; margin: 0.75rem 0 0.4rem; display: flex; align-items: center; gap: 0.5rem; }
.sdm-perf-trend { height: 130px; }
.sdm-perf-bar { flex: 1; max-width: 22px; background: var(--sdm-perf-c); border-radius: 4px 4px 0 0; transition: height 0.3s ease, opacity 0.15s; }
.sdm-perf-bar.selected { background: #e8692a; }
.sdm-perf-bar.dimmed { opacity: 0.35; }
.sdm-perf-hit { cursor: pointer; }
.sdm-perf-fill { background: var(--sdm-perf-c); }
.sdm-perf-breakdown { margin-top: 0.25rem; gap: 1.5rem; }
.sdm-perf-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: -0.25rem 0 0.75rem; font-size: 0.78rem; }
.sdm-perf-crumb-root { color: #6c757d; }
.sdm-perf-crumb { display: inline-flex; align-items: center; gap: 0.3rem; background: rgba(43, 108, 212, 0.1); color: #1f4f9c; border-radius: 12px; padding: 0.15rem 0.35rem 0.15rem 0.6rem; font-weight: 600; }
.sdm-perf-crumb::before { content: "›"; color: #6c757d; margin-right: 0.2rem; font-weight: 400; }
.sdm-perf-crumb button { border: none; background: none; color: inherit; cursor: pointer; font-size: 0.9rem; line-height: 1; padding: 0 0.15rem; }
.sdm-perf-loading { padding: 2rem; }
.sdm-perf-message { padding: 1.5rem 0; }
.sdm-perf-showall { margin-top: 0.75rem; }
.sdm-perf-detail-title { margin-top: 1rem; }
[data-theme="dark"] .sdm-perf-section-title { color: var(--text-secondary); }
[data-theme="dark"] .sdm-perf-crumb { background: rgba(43, 108, 212, 0.25); color: #9cc1ff; }

/* SDM — case overview */
.sdm-case-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 0.75rem; }
.sdm-case-summary { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.sdm-case-stat { font-size: 0.78rem; color: #495057; background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 16px; padding: 0.25rem 0.75rem; }
.sdm-case-stat b { color: #002d5c; }
.sdm-case-stat-warn { background: rgba(232, 90, 36, 0.08); border-color: rgba(232, 90, 36, 0.35); }
.sdm-case-stat-warn b { color: #c2410c; }
.sdm-no-case { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 10px; font-size: 0.72rem; font-weight: 600; background: rgba(232, 90, 36, 0.12); color: #c2410c; border: 1px dashed rgba(232, 90, 36, 0.6); white-space: nowrap; }
.sdm-no-case.resolved { background: transparent; color: #6c757d; border-color: #ced4da; font-weight: 500; }
.sdm-case-link { text-decoration: none; cursor: pointer; }
.sdm-case-link:hover { text-decoration: underline; }
.sdm-muted { color: #6c757d; }
.sdm-alert-name { margin-left: 0.4rem; display: inline-block; max-width: 260px; vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sdm-row-nocase td:first-child { box-shadow: inset 3px 0 0 #e8692a; }
[data-theme="dark"] .sdm-case-stat { background: var(--bg-tertiary); border-color: var(--border-color); color: var(--text-secondary); }
[data-theme="dark"] .sdm-case-stat b { color: var(--text-primary); }
[data-theme="dark"] .sdm-no-case { color: #ffa36b; }

/* SDM — monthly alert activity chart (palette validated for light + dark surfaces) */
.sdm-s-triggered { --sdm-c: #2b6cd4; }
.sdm-s-progress  { --sdm-c: #e8692a; }
.sdm-s-resolved  { --sdm-c: #119c86; }
.sdm-act-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin-bottom: 0.75rem; }
.sdm-act-tile { display: flex; gap: 0.5rem; align-items: flex-start; padding: 0.5rem 0.75rem; border: 1px solid #e9ecef; border-radius: 10px; min-width: 0; }
.sdm-act-swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--sdm-c); flex-shrink: 0; margin-top: 0.25rem; display: inline-block; }
.sdm-act-tile-body { display: flex; flex-direction: column; min-width: 0; }
.sdm-act-tile-label { font-size: 0.72rem; color: #6c757d; }
.sdm-act-tile-value { font-size: 1.15rem; font-weight: 700; color: #002d5c; line-height: 1.2; }
.sdm-act-tile-sub { font-size: 0.68rem; color: #6c757d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sdm-act-chart { display: grid; grid-template-columns: 36px 1fr; gap: 6px; height: 170px; }
.sdm-act-yaxis { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; font-size: 0.65rem; color: #6c757d; line-height: 1; }
.sdm-act-plot { position: relative; }
.sdm-act-grid { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.sdm-act-grid span { border-top: 1px solid #eef1f4; }
.sdm-act-grid span:last-child { border-top-color: #ced4da; }
.sdm-act-bars { position: absolute; inset: 0; display: flex; }
.sdm-act-group { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; padding: 0 12%; }
.sdm-act-bar { flex: 1; max-width: 14px; min-height: 0; background: var(--sdm-c); border-radius: 4px 4px 0 0; transition: height 0.3s ease; }
.sdm-act-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sdm-act-line { fill: none; stroke: var(--sdm-c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.sdm-act-dot { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--sdm-c); border: 2px solid #fff; transform: translate(-50%, 50%); pointer-events: none; }
.sdm-act-hits { position: absolute; inset: 0; display: flex; }
.sdm-act-hit { flex: 1; }
.sdm-act-hit.hover { background: rgba(0, 45, 92, 0.05); }
.sdm-act-tooltip { position: absolute; top: 0; transform: translateX(8px); background: #fff; border: 1px solid #dee2e6; border-radius: 8px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); padding: 0.45rem 0.6rem; font-size: 0.75rem; color: #212529; pointer-events: none; z-index: 2; min-width: 150px; }
.sdm-act-tooltip.flip { transform: translateX(calc(-100% - 8px)); }
.sdm-act-tooltip strong { display: block; margin-bottom: 0.25rem; color: #002d5c; }
.sdm-act-tip-row { display: flex; align-items: center; gap: 0.4rem; }
.sdm-act-tip-row .sdm-act-swatch { margin-top: 0; }
.sdm-act-tip-row b { margin-left: auto; padding-left: 0.75rem; }
.sdm-act-xlabels { display: flex; padding-left: 42px; margin-top: 0.3rem; font-size: 0.65rem; color: #6c757d; }
.sdm-act-xlabels span { flex: 1; text-align: center; white-space: nowrap; overflow: hidden; }
.sdm-act-table-wrap { max-height: 220px; overflow-y: auto; }
.sdm-act-note { display: block; margin-top: 0.5rem; font-size: 0.68rem; color: #6c757d; }
@media (max-width: 640px) { .sdm-act-summary { grid-template-columns: 1fr; } }

[data-theme="dark"] .sdm-act-tile { border-color: var(--border-color); }
[data-theme="dark"] .sdm-act-tile-value, [data-theme="dark"] .sdm-act-tooltip strong { color: var(--text-primary); }
[data-theme="dark"] .sdm-act-grid span { border-top-color: var(--border-color); }
[data-theme="dark"] .sdm-act-tooltip { background: var(--bg-secondary); border-color: var(--border-color); color: var(--text-primary); }
[data-theme="dark"] .sdm-act-dot { border-color: var(--bg-secondary); }
[data-theme="dark"] .sdm-act-hit.hover { background: rgba(255, 255, 255, 0.04); }

[data-theme="dark"] .sdm-row-selected .bar-label { color: var(--text-primary); }
[data-theme="dark"] .sdm-clickable:hover, [data-theme="dark"] .sdm-row-selected { background: var(--bg-tertiary); }

/* Shared chart card */
.cs-chart-card { background: #fff; border-radius: 16px; padding: 1.5rem; border: 1px solid #dee2e6; margin-bottom: 1.5rem; }
.cs-chart-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.25rem; }
.cs-chart-header h3 { font-size: 1rem; font-weight: 600; color: #002d5c; margin: 0 0 0.2rem 0; }
.cs-chart-sub { font-size: 0.78rem; color: #6c757d; }
.cs-clear-btn { font-size: 0.78rem; color: #e85a24; background: none; border: 1px solid #e85a24; border-radius: 6px; padding: 0.3rem 0.75rem; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.cs-clear-btn:hover { background: rgba(232, 90, 36, 0.06); }

/* Country horizontal bar chart */
.cs-bar-chart { display: flex; flex-direction: column; gap: 0.5rem; }
.cs-bar-row { display: grid; grid-template-columns: 160px 1fr 40px; align-items: center; gap: 0.75rem; padding: 0.45rem 0.75rem; border-radius: 8px; cursor: pointer; transition: background 0.15s; }
.cs-bar-row:hover { background: #f8f9fa; }
.cs-bar-row-sel { background: rgba(0, 45, 92, 0.04); }
.cs-bar-label { font-size: 0.84rem; color: #495057; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-bar-row-sel .cs-bar-label { font-weight: 600; color: #002d5c; }
.cs-bar-track { height: 10px; background: #e9ecef; border-radius: 5px; overflow: hidden; }
.cs-bar-fill { height: 100%; background: linear-gradient(90deg, #002d5c, #004080); border-radius: 5px; transition: width 0.4s ease; min-width: 4px; }
.cs-bar-fill-sel { background: linear-gradient(90deg, #e85a24, #ff7043); }
.cs-bar-num { font-size: 0.84rem; font-weight: 600; color: #002d5c; text-align: right; }

/* Detail section header */
.cs-detail-header { margin-bottom: 1.25rem; }
.cs-detail-header h2 { font-size: 1.2rem; font-weight: 700; color: #002d5c; margin: 0 0 0.2rem 0; }
.cs-detail-header span { font-size: 0.82rem; color: #6c757d; }

/* Side-by-side detail panels */
.cs-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.cs-sol-card, .cs-acc-card { margin-bottom: 0; }

/* Solutions donut + legend */
.cs-sol-layout { display: flex; align-items: flex-start; gap: 1.5rem; }
.cs-donut-wrap { position: relative; width: 130px; height: 130px; flex-shrink: 0; }
.cs-donut-svg { width: 130px; height: 130px; transform: rotate(-90deg); }
.cs-donut-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; }
.cs-donut-num { display: block; font-size: 1.4rem; font-weight: 700; color: #002d5c; line-height: 1.1; }
.cs-donut-lbl { font-size: 0.62rem; color: #6c757d; text-transform: uppercase; letter-spacing: 0.5px; }

.cs-sol-legend { flex: 1; display: flex; flex-direction: column; gap: 0.3rem; overflow-y: auto; max-height: 220px; }
.cs-sol-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.38rem 0.5rem; border-radius: 6px; cursor: pointer; transition: background 0.15s; font-size: 0.82rem; }
.cs-sol-row:hover { background: #f8f9fa; }
.cs-sol-active { background: rgba(0, 45, 92, 0.05); }
.cs-sol-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.cs-sol-name { flex: 1; color: #495057; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-sol-active .cs-sol-name { font-weight: 600; color: #002d5c; }
.cs-sol-pct { color: #adb5bd; font-size: 0.74rem; min-width: 30px; text-align: right; }
.cs-sol-count { font-weight: 600; color: #002d5c; min-width: 22px; text-align: right; }

/* Accounts empty state */
.cs-empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3rem 1rem; color: #adb5bd; gap: 0.75rem; text-align: center; min-height: 200px; }
.cs-empty-state svg { width: 44px; height: 44px; opacity: 0.35; }
.cs-empty-state p { margin: 0; font-size: 0.88rem; }
.cs-empty { padding: 2rem; text-align: center; color: #adb5bd; font-size: 0.88rem; }

/* Version distribution bars */
.cs-ver-section { margin-bottom: 1.25rem; padding-bottom: 1.25rem; border-bottom: 1px solid #e9ecef; }
.cs-ver-title { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: #6c757d; margin-bottom: 0.6rem; }
.cs-ver-row { display: grid; grid-template-columns: 110px 1fr 30px; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; }
.cs-ver-label { font-size: 0.78rem; color: #495057; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-ver-track { height: 7px; background: #e9ecef; border-radius: 4px; overflow: hidden; }
.cs-ver-fill { height: 100%; border-radius: 4px; transition: width 0.35s ease; min-width: 3px; }
.cs-ver-count { font-size: 0.78rem; font-weight: 600; color: #002d5c; text-align: right; }

/* Account list */
.cs-acc-list { display: flex; flex-direction: column; gap: 0.3rem; max-height: 300px; overflow-y: auto; }
.cs-acc-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.45rem 0.5rem; border-radius: 8px; }
.cs-acc-row:hover { background: #f8f9fa; }
.cs-acc-avatar { width: 32px; height: 32px; border-radius: 8px; background: #002d5c; display: flex; align-items: center; justify-content: center; font-size: 0.78rem; font-weight: 600; color: #fff; flex-shrink: 0; }
.cs-acc-info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cs-acc-customer { font-size: 0.84rem; font-weight: 500; color: #212529; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-acc-account { font-size: 0.74rem; color: #6c757d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-ver-pill { padding: 0.18rem 0.45rem; background: #f1f3f5; border: 1px solid #e9ecef; border-radius: 4px; font-size: 0.72rem; color: #495057; white-space: nowrap; flex-shrink: 0; }

/* Responsive */
@media (max-width: 1024px) {
    .cs-detail-grid { grid-template-columns: 1fr; }
    .cs-sol-card, .cs-acc-card { margin-bottom: 1.5rem; }
    .cs-score-row { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .cs-kpi-grid { grid-template-columns: 1fr; }
    .cs-bar-row { grid-template-columns: 120px 1fr 36px; }
}

/* ── Score note ──────────────────────────────────────────────────────── */
.cs-score-note { font-size: 0.78rem; color: #6c757d; margin: 0 0 1.25rem 0; line-height: 1.6; }

/* ── Tab bar ─────────────────────────────────────────────────────────── */
.cs-tab-bar { display: flex; gap: 0; border-bottom: 2px solid #e9ecef; margin-bottom: 1.5rem; }
.cs-tab { background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px; padding: 0.6rem 1.4rem; font-size: 0.9rem; font-weight: 500; color: #6c757d; cursor: pointer; transition: color 0.15s, border-color 0.15s; }
.cs-tab:hover { color: #002d5c; }
.cs-tab-active { color: #002d5c; border-bottom-color: #002d5c; }

/* ── Score layout ────────────────────────────────────────────────────── */
.cs-score-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
.cs-score-half { margin-bottom: 0 !important; }

/* ── Score bar fills ─────────────────────────────────────────────────── */
.cs-score-bar-fill { height: 100%; border-radius: 4px; transition: width 0.4s ease; }
.cs-score-healthy  { background: #28a745; }
.cs-score-fair     { background: #ffc107; }
.cs-score-risk     { background: #fd7e14; }
.cs-score-critical { background: #dc3545; }

/* ── Score badges ────────────────────────────────────────────────────── */
.cs-score-badge { display: inline-block; min-width: 38px; padding: 0.15rem 0.45rem; border-radius: 6px; font-size: 0.8rem; font-weight: 600; text-align: center; color: #fff; flex-shrink: 0; }
.cs-score-badge.cs-score-healthy  { background: #28a745; }
.cs-score-badge.cs-score-fair     { background: #ffc107; color: #212529; }
.cs-score-badge.cs-score-risk     { background: #fd7e14; }
.cs-score-badge.cs-score-critical { background: #dc3545; }

/* ── Matrix ──────────────────────────────────────────────────────────── */
.cs-matrix-wrap { overflow-x: auto; }
.cs-matrix-table { border-collapse: collapse; width: 100%; font-size: 0.8rem; }
.cs-matrix-table th, .cs-matrix-table td { border: 1px solid #dee2e6; padding: 0.35rem 0.5rem; white-space: nowrap; }
.cs-matrix-corner { background: #f8f9fa; min-width: 120px; }
.cs-matrix-ehead { background: #f1f3f5; font-weight: 600; color: #495057; text-align: center; min-width: 70px; font-size: 0.75rem; }
.cs-matrix-chead { background: #f8f9fa; font-weight: 500; color: #212529; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.cs-matrix-cell { text-align: center; font-weight: 600; font-size: 0.82rem; }
.cs-matrix-empty { color: #adb5bd; text-align: center; }
.cs-score-healthy-cell { background: #d4edda; color: #155724; }
.cs-score-fair-cell    { background: #fff3cd; color: #856404; }
.cs-score-risk-cell    { background: #fde8d0; color: #7d3802; }
.cs-score-critical-cell { background: #f8d7da; color: #721c24; }

/* ── Resource table ──────────────────────────────────────────────────── */
.cs-resource-table { border-collapse: collapse; width: 100%; font-size: 0.82rem; }
.cs-resource-table th { background: #f8f9fa; font-weight: 600; color: #495057; padding: 0.5rem 0.75rem; text-align: left; border-bottom: 2px solid #dee2e6; white-space: nowrap; }
.cs-resource-table td { padding: 0.4rem 0.75rem; border-bottom: 1px solid #f1f3f5; color: #212529; }
.cs-resource-table tr:hover td { background: #f8f9fa; }
.cs-res-name { font-weight: 500; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }

.link-darkblue {
    color: #002d5c;
    font-weight: 400;
   
}

/* Custom orange (#e85a24) for empty */
.link-orange-custom {
    color: #e85a24;
    font-weight: 400;
}


/*Toggle active/inactive customer*/
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

    .switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.slider {
    position: absolute;
    cursor: pointer;
    background-color: #ccc;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transition: .4s;
    border-radius: 24px;
}

    .slider:before {
        position: absolute;
        content: "";
        height: 18px;
        width: 18px;
        left: 3px;
        bottom: 3px;
        background-color: white;
        transition: .4s;
        border-radius: 50%;
    }

input:checked + .slider {
    background-color: #002d5c;
}

    input:checked + .slider:before {
        transform: translateX(22px);
    }


/* ═══════════════════════════════════════════════════════════════
   ENGINEER STATISTICS PAGE
   ═══════════════════════════════════════════════════════════════ */

/* Period Selector */
.period-selector {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
}

.period-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

    .period-btn:hover {
        color: var(--text-primary);
    }

    .period-btn.active {
        background: var(--bg-secondary);
        color: var(--hso-primary);
        box-shadow: 0 1px 3px var(--shadow);
    }

/* Stats Overview Cards */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.overview-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.2s ease;
}

    .overview-card:hover {
        box-shadow: 0 4px 12px var(--shadow);
    }

.overview-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .overview-icon svg {
        width: 24px;
        height: 24px;
    }

    .overview-icon.resolved {
        background: rgba(40, 167, 69, 0.1);
        color: #28a745;
    }

    .overview-icon.time {
        background: rgba(0, 45, 92, 0.1);
        color: var(--hso-primary);
    }

    .overview-icon.active {
        background: rgba(111, 66, 193, 0.1);
        color: #6f42c1;
    }

    .overview-icon.score {
        background: rgba(232, 90, 36, 0.1);
        color: var(--hso-accent);
    }

.overview-content {
    flex: 1;
    min-width: 0;
}

.overview-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    display: block;
    margin-bottom: 0.25rem;
}

    .overview-value .score-max {
        font-size: 1rem;
        font-weight: 400;
        color: var(--text-muted);
    }

.overview-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.5rem;
}

.overview-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

    .overview-trend.positive {
        background: rgba(40, 167, 69, 0.1);
        color: #28a745;
    }

    .overview-trend.negative {
        background: rgba(220, 53, 69, 0.1);
        color: #dc3545;
    }

.overview-subtext {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.score-bar {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--hso-accent), #ffc107);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Main Layout */
.engineer-stats-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stats-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Stats Card */
.stats-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

    .stats-card.full-width {
        grid-column: 1 / -1;
    }

.stats-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

    .stats-card-header h3 {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-size: 0.95rem;
        font-weight: 600;
        color: var(--text-primary);
        margin: 0;
    }

        .stats-card-header h3 svg {
            color: var(--hso-accent);
        }

.stats-card-body {
    padding: 1.25rem;
}

    .stats-card-body.no-padding {
        padding: 0;
    }

/* Sort Toggle */
.sort-toggle {
    display: flex;
    background: var(--bg-secondary);
    border-radius: 6px;
    padding: 3px;
    gap: 3px;
}

.sort-btn {
    padding: 0.375rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

    .sort-btn:hover {
        color: var(--text-primary);
    }

    .sort-btn.active {
        background: var(--hso-primary);
        color: #fff;
    }

/* Leaderboard */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 10px;
    transition: all 0.15s ease;
}

    .leaderboard-item:hover {
        background: var(--border-light);
    }

    .leaderboard-item.top-1 {
        background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 193, 7, 0.05));
        border: 1px solid rgba(255, 193, 7, 0.3);
    }

    .leaderboard-item.top-2 {
        background: linear-gradient(135deg, rgba(192, 192, 192, 0.1), rgba(192, 192, 192, 0.05));
        border: 1px solid rgba(192, 192, 192, 0.3);
    }

    .leaderboard-item.top-3 {
        background: linear-gradient(135deg, rgba(205, 127, 50, 0.1), rgba(205, 127, 50, 0.05));
        border: 1px solid rgba(205, 127, 50, 0.3);
    }

.rank {
    width: 32px;
    display: flex;
    justify-content: center;
}

.rank-medal {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.top-1 .rank-medal {
    background: linear-gradient(135deg, #ffc107, #ffdb58);
    color: #7d5a00;
}

.top-2 .rank-medal {
    background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
    color: #555;
}

.top-3 .rank-medal {
    background: linear-gradient(135deg, #cd7f32, #daa06d);
    color: #5c3a21;
}

.rank-number {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.engineer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}

    .engineer-avatar.small {
        width: 36px;
        height: 36px;
        font-size: 0.75rem;
    }

.engineer-info {
    flex: 1;
    min-width: 0;
}

.engineer-name {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.engineer-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.engineer-email {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
}

.engineer-metrics {
    display: flex;
    gap: 1.5rem;
}

.metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
}

.metric-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.metric-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.mini-score-ring {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: conic-gradient(var(--hso-accent) calc(var(--score) * 3.6deg), var(--border-color) 0);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

    .mini-score-ring::before {
        content: '';
        position: absolute;
        inset: 4px;
        background: var(--bg-tertiary);
        border-radius: 50%;
    }

    .mini-score-ring span {
        position: relative;
        font-size: 0.7rem;
        font-weight: 700;
        color: var(--text-primary);
    }

.trend-indicator {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

    .trend-indicator.up {
        color: #28a745;
    }

    .trend-indicator.down {
        color: #dc3545;
    }

/* Bar Chart */
.chart-container {
    height: 200px;
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 100%;
    gap: 0.75rem;
    padding-top: 1.5rem;
}

.bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.bar {
    width: 100%;
    background: linear-gradient(180deg, var(--hso-primary), var(--hso-primary-light));
    border-radius: 6px 6px 0 0;
    position: relative;
    min-height: 4px;
    transition: height 0.5s ease;
}

.bar-value {
    position: absolute;
    top: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.bar-label {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Severity Distribution */
.severity-distribution {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.severity-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.severity-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 60px;
}

.severity-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

    .severity-dot.sev-sev0 {
        background: #dc3545;
    }

    .severity-dot.sev-sev1 {
        background: #fd7e14;
    }

    .severity-dot.sev-sev2 {
        background: #ffc107;
    }

    .severity-dot.sev-sev3 {
        background: #17a2b8;
    }

    .severity-dot.sev-sev4 {
        background: #6c757d;
    }

.severity-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.severity-bar-wrapper {
    flex: 1;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.severity-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

    .severity-bar.sev-sev0 {
        background: #dc3545;
    }

    .severity-bar.sev-sev1 {
        background: #fd7e14;
    }

    .severity-bar.sev-sev2 {
        background: #ffc107;
    }

    .severity-bar.sev-sev3 {
        background: #17a2b8;
    }

    .severity-bar.sev-sev4 {
        background: #6c757d;
    }

.severity-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    width: 80px;
    text-align: right;
}

/* Activity Timeline */
.view-all-link {
    font-size: 0.8rem;
    color: var(--hso-primary);
    text-decoration: none;
}

    .view-all-link:hover {
        text-decoration: underline;
    }

.activity-timeline {
    display: flex;
    flex-direction: column;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}

    .activity-item:last-child {
        border-bottom: none;
    }

.activity-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: block;
    line-height: 1.4;
}

    .activity-text strong {
        color: var(--text-primary);
    }

.activity-target {
    color: var(--hso-primary);
}

.activity-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.activity-type {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .activity-type.resolved {
        background: rgba(40, 167, 69, 0.1);
        color: #28a745;
    }

    .activity-type.assigned {
        background: rgba(0, 45, 92, 0.1);
        color: var(--hso-primary);
    }

    .activity-type.comment {
        background: rgba(23, 162, 184, 0.1);
        color: #17a2b8;
    }

    .activity-type.escalated {
        background: rgba(220, 53, 69, 0.1);
        color: #dc3545;
    }

    .activity-type.case {
        background: rgba(111, 66, 193, 0.1);
        color: #6f42c1;
    }

    .activity-type.acknowledged {
        background: rgba(255, 193, 7, 0.1);
        color: #d39e00;
    }

/* Stats Table */
.table-search {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.85rem;
    width: 200px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

    .table-search:focus {
        outline: none;
        border-color: var(--hso-primary);
    }

.stats-table {
    width: 100%;
    border-collapse: collapse;
}

    .stats-table th {
        padding: 0.875rem 1rem;
        text-align: left;
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        color: var(--text-muted);
        background: var(--bg-tertiary);
        border-bottom: 1px solid var(--border-color);
    }

    .stats-table td {
        padding: 1rem;
        border-bottom: 1px solid var(--border-light);
        font-size: 0.875rem;
        color: var(--text-primary);
    }

    .stats-table tr:hover td {
        background: var(--bg-tertiary);
    }

.text-center {
    text-align: center;
}

.engineer-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.stat-pill {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

    .stat-pill.resolved {
        background: rgba(40, 167, 69, 0.1);
        color: #28a745;
    }

    .stat-pill.assigned {
        background: rgba(0, 45, 92, 0.1);
        color: var(--hso-primary);
    }

    .stat-pill.inprogress {
        background: rgba(255, 193, 7, 0.1);
        color: #d39e00;
    }

.rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
}

    .rating .star {
        color: #ddd;
    }

        .rating .star.filled {
            color: #ffc107;
        }

.rating-value {
    margin-left: 0.375rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.score-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
}

    .score-badge.excellent {
        background: rgba(40, 167, 69, 0.15);
        color: #28a745;
    }

    .score-badge.good {
        background: rgba(0, 45, 92, 0.1);
        color: var(--hso-primary);
    }

    .score-badge.average {
        background: rgba(255, 193, 7, 0.15);
        color: #d39e00;
    }

    .score-badge.needs-improvement {
        background: rgba(220, 53, 69, 0.1);
        color: #dc3545;
    }

.trend-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
    font-size: 0.85rem;
}

    .trend-cell.up {
        color: #28a745;
    }

    .trend-cell.down {
        color: #dc3545;
    }

/* Responsive */
@media (max-width: 1200px) {
    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
    }

    .engineer-stats-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .stats-overview {
        grid-template-columns: 1fr;
    }

    .engineer-metrics {
        gap: 0.75rem;
    }

    .leaderboard-item {
        flex-wrap: wrap;
    }

    .stats-table {
        font-size: 0.8rem;
    }

        .stats-table th,
        .stats-table td {
            padding: 0.625rem 0.5rem;
        }
}

/*Users and Groups*/

/* Admin Page Layout */
.admin-page {
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-content h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.header-content .subtitle {
    color: var(--text-secondary);
    margin: 0.25rem 0 0 0;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Search Box */
.search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-width: 200px;
}

    .search-box svg {
        width: 18px;
        height: 18px;
        color: var(--text-muted);
    }

/* Filter Select */
.filter-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
}

/* Users Table */
.users-table-container {
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

    .users-table th {
        text-align: left;
        padding: 1rem;
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 0.85rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        background: var(--bg-tertiary);
        border-bottom: 1px solid var(--border-color);
    }

    .users-table td {
        padding: 1rem;
        border-bottom: 1px solid var(--border-color);
    }

    .users-table tr:last-child td {
        border-bottom: none;
    }

    .users-table tr.inactive {
        opacity: 0.6;
    }

    .users-table tr:hover {
        background: var(--bg-tertiary);
    }

/* User Cell */
.user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
}

    .user-avatar.blue {
        background: #3b82f6;
    }

    .user-avatar.green {
        background: #10b981;
    }

    .user-avatar.orange {
        background: #f59e0b;
    }

    .user-avatar.purple {
        background: #8b5cf6;
    }

    .user-avatar.teal {
        background: #14b8a6;
    }

.user-email {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Group Badges */
.group-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.group-badge {
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

    .group-badge.more {
        background: var(--hso-primary-bg);
        color: var(--hso-primary);
    }

/* Status Badge */
.status-badge {
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

    .status-badge.active {
        background: #dcfce7;
        color: #166534;
    }

    .status-badge.inactive {
        background: #fef2f2;
        color: #991b1b;
    }

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}

    .btn-icon:hover {
        background: var(--bg-tertiary);
        color: var(--text-primary);
    }

    .btn-icon.danger:hover {
        background: #fef2f2;
        color: #dc2626;
    }

    .btn-icon:disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }

    .btn-icon svg {
        width: 18px;
        height: 18px;
    }

/* Groups Grid */
.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.group-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
}

.group-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.group-icon {
    width: 44px;
    height: 44px;
    background: var(--hso-primary-bg);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hso-primary);
}

    .group-icon svg {
        width: 22px;
        height: 22px;
    }

.group-info h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.group-info .user-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.group-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0 0 1rem 0;
}

.permissions-section h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.5rem 0;
}

.permission-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 1rem;
}

.permission-tag {
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

    .permission-tag.more {
        background: var(--hso-primary-bg);
        color: var(--hso-primary);
    }

.no-permissions {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
}

.group-card-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

    .modal-content.small {
        max-width: 400px;
    }

    .modal-content.large {
        max-width: 600px;
    }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

    .modal-header h2 {
        margin: 0;
        font-size: 1.25rem;
        font-weight: 600;
        color: var(--text-primary);
    }

.btn-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

    .btn-close:hover {
        background: var(--bg-tertiary);
    }

    .btn-close svg {
        width: 20px;
        height: 20px;
    }

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
}

    .form-group label {
        display: block;
        font-weight: 500;
        color: var(--text-primary);
        margin-bottom: 0.5rem;
    }

    .form-group input,
    .form-group textarea {
        width: 100%;
        padding: 0.625rem 0.75rem;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        font-size: 0.95rem;
        color: var(--text-primary);
        background: var(--bg-primary);
    }

        .form-group input:focus,
        .form-group textarea:focus {
            outline: none;
            border-color: var(--hso-primary);
            box-shadow: 0 0 0 3px var(--hso-primary-bg);
        }

        .form-group input:disabled {
            background: var(--bg-tertiary);
            cursor: not-allowed;
        }

.help-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.warning-text {
    color: #dc2626;
    font-size: 0.9rem;
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
}

    .checkbox-item:hover {
        background: var(--bg-tertiary);
    }

    .checkbox-item input[type="checkbox"] {
        width: 18px;
        height: 18px;
        margin-top: 2px;
        cursor: pointer;
    }

.checkbox-label {
    display: flex;
    flex-direction: column;
}

    .checkbox-label strong {
        color: var(--text-primary);
        font-weight: 500;
    }

    .checkbox-label small {
        color: var(--text-secondary);
        font-size: 0.8rem;
    }

.checkbox-item.inline {
    flex-direction: row;
    align-items: center;
}

/* Permissions Grid */
.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.permission-category h5 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--hso-primary);
    margin: 0 0 0.5rem 0;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

    .empty-state svg {
        width: 48px;
        height: 48px;
        margin-bottom: 1rem;
        opacity: 0.5;
    }

    .empty-state h3 {
        margin: 0;
        color: var(--text-primary);
    }

    .empty-state p {
        margin: 0.5rem 0 0 0;
    }

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

    .btn svg {
        width: 18px;
        height: 18px;
    }

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

    .btn-secondary:hover {
        background: var(--border-color);
    }

.btn-danger {
    background: #dc2626;
    color: #fff;
}

    .btn-danger:hover {
        background: #b91c1c;
    }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

    .btn-ghost:hover {
        background: var(--bg-tertiary);
        color: var(--text-primary);
    }

    .btn-ghost.danger:hover {
        background: #fef2f2;
        color: #dc2626;
    }

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Spinner */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Loading Container */
.loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

/* Admin Transition Overlay */
.admin-transition-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #002d5c 0%, #001a38 100%);
    animation: adminOverlayIn 0.5s ease-out forwards;
}

    .admin-transition-overlay.exiting {
        animation: adminOverlayOut 0.4s ease-in forwards;
    }

@keyframes adminOverlayIn {
    0% {
        opacity: 0;
        clip-path: circle(0% at 120px 85%);
    }

    100% {
        opacity: 1;
        clip-path: circle(150% at 120px 85%);
    }
}

@keyframes adminOverlayOut {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

.admin-transition-overlay .transition-content {
    text-align: center;
    color: #fff;
    animation: contentFadeIn 0.4s ease-out 0.2s both;
}

@keyframes contentFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.admin-transition-overlay .transition-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: rgba(232, 90, 36, 0.15);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: iconSpin 2s linear infinite;
}

    .admin-transition-overlay .transition-icon svg {
        width: 40px;
        height: 40px;
        color: #e85a24;
    }

@keyframes iconSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.admin-transition-overlay h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.admin-transition-overlay p {
    font-size: 1rem;
    opacity: 0.7;
    margin: 0 0 2rem 0;
}

.admin-transition-overlay .transition-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
}

    .admin-transition-overlay .transition-dots span {
        width: 10px;
        height: 10px;
        background: #e85a24;
        border-radius: 50%;
        animation: dotBounce 1.4s ease-in-out infinite;
    }

        .admin-transition-overlay .transition-dots span:nth-child(1) {
            animation-delay: 0s;
        }

        .admin-transition-overlay .transition-dots span:nth-child(2) {
            animation-delay: 0.2s;
        }

        .admin-transition-overlay .transition-dots span:nth-child(3) {
            animation-delay: 0.4s;
        }

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }

    40% {
        transform: scale(1.1);
        opacity: 1;
    }
}

/* Back to App button (styled like a link) */
button.back-to-app {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

    button.back-to-app:hover {
        background: var(--bg-tertiary);
        color: var(--hso-primary);
    }

    button.back-to-app svg {
        width: 20px;
        height: 20px;
    }

/* App Transition Overlay (Back to App) */
.app-transition-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #002d5c 0%, #001a38 100%);
    animation: appOverlayIn 0.5s ease-out forwards;
}

    .app-transition-overlay.exiting {
        animation: appOverlayOut 0.4s ease-in forwards;
    }

@keyframes appOverlayIn {
    0% {
        opacity: 0;
        clip-path: circle(0% at 15% 90%);
    }

    100% {
        opacity: 1;
        clip-path: circle(150% at 15% 90%);
    }
}

@keyframes appOverlayOut {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

.app-transition-overlay .transition-content {
    text-align: center;
    color: #fff;
    animation: contentFadeIn 0.4s ease-out 0.2s both;
}

@keyframes contentFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.app-transition-overlay .transition-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: rgba(232, 90, 36, 0.15);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: iconPulse 1.5s ease-in-out infinite;
}

    .app-transition-overlay .transition-icon svg {
        width: 40px;
        height: 40px;
        color: #e85a24;
    }

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.app-transition-overlay h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.app-transition-overlay p {
    font-size: 1rem;
    opacity: 0.7;
    margin: 0 0 2rem 0;
}

.app-transition-overlay .transition-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
}

    .app-transition-overlay .transition-dots span {
        width: 10px;
        height: 10px;
        background: #e85a24;
        border-radius: 50%;
        animation: dotBounce 1.4s ease-in-out infinite;
    }

        .app-transition-overlay .transition-dots span:nth-child(1) {
            animation-delay: 0s;
        }

        .app-transition-overlay .transition-dots span:nth-child(2) {
            animation-delay: 0.2s;
        }

        .app-transition-overlay .transition-dots span:nth-child(3) {
            animation-delay: 0.4s;
        }

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }

    40% {
        transform: scale(1.1);
        opacity: 1;
    }
}

/* Tabs */
.tabs-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0;
}

.tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: -1px;
}

    .tab:hover {
        color: var(--text-primary);
        background: var(--bg-tertiary);
    }

    .tab.active {
        color: var(--hso-primary);
        border-bottom-color: var(--hso-primary);
    }

    .tab svg {
        width: 18px;
        height: 18px;
    }

.tab-badge {
    padding: 0.125rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 10px;
    font-size: 0.8rem;
}

.tab.active .tab-badge {
    background: var(--hso-primary-bg);
    color: var(--hso-primary);
}

/* Tab Content */
.tab-content {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Toolbar */
.toolbar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center; /* stop children from stretching to the tallest sibling */
}

    /* Keep every toolbar control the same height for a clean row */
    .toolbar .search-box,
    .toolbar .filter-select,
    .toolbar .btn {
        height: 42px;
        box-sizing: border-box;
    }

    /* The search box is a flex wrapper (icon + input). Override the global
       absolute-positioned icon so it flows beside the input instead of on top. */
    .toolbar .search-box {
        position: relative;
        margin-bottom: 0;
    }

    .toolbar .search-box > svg {
        position: static;
        transform: none;
        flex-shrink: 0;
    }

    /* Neutralise the global oversized input padding so the inner input doesn't
       inflate the row or sit under the icon. */
    .toolbar .search-box input {
        padding: 0;
        border: none;
        background: transparent;
        box-shadow: none;
        width: 100%;
    }

    .search-box svg {
        width: 18px;
        height: 18px;
        color: var(--text-muted);
    }

.filter-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    min-width: 150px;
}

/* Table */
.table-container {
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

    .data-table th {
        text-align: left;
        padding: 1rem;
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 0.8rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        background: var(--bg-tertiary);
        border-bottom: 1px solid var(--border-color);
    }

    .data-table td {
        padding: 1rem;
        border-bottom: 1px solid var(--border-color);
        vertical-align: middle;
    }

    .data-table tr:last-child td {
        border-bottom: none;
    }

    .data-table tr:hover {
        background: var(--bg-tertiary);
    }

    .data-table tr.inactive-row {
        opacity: 0.6;
    }

.empty-row {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem !important;
}

/* User Cell */
.user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
}

    .avatar.blue {
        background: #3b82f6;
    }

    .avatar.green {
        background: #10b981;
    }

    .avatar.orange {
        background: #f59e0b;
    }

    .avatar.purple {
        background: #8b5cf6;
    }

    .avatar.teal {
        background: #14b8a6;
    }

.user-email {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Badges */
.group-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.badge {
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

    .badge.more {
        background: var(--hso-primary-bg);
        color: var(--hso-primary);
    }

.no-groups {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
}

.status-badge {
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

    .status-badge.active {
        background: #dcfce7;
        color: #166534;
    }

    .status-badge.inactive {
        background: #fef2f2;
        color: #991b1b;
    }

.code-badge {
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--hso-primary);
}

.category-badge {
    padding: 0.25rem 0.5rem;
    background: var(--hso-primary-bg);
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--hso-primary);
}

/* Permission Cell */
.permission-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.permission-icon {
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

    .permission-icon svg {
        width: 18px;
        height: 18px;
    }

.permission-name {
    font-weight: 500;
    color: var(--text-primary);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}

    .btn-icon:hover {
        background: var(--bg-tertiary);
        color: var(--text-primary);
    }

    .btn-icon.danger:hover {
        background: #fef2f2;
        color: #dc2626;
    }

    .btn-icon:disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }

    .btn-icon svg {
        width: 18px;
        height: 18px;
    }

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.group-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.2s;
}

    .group-card:hover {
        border-color: var(--hso-primary);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

.group-card-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.group-icon {
    width: 44px;
    height: 44px;
    background: var(--hso-primary-bg);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hso-primary);
    flex-shrink: 0;
}

    .group-icon svg {
        width: 22px;
        height: 22px;
    }

.group-info {
    flex: 1;
}

    .group-info h3 {
        margin: 0;
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--text-primary);
    }

    .group-info .user-count {
        font-size: 0.85rem;
        color: var(--text-secondary);
    }

.group-actions {
    display: flex;
    gap: 0.25rem;
}

.group-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0 0 1rem 0;
    line-height: 1.5;
}

.permissions-section h4 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.5rem 0;
}

.permission-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.permission-tag {
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

    .permission-tag.more {
        background: var(--hso-primary-bg);
        color: var(--hso-primary);
    }

.no-permissions {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

    .modal-content.large {
        max-width: 700px;
    }

    .modal-content.small {
        max-width: 400px;
    }

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

    .modal-header h2 {
        margin: 0;
        font-size: 1.25rem;
        font-weight: 600;
        color: var(--text-primary);
    }

.btn-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

    .btn-close:hover {
        background: var(--bg-tertiary);
    }

    .btn-close svg {
        width: 20px;
        height: 20px;
    }

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

    .form-group:last-child {
        margin-bottom: 0;
    }

    .form-group label {
        display: block;
        font-weight: 500;
        color: var(--text-primary);
        margin-bottom: 0.5rem;
    }

    .form-group .required {
        color: #dc2626;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        width: 100%;
        padding: 0.625rem 0.75rem;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        font-size: 0.95rem;
        color: var(--text-primary);
        background: var(--bg-primary);
        transition: border-color 0.2s, box-shadow 0.2s;
    }

        .form-group input:focus,
        .form-group textarea:focus,
        .form-group select:focus {
            outline: none;
            border-color: var(--hso-primary);
            box-shadow: 0 0 0 3px var(--hso-primary-bg);
        }

        .form-group input:disabled {
            background: var(--bg-tertiary);
            cursor: not-allowed;
        }

.help-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.warning-text {
    color: #dc2626;
    font-size: 0.9rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* Checkbox List */
.checkbox-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
}

.checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background 0.2s;
}

    .checkbox-item:hover {
        background: var(--bg-tertiary);
    }

    .checkbox-item input[type="checkbox"] {
        width: 18px;
        height: 18px;
        margin-top: 2px;
        cursor: pointer;
        accent-color: var(--hso-primary);
    }

.checkbox-label {
    display: flex;
    flex-direction: column;
}

    .checkbox-label strong {
        color: var(--text-primary);
        font-weight: 500;
    }

    .checkbox-label small {
        color: var(--text-secondary);
        font-size: 0.8rem;
    }

.checkbox-item.inline {
    align-items: center;
}

    .checkbox-item.inline span {
        color: var(--text-primary);
    }

.label-optional {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.form-group label .badge {
    margin-left: 0.5rem;
}

.form-group input.list-search {
    margin-bottom: 0.5rem;
}

/* Permissions Grid */
.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
}

.permission-category h5 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--hso-primary);
    margin: 0 0 0.5rem 0;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border-color);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

    .btn svg {
        width: 18px;
        height: 18px;
    }

    .btn-primary:hover {
        background: var(--hso-primary-light);
    }

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

    .btn-secondary:hover {
        background: var(--border-color);
    }

.btn-danger {
    background: #dc2626;
    color: #fff;
}

    .btn-danger:hover {
        background: #b91c1c;
    }

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Spinner */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Loading */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    gap: 1rem;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--hso-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

/* Utilities */
.text-muted {
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .toolbar {
        flex-direction: column;
    }

    .search-box {
        max-width: none;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .tabs-container {
        overflow-x: auto;
    }

    .tab {
        white-space: nowrap;
    }

}


.resource-card {
    background: var(--bg-secondary);
    color: var(--hso-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
}

/* ── Print / Export PDF ───────────────────────────────────────────────── */
.print-only { display: none; }
.header-actions { display: flex; align-items: center; gap: 0.75rem; }

@media print {
    /* Strip layout chrome */
    .admin-sidebar,
    .admin-sidebar-overlay,
    .admin-mobile-header     { display: none !important; }
    .admin-content           { margin-left: 0 !important; }
    .admin-page,
    .dashboard-page          { padding: 0.5rem !important; }

    /* Hide any element tagged no-print */
    .no-print                { display: none !important; }

    /* Show print-only elements */
    .print-only              { display: block !important; }

    /* Remove decorative shadows/backgrounds */
    .mud-paper,
    .mud-elevation-0         { box-shadow: none !important; background: transparent !important; }

    /* Tighten table for A4 */
    .mud-table-container     { overflow: visible !important; }
    .mud-table               { font-size: 10pt !important; width: 100% !important; }
    .mud-table th,
    .mud-table td            { padding: 5px 8px !important; font-size: 10pt !important; }

    /* Efficiency chips: print-safe (no colour fill) */
    .mud-chip                { border: 1px solid #495057 !important;
                               background: transparent !important;
                               color: #000 !important;
                               box-shadow: none !important; }

    /* Page setup */
    @page                    { size: A4 landscape; margin: 1.5cm; }
}

/* Print report header (hidden on screen, shown when printing) */
.print-report-header {
    border-bottom: 2px solid #002d5c;
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
}
.print-logo-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.print-title  { font-size: 1.2rem; font-weight: 700; color: #002d5c; }
.print-meta   { font-size: 0.8rem; color: #6c757d; }
.print-period { font-size: 0.85rem; color: #495057; margin-top: 0.25rem; }

/* ── NOC Heatmap ──────────────────────────────────────────────────────── */

.noc-description {
    font-size: 0.82rem;
    color: #6c757d;
    margin: 0 0 12px 0;
}

.noc-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.noc-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    font-size: 0.8rem;
    color: #495057;
}

.noc-legend-item { display: flex; align-items: center; gap: 0.375rem; }

.noc-legend-dot {
    width: 14px; height: 14px; border-radius: 3px; display: inline-block;
}
.noc-legend-dot-green  { background: #d4edda; border: 1px solid #28a745; }
.noc-legend-dot-yellow { background: #fff3cd; border: 1px solid #ffc107; }
.noc-legend-dot-red    { background: #f8d7da; border: 1px solid #dc3545; }
.noc-legend-dot-empty  { background: #f8f9fa; border: 1px solid #ced4da; }

.noc-dim-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.noc-dim-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    background: #f0f2f5;
    border: 1px solid #dee2e6;
    white-space: nowrap;
}

/* Heatmap grid */
.noc-grid-wrap {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color, #dee2e6);
}

.noc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    min-width: 680px;
}

.noc-table thead {
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 2;
}

.noc-table thead th {
    padding: 0.7rem 1.1rem;
    text-align: center;
    font-weight: 700;
    font-size: 0.8rem;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.noc-cust-head {
    text-align: left !important;
    min-width: 200px;
    padding-left: 1rem !important;
    color: #495057;
}

.noc-table tbody tr { border-bottom: 1px solid #f0f0f0; }
.noc-table tbody tr:hover { background: #f8f9fa; }

[data-theme="dark"] .noc-table tbody tr { border-bottom-color: var(--border-color); }
[data-theme="dark"] .noc-table tbody tr:hover { background: var(--bg-tertiary); }

.noc-cust-cell {
    padding: 0.55rem 1rem;
    white-space: nowrap;
}

.noc-cust-name {
    display: inline;
    font-size: 0.875rem;
    font-weight: 500;
    color: #212529;
}

.noc-cust-country {
    display: inline-block;
    font-size: 0.72rem;
    color: #6c757d;
    background: #f0f0f0;
    border-radius: 3px;
    padding: 0.1rem 0.35rem;
    margin-left: 0.4rem;
    vertical-align: middle;
}

.noc-cell {
    padding: 0.55rem 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: filter 0.12s ease, outline 0.1s ease;
    min-width: 88px;
    font-weight: 700;
    font-size: 0.9rem;
    border-left: 1px solid rgba(0,0,0,0.05);
    user-select: none;
}

.noc-cell:hover { filter: brightness(0.9); }

.noc-cell-green  { background: #d4edda; color: #155724; }
.noc-cell-yellow { background: #fff3cd; color: #856404; }
.noc-cell-red    { background: #f8d7da; color: #721c24; }
.noc-cell-empty  { background: #f8f9fa; color: #adb5bd; cursor: default; font-weight: 400; }
.noc-cell-active { outline: 3px solid #002d5c; outline-offset: -3px; }

/* Dimension header accent colours */
.noc-dim-critical  { color: #dc3545 !important; }
.noc-dim-high      { color: #fd7e14 !important; }
.noc-dim-medium    { color: #856404 !important; }
.noc-dim-repeating { color: #6f42c1 !important; }
.noc-dim-volume    { color: #0d6efd !important; }

/* Drill-down panel */
.noc-drill-panel {
    margin-top: 1.25rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    animation: noc-slide-in 0.18s ease;
}

@keyframes noc-slide-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.noc-drill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.noc-drill-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: #212529;
}

.noc-drill-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    color: #6c757d;
    line-height: 1;
    padding: 0 0.3rem;
    border-radius: 4px;
}
.noc-drill-close:hover { background: #e9ecef; color: #212529; }

.noc-drill-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.noc-drill-table thead th {
    background: #fff;
    padding: 0.55rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #6c757d;
    font-size: 0.73rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #f0f0f0;
}

.noc-drill-table tbody tr:hover { background: #f8f9fa; }

.noc-drill-table tbody td {
    padding: 0.45rem 1rem;
    border-bottom: 1px solid #f8f8f8;
    color: #212529;
    vertical-align: middle;
}

.noc-sev-pill {
    display: inline-block;
    padding: 0.18rem 0.5rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.noc-sev-0     { background: #f8d7da; color: #721c24; }
.noc-sev-1     { background: #fde8cc; color: #7d3c00; }
.noc-sev-2     { background: #fff3cd; color: #856404; }
.noc-sev-3     { background: #d4edda; color: #155724; }
.noc-sev-other { background: #e2e3e5; color: #383d41; }

/* Monitored resources upload page */
.monitored-upload {
    width: 100%;
}

.monitored-upload .page-header {
    margin-bottom: 1.25rem;
}

.upload-eyebrow {
    margin-bottom: 0.4rem;
    color: var(--hso-accent);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.upload-card {
    padding: 1.5rem;
}

.upload-intro {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    margin-bottom: 0;
}

.upload-intro-heading {
    min-width: 0;
}

.monitored-upload .upload-catalog-card {
    margin-top: 48px;
}

.upload-intro-title {
    color: var(--hso-primary);
    font-weight: 600;
}

.upload-intro-copy {
    margin-top: 0.25rem;
    color: var(--text-secondary);
}

.upload-stepper-toggle {
    display: inline-flex;
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 2.25rem;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 2px;
    background: var(--bg-secondary);
    color: var(--hso-primary);
    cursor: pointer;
}

.upload-stepper-toggle:hover,
.upload-stepper-toggle:focus-visible {
    border-color: var(--hso-primary);
    outline-color: var(--hso-accent);
}

.upload-stepper {
    color: var(--text-primary);
}

.upload-step-content {
    width: 100%;
    box-sizing: border-box;
    margin: 1.5rem 0 0;
}

.upload-step-heading {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    margin-bottom: 1.25rem;
}

.upload-step-heading-action {
    align-items: center;
}

.upload-step-number {
    display: inline-flex;
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 2.25rem;
    align-items: center;
    justify-content: center;
    color: var(--hso-primary);
    background: rgba(0, 45, 92, 0.08);
    border-left: 2px solid var(--hso-accent);
    font-size: 0.75rem;
    font-weight: 700;
}

.upload-step-title {
    color: var(--text-primary);
    font-weight: 600;
}

.upload-step-description {
    margin-top: 0.2rem;
    color: var(--text-secondary);
}

.upload-search-dropdown {
    position: relative;
    width: 100%;
}

.upload-field-label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
}

.upload-field-trigger.dropdown-trigger {
    width: 100%;
    min-height: 2.5rem;
    box-sizing: border-box;
    justify-content: space-between;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 2px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
}

.upload-field-trigger.dropdown-trigger:hover,
.upload-field-trigger.dropdown-trigger:focus-visible,
.upload-field-trigger.dropdown-trigger.active {
    border-color: var(--hso-primary) !important;
    background: var(--bg-secondary);
    color: var(--hso-primary) !important;
}

.upload-field-trigger.dropdown-trigger:focus-visible {
    outline: 2px solid var(--hso-accent);
    outline-offset: 1px;
}

.upload-field-trigger.dropdown-trigger:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.upload-field-trigger.dropdown-trigger svg {
    flex: 0 0 auto;
    color: var(--hso-primary);
}

.upload-search-dropdown .dropdown-menu {
    width: 100%;
    min-width: 0;
    border-radius: 2px;
}

.upload-search-dropdown .dropdown-search input {
    border-radius: 2px;
    border-color: var(--border-color);
    color: var(--text-primary);
    width: 100%;
}

.upload-search-dropdown .dropdown-search input:focus {
    border-color: var(--hso-primary);
    box-shadow: 0 0 0 1px var(--hso-primary);
}

.upload-dropdown-option {
    width: 100%;
    justify-content: space-between;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    text-align: left;
}

.upload-dropdown-option.selected {
    background: rgba(0, 45, 92, 0.08) !important;
    color: var(--hso-primary) !important;
    font-weight: 600;
}

.upload-option-check {
    color: var(--hso-accent);
    font-weight: 700;
}

.upload-step-counter {
    color: var(--hso-accent) !important;
}

.upload-table-toolbar {
    display: flex;
    width: 100%;
    justify-content: flex-start;
}

.upload-hint {
    display: block;
    margin-top: 0.75rem;
    color: var(--hso-primary) !important;
}

.upload-add-button {
    margin: 0;
    align-content: end;
}

.upload-loading {
    display: flex;
    min-height: 5rem;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: var(--text-secondary);
}

.upload-actions-heading,
.upload-actions-cell {
    width: 1%;
    text-align: right;
    white-space: nowrap;
}

.upload-empty-state {
    padding: 1.25rem;
    color: var(--text-secondary);
    text-align: center;
}

.upload-dropzone {
    position: relative;
    margin-top: 1.5rem;
}

.upload-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

.upload-file-label {
    display: flex;
    min-height: 12rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem;
    border: 1px dashed var(--border-color);
    background: var(--bg-tertiary);
    color: var(--hso-primary);
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.upload-file-label:hover,
.upload-file-input:focus-visible + .upload-file-label {
    border-color: var(--hso-accent);
    background: rgba(232, 90, 36, 0.04);
}

.upload-file-label .mud-icon-root {
    color: var(--hso-accent);
}

.upload-file-title {
    font-weight: 600;
}

.upload-file-caption {
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.upload-file-button {
    margin-top: 0.5rem;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--hso-primary);
    color: var(--hso-primary);
    font-size: 0.8125rem;
}

.upload-grid-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.upload-table {
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.monitored-upload .upload-catalog-filters {
    margin-bottom: 32px;
}

.upload-catalog-toolbar {
    justify-content: flex-start;
}

.upload-catalog-package {
    color: var(--hso-primary);
    font-weight: 600;
}

.upload-catalog-package-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.upload-package-toggle {
    display: inline-flex;
    width: 1.75rem;
    height: 1.75rem;
    flex: 0 0 1.75rem;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--hso-primary);
    cursor: pointer;
}

.upload-package-toggle:hover,
.upload-package-toggle:focus-visible {
    color: var(--hso-accent);
    outline-color: var(--hso-accent);
}

.upload-catalog-solutions {
    margin: 0.5rem 0 0.25rem 2.25rem;
    padding-left: 0.875rem;
    border-left: 2px solid var(--hso-accent);
}

.upload-catalog-solution-row {
    padding: 0.5rem 0;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.upload-catalog-solution-row:last-child {
    border-bottom: 0;
}

.upload-package-cell .upload-empty-state {
    padding: 0.5rem 0;
    text-align: left;
}

.upload-stepper .mud-stepper {
    background: transparent;
}

.upload-stepper .mud-stepper-nav .mud-step-label {
    color: var(--hso-primary) !important;
}

.upload-stepper .mud-stepper-nav .mud-step-label * {
    color: inherit !important;
}

.upload-stepper .mud-stepper-nav .mud-step .mud-step-label-content,
.upload-stepper .mud-stepper-nav .mud-step .mud-step-label-content * {
    color: var(--hso-primary) !important;
}

.upload-stepper .mud-stepper-nav .mud-step .mud-step-label-icon {
    background-color: var(--hso-primary) !important;
    color: #fff !important;
}

.upload-stepper .mud-stepper-nav .mud-step .mud-step-label-icon * {
    color: #fff !important;
}

.upload-stepper .upload-back-button.mud-button-outlined-primary {
    border-color: var(--hso-primary) !important;
    color: var(--hso-primary) !important;
}

.upload-stepper .upload-back-button.mud-button-outlined-primary:hover {
    background: rgba(0, 45, 92, 0.06) !important;
}

.upload-stepper .mud-input-control {
    margin-top: 0.25rem;
}

.upload-stepper .mud-input-outlined-border {
    border-radius: 2px;
}

.upload-stepper .mud-table-container {
    border-radius: 2px;
}

.upload-stepper .mud-table-head .mud-table-cell {
    color: var(--hso-primary);
}

@media (max-width: 640px) {
    .upload-card {
        padding: 1rem;
    }

    .upload-intro {
        align-items: flex-start;
    }

    .upload-step-content {
        margin-top: 1rem;
        width: 100%;
    }

    .upload-add-button {
        width: auto;
    }

    .upload-file-label {
        min-height: 10rem;
        padding: 1rem;
    }
}

.two-factor-modal {
    max-width: 500px;
    border-radius: 14px;
}

.two-factor-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.4rem 1.5rem 1rem;
}

.two-factor-modal-heading {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.two-factor-modal-heading h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 650;
    line-height: 1.35;
}

.two-factor-modal-icon {
    position: relative;
    display: inline-flex;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--bg-tertiary);
    color: var(--hso-primary);
}

.two-factor-security-icon {
    width: 25px;
    height: 25px;
}

.two-factor-restart-badge {
    position: absolute;
    right: -4px;
    bottom: -3px;
    width: 17px;
    height: 17px;
    padding: 2px;
    border: 1px solid var(--bg-secondary);
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--hso-primary);
}

.two-factor-modal-close {
    display: inline-flex;
    flex: 0 0 32px;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.two-factor-modal-close:hover:not(:disabled) {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.two-factor-modal-close:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.two-factor-modal-body {
    padding: 0.75rem 1.5rem 1.25rem;
}

.two-factor-question {
    margin: 0 0 0.45rem;
    color: var(--text-primary);
    font-size: 1rem;
}

.two-factor-description {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.93rem;
    line-height: 1.55;
}

.two-factor-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    margin-top: 1.1rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: 9px;
    background: rgba(220, 38, 38, 0.07);
    color: var(--text-primary);
}

.two-factor-warning > svg {
    flex: 0 0 19px;
    width: 19px;
    height: 19px;
    margin-top: 1px;
    color: #b91c1c;
}

.two-factor-warning > div {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.88rem;
    line-height: 1.45;
}

.two-factor-warning strong {
    color: #b91c1c;
}

.two-factor-warning span {
    color: var(--text-secondary);
}

.two-factor-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    padding: 1rem 1.5rem 1.4rem;
    border-top: 1px solid var(--border-color);
}

.two-factor-cancel {
    padding: 0.6rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    cursor: pointer;
}

.two-factor-cancel:hover:not(:disabled) {
    background: var(--bg-tertiary);
}

.two-factor-cancel:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.two-factor-confirm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-width: 132px;
}

.two-factor-confirm svg {
    width: 17px;
    height: 17px;
}

@media (max-width: 480px) {
    .two-factor-modal-header {
        padding: 1.15rem 1rem 0.85rem;
    }

    .two-factor-modal-heading {
        gap: 0.65rem;
    }

    .two-factor-modal-heading h2 {
        font-size: 1rem;
    }

    .two-factor-modal-body {
        padding: 0.65rem 1rem 1rem;
    }

    .two-factor-modal-footer {
        padding: 0.85rem 1rem 1rem;
    }
}

