/* ═══════════════ ADMIN PANEL ═══════════════ */
#admin-panel {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(11, 18, 32, .55);
    backdrop-filter: blur(8px);
    padding: 20px;
    align-items: center;
    justify-content: center;
}

#admin-panel.open {
    display: flex;
}

.admin-modal {
    background: #fff;
    border-radius: 22px;
    width: min(1100px, 98vw);
    max-height: 92vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 32px 80px rgba(0, 0, 0, .30);
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(17, 17, 17, .08);
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--blue), #0a3560);
    border-radius: 22px 22px 0 0;
}

.admin-topbar h2 {
    color: #fff;
    font-size: 17px;
    font-weight: 800;
    margin: 0;
}

.admin-topbar p {
    color: rgba(255, 255, 255, .6);
    font-size: 12px;
    margin: 2px 0 0;
}

.admin-close {
    width: 36px;
    height: 36px;
    border-radius: 99px;
    border: none;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .18s;
}

.admin-close:hover {
    background: rgba(255, 255, 255, .28);
}

.admin-tabs {
    display: flex;
    gap: 4px;
    padding: 14px 24px 0;
    border-bottom: 1px solid rgba(17, 17, 17, .08);
    flex-shrink: 0;
}

.admin-tab {
    padding: 9px 18px;
    border-radius: 12px 12px 0 0;
    border: none;
    background: transparent;
    font-family: 'Sora', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    color: var(--muted);
    transition: background .18s, color .18s;
    border-bottom: 2px solid transparent;
}

.admin-tab:hover {
    background: var(--gray);
    color: var(--black);
}

.admin-tab.active {
    color: var(--blue);
    border-bottom-color: var(--blue);
    background: rgba(15, 76, 129, .06);
}

.admin-body {
    flex: 1;
    overflow-y: auto;
    padding: 22px 24px;
}

/* Tab: Daftar Siswa */
.db-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.db-search {
    flex: 1;
    min-width: 200px;
    padding: 9px 14px;
    border-radius: 12px;
    border: 1px solid rgba(17, 17, 17, .12);
    font-family: 'Sora', sans-serif;
    font-size: 13px;
    outline: none;
    transition: border-color .18s, box-shadow .18s;
}

.db-search:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(15, 76, 129, .10);
}

.db-filter {
    padding: 9px 13px;
    border-radius: 12px;
    border: 1px solid rgba(17, 17, 17, .12);
    font-family: 'Sora', sans-serif;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    background: #fff;
}

.db-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.db-stat {
    background: var(--gray);
    border-radius: 14px;
    padding: 14px 16px;
    border: 1px solid rgba(17, 17, 17, .06);
}

.db-stat-num {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -1px;
}

.db-stat-num.blue {
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.db-stat-num.red {
    background: linear-gradient(135deg, var(--red), #ff5e58);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.db-stat-num.green {
    background: linear-gradient(135deg, #10b981, #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.db-stat-num.orange {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.db-stat-lbl {
    font-size: 12px;
    color: var(--muted);
    margin-top: 3px;
    font-weight: 600;
}

.db-table-wrap {
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid rgba(17, 17, 17, .08);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead tr {
    background: var(--gray);
}

thead th {
    padding: 11px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}

tbody tr {
    border-top: 1px solid rgba(17, 17, 17, .06);
    transition: background .15s;
}

tbody tr:hover {
    background: rgba(15, 76, 129, .03);
}

tbody td {
    padding: 11px 14px;
    vertical-align: middle;
}

.td-name {
    font-weight: 700;
}

.td-avatar {
    width: 32px;
    height: 32px;
    border-radius: 99px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    margin-right: 9px;
    vertical-align: middle;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.status-badge.aktif {
    background: rgba(16, 185, 129, .12);
    color: #059669;
}

.status-badge.lulus {
    background: rgba(15, 76, 129, .10);
    color: var(--blue);
}

.status-badge.proses {
    background: rgba(245, 158, 11, .12);
    color: #d97706;
}

.status-badge.berangkat {
    background: rgba(225, 6, 0, .10);
    color: var(--red);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 99px;
    background: currentColor;
}

.tb-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid rgba(17, 17, 17, .10);
    background: transparent;
    font-family: 'Sora', sans-serif;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    color: var(--black);
}

.tb-action:hover {
    background: var(--gray);
}

.tb-action.danger:hover {
    background: rgba(225, 6, 0, .08);
    color: var(--red);
    border-color: rgba(225, 6, 0, .20);
}

/* Tab: Tambah Siswa */
.add-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.add-field label {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .2px;
    text-transform: uppercase;
    margin-bottom: 6px;
    color: #374151;
}

.add-field input,
.add-field select,
.add-field textarea {
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(17, 17, 17, .12);
    font-family: 'Sora', sans-serif;
    font-size: 13px;
    color: var(--black);
    outline: none;
    transition: border-color .18s, box-shadow .18s;
    background: #fff;
}

.add-field input:focus,
.add-field select:focus,
.add-field textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(15, 76, 129, .10);
}

.add-field.span2 {
    grid-column: span 2;
}

.add-submit-row {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

/* Tab: Berita Admin */
.news-admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.news-item-admin {
    background: var(--gray);
    border-radius: 14px;
    padding: 16px;
    border: 1px solid rgba(17, 17, 17, .07);
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.news-emo {
    font-size: 28px;
    flex-shrink: 0;
}

.news-item-admin h5 {
    font-size: 13.5px;
    font-weight: 700;
    margin: 0 0 4px;
    line-height: 1.3;
}

.news-item-admin p {
    font-size: 12px;
    color: var(--muted);
    margin: 0 0 10px;
    line-height: 1.5;
}

.news-item-actions {
    display: flex;
    gap: 7px;
}

/* Floating admin button */
.admin-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 500;
    border-radius: 999px;
    padding: 13px 22px;
    font-size: 13.5px;
    box-shadow: 0 12px 36px rgba(15, 76, 129, .35);
    display: flex;
    align-items: center;
    gap: 8px;
}