/* ============================================================
   RESET & BASE
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, system-ui, sans-serif;
}

body {
    background: #f0f4f8;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 16px;
}

/* ============================================================
   APP CONTAINER
   ============================================================ */
.app {
    max-width: 1500px;
    width: 100%;
    background: white;
    border-radius: 32px;
    box-shadow: 0 20px 40px rgba(0, 20, 30, 0.12);
    overflow: hidden;
    min-height: 95vh;
}

/* ============================================================
   HEADER
   ============================================================ */
.app-header {
    background: linear-gradient(135deg, #0a2a3a 0%, #1a4a5e 100%);
    color: white;
    padding: 14px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.app-header h1 {
    font-weight: 500;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-header h1 i {
    color: #6fc2e8;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.clock {
    font-size: 1.1rem;
    font-weight: 300;
    background: rgba(255, 255, 255, 0.12);
    padding: 5px 16px;
    border-radius: 40px;
    letter-spacing: 1px;
    color: white;
}

.role-badge {
    background: rgba(255, 255, 255, 0.15);
    padding: 5px 16px;
    border-radius: 40px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    border: none;
    background: white;
    padding: 6px 18px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid transparent;
    text-decoration: none;
}

.btn-primary {
    background: #1a4a5e;
    color: white;
}
.btn-primary:hover {
    background: #0d3343;
    transform: scale(0.97);
}

.btn-danger {
    background: #dc3545;
    color: white;
}
.btn-danger:hover {
    background: #c82333;
}

.btn-success {
    background: #28a745;
    color: white;
}
.btn-success:hover {
    background: #1e7e34;
}

.btn-info {
    background: #17a2b8;
    color: white;
}
.btn-info:hover {
    background: #138496;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}
.btn-warning:hover {
    background: #e0a800;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}
.btn-secondary:hover {
    background: #5a6268;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 0.72rem;
}
.btn-xs {
    padding: 2px 10px;
    font-size: 0.65rem;
}

.btn-slide {
    background: #6f42c1;
    color: white;
    border: none;
    padding: 6px 18px;
    border-radius: 40px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
}
.btn-slide:hover {
    background: #5a32a3;
    transform: scale(0.97);
}
.btn-slide.hidden {
    display: none;
}

.btn-download {
    background: #6f42c1;
    color: white;
}
.btn-download:hover {
    background: #5a32a3;
}

.btn-download-word {
    background: #2b5797;
    color: white;
}
.btn-download-word:hover {
    background: #1e3f6f;
}

.btn-upload {
    background: #fd7e14;
    color: white;
}
.btn-upload:hover {
    background: #e06b0a;
}

/* ============================================================
   LOGIN BAR
   ============================================================ */
.login-bar {
    background: #e9f0f6;
    padding: 10px 28px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    border-bottom: 1px solid #cddde9;
}

.login-bar span {
    font-weight: 500;
    color: #1a2e3f;
}

.login-bar .user-label {
    margin-left: auto;
    font-size: 0.85rem;
    color: #2b4c61;
}

.login-bar .user-label i {
    color: #1f7b5a;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.main-layout {
    display: flex;
    min-height: 70vh;
}

.sidebar {
    background: #f7fafc;
    width: 240px;
    padding: 16px 12px;
    border-right: 1px solid #dde6ef;
    flex-shrink: 0;
    overflow-y: auto;
    max-height: 80vh;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin-bottom: 2px;
    border-radius: 10px;
}

.sidebar-menu li > a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    color: #1f384b;
    font-weight: 500;
    text-decoration: none;
    border-radius: 10px;
    transition: 0.15s;
    font-size: 0.85rem;
    cursor: pointer;
}

.sidebar-menu li > a i {
    width: 20px;
    color: #3b5f77;
    font-size: 0.9rem;
    text-align: center;
}

.sidebar-menu li > a .arrow {
    margin-left: auto;
    transition: transform 0.3s ease;
    font-size: 0.7rem;
    color: #8a9aa8;
}
.sidebar-menu li > a .arrow.open {
    transform: rotate(180deg);
}

.sidebar-menu li.active > a {
    background: #1a4a5e;
    color: white;
    box-shadow: 0 4px 10px rgba(0, 20, 30, 0.12);
}

.sidebar-menu li.active > a i {
    color: white;
}

.sidebar-menu li > a:hover:not(.active a) {
    background: #e0ebf5;
}

/* Sub Menu */
.sub-menu {
    list-style: none;
    padding-left: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    padding-top: 0;
}

.sub-menu.open {
    max-height: 500px;
    padding-top: 4px;
}

.sub-menu li {
    margin-bottom: 1px;
}

.sub-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px 7px 46px;
    color: #2a4a5e;
    font-weight: 400;
    font-size: 0.8rem;
    text-decoration: none;
    border-radius: 8px;
    transition: 0.15s;
    cursor: pointer;
}

.sub-menu li a i {
    width: 16px;
    font-size: 0.7rem;
    color: #5a7a8e;
}

.sub-menu li a:hover {
    background: #e0ebf5;
}

.sub-menu li.active a {
    background: #1a4a5e20;
    color: #1a4a5e;
    font-weight: 600;
}
.sub-menu li.active a i {
    color: #1a4a5e;
}

/* ============================================================
   CONTENT
   ============================================================ */
.content {
    flex: 1;
    padding: 20px 28px;
    background: white;
    overflow-x: auto;
    max-height: 80vh;
    overflow-y: auto;
}

.content h2 {
    font-weight: 500;
    color: #0b222f;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid #e8eff5;
    padding-bottom: 10px;
    font-size: 1.2rem;
}

.content h3 {
    font-weight: 500;
    color: #1a4a5e;
    margin: 16px 0 10px 0;
    font-size: 1rem;
}

.content h4 {
    font-weight: 500;
    color: #2a5775;
    margin: 12px 0 8px 0;
    font-size: 0.95rem;
}

.empty-state {
    padding: 24px 16px;
    text-align: center;
    color: #6b8ba0;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    padding: 3px 12px;
    border-radius: 40px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-block;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}
.badge-warning {
    background: #fff3cd;
    color: #856404;
}
.badge-danger {
    background: #f8d7da;
    color: #721c24;
}
.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}
.badge-secondary {
    background: #e2e3e5;
    color: #383d41;
}

.badge-alpha {
    background: #f8d7da;
    color: #721c24;
}
.badge-sakit {
    background: #fff3cd;
    color: #856404;
}
.badge-izin {
    background: #d1ecf1;
    color: #0c5460;
}
.badge-dispensasi {
    background: #d5c4e8;
    color: #4a2a7a;
}
.badge-terlambat {
    background: #ffe0b2;
    color: #856404;
}

/* Status Badge untuk Jadwal */
.badge-belum-mulai {
    background: #6b7280;
    color: white;
}
.badge-berlangsung {
    background: #fbbf24;
    color: #1a1a2e;
}
.badge-masuk-kelas {
    background: #10b981;
    color: white;
}
.badge-selesai {
    background: #3b82f6;
    color: white;
}
.badge-libur {
    background: #ef4444;
    color: white;
}

/* ============================================================
   STATUS DOTS
   ============================================================ */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.status-dot.green {
    background: #28a745;
}
.status-dot.yellow {
    background: #ffc107;
}
.status-dot.red {
    background: #dc3545;
}
.status-dot.gray {
    background: #6c757d;
}
.status-dot.blue {
    background: #17a2b8;
}
.status-dot.purple {
    background: #6f42c1;
}
.status-dot.orange {
    background: #fd7e14;
}

/* ============================================================
   CARDS & SUMMARY
   ============================================================ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card {
    background: #f6faff;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid #e3edf6;
}

.stat-card .number {
    font-size: 1.8rem;
    font-weight: 600;
    color: #1a4a5e;
}

.stat-card .label {
    color: #3d637c;
    font-size: 0.8rem;
    font-weight: 500;
}

.summary-box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.summary-item {
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #e3edf6;
    background: #fafdff;
}

.summary-item .count {
    font-size: 1.5rem;
    font-weight: 700;
}
.summary-item .label {
    font-size: 0.8rem;
    color: #3d637c;
}
.summary-item.alpha .count {
    color: #dc3545;
}
.summary-item.sakit .count {
    color: #856404;
}
.summary-item.izin .count {
    color: #17a2b8;
}
.summary-item.dispensasi .count {
    color: #6f42c1;
}
.summary-item.terlambat .count {
    color: #fd7e14;
}
.summary-item.hadir .count {
    color: #28a745;
}

/* ============================================================
   STATUS LEGEND
   ============================================================ */
.status-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding: 10px 16px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e3edf6;
}

.status-legend .item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #3d637c;
}

.status-legend .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.status-legend .dot.belum {
    background: #6c757d;
}
.status-legend .dot.berlangsung {
    background: #ffc107;
}
.status-legend .dot.masuk {
    background: #28a745;
}
.status-legend .dot.selesai {
    background: #17a2b8;
}
.status-legend .dot.red {
    background: #dc3545;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap {
    overflow-x: auto;
    background: #fafdff;
    border-radius: 14px;
    border: 1px solid #e3edf6;
    padding: 2px 0;
    margin-bottom: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

th {
    text-align: left;
    padding: 10px 12px 8px 12px;
    color: #1a3a4f;
    border-bottom: 2px solid #d3e0ea;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

td {
    padding: 8px 12px;
    border-bottom: 1px solid #e2ecf5;
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

/* ============================================================
   FLEX HELPERS
   ============================================================ */
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.flex-end {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    padding: 24px 28px;
    border-radius: 20px;
    max-width: 950px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
}

.modal .form-group {
    margin-bottom: 12px;
}

.modal .form-group label {
    display: block;
    font-weight: 500;
    font-size: 0.85rem;
    color: #1a3a4f;
    margin-bottom: 4px;
}

.modal .form-group input,
.modal .form-group select,
.modal .form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #dde6ef;
    font-size: 0.9rem;
}

.modal .form-group input:focus,
.modal .form-group select:focus,
.modal .form-group textarea:focus {
    border-color: #1a4a5e;
    outline: none;
}

.modal .btn-group {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
}

/* ============================================================
   HARI TABS
   ============================================================ */
.hari-tab-container {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    background: #f1f4f8;
    padding: 6px;
    border-radius: 10px;
}

.hari-tab {
    padding: 8px 20px;
    border-radius: 8px;
    border: none;
    background: transparent;
    font-weight: 600;
    font-size: 0.85rem;
    color: #5a6a7a;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hari-tab:hover {
    background: rgba(255, 255, 255, 0.5);
}

.hari-tab.active-tab {
    background: white;
    color: #1a4a5e;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ============================================================
   JURNAL INTEGRATION CARD
   ============================================================ */
.jurnal-integrasi-card {
    background: #f8fafc;
    border: 1px solid #e3edf6;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}

.jurnal-integrasi-card .jurnal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.jurnal-integrasi-card .jurnal-header .info {
    font-size: 0.85rem;
    color: #3d637c;
}

.jurnal-integrasi-card .jurnal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.jurnal-integrasi-card .jurnal-body .form-group {
    margin-bottom: 0;
}

.jurnal-integrasi-card .jurnal-body .form-group textarea {
    width: 100%;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #dde6ef;
    font-size: 0.85rem;
    background: white;
    min-height: 50px;
    resize: vertical;
}

/* ============================================================
   JURNAL HARIAN FORM
   ============================================================ */
.jurnal-harian-form {
    background: #f8fafc;
    border: 1px solid #e3edf6;
    border-radius: 12px;
    padding: 18px 22px;
    margin-bottom: 20px;
}

.jurnal-harian-form .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    align-items: end;
}

.jurnal-harian-form .form-group {
    margin-bottom: 0;
}

.jurnal-harian-form .form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.75rem;
    color: #1a3a4f;
    margin-bottom: 3px;
}

.jurnal-harian-form .form-group input,
.jurnal-harian-form .form-group select {
    width: 100%;
    padding: 7px 10px;
    border-radius: 6px;
    border: 1px solid #dde6ef;
    font-size: 0.85rem;
    background: white;
}

/* ============================================================
   MINI CALENDAR
   ============================================================ */
.mini-calendar {
    background: white;
    border: 1px solid #dde6ef;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 12px;
    display: inline-block;
}

.mini-calendar .cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    color: #1a4a5e;
}

.mini-calendar .cal-header .cal-nav {
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    background: #e9f0f6;
    border: none;
    font-size: 0.8rem;
}

.mini-calendar .cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
    font-size: 0.7rem;
}

.mini-calendar .cal-grid .cal-day-name {
    font-weight: 600;
    color: #6b8ba0;
    padding: 2px 0;
}

.mini-calendar .cal-grid .cal-day {
    padding: 3px 0;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.15s;
}

.mini-calendar .cal-grid .cal-day:hover {
    background: #e9f0f6;
}

.mini-calendar .cal-grid .cal-day.today {
    background: #1a4a5e;
    color: white;
    font-weight: 600;
}

.mini-calendar .cal-grid .cal-day.selected {
    background: #28a745;
    color: white;
    font-weight: 600;
}

.mini-calendar .cal-grid .cal-day.other-month {
    color: #bbb;
}

/* ============================================================
   DATABASE
   ============================================================ */
.db-table-list {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.db-table-item {
    background: #f8fafc;
    border: 1px solid #e3edf6;
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.db-table-item .table-name {
    font-weight: 600;
    color: #1a4a5e;
    font-size: 0.85rem;
}

.db-table-item .table-count {
    font-size: 0.8rem;
    color: #6b8ba0;
}

.db-table-item .table-actions {
    display: flex;
    gap: 6px;
}

.db-table-item .table-actions .btn-clear {
    background: #dc3545;
    color: white;
    border: none;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 0.6rem;
    cursor: pointer;
    font-weight: 600;
}

.db-table-item .table-actions .btn-view {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 0.6rem;
    cursor: pointer;
    font-weight: 600;
}

.db-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1a4a5e;
    margin: 16px 0 8px 0;
    border-bottom: 2px solid #e8eff5;
    padding-bottom: 6px;
}

.db-actions-all {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 12px 0 16px 0;
}

.db-clear-all,
.btn-reset-data {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 20px;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    transition: 0.2s;
}
.db-clear-all:hover,
.btn-reset-data:hover {
    background: #c82333;
}

/* ============================================================
   LIVE TRAFFIC
   ============================================================ */
.live-traffic-card {
    background: #f8fafc;
    border: 1px solid #e3edf6;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.live-traffic-card .traffic-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.live-traffic-card .traffic-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #1a4a5e;
}

.live-traffic-card .traffic-header .live-badge {
    background: #dc3545;
    color: white;
    padding: 2px 14px;
    border-radius: 40px;
    font-size: 0.7rem;
    font-weight: 600;
    animation: pulse-dot 2s infinite;
}

.live-traffic-card .traffic-header .time-info {
    font-size: 0.8rem;
    color: #6b8ba0;
}

.live-traffic-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.live-traffic-grid .kelas-item {
    background: white;
    border: 1px solid #e3edf6;
    border-radius: 8px;
    padding: 10px 14px;
}

.live-traffic-grid .kelas-item .kelas-name {
    font-weight: 600;
    color: #1a4a5e;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.live-traffic-grid .kelas-item .kelas-detail {
    font-size: 0.75rem;
    color: #3d637c;
}

.live-traffic-grid .kelas-item .status-indicator {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 600;
}

.live-traffic-grid .kelas-item .status-indicator.active {
    background: #d4edda;
    color: #155724;
}
.live-traffic-grid .kelas-item .status-indicator.inactive {
    background: #f8d7da;
    color: #721c24;
}
.live-traffic-grid .kelas-item .status-indicator.waiting {
    background: #fff3cd;
    color: #856404;
}

.live-absen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 6px;
    margin-top: 8px;
}

.live-absen-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    background: #f8f9fa;
    border-left: 3px solid #dc3545;
    font-size: 0.75rem;
}

.live-absen-item .nama-siswa {
    font-weight: 500;
}

.status-badge-sm {
    font-size: 0.6rem;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 20px;
}
.status-badge-sm.alpha {
    background: #dc3545;
    color: white;
}
.status-badge-sm.sakit {
    background: #ffc107;
    color: #212529;
}
.status-badge-sm.izin {
    background: #17a2b8;
    color: white;
}
.status-badge-sm.dispensasi {
    background: #6f42c1;
    color: white;
}
.status-badge-sm.terlambat {
    background: #fd7e14;
    color: white;
}

.live-empty {
    color: #6b8ba0;
    font-size: 0.85rem;
    text-align: center;
    padding: 12px;
}

/* ============================================================
   INTEGRATION INFO
   ============================================================ */
.integration-info {
    background: #e8f5e9;
    border-left: 4px solid #28a745;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #1a4a5e;
    margin-bottom: 10px;
}
.integration-info i {
    color: #28a745;
}

/* ============================================================
   IMPORT AREA
   ============================================================ */
.import-siswa-area {
    background: #f8fafc;
    border: 2px dashed #28a745;
    border-radius: 12px;
    padding: 16px 20px;
    margin: 8px 0 16px 0;
    display: none;
}
.import-siswa-area.active {
    display: block;
}

.import-siswa-area .import-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.import-siswa-area .import-header .close-import {
    background: #dc3545;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
}

.upload-area-sm {
    border: 1px dashed #dde6ef;
    border-radius: 10px;
    padding: 14px;
    text-align: center;
    background: white;
}
.upload-area-sm input[type="file"] {
    display: none;
}
.upload-area-sm .upload-label-sm {
    display: inline-block;
    padding: 6px 18px;
    background: #28a745;
    color: white;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
}
.upload-area-sm .upload-label-sm:hover {
    background: #1e7e34;
}
.upload-area-sm .template-link {
    margin-top: 6px;
    font-size: 0.75rem;
    color: #17a2b8;
}
.upload-area-sm .template-link a {
    cursor: pointer;
    text-decoration: underline;
}
.upload-area-sm .template-link a:hover {
    color: #0d6e7a;
}

.import-preview {
    margin-top: 12px;
    max-height: 200px;
    overflow-y: auto;
}
.import-preview table {
    font-size: 0.75rem;
}
.import-preview table th {
    font-size: 0.65rem;
    padding: 4px 8px;
}
.import-preview table td {
    padding: 4px 8px;
}

.import-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.btn-import-confirm {
    background: #28a745;
    color: white;
    border: none;
    padding: 6px 20px;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
}
.btn-import-confirm:hover {
    background: #1e7e34;
}
.btn-import-cancel {
    background: #6c757d;
    color: white;
    border: none;
    padding: 6px 20px;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
}

/* ============================================================
   GURU PENGAJARAN
   ============================================================ */
.guru-pengajaran-item {
    background: #f8fafc;
    border: 1px solid #e3edf6;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 6px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.guru-pengajaran-item .mapel-name {
    font-weight: 600;
    color: #1a4a5e;
    min-width: 120px;
}

.guru-pengajaran-item .kelas-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    flex: 1;
}

.guru-pengajaran-item .kelas-list .kelas-tag {
    display: inline-block;
    background: #d1ecf1;
    color: #0c5460;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    margin: 1px 2px;
    cursor: default;
}

.guru-pengajaran-item .kelas-list .kelas-tag .remove-kelas-pengajaran {
    cursor: pointer;
    color: #dc3545;
    margin-left: 4px;
    font-weight: 700;
}

.guru-pengajaran-item .btn-group-item {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-left: auto;
}

.guru-pengajaran-item select {
    padding: 3px 6px;
    border-radius: 4px;
    border: 1px solid #dde6ef;
    font-size: 0.7rem;
    background: white;
    max-width: 130px;
}

.btn-add-pengajaran {
    background: #28a745;
    color: white;
    border: none;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.6rem;
    cursor: pointer;
    font-weight: 600;
}
.btn-add-pengajaran:hover {
    background: #1e7e34;
}
.btn-remove-pengajaran {
    background: #dc3545;
    color: white;
    border: none;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.6rem;
    cursor: pointer;
    font-weight: 600;
}
.btn-remove-pengajaran:hover {
    background: #c82333;
}
.btn-add-kelas-pengajaran {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.6rem;
    cursor: pointer;
    font-weight: 600;
}
.btn-add-kelas-pengajaran:hover {
    background: #138496;
}

.guru-pengajaran-empty {
    color: #6b8ba0;
    font-size: 0.8rem;
    padding: 4px 0;
}

/* ============================================================
   HARI LIBUR
   ============================================================ */
.libur-item {
    background: #f8fafc;
    border: 1px solid #e3edf6;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.libur-item .libur-info {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.libur-item .libur-info .libur-tanggal {
    font-weight: 600;
    color: #1a4a5e;
    font-size: 0.85rem;
    min-width: 120px;
}

.libur-item .libur-info .libur-keterangan {
    color: #3d637c;
    font-size: 0.8rem;
}

.libur-item .libur-info .libur-kelas {
    font-size: 0.75rem;
    background: #ffc107;
    color: #212529;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 500;
}

.libur-item .libur-actions .btn-hapus-libur {
    background: #dc3545;
    color: white;
    border: none;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 0.6rem;
    cursor: pointer;
    font-weight: 600;
}

.libur-form {
    background: #f8fafc;
    border: 1px solid #e3edf6;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
}
.libur-form .form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    align-items: end;
}
.libur-form .form-group {
    margin-bottom: 0;
}
.libur-form .form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.75rem;
    color: #1a3a4f;
    margin-bottom: 3px;
}
.libur-form .form-group input,
.libur-form .form-group select {
    width: 100%;
    padding: 7px 10px;
    border-radius: 6px;
    border: 1px solid #dde6ef;
    font-size: 0.85rem;
    background: white;
}

.libur-status-banner {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 10px;
    padding: 10px 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    color: #856404;
}
.libur-status-banner .libur-kelas-tag {
    background: #ffc107;
    color: #212529;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* ============================================================
   JADWAL INPUT FORM
   ============================================================ */
.jadwal-input-form {
    background: #f8fafc;
    border: 1px solid #e3edf6;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
}
.jadwal-input-form .form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    align-items: end;
}
.jadwal-input-form .form-group {
    margin-bottom: 0;
}
.jadwal-input-form .form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.75rem;
    color: #1a3a4f;
    margin-bottom: 3px;
}
.jadwal-input-form .form-group input,
.jadwal-input-form .form-group select {
    width: 100%;
    padding: 7px 10px;
    border-radius: 6px;
    border: 1px solid #dde6ef;
    font-size: 0.85rem;
    background: white;
}
.jadwal-input-form .form-group input:focus,
.jadwal-input-form .form-group select:focus {
    border-color: #1a4a5e;
    outline: none;
}

.btn-hapus-jadwal {
    background: #dc3545;
    color: white;
    border: none;
    padding: 2px 10px;
    border-radius: 40px;
    font-size: 0.65rem;
    cursor: pointer;
    font-weight: 600;
}
.btn-hapus-jadwal:hover {
    background: #c82333;
}

/* ============================================================
   WORD DOWNLOAD
   ============================================================ */
.word-download-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes pulse-dot {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 820px) {
    .main-layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #dde6ef;
        padding: 10px;
        max-height: none;
    }
    .sidebar-menu {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }
    .sidebar-menu li {
        flex: 1 0 auto;
    }
    .sub-menu {
        padding-left: 10px;
        display: flex;
        flex-wrap: wrap;
        gap: 4px 8px;
    }
    .content {
        padding: 14px;
        max-height: none;
    }
    .db-table-list {
        grid-template-columns: 1fr 1fr;
    }
    .live-traffic-grid {
        grid-template-columns: 1fr;
    }
    .jurnal-integrasi-card .jurnal-body {
        grid-template-columns: 1fr;
    }
    .jurnal-harian-form .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .login-box {
        padding: 24px 20px;
    }
    .jurnal-integrasi-card .jurnal-body {
        grid-template-columns: 1fr;
    }
    .jadwal-input-form .form-grid {
        grid-template-columns: 1fr;
    }
    .hari-tab {
        padding: 6px 12px;
        font-size: 0.7rem;
    }
    .modal {
        padding: 16px;
        max-width: 95%;
    }
    .db-table-list {
        grid-template-columns: 1fr;
    }
    .slide-table-wrap table {
        font-size: 0.65rem;
    }
    .slide-table-wrap table th,
    .slide-table-wrap table td {
        padding: 4px 6px;
    }
    .live-traffic-grid {
        grid-template-columns: 1fr;
    }
    .card-grid {
        grid-template-columns: 1fr 1fr;
    }
    .app-header h1 {
        font-size: 1rem;
    }
    .login-bar .user-label {
        margin-left: 0;
        width: 100%;
    }
}
/* ============================================================
   DASHBOARD SPECIFIC
   ============================================================ */
.dashboard-container .card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.dashboard-container .stat-card {
    background: #f6faff;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid #e3edf6;
    text-align: center;
    transition: all 0.2s;
}

.dashboard-container .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.dashboard-container .stat-card .number {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a4a5e;
}

.dashboard-container .stat-card .label {
    color: #3d637c;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Summary Box */
.dashboard-container .summary-box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.dashboard-container .summary-item {
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #e3edf6;
    background: #fafdff;
    text-align: center;
    transition: all 0.2s;
}

.dashboard-container .summary-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.dashboard-container .summary-item .count {
    font-size: 1.5rem;
    font-weight: 700;
}

.dashboard-container .summary-item .label {
    font-size: 0.8rem;
    color: #3d637c;
}

.dashboard-container .summary-item.hadir .count { color: #28a745; }
.dashboard-container .summary-item.alpha .count { color: #dc3545; }
.dashboard-container .summary-item.sakit .count { color: #856404; }
.dashboard-container .summary-item.izin .count { color: #17a2b8; }
.dashboard-container .summary-item.terlambat .count { color: #fd7e14; }
.dashboard-container .summary-item.dispensasi .count { color: #6f42c1; }

/* Status Legend */
.dashboard-container .status-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 10px 16px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e3edf6;
}

.dashboard-container .status-legend .item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #3d637c;
}

.dashboard-container .status-legend .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dashboard-container .status-legend .dot.belum { background: #6c757d; }
.dashboard-container .status-legend .dot.berlangsung { background: #ffc107; }
.dashboard-container .status-legend .dot.masuk { background: #28a745; }
.dashboard-container .status-legend .dot.selesai { background: #17a2b8; }
.dashboard-container .status-legend .dot.red { background: #dc3545; }

/* Live Traffic */
.dashboard-container .live-traffic-card {
    background: #f8fafc;
    border: 1px solid #e3edf6;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.dashboard-container .live-traffic-card .traffic-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.dashboard-container .live-traffic-card .traffic-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #1a4a5e;
}

.dashboard-container .live-traffic-card .traffic-header .live-badge {
    background: #dc3545;
    color: white;
    padding: 2px 14px;
    border-radius: 40px;
    font-size: 0.7rem;
    font-weight: 600;
    animation: pulse-dot 2s infinite;
}

.dashboard-container .live-traffic-card .traffic-header .time-info {
    font-size: 0.8rem;
    color: #6b8ba0;
}

.dashboard-container .live-traffic-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.dashboard-container .live-traffic-grid .kelas-item {
    background: white;
    border: 1px solid #e3edf6;
    border-radius: 8px;
    padding: 10px 14px;
    transition: all 0.2s;
}

.dashboard-container .live-traffic-grid .kelas-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.dashboard-container .live-traffic-grid .kelas-item .kelas-name {
    font-weight: 600;
    color: #1a4a5e;
    font-size: 0.85rem;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.dashboard-container .live-traffic-grid .kelas-item .kelas-detail {
    font-size: 0.75rem;
    color: #3d637c;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.dashboard-container .live-traffic-grid .kelas-item .kelas-detail span {
    display: inline-block;
    background: #f8fafc;
    padding: 2px 8px;
    border-radius: 4px;
    margin: 2px 0;
}

.dashboard-container .live-traffic-grid .kelas-item .status-indicator {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 600;
}

.dashboard-container .live-traffic-grid .kelas-item .status-indicator.active {
    background: #d4edda;
    color: #155724;
}

.dashboard-container .live-traffic-grid .kelas-item .status-indicator.inactive {
    background: #f8d7da;
    color: #721c24;
}

.dashboard-container .live-traffic-grid .kelas-item .status-indicator.waiting {
    background: #fff3cd;
    color: #856404;
}

/* Live Absen */
.dashboard-container .live-absen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 6px;
    margin-top: 8px;
}

.dashboard-container .live-absen-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    border-radius: 6px;
    background: #f8f9fa;
    border-left: 3px solid #dc3545;
    font-size: 0.75rem;
    gap: 6px;
    flex-wrap: wrap;
}

.dashboard-container .live-absen-item .nama-siswa {
    font-weight: 500;
}

.dashboard-container .status-badge-sm {
    font-size: 0.6rem;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 20px;
}

.dashboard-container .status-badge-sm.alpha { background: #dc3545; color: white; }
.dashboard-container .status-badge-sm.sakit { background: #ffc107; color: #212529; }
.dashboard-container .status-badge-sm.izin { background: #17a2b8; color: white; }
.dashboard-container .status-badge-sm.dispensasi { background: #6f42c1; color: white; }
.dashboard-container .status-badge-sm.terlambat { background: #fd7e14; color: white; }

.dashboard-container .live-empty {
    color: #6b8ba0;
    font-size: 0.9rem;
    text-align: center;
    padding: 20px;
}

/* Responsive */
@media (max-width: 820px) {
    .dashboard-container .live-traffic-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .dashboard-container .card-grid {
        grid-template-columns: 1fr 1fr;
    }
    .dashboard-container .summary-box {
        grid-template-columns: 1fr 1fr;
    }
    .dashboard-container .live-absen-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-container .live-traffic-card .traffic-header {
        flex-direction: column;
        align-items: flex-start;
    }
}