/* ================================================================
   JDIH BAKP UNG — Custom Styles
   Core design tokens & shared component styling
   ================================================================ */

:root {
    --ung-primary: #00573D;
    --ung-primary-rgb: 0, 87, 61;
    --ung-primary-dark: #00432E;
    --ung-primary-light: #E8F5E9;
    --ung-accent: #C5A54B;
    --ung-accent-light: #F9F3E3;
    --ung-dark: #1A1A2E;
    --ung-gray: #6B7280;
    --ung-light: #F8F9FA;
    --ung-white: #FFFFFF;
    --ung-border: #E5E7EB;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.10);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---- Reset & Base ---- */

body {
    font-family: var(--font-sans);
    color: #212529;
    background: #FAFBFC;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1 0 auto;
}

a {
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ---- Navbar ---- */

.navbar.bg-dark {
    background-color: var(--ung-dark) !important;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}

.navbar-brand img {
    height: 34px;
    width: auto;
}

.nav-link {
    font-weight: 500;
    font-size: 0.875rem;
}

/* ---- Breadcrumb ---- */

.breadcrumb {
    background: transparent;
    padding: 0;
    font-size: 0.8125rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--ung-gray);
}

.breadcrumb a {
    color: var(--ung-primary);
}

/* ---- Hero / Header ---- */

.hero-section {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #0D47A1 0%, #1565C0 35%, #1E88E5 70%, #42A5F5 100%);
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
    pointer-events: none;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -8%;
    width: 350px;
    height: 350px;
    background: rgba(255,255,255,0.03);
    border-radius: 50%;
    pointer-events: none;
}

.hero-section .badge {
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.hero-section .badge:hover {
    transform: scale(1.05);
    background-color: rgba(255, 255, 255, 0.35) !important;
}

.search-box .form-control:focus {
    box-shadow: none;
    border-color: transparent;
}

.text-success-light { color: #81C784; }
.text-warning-light { color: #FFD54F; }

/* ---- Cards ---- */

.card {
    border-radius: var(--radius-md);
    transition: box-shadow 0.2s ease;
}

.card.shadow-sm {
    box-shadow: var(--shadow-sm);
}

.card.shadow-sm:hover {
    box-shadow: var(--shadow-md);
}

.doc-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border-radius: var(--radius-md);
}

.doc-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg) !important;
}

/* ---- Detail Page ---- */

.detail-header {
    background: linear-gradient(135deg, var(--ung-dark) 0%, #2D2D44 100%);
    padding: 2.5rem 0;
    color: #fff;
}

.detail-header .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255,255,255,0.5);
}

.detail-header .breadcrumb a {
    color: rgba(255,255,255,0.8);
}

.detail-meta-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.detail-sidebar-card {
    border-radius: var(--radius-md);
    border: 1px solid var(--ung-border);
    background: #fff;
}

.detail-sidebar-card .stat-box {
    text-align: center;
    padding: 1.25rem 0.5rem;
    border-radius: var(--radius-sm);
    background: var(--ung-light);
    transition: background 0.15s ease;
}

.detail-sidebar-card .stat-box:hover {
    background: #EDF2F7;
}

/* ---- Footer ---- */

.footer {
    background: var(--ung-dark);
    color: rgba(255,255,255,0.75);
    padding: 3rem 0 0;
    flex-shrink: 0;
    font-size: 0.875rem;
}

.footer__container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer__grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1.2fr;
    gap: 2.5rem;
}

.footer__col {
    min-width: 0;
}

.footer__heading {
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer__heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 32px;
    height: 3px;
    background: var(--ung-accent);
    border-radius: 2px;
}

.footer__text {
    line-height: 1.7;
    color: rgba(255,255,255,0.6);
    font-size: 0.8125rem;
    margin: 0;
}

.footer__links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer__links li {
    margin-bottom: 0.5rem;
}

.footer__link {
    color: rgba(255,255,255,0.65);
    transition: color 0.15s ease, padding-left 0.15s ease;
    font-size: 0.8125rem;
}

.footer__link:hover {
    color: #fff;
    text-decoration: none;
    padding-left: 4px;
}

.footer__contact-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.75rem !important;
}

.footer__icon {
    flex-shrink: 0;
    font-size: 0.9375rem;
    margin-top: 1px;
}

.footer__bottom {
    margin-top: 2.5rem;
    padding: 1.25rem 0;
    border-top: 1px solid rgba(255,255,255,0.08);
    text-align: center;
}

.footer__bottom p {
    margin: 0;
    color: rgba(255,255,255,0.35);
    font-size: 0.75rem;
    letter-spacing: 0.02em;
}

/* ---- Responsive ---- */

@media (max-width: 991px) {
    .footer__grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}

@media (max-width: 767px) {
    .footer__grid {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }

    .footer {
        padding: 2.25rem 0 0;
    }

    .footer__bottom {
        margin-top: 1.75rem;
    }

    .detail-header {
        padding: 1.75rem 0;
    }
}

/* ---- Utility ---- */

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.badge {
    font-weight: 500;
    letter-spacing: 0.01em;
}

.btn {
    font-weight: 500;
    letter-spacing: -0.01em;
    border-radius: var(--radius-sm);
}

.btn-primary {
    background: #1565C0;
    border-color: #1565C0;
}

.btn-primary:hover {
    background: #0D47A1;
    border-color: #0D47A1;
}

.btn-warning {
    color: #1A1A2E;
}

.form-control, .form-select {
    border-radius: var(--radius-sm);
    border-color: var(--ung-border);
}

.form-control:focus, .form-select:focus {
    border-color: #90CAF9;
    box-shadow: 0 0 0 0.2rem rgba(21,101,192,0.15);
}

/* ================================================================
   Admin Panel Styles
   ================================================================ */

/* ---- Admin Layout ---- */
.admin-layout {
    display: flex;
    min-height: 100vh;
    background: #F1F5F9;
}

/* ---- Admin Sidebar ---- */
.admin-sidebar {
    width: 250px;
    min-width: 250px;
    background: linear-gradient(180deg, var(--ung-dark) 0%, #16213E 100%);
    color: rgba(255,255,255,0.85);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    overflow-y: auto;
    box-shadow: 2px 0 16px rgba(0,0,0,0.12);
}

.admin-sidebar__brand {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 0.5rem;
}

.admin-sidebar__logo-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #fff;
    text-decoration: none;
}

.admin-sidebar__logo-link:hover {
    text-decoration: none;
}

.admin-sidebar__logo {
    font-size: 1.4rem;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ung-accent);
    border-radius: var(--radius-sm);
    color: var(--ung-dark);
}

.admin-sidebar__logo img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.admin-sidebar__name {
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.admin-sidebar__nav {
    flex: 1;
    padding: 0 0.75rem;
}

.admin-sidebar__menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.admin-sidebar__item {
    margin-bottom: 2px;
}

.admin-sidebar__link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.6);
    font-size: 0.8475rem;
    font-weight: 500;
    transition: all 0.15s ease;
    text-decoration: none;
}

.admin-sidebar__link:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
    text-decoration: none;
}

.admin-sidebar__link--active {
    background: rgba(255,255,255,0.14);
    color: #fff;
    font-weight: 600;
}

.admin-sidebar__icon {
    font-size: 1.05rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.admin-sidebar__footer {
    padding: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: auto;
}

.admin-sidebar__link--logout {
    color: rgba(255,255,255,0.45);
    font-size: 0.8125rem;
}

.admin-sidebar__link--logout:hover {
    color: #FCA5A5;
    background: rgba(239,68,68,0.12);
}

/* ---- Admin Main ---- */
.admin-main {
    flex: 1;
    margin-left: 250px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ---- Admin Header ---- */
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.75rem;
    background: #fff;
    border-bottom: 1px solid var(--ung-border);
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.admin-header__title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ung-dark);
    margin: 0;
    letter-spacing: -0.01em;
}

.admin-header__user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #4B5563;
    background: var(--ung-light);
    padding: 0.4rem 0.9rem;
    border-radius: 2rem;
}

.admin-header__role {
    color: var(--ung-gray);
    font-weight: 400;
    font-size: 0.75rem;
}

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

/* ---- Admin Document Upload & PDF Auto Reader ---- */
.document-upload-card {
    padding: 1.25rem;
    border: 1px solid var(--ung-border);
    border-radius: var(--radius-md);
    background: var(--ung-light);
}

.document-drop-zone {
    position: relative;
    min-height: 190px;
    padding: 1.5rem;
    border: 2px dashed var(--ung-border);
    border-radius: var(--radius-md);
    background: var(--ung-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.document-drop-zone:hover,
.document-drop-zone:focus-visible,
.document-drop-zone.is-dragover {
    border-color: var(--ung-primary);
    background: var(--ung-primary-light);
    box-shadow: 0 0 0 0.2rem rgba(var(--ung-primary-rgb), 0.12);
    outline: none;
}

.document-drop-zone.is-dragover {
    transform: translateY(-2px);
}

.document-drop-zone.is-loading {
    cursor: progress;
}

.document-drop-zone.has-file {
    min-height: 120px;
    border-style: solid;
    border-color: var(--ung-primary);
}

.document-drop-zone__prompt,
.document-drop-zone__loader {
    max-width: 520px;
}

.document-drop-zone__icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 0.8rem;
    border-radius: 50%;
    background: var(--ung-primary-light);
    color: var(--ung-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.65rem;
}

.document-file-summary {
    width: min(100%, 650px);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    text-align: left;
}

.document-file-summary__icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--ung-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.document-file-summary__content {
    min-width: 0;
}

.document-field-autofilled {
    border-color: var(--ung-primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(var(--ung-primary-rgb), 0.12) !important;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

/* ---- Dashboard Stats Grid ---- */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

/* ---- Stat Card ---- */
.stat-card {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 1.35rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--ung-border);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

.stat-card__icon {
    font-size: 2rem;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--ung-light);
    flex-shrink: 0;
}

.stat-card--success .stat-card__icon {
    background: #DCFCE7;
}

.stat-card--danger .stat-card__icon {
    background: #FEE2E2;
}

.stat-card--warning .stat-card__icon {
    background: #FEF3C7;
}

.stat-card--primary .stat-card__icon {
    background: #DBEAFE;
}

.stat-card--info .stat-card__icon {
    background: #E0E7FF;
}

.stat-card__info {
    min-width: 0;
}

.stat-card__value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--ung-dark);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.stat-card__label {
    font-size: 0.8125rem;
    color: var(--ung-gray);
    font-weight: 500;
    margin-top: 2px;
}

/* ---- Dashboard Grid (Panels) ---- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.dashboard-panel {
    background: #fff;
    border-radius: var(--radius-md);
    border: 1px solid var(--ung-border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

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

.dashboard-panel__header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--ung-border);
    background: #FAFBFC;
}

.dashboard-panel__header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ung-dark);
    letter-spacing: -0.01em;
}

.dashboard-panel__body {
    padding: 1.25rem;
}

/* ---- Activity List ---- */
.activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.activity-item {
    display: flex;
    gap: 0.85rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #F3F4F6;
}

.activity-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.activity-item:first-child {
    padding-top: 0;
}

.activity-item__icon {
    font-size: 1.1rem;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--ung-light);
    flex-shrink: 0;
}

.activity-item__info {
    min-width: 0;
    flex: 1;
}

.activity-item__text {
    margin: 0;
    font-size: 0.8125rem;
    color: #374151;
    line-height: 1.4;
}

.activity-item__text strong {
    color: var(--ung-dark);
}

.activity-item__meta {
    font-size: 0.75rem;
    color: var(--ung-gray);
    margin-top: 2px;
}

/* ---- Table Styling (Admin) ---- */
.table {
    font-size: 0.85rem;
    margin-bottom: 0;
}

.table thead th {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--ung-gray);
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--ung-border);
    background: #FAFBFC;
    white-space: nowrap;
}

.table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #F3F4F6;
}

.table tbody tr:hover {
    background-color: #F8FAFC;
}

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

.table--sm {
    font-size: 0.8125rem;
}

.table--sm thead th {
    padding: 0.55rem 0.75rem;
}

.table--sm tbody td {
    padding: 0.55rem 0.75rem;
}

/* ---- Badge Overrides for Admin ---- */
.badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3em 0.65em;
    border-radius: 4px;
}

.bg-success.bg-opacity-10 { background-color: rgba(16,185,129,0.1) !important; }
.bg-warning.bg-opacity-10 { background-color: rgba(245,158,11,0.1) !important; }
.bg-danger.bg-opacity-10 { background-color: rgba(239,68,68,0.1) !important; }
.bg-primary.bg-opacity-10 { background-color: rgba(59,130,246,0.1) !important; }

.text-success { color: #059669 !important; }
.text-warning { color: #D97706 !important; }
.text-danger { color: #DC2626 !important; }
.text-primary { color: #2563EB !important; }

/* ---- Card (Admin) ---- */
.card {
    border: 1px solid var(--ung-border);
    border-radius: var(--radius-md);
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--ung-border);
    background: #FAFBFC;
}

.card-footer.bg-white {
    background: #fff;
}

/* ---- Pagination ---- */
.pagination {
    gap: 2px;
}

.page-link {
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    padding: 0.35rem 0.65rem;
    color: #4B5563;
    border: 1px solid #E5E7EB;
}

.page-item.active .page-link {
    background: var(--ung-primary);
    border-color: var(--ung-primary);
    color: #fff;
}

.page-link:hover {
    background: var(--ung-light);
    color: var(--ung-dark);
    border-color: #D1D5DB;
}

/* ---- Button Brand (UNG Primary) ---- */
.btn-brand {
    background: var(--ung-primary);
    border: 1px solid var(--ung-primary);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.5rem 1.15rem;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-brand:hover {
    background: var(--ung-primary-dark);
    border-color: var(--ung-primary-dark);
    color: #fff;
    text-decoration: none;
}

.btn-brand:active {
    transform: scale(0.97);
}

.btn-outline-secondary {
    border-color: #D1D5DB;
    color: #4B5563;
    font-weight: 500;
}

.btn-outline-secondary:hover {
    background: #F3F4F6;
    border-color: #9CA3AF;
    color: var(--ung-dark);
}

.btn-outline-danger {
    border-color: #FECACA;
    color: #DC2626;
    font-weight: 500;
}

.btn-outline-danger:hover {
    background: #FEF2F2;
    border-color: #F87171;
    color: #B91C1C;
}

.btn-group-sm .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.55rem;
}

/* ---- Form Controls (Admin Compact) ---- */
.form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.3rem;
}

.form-control-sm, .form-select-sm {
    font-size: 0.8125rem;
    padding: 0.4rem 0.65rem;
    border-radius: var(--radius-sm);
    border-color: #D1D5DB;
}

.form-control-sm:focus, .form-select-sm:focus {
    border-color: var(--ung-primary);
    box-shadow: 0 0 0 0.15rem rgba(0,87,61,0.15);
}

/* ---- Dashboard Bar Chart ---- */
.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bar-chart__row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bar-chart__label {
    width: 50px;
    font-size: 0.8rem;
    color: var(--ung-gray);
    text-align: right;
    font-weight: 500;
}

.bar-chart__bar-wrapper {
    flex: 1;
    height: 22px;
    background: #F1F5F9;
    border-radius: 4px;
    overflow: hidden;
}

.bar-chart__bar {
    height: 100%;
    background: linear-gradient(135deg, var(--ung-primary), #007A56);
    border-radius: 4px;
    transition: width 0.6s ease;
    min-width: 4px;
}

.bar-chart__value {
    width: 32px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ung-dark);
    text-align: left;
}

/* ---- Text Utilities ---- */
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.text-muted { color: var(--ung-gray) !important; }
.text-secondary { color: var(--ung-gray) !important; }
.fw-medium { font-weight: 500 !important; }
.fw-bold { font-weight: 700 !important; }
.small { font-size: 0.8125rem !important; }

/* ---- Alert / Flash Messages in Admin ---- */
.alert {
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    padding: 0.75rem 1rem;
    border: 1px solid transparent;
}

.alert-success {
    background: #F0FDF4;
    border-color: #BBF7D0;
    color: #166534;
}

.alert-danger {
    background: #FEF2F2;
    border-color: #FECACA;
    color: #991B1B;
}

.alert-warning {
    background: #FFFBEB;
    border-color: #FDE68A;
    color: #92400E;
}

.alert-info {
    background: #EFF6FF;
    border-color: #BFDBFE;
    color: #1E40AF;
}

/* ---- Empty State ---- */
.text-center.py-5 .display-4 {
    font-size: 2.5rem;
    opacity: 0.5;
}

/* ---- Responsive Admin ---- */
@media (max-width: 1024px) {
    .admin-sidebar {
        width: 220px;
        min-width: 220px;
    }
    .admin-main {
        margin-left: 220px;
    }
    .dashboard-stats {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        width: 250px;
        min-width: 250px;
    }
    .admin-sidebar--open {
        transform: translateX(0);
    }
    .admin-main {
        margin-left: 0;
    }
    .admin-content {
        padding: 1rem;
    }
    .admin-header {
        padding: 0.75rem 1rem;
    }
    .dashboard-stats {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    .stat-card {
        padding: 1rem;
    }
    .stat-card__value {
        font-size: 1.4rem;
    }
    .stat-card__icon {
        width: 44px;
        height: 44px;
        font-size: 1.5rem;
    }
}

/* ---- Scrollbar Styling for Sidebar ---- */
.admin-sidebar::-webkit-scrollbar {
    width: 4px;
}

.admin-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.admin-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
}

/* ---- Print ---- */
@media print {
    .admin-sidebar,
    .admin-header {
        display: none;
    }
    .admin-main {
        margin-left: 0;
    }
    .admin-content {
        padding: 0;
    }
}

/* ================================================================
   404 / Not Found Page
   ================================================================ */

.error-404 {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 5rem 1rem;
    padding: clamp(3rem, 7vw, 6.5rem) 1rem;
    background:
        radial-gradient(circle at 12% 12%, rgba(197, 165, 75, 0.14), transparent 30%),
        radial-gradient(circle at 88% 85%, rgba(0, 87, 61, 0.14), transparent 32%),
        linear-gradient(145deg, #F8FAFC 0%, #F2F7F4 50%, #F8FAFC 100%);
}

.error-404::before {
    position: absolute;
    z-index: -1;
    inset: 0;
    content: "";
    opacity: 0.42;
    background-image:
        linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: linear-gradient(to bottom, #000, transparent 88%);
}

.error-404__glow {
    position: absolute;
    z-index: -1;
    border-radius: 999px;
    filter: blur(1px);
    pointer-events: none;
}

.error-404__glow--one {
    top: -110px;
    right: 7%;
    width: 280px;
    height: 280px;
    border: 1px solid rgba(0, 87, 61, 0.12);
    box-shadow:
        0 0 0 42px rgba(0, 87, 61, 0.025),
        0 0 0 84px rgba(0, 87, 61, 0.018);
}

.error-404__glow--two {
    bottom: -100px;
    left: 4%;
    width: 220px;
    height: 220px;
    border: 1px solid rgba(197, 165, 75, 0.16);
    box-shadow: 0 0 0 54px rgba(197, 165, 75, 0.025);
}

.error-404__container {
    width: 100%;
    max-width: 1080px;
    width: min(1080px, 100%);
    margin: 0 auto;
}

.error-404__card {
    display: -webkit-box;
    -webkit-box-orient: horizontal;
    display: flex;
    flex-direction: row;
    display: grid;
    grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
    min-height: 500px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow:
        0 30px 80px rgba(15, 23, 42, 0.14),
        0 2px 8px rgba(15, 23, 42, 0.05);
}

.error-404__visual {
    position: relative;
    width: 42%;
    -webkit-box-flex: 0;
    display: -webkit-box;
    -webkit-box-align: center;
    -webkit-box-pack: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    overflow: hidden;
    border-radius: 28px 0 0 28px;
    background: #0F172A;
    background:
        radial-gradient(circle at 68% 28%, rgba(255, 255, 255, 0.13), transparent 24%),
        linear-gradient(145deg, #0F172A 0%, #103C32 55%, #00573D 100%);
}

.error-404__visual::before,
.error-404__visual::after {
    position: absolute;
    content: "";
    border-radius: 50%;
}

.error-404__visual::before {
    right: -82px;
    bottom: -92px;
    width: 290px;
    height: 290px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 0 0 38px rgba(255, 255, 255, 0.025),
        0 0 0 76px rgba(255, 255, 255, 0.018);
}

.error-404__visual::after {
    top: 44px;
    left: 38px;
    width: 72px;
    height: 72px;
    background: rgba(197, 165, 75, 0.11);
    filter: blur(1px);
}

.error-404__number {
    position: absolute;
    top: 50%;
    left: 50%;
    color: rgba(255, 255, 255, 0.045);
    font-size: 11rem;
    font-size: clamp(8rem, 17vw, 13rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.09em;
    transform: translate(-52%, -52%);
    user-select: none;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.09);
}

.error-404__document {
    position: relative;
    z-index: 2;
    width: 150px;
    height: 190px;
    padding: 35px 23px 20px;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.28);
    color: #00573D;
    transform: rotate(-6deg);
    animation: error-404-float 4.5s ease-in-out infinite;
}

.error-404__document > .bi {
    display: block;
    margin-bottom: 24px;
    font-size: 2.75rem;
    line-height: 1;
}

.error-404__document-fold {
    position: absolute;
    top: -1px;
    right: -1px;
    width: 44px;
    height: 44px;
    border-bottom: 1px solid rgba(0, 87, 61, 0.15);
    border-left: 1px solid rgba(0, 87, 61, 0.15);
    border-radius: 0 18px 0 12px;
    background: #E8F5E9;
}

.error-404__document-line {
    display: block;
    width: 64%;
    height: 6px;
    margin-top: 10px;
    border-radius: 999px;
    background: #D8E3DE;
}

.error-404__document-line--long {
    width: 100%;
}

.error-404__document-line--short {
    width: 43%;
}

.error-404__search-icon {
    position: absolute;
    z-index: 3;
    top: calc(50% + 50px);
    left: calc(50% + 41px);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 74px;
    height: 74px;
    border: 7px solid #C5A54B;
    border-radius: 50%;
    background: #0F172A;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.32);
    color: #FFF;
    font-size: 1.55rem;
    transform: rotate(8deg);
}

.error-404__search-icon::after {
    position: absolute;
    right: -28px;
    bottom: -20px;
    width: 39px;
    height: 9px;
    border-radius: 999px;
    background: #C5A54B;
    content: "";
    transform: rotate(47deg);
    transform-origin: left center;
}

.error-404__spark {
    position: absolute;
    z-index: 1;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #C5A54B;
    box-shadow: 0 0 18px rgba(197, 165, 75, 0.75);
}

.error-404__spark--one {
    top: 24%;
    right: 22%;
}

.error-404__spark--two {
    right: 17%;
    bottom: 24%;
    width: 5px;
    height: 5px;
}

.error-404__spark--three {
    bottom: 22%;
    left: 19%;
    width: 6px;
    height: 6px;
}

.error-404__content {
    width: 58%;
    -webkit-box-flex: 1;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-box-pack: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem;
    padding: clamp(2.2rem, 5vw, 4.5rem);
}

@supports (display: grid) {
    .error-404__visual,
    .error-404__content {
        width: auto;
    }
}

.error-404__eyebrow {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid #F0E2B8;
    border-radius: 999px;
    background: #FFF9E9;
    color: #755D1C;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.error-404__status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #C5A54B;
    box-shadow: 0 0 0 4px rgba(197, 165, 75, 0.14);
}

.error-404__kicker {
    margin: 0 0 0.35rem;
    color: #00573D;
    font-size: 0.9rem;
    font-weight: 700;
}

.error-404__title {
    margin: 0;
    color: #111827;
    font-size: 3rem;
    font-size: clamp(2rem, 4.3vw, 3.45rem);
    font-weight: 700;
    font-weight: 750;
    line-height: 1.08;
    letter-spacing: -0.045em;
}

.error-404__description {
    max-width: 560px;
    margin: 1.15rem 0 0;
    color: #64748B;
    font-size: 0.98rem;
    line-height: 1.75;
}

.error-404__requested-path {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.3rem;
    padding: 0.72rem 0.85rem;
    border: 1px solid #E2E8F0;
    border-radius: 11px;
    background: #F8FAFC;
    color: #64748B;
    font-size: 0.75rem;
}

.error-404__requested-path > .bi {
    color: #00573D;
    font-size: 1rem;
}

.error-404__requested-path code {
    overflow: hidden;
    color: #334155;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.75rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.error-404__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.7rem;
}

.error-404__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 46px;
    padding: 0.7rem 1rem;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.error-404__button:hover {
    text-decoration: none;
    transform: translateY(-2px);
}

.error-404__button--primary {
    background: #00573D;
    color: #FFF;
    box-shadow: 0 9px 20px rgba(0, 87, 61, 0.22);
}

.error-404__button--primary:hover {
    background: #00432E;
    color: #FFF;
    box-shadow: 0 12px 24px rgba(0, 87, 61, 0.3);
}

.error-404__button--secondary {
    border-color: #D5DFDA;
    background: #FFF;
    color: #1F3D34;
}

.error-404__button--secondary:hover {
    border-color: #9CB7AC;
    background: #F1F7F4;
    color: #00573D;
}

.error-404__hint {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-top: 1.65rem;
    padding-top: 1.2rem;
    border-top: 1px solid #EDF1EF;
    color: #64748B;
}

.error-404__hint > .bi {
    flex-shrink: 0;
    margin-top: 0.1rem;
    color: #C5A54B;
}

.error-404__hint p {
    margin: 0;
    font-size: 0.76rem;
    line-height: 1.6;
}

.error-404__hint strong {
    color: #334155;
}

@keyframes error-404-float {
    0%,
    100% {
        transform: rotate(-6deg) translateY(0);
    }
    50% {
        transform: rotate(-4deg) translateY(-9px);
    }
}

@media (max-width: 820px) {
    .error-404 {
        padding: 2.5rem 1rem;
    }

    .error-404__card {
        display: block;
        grid-template-columns: 1fr;
        max-width: 650px;
        margin: 0 auto;
    }

    .error-404__visual {
        width: 100%;
        min-height: 300px;
        border-radius: 28px 28px 0 0;
    }

    .error-404__number {
        font-size: 10rem;
    }

    .error-404__content {
        width: 100%;
        padding: 2.5rem;
    }
}

@media (max-width: 480px) {
    .error-404 {
        padding: 1.25rem 0.75rem 2rem;
    }

    .error-404__card {
        border-radius: 20px;
    }

    .error-404__visual {
        min-height: 245px;
        border-radius: 20px 20px 0 0;
    }

    .error-404__document {
        width: 118px;
        height: 150px;
        padding: 27px 18px 16px;
    }

    .error-404__document > .bi {
        margin-bottom: 14px;
        font-size: 2.1rem;
    }

    .error-404__search-icon {
        top: calc(50% + 38px);
        left: calc(50% + 31px);
        width: 60px;
        height: 60px;
        border-width: 6px;
        font-size: 1.2rem;
    }

    .error-404__content {
        padding: 2rem 1.25rem;
    }

    .error-404__eyebrow {
        margin-bottom: 1.15rem;
    }

    .error-404__title {
        font-size: 2.15rem;
    }

    .error-404__requested-path {
        grid-template-columns: auto 1fr;
    }

    .error-404__requested-path code {
        grid-column: 1 / -1;
        padding-left: 1.5rem;
    }

    .error-404__actions {
        flex-direction: column;
    }

    .error-404__button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .error-404__document {
        animation: none;
    }

    .error-404__button {
        transition: none;
    }
}

/* ================================================================
   Auth / Login Page Styles
   ================================================================ */

.login-body {
    background-color: #0F172A;
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #0F172A 100%);
    height: 100vh;
    min-height: 100vh;
    box-sizing: border-box;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-box-align: center;
    -webkit-box-pack: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-family: var(--font-sans);
    margin: 0;
    padding: 1rem;
}

.login-page {
    width: 100%;
    max-width: 440px;
    margin: auto;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-box-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
}

/* ---- Login Card ---- */
.login-card {
    width: 100%;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

/* ---- Header ---- */
.login-card__header {
    padding: 2rem 1.75rem 0;
    text-align: center;
}

.login-card__logo {
    width: 56px;
    height: 56px;
    margin: 0 auto 0.85rem;
    background: #00573D;
    background: linear-gradient(135deg, var(--ung-primary), #007A56);
    border-radius: 14px;
    display: -webkit-box;
    -webkit-box-align: center;
    -webkit-box-pack: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #fff;
    box-shadow: 0 6px 18px rgba(0, 87, 61, 0.3);
}

.login-card__logo img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.login-card__title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--ung-dark);
    margin: 0 0 0.35rem;
    letter-spacing: -0.02em;
}

.login-card__subtitle {
    font-size: 0.875rem;
    color: var(--ung-gray);
    margin: 0;
    line-height: 1.5;
}

/* ---- Alerts inside Card ---- */
.login-card__alerts {
    padding: 1rem 1.75rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.login-alert {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.4;
    border: 1px solid transparent;
}

.login-alert__icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.login-alert__text {
    flex: 1;
}

.login-alert--success {
    background: #F0FDF4;
    border-color: #BBF7D0;
    color: #166534;
}

.login-alert--success .login-alert__icon {
    color: #16A34A;
}

.login-alert--danger,
.login-alert--error {
    background: #FEF2F2;
    border-color: #FECACA;
    color: #991B1B;
}

.login-alert--danger .login-alert__icon,
.login-alert--error .login-alert__icon {
    color: #DC2626;
}

.login-alert--warning {
    background: #FFFBEB;
    border-color: #FDE68A;
    color: #92400E;
}

.login-alert--warning .login-alert__icon {
    color: #D97706;
}

.login-alert--info {
    background: #EFF6FF;
    border-color: #BFDBFE;
    color: #1E40AF;
}

.login-alert--info .login-alert__icon {
    color: #2563EB;
}

/* ---- Form ---- */
.login-form {
    padding: 1.5rem 1.75rem 1.75rem;
}

.login-form__group {
    margin-bottom: 1.15rem;
}

.login-form__group:last-of-type {
    margin-bottom: 1.5rem;
}

.login-form__label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.4rem;
    letter-spacing: 0.01em;
}

.login-form__input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.login-form__icon {
    position: absolute;
    left: 12px;
    font-size: 1.1rem;
    color: #9CA3AF;
    pointer-events: none;
    transition: color 0.15s ease;
    z-index: 2;
}

.login-form__input {
    width: 100%;
    padding: 0.65rem 2.5rem 0.65rem 2.5rem;
    font-size: 0.9rem;
    font-family: inherit;
    border: 1.5px solid #D1D5DB;
    border-radius: 10px;
    background: #FAFBFC;
    color: #1F2937;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    outline: none;
}

.login-form__input::placeholder {
    color: #9CA3AF;
    font-size: 0.85rem;
}

.login-form__input:focus {
    border-color: #00573D;
    border-color: var(--ung-primary);
    box-shadow: 0 0 0 3px rgba(0, 87, 61, 0.12);
    background: #fff;
}

.login-form__input:focus ~ .login-form__icon,
.login-form__input-wrap:focus-within .login-form__icon {
    color: var(--ung-primary);
}

/* Password Toggle Button */
.login-form__toggle-password {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: #9CA3AF;
    font-size: 1.15rem;
    cursor: pointer;
    padding: 4px 6px;
    line-height: 1;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
    z-index: 2;
}

.login-form__toggle-password:hover {
    color: #4B5563;
    background: #F3F4F6;
}

/* Submit Button */
.login-form__submit {
    width: 100%;
    padding: 0.72rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    background: #00573D;
    background: linear-gradient(135deg, var(--ung-primary) 0%, #007A56 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: -webkit-box;
    -webkit-box-align: center;
    -webkit-box-pack: center;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease;
    box-shadow: 0 4px 14px rgba(0, 87, 61, 0.3);
    letter-spacing: 0.01em;
}

.login-form__submit:hover {
    background: linear-gradient(135deg, var(--ung-primary-dark) 0%, #006648 100%);
    box-shadow: 0 6px 20px rgba(0, 87, 61, 0.4);
}

.login-form__submit:active {
    transform: scale(0.98);
}

.login-form__submit:focus-visible {
    outline: 2px solid var(--ung-primary);
    outline-offset: 2px;
}

/* ---- Card Footer ---- */
.login-card__footer {
    padding: 1rem 1.75rem 1.5rem;
    text-align: center;
    border-top: 1px solid #F3F4F6;
    background: #FAFBFC;
}

.login-card__help {
    font-size: 0.8125rem;
    color: var(--ung-gray);
    margin: 0 0 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

.login-card__help strong {
    color: #374151;
}

.login-card__back-link {
    display: -webkit-inline-box;
    -webkit-box-align: center;
    display: inline-flex;
    align-items: center;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #00573D;
    color: var(--ung-primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

.login-card__back-link:hover {
    color: var(--ung-primary-dark);
    text-decoration: underline;
}

/* ---- Org Footer (below card) ---- */
.login-page__org-footer {
    margin-top: 1.5rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
}

/* ---- Responsive Login ---- */
@media (max-width: 480px) {
    .login-body {
        padding: 0.75rem;
        align-items: flex-start;
        justify-content: flex-start;
        padding-top: 3rem;
    }

    .login-page {
        margin: 0 auto;
    }

    .login-card {
        border-radius: 14px;
    }

    .login-card__header {
        padding: 1.5rem 1.25rem 0;
    }

    .login-card__logo {
        width: 48px;
        height: 48px;
        font-size: 1.35rem;
        border-radius: 12px;
    }

    .login-card__title {
        font-size: 1.2rem;
    }

    .login-card__subtitle {
        font-size: 0.8125rem;
    }

    .login-card__alerts {
        padding: 0.75rem 1.25rem 0;
    }

    .login-form {
        padding: 1.25rem 1.25rem 1.5rem;
    }

    .login-form__input {
        padding: 0.6rem 2.3rem 0.6rem 2.3rem;
        font-size: 0.875rem;
    }

    .login-card__footer {
        padding: 0.85rem 1.25rem 1.25rem;
    }
}

/* ---- Reduce Motion ---- */
@media (prefers-reduced-motion: reduce) {
    .login-form__submit {
        transition: none;
    }

    .login-form__submit:active {
        transform: none;
    }
}

/* ================================================================
   System Settings
   ================================================================ */
.settings-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.settings-heading__eyebrow {
    margin: 0 0 0.35rem;
    color: var(--ung-primary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.settings-heading__title {
    margin: 0;
    color: var(--ung-dark);
    font-size: clamp(1.55rem, 3vw, 2rem);
    font-weight: 750;
}

.settings-heading__description {
    max-width: 720px;
    margin: 0.55rem 0 0;
    color: #64748b;
}

.settings-heading__status {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex: 0 0 auto;
    padding: 0.65rem 0.85rem;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    background: #f0fdf4;
    color: #166534;
    font-size: 0.8rem;
    font-weight: 650;
}

.settings-card {
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 35px rgba(15, 23, 42, 0.05);
}

.settings-card__header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid #edf2f7;
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
}

.settings-card__header h2 {
    margin: 0;
    color: var(--ung-dark);
    font-size: 1rem;
    font-weight: 700;
}

.settings-card__header p {
    margin: 0.2rem 0 0;
    color: #64748b;
    font-size: 0.79rem;
}

.settings-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 11px;
    background: rgba(0, 87, 61, 0.1);
    color: var(--ung-primary);
    font-size: 1.1rem;
}

.settings-card__body {
    padding: 1.25rem;
}

.branding-preview {
    display: grid;
    grid-template-columns: 1fr 86px;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.branding-preview__logo,
.branding-preview__favicon {
    min-height: 122px;
    padding: 0.7rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.branding-preview span {
    display: block;
    margin-bottom: 0.55rem;
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 650;
    text-transform: uppercase;
}

.branding-preview__logo img {
    display: block;
    width: 100%;
    height: 74px;
    object-fit: contain;
}

.branding-preview__favicon {
    text-align: center;
}

.branding-preview__favicon-box {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin: 0 !important;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.09);
}

.branding-preview__favicon-box img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.branding-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.1rem;
    border: 1.5px dashed #94a3b8;
    border-radius: 12px;
    background: #f8fafc;
    color: #334155;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.branding-upload:hover {
    border-color: var(--ung-primary);
    background: rgba(0, 87, 61, 0.04);
}

.branding-upload i {
    margin-bottom: 0.35rem;
    color: var(--ung-primary);
    font-size: 1.5rem;
}

.branding-upload span {
    margin-top: 0.2rem;
    color: #64748b;
    font-size: 0.75rem;
}

.branding-upload input {
    width: 100%;
    margin-top: 0.8rem;
    font-size: 0.78rem;
}

.settings-reset {
    padding: 0.8rem 0.8rem 0.8rem 2.2rem;
    border-radius: 10px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 0.82rem;
}

.settings-save {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 14px;
    background: #e8eef2;
}

.settings-save p {
    margin: 0 0 0.75rem;
    color: #475569;
    font-size: 0.78rem;
}

@media (max-width: 767.98px) {
    .settings-heading {
        display: block;
    }

    .settings-heading__status {
        margin-top: 1rem;
    }

    .settings-card__header,
    .settings-card__body {
        padding: 1rem;
    }
}

/* ---- Sprint 5: API Keys & Audit Log ---- */
.api-scope-option {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    min-height: 76px;
    padding: 0.8rem;
    border: 1px solid #dbe4ea;
    border-radius: 10px;
    background: #f8fafc;
    cursor: pointer;
}

.api-scope-option:has(input:checked) {
    border-color: var(--ung-primary);
    background: rgba(0, 87, 61, 0.06);
}

.api-scope-option strong,
.api-scope-option small {
    display: block;
}

.api-scope-option strong {
    color: #0f172a;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.78rem;
}

.api-scope-option small {
    margin-top: 0.25rem;
    color: #64748b;
    line-height: 1.35;
}

.audit-table td {
    vertical-align: top;
}

.audit-table details {
    position: relative;
}

.audit-table summary {
    list-style: none;
}

.audit-detail {
    width: min(520px, 70vw);
    max-height: 280px;
    margin: 0.6rem 0 0;
    padding: 0.85rem;
    overflow: auto;
    border: 1px solid #dbe4ea;
    border-radius: 8px;
    background: #0f172a;
    color: #d1fae5;
    font-size: 0.74rem;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ================================================================
   PDF.js Viewer
   ================================================================ */
.pdf-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0.8rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: #212529;
    color: #fff;
}

.pdf-toolbar__group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.pdf-toolbar__page-label,
.pdf-toolbar__page-total,
.pdf-toolbar__zoom {
    color: rgba(255,255,255,0.75);
    font-size: 0.78rem;
}

.pdf-toolbar__page-input {
    width: 64px;
    text-align: center;
}

.pdf-toolbar__zoom {
    width: 52px;
    text-align: center;
}

.pdf-viewer-shell {
    position: relative;
    height: calc(100vh - 208px);
    min-height: 560px;
    overflow: hidden;
    background: #525659;
}

.pdf-canvas-wrap {
    width: 100%;
    height: 100%;
    padding: 1rem;
    overflow: auto;
    text-align: center;
    outline: none;
}

#pdf-canvas {
    display: inline-block;
    background: #fff;
    box-shadow: 0 5px 24px rgba(0,0,0,0.4);
    vertical-align: top;
}

.pdf-viewer-state {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #525659;
    color: #fff;
}

#pdf-error {
    z-index: 4;
    background: #212529;
}

.pdf-print-frame {
    position: fixed;
    right: 0;
    bottom: 0;
    width: 1px;
    height: 1px;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.pdf-viewer-shell:fullscreen {
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
}

@media (max-width: 767.98px) {
    .document-upload-card {
        padding: 1rem;
    }

    .document-drop-zone {
        min-height: 170px;
        padding: 1.25rem 1rem;
    }

    .document-file-summary {
        gap: 0.75rem;
    }

    .pdf-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .pdf-toolbar__group {
        justify-content: center;
    }

    .pdf-viewer-shell {
        height: calc(100vh - 250px);
        min-height: 480px;
    }

    .pdf-canvas-wrap {
        padding: 0.5rem;
    }
}
