@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --forest: #0f3d2e;
    --forest-dark: #0a2c21;
    --gold: #c99a3f;
    --gold-light: #fbf3e2;
    --green: #16a34a;
    --green-light: #f0fdf4;
    --red: #dc2626;
    --red-light: #fef2f2;
    --ink: #1e1e1c;
    --muted: #6b7280;
    --border: #e9e7e1;
    --bg: #f5f4f0;
    --card: #ffffff;
    --radius: 14px;
    --sidebar-w: 220px;
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

.app { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: var(--forest);
    color: #fff;
    padding: 22px 14px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
}
.sidebar .brand { font-size: 15px; font-weight: 700; line-height: 1.3; padding: 0 8px 22px; letter-spacing: -0.2px; }
.sidebar nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.sidebar nav a {
    display: flex; align-items: center; gap: 10px;
    color: rgba(255,255,255,0.72);
    text-decoration: none;
    font-size: 14px; font-weight: 600;
    padding: 10px 12px;
    border-radius: 9px;
    transition: background .15s ease, color .15s ease;
}
.sidebar nav a i { font-size: 17px; }
.sidebar nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar nav a.active { background: var(--gold); color: var(--forest-dark); }
.sidebar .logout {
    display: flex; align-items: center; gap: 10px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 13px; font-weight: 600;
    padding: 10px 12px;
    border-top: 1px solid rgba(255,255,255,0.12);
    margin-top: 12px;
}
.sidebar .logout i { font-size: 16px; }
.sidebar .logout:hover { color: #fff; }

.content { flex: 1; min-width: 0; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 30px 32px 60px; }

h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.4px; margin-bottom: 18px; color: var(--ink); }
h3 { font-size: 15px; font-weight: 700; color: var(--ink); }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: 0 1px 2px rgba(16,24,40,0.04);
    margin-bottom: 22px;
}

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); gap: 14px; }

.stat {
    text-align: left;
    background: #fafaf8;
    border: 1px solid var(--border);
    border-left: 3px solid var(--forest);
    border-radius: 0 10px 10px 0;
    padding: 14px 16px;
}
.stat .label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.stat .value { font-size: 21px; font-weight: 800; margin-top: 6px; letter-spacing: -0.4px; }
.stat.gold { border-left-color: var(--gold); }
.stat.green { border-left-color: var(--green); }
.stat.green .value { color: var(--green); }
.stat.red { border-left-color: var(--red); }
.stat.red .value { color: var(--red); }

.tabs-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs-filter a {
    font-size: 13px; font-weight: 600; text-decoration: none;
    color: var(--muted); background: #fafaf8; border: 1px solid var(--border);
    padding: 7px 14px; border-radius: 999px;
}
.tabs-filter a.active { background: var(--forest); color: #fff; border-color: var(--forest); }
.tabs-filter a:hover:not(.active) { border-color: var(--gold); color: var(--ink); }

.note-badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; font-weight: 600; color: var(--gold-light);
    background: var(--forest); padding: 4px 10px; border-radius: 999px;
    margin-bottom: 8px;
}
.note-list { display: flex; flex-direction: column; gap: 6px; }
.note-item { font-size: 13px; color: var(--ink); background: var(--gold-light); border-left: 3px solid var(--gold); border-radius: 0 8px 8px 0; padding: 8px 12px; }
.note-item .d { font-weight: 700; margin-right: 6px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); }
th { background: #fafaf8; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); }
tr:hover td { background: #fafaf8; }
td a { color: var(--forest); font-weight: 600; text-decoration: none; font-size: 13px; }
td a:hover { text-decoration: underline; }

form label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #374151; }
form input, form select, form textarea {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 14px;
    border: 1.5px solid var(--border);
    border-radius: 9px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    transition: border-color .15s ease;
}
form input:focus-visible, form select:focus-visible, form textarea:focus-visible {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201,154,63,0.25);
}

a:focus-visible, button:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

button, .btn {
    background: var(--forest);
    color: #fff;
    border: none;
    padding: 11px 20px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background .15s ease, transform .1s ease;
}
button:hover, .btn:hover { background: var(--forest-dark); transform: translateY(-1px); }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--forest); }
.login-box { max-width: 380px; width: 100%; padding: 36px; background: #fff; border-radius: 16px; }
.login-box .brand { text-align: center; font-weight: 800; font-size: 18px; margin-bottom: 22px; color: var(--forest); }

.msg-error { background: var(--red-light); color: var(--red); padding: 12px 14px; border-radius: 9px; margin-bottom: 16px; font-size: 14px; font-weight: 600; border: 1px solid #fecaca; }
.msg-ok { background: var(--green-light); color: #166534; padding: 12px 14px; border-radius: 9px; margin-bottom: 16px; font-size: 14px; font-weight: 600; border: 1px solid #bbf7d0; }

@media (max-width: 780px) {
    .app { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; }
    .sidebar .brand { padding: 0 10px 0 0; font-size: 13px; }
    .sidebar nav { flex-direction: row; flex-wrap: wrap; }
    .sidebar .logout { border-top: none; margin-top: 0; padding: 8px 10px; }
    .wrap { padding: 20px 16px 40px; }
}
