:root {
    --green: #075b45;
    --green-dark: #073d30;
    --green-light: #0b7659;
    --soft: #edf5f1;
    --background: #f4f7f5;
    --white: #ffffff;
    --ink: #17211d;
    --muted: #6b7772;
    --line: #dce5e1;
    --danger: #b42318;
    --danger-soft: #fff0ef;
    --sidebar-width: 260px;
}

/* =========================
   RESET
========================= */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: Manrope, Arial, sans-serif;
    color: var(--ink);
    background: var(--background);
}

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

button,
input,
select,
textarea {
    font-family: inherit;
}

/* =========================
   LAYOUT ADMIN
========================= */

.admin-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 26px 18px;
    overflow-y: auto;
    color: #d4e5de;
    background: var(--green-dark);
}

.admin-main {
    min-width: 0;
}

.admin-content {
    padding: 30px;
}

/* =========================
   LOGO DAN IDENTITAS ADMIN
========================= */

.admin-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 76px;
    padding: 0 8px 20px;
    margin-bottom: 18px;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-logo {
    display: flex;
    flex: 0 0 55px;
    align-items: center;
    justify-content: center;
    width: 55px;
    min-width: 55px;
    max-width: 55px;
    height: 64px;
    overflow: hidden;
}

.admin-logo img {
    display: block;
    width: 100% !important;
    max-width: 55px !important;
    height: 100% !important;
    max-height: 64px !important;
    object-fit: contain;
}

/*
   Dukungan jika HTML masih menggunakan:
   <span class="logo"><img ...></span>
*/

.admin-brand .logo {
    display: flex;
    flex: 0 0 55px;
    align-items: center;
    justify-content: center;
    width: 55px;
    min-width: 55px;
    max-width: 55px;
    height: 64px;
    padding: 0;
    overflow: hidden;
    color: transparent;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.admin-brand .logo img {
    display: block;
    width: 100% !important;
    max-width: 55px !important;
    height: 100% !important;
    max-height: 64px !important;
    object-fit: contain;
}

.admin-brand-text {
    min-width: 0;
    flex: 1;
}

.admin-brand strong,
.admin-brand small,
.admin-brand-text strong,
.admin-brand-text small {
    display: block;
}

.admin-brand strong,
.admin-brand-text strong {
    color: var(--white);
    font-size: 14px;
    line-height: 1.3;
}

.admin-brand small,
.admin-brand-text small {
    margin-top: 2px;
    color: #a8c2b8;
    font-size: 11px;
    line-height: 1.4;
}

/* =========================
   MENU SIDEBAR
========================= */

.side-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    margin: 3px 0;
    color: #d4e5de;
    font-size: 13px;
    border-radius: 9px;
    transition:
        color 0.2s ease,
        background-color 0.2s ease;
}

.side-menu a:hover,
.side-menu a.active {
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
}

.side-menu .label {
    margin: 19px 12px 7px;
    color: #7fa69a;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* =========================
   TOPBAR
========================= */

.admin-top {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    padding: 0 30px;
    background: var(--white);
    border-bottom: 1px solid var(--line);
}

.admin-top h1 {
    margin: 0;
    font-size: 18px;
}

.admin-user {
    color: var(--muted);
    font-size: 12px;
}

/* =========================
   STATISTIK DAN PANEL
========================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 25px;
}

.stat-card,
.panel {
    padding: 20px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 15px;
}

.stat-card span {
    color: var(--muted);
    font-size: 12px;
}

.stat-card strong {
    display: block;
    margin-top: 5px;
    color: var(--green);
    font-size: 30px;
    line-height: 1.25;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 18px;
}

.panel-head h2 {
    margin: 0;
    font-size: 18px;
}

.two-col {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.6fr);
    gap: 20px;
}

/* =========================
   TOMBOL
========================= */

.btn {
    display: inline-block;
    padding: 10px 14px;
    color: inherit;
    font: 700 12px Manrope, Arial, sans-serif;
    cursor: pointer;
    border: 0;
    border-radius: 9px;
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}

.btn:hover {
    opacity: 0.9;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    color: var(--white);
    background: var(--green);
}

.btn-light {
    color: var(--green);
    background: var(--soft);
}

.btn-danger {
    color: var(--danger);
    background: var(--danger-soft);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* =========================
   TABEL
========================= */

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

th,
td {
    padding: 12px 10px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--line);
}

th {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

tbody tr:hover {
    background: #f8fbf9;
}

/* =========================
   BADGE
========================= */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    color: var(--green);
    font-size: 10px;
    font-weight: 700;
    background: var(--soft);
    border-radius: 999px;
}

/* =========================
   FORMULIR
========================= */

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
}

.control {
    width: 100%;
    padding: 11px 12px;
    color: var(--ink);
    font: 13px Manrope, Arial, sans-serif;
    background: var(--white);
    border: 1px solid #ccd7d2;
    border-radius: 9px;
    outline: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.control:focus {
    border-color: var(--green-light);
    box-shadow: 0 0 0 3px rgba(11, 118, 89, 0.12);
}

textarea.control {
    min-height: 110px;
    resize: vertical;
}

/* =========================
   NOTIFIKASI
========================= */

.alert {
    padding: 12px 15px;
    margin-bottom: 17px;
    font-size: 13px;
    border-radius: 10px;
}

.alert-success {
    color: #11623e;
    background: #e8f7ef;
}

.alert-error {
    color: #96231a;
    background: var(--danger-soft);
}

/* =========================
   HALAMAN LOGIN
========================= */

.login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #053c30, #0c795c);
}

.login-card {
    width: min(430px, 100%);
    padding: 34px;
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.2);
}

.login-card h1 {
    margin: 10px 0 5px;
}

.login-card p {
    color: var(--muted);
    font-size: 13px;
}

/* =========================
   KONDISI DATA KOSONG
========================= */

.empty {
    padding: 30px;
    color: var(--muted);
    text-align: center;
}

/* =========================
   RESPONSIVE TABLET
========================= */

@media (max-width: 900px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        overflow: visible;
    }

    .side-menu {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .side-menu .label {
        grid-column: 1 / -1;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .two-col {
        grid-template-columns: 1fr;
    }
}

/* =========================
   RESPONSIVE HP
========================= */

@media (max-width: 600px) {
    .sidebar {
        padding: 20px 14px;
    }

    .admin-brand {
        min-height: 68px;
    }

    .admin-logo,
    .admin-brand .logo {
        flex-basis: 48px;
        width: 48px;
        min-width: 48px;
        max-width: 48px;
        height: 56px;
    }

    .admin-logo img,
    .admin-brand .logo img {
        max-width: 48px !important;
        max-height: 56px !important;
    }

    .side-menu {
        grid-template-columns: 1fr;
    }

    .admin-top {
        height: auto;
        min-height: 64px;
        padding: 13px 18px;
    }

    .admin-top h1 {
        font-size: 16px;
    }

    .admin-user {
        max-width: 140px;
        text-align: right;
    }

    .admin-content {
        padding: 18px;
    }

    .stats-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .panel-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .login-card {
        padding: 26px 22px;
    }
    /* =========================================
   PERBAIKAN PAKSA LOGO SIDEBAR ADMIN
========================================= */

.sidebar .admin-brand {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;

    width: 100% !important;
    min-height: 78px !important;
    max-height: 78px !important;

    padding: 0 8px 16px !important;
    margin: 0 0 18px !important;

    overflow: hidden !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

/* Mengunci semua gambar di dalam admin-brand */
.sidebar .admin-brand img {
    display: block !important;

    width: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;

    height: 62px !important;
    min-height: 62px !important;
    max-height: 62px !important;

    margin: 0 !important;
    padding: 0 !important;

    object-fit: contain !important;
    object-position: center !important;

    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Mengunci wadah logo */
.sidebar .admin-logo,
.sidebar .admin-brand .logo {
    display: flex !important;
    flex: 0 0 52px !important;
    align-items: center !important;
    justify-content: center !important;

    width: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;

    height: 62px !important;
    min-height: 62px !important;
    max-height: 62px !important;

    margin: 0 !important;
    padding: 0 !important;

    overflow: hidden !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Tulisan identitas */
.sidebar .admin-brand-text {
    display: block !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
}

.sidebar .admin-brand-text strong {
    display: block !important;
    margin: 0 !important;

    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    line-height: 1.3 !important;
}

.sidebar .admin-brand-text small {
    display: block !important;
    margin-top: 3px !important;

    color: #a8c2b8 !important;
    font-size: 11px !important;
    line-height: 1.35 !important;
}
}
/* === OVERLAY PERBAIKAN LOGO ADMIN === */

.admin-brand {
    height: 85px !important;
    min-height: 85px !important;
    max-height: 85px !important;
    overflow: hidden !important;
}

.admin-brand img {
    width: 55px !important;
    height: 65px !important;
    min-width: 55px !important;
    max-width: 55px !important;
    min-height: 65px !important;
    max-height: 65px !important;
    object-fit: contain !important;
}

.admin-brand .logo,
.admin-brand .admin-logo {
    width: 55px !important;
    height: 65px !important;
    min-width: 55px !important;
    max-width: 55px !important;
    min-height: 65px !important;
    max-height: 65px !important;
    flex: 0 0 55px !important;
    overflow: hidden !important;
    background: transparent !important;
}

.admin-brand-text {
    display: block !important;
    flex: 1 !important;
}

.admin-brand-text strong {
    display: block !important;
    color: #fff !important;
    font-size: 14px !important;
}

.admin-brand-text small {
    display: block !important;
    color: #a8c2b8 !important;
    font-size: 11px !important;
}