/* ====================================================================
   SIAKAD SPENTIMA - SMP NEGERI 3 MANGGIS
   Modern Responsive Stylesheet (Vanilla CSS)
   ==================================================================== */

:root {
    --primary: #1e3a8a;          /* Spentima Navy */
    --primary-light: #3b82f6;
    --primary-dark: #0f172a;
    --accent: #0284c7;           /* Sky Blue */
    --accent-gold: #d97706;      /* Balinese Gold */
    --success: #10b981;         /* Emerald */
    --success-bg: #ecfdf5;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --danger: #ef4444;          /* Alpa / Red */
    --danger-bg: #fef2f2;
    --info: #6366f1;
    --info-bg: #e0e7ff;
    
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ================= TOP NAVBAR & ROLE SWITCHER ================= */
.top-navbar {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.school-logo-badge {
    width: 44px;
    height: 44px;
    background: #ffffff;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.brand-text h1 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-sub {
    font-size: 0.75rem;
    color: #cbd5e1;
}

.domain-pill {
    background: rgba(255, 255, 255, 0.15);
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-family: monospace;
    border: 1px solid rgba(255,255,255,0.25);
}

/* User Switcher Toolbar */
.user-switch-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
}

.user-switch-bar label {
    font-size: 0.75rem;
    color: #e2e8f0;
    font-weight: 500;
}

.select-user {
    background: #ffffff;
    color: var(--text-primary);
    border: none;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.825rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
}

.current-role-badge {
    background: var(--accent-gold);
    color: #ffffff;
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.backend-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #f1f5f9;
    transition: var(--transition);
    user-select: none;
}

.backend-status-pill:hover {
    filter: brightness(1.1);
}

.backend-status-pill.connected {
    background: #065f46;
    border-color: #34d399;
    color: #d1fae5;
}

.backend-status-pill.offline {
    background: #374151;
    border-color: #6b7280;
    color: #d1d5db;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #9ca3af;
    display: inline-block;
}

.backend-status-pill.connected .status-dot {
    background-color: #10b981;
    box-shadow: 0 0 8px #34d399;
}

/* ================= APP LAYOUT ================= */
.app-layout {
    max-width: 1440px;
    margin: 1.5rem auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 270px 1fr;
    gap: 1.5rem;
}

/* Sidebar */
.sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    height: fit-content;
    position: sticky;
    top: 5rem;
}

.user-profile-card {
    text-align: center;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.25rem;
}

.avatar-circle {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    border-radius: 50%;
    margin: 0 auto 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    border: 3px solid #ffffff;
    box-shadow: var(--shadow-md);
}

.profile-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.profile-nip {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: monospace;
    margin-top: 0.2rem;
}

.profile-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    justify-content: center;
    margin-top: 0.6rem;
}

.role-tag {
    background: #f1f5f9;
    color: #334155;
    font-size: 0.68rem;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-weight: 600;
    border: 1px solid #e2e8f0;
}

/* Sidebar Navigation */
.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition);
    cursor: pointer;
}

.nav-link:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.nav-link.active {
    background: var(--primary);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(30, 58, 138, 0.25);
}

.nav-icon {
    font-size: 1.15rem;
}

.nav-pill-count {
    margin-left: auto;
    background: rgba(0,0,0,0.08);
    font-size: 0.7rem;
    padding: 0.1rem 0.45rem;
    border-radius: 9999px;
}

.nav-link.active .nav-pill-count {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

/* Main Content Area */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Content Header */
.view-header {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    gap: 1rem;
}

.view-title h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
}

.view-title p {
    font-size: 0.825rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

/* Sub-Tab Navigation Bar */
.subtabs-bar {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.25rem;
    overflow-x: auto;
}

.subtab-btn {
    padding: 0.65rem 1.15rem;
    border: none;
    background: transparent;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.subtab-btn:hover {
    color: var(--primary);
}

.subtab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Stat Cards Grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-info .stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-info .stat-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

/* Card Containers */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafafa;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* ================= TABLES ================= */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.85rem;
}

.data-table th {
    background: #f8fafc;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    vertical-align: middle;
}

.data-table tr:hover {
    background-color: #f8fafc;
}

/* Search and Filters toolbar */
.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.search-input {
    padding: 0.45rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    outline: none;
    min-width: 240px;
}

.search-input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.725rem;
    font-weight: 700;
}

.badge-hadir {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-izin {
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-sakit {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-alpa {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ================= BUTTONS & FORMS ================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}
.btn-primary:hover {
    background: #172554;
}

.btn-success {
    background: var(--success);
    color: #ffffff;
}
.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
}
.btn-danger:hover {
    background: #dc2626;
}

.btn-outline {
    background: #ffffff;
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-outline:hover {
    background: #f1f5f9;
}

.btn-sm {
    padding: 0.3rem 0.65rem;
    font-size: 0.775rem;
}

/* Status Radio Switch Group for Attendance */
.status-pill-group {
    display: inline-flex;
    background: #f1f5f9;
    padding: 3px;
    border-radius: var(--radius-md);
    gap: 2px;
}

.status-pill-btn {
    border: none;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: transparent;
    color: var(--text-secondary);
    transition: var(--transition);
}

.status-pill-btn.active-hadir {
    background: var(--success);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.status-pill-btn.active-izin {
    background: var(--info);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.status-pill-btn.active-sakit {
    background: var(--warning);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.status-pill-btn.active-alpa {
    background: var(--danger);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

/* ================= MODAL DIALOGS ================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 580px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: zoomIn 0.2s ease-out;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 75vh;
    overflow-y: auto;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group label {
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input, .form-group select, .form-group textarea {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    outline: none;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--primary);
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: #fafafa;
}

@keyframes zoomIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ================= TOAST / MODAL NOTIFICATIONS ================= */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.wa-toast {
    pointer-events: auto;
    background: #ffffff;
    border-left: 5px solid #25d366; /* WhatsApp Green */
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 1rem 1.25rem;
    max-width: 440px;
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-top: 1px solid var(--border);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.wa-toast-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.825rem;
    font-weight: 700;
    color: #075e54;
    margin-bottom: 0.35rem;
}

.wa-toast-body {
    font-size: 0.8rem;
    color: var(--text-primary);
    line-height: 1.4;
    background: #f0fdf4;
    padding: 0.6rem;
    border-radius: var(--radius-sm);
    border: 1px dashed #86efac;
}

.wa-toast-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ================= E-RAPOR PRINT LAYOUT ================= */
.rapor-preview-container {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    max-width: 900px;
    margin: 0 auto;
}

.kop-surat {
    border-bottom: 3px double #000000;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
    position: relative;
}

.kop-logo {
    position: absolute;
    left: 10px;
    top: 5px;
    font-size: 3rem;
}

.kop-title h4 {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.kop-title h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary);
    margin: 0.15rem 0;
}

.kop-address {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.rapor-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 2rem;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    background: #f8fafc;
    padding: 1rem;
    border-radius: var(--radius-sm);
}

.rapor-meta-grid dt {
    font-weight: 600;
    color: var(--text-secondary);
}

.rapor-meta-grid dd {
    font-weight: 700;
    color: var(--text-primary);
}

.rapor-sign-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    text-align: center;
    margin-top: 2.5rem;
    font-size: 0.85rem;
}

.sign-box {
    padding: 0 1.5rem;
}

.sign-line {
    margin-top: 4.5rem;
    border-top: 1px solid #000;
    font-weight: 700;
}

/* ================= PRINT MEDIA ================= */
@media print {
    body {
        background: #fff;
    }
    .top-navbar, .sidebar, .view-header, .btn, .toast-container, .no-print, .subtabs-bar, .table-toolbar {
        display: none !important;
    }
    .app-layout {
        display: block;
        margin: 0;
        padding: 0;
        max-width: 100%;
    }
    .rapor-preview-container {
        border: none;
        box-shadow: none;
        padding: 0;
        max-width: 100%;
    }
}

/* ================= RESPONSIVE ================= */
@media (max-width: 992px) {
    .app-layout {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: static;
    }
    .nav-menu {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
}

/* ================= BULK IMPORT & DAPODIK INTEGRATION STYLES ================= */
.dropzone-container {
    border: 2px dashed #3b82f6;
    background: #f8fafc;
    border-radius: var(--radius-md);
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.dropzone-container:hover, .dropzone-container.dragover {
    background: #eff6ff;
    border-color: #1d4ed8;
}

.dropzone-icon {
    font-size: 2.5rem;
    color: #3b82f6;
    margin-bottom: 0.5rem;
}

.dropzone-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.dropzone-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.dropzone-file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.template-download-box {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.template-download-box span {
    color: #065f46;
    font-weight: 600;
}

.preview-table-wrapper {
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-top: 1rem;
}

.btn-group {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
}

/* ================= ACTION BUTTONS FOR TABLES (TAMBAH, EDIT, HAPUS) ================= */
.btn-action-group {
    display: inline-flex;
    gap: 5px;
    align-items: center;
}

.btn-icon-action {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 0.25rem 0.5rem;
    font-size: 0.725rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 1px solid var(--border);
    background: #ffffff;
    transition: var(--transition);
    line-height: 1.2;
    white-space: nowrap;
}

.btn-icon-edit {
    color: #0369a1;
    border-color: #bae6fd;
    background: #f0f9ff;
}

.btn-icon-edit:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
}

.btn-icon-delete {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fef2f2;
}

.btn-icon-delete:hover {
    background: #dc2626;
    color: #ffffff;
    border-color: #dc2626;
}

.btn-icon-check {
    color: #047857;
    border-color: #a7f3d0;
    background: #ecfdf5;
}

.btn-icon-check:hover {
    background: #059669;
    color: #ffffff;
    border-color: #059669;
}


/* ================= TIM PKG & SUPERVISI AKADEMIK INSTRUMEN STYLES ================= */
.pkg-subtabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.5rem;
    overflow-x: auto;
}
.pkg-subtab-btn {
    padding: 0.55rem 1.15rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.pkg-subtab-btn:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}
.pkg-subtab-btn.active {
    background: var(--primary);
    color: #fff;
}
.pkg-instrument-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #fff;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.pkg-item-header {
    background: #f8fafc;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.pkg-item-body {
    padding: 0.85rem 1rem;
}
.pkg-rubric-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin: 0.65rem 0;
}
@media (max-width: 768px) {
    .pkg-rubric-grid {
        grid-template-columns: 1fr;
    }
}
.pkg-rubric-opt {
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-sm);
    padding: 0.65rem;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.pkg-rubric-opt:hover {
    border-color: var(--primary);
    background: #f0fdf4;
}
.pkg-rubric-opt.selected {
    border-color: #059669;
    background: #ecfdf5;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}
.pkg-rubric-opt .opt-score {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    border-radius: 50%;
    background: #e2e8f0;
    font-weight: 700;
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
}
.pkg-rubric-opt.selected .opt-score {
    background: #059669;
    color: #fff;
}
.pkg-rubric-opt .opt-desc {
    font-size: 0.8rem;
    line-height: 1.35;
    color: var(--text-primary);
}
.pkg-live-summary {
    background: linear-gradient(135deg, #1e3a8a, #0f172a);
    color: #fff;
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    align-items: center;
}
.pkg-live-metric {
    text-align: center;
}
.pkg-live-metric .val {
    font-size: 1.85rem;
    font-weight: 800;
    color: #38bdf8;
}
.pkg-live-metric .lbl {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #cbd5e1;
}
.pkg-print-document {
    background: #fff;
    padding: 2rem 2.5rem;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    max-width: 900px;
    margin: 0 auto;
    font-family: 'Times New Roman', Times, serif;
    color: #000;
}
.pkg-print-header {
    text-align: center;
    position: relative;
    padding-bottom: 0.5rem;
    border-bottom: 3px double #000;
    margin-bottom: 1rem;
}
.pkg-print-title {
    text-align: center;
    font-weight: bold;
    font-size: 1.05rem;
    text-transform: uppercase;
    margin: 0.75rem 0;
    text-decoration: underline;
}
.pkg-print-identitas {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.5;
}
.pkg-print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}
.pkg-print-table th, .pkg-print-table td {
    border: 1px solid #000;
    padding: 0.4rem 0.5rem;
    vertical-align: top;
}
.pkg-print-table th {
    background: #f1f5f9;
    font-weight: bold;
    text-align: center;
}
.pkg-print-box {
    border: 1px solid #000;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}
.pkg-signature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
}


/* ================= EXECUTIVE MONITORING: DIAGRAM LINGKARAN KETERLAKSANAAN TUGAS (ADMIN & KEPSEK) ================= */
.executive-monitoring-section {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.executive-header-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
    border: 1px solid #334155;
}

.executive-header-info h3 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 0.35rem 0;
}

.executive-header-info p {
    font-size: 0.85rem;
    color: #94a3b8;
    margin: 0;
    line-height: 1.4;
}

.executive-header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.executive-kpi-badge {
    background: rgba(16, 185, 129, 0.18);
    border: 1px solid #10b981;
    color: #34d399;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.executive-kpi-badge .kpi-num {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1;
}

.executive-kpi-badge .kpi-lbl {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #a7f3d0;
    margin-top: 0.2rem;
}

/* 4-Column Grid for Donut Cards */
.donut-chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 1.25rem;
}

.donut-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.donut-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.donut-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--card-accent, var(--primary));
}

.donut-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.donut-card-title {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.donut-card-title .icon-box {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.donut-card-title h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.donut-card-title .target-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.donut-chart-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0;
    position: relative;
}

.donut-svg {
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.06));
    display: block;
}

.donut-status-pill {
    margin-top: 0.65rem;
    padding: 0.25rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.subtask-list {
    margin-top: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    background: #f8fafc;
    border-radius: var(--radius-md);
    padding: 0.75rem 0.85rem;
    border: 1px solid #f1f5f9;
}

.subtask-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.subtask-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
}

.subtask-name {
    font-weight: 600;
    color: var(--text-secondary);
}

.subtask-pct {
    font-weight: 800;
    color: var(--text-primary);
}

.subtask-bar-track {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
}

.subtask-bar-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.donut-card-footer {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-detail-link {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-detail-link:hover {
    background: #f1f5f9;
    color: var(--primary);
    border-color: var(--primary);
}

/* Modal Detail Keterlaksanaan Table */
.exec-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.825rem;
    margin-top: 0.75rem;
}

.exec-detail-table th, .exec-detail-table td {
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    text-align: left;
}

.exec-detail-table th {
    background: #f8fafc;
    font-weight: 700;
    color: var(--text-primary);
}

.exec-detail-table tr:hover td {
    background: #f1f5f9;
}


/* ================= ROLE MANAGEMENT: ADMIN & SELF-SELECTION (DROPDOWN) ================= */
.select-active-role {
    background: #ecfdf5 !important;
    border: 1.5px solid #10b981 !important;
    color: #065f46 !important;
    font-weight: 700 !important;
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.select-active-role:hover, .select-active-role:focus {
    background: #d1fae5 !important;
    outline: none;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

.select-class {
    background: #eff6ff !important;
    border: 1.5px solid #3b82f6 !important;
    color: #1e3a8a !important;
    font-weight: 700 !important;
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.select-class:hover, .select-class:focus {
    background: #dbeafe !important;
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.btn-self-role {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.btn-self-role:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(217, 119, 6, 0.3);
}

/* Sidebar Role Box */
.sidebar-roles-box {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-role-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.role-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: center;
}

.role-tag-interactive {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    transition: all 0.15s;
    cursor: pointer;
}

.role-tag-interactive.is-active {
    box-shadow: 0 0 0 2px #059669;
}

.role-tag-remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(0,0,0,0.12);
    color: inherit;
    font-size: 9px;
    line-height: 1;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 2px;
}

.role-tag-remove-btn:hover {
    background: #ef4444;
    color: #fff;
}

.select-role-compact {
    width: 100%;
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
    border: 1.5px dashed #cbd5e1;
    border-radius: var(--radius-sm);
    background: #f8fafc;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.select-role-compact:hover {
    border-color: var(--primary);
    background: #eff6ff;
}

/* Modal Multi-Role Checkboxes Grid */
.role-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.65rem;
    margin: 1rem 0;
}

.role-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.75rem;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.role-checkbox-label:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.role-checkbox-label.checked {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1e40af;
    font-weight: 600;
}

.role-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.role-category-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0.75rem 0 0.25rem 0;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border);
}

/* ====================================================================
   SIAKAD SPENTIMA - SISTEM LOGIN & LOGOUT PENGGUNA (GTK & SISWA)
   ==================================================================== */
.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #ef4444;
    color: #ffffff;
    border: none;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 1px 3px rgba(239, 68, 68, 0.3);
}

.btn-logout:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-login-open {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #10b981;
    color: #ffffff;
    border: none;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.3);
}

.btn-login-open:hover {
    background: #059669;
    transform: translateY(-1px);
}

.auth-user-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    color: #f8fafc;
    font-size: 0.82rem;
}

.auth-user-badge strong {
    color: #38bdf8;
}

/* Modal Login Styling */
.spentima-login-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.25s ease-out;
}

.spentima-login-box {
    background: #ffffff;
    width: 100%;
    max-width: 520px;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    animation: scaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-header-banner {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: #ffffff;
    padding: 1.75rem 1.5rem 1.25rem;
    text-align: center;
    position: relative;
}

.login-header-banner .school-icon {
    font-size: 2.75rem;
    display: inline-block;
    margin-bottom: 0.25rem;
}

.login-header-banner h2 {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    margin: 0;
}

.login-header-banner p {
    font-size: 0.82rem;
    color: #bfdbfe;
    margin: 0.25rem 0 0 0;
}

.login-tab-nav {
    display: flex;
    background: #f1f5f9;
    border-bottom: 2px solid #e2e8f0;
}

.login-tab-btn {
    flex: 1;
    padding: 0.9rem 0.5rem;
    border: none;
    background: none;
    font-size: 0.88rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border-bottom: 3px solid transparent;
}

.login-tab-btn.active {
    background: #ffffff;
    color: #1e3a8a;
    border-bottom-color: #2563eb;
}

.login-body {
    padding: 1.5rem;
}

.login-form-group {
    margin-bottom: 1.1rem;
}

.login-form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.35rem;
}

.login-form-group input {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.92rem;
    transition: var(--transition);
    background: #f8fafc;
}

.login-form-group input:focus {
    outline: none;
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn-login-submit {
    width: 100%;
    padding: 0.85rem;
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.25);
}

.btn-login-submit:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px -2px rgba(37, 99, 235, 0.35);
}

.demo-chips-container {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px dashed #e2e8f0;
}

.demo-chips-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.demo-chips-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.demo-chip {
    padding: 0.35rem 0.65rem;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.demo-chip:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    color: #0f172a;
    transform: translateY(-1px);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleUp {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
