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

:root {
    --red-900:  #501313;
    --red-800:  #791F1F;
    --red-700:  #8B2121;
    --red-main: #A32D2D;
    --red-mid:  #C0392B;
    --red-400:  #E24B4A;
    --red-light:#F7C1C1;
    --red-pale: #FCEBEB;

    --sidebar-w: 220px;
    --topbar-h:  60px;

    --gray-50:  #F7F6F4;
    --gray-100: #EFEEEC;
    --gray-200: #E1DED9;
    --gray-400: #9A9692;
    --gray-600: #6B6865;
    --gray-900: #1C1A18;
    --white:    #ffffff;

    --sidebar-transition: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* ── OVERLAY (mobile only) ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 90;
    opacity: 0;
    transition: opacity 0.28s;
}
.sidebar-overlay.visible {
    display: block;
    opacity: 1;
}

/* ── SIDEBAR ── */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--red-main);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    overflow: hidden;
    transition: transform var(--sidebar-transition), width var(--sidebar-transition);
}

body.sidebar-collapsed .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w)));
}
body.sidebar-collapsed .main {
    margin-left: 0;
}

.sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 10% 0%, rgba(255,255,255,0.10) 0%, transparent 60%),
        radial-gradient(ellipse at 90% 100%, rgba(0,0,0,0.18) 0%, transparent 60%);
    pointer-events: none;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
    height: var(--topbar-h);
    border-bottom: 1px solid rgba(255,255,255,0.12);
    position: relative;
    flex-shrink: 0;
}
.logo-circle {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: rgba(255,255,255,0.18);
    border: 1.5px solid rgba(255,255,255,0.3);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.logo-text {
    font-family: 'Sora', sans-serif;
    font-size: 13px; font-weight: 600;
    color: white; line-height: 1.2;
}
.logo-sub { font-size: 10px; font-weight: 400; color: rgba(255,255,255,0.65); }

.sidebar-close {
    display: none;
    margin-left: auto;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 8px;
    padding: 6px;
    cursor: pointer;
    color: white;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.sidebar-close:hover { background: rgba(255,255,255,0.25); }

.sidebar-nav {
    flex: 1;
    padding: 14px 0;
    overflow-y: auto;
    position: relative;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    font-size: 13.5px; font-weight: 500;
    color: rgba(255,255,255,0.75);
    cursor: pointer;
    border-radius: 0;
    transition: background 0.18s, color 0.18s;
    position: relative;
    user-select: none;
    text-decoration: none;
}
.nav-item:hover { background: rgba(255,255,255,0.10); color: white; }
.nav-item.active { background: rgba(255,255,255,0.16); color: white; }
.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: white;
    border-radius: 0 3px 3px 0;
}
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.85; }
.nav-arrow {
    margin-left: auto;
    width: 14px; height: 14px;
    opacity: 0.6;
    transition: transform 0.2s;
    flex-shrink: 0;
}
.nav-item.open .nav-arrow { transform: rotate(180deg); }

.nav-sub {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
}
.nav-sub.open { max-height: 220px; }

.nav-sub-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px 8px 48px;
    font-size: 12.5px;
    color: rgba(255,255,255,0.60);
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
    text-decoration: none;
}
.nav-sub-item:hover { color: white; background: rgba(255,255,255,0.07); }
.nav-sub-item.active { color: white; background: rgba(255,255,255,0.10); }
.nav-sub-item::before {
    content: '';
    width: 5px; height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    flex-shrink: 0;
}
.nav-sub-item.active::before { background: white; }

.sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,0.12);
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    position: relative;
    flex-shrink: 0;
}

/* ── MAIN ── */
.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    transition: margin-left var(--sidebar-transition);
}

/* ── TOPBAR ── */
.topbar {
    height: var(--topbar-h);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    padding: 0 28px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-menu {
    background: none; border: none; cursor: pointer;
    color: var(--gray-600); padding: 6px; border-radius: 8px;
    display: flex; transition: background 0.15s;
}
.topbar-menu:hover { background: var(--gray-100); }
.topbar-title {
    font-family: 'Sora', sans-serif;
    font-size: 15px; font-weight: 600;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--red-main);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Sora', sans-serif;
    font-size: 14px; font-weight: 600;
    flex-shrink: 0;
}
.user-info { text-align: right; }
.user-name  { font-size: 13px; font-weight: 500; color: var(--gray-900); display: block; }
.user-role  { font-size: 11px; color: var(--gray-400); display: block; }

/* ── CONTENT ── */
.content { padding: 24px 28px; flex: 1; min-width: 0; }


/* ── PAGE VIEWS ── */


/* ── DASHBOARD WIDGETS ── */


/* ══════════════════════════════════════
   PENDAFTARAN TABLE PAGE
══════════════════════════════════════ */

/* Filter Card */


/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
    :root { --sidebar-w: 200px; }
}

@media (max-width: 768px) {
    body.sidebar-collapsed .sidebar { transform: translateX(-100%); }
    body.sidebar-collapsed .main    { margin-left: 0; }

    .sidebar { transform: translateX(-100%); box-shadow: none; width: 240px; }
    .sidebar.open {
        transform: translateX(0) !important;
        box-shadow: 4px 0 24px rgba(0,0,0,0.22);
    }
    .sidebar-close { display: flex; }
    .main { margin-left: 0 !important; }
    .topbar { padding: 0 16px; gap: 10px; }
    .content { padding: 16px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .user-info { display: none; }
}

@media (max-width: 480px) {
    .stat-grid { grid-template-columns: 1fr; }
    .stat-card-value { font-size: 28px; }
    .chart-wrap { height: 200px; }
    .section-card { padding: 16px; }
    .filter-field { max-width: 100%; }
    .btn-filter { width: 100%; text-align: center; }
    .page-title { font-size: 16px; }
}

@media (max-height: 500px) and (max-width: 900px) {
    :root { --topbar-h: 48px; }
    .sidebar-nav { padding: 8px 0; }
    .nav-item { padding: 8px 16px; font-size: 13px; }
    .content { padding: 12px 16px; }
}

.topbar-right {
    position: relative;
}

.user-dropdown {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 8px;
    transition: background 0.15s;
    width: 100%;
}

.user-dropdown:hover {
    background: var(--gray-100);
}

.dropdown-arrow {
    color: var(--gray-400);
    transition: transform 0.2s;
}

.user-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(28, 26, 24, 0.12);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--gray-900);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s;
    white-space: nowrap;
}

.dropdown-item:hover {
    background: var(--gray-50);
}

.dropdown-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.7;
}
