/* ============================================================ */
/* ============================================================ */
/* SISTEM TATA TERTIB SISWA - SMK NEGERI 4 KENDAL              */
/* Style CSS Utama                                              */
/* Made with ❤️ by ITSkanifo - 2026                             */
/* ============================================================ */
/* ============================================================ */

/* ============================================================ */
/* 1. RESET & BASE                                              */
/* ============================================================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    background: #f0f4f8;
    color: #333;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: #1e40af;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ============================================================ */
/* 2. CONTAINER                                                 */
/* ============================================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 12px;
}

/* ============================================================ */
/* 3. NAVBAR                                                    */
/* ============================================================ */
.navbar {
    background: #1e40af;
    color: #fff;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar .brand {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
}

.brand-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    background: #fff;
    border-radius: 6px;
    padding: 3px;
    flex-shrink: 0;
}

.brand-text {
    line-height: 1.2;
    min-width: 0;
}

.brand-title {
    font-size: 0.9rem;
    font-weight: bold;
    color: #fff;
}

.brand-subtitle {
    font-size: 0.7rem;
    font-weight: normal;
    color: rgba(255, 255, 255, 0.85);
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    margin-top: 6px;
    align-items: center;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    padding: 6px 10px;
    font-size: 0.85rem;
    border-radius: 4px;
    transition: background 0.2s;
    white-space: nowrap;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.2);
    text-decoration: none;
}

.user-info {
    font-size: 0.8rem;
    opacity: 0.9;
    margin-left: auto;
    padding: 4px 8px;
}

.user-info small {
    opacity: 0.8;
    font-size: 0.75rem;
}

.btn-logout {
    background: #dc2626 !important;
    padding: 6px 12px !important;
    font-size: 0.85rem !important;
    font-weight: bold;
    border-radius: 4px;
}

.btn-logout:hover {
    background: #b91c1c !important;
}

/* ============================================================ */
/* 4. MAIN CONTENT                                              */
/* ============================================================ */
main {
    min-height: calc(100vh - 200px);
    padding-bottom: 20px;
}

/* ============================================================ */
/* 5. CARD                                                      */
/* ============================================================ */
.card {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    margin-bottom: 16px;
}

.card h1 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: #1e40af;
}

.card h2 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: #1e40af;
}

.card h3 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: #1e40af;
}

.card h4 {
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: #1e40af;
}

.card p {
    margin-bottom: 8px;
}

.card p:last-child {
    margin-bottom: 0;
}

/* ============================================================ */
/* 6. PAGE HEADER                                               */
/* ============================================================ */
.page-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 16px;
}

.page-header h1 {
    font-size: 1.2rem;
    color: #1e40af;
}

.page-header > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ============================================================ */
/* 7. LOGIN PAGE                                                */
/* ============================================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #1e40af 0%, #0891b2 100%);
}

.login-wrapper {
    width: 100%;
    max-width: 400px;
    background: #fff;
    padding: 32px 24px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 20px;
}

.login-logo img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    margin: 0 auto 8px;
}

.login-logo h2 {
    color: #1e40af;
    font-size: 1rem;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.login-wrapper h1 {
    text-align: center;
    color: #1e40af;
    font-size: 1.2rem;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
}

.login-wrapper input {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    transition: 0.2s;
}

.login-wrapper input:focus {
    outline: none;
    border-color: #1e40af;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.login-wrapper button {
    width: 100%;
    padding: 12px;
    background: #1e40af;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    margin-top: 8px;
    min-height: 44px;
}

.login-wrapper button:hover {
    background: #1e3a8a;
    transform: translateY(-1px);
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.85rem;
    color: #666;
}

/* ============================================================ */
/* 8. FORM                                                      */
/* ============================================================ */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: 0.2s;
    background: #fff;
    color: #333;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1e40af;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group small {
    display: block;
    margin-top: 4px;
    font-size: 0.8rem;
    color: #6b7280;
}

/* Form inline - vertikal di mobile */
form[style*="display:flex"],
form[style*="display: flex"] {
    flex-direction: column;
    align-items: stretch;
}

form[style*="display:flex"] .form-group,
form[style*="display: flex"] .form-group {
    margin: 0 0 12px 0 !important;
    min-width: 100% !important;
    flex: none !important;
}

/* ============================================================ */
/* 9. BUTTON                                                    */
/* ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    background: #1e40af;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    min-height: 44px;
    transition: 0.2s;
    white-space: nowrap;
    gap: 6px;
}

.btn:hover {
    background: #1e3a8a;
    text-decoration: none;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-success {
    background: #16a34a;
}

.btn-success:hover {
    background: #15803d;
}

.btn-danger {
    background: #dc2626;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-warning {
    background: #f59e0b;
}

.btn-warning:hover {
    background: #d97706;
}

/* ============================================================ */
/* 10. ALERT                                                    */
/* ============================================================ */
.alert {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border-left: 4px solid #16a34a;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #dc2626;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #1e40af;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

/* ============================================================ */
/* 11. TABLE                                                    */
/* ============================================================ */
.card > table,
.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    margin: 12px 0;
    padding-bottom: 8px; /* ruang untuk scrollbar */
}

/* Kalau tabel langsung di dalam card (tanpa wrapper) */
.card > table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 12px 0;
    max-width: 100%;
}

/* Tabel dasar */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    min-width: 700px;    /* ⬅️ DIPERBESAR dari 500px */
}

/* Tabel dengan banyak kolom */
table.tabel-lebar {
    min-width: 900px;
}

table th,
table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
    white-space: nowrap;
}

table th {
    background: #f3f4f6;
    font-weight: 600;
    font-size: 0.8rem;
    color: #374151;
    white-space: nowrap;
}

/* Kolom tertentu boleh wrap (kalau perlu) */
table td.wrap {
    white-space: normal;
}

table tr:hover {
    background: #f9fafb;
}

table tr:last-child td {
    border-bottom: none;
}

table td[colspan] {
    text-align: center;
    color: #999;
    padding: 20px;
}

table th,
table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}

table th {
    background: #f3f4f6;
    font-weight: 600;
    font-size: 0.8rem;
    color: #374151;
    white-space: nowrap;
}

table tr:hover {
    background: #f9fafb;
}

table tr:last-child td {
    border-bottom: none;
}

/* ============================================================ */
/* 12. BADGE                                                    */
/* ============================================================ */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.4;
}

.badge-ringan {
    background: #dcfce7;
    color: #166534;
}

.badge-sedang {
    background: #fef3c7;
    color: #92400e;
}

.badge-berat {
    background: #fed7aa;
    color: #9a3412;
}

.badge-sangat_berat {
    background: #fee2e2;
    color: #991b1b;
}

.badge-khusus {
    background: #e9d5ff;
    color: #6b21a8;
}

/* ============================================================ */
/* 13. GRID KELAS                                               */
/* ============================================================ */
.grid-kelas {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.kelas-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 16px 8px;
    background: #fff;
    border: 2px solid #1e40af;
    border-radius: 8px;
    text-decoration: none;
    color: #1e40af;
    font-weight: bold;
    font-size: 0.9rem;
    transition: 0.2s;
    line-height: 1.3;
    min-height: 80px;
}

.kelas-btn:hover {
    background: #1e40af;
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
}

.kelas-btn small {
    display: block;
    margin-top: 4px;
    font-weight: normal;
    font-size: 0.75rem;
    opacity: 0.8;
}

/* ============================================================ */
/* 14. STAT BOX                                                 */
/* ============================================================ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.stat-box {
    padding: 14px 10px;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.2s;
}

.stat-box:hover {
    transform: translateY(-2px);
}

.stat-box .stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1.2;
}

.stat-box .stat-label {
    font-size: 0.8rem;
    margin-top: 4px;
    line-height: 1.3;
}

.stat-blue   { background: #dbeafe; color: #1e40af; }
.stat-green  { background: #dcfce7; color: #166534; }
.stat-yellow { background: #fef3c7; color: #92400e; }
.stat-pink   { background: #fce7f3; color: #9d174d; }
.stat-purple { background: #e9d5ff; color: #6b21a8; }
.stat-orange { background: #fed7aa; color: #9a3412; }

/* ============================================================ */
/* 15. TTD (Tanda Tangan)                                       */
/* ============================================================ */
.ttd-table {
    width: 100%;
    margin-top: 40px;
    border-collapse: collapse;
    page-break-inside: avoid;
}

.ttd-table td {
    width: 50%;
    text-align: center;
    vertical-align: top;
    padding: 0 10px;
    border: none;
}

.ttd-table .ttd-label {
    font-size: 11pt;
    margin: 0;
}

.ttd-table .ttd-spacer {
    height: 60px;
}

.ttd-table .ttd-nama {
    font-weight: bold;
    text-decoration: underline;
    font-size: 11pt;
    margin-bottom: 2px;
}

.ttd-table .ttd-nip {
    font-size: 9pt;
    margin-top: 2px;
}

.ttd-table-4 td {
    width: 25%;
}

.ttd-box .spacer {
    height: 50px;
}

.ttd-box .nama {
    font-weight: bold;
    text-decoration: underline;
    margin-bottom: 2px;
    white-space: nowrap;
}

.ttd-box .nip {
    font-size: 0.85rem;
    white-space: nowrap;
    line-height: 1.3;
    margin-top: 2px;
}

/* ============================================================ */
/* 16. FOOTER                                                   */
/* ============================================================ */
.footer {
    text-align: center;
    padding: 20px 12px;
    margin-top: 40px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    color: #4b5563;
    font-size: 0.85rem;
    line-height: 1.6;
}

.footer p {
    margin: 0;
}

.footer strong {
    color: #1e40af;
    font-weight: 600;
}

/* ============================================================ */
/* 17. UTILITY                                                  */
/* ============================================================ */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-left   { text-align: left; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.d-flex { display: flex; }
.d-block { display: block; }
.d-none { display: none; }

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ============================================================ */
/* ============================================================ */
/* RESPONSIVE - TABLET (min-width: 600px)                      */
/* ============================================================ */
/* ============================================================ */
@media (min-width: 600px) {

    body {
        font-size: 15px;
    }

    .container {
        padding: 0 20px;
    }

    /* Navbar */
    .navbar {
        flex-wrap: nowrap;
        padding: 12px 20px;
    }

    .navbar .brand {
        width: auto;
        flex-wrap: nowrap;
        flex-shrink: 0;
    }

    .brand-logo {
        width: 40px;
        height: 40px;
    }

    .brand-title {
        font-size: 1rem;
    }

    .brand-subtitle {
        font-size: 0.8rem;
    }

    .nav-links {
        width: auto;
        margin-top: 0;
        flex: 1;
        justify-content: flex-end;
    }

    .nav-links a {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    /* Page Header */
    .page-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .page-header h1 {
        font-size: 1.4rem;
    }

    /* Card */
    .card {
        padding: 20px;
    }

    /* Form inline jadi horizontal */
    form[style*="display:flex"],
    form[style*="display: flex"] {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-end;
    }

    form[style*="display:flex"] .form-group,
    form[style*="display: flex"] .form-group {
        margin: 0 !important;
        min-width: 150px !important;
        flex: 1 !important;
    }

    /* Grid Kelas */
    .grid-kelas {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    /* Statistik */
    .stat-box .stat-value {
        font-size: 1.8rem;
    }

    .stat-box .stat-label {
        font-size: 0.85rem;
    }

    /* TTD */
    .ttd {
        flex-direction: row;
        justify-content: space-between;
    }

    .ttd-box {
        width: 200px;
    }

    .ttd-box .spacer {
        height: 55px;
    }

    /* Tabel */
    table {
        font-size: 0.9rem;
        min-width: auto;
    }
}

/* ============================================================ */
/* TANDA TANGAN — RAPI & SEJAJAR                                */
/* ============================================================ */
.ttd-wrap,
.ttd-wrap-4 {
    margin-top: 40px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    page-break-inside: avoid;
    width: 100%;
}

.ttd-kolom {
    flex: 1 1 0;
    text-align: center;
    font-size: 10pt;
    line-height: 1.2;
    padding: 0 4px;
    min-width: 0; /* PENTING: biar flex bisa shrink */
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Label (Mengetahui, Wali Kelas, dst) */
.ttd-kolom .label {
    font-size: 10pt;
    line-height: 1.2;
    margin: 0;
    padding: 0;
    color: #000;
    white-space: normal; /* boleh wrap */
}

/* Spacer — jarak untuk tanda tangan asli */
.ttd-kolom .spacer {
    height: 55px;
}

/* Nama — bold + underline */
.ttd-kolom .nama {
    font-weight: bold;
    text-decoration: underline;
    font-size: 10pt;
    line-height: 1.15;
    margin: 0;
    padding: 0;
    white-space: normal; /* biar boleh wrap kalau panjang */
    word-break: break-word;
    overflow-wrap: break-word;
}

/* NIP */
.ttd-kolom .nip {
    font-size: 8.5pt;
    line-height: 1.15;
    margin: 2px 0 0 0;
    padding: 0;
    white-space: normal;
    word-break: break-word;
}

/* Untuk TTD 4 kolom — perkecil font dikit */
.ttd-wrap-4 .ttd-kolom {
    font-size: 9.5pt;
}

.ttd-wrap-4 .ttd-kolom .label {
    font-size: 9.5pt;
}

.ttd-wrap-4 .ttd-kolom .nama {
    font-size: 9.5pt;
}

.ttd-wrap-4 .ttd-kolom .nip {
    font-size: 8pt;
}

/* ============================================================ */
/* ============================================================ */
/* RESPONSIVE - DESKTOP (min-width: 900px)                     */
/* ============================================================ */
/* ============================================================ */
@media (min-width: 900px) {

    .container {
        padding: 0 24px;
    }

    .card {
        padding: 24px;
        margin-bottom: 20px;
    }

    .card h1 { font-size: 1.5rem; }
    .card h2 { font-size: 1.2rem; }
    .card h3 { font-size: 1.05rem; }

    .page-header h1 {
        font-size: 1.5rem;
    }

    /* Grid Kelas - auto fit */
    .grid-kelas {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 12px;
    }

    /* Statistik */
    .stat-box .stat-value {
        font-size: 2rem;
    }

    /* TTD */
    .ttd-box {
        width: 250px;
    }

    .ttd-box .spacer {
        height: 60px;
    }
}

/* ============================================================ */
/* ============================================================ */
/* RESPONSIVE - LARGE DESKTOP (min-width: 1200px)              */
/* ============================================================ */
/* ============================================================ */
@media (min-width: 1200px) {

    .container {
        padding: 0 20px;
    }
}

/* ============================================================ */
/* ============================================================ */
/* RESPONSIVE - SMALL MOBILE (max-width: 400px)                */
/* ============================================================ */
/* ============================================================ */
@media (max-width: 400px) {

    body {
        font-size: 14px;
    }

    .grid-kelas {
        grid-template-columns: 1fr;
    }

    .stat-box .stat-value {
        font-size: 1.3rem;
    }

    .brand-title {
        font-size: 0.8rem;
    }

    .brand-subtitle {
        font-size: 0.65rem;
    }
}

/* ============================================================ */
/* ============================================================ */
/* PRINT                                                        */
/* ============================================================ */
/* ============================================================ */
@media print {

    body {
        background: #fff;
        font-size: 11pt;
    }

    .navbar,
    .footer,
    .btn,
    .btn-logout,
    .page-header > div {
        display: none !important;
    }

    .container {
        max-width: 100%;
        padding: 0;
        margin: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #999;
        page-break-inside: avoid;
        margin-bottom: 12px;
        padding: 12px;
    }

    table {
        min-width: auto;
    }

    a {
        color: #000;
        text-decoration: none;
    }

    .badge {
        border: 1px solid #999;
    }

    @page {
        margin: 1cm;
    }
}

/* ============================================================ */
/* ============================================================ */
/* ANIMASI                                                      */
/* ============================================================ */
/* ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.alert,
.card {
    animation: fadeIn 0.2s ease-out;
}

/* ============================================================ */
/* ============================================================ */
/* SCROLLBAR CANTIK                                             */
/* ============================================================ */
/* ============================================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* ============================================================ */
/* END OF FILE                                                  */
/* ============================================================ */

/* ============================================================ */
/* MOBILE OPTIMIZATION - TAMBAHAN                               */
/* ============================================================ */

/* ---------- TABEL RESPONSIVE (WAJIB) ---------- */
/* Semua tabel langsung bisa scroll horizontal */
table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    white-space: nowrap;
}

table thead,
table tbody,
table tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}

table thead {
    display: table-header-group;
}

/* Kalau tabel di dalam .card, padding card dikurangi */
.card > table {
    margin: 0 -16px;  /* keluar dari padding card */
    width: calc(100% + 32px);
    padding: 0 16px;
}

/* ---------- NAVBAR HP - RINGKAS ---------- */
@media (max-width: 768px) {

    .navbar {
        padding: 8px 10px;
    }

    .navbar .brand {
        gap: 6px;
    }

    .brand-logo {
        width: 30px;
        height: 30px;
    }

    .brand-title {
        font-size: 0.75rem;
        line-height: 1.2;
    }

    .brand-subtitle {
        font-size: 0.65rem;
    }

    .nav-links {
        gap: 4px;
        margin-top: 4px;
    }

    .nav-links a {
        padding: 5px 8px;
        font-size: 0.75rem;
        border-radius: 3px;
    }

    .user-info {
        font-size: 0.7rem;
        padding: 3px 6px;
    }

    .btn-logout {
        padding: 5px 10px !important;
        font-size: 0.75rem !important;
    }

    /* ---------- CARD - PADDING KECIL ---------- */
    .card {
        padding: 12px;
        margin-bottom: 12px;
    }

    .card h2 { font-size: 1rem; }
    .card h3 { font-size: 0.95rem; }

    /* ---------- GRID KELAS - 2 KOLOM ---------- */
    .grid-kelas {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px;
    }

    .kelas-btn {
        padding: 12px 6px;
        font-size: 0.85rem;
        min-height: 70px;
    }

    /* ---------- STAT BOX - 2 KOLOM ---------- */
    div[style*="grid-template-columns:repeat(auto-fill"],
    div[style*="grid-template-columns: repeat(auto-fill"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    .stat-box {
        padding: 10px 6px;
    }

    .stat-box .stat-value {
        font-size: 1.3rem;
    }

    .stat-box .stat-label {
        font-size: 0.7rem;
    }

    /* ---------- PAGE HEADER ---------- */
    .page-header h1 {
        font-size: 1.1rem;
    }

    /* ---------- BUTTON ---------- */
    .btn {
        padding: 8px 12px;
        font-size: 0.85rem;
        min-height: 38px;
    }

    /* ---------- TABEL ---------- */
    table {
    font-size: 0.8rem;
    min-width: 800px;    /* ⬅️ lebih besar supaya scroll */
}

table th,
table td {
    padding: 8px 10px;   /* ⬅️ tambah padding */
}

    /* ---------- BADGE ---------- */
    .badge {
        font-size: 0.7rem;
        padding: 2px 6px;
    }
}

/* ---------- HP KECIL ---------- */
@media (max-width: 480px) {

    .grid-kelas {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .brand-title {
        font-size: 0.7rem;
    }

    /* Navbar - menu di-scroll horizontal */
    .nav-links {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }

    .nav-links::-webkit-scrollbar {
        height: 3px;
    }

    .nav-links a {
        flex-shrink: 0;
    }
}

/* Tombol hamburger — hanya muncul di HP */
.hamburger {
    display: none;
    background: none;
    border: 2px solid #fff;
    color: #fff;
    font-size: 1.5rem;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-top: 8px;
    }

    .nav-links.show {
        display: flex;
    }

    .nav-links a {
        width: 100%;
        text-align: center;
        padding: 10px;
        border-bottom: 1px solid rgba(255,255,255,0.2);
    }
}

/* ------------------------------------------------------------ */
/* Alamat Penerima Surat — spasi rapat 1.15                     */
/* ------------------------------------------------------------ */
.alamat-penerima {
    margin-bottom: 1.5em;
    line-height: 1.15;
}

.alamat-penerima > div {
    line-height: 1.15;
    margin-bottom: 0;
}