:root {
    --lime: #c6f135;
    --lime-dark: #a8d420;
    --dark: #14150f;
    --dark-2: #1b1c15;
    --bg: #f3f3ef;
    --card: #ffffff;
    --text-dark: #14150f;
    --text-muted: #8b8d80;
    --border: #eaeae4;
    --positive: #3aa655;
    --negative: #e0563f;
    --radius-lg: 22px;
    --radius-md: 14px;
    --shadow: 0 10px 30px rgba(20, 21, 15, 0.06);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg);
    color: var(--text-dark);
}

/* ---------- LOGIN ---------- */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top left, #1f2117 0%, #0c0d08 70%);
}

.login-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 44px 40px;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow);
}

.login-logo {
    font-weight: 800;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-dot {
    width: 12px;
    height: 12px;
    border-radius: 4px;
    background: var(--lime);
    display: inline-block;
}

.login-sub {
    color: var(--text-muted);
    font-size: 14px;
    margin: 6px 0 28px;
}

.login-form { display: flex; flex-direction: column; gap: 6px; }
.login-form label { font-size: 13px; font-weight: 600; margin-top: 10px; }
.login-form input {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg);
    font-family: inherit;
    font-size: 14px;
    outline: none;
}
.login-form input:focus { border-color: var(--lime-dark); }

.btn-primary {
    margin-top: 20px;
    background: var(--dark);
    color: var(--lime);
    border: none;
    padding: 13px 20px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease;
}
.btn-primary:hover { background: #23241a; transform: translateY(-1px); }
.btn-block { width: 100%; }

.alert-error {
    background: #fdeceb;
    color: var(--negative);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    margin-bottom: 16px;
}

/* ---------- LAYOUT ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 250px;
    background: var(--dark);
    color: #d9dacd;
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-shrink: 0;
}

.brand {
    color: #fff;
    font-weight: 800;
    font-size: 17px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 40px;
}
.brand-accent { color: var(--lime); }

.nav-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #6c6e60;
    font-weight: 700;
    display: block;
    margin-bottom: 12px;
}

.nav-menu { display: flex; flex-direction: column; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: var(--radius-md);
    color: #b6b7a8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}
.nav-item svg {
    width: 18px; height: 18px;
    fill: none; stroke: currentColor; stroke-width: 1.8;
    stroke-linecap: round; stroke-linejoin: round;
}
.nav-item.active { background: rgba(198, 241, 53, 0.12); color: var(--lime); }
.nav-item:hover { color: #fff; }

.sidebar-footer { display: flex; flex-direction: column; gap: 14px; }

.user-chip { display: flex; align-items: center; gap: 10px; }
.user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--lime); color: var(--dark);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 14px;
}
.user-name { font-size: 13px; font-weight: 700; color: #fff; }
.user-role { font-size: 11px; color: #7d7f6f; }

.logout-link {
    font-size: 13px; color: #8f9182; text-decoration: none;
    border-top: 1px solid #2a2b21; padding-top: 14px;
}
.logout-link:hover { color: var(--lime); }

/* ---------- MAIN ---------- */
.main { flex: 1; padding: 32px 40px 60px; max-width: 1200px; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}
.topbar h1 { margin: 0; font-size: 26px; }
.topbar-sub { margin: 4px 0 0; color: var(--text-muted); font-size: 14px; }

/* ---------- CARDS ---------- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
}
.card-dark { background: var(--dark); color: #fff; }
.card-dark .card-label { color: #9a9c8c; }

.card-icon { font-size: 18px; }
.card-label {
    font-size: 12.5px;
    color: var(--text-muted);
    margin: 12px 0 4px;
    font-weight: 600;
}
.card-value { margin: 0; font-size: 22px; font-weight: 800; }
.card-tag {
    display: inline-block;
    margin-top: 10px;
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(198, 241, 53, 0.18);
    color: var(--lime-dark);
}
.card-dark .card-tag { background: rgba(198, 241, 53, 0.16); color: var(--lime); }
.card-tag.muted { background: #f1f1ea; color: var(--text-muted); }
.card-tag.positive { background: #e6f6ea; color: var(--positive); }
.card-tag.negative { background: #fdeceb; color: var(--negative); }
.positive { color: var(--positive) !important; }
.negative { color: var(--negative) !important; }

/* ---------- PANELS ---------- */
.panel {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 22px;
}
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.panel-header h3 { margin: 0; font-size: 16px; }
.panel-sub { margin: 2px 0 0; font-size: 12.5px; color: var(--text-muted); }

.empty-state {
    text-align: center;
    padding: 40px 10px;
    color: var(--text-muted);
    font-size: 14px;
}

/* ---------- TABLE ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}
tbody td { padding: 12px; border-bottom: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: none; }

.pill {
    padding: 3px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
}
.pill-positive { background: #e6f6ea; color: var(--positive); }
.pill-negative { background: #fdeceb; color: var(--negative); }

.btn-ghost-danger {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--negative);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
}
.btn-ghost-danger:hover { background: #fdeceb; }

/* ---------- MODAL ---------- */
.modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(20, 21, 15, 0.5);
    align-items: center; justify-content: center;
    z-index: 50;
}
.modal-overlay.open { display: flex; }

.modal {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 26px 28px 30px;
    width: 100%;
    max-width: 380px;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-header h3 { margin: 0; font-size: 17px; }
.modal-close {
    background: none; border: none; font-size: 22px;
    cursor: pointer; color: var(--text-muted); line-height: 1;
}

.modal-form { display: flex; flex-direction: column; gap: 4px; }
.modal-form label { font-size: 13px; font-weight: 600; margin-top: 12px; }
.modal-form .optional { color: var(--text-muted); font-weight: 400; }
.modal-form input {
    padding: 11px 13px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg);
    font-family: inherit;
    font-size: 14px;
    outline: none;
}
.modal-form input:focus { border-color: var(--lime-dark); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 880px) {
    .layout { flex-direction: column; }
    .sidebar { width: 100%; flex-direction: row; align-items: center; padding: 16px 20px; }
    .sidebar-footer { display: none; }
    .nav-menu { flex-direction: row; margin-left: auto; }
    .nav-label { display: none; }
    .main { padding: 24px 18px 50px; }
    .topbar { flex-direction: column; align-items: flex-start; gap: 14px; }
}
