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

:root {
    --primary: #4F46E5; /* Indigo 600 */
    --primary-hover: #4338CA;
    --primary-light: #E0E7FF;
    --secondary: #06B6D4; /* Cyan 500 */
    --secondary-hover: #0891B2;
    --accent: #F59E0B; /* Amber 500 */
    --bg: #F3F4F6;
    --surface: #FFFFFF;
    --text: #111827; /* Gray 900 */
    --text-muted: #6B7280;
    --border: #E5E7EB;
    --danger: #EF4444;
    --danger-hover: #DC2626;
    --success: #10B981;
    --success-hover: #059669;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Typography & Utilities */
h1, h2, h3, h4 { color: var(--text); font-weight: 600; letter-spacing: -0.02em; }
.text-muted { color: var(--text-muted); font-size: 0.9rem; }
.text-center { text-align: center; }
.mb-2 { margin-bottom: 1rem; }
.mt-2 { margin-top: 1rem; }
.w-100 { width: 100%; }

/* Particles Animation */
@keyframes floatUp {
  0% { transform: translateY(110vh) scale(0.5) rotate(0deg); opacity: 0; }
  10% { opacity: 0.2; }
  90% { opacity: 0.2; }
  100% { transform: translateY(-20vh) scale(1.5) rotate(360deg); opacity: 0; }
}
.particle {
  position: absolute;
  top: 0;
  color: rgba(255, 255, 255, 0.15);
  animation: floatUp 15s linear infinite;
  z-index: 1;
}

/* Login Container */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}
.login-wrapper::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    top: -200px;
    left: -200px;
    border-radius: 50%;
}
.login-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 420px;
    text-align: center;
    position: relative;
    z-index: 10;
    border: 1px solid rgba(255,255,255,0.2);
}
.login-box h2 {
    color: var(--primary);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}
.login-box .form-control {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

/* Layout Dashboard */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg);
    width: 100%;
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    width: 270px;
    background: linear-gradient(180deg, #111827 0%, #1f2937 100%);
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
    z-index: 10;
}
.sidebar-header {
    padding: 1.5rem;
    font-size: 1.4rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: 0.5px;
    color: #f8fafc;
}
.sidebar-menu {
    flex: 1;
    padding: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0.9rem 1.8rem;
    color: #9ca3af;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    font-weight: 500;
    border-left: 4px solid transparent;
}
.nav-link:hover, .nav-link.active {
    background: rgba(255,255,255,0.05);
    color: white;
    border-left: 4px solid var(--primary);
}
.nav-link i { font-size: 1.1rem; width: 20px; text-align: center; }
.nav-link { position: relative; }
.nav-badge {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: #ef4444;
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
}
.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.main-content {
    flex: 1;
    padding: 2.5rem;
    overflow-y: auto;
}
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 20;
}
.header-user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}
.header-user-name-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.header-user-name {
    display: block;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.82rem;
}
.header-user-role {
    margin-top: 0;
    font-size: 0.64rem;
    padding: 2px 6px;
    line-height: 1.15;
}

/* Dropdown hover di header desktop */
.header-user-dropdown {
    position: relative;
    cursor: pointer;
    user-select: none;
}
.header-user-dropdown .header-user-info {
    cursor: pointer;
    border-radius: 8px;
    padding: 4px 8px;
    transition: background 0.18s;
}
.header-user-dropdown:hover .header-user-info {
    background: #f1f5f9;
}
.header-user-chevron {
    font-size: 0.65rem;
    color: #94a3b8;
    margin-left: 2px;
    transition: transform 0.2s ease;
}
.header-user-dropdown:hover .header-user-chevron {
    transform: rotate(180deg);
}
.header-user-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 150px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
    z-index: 200;
}
.header-user-dropdown:hover .header-user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.header-dropdown-logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    border-radius: 7px;
    color: #dc2626;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    text-align: left;
}
.header-dropdown-logout-btn:hover {
    background: #fef2f2;
}
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
    padding: 1.2rem 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    border-left: 5px solid var(--primary);
}

/* Components */
.panel {
    background: var(--surface);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    margin-bottom: 2rem;
    transition: box-shadow 0.3s ease;
}
.panel.panel-compact {
    padding: 1rem;
    margin-bottom: 1.5rem;
}
.panel.panel-compact .panel-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
}
.panel:hover {
    box-shadow: var(--shadow-lg);
}
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.panel-header h3,
.panel-header > h4 {
    flex: 1 1 0;
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.2;
    font-weight: 700;
    min-width: 0;
}
.panel-header > div {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-end;
}
.panel-header button {
    min-width: auto;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    white-space: nowrap;
}
.panel-header > div:last-child {
    justify-content: flex-end;
}
@media (max-width: 900px) {
    .panel-header {
        justify-content: space-between;
    }
    .panel-header h3,
    .panel-header > h4 {
        font-size: 0.92rem;
    }
}
@media (max-width: 560px) {
    .panel-header {
        gap: 0.35rem;
        flex-direction: column;
        align-items: stretch;
    }
    .panel-header h3,
    .panel-header > h4 {
        font-size: 0.88rem;
        margin-bottom: 0.35rem;
    }
    .panel-header > div {
        justify-content: flex-start;
        width: 100%;
        flex-wrap: wrap;
        gap: 0.35rem;
    }
    .panel-header button {
        padding: 0.3rem 0.65rem;
        font-size: 0.75rem;
    }
    .btn-text-desktop {
        display: none !important;
    }
    .btn-text-mobile {
        display: inline !important;
    }
    .panel-actions {
        flex-wrap: nowrap;
    }
    .panel-actions.panel-actions-2col {
        display: flex;
        width: 100%;
        justify-content: space-between;
        gap: 0.5rem;
    }
    .panel-actions.panel-actions-2col .table-action-btn {
        flex: 1 1 0;
        min-width: 0;
        max-width: calc((100% - 0.5rem) / 2);
        white-space: nowrap;
    }
    .tab-header.tab-header-2col {
        flex-wrap: nowrap;
        width: 100%;
        gap: 0.5rem;
    }
    .tab-header.tab-header-2col .tab-btn {
        flex: 1 1 0;
        min-width: 0;
        max-width: calc((100% - 10px) / 2);
    }
    .table-action-btn {
        flex: 1 1 0;
        min-width: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        padding: 0.55rem 0.75rem;
        white-space: nowrap;
    }
    .btn-text-desktop {
        display: none !important;
    }
    .btn-text-mobile {
        display: inline !important;
    }
}

/* Forms */
.form-group {
    margin-bottom: 1.2rem;
    text-align: left;
}
.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: #4b5563;
}
.form-control, .form-control-file {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background-color: #f9fafb;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background-color: var(--surface);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}
select.form-control {
    appearance: auto;
    cursor: pointer;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: capitalize;
}
.link-button {
    display: inline-flex;
    align-items: center;
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.link-button:hover,
.link-button:focus {
    text-decoration: underline;
    outline: none;
}
.data-table td .link-button {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: white; box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3); border: none; }
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-hover), var(--secondary-hover)); box-shadow: 0 6px 8px -1px rgba(79, 70, 229, 0.4); }
.btn-success { background: linear-gradient(135deg, var(--success), #34d399); color: white; border: none; }
.btn-success:hover { background: linear-gradient(135deg, var(--success-hover), #10b981); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: var(--danger-hover); }
.btn-info { background: var(--secondary); color: white; }
.btn-info:hover { background: var(--secondary-hover); }
.btn-secondary { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }
.btn-secondary:hover { background: #e5e7eb; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; border-radius: 6px; }
.btn-block { width: 100%; }

/* Tables */
.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin: 0;
    padding: 0;
    text-align: left;
}
.table-responsive.table-responsive-compact {
    padding-bottom: 0.2rem;
}
.table-responsive.table-responsive-compact table {
    margin-bottom: 0;
}
.table-responsive.table-responsive-compact .data-table th,
.table-responsive.table-responsive-compact .data-table td {
    padding: 0.55rem 0.7rem;
}
.table-responsive table {
    width: 100%;
    min-width: 0;
    margin-bottom: 0.35rem;
}
.data-table,
table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    table-layout: auto;
}
.data-table th,
.data-table td,
th, td {
    padding: 0.8rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
}
.data-table th,
th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
@media (min-width: 901px) {
    .data-table th,
    .data-table td {
        font-size: 1rem;
    }
}
@media (max-width: 900px) {
    .data-table th,
    .data-table td {
        font-size: 0.84rem;
    }
    .data-table th {
        font-size: 0.72rem;
    }
}

.desktop-only {
    display: table-cell;
}

.mobile-only {
    display: none;
}

.hide-on-mobile {
    display: table-cell;
}

.opd-table {
    border: none;
    border-collapse: collapse;
}

.opd-table th,
.opd-table td {
    border: none;
}

.opd-table th:first-child,
.opd-table td:first-child {
    min-width: 280px;
    width: 50%;
}

.opd-table th:not(:first-child),
.opd-table td:not(:first-child) {
    width: auto;
}

@media (max-width: 900px) {
    .desktop-only,
    .hide-on-mobile {
        display: none !important;
    }
    .mobile-only {
        display: table-cell !important;
    }
    .opd-table .desktop-only,
    .opd-table .hide-on-mobile {
        display: table-cell !important;
    }
    .opd-table .mobile-only {
        display: none !important;
    }
}

@media (max-width: 560px) {
    .opd-table .desktop-only,
    .opd-table .hide-on-mobile {
        display: none !important;
    }
    .opd-table .mobile-only {
        display: table-cell !important;
    }
}

/* Tombol aksi tabel Kelola Akun Superadmin */
.pengaturan-akun-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

/* Tabel Kelola Akun Superadmin - pastikan tidak ada min-width besar */
.superadmin-akun-tabel {
    table-layout: auto;
    width: 100%;
}

/* Card container di tab-akun */
.tab-akun-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    box-sizing: border-box;
    width: 100%;
    min-width: 0; /* Cegah overflow keluar dari parent */
    overflow: hidden;
}

/* Header card: title + tombol bisa wrap ke baris baru di HP */
.tab-akun-card-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.tab-akun-card-header h4 {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
}

/* Grid Backup & Restore: 2 kolom di desktop, 1 kolom di HP */
.backup-restore-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.backup-restore-item {
    background: #fff;
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-sizing: border-box;
    min-width: 0;
}

/* Di mobile, backup/restore stacked 1 kolom */
@media (max-width: 600px) {
    .backup-restore-grid {
        grid-template-columns: 1fr;
    }
    .tab-akun-card {
        padding: 14px;
    }
}



.mobile-app-header,
.mobile-bottom-nav {
    display: none;
}

@media (max-width: 900px) {
    .dashboard-layout {
        display: block;
    }
    .sidebar {
        display: none;
    }
    .mobile-app-header {
        display: flex;
        position: sticky;
        top: 0;
        z-index: 30;
        width: 100%;
        /* Solid white - tidak transparan agar tidak tumpang tindih saat scroll */
        background: #ffffff;
        border-bottom: 1px solid #e2e8f0;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        padding: 0.9rem 1rem;
        gap: 12px;
        align-items: center;
        justify-content: space-between;
    }
    .mobile-header-brand {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }
    .mobile-logout-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 0.55rem;
        border-radius: 12px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: white;
        background: #ef4444;
        border: 1px solid rgba(239,68,68,0.4);
    }
    .mobile-logout-btn:hover {
        background: #dc2626;
    }
    .mobile-header-brand img,
    .mobile-header-brand i {
        width: 38px;
        height: 38px;
        flex-shrink: 0;
        border-radius: 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: rgba(15, 23, 42, 0.05);
    }
    .mobile-header-title {
        font-size: 1rem;
        font-weight: 700;
        color: var(--text);
    }
    .mobile-header-subtitle {
        font-size: 0.78rem;
        color: var(--text-muted);
    }
    .mobile-bottom-nav {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--surface);
        border-top: 1px solid var(--border);
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
        z-index: 40;
    }
    .mobile-bottom-nav-inner {
        display: flex;
        width: 100%;
        justify-content: space-between;
        align-items: stretch;
    }
    .mobile-nav-link {
        flex: 0 0 20%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 0.6rem 0.2rem;
        font-size: 0.72rem;
        color: #64748b;
        text-decoration: none;
        border-right: 1px solid #e5e7eb;
        min-height: 64px;
        position: relative;
        transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
        background: #f8fafc;
    }
    /* Untuk nav dengan sedikit item (misal ASN: 3 item), isi penuh lebar layar */
    .mobile-nav-link.mobile-nav-link-flex {
        flex: 1 1 0;
    }
    .mobile-nav-link:last-child {
        border-right: none;
    }
    .mobile-nav-link i {
        font-size: 1rem;
        line-height: 1;
    }
    .mobile-nav-link.center-item {
        flex: 0 0 auto;
        transform: translateY(-10%);
        background: var(--primary);
        color: white;
        border-radius: 50%;
        min-width: 62px;
        min-height: 62px;
        width: 62px;
        height: 62px;
        justify-content: center;
        padding: 0;
        box-shadow: 0 10px 20px rgba(15, 23, 42, 0.18);
        border: 1px solid rgba(255,255,255,0.12);
    }
    .mobile-nav-link.center-item span {
        display: none;
    }
    .mobile-nav-link.center-item i {
        font-size: 1.2rem;
    }
    .mobile-nav-link.center-item.active,
    .mobile-nav-link.center-item:hover {
        color: white;
        background: var(--primary);
        transform: translateY(-10%);
    }
    .mobile-nav-link:not(.center-item).active,
    .mobile-nav-link:not(.center-item):hover {
        color: var(--primary);
        background: #f8fafc;
    }
    .mobile-nav-badge {
        position: absolute;
        top: 6px;
        right: 12px;
        background: #ef4444;
        color: white;
        font-size: 0.65rem;
        padding: 2px 6px;
        border-radius: 999px;
    }
    .main-content {
        padding: 1rem 1rem 88px;
        flex: 1;
    }
    .grid-cards {
        grid-template-columns: 1fr;
    }
    .card {
        padding: 1rem;
    }
    .data-table th,
    .data-table td {
        /* Hanya white-space nowrap di mobile untuk header saja, bukan semua td */
        white-space: normal;
    }
    .data-table th {
        white-space: nowrap;
    }

    .truncate-1-line {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .truncate-2-lines {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: normal;
        line-height: 1.2;
        max-height: calc(2 * 1.2em);
    }
}

tr:last-child td { border-bottom: none; }
tr:hover td {
    background: #f1f5f9;
}
/* Kolom Aksi — td dan th harus tetap table-cell, BUKAN flex */
td.actions,
th.actions {
    display: table-cell !important;  /* override .actions{display:flex} */
    white-space: nowrap;
    vertical-align: middle;
}
/* Flex hanya untuk div/span.actions (tombol-tombol di dalam td) */
div.actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: nowrap;
}
div.actions button {
    margin-right: 0;
    white-space: nowrap;
    flex: 0 0 auto;
}
/* .actions class lama — masih ada di tempat lain */
.actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: nowrap;
    white-space: nowrap;
}
.actions button {
    margin-right: 0;
    white-space: nowrap;
    flex: 0 0 auto;
}
.actions button i {
    margin-right: 0;
}

@media (max-width: 760px) {
    div.actions {
        gap: 0.2rem;
    }
    div.actions button,
    .actions button {
        padding: 0.35rem 0.45rem;
        font-size: 0.72rem;
        min-width: auto;
    }
}


/* Tabs */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0px;
    /* Hapus overflow-x: auto agar tidak ada scrollbar di kanan tab */
    overflow: visible;
}
.tabs .tab-btn,
.tab-header .tab-btn {
    flex: 1 1 0;
    max-width: 100%;
    min-width: 0;
}
.tab-header {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}
.tab-header.tab-header-2col {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    gap: 0.5rem;
}
.tab-header.tab-header-2col .tab-btn {
    flex: 0 0 calc(50% - 0.25rem);
    width: calc(50% - 0.25rem);
    max-width: calc(50% - 0.25rem);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tab-btn {
    background: none;
    border: none;
    padding: 0.6rem 0.8rem;
    font-size: 0.82rem;
    font-family: inherit;
    min-width: 100px;
    text-align: center;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tab-btn:hover {
    color: var(--primary);
}
.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}
.tab-content.active {
    display: block;
}
.settings-2col-form {
    display: block;
}
.settings-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.settings-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem;
}
.settings-section h4 {
    margin-bottom: 0.75rem;
    font-size: 1rem;
}
.color-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}
.color-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}
.color-input {
    width: 46px;
    height: 36px;
    padding: 0;
    border: 1px solid #d1d5db;
    border-radius: 8px;
}
.preview-box {
    width: 100%;
    min-height: 140px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.preview-placeholder {
    color: #6b7280;
    font-size: 0.9rem;
    text-align: center;
    padding: 1rem;
}
.small-text {
    font-size: 0.82rem;
    color: #6b7280;
}
.file-input {
    padding: 0.45rem 0.6rem;
}
@media (max-width: 900px) {
    .settings-2col {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 560px) {
    .settings-panel {
        padding: 1rem;
    }
    .tabs {
        gap: 0;
        /* Pastikan tab memenuhi lebar penuh, tidak ada scroll */
        width: 100%;
        overflow: visible;
    }
    .tab-btn {
        font-size: 0.78rem;
        padding: 0.5rem 0.5rem;
        flex: 1 1 auto;
        min-width: 0;
        max-width: 100%;
        white-space: normal;      /* Izinkan teks wrap jika terlalu panjang */
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.3;
    }
    .settings-section h4 {
        font-size: 0.95rem;
    }
    .form-group label,
    .form-control,
    .form-control-file {
        font-size: 0.85rem;
    }
    .form-control,
    .file-input {
        padding: 0.45rem 0.55rem;
    }
    .preview-box {
        min-height: 120px;
    }
    .header {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        align-items: flex-start;
    }
    .header-user-name {
        /* Perkecil max-width di layar kecil agar tidak tumpang tindih */
        max-width: 100px;
    }
    .header-user-info {
        gap: 0.35rem;
    }
    /* Untuk layar sangat kecil < 360px */
    @media (max-width: 360px) {
        .header-user-name {
            max-width: 70px;
        }
    }
    .header-user-role {
        display: none;
    }
    .table-responsive {
        overflow-x: auto;
    }
    .table-responsive.table-responsive-compact {
        display: block;
        overflow-x: auto;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    .table-responsive.table-responsive-compact table {
        width: auto;
        min-width: 620px;
        box-sizing: border-box;
    }
    .table-responsive.table-responsive-compact td,
    .table-responsive.table-responsive-compact th {
        word-break: break-word;
        white-space: normal;
        min-width: 90px;
    }
    .table-responsive .btn {
        width: auto;
        white-space: nowrap;
    }
    .pengaturan-akun-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.3rem;
    }
    .pengaturan-akun-actions .btn {
        flex: 1 1 auto;
        min-width: 0;
    }
}
.compact-month-tabs {
    display: grid;
    grid-template-columns: repeat(14, minmax(80px, 1fr));
    grid-auto-flow: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    width: 100%;
}
.btn-tab-bulan {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 30px;
    padding: 0.35rem 0.5rem;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.1;
    white-space: normal;
    word-break: break-word;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.2s ease;
}
.btn-tab-bulan:hover {
    transform: translateY(-1px);
    opacity: 0.95;
}
@media (max-width: 900px) {
    .compact-month-tabs {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        grid-auto-flow: row;
        overflow-x: hidden;
    }
    .btn-tab-bulan {
        font-size: 0.68rem;
        padding: 0.25rem 0.4rem;
        min-height: 28px;
    }
}
@media (max-width: 560px) {
    .compact-month-tabs {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 0.35rem;
    }
    .btn-tab-bulan {
        font-size: 0.66rem;
        padding: 0.2rem 0.35rem;
    }
}
@media (max-width: 420px) {
    .compact-month-tabs {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 0.25rem;
    }
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.compact-filter-row {
    display: grid;
    grid-template-columns: minmax(110px, 110px) minmax(220px, 1fr) minmax(220px, 1fr);
    gap: 0.4rem;
    align-items: center;
    margin-bottom: 0.75rem;
    min-width: 0;
}
.compact-filter-row > * {
    min-width: 0;
}
.compact-filter-row .compact-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    width: 100%;
}
.compact-filter-row .compact-filters select {
    flex: 1 1 0;
    min-width: 0;
    max-width: 160px;
    width: 100%;
}
.compact-filter-row .filter-search {
    min-width: 0;
}
.compact-select,
.compact-select-wide,
.compact-filter-row .filter-search,
select.form-control {
    width: 100%;
    font-size: 0.8rem;
    line-height: 1.25;
    padding: 0.45rem 0.65rem;
    min-height: 32px;
}
.compact-select {
    max-width: 110px;
}
.compact-select-wide {
    max-width: 150px;
}
select.form-control option {
    font-size: 0.8rem;
    line-height: 1.25;
}
@media (max-width: 1024px) {
    .compact-filter-row {
        grid-template-columns: minmax(100px, 100px) minmax(180px, 1fr) minmax(180px, 1fr);
    }
    .compact-filter-row .compact-filters {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
    }
    .compact-filter-row .compact-filters select {
        max-width: 150px;
    }
    .compact-select,
    .compact-select-wide,
    .compact-filter-row .filter-search,
    select.form-control {
        font-size: 0.78rem;
        padding: 0.35rem 0.6rem;
        min-height: 30px;
    }
}
@media (max-width: 760px) {
    .compact-filter-row {
        grid-template-columns: minmax(90px, 90px) minmax(140px, 1fr);
        gap: 0.35rem;
        margin-bottom: 0.65rem;
    }
    .compact-filter-row .compact-filters {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
    }
    .compact-filter-row .compact-filters select {
        max-width: 140px;
    }
}
@media (max-width: 560px) {
    .compact-filter-row {
        grid-template-columns: 32% 68%;
        grid-template-rows: auto auto;
        gap: 0.35rem;
    }
    .compact-filter-row .compact-filters {
        display: grid;
        grid-column: 1 / -1;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.35rem;
        width: 100%;
    }
    .compact-filter-row .compact-filters select,
    .compact-filter-row .compact-filters .form-control {
        width: 100%;
        max-width: none;
    }
    .compact-filter-row .filter-search {
        min-width: 0;
    }
    .compact-select,
    .compact-select-wide,
    .compact-filter-row .filter-search,
    select.form-control {
        font-size: 0.72rem;
        line-height: 1.25;
        padding: 0.32rem 0.5rem;
        min-height: 28px;
    }
    .compact-select {
        max-width: 110px;
    }
    .compact-select-wide {
        max-width: none;
    }
    select.form-control option {
        font-size: 0.72rem;
        line-height: 1.25;
    }
    .data-table th,
    .data-table td {
        font-size: 0.76rem;
        padding: 0.45rem 0.55rem;
        white-space: nowrap;
    }
    .data-table th {
        font-size: 0.72rem;
    }
    .data-table th:first-child,
    .data-table td:first-child {
        min-width: 38%;
        white-space: normal;
    }
    .data-table td:first-child .link-button {
        display: block;
        text-align: left;
        white-space: normal;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        line-height: 1.2;
        max-height: calc(2 * 1.2em);
    }
    .data-table td.mobile-only {
        white-space: normal;
    }
    .actions {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 0.25rem;
        overflow-x: auto;
    }
    .actions button {
        padding: 0.35rem 0.45rem;
        font-size: 0.72rem;
        line-height: 1.2;
        min-width: 34px;
    }
    .actions button i {
        margin-right: 0;
    }
    .actions button .btn-label {
        display: none;
    }
    .compact-top-controls {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        align-items: center;
    }
    .compact-top-btn {
        padding: 0.35rem 0.75rem;
        font-size: 0.82rem;
        border-radius: 0.5rem;
        min-height: 36px;
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
    }
    .compact-top-btn .btn-label {
        display: inline;
    }
    .compact-btn {
        padding: 0.4rem 0.55rem;
        font-size: 0.78rem;
        border-radius: 6px;
        min-height: 34px;
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
    }
    .compact-btn i {
        margin-right: 0;
    }
    .compact-docs {
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
    }
    .compact-docs a {
        margin-right: 0;
        margin-bottom: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .compact-cell .compact-title {
        font-size: 0.88rem;
    }
    .compact-cell .compact-subtext {
        font-size: 0.75rem;
        color: #64748b;
    }
    .compact-status {
        font-size: 0.75rem;
        padding: 0.22rem 0.5rem;
        line-height: 1.2;
    }
    @media (max-width: 900px) {
        .compact-top-btn {
            padding: 0.28rem 0.45rem;
            font-size: 0.72rem;
            min-height: 32px;
        }
        .compact-top-btn .btn-label,
        .compact-btn .btn-label,
        .compact-docs .btn-label {
            display: none;
        }
        .compact-btn {
            padding: 0.28rem 0.4rem;
            font-size: 0.7rem;
            min-height: 30px;
        }
        .compact-status {
            font-size: 0.66rem;
            padding: 0.18rem 0.35rem;
        }
        .compact-cell .compact-title {
            font-size: 0.78rem;
        }
        .compact-cell .compact-subtext {
            font-size: 0.68rem;
        }
    }
    .table-responsive {
        overflow-x: auto;
    }
    .main-content {
        padding-bottom: 110px;
    }
}

.table-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-top: 15px;
    font-size: 0.9rem;
}
.table-controls .pagination-buttons {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}
.table-controls button {
    padding: 0.35rem 0.65rem;
    font-size: 0.82rem;
}
@media (max-width: 560px) {
    .table-controls {
        font-size: 0.75rem;
    }
    .table-controls button {
        padding: 0.25rem 0.45rem;
        font-size: 0.72rem;
    }
}

@media (max-width: 560px) {
    .modal-content {
        padding: 1.25rem;
        width: 95%;
        max-width: 520px;
    }
    .modal-content h2 {
        font-size: 0.95rem;
        margin-bottom: 0.75rem;
    }
    .modal-content .nav-tabs {
        flex-wrap: nowrap;
        gap: 0.35rem;
        margin-bottom: 0.75rem;
        overflow-x: auto;
        white-space: nowrap;
    }
    .modal-content .nav-tabs a {
        padding: 6px 8px;
        font-size: 0.78rem;
        white-space: nowrap;
    }
    .modal-content .form-group {
        margin-bottom: 0.9rem;
    }
    .modal-content label,
    .modal-content .table th,
    .modal-content .table td {
        font-size: 0.82rem;
    }
    .modal-content .form-control,
    .modal-content select.form-control {
        font-size: 0.82rem;
        padding: 0.45rem 0.55rem;
    }
    .modal-content .table {
        font-size: 0.82rem;
    }
    .modal-content .table th,
    .modal-content .table td {
        padding: 0.45rem 0.55rem;
    }
    .modal-content .btn {
        font-size: 0.82rem;
        padding: 0.45rem 0.9rem;
    }
    .modal-content .close-btn {
        top: 0.8rem;
        right: 0.8rem;
    }
}

/* Grid Cards (Kamar Tahun / OPD) */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}
.card {
    background: var(--surface);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
@media (max-width: 1024px) {
    .grid-cards {
        grid-template-columns: repeat(3, minmax(180px, 1fr));
        gap: 1rem;
    }
    .card {
        padding: 1.5rem;
    }
}
@media (max-width: 840px) {
    .grid-cards {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
        gap: 1rem;
    }
    .card {
        padding: 1.3rem;
    }
}
@media (max-width: 760px) {
    .grid-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .card {
        padding: 1rem;
    }
}
.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 4px;
    background: var(--primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}
.card:hover::before {
    transform: scaleX(1);
}
.card i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1.2rem;
    background: var(--primary-light);
    padding: 1rem;
    border-radius: 50%;
}

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(17, 24, 39, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    animation: modalFadeIn 0.3s ease;
}
.modal-content {
    background: var(--surface);
    padding: 2.5rem;
    border-radius: 16px;
    width: 90%; /* Default responsive width */
    max-width: 800px;
    max-height: 90vh;
    /* Gunakan dvh (dynamic viewport height) agar modal tidak tertutup keyboard virtual */
    max-height: 90dvh;
    overflow-y: auto;
    position: relative;
    box-shadow: none;
    border: none;
    animation: modalSlideUp 0.4s ease;
    /* Padding bawah ekstra agar tombol submit tidak tertutup keyboard virtual di HP */
    padding-bottom: max(2.5rem, env(safe-area-inset-bottom, 0px));
}
/* Add Edit Modal Header Gradient */
.modal-header-edit h2 {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    border-bottom: 2px solid #fcd34d;
    padding-bottom: 10px;
    margin-bottom: 20px;
}
/* Allow inline style max-width to override */
.modal-content[style*="max-width"] {
    /* If max-width is set inline, it will take precedence */
}
@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.close-btn {
    position: absolute;
    top: 1.2rem;
    right: 1.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
    background: #f1f5f9;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.close-btn:hover { color: var(--danger); background: #fee2e2; }

/* Badges */
.badge {
    padding: 0.35em 0.8em;
    border-radius: 50rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-warning { background: #FEF3C7; color: #D97706; }
.badge-success { background: #D1FAE5; color: #059669; }
.badge-primary { background: #E0E7FF; color: #4338CA; }

/* Custom Accordion Dropdown */
.acc-dropdown-container { position: relative; width: 100%; }
.acc-dropdown-selected {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background-color: #f9fafb;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.acc-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.25rem;
    margin-top: 4px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
    display: none;
}
.acc-dropdown-menu.show { display: block; }
.acc-group summary {
    padding: 4px 8px;
    background: #f1f5f9;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    border-bottom: 1px solid #e2e8f0;
    list-style: none;
    outline: none;
}
.acc-group summary::-webkit-details-marker { display: none; }
.acc-group summary::after { content: '\25BC'; float: right; font-size: 10px; margin-top: 4px; color: #64748b; }
.acc-group[open] summary::after { content: '\25B2'; }
.acc-group[open] summary { border-bottom: none; }
.acc-item {
    padding: 4px 8px 4px 20px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid #f1f5f9;
}
.acc-item:hover { background: #e0e7ff; color: #4338ca; }
.acc-item.active { background: #4f46e5; color: #fff; }

.glass-box {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 40px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    width: 90%;
    text-align: center;
}

@keyframes floatAnim {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}
.floating-anim {
    animation: floatAnim 4s ease-in-out infinite;
}

/* Compact table layout for Kelola Pegawai */
.panel.panel-compact {
    padding: 0.75rem 0.9rem;
    margin-bottom: 1.25rem;
}
.panel.panel-compact .panel-header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
}
.panel.panel-compact .panel-actions {
    gap: 0.35rem;
}
.panel.panel-compact .table-responsive {
    padding: 0;
    border-width: 1px;
    border-radius: 6px;
    margin: 0;
}
.panel.panel-compact .table-responsive.table-responsive-compact {
    padding-bottom: 0;
}
.panel.panel-compact .data-table {
    margin: 0;
}
.panel.panel-compact .data-table th,
.panel.panel-compact .data-table td {
    padding: 0.45rem 0.65rem;
}
.panel.panel-compact .compact-filter-row {
    margin-bottom: 0.5rem;
    gap: 0.35rem;
}
.panel.panel-compact .table-controls {
    margin-top: 0.45rem;
}
