:root {
    --bg: #f7f7f8;
    --card: #ffffff;
    --text: #202124;
    --muted: #666;
    --primary: #9a5a22;
    --primary-dark: #6f3d12;
    --border: #e3e3e3;
    --danger: #b42318;
    --success: #067647;
    --warning: #b54708;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.topbar {
    background: #2f2118;
    color: white;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand a {
    color: white;
    font-weight: bold;
    font-size: 18px;
}

.nav {
    display: flex;
    gap: 12px;
    align-items: center;
}

.nav a {
    color: white;
    padding: 8px 10px;
    border-radius: 8px;
}

.nav a:hover {
    background: rgba(255,255,255,.12);
    text-decoration: none;
}

.menu-toggle {
    display: none;
    border: 1px solid rgba(255,255,255,.5);
    background: transparent;
    color: white;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 18px;
}

.container {
    max-width: 1180px;
    margin: 24px auto;
    padding: 0 16px;
}

.footer {
    text-align: center;
    color: var(--muted);
    padding: 32px 16px;
}

h1 {
    margin-top: 0;
    font-size: 26px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: 0 3px 12px rgba(0,0,0,.04);
}

.grid {
    display: grid;
    gap: 16px;
}

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

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

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.btn {
    display: inline-block;
    border: none;
    background: var(--primary);
    color: white;
    padding: 9px 13px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 14px;
}

.btn:hover {
    background: var(--primary-dark);
    color: white;
    text-decoration: none;
}

.btn.secondary {
    background: #4b5563;
}

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

.btn.light {
    background: #ece7e1;
    color: #2f2118;
}

form {
    margin: 0;
}

.form-row {
    margin-bottom: 14px;
}

label {
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
}

input, select, textarea {
    width: 100%;
    padding: 10px 11px;
    border: 1px solid var(--border);
    border-radius: 9px;
    font-size: 15px;
    background: white;
}

textarea {
    min-height: 90px;
}

.table-wrap {
    overflow-x: auto;
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

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

th {
    background: #f1ece7;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

tr:last-child td {
    border-bottom: none;
}

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 18px;
}

.alert-success {
    background: #ecfdf3;
    color: var(--success);
    border: 1px solid #abefc6;
}

.alert-error {
    background: #fef3f2;
    color: var(--danger);
    border: 1px solid #fecdca;
}

.alert-warning {
    background: #fffaeb;
    color: var(--warning);
    border: 1px solid #fedf89;
}

.muted {
    color: var(--muted);
}

.kpi {
    font-size: 24px;
    font-weight: bold;
}

.login-box {
    max-width: 420px;
    margin: 8vh auto;
}

@media (max-width: 760px) {
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }

    .menu-toggle {
        display: block;
    }

    .nav {
        display: none;
        position: absolute;
        top: 58px;
        left: 0;
        right: 0;
        background: #2f2118;
        padding: 10px 18px 16px;
        flex-direction: column;
        align-items: stretch;
    }

    body.menu-open .nav {
        display: flex;
    }

    .container {
        margin: 16px auto;
    }

    h1 {
        font-size: 22px;
    }
}
