:root {

    --background: #f6f0e4;
    --card: #fffdf8;

    --text: #403a31;
    --muted: #7c7467;

    --gold: #9b7745;
    --gold-dark: #73552e;

    --border: #e5dccd;

    --green: #557a57;
    --red: #9a5148;

    --shadow:
        0 12px 35px rgba(70, 55, 35, 0.08);
}


* {
    box-sizing: border-box;
}


body {

    margin: 0;

    background:
        radial-gradient(
            circle at top,
            #fffdf8 0,
            var(--background) 60%
        );

    color: var(--text);

    font-family:
        Georgia,
        'Times New Roman',
        serif;
}


button,
input,
textarea,
select {

    font: inherit;
}


.admin-layout {

    display: flex;

    min-height: 100vh;
}


/* ================================================================
   SIDEBAR
   ================================================================ */

.sidebar {

    width: 250px;

    background:
        linear-gradient(
            180deg,
            #40382e,
            #2f2923
        );

    color: white;

    padding: 30px 20px;

    position: fixed;

    inset:
        0
        auto
        0
        0;

    display: flex;

    flex-direction: column;
}


.sidebar-title {

    font-size: 22px;

    color: #f4dfb9;

    margin-bottom: 4px;
}


.sidebar-subtitle {

    color: #bdb3a5;

    font-size: 13px;

    margin-bottom: 35px;
}


.sidebar nav {

    display: flex;

    flex-direction: column;

    gap: 6px;
}


.sidebar nav a,
.sidebar .logout {

    color: #e9e2d8;

    text-decoration: none;

    padding: 13px 14px;

    border-radius: 10px;

    transition:
        background .2s,
        color .2s;
}


.sidebar nav a:hover,
.sidebar nav a.active {

    background: rgba(255,255,255,.10);

    color: #f4dfb9;
}


.sidebar .logout {

    margin-top: auto;

    color: #d8a49d;
}


/* ================================================================
   MAIN
   ================================================================ */

.admin-main {

    margin-left: 250px;

    width: calc(100% - 250px);

    padding: 45px;

    max-width: 1600px;
}


.page-header {

    margin-bottom: 30px;
}


.page-header h1 {

    margin: 0 0 8px;

    font-size: 36px;

    font-weight: normal;
}


.page-header p {

    margin: 0;

    color: var(--muted);
}


/* ================================================================
   STAT
   ================================================================ */

.stats-grid {

    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(170px, 1fr)
        );

    gap: 18px;

    margin-bottom: 30px;
}


.stat-card {

    background: var(--card);

    border:
        1px solid var(--border);

    border-radius: 18px;

    padding: 22px;

    box-shadow: var(--shadow);
}


.stat-card span {

    display: block;

    font-size: 25px;

    margin-bottom: 10px;
}


.stat-card strong {

    display: block;

    font-size: 32px;

    color: var(--gold-dark);
}


.stat-card small {

    color: var(--muted);
}


/* ================================================================
   CARD
   ================================================================ */

.admin-card {

    background: var(--card);

    border:
        1px solid var(--border);

    border-radius: 20px;

    padding: 28px;

    margin-bottom: 28px;

    box-shadow: var(--shadow);
}


.admin-card h2 {

    margin-top: 0;

    font-weight: normal;
}


.section-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 20px;
}


/* ================================================================
   TABLE
   ================================================================ */

.table-wrapper {

    overflow-x: auto;
}


table {

    width: 100%;

    border-collapse: collapse;
}


th {

    text-align: left;

    color: var(--muted);

    font-size: 13px;

    font-weight: normal;

    padding:
        12px
        10px;

    border-bottom:
        1px solid var(--border);
}


td {

    padding:
        15px
        10px;

    border-bottom:
        1px solid #eee7dc;

    vertical-align: middle;
}


tr:last-child td {

    border-bottom: 0;
}


code {

    background: #f0e9dc;

    padding:
        4px
        8px;

    border-radius: 6px;

    color: var(--gold-dark);

    letter-spacing: 2px;
}


/* ================================================================
   FORM
   ================================================================ */

.admin-form {

    display: flex;

    flex-direction: column;

    gap: 9px;
}


.admin-form label {

    margin-top: 10px;

    color: var(--muted);

    font-size: 14px;
}


.admin-form input,
.admin-form textarea,
.admin-form select {

    width: 100%;

    border:
        1px solid var(--border);

    border-radius: 10px;

    background: #fffefa;

    padding: 12px 14px;

    color: var(--text);

    outline: none;
}


.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus {

    border-color: var(--gold);
}


.form-grid {

    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap: 18px;
}


.form-actions {

    display: flex;

    gap: 10px;

    margin-top: 20px;
}


button,
.small-button,
.secondary-button,
.danger-button {

    border: 0;

    border-radius: 9px;

    padding:
        10px
        15px;

    cursor: pointer;

    text-decoration: none;

    display: inline-block;
}


button {

    background: var(--gold);

    color: white;
}


button:hover {

    background: var(--gold-dark);
}


.small-button {

    background: #e8dcc8;

    color: var(--gold-dark);
}


.secondary-button {

    background: #eee7dc;

    color: var(--text);
}


.danger-button {

    background: #f1d9d5;

    color: #803e37;
}


.action-buttons {

    display: flex;

    flex-wrap: wrap;

    gap: 6px;
}


/* ================================================================
   BADGE
   ================================================================ */

.badge {

    display: inline-block;

    padding:
        5px
        9px;

    border-radius: 99px;

    font-size: 11px;

    font-weight: bold;

    letter-spacing: .5px;
}


.badge.green {

    background: #dce9dc;

    color: #426344;
}


.badge.red {

    background: #f0d9d5;

    color: #843f38;
}


.badge.gray {

    background: #e7e2da;

    color: #665f55;
}


/* ================================================================
   EMPTY
   ================================================================ */

.empty-state {

    padding: 35px;

    text-align: center;

    color: var(--muted);
}


/* ================================================================
   LOGIN
   ================================================================ */

.admin-login-page {

    min-height: 100vh;

    display: grid;

    place-items: center;

    padding: 20px;
}


.login-box {

    width: 100%;

    max-width: 420px;

    background: var(--card);

    padding: 40px;

    border:
        1px solid var(--border);

    border-radius: 22px;

    box-shadow: var(--shadow);

    text-align: center;
}


.admin-logo {

    color: var(--gold);

    font-size: 32px;

    margin-bottom: 10px;
}


.login-box h1 {

    font-weight: normal;

    margin-bottom: 5px;
}


.login-box p {

    color: var(--muted);

    margin-top: 0;

    margin-bottom: 30px;
}


.login-box form {

    text-align: left;
}


.login-box label {

    display: block;

    margin:
        15px
        0
        7px;

    color: var(--muted);
}


.login-box input {

    width: 100%;

    padding: 13px;

    border:
        1px solid var(--border);

    border-radius: 10px;
}


.login-box button {

    width: 100%;

    margin-top: 22px;

    padding: 14px;
}


.alert {

    padding: 12px;

    border-radius: 10px;

    margin-bottom: 20px;
}


.alert.error {

    background: #f1d9d5;

    color: #803e37;
}


/* ================================================================
   MOBILE
   ================================================================ */

@media (max-width: 800px) {

    .sidebar {

        position: static;

        width: 100%;

        min-height: auto;
    }


    .admin-layout {

        display: block;
    }


    .admin-main {

        margin-left: 0;

        width: 100%;

        padding: 22px 15px;
    }


    .sidebar nav {

        flex-direction: row;

        overflow-x: auto;
    }


    .sidebar nav a {

        white-space: nowrap;
    }


    .sidebar .logout {

        margin-top: 20px;
    }


    .form-grid {

        grid-template-columns: 1fr;
    }


    .page-header h1 {

        font-size: 28px;
    }
}