@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --hijau-tua: #0d3b2e;
    --hijau: #12543f;
    --hijau-muda: #1a7a5c;
    --emas: #c9a35c;
    --emas-terang: #e6c877;
    --krem: #f6f8f7;
    --putih: #fff;
    --teks-gelap: #1f2a25;
    --teks-abu: #69766f;
    --bayangan: 0 8px 22px rgba(13,59,46,.08);
    --radius: 12px;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--krem);
    color: var(--teks-gelap);
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }

/* ==== Login ==== */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--hijau-tua), var(--hijau-muda));
    padding: 20px;
}
.login-card {
    background: #fff;
    border-radius: 16px;
    padding: clamp(28px, 6vw, 44px);
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.login-card .logo-wrap { text-align: center; margin-bottom: 20px; }
.login-card .logo-wrap i { font-size: 44px; color: var(--emas); }
.login-card h2 { text-align: center; color: var(--hijau-tua); margin-bottom: 6px; font-size: 22px; }
.login-card p.sub { text-align: center; color: var(--teks-abu); font-size: 13.5px; margin-bottom: 26px; }

/* ==== Layout Admin ==== */
.admin-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.sidebar {
    width: 260px;
    background: var(--hijau-tua);
    color: #dcece3;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform .3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar .brand i { font-size: 24px; color: var(--emas-terang); }
.sidebar .brand span { font-weight: 700; font-size: 16px; color: #fff; }
.sidebar nav { padding: 14px 10px; }
.sidebar .grup-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #89a99a;
    padding: 14px 12px 6px;
    font-weight: 600;
}
.sidebar a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 8px;
    margin-bottom: 3px;
    font-size: 14px;
    color: #cfe0d7;
    transition: all .2s ease;
}
.sidebar a i { width: 18px; text-align: center; }
.sidebar a:hover, .sidebar a.aktif { background: rgba(255,255,255,.1); color: #fff; }
.sidebar a.aktif { background: var(--hijau-muda); font-weight: 600; }

.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar-admin {
    background: #fff;
    box-shadow: var(--bayangan);
    padding: 16px clamp(16px, 4vw, 28px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 99;
}
.topbar-admin h1 {
    font-size: clamp(16px, 3vw, 20px);
    color: var(--hijau-tua);
}
.topbar-admin .profil-admin {
    display: flex;
    align-items: center;
    gap: 10px;
}
.topbar-admin .avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--hijau);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 15px;
    flex-shrink: 0;
}

.isi-halaman {
    padding: clamp(16px, 3.5vw, 28px);
    flex: 1;
}

/* ==== Card & Table ==== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 26px;
}
.stat-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--bayangan);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.stat-card .ic {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    background: linear-gradient(135deg, var(--hijau), var(--hijau-muda));
    flex-shrink: 0;
}
.stat-card .angka { font-size: 24px; font-weight: 700; color: var(--hijau-tua); line-height: 1.1; }
.stat-card .label { font-size: 13px; color: var(--teks-abu); }

.panel {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--bayangan);
    padding: clamp(18px, 3vw, 26px);
    margin-bottom: 24px;
    overflow: hidden;
}
.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.panel-head h3 { color: var(--hijau-tua); font-size: 17px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all .2s ease;
    font-family: inherit;
}
.btn-hijau { background: var(--hijau); color: #fff; }
.btn-hijau:hover { background: var(--hijau-muda); }
.btn-emas { background: var(--emas); color: #fff; }
.btn-merah { background: #e05252; color: #fff; }
.btn-abu { background: #eef1ef; color: var(--teks-gelap); }
.btn-outline { border: 1.5px solid var(--hijau); color: var(--hijau); background: transparent; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }

/* Table responsive wrapper */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 10px;
}
table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}
table th {
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--teks-abu);
    padding: 12px 14px;
    border-bottom: 2px solid #eef1ef;
    white-space: nowrap;
}
table td {
    padding: 14px;
    border-bottom: 1px solid #f1f3f2;
    font-size: 14px;
    vertical-align: middle;
}
table tr:hover { background: #fafcfb; }
.thumb-tabel { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; }
.badge { padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; display: inline-block; }
.badge-hijau { background: #e2f4ea; color: #1a7a4a; }
.badge-abu { background: #eef1ef; color: #69766f; }
.badge-merah { background: #fdeaea; color: #b3261e; }

.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
    font-size: 13.5px;
    color: var(--hijau-tua);
}
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #e1e6e3;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 14.5px;
    background: #fff;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none;
    border-color: var(--hijau);
    box-shadow: 0 0 0 3px rgba(18,84,63,0.1);
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.preview-img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 10px;
    border: 1px solid #e1e6e3;
    display: block;
}

.alert { padding: 14px 18px; border-radius: 10px; margin-bottom: 20px; font-size: 14px; }
.alert-sukses { background: #e2f4ea; color: #1a7a4a; border: 1px solid #b6e3c6; }
.alert-gagal { background: #fdeaea; color: #b3261e; border: 1px solid #f5c2c2; }

.toggle-sidebar-btn {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--hijau-tua);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
}
.toggle-sidebar-btn:hover { background: rgba(13,59,46,0.06); }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity .3s ease;
}
.sidebar-overlay.tampil {
    display: block;
    opacity: 1;
}

/* =========================================================
   ADMIN RESPONSIVE BREAKPOINTS
   ========================================================= */

@media (max-width: 1024px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}

@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.25);
    }
    .sidebar.tampil {
        transform: translateX(0);
    }
    .toggle-sidebar-btn { display: block; }
}

@media (max-width: 600px) {
    .stat-grid { grid-template-columns: 1fr; gap: 12px; }
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .topbar-admin { padding: 12px 16px; }
    .isi-halaman { padding: 16px 12px; }
    .panel { padding: 18px 14px; }
    .panel-head { flex-direction: column; align-items: flex-start; }
    .panel-head .btn { width: 100%; justify-content: center; }
}
