/* Smart RT — Global modern theme */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap");
@import url("/css/option-picker.css");

:root {
    --sr-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --sr-primary: #1e3a5f;
    --sr-primary-light: #2d5a87;
    --sr-accent: #0d6efd;
    --sr-accent-dark: #0a58ca;
    --sr-portal: #0d6efd;
    --sr-bg: #eef2f7;
    --sr-surface: #ffffff;
    --sr-border: rgba(30, 58, 95, 0.08);
    --sr-radius: 1rem;
    --sr-radius-sm: 0.625rem;
    --sr-radius-pill: 2rem;
    --sr-shadow: 0 4px 24px rgba(30, 58, 95, 0.08);
    --sr-shadow-sm: 0 2px 12px rgba(30, 58, 95, 0.06);
    --sr-gradient: linear-gradient(145deg, #1e5a9e 0%, var(--sr-accent) 100%);
    --sr-gradient-sidebar: linear-gradient(180deg, #1a3352 0%, var(--sr-primary) 55%, #152a45 100%);
}

html {
    scroll-behavior: smooth;
}

body.mobile-app {
    font-family: var(--sr-font);
    background: var(--sr-bg);
    color: #1a1d21;
    -webkit-font-smoothing: antialiased;
}

body.portal-mobile {
    background: var(--sr-bg);
}

/* ——— Flash alerts ——— */
.app-flash {
    border: none;
    border-radius: var(--sr-radius-sm);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--sr-shadow-sm);
}

.app-flash i {
    font-size: 1.15rem;
    flex-shrink: 0;
    margin-top: 0.05rem;
}

.app-flash-success {
    background: #d1e7dd;
    color: #0a3622;
}

.app-flash-danger {
    background: #f8d7da;
    color: #58151c;
}

/* ——— Admin sidebar ——— */
.app-sidebar {
    min-height: 100vh;
    background: var(--sr-gradient-sidebar);
    padding: 1.25rem 1rem !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
    overflow: visible;
}

.app-sidebar-brand {
    color: #fff !important;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem !important;
    display: block;
}

.app-sidebar-brand i {
    font-size: 1.35rem;
    opacity: 0.95;
}

.app-sidebar-user {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--sr-radius-sm);
    padding: 0.75rem 0.65rem !important;
    margin-bottom: 1rem !important;
    overflow: visible;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.app-sidebar-user-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
    position: relative;
    z-index: 21;
}

.app-sidebar-avatar-link {
    display: block;
    line-height: 0;
    flex-shrink: 0;
    border: 0;
    background: transparent;
    padding: 0;
}

.app-sidebar-profile-menu .dropdown-toggle-no-caret::after {
    display: none;
}

.app-sidebar-profile-menu .dropdown-menu {
    min-width: 12rem;
}

.app-sidebar-user-notif {
    flex-shrink: 0;
    position: relative;
}

.app-sidebar-user-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-width: 0;
    color: #fff !important;
    overflow: hidden;
}

.app-sidebar-user-avatar {
    object-fit: cover;
    margin-bottom: 0;
}

.app-sidebar-user-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0;
}

.app-sidebar-user-name {
    font-size: 0.82rem;
    font-weight: 600;
    max-width: 100%;
}

.app-sidebar-user .sidebar-role {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.55);
    text-transform: capitalize;
    max-width: 100%;
}

.app-sidebar-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 0.55rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--sr-radius-sm);
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.88) !important;
    text-decoration: none !important;
    background: rgba(255, 255, 255, 0.1);
    transition: background 0.15s ease, color 0.15s ease;
}

.app-sidebar-logout:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.2);
}

.app-sidebar-logout i {
    font-size: 0.95rem;
}

.app-sidebar-nav .nav-link {
    color: rgba(255, 255, 255, 0.82) !important;
    border-radius: var(--sr-radius-sm);
    padding: 0.55rem 0.75rem !important;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.15s ease, color 0.15s ease;
}

.app-sidebar-nav .nav-link i {
    font-size: 1.1rem;
    opacity: 0.9;
    width: 1.25rem;
    text-align: center;
}

.app-sidebar-nav .nav-link:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.1);
}

.app-sidebar-nav .nav-link.active {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.18);
    font-weight: 600;
    box-shadow: inset 3px 0 0 #fff;
}

.app-sidebar-nav .nav-divider {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.app-sidebar-nav .app-sidebar-parent {
    justify-content: space-between;
}

.app-sidebar-nav .app-sidebar-chevron {
    font-size: 0.75rem;
    opacity: 0.75;
    transition: transform 0.2s ease;
}

.app-sidebar-nav .app-sidebar-parent[aria-expanded="true"] .app-sidebar-chevron {
    transform: rotate(180deg);
}

.app-sidebar-subnav {
    margin: 0.15rem 0 0.35rem 0.5rem;
    padding-left: 0.35rem;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.app-sidebar-subnav .nav-link {
    padding: 0.4rem 0.65rem 0.4rem 0.5rem !important;
    font-size: 0.85rem;
}

.app-sidebar-subnav .nav-link i {
    font-size: 1rem;
}

/* Legacy sidebar class compat */
.sidebar-desktop {
    min-height: 100vh;
    background: var(--sr-gradient-sidebar);
}

.sidebar-desktop a.nav-link {
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    border-radius: var(--sr-radius-sm);
}

.sidebar-desktop a.nav-link:hover,
.sidebar-desktop a.nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

/* ——— Portal top nav (desktop) ——— */
.app-topnav {
    background: var(--sr-gradient) !important;
    box-shadow: var(--sr-shadow);
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}

.app-topnav .navbar-brand {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.app-topnav .nav-link {
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: var(--sr-radius-sm);
    padding: 0.4rem 0.75rem !important;
    transition: background 0.15s ease;
}

.app-topnav .nav-link:hover,
.app-topnav .nav-link.active {
    background: rgba(255, 255, 255, 0.15);
}

.app-topnav .nav-logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0 !important;
    border-radius: 50%;
    font-size: 1.15rem;
}

.app-topnav .nav-logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ——— Main content ——— */
.app-content {
    min-height: 60vh;
}

@media (min-width: 768px) {
    .app-content {
        padding: 1.75rem 2rem !important;
    }
}

/* Page titles */
.app-content > h2,
.app-content > .page-head h2,
.app-content h2.h5:first-child {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--sr-primary);
    margin-bottom: 1rem;
}

.app-content > h4,
.app-content > h5 {
    font-weight: 700;
    color: var(--sr-primary);
    font-size: 1rem;
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
}

.app-content > .d-flex:has(h2) {
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--sr-border);
}

.app-content > .d-flex h2 {
    margin-bottom: 0;
}

/* ——— Cards ——— */
.app-content .card {
    border: 1px solid var(--sr-border);
    border-radius: var(--sr-radius);
    box-shadow: var(--sr-shadow-sm);
    overflow: hidden;
}

.app-content .card-header {
    background: #f8fafc;
    border-bottom: 1px solid var(--sr-border);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--sr-primary);
    padding: 0.85rem 1.1rem;
}

.app-content .card-body {
    padding: 1.1rem;
}

.app-content .card.border-0,
.app-content .stat-card-compact {
    border: 1px solid var(--sr-border) !important;
}

.stat-card-compact {
    position: relative;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card-compact::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--sr-gradient);
}

.stat-card-compact:hover {
    transform: translateY(-2px);
    box-shadow: var(--sr-shadow);
}

.stat-card-compact .stat-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6c757d;
}

.stat-card-compact .stat-value {
    font-weight: 800;
    color: var(--sr-primary);
    letter-spacing: -0.02em;
}

/* Kartu stat berwarna (mis. halaman keuangan) — teks putih, jangan pakai warna gelap stat-card */
.stat-card-compact[class*="text-bg-"] {
    border-color: transparent !important;
}

.stat-card-compact[class*="text-bg-"]::before {
    display: none;
}

.stat-card-compact[class*="text-bg-"] .stat-label,
.stat-card-compact[class*="text-bg-"] .stat-value,
.stat-card-compact[class*="text-bg-"] .stat-value-money {
    color: #fff !important;
}

.stat-card-compact[class*="text-bg-"] .stat-label {
    opacity: 0.9;
}

.stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.55rem;
    background: #eef4fc;
    border-radius: var(--sr-radius-pill);
    font-size: 0.8rem;
    color: var(--sr-primary);
}

.dashboard-chart-wrap {
    position: relative;
    width: 100%;
    min-height: 220px;
    height: 220px;
}

.dashboard-chart-wrap--donut {
    max-width: 240px;
    margin: 0 auto;
}

.dashboard-chart-wrap--wide {
    min-height: 260px;
    height: 260px;
}

.dashboard-chart-wrap canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* Portal dashboard quick cards */
.portal-quick-card {
    border: 1px solid var(--sr-border) !important;
    border-radius: var(--sr-radius) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none !important;
}

.portal-quick-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--sr-shadow) !important;
}

.portal-quick-card .card-body {
    padding: 1.25rem 1rem !important;
}

.portal-announce-card {
    border-left: 3px solid var(--sr-accent);
}

.dashboard-pending-card .table-responsive {
    overflow-x: auto;
}

.dashboard-pending-card .pending-verify-actions {
    min-width: 4.5rem;
    vertical-align: top;
}

.dashboard-pending-card .pending-verify-actions .btn {
    min-width: 4.25rem;
}

.portal-welcome-hero {
    text-align: center;
    padding: 1.5rem 1.25rem;
    margin: -1rem -1rem 1.25rem;
    background: var(--sr-gradient);
    border-radius: 0 0 1.5rem 1.5rem;
    color: #fff;
    box-shadow: var(--sr-shadow);
}

@media (min-width: 768px) {
    .portal-welcome-hero {
        margin: 0 0 1.5rem;
        border-radius: var(--sr-radius);
    }
}

.portal-welcome-hero .welcome-label {
    font-size: 0.8rem;
    opacity: 0.85;
    margin-bottom: 0.25rem;
}

.portal-welcome-hero .welcome-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
}

/* ——— Tables ——— */
.app-content .table-responsive {
    background: var(--sr-surface);
    border-radius: var(--sr-radius);
    box-shadow: var(--sr-shadow-sm);
    border: 1px solid var(--sr-border);
    overflow: hidden;
}

.app-content table.table {
    margin-bottom: 0;
    --bs-table-bg: var(--sr-surface);
}

.app-content table.table thead {
    background: #f8fafc;
}

.app-content table.table thead th {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6c757d;
    border-bottom: 1px solid var(--sr-border);
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.app-content table.table tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    font-size: 0.9rem;
    border-color: #f1f3f5;
}

.app-content table.table-hover tbody tr:hover {
    background: #f8fafc;
}

/* Standalone tables without wrapper */
.app-content > table.table,
.app-content > h5 + table.table {
    background: var(--sr-surface);
    border-radius: var(--sr-radius);
    box-shadow: var(--sr-shadow-sm);
    border: 1px solid var(--sr-border);
    overflow: hidden;
    display: block;
    width: 100%;
}

/* ——— Forms ——— */
.app-content .form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.35rem;
}

.app-content .form-control,
.app-content .form-select {
    border-color: #e2e8f0;
    border-radius: var(--sr-radius-sm);
    font-size: 0.95rem;
    padding: 0.55rem 0.85rem;
}

.app-content .form-control:focus,
.app-content .form-select:focus {
    border-color: var(--sr-accent);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.12);
}

.app-content > form,
.app-content form.card,
.app-content .form-card {
    background: var(--sr-surface);
    border: 1px solid var(--sr-border);
    border-radius: var(--sr-radius);
    box-shadow: var(--sr-shadow-sm);
    padding: 1.25rem;
}

.app-content form.card {
    padding: 0;
}

.app-content form.card .card-body {
    padding: 1.25rem;
}

.app-content > form.col-md-6 {
    max-width: 480px;
}

.profile-portal-page > form {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

/* Search / filter bars */
.app-content > form.mb-3:not(.row) .input-group,
.app-content > form .input-group {
    box-shadow: var(--sr-shadow-sm);
    border-radius: var(--sr-radius-sm);
    overflow: hidden;
}

.app-content > form.row.g-2 {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

/* ——— Buttons ——— */
.app-content .btn {
    font-weight: 600;
    border-radius: var(--sr-radius-sm);
    font-size: 0.875rem;
}

.app-content .btn-primary {
    background: linear-gradient(135deg, var(--sr-accent) 0%, var(--sr-accent-dark) 100%);
    border: none;
    box-shadow: 0 2px 10px rgba(13, 110, 253, 0.3);
}

.app-content .btn-primary:hover {
    background: linear-gradient(135deg, #0b5ed7 0%, #084298 100%);
    box-shadow: 0 4px 14px rgba(13, 110, 253, 0.4);
}

.app-content .btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

/* ——— Badges ——— */
.app-content .badge {
    font-weight: 600;
    padding: 0.35em 0.65em;
    border-radius: 0.35rem;
}

/* ——— Mobile card list ——— */
.mobile-card-list .card,
.mobile-card-list > a.card {
    border: 1px solid var(--sr-border) !important;
    border-radius: var(--sr-radius) !important;
    box-shadow: var(--sr-shadow-sm) !important;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.mobile-card-list .card:active,
.mobile-card-list > a.card:hover {
    transform: translateY(-1px);
    box-shadow: var(--sr-shadow) !important;
}

/* ——— List group ——— */
.app-content .list-group-item {
    border-color: #f1f3f5;
    padding: 0.85rem 1.1rem;
}

.app-content .list-group-item strong {
    color: var(--sr-primary);
}

/* ——— Modals ——— */
.modal-content {
    border: none;
    border-radius: var(--sr-radius);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid var(--sr-border);
    background: #f8fafc;
}

.modal-footer {
    border-top: 1px solid var(--sr-border);
}

/* ——— Error pages ——— */
.app-error-page {
    text-align: center;
    padding: 3rem 1.5rem;
    max-width: 400px;
    margin: 0 auto;
}

.app-error-page .error-code {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1;
    background: var(--sr-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.04em;
}

.app-error-page p {
    color: #6c757d;
    margin-bottom: 1.5rem;
}

/* ——— Login ——— */
.auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    background: linear-gradient(165deg, var(--sr-primary) 0%, var(--sr-primary-light) 42%, var(--sr-bg) 42%);
    font-family: var(--sr-font);
}

.auth-hero {
    color: #fff;
    text-align: center;
    padding: 2.5rem 1rem 1.5rem;
}

.auth-hero i {
    font-size: 3rem;
    opacity: 0.95;
}

.auth-hero h1 {
    font-weight: 800;
    letter-spacing: -0.03em;
}

.auth-wrap {
    padding: 0 1rem 2rem;
    display: flex;
    justify-content: center;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    border: none;
    border-radius: var(--sr-radius) var(--sr-radius) 0 0;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.12);
}

.auth-card .form-control {
    border-radius: var(--sr-radius-sm);
    padding: 0.65rem 0.9rem;
}

.auth-card .btn-primary {
    border-radius: var(--sr-radius-pill);
    padding: 0.75rem;
    font-weight: 700;
}

/* ——— Print ——— */
@media print {
    .no-print {
        display: none !important;
    }
    body {
        background: #fff;
    }
}

.payment-proof-img {
    max-height: 420px;
    object-fit: contain;
    background: #f8f9fa;
}

.payment-proof-card .card-body {
    padding: 1rem;
}

.portal-proof-thumb-img,
.proof-file-preview-img {
    max-height: 200px;
    width: 100%;
    object-fit: contain;
    border-radius: 0.375rem;
    background: #f8f9fa;
}

.proof-file-preview-inner {
    min-height: 4rem;
}

.portal-payment-card .badge {
    flex-shrink: 0;
    white-space: nowrap;
}
