/* =========================================
   1. Variables & Base Styles
   ========================================= */
:root {
    --bg: #070809;
    --panel: #0d0f11;
    --panel2: #111417;
    --line: rgba(255, 255, 255, .08);
    --muted: #8b929b;
    --text: #f5f7f8;
    --brand: #b7f34a;
    --danger: #ff5c6c;
    --warn: #ffc857;
    --blue: #66a3ff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: radial-gradient(circle at 80% -10%, rgba(183, 243, 74, .08), transparent 30%), var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input, textarea, select {
    font: inherit;
}

button {
    cursor: pointer;
}

/* =========================================
   2. Main Layout (Sidebar & Topbar)
   ========================================= */
.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    position: fixed;
    inset: 0 auto 0 0;
    background: rgba(8, 9, 10, .92);
    border-right: 1px solid var(--line);
    backdrop-filter: blur(18px);
    padding: 18px 14px;
    z-index: 40;
}

.main {
    margin-left: 250px;
    width: calc(100% - 250px);
    min-width: 0;
}

.topbar {
    height: 72px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(7, 8, 9, .75);
    backdrop-filter: blur(18px);
}

.content {
    padding: 28px;
    max-width: 1500px;
    margin: auto;
}

/* =========================================
   3. Navigation & Branding
   ========================================= */
.brand {
    padding: 10px 12px 22px;
    font-weight: 900;
    letter-spacing: -.04em;
    font-size: 18px;
}

.brand span {
    color: var(--brand);
}

.nav-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: #59616a;
    padding: 12px;
}

.nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 12px;
    border-radius: 12px;
    color: #aeb5bc;
    font-size: 13px;
    margin: 2px 0;
}

.nav a:hover, 
.nav a.active {
    background: rgba(183, 243, 74, .08);
    color: #fff;
}

.nav a.active:before {
    content: "";
    width: 3px;
    height: 17px;
    border-radius: 5px;
    background: var(--brand);
    margin-left: -12px;
}

/* =========================================
   4. Typography & Text Utilities
   ========================================= */
.eyebrow {
    color: #68717a;
    text-transform: uppercase;
    letter-spacing: .16em;
    font-size: 10px;
    font-weight: 800;
}

.title {
    font-size: 32px;
    line-height: 1.1;
    letter-spacing: -.04em;
    font-weight: 850;
    margin: 5px 0;
}

.subtitle {
    color: var(--muted);
    font-size: 13px;
}

.muted { color: var(--muted); }
.green { color: var(--brand); }
.red   { color: var(--danger); }
.yellow{ color: var(--warn); }
.blue  { color: var(--blue); }

/* =========================================
   5. Grid & Containers
   ========================================= */
.grid { display: grid; gap: 16px; }
.stats { grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 24px 0; }
.two { grid-template-columns: 1.6fr 1fr; }
.three { grid-template-columns: repeat(3, 1fr); }

.card {
    background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .018));
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .18);
}

.panel { padding: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.panel-title { font-weight: 800; font-size: 15px; }

/* =========================================
   6. UI Components (Stats, Badges, Buttons)
   ========================================= */
.stat { padding: 18px; }
.stat .label { font-size: 11px; color: #737c85; }
.stat .value { font-size: 25px; font-weight: 850; margin-top: 9px; letter-spacing: -.03em; }
.delta { font-size: 11px; color: #9aa2aa; margin-top: 8px; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.badge:before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-green { color: var(--brand); background: rgba(183, 243, 74, .09); }
.badge-red { color: var(--danger); background: rgba(255, 92, 108, .08); }
.badge-yellow { color: var(--warn); background: rgba(255, 200, 87, .08); }
.badge-blue { color: var(--blue); background: rgba(102, 163, 255, .08); }

.btn {
    border: 1px solid var(--line);
    background: #15181b;
    color: #fff;
    border-radius: 11px;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 750;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.btn:hover { background: #1b1f22; }
.btn-primary { background: var(--brand); color: #050605; border-color: transparent; }
.btn-primary:hover { background: #c9ff6d; }
.btn-danger { background: rgba(255, 92, 108, .1); color: #ff8490; border-color: rgba(255, 92, 108, .2); }

/* =========================================
   7. Forms, Tables & Data Display
   ========================================= */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.input {
    background: #0a0c0e;
    border: 1px solid var(--line);
    color: #fff;
    border-radius: 11px;
    padding: 10px 12px;
    outline: none;
    width: 100%;
}
.input:focus { border-color: rgba(183, 243, 74, .5); box-shadow: 0 0 0 3px rgba(183, 243, 74, .06); }

label { display: block; font-size: 11px; color: #89919a; margin-bottom: 7px; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }

.table-wrap { overflow: auto; }
.table { width: 100%; border-collapse: collapse; min-width: 720px; }
.table th { text-align: left; color: #68717a; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.table td { padding: 14px; border-bottom: 1px solid rgba(255, 255, 255, .05); font-size: 13px; color: #d8dde1; }
.table tr:hover td { background: rgba(255, 255, 255, .018); }

.metric { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); }
.metric:last-child { border: 0; }

.progress { height: 6px; background: #1a1d20; border-radius: 9px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--brand); border-radius: 9px; }

.chart { height: 250px; display: flex; align-items: end; gap: 8px; padding: 18px 4px 5px; }
.bar { flex: 1; min-width: 10px; border-radius: 7px 7px 2px 2px; background: linear-gradient(180deg, #c9ff6d, #6d9e25); opacity: .9; }
.bar:hover { filter: brightness(1.15); }

/* =========================================
   8. Misc Utilities & Auth Pages
   ========================================= */
.empty { padding: 45px 20px; text-align: center; color: #69717a; }
.avatar { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: #1b2024; border: 1px solid var(--line); font-weight: 800; font-size: 12px; }
.userbox { display: flex; gap: 10px; align-items: center; }
.mobile-btn { display: none; }
.flash { margin-bottom: 16px; padding: 12px 14px; border-radius: 12px; background: rgba(183, 243, 74, .08); border: 1px solid rgba(183, 243, 74, .18); color: #c9ff6d; font-size: 13px; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 10%, rgba(183, 243, 74, .1), transparent 30%), #070809; }
.login-card { width: min(430px, 100%); padding: 30px; }
.logo-big { font-size: 22px; font-weight: 900; letter-spacing: -.05em; }
.login-card h1 { font-size: 32px; letter-spacing: -.04em; margin: 30px 0 6px; }
.stack > * + * { margin-top: 14px; }

/* =========================================
   9. Media Queries (Responsive Design)
   ========================================= */
@media (max-width: 1100px) {
    .stats { grid-template-columns: repeat(3, 1fr); }
    .two { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .sidebar { transform: translateX(-100%); transition: .2s; }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; width: 100%; }
    .mobile-btn { display: inline-flex; }
    .topbar { padding: 0 16px; }
    .content { padding: 20px 14px; }
    .stats, .three, .form-grid { grid-template-columns: 1fr 1fr; }
    .title { font-size: 26px; }
}

@media (max-width: 520px) {
    .stats, .three, .form-grid { grid-template-columns: 1fr; }
    .topbar { height: 62px; }
    .card { border-radius: 15px; }
}