:root {
    --bg: #f5f5f5;
    --panel: #ffffff;
    --ink: #1f2937;
    --muted: #4b5563;
    --line: #d1d5db;
    --brand: #006400;
    --brand-2: #004d00;
    --brand-accent: #FFD700;
    --danger: #dc2626;
    --ok: #16a34a;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", "ui-sans-serif", "system-ui", sans-serif;
    color: var(--ink);
    background: radial-gradient(circle at top right, #e8f5e9, var(--bg) 40%);
    display: flex;
    min-height: 100vh;
}

.layout-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 20px 15px;
    box-shadow: 2px 0 10px rgba(10, 79, 112, 0.2);
}

.sidebar .brand {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.3px;
    margin-bottom: 30px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 15px;
}

.sidebar .nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar .nav a {
    color: #e7f6ff;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 15px;
    transition: background 0.3s, border 0.3s;
}

.sidebar .nav a.active,
.sidebar .nav a:hover {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.logout-link {
    margin-top: auto;
    background: rgba(156, 45, 45, 0.8) !important;
}
.logout-link:hover {
    background: rgba(156, 45, 45, 1) !important;
}

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: #fff;
    color: var(--ink);
    padding: 15px 30px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    box-shadow: 0 2px 10px rgba(10, 79, 112, 0.05);
    border-bottom: 1px solid var(--line);
}

.user-info {
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
}

.content-body {
    padding: 30px;
    flex: 1;
    overflow-y: auto;
}

/* Authentication Box */
.auth-box {
    max-width: 400px;
    margin: 60px auto;
    background: var(--panel);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.auth-box h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--brand);
}

.container {
    width: 100%;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 5px 12px rgba(17, 43, 60, 0.06);
}

.card h3 {
    margin: 0 0 8px;
    font-size: 15px;
    color: var(--muted);
}

.card .value {
    font-size: 28px;
    font-weight: 700;
}

h1 {
    margin-top: 0;
}

form,
.table-wrap {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}

fieldset {
    border: 1px solid var(--line);
    border-radius: 10px;
    margin: 0 0 14px;
    padding: 10px;
}

legend {
    font-weight: 600;
}

.row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 4px;
}

input,
select,
button,
textarea {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--line);
    padding: 9px 10px;
    font: inherit;
}

button {
    background: var(--brand);
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

button:hover {
    opacity: 0.95;
}

.btn-danger {
    background: #dc2626;
    color: #fff;
    border: 1px solid #b91c1c;
    padding: 6px 12px;
    border-radius: 999px;
    width: auto;
    font-size: 13px;
}

.btn-danger:hover {
    background: #b91c1c;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 8px;
    text-align: left;
}

th {
    background: #f0f6fa;
}

.msg {
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.msg.ok {
    background: #e8f8ee;
    color: var(--ok);
    border: 1px solid #b8e2c7;
}

.msg.err {
    background: #fdeeee;
    color: var(--danger);
    border: 1px solid #f2c3c3;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.note {
    color: var(--muted);
    font-size: 13px;
}
