/* ==========================================================================
   Helpdesk APIK - Modern Enterprise Admin Theme System
   Sidebar Layout with Dual Mode (Light & Dark Theme)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root, [data-theme="light"] {
    --bg-canvas: #F8FAFC;
    --bg-sidebar: #0B1325;
    --bg-sidebar-hover: rgba(255, 255, 255, 0.07);
    --bg-sidebar-active: rgba(255, 174, 0, 0.15);
    --sidebar-text: #CBD5E1;
    --sidebar-text-muted: #64748B;
    --sidebar-text-active: #FFAE00;
    --bg-topbar: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-subtle: #F1F5F9;
    --border-color: #E2E8F0;
    --border-color-focus: #FFAE00;
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #64748B;
    --shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --brand-gold: #FFAE00;
    --brand-gold-hover: #F59E0B;
    --brand-navy: #0B1325;
    --brand-green: #10B981;
    --brand-blue: #3B82F6;
    --brand-red: #EF4444;
    --sidebar-width: 270px;
    --topbar-height: 62px;
    --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

[data-theme="dark"] {
    --bg-canvas: #070D19;
    --bg-sidebar: #0B1325;
    --bg-sidebar-hover: rgba(255, 255, 255, 0.06);
    --bg-sidebar-active: rgba(255, 174, 0, 0.15);
    --sidebar-text: #E2E8F0;
    --sidebar-text-muted: #64748B;
    --sidebar-text-active: #FFAE00;
    --bg-topbar: #0F172A;
    --bg-card: #0F172A;
    --bg-subtle: #1E293B;
    --border-color: #1E293B;
    --border-color-focus: #FFAE00;
    --text-primary: #F8FAFC;
    --text-secondary: #CBD5E1;
    --text-muted: #94A3B8;
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.25), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

/* ==================== BASE OVERRIDES ==================== */
html, body {
    font-family: var(--font-family) !important;
    background-color: var(--bg-canvas) !important;
    color: var(--text-primary) !important;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* ==================== LAYOUT WRAPPER ==================== */
.admin-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ==================== LEFT SIDEBAR ==================== */
.admin-sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    color: var(--sidebar-text);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

/* Sidebar Brand Header */
.sidebar-header {
    height: var(--topbar-height);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.15);
}

.sidebar-emblem {
    width: 34px;
    height: 42px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
}

.brand-main-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #FFFFFF;
    letter-spacing: -0.2px;
    line-height: 1.2;
}

.brand-main-title .gold-accent {
    color: var(--brand-gold);
}

.brand-sub-title {
    font-size: 0.72rem;
    color: var(--sidebar-text-muted);
    font-weight: 500;
}

/* Sidebar Scrollable Nav */
.sidebar-nav-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.75rem;
}

.sidebar-nav-container::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.nav-section-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--sidebar-text-muted);
    padding: 0.75rem 0.75rem 0.4rem 0.75rem;
    margin-top: 0.5rem;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-menu-item .sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 0.85rem;
    color: var(--sidebar-text);
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-link i {
    font-size: 1.15rem;
    width: 20px;
    text-align: center;
    color: #94A3B8;
    transition: color 0.2s ease;
}

.sidebar-link:hover {
    background-color: var(--bg-sidebar-hover);
    color: #FFFFFF;
}

.sidebar-link:hover i {
    color: var(--brand-gold);
}

.sidebar-link.active {
    background-color: #16243d;
    color: #FFFFFF;
    font-weight: 600;
    border-left: 3.5px solid var(--brand-gold);
}

.sidebar-link.active i {
    color: var(--brand-gold);
}

.sidebar-link.active span {
    color: #FFFFFF;
}

/* Sidebar Footer (User Card) */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.2);
}

.user-compact-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-gold) 0%, #D97706 100%);
    color: #000;
    font-weight: 800;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-compact-info {
    flex: 1;
    min-width: 0;
}

.user-compact-name {
    font-size: 0.84rem;
    font-weight: 700;
    color: #FFFFFF;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-compact-role {
    font-size: 0.72rem;
    color: var(--brand-gold);
    font-weight: 600;
}

/* ==================== MAIN CONTENT AREA ==================== */
.admin-main-wrap {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
    background-color: var(--bg-canvas);
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Topbar Header */
.admin-topbar {
    height: var(--topbar-height);
    background-color: var(--bg-topbar);
    border-bottom: 1px solid var(--border-color);
    padding: 0 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1020;
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.35rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    display: none;
}

.btn-sidebar-toggle:hover {
    background-color: var(--bg-subtle);
}

.topbar-ribbon-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.2px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

/* Theme Toggle Button (Sun/Moon) */
.btn-theme-toggle {
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.btn-theme-toggle:hover {
    background-color: var(--brand-gold);
    color: #000;
    border-color: var(--brand-gold);
    transform: rotate(15deg);
}

/* User Dropdown */
.topbar-user-btn {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    padding: 0.32rem 0.85rem;
    border-radius: 30px;
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.topbar-user-btn:hover {
    background-color: var(--border-color);
    color: var(--text-primary);
}

.topbar-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-gold) 0%, #D97706 100%);
    color: #000;
    font-weight: 800;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.topbar-user-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.1px;
}

.topbar-user-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
}

/* Content Body */
.admin-content-body {
    flex: 1;
    padding: 1.75rem 2rem;
}

@media (max-width: 768px) {
    .admin-content-body {
        padding: 1rem;
    }
}

/* Admin Footer */
.admin-footer {
    padding: 1rem 2rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-topbar);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ==================== COMPONENT STYLING (CARDS, TABLES, FORMS) ==================== */
.card {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 16px !important;
    box-shadow: var(--shadow-card) !important;
    color: var(--text-primary) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.25s ease, border-color 0.25s ease;
    overflow: hidden;
}

.card-header {
    background-color: transparent !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 1rem 1.35rem !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    color: var(--text-primary) !important;
}

.card-body {
    padding: 1.35rem !important;
}

.card-footer {
    background-color: transparent !important;
    border-top: 1px solid var(--border-color) !important;
    padding: 0.85rem 1.35rem !important;
}

/* Modern Metric Cards */
.stat-card-modern {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.35rem;
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.stat-card-modern:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.stat-card-info h3 {
    font-size: 1.85rem;
    font-weight: 800;
    margin: 0;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-card-info p {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0.25rem 0 0 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card-icon-bubble {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.bubble-red {
    background: rgba(239, 68, 68, 0.12);
    color: #EF4444;
}

.bubble-dark {
    background: rgba(100, 116, 139, 0.15);
    color: var(--text-primary);
}

.bubble-gold {
    background: rgba(255, 174, 0, 0.15);
    color: var(--brand-gold);
}

.bubble-green {
    background: rgba(16, 185, 129, 0.12);
    color: #10B981;
}

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

/* Tables in Modern Theme */
.table {
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

.table thead th {
    background-color: var(--bg-subtle) !important;
    color: var(--text-primary) !important;
    font-weight: 700 !important;
    font-size: 0.84rem !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color) !important;
    padding: 0.75rem 0.85rem !important;
}

.table tbody td {
    padding: 0.75rem 0.85rem !important;
    font-size: 0.9rem !important;
    border-color: var(--border-color) !important;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: var(--bg-subtle) !important;
}

/* Form Inputs in Modern Theme */
.form-control, .form-select {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 10px !important;
    font-size: 0.9rem !important;
    padding: 0.55rem 0.85rem !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--brand-gold) !important;
    box-shadow: 0 0 0 3px rgba(255, 174, 0, 0.2) !important;
}

.form-control::placeholder {
    color: var(--text-muted) !important;
}

/* Primary Button Gold */
.btn-warning {
    background-color: var(--brand-gold) !important;
    border-color: var(--brand-gold) !important;
    color: #000000 !important;
    font-weight: 700 !important;
    border-radius: 10px !important;
    padding: 0.5rem 1.15rem !important;
    transition: all 0.2s ease !important;
}

.btn-warning:hover {
    background-color: var(--brand-gold-hover) !important;
    border-color: var(--brand-gold-hover) !important;
    transform: translateY(-1px);
}

/* ==================== IMAGE 2 REFERENCE ENHANCEMENTS ==================== */
/* 1. Pinned Announcement Banner */
.pinned-banner-card {
    background: linear-gradient(135deg, #1E3A8A 0%, #0F172A 100%);
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    border-radius: 14px !important;
    padding: 1rem 1.35rem;
    color: #FFFFFF !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.15);
}
.pinned-banner-badge {
    background-color: #EF4444;
    color: #FFFFFF;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    letter-spacing: 0.5px;
}
.pinned-banner-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #FFFFFF;
    flex-shrink: 0;
}
.pinned-banner-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
    border-radius: 8px;
    padding: 0.4rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s ease;
    text-decoration: none;
}
.pinned-banner-btn:hover {
    background: #FFFFFF;
    color: #0F172A;
}

/* 2. Stat Cards with Accent Borders (Persis Gambar 2) */
.metric-card-accent {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 14px !important;
    padding: 1.15rem 1.25rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.metric-card-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}
.metric-card-accent::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3.5px;
}
.metric-card-green::after { background-color: #10B981; }
.metric-card-orange::after { background-color: #F59E0B; }
.metric-card-blue::after { background-color: #3B82F6; }
.metric-card-red::after { background-color: #EF4444; }

.metric-circle-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}
.metric-circle-green { background-color: #ECFDF5; color: #10B981; }
.metric-circle-orange { background-color: #FFFBEB; color: #F59E0B; }
.metric-circle-blue { background-color: #EFF6FF; color: #3B82F6; }
.metric-circle-red { background-color: #FEF2F2; color: #EF4444; }

[data-theme="dark"] .metric-circle-green { background-color: rgba(16, 185, 129, 0.15); color: #34D399; }
[data-theme="dark"] .metric-circle-orange { background-color: rgba(245, 158, 11, 0.15); color: #FBBF24; }
[data-theme="dark"] .metric-circle-blue { background-color: rgba(59, 130, 246, 0.15); color: #60A5FA; }
[data-theme="dark"] .metric-circle-red { background-color: rgba(239, 68, 68, 0.15); color: #F87171; }

/* 3. Aksi Cepat (Quick Actions Grid) */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.6rem;
}
@media (max-width: 576px) {
    .quick-actions-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.4rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-subtle);
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    text-align: center;
}
.quick-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    color: var(--text-primary);
    background-color: var(--bg-card);
    border-color: #3B82F6;
}
.quick-action-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 0.4rem;
}
.quick-action-title {
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-muted);
}
.quick-action-btn:hover .quick-action-title {
    color: var(--text-primary);
}

/* 4. Modern Primary Button (Pengganti Kuning Jadul) */
.btn-primary {
    background-color: #2563EB !important;
    border-color: #2563EB !important;
    color: #FFFFFF !important;
    font-weight: 600 !important;
    border-radius: 10px !important;
    padding: 0.5rem 1.25rem !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25) !important;
    transition: all 0.2s ease !important;
}
.btn-primary:hover {
    background-color: #1D4ED8 !important;
    border-color: #1D4ED8 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35) !important;
}

/* 5. Period Pill Toggle (Bulan Ini vs Tahun Ini) */
.btn-toggle-period {
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.3rem 0.85rem;
    border: 1px solid var(--border-color);
    background: var(--bg-subtle);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-toggle-period.active {
    background-color: #2563EB;
    border-color: #2563EB;
    color: #FFFFFF;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

/* 6. Clickable Employee Name in Analytics */
.link-pegawai-drilldown {
    color: #2563EB;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s ease;
}
.link-pegawai-drilldown:hover {
    color: #1D4ED8;
    text-decoration: underline;
}
[data-theme="dark"] .link-pegawai-drilldown {
    color: #60A5FA;
}
[data-theme="dark"] .link-pegawai-drilldown:hover {
    color: #93C5FD;
}

/* ==================== RESPONSIVE RULES ==================== */
@media (max-width: 991.98px) {
    .btn-sidebar-toggle {
        display: inline-block;
    }

    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.show {
        transform: translateX(0);
    }

    .admin-main-wrap {
        margin-left: 0;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1030;
        display: none;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

/* ==========================================================================
   MODERN GOVERNMENT OPERATOR WORKSPACE (RESET AKUN / PERANGKAT)
   ========================================================================== */
.operator-header {
    margin-bottom: 24px;
}
.operator-page-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}
.operator-page-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

.operator-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 22px;
    box-shadow: var(--shadow-card);
}

.search-operator-box {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-card);
}

.operator-input-label {
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
    display: block;
}

.operator-input-nip {
    font-family: monospace, sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-canvas);
    color: var(--text-primary);
    padding: 10px 14px;
}
.operator-input-nip:focus {
    border-color: #2563EB;
    background-color: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.btn-operator-search {
    background-color: #2563EB;
    color: #FFFFFF;
    font-weight: 600;
    font-size: 0.92rem;
    border-radius: 8px;
    padding: 10px 22px;
    border: none;
    transition: all 0.15s ease-in-out;
}
.btn-operator-search:hover {
    background-color: #1D4ED8;
    color: #FFFFFF;
}

/* Device Status Panel */
.device-status-panel {
    border-radius: 10px;
    padding: 18px 20px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}
.device-status-connected {
    border-left: 5px solid #10B981;
    background-color: rgba(16, 185, 129, 0.05);
}
.device-status-free {
    border-left: 5px solid #3B82F6;
    background-color: rgba(59, 130, 246, 0.05);
}
.device-status-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 2px;
}
.device-uuid-box {
    font-family: monospace;
    font-size: 0.92rem;
    font-weight: 600;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 3px 10px;
    border-radius: 6px;
    color: var(--text-primary);
    display: inline-block;
}

/* Profile Summary */
.profile-summary-wrap {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 22px;
    margin-bottom: 20px;
}
.profile-main-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3px;
}
.profile-sub-nip {
    font-size: 0.88rem;
    color: var(--text-muted);
    font-family: monospace;
    margin-bottom: 4px;
}
.profile-sub-jabatan {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2563EB;
}
[data-theme="dark"] .profile-sub-jabatan {
    color: #60A5FA;
}

.profile-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    margin-top: 16px;
}
.profile-meta-item .meta-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 3px;
}
.profile-meta-item .meta-val {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Action Box */
.device-action-box {
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 22px;
}
.btn-action-unlock {
    background-color: #DC2626;
    color: #FFFFFF;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 9px 20px;
    border-radius: 8px;
    border: none;
    transition: all 0.15s ease-in-out;
}
.btn-action-unlock:hover {
    background-color: #B91C1C;
    color: #FFFFFF;
}

/* History Table Modern Clean */
.history-table-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}
.history-table-clean {
    width: 100%;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.86rem;
}
.history-table-clean th {
    background-color: var(--bg-subtle);
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 11px 16px;
    border-bottom: 1px solid var(--border-color);
}
.history-table-clean td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    vertical-align: middle;
}
.history-table-clean tr:last-child td {
    border-bottom: none;
}
.history-table-clean tr:hover td {
    background-color: var(--bg-subtle);
}

/* Face Comparison & Frames */
.face-compare-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.face-frame-box {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    box-shadow: var(--shadow-card);
}
.face-frame-img {
    width: 130px;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.face-frame-img:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}
.face-frame-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 10px;
    margin-bottom: 2px;
}
.face-frame-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Modern Ticket Cards */
.ticket-item-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-card);
    transition: all 0.2s ease;
}
.ticket-item-card:hover {
    border-color: #2563EB;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}
.ticket-code-badge {
    font-family: var(--font-mono, monospace);
    font-weight: 700;
    color: #2563EB;
    font-size: 0.88rem;
}
.ticket-desc-box {
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* ==========================================================================
   PORTAL PEGAWAI - MODERN GOVERNMENT EMPLOYEE PORTAL DESIGN SYSTEM
   Clean, Professional, Trustworthy, Accessible Light & Dark Mode
   ========================================================================== */

/* 1. Page Header & Greeting */
.portal-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.portal-greeting-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    letter-spacing: -0.3px;
}

.portal-greeting-sub {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

.portal-date-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 0.45rem 0.95rem;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    box-shadow: var(--shadow-card);
}

.portal-user-meta-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.portal-user-meta-bar span.meta-val {
    color: var(--text-primary);
    font-weight: 600;
}

/* 2. Information Banner (Subtle & Non-Intimidating) */
.portal-info-banner {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--brand-blue);
    border-radius: 12px;
    padding: 0.85rem 1.15rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-card);
    transition: all 0.2s ease;
}

.portal-info-banner-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background-color: rgba(37, 99, 235, 0.1);
    color: #2563EB;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

[data-theme="dark"] .portal-info-banner-icon {
    background-color: rgba(59, 130, 246, 0.2);
    color: #60A5FA;
}

.portal-info-banner-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.portal-info-banner-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0;
    line-height: 1.45;
}

.portal-info-collapse {
    border-top: 1px solid var(--border-color);
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* 3. Hero Status Card (Status Akun & Perangkat) */
.portal-hero-status {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.35rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.portal-hero-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 1.15rem;
    border-bottom: 1px solid var(--border-color);
}

.portal-status-badge-lg {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.85rem;
    border-radius: 30px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.portal-status-badge-lg.status-safe {
    background-color: rgba(16, 185, 129, 0.12);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

[data-theme="dark"] .portal-status-badge-lg.status-safe {
    background-color: rgba(16, 185, 129, 0.18);
    color: #34D399;
    border-color: rgba(16, 185, 129, 0.3);
}

.portal-status-badge-lg.status-warn {
    background-color: rgba(245, 158, 11, 0.12);
    color: #D97706;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    background-color: currentColor;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
    animation: pulseDotAnim 2s infinite;
}

@keyframes pulseDotAnim {
    0% { transform: scale(0.95); opacity: 0.8; }
    70% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

.portal-hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-top: 1.15rem;
}

.portal-status-item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    background-color: var(--bg-subtle);
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.portal-status-item:hover {
    border-color: var(--border-color);
}

.portal-status-icon-box {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.portal-status-label {
    font-size: 0.76rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.4px;
    margin-bottom: 0.15rem;
}

.portal-status-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.portal-status-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* 4. Quick Action Tiles (Modern Service Options) */
.portal-action-tile {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.2rem;
    height: 100%;
    text-decoration: none !important;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-card);
    position: relative;
    cursor: pointer;
}

.portal-action-tile:hover {
    border-color: var(--brand-gold);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.portal-action-tile:focus-visible {
    outline: 2px solid var(--brand-gold);
}

.portal-action-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.portal-action-tile:hover .portal-action-icon {
    transform: scale(1.06);
}

.portal-action-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 0.85rem;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.portal-action-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.45;
    margin-bottom: 0.85rem;
    flex-grow: 1;
}

.portal-action-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.65rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    font-weight: 600;
}

/* 5. Quota Usage & Ticket Overview */
.portal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.35rem;
    height: 100%;
    box-shadow: var(--shadow-card);
}

.portal-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.15rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--border-color);
}

.portal-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quota-item-row {
    padding: 0.9rem;
    border-radius: 10px;
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-color);
    margin-bottom: 0.85rem;
}

.quota-item-row:last-child {
    margin-bottom: 0;
}

.quota-progress-track {
    height: 6px;
    background-color: rgba(100, 116, 139, 0.15);
    border-radius: 10px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.quota-progress-bar {
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* 6. Compact History Table */
.portal-history-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.portal-history-tab-btn {
    border: 1px solid transparent;
    border-radius: 20px;
    padding: 0.35rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    background: none;
    transition: all 0.18s ease;
}

.portal-history-tab-btn:hover {
    color: var(--text-primary);
    background-color: var(--bg-subtle);
}

.portal-history-tab-btn.active {
    color: var(--brand-navy);
    background-color: var(--brand-gold);
    border-color: var(--brand-gold);
}

[data-theme="dark"] .portal-history-tab-btn.active {
    color: #000000;
    background-color: var(--brand-gold);
}

.table-compact-history {
    margin-bottom: 0;
    font-size: 0.82rem;
}

.table-compact-history thead th {
    padding: 0.75rem 1rem;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-subtle);
}

.table-compact-history tbody td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table-compact-history tbody tr:last-child td {
    border-bottom: none;
}

.badge-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
}

.badge-status-pill.success {
    background-color: rgba(16, 185, 129, 0.12);
    color: #059669;
}

[data-theme="dark"] .badge-status-pill.success {
    background-color: rgba(16, 185, 129, 0.2);
    color: #34D399;
}

.badge-status-pill.warning {
    background-color: rgba(245, 158, 11, 0.12);
    color: #D97706;
}

[data-theme="dark"] .badge-status-pill.warning {
    background-color: rgba(245, 158, 11, 0.2);
    color: #FBBF24;
}

.badge-status-pill.primary {
    background-color: rgba(37, 99, 235, 0.1);
    color: #2563EB;
}

[data-theme="dark"] .badge-status-pill.primary {
    background-color: rgba(59, 130, 246, 0.2);
    color: #60A5FA;
}

/* Dedicated Portal Icon Container Colors (Light & Dark) */
.portal-icon-blue {
    background-color: rgba(37, 99, 235, 0.1) !important;
    color: #2563EB !important;
}
.portal-icon-amber {
    background-color: rgba(245, 158, 11, 0.12) !important;
    color: #D97706 !important;
}
.portal-icon-cyan {
    background-color: rgba(6, 182, 212, 0.12) !important;
    color: #0891B2 !important;
}
.portal-icon-green {
    background-color: rgba(16, 185, 129, 0.12) !important;
    color: #059669 !important;
}
.portal-icon-purple {
    background-color: rgba(124, 58, 237, 0.12) !important;
    color: #7C3AED !important;
}
.portal-icon-gray {
    background-color: rgba(100, 116, 139, 0.12) !important;
    color: #64748B !important;
}

[data-theme="dark"] .portal-icon-blue {
    background-color: rgba(59, 130, 246, 0.2) !important;
    color: #60A5FA !important;
}
[data-theme="dark"] .portal-icon-amber {
    background-color: rgba(245, 158, 11, 0.2) !important;
    color: #FBBF24 !important;
}
[data-theme="dark"] .portal-icon-cyan {
    background-color: rgba(6, 182, 212, 0.2) !important;
    color: #22D3EE !important;
}
[data-theme="dark"] .portal-icon-green {
    background-color: rgba(16, 185, 129, 0.2) !important;
    color: #34D399 !important;
}
[data-theme="dark"] .portal-icon-purple {
    background-color: rgba(139, 92, 246, 0.2) !important;
    color: #A78BFA !important;
}
[data-theme="dark"] .portal-icon-gray {
    background-color: rgba(148, 163, 184, 0.18) !important;
    color: #CBD5E1 !important;
}

/* Dedicated Pill Badges (Light & Dark) */
.portal-pill-warning {
    background-color: rgba(245, 158, 11, 0.15) !important;
    color: #B45309 !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
}
[data-theme="dark"] .portal-pill-warning {
    background-color: rgba(245, 158, 11, 0.2) !important;
    color: #FBBF24 !important;
    border-color: rgba(245, 158, 11, 0.4) !important;
}

.portal-pill-success {
    background-color: rgba(16, 185, 129, 0.12) !important;
    color: #047857 !important;
    border: 1px solid rgba(16, 185, 129, 0.25) !important;
}
[data-theme="dark"] .portal-pill-success {
    background-color: rgba(16, 185, 129, 0.2) !important;
    color: #34D399 !important;
    border-color: rgba(16, 185, 129, 0.35) !important;
}

.portal-pill-primary {
    background-color: rgba(37, 99, 235, 0.1) !important;
    color: #1D4ED8 !important;
    border: 1px solid rgba(37, 99, 235, 0.25) !important;
}
[data-theme="dark"] .portal-pill-primary {
    background-color: rgba(59, 130, 246, 0.2) !important;
    color: #93C5FD !important;
    border-color: rgba(59, 130, 246, 0.35) !important;
}

/* ==================== THEME UTILITY CLASSES ==================== */
.bg-card-theme {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

.text-theme {
    color: var(--text-primary) !important;
}

.border-theme {
    border-color: var(--border-color) !important;
}

.bg-subtle {
    background-color: var(--bg-subtle) !important;
}

html {
    scroll-behavior: smooth;
}

#quick-actions {
    scroll-margin-top: 80px;
}

.portal-section-label {
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
}

/* ==================== MODERN PORTAL BUTTONS ==================== */
/* Rounded 8-10px, proportional height, subtle hover states, no excessive shadows */
.btn-portal-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    background-color: #2563EB;
    color: #FFFFFF !important;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.48rem 1.15rem;
    border-radius: 9px;
    border: 1px solid #2563EB;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none !important;
    cursor: pointer;
}
.btn-portal-primary:hover {
    background-color: #1D4ED8;
    border-color: #1D4ED8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.btn-portal-primary:active {
    transform: translateY(0);
}

.btn-portal-warning {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    background-color: var(--brand-gold);
    color: #0B1325 !important;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.48rem 1.15rem;
    border-radius: 9px;
    border: 1px solid var(--brand-gold);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none !important;
    cursor: pointer;
}
.btn-portal-warning:hover {
    background-color: #F59E0B;
    border-color: #F59E0B;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}
.btn-portal-warning:active {
    transform: translateY(0);
}

.btn-portal-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    background-color: transparent;
    color: var(--text-secondary) !important;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.45rem 1rem;
    border-radius: 9px;
    border: 1px solid var(--border-color);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none !important;
    cursor: pointer;
}
.btn-portal-outline:hover {
    background-color: var(--bg-subtle);
    color: var(--text-primary) !important;
    border-color: var(--text-muted);
}

.btn-portal-outline-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    background-color: rgba(37, 99, 235, 0.06);
    color: #2563EB !important;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.45rem 1.05rem;
    border-radius: 9px;
    border: 1px solid rgba(37, 99, 235, 0.25);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none !important;
    cursor: pointer;
}
.btn-portal-outline-primary:hover {
    background-color: #2563EB;
    color: #FFFFFF !important;
    border-color: #2563EB;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}
.btn-portal-outline-primary:active {
    transform: translateY(0);
}

[data-theme="dark"] .btn-portal-outline-primary {
    background-color: rgba(59, 130, 246, 0.12);
    color: #93C5FD !important;
    border-color: rgba(59, 130, 246, 0.35);
}
[data-theme="dark"] .btn-portal-outline-primary:hover {
    background-color: #3B82F6;
    color: #FFFFFF !important;
}

/* Modal Polish */
.modal-content.rounded-4 {
    border-radius: 16px !important;
    border: 1px solid var(--border-color) !important;
}

[data-theme="dark"] .modal-content {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5) !important;
}

/* ==================== AUDIT INTEGRITY & PSYCHOLOGICAL STATUS ==================== */
.portal-integrity-status {
    padding: 0.85rem 1.1rem;
    border-radius: 12px;
    margin-top: 1.15rem;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}
.portal-integrity-status.status-safe {
    background-color: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.25);
}
[data-theme="dark"] .portal-integrity-status.status-safe {
    background-color: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
}

.portal-integrity-status.status-warn {
    background-color: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.25);
}
[data-theme="dark"] .portal-integrity-status.status-warn {
    background-color: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
}

.portal-integrity-status.status-danger {
    background-color: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
}
[data-theme="dark"] .portal-integrity-status.status-danger {
    background-color: rgba(239, 68, 68, 0.14);
    border-color: rgba(239, 68, 68, 0.35);
}

.portal-audit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.85rem;
    margin-top: 1rem;
}

.portal-audit-stat-box {
    padding: 0.85rem 1rem;
    border-radius: 11px;
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.portal-audit-stat-box:hover {
    border-color: var(--brand-gold);
}

.portal-audit-stat-num {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.5px;
}

/* ========================================================
   Refined Portal Pegawai Polish Styles
   ======================================================== */
.portal-user-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.32rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-secondary);
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.portal-audit-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.1rem 1.15rem;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    box-shadow: var(--shadow-card);
    transition: all 0.2s ease;
}

.portal-audit-stat-card:hover {
    border-color: var(--brand-gold);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.portal-audit-icon-box {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.portal-audit-warn-card {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 12px;
    padding: 1.1rem 1.15rem;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

[data-theme="dark"] .portal-audit-warn-card {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
}

.portal-ticket-item {
    padding: 0.9rem;
    border-radius: 10px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.portal-ticket-item:hover {
    background: var(--bg-card);
}

.portal-action-tile.disabled {
    opacity: 0.72;
    cursor: not-allowed !important;
    background: var(--bg-subtle);
}

.portal-action-tile.disabled:hover {
    transform: none;
    box-shadow: var(--shadow-card);
    border-color: var(--border-color);
}



