* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, sans-serif; }
body { background: #f5f2ea; color: #2b2b2b; font-size: 14px; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }

/* ============ LOGIN PAGE ============ */
.login-wrapper {
    display: grid; grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}
.login-left {
    background: linear-gradient(135deg, #1a3d2e 0%, #234a38 100%);
    color: #fff;
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;      /* ← WAJIB */
    overflow: hidden;        /* ← WAJIB */
}
/* ============ BATIK DECORATION ============ */
.login-left .batik {
    position: absolute;
    pointer-events: none;
    user-select: none;
    opacity: 50;           /* sesuaikan: 0.2 - 0.5 */
    z-index: 0;
}
/* Batik kanan atas */
.login-left .batik-tr {
    top: -20px;
    right: -20px;
    width: 220px;
    height: auto;
}

/* Batik kiri bawah */
.login-left .batik-bl {
    bottom: -15%;
    left: -15%;
    width: 55%;
    height: auto;
    transform: rotate(180deg);
    opacity: 0.75;
    filter: brightness(1.6);
}

/* Semua konten di atas batik */
.login-left > *:not(.batik) {
    position: relative;
    z-index: 1;
}
.login-left > *:not(.batik) {
    position: relative;
    z-index: 1;
}
.login-left .logo {
    width: 90px;
    height: 90px;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* background & border-radius dihapus karena sudah ada logo sekolah */
}
.login-left .logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.login-left h1 { 
    text-align: center; 
    font-size: 26px; 
    letter-spacing: 3px; 
    margin-bottom: 6px;
    color: #fff;
}
.login-left p { 
    text-align: center; 
    color: #c9d4cd; 
    font-size: 13px; 
    margin-bottom: 4px; 
}
/* SMK Negeri 1 Panumbangan — sama besar dengan WANGI KELAS */
.login-left h1.sekolah {
    text-align: center;
    font-size: 26px;         /* sama dengan WANGI KELAS */
    letter-spacing: 3px;
    color: #d4af37;          /* warna emas biar beda */
    margin-bottom: 30px;
}
.login-left .tagline {
    text-align: center; color: #d4af37; font-weight: 600;
    padding: 20px 0; border-top: 1px solid rgba(212,175,55,.3);
    border-bottom: 1px solid rgba(212,175,55,.3); margin-bottom: 30px;
    line-height: 1.8;
}
.login-left .values {
    display: flex; justify-content: center; gap: 25px;
}
.login-left .values div {
    text-align: center; font-size: 11px; color: #c9d4cd;
}
.login-left .values div span {
    display: block; width: 40px; height: 40px; margin: 0 auto 8px;
    border: 1px solid rgba(212,175,55,.5); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #d4af37; font-size: 16px;
}

.login-right {
    display: flex; align-items: center; justify-content: center;
    padding: 40px; background: #f5f2ea;
}
.login-card {
    background: #fff; padding: 40px; border-radius: 12px;
    width: 100%; max-width: 400px; box-shadow: 0 8px 30px rgba(0,0,0,.06);
}
.login-card h2 { font-size: 22px; color: #1a3d2e; text-align: center; margin-bottom: 8px; }
.login-card .sub { text-align: center; color: #888; font-size: 12px; margin-bottom: 25px; }
.login-card label { display: block; font-size: 12px; color: #555; margin-bottom: 6px; font-weight: 600; }
.login-card input[type=text],
.login-card input[type=password] {
    width: 100%; padding: 11px 14px; border: 1px solid #dfe3e0;
    border-radius: 8px; font-size: 14px; margin-bottom: 15px;
    background: #fafbfa;
}
.login-card input:focus { outline: none; border-color: #2d5241; background: #fff; }

.role-group { margin: 15px 0; }
.role-group > label:first-child {
    font-size: 12px; font-weight: 600; color: #555; margin-bottom: 10px; display: block;
}
.role-option {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; border-radius: 8px; cursor: pointer;
    font-size: 13px; color: #444; margin-bottom: 4px;
}
.role-option:hover { background: #f0f4f1; }
.role-option input { accent-color: #2d5241; }

.btn-login {
    width: 100%; background: #2d5241; color: #fff;
    padding: 12px; border: none; border-radius: 8px;
    font-size: 14px; font-weight: 600; margin-top: 10px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-login:hover { background: #1a3d2e; }
.login-footer {
    text-align: center; font-size: 11px; color: #aaa;
    margin-top: 25px; padding-top: 15px; border-top: 1px solid #eee;
}

/* ============ SIDEBAR ============ */
.sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 240px;
    background: linear-gradient(180deg, #1a3d2e 0%, #234a38 100%);
    color: #e8f0ea; padding: 0; overflow-y: auto;
    display: flex; flex-direction: column;
}
.sidebar-brand {
    padding: 22px 20px; border-bottom: 1px solid rgba(255,255,255,.08);
    display: flex; align-items: center; gap: 12px;
}
.sidebar-brand .logo-box {
    width: 38px; height: 38px; background: #d4af37; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #1a3d2e; font-size: 20px; font-weight: bold;
}
.sidebar-brand .brand-text h3 {
    font-size: 16px; color: #fff; letter-spacing: 1.5px; line-height: 1;
}
.sidebar-brand .brand-text span {
    font-size: 10px; color: #a8bcae; display: block; margin-top: 3px;
}
.sidebar nav { padding: 15px 12px; flex: 1; }
.sidebar nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; border-radius: 8px;
    font-size: 13px; color: #c9d4cd; margin-bottom: 3px;
    transition: .2s;
}
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.active {
    background: rgba(212,175,55,.15); color: #d4af37;
    border-left: 3px solid #d4af37;
}
.sidebar .nav-group {
    font-size: 10px; text-transform: uppercase; color: #7a9485;
    padding: 18px 14px 8px; letter-spacing: 1.5px;
}

/* ============ TOPBAR ============ */
.topbar {
    position: fixed; top: 0; left: 240px; right: 0;
    background: #fff; padding: 12px 25px;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: 0 1px 4px rgba(0,0,0,.04); z-index: 50;
}
.topbar .hamburger {
    font-size: 20px; color: #555; cursor: pointer;
}
.topbar .user-info {
    display: flex; align-items: center; gap: 10px;
    font-size: 13px; color: #333;
}
.topbar .user-info .avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: #2d5241; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
}

/* ============ CONTENT ============ */
.content {
    margin-left: 240px; padding: 80px 30px 30px;
    min-height: 100vh;
}
.page-title { font-size: 22px; color: #1a3d2e; margin-bottom: 4px; }
.page-sub { font-size: 13px; color: #888; margin-bottom: 20px; }

/* Cards */
.card {
    background: #fff; border-radius: 12px; padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04); margin-bottom: 18px;
}
.card h3 { font-size: 15px; color: #1a3d2e; margin-bottom: 12px; }

/* Stat Grid */
.stat-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 15px; margin-bottom: 20px;
}
.stat-card {
    background: #fff; border-radius: 12px; padding: 18px;
    display: flex; align-items: center; gap: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.stat-icon {
    width: 48px; height: 48px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
}
.stat-icon.green { background: #e6f2ec; color: #2d5241; }
.stat-icon.yellow { background: #fdf3e0; color: #d4a017; }
.stat-icon.blue { background: #e8f0f8; color: #2980b9; }
.stat-icon.orange { background: #fdeee0; color: #e67e22; }
.stat-info h2 { font-size: 24px; color: #1a3d2e; line-height: 1; }
.stat-info p { font-size: 12px; color: #888; margin-top: 4px; }
.stat-info span { font-size: 11px; color: #2d5241; }

/* Welcome Banner */
.welcome-banner {
    background: linear-gradient(135deg, #1a3d2e 0%, #234a38 100%);
    color: #fff; padding: 22px 25px; border-radius: 12px;
    margin-bottom: 20px; position: relative; overflow: hidden;
}
.welcome-banner::after {
    content: ''; position: absolute; right: -30px; top: -30px;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(212,175,55,.15) 0%, transparent 70%);
}
.welcome-banner h2 { font-size: 18px; margin-bottom: 6px; }
.welcome-banner p { font-size: 13px; color: #c9d4cd; }
.welcome-banner .quote {
    margin-top: 12px; padding-top: 12px;
    border-top: 1px solid rgba(212,175,55,.3);
    color: #d4af37; font-style: italic; font-size: 13px;
}

/* Two column layout */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* Table */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f0f0f0; }
.table th { color: #888; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.table tbody tr:hover { background: #fafbfa; }

/* Badge */
.badge {
    display: inline-block; padding: 4px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 600;
}
.badge-disetujui, .badge-terlaksana { background: #d4ecd9; color: #2d5241; }
.badge-menunggu_wali, .badge-terjadwal { background: #fdf0d5; color: #b8860b; }
.badge-menunggu_kepsek, .badge-berlangsung { background: #d6e6f7; color: #2471a3; }
.badge-ditolak { background: #fadbd8; color: #c0392b; }
.badge-draft { background: #ecf0f1; color: #7f8c8d; }

/* Button */
.btn { padding: 9px 18px; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; }
.btn-primary { background: #2d5241; color: #fff; }
.btn-primary:hover { background: #1a3d2e; }
.btn-success { background: #2d5241; color: #fff; }
.btn-danger  { background: #c0392b; color: #fff; }
.btn-outline { background: #fff; color: #333; border: 1px solid #ddd; }
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: 14px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #e0e0e0;
    color: #333;
    text-decoration: none;
    cursor: pointer;
    transition: .2s;
}
.btn-icon:hover {
    background: #f0f4f1;
    border-color: #2d5241;
    color: #2d5241;
}

/* Form */
.form-card {
    background: #fff; border-radius: 12px; padding: 22px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04); margin-bottom: 18px;
}
.form-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 15px; }
.form-group label {
    display: block; font-size: 12px; color: #555;
    font-weight: 600; margin-bottom: 6px;
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 9px 12px; border: 1px solid #dfe3e0;
    border-radius: 8px; font-size: 13px; background: #fafbfa;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: #2d5241; background: #fff;
}

/* Progress bar */
.progress-bar {
    height: 6px; background: #eef1ef; border-radius: 20px; overflow: hidden;
    margin-top: 4px;
}
.progress-bar > div { height: 100%; background: #2d5241; border-radius: 20px; }

/* Donut */
.donut-wrap { display: flex; align-items: center; gap: 25px; }
.donut {
    width: 130px; height: 130px; border-radius: 50%;
    background: conic-gradient(#2d5241 0% 67%, #e8eeea 67% 100%);
    display: flex; align-items: center; justify-content: center;
    position: relative;
}
.donut::before {
    content: ''; position: absolute; width: 85px; height: 85px;
    background: #fff; border-radius: 50%;
}
.donut span {
    position: relative; z-index: 1;
    font-size: 22px; font-weight: bold; color: #1a3d2e;
}
.donut-legend { flex: 1; }
.donut-legend div {
    display: flex; align-items: center; gap: 10px;
    font-size: 12px; margin-bottom: 8px;
}
.donut-legend .dot { width: 8px; height: 8px; border-radius: 50%; }

/* Tab */
.tabs { display: flex; gap: 5px; margin-bottom: 20px; }
.tabs a {
    padding: 8px 18px; border-radius: 8px;
    font-size: 13px; color: #555; background: #fff;
    border: 1px solid #e5e8e6;
}
.tabs a.active { background: #2d5241; color: #fff; border-color: #2d5241; }

/* Toolbar */
.toolbar {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 15px; flex-wrap: wrap;
}
.toolbar .search {
    flex: 1; min-width: 200px; padding: 9px 14px;
    border: 1px solid #dfe3e0; border-radius: 8px;
    font-size: 13px; background: #fff;
}

/* Barcode */
.barcode-card { text-align: center; padding: 25px; }
.barcode-card img { margin: 10px 0; border: 1px solid #eee; padding: 8px; border-radius: 8px; }

/* Error */
.error {
    color: #c0392b; background: #fdecea; padding: 10px 14px;
    border-radius: 8px; font-size: 13px; margin-bottom: 12px;
    border-left: 3px solid #c0392b;
}

/* Card header */
.card-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px;
}
.card-head h3 { margin: 0; }
.card-head a { font-size: 12px; color: #2d5241; }


/* =========================================
   TAMPILAN RESPONSIF UNTUK HP / TABLET (Mobile)
   ========================================= */
@media screen and (max-width: 768px) {
    /* 1. Menyembunyikan Sidebar ke kiri layar */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        z-index: 9999;
        position: fixed;
        height: 100vh;
    }

    /* 2. Class untuk memunculkan sidebar saat tombol hamburger diklik */
    .sidebar.show {
        transform: translateX(0);
    }

    /* 3. Mengatur ulang layout konten utama */
    .content {
        margin-left: 0 !important;
        padding: 70px 15px 15px !important; /* Padding atas dikurangi */
        width: 100% !important;
    }

    /* 4. Menyesuaikan Topbar (Header atas) */
    .topbar {
        left: 0 !important; /* Topbar jadi lebar penuh */
        padding: 10px 15px !important;
    }
    
    /* Menyembunyikan teks nama user di topbar agar tidak kepanjangan */
    .topbar .user-info span {
        display: none;
    }

    /* 5. Membuat Tabel bisa digeser (scroll) ke samping */
    .card {
        overflow-x: auto;
    }
    .table, .rekap-table {
        min-width: 600px; /* Memaksa tabel memiliki lebar minimum agar tidak gepeng */
    }

    /* 6. Form filter berubah menjadi atas-bawah (bukan menyamping) */
    .filter-bar {
        display: flex !important;
        flex-direction: column;
        align-items: stretch !important;
    }
    .filter-bar input, .filter-bar select, .filter-bar button {
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 8px;
    }

    /* 7. Grid statistik (kotak-kotak di dashboard) jadi 1 kolom */
    .stat-grid, .stat-cards, .form-row, .grid-2 {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    /* 8. Tombol cetak / tambah data jadi lebar penuh */
    .card-head {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }
    .card-head .btn {
        width: 100%;
        text-align: center;
    }
}