:root {
    --bg: #020617;
    --panel: #0b1220;
    --card: #111827;
    --card-2: #0f172a;
    --border: #1e293b;
    --blue: #2563eb;
    --blue-2: #3b82f6;
    --text: #f8fafc;
    --muted: #94a3b8;
    --green: #22c55e;
    --red: #ef4444;
    --yellow: #f59e0b;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, .22), transparent 35%),
        linear-gradient(135deg, #020617, #0b1220 55%, #0f172a);
    color: var(--text);
    min-height: 100vh;
}

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

.sidebar {
    width: 250px;
    background: rgba(15, 23, 42, .92);
    border-right: 1px solid var(--border);
    padding: 22px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand { display: grid; gap: 12px; align-items: center; margin-bottom: 30px; }
.brand-logo {
    width: 100%;
    height: 116px;
    border-radius: 10px;
    object-fit: contain;
    background: #020617;
    border: 1px solid var(--border);
    padding: 8px;
    box-shadow: 0 15px 35px rgba(37, 99, 235, .18);
}
.brand strong { display: block; font-size: 15px; line-height: 1.2; max-width: 190px; }
.brand span { display: block; font-size: 12px; margin-top: 2px; }
.brand span, .sidebar-footer small, .topbar p { color: var(--muted); }

.nav { display: grid; gap: 10px; }
.nav a {
    color: var(--muted);
    text-decoration: none;
    padding: 11px 13px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 14px;
}
.nav a:hover, .nav a.active {
    color: var(--text);
    background: rgba(37, 99, 235, .16);
    border-color: rgba(59, 130, 246, .35);
}

.sidebar-footer { margin-top: auto; color: var(--text); display: grid; gap: 3px; font-size: 14px; }

.main { flex: 1; padding: 26px 34px; overflow: auto; }
.topbar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 22px;
}
.topbar h1 { margin: 0; font-size: 25px; line-height: 1.2; }
.topbar p { margin: 6px 0 0; font-size: 14px; }
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
code { color: #bfdbfe; }

.cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.card, .panel {
    background: rgba(17, 24, 39, .92);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0,0,0,.18);
}
.card { padding: 17px 18px; }
.card span { color: var(--muted); font-size: 13px; }
.card strong { display: block; font-size: 25px; margin-top: 7px; line-height: 1; }

.panel { overflow: hidden; }
.panel-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}
.panel-head h2 { margin: 0; font-size: 16px; }

.search {
    background: #020617;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    min-width: 260px;
    font-size: 13px;
}

table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 18px; border-bottom: 1px solid var(--border); text-align: left; font-size: 14px; }
th { color: var(--muted); font-size: 12px; background: rgba(15, 23, 42, .7); }
td { color: #e5e7eb; }
tr:hover td { background: rgba(37, 99, 235, .06); }

.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    border: 1px solid var(--border);
}
.badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: currentColor;
}
.badge.active { color: var(--green); background: rgba(34, 197, 94, .1); }
.badge.inactive { color: var(--red); background: rgba(239, 68, 68, .1); }
.badge.role { color: #bfdbfe; background: rgba(37, 99, 235, .12); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 13px;
    border-radius: 10px;
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
}
.btn-primary { background: var(--blue); color: white; }
.btn-primary:hover { background: var(--blue-2); }
.btn-muted { background: #1e293b; color: var(--text); border-color: var(--border); }
.btn-danger { background: rgba(239, 68, 68, .12); color: #fca5a5; border-color: rgba(239, 68, 68, .35); }
.btn-success { background: rgba(34, 197, 94, .12); color: #86efac; border-color: rgba(34, 197, 94, .35); }
.btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.form-card {
    max-width: 760px;
    padding: 20px;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.form-group { display: grid; gap: 8px; }
.form-group.full { grid-column: 1 / -1; }
label { color: #cbd5e1; font-weight: 700; font-size: 13px; }
input, select {
    width: 100%;
    background: #020617;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
}
.form-actions { margin-top: 20px; display: flex; gap: 10px; }

.login-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 20px;
    background:
        linear-gradient(rgba(2, 6, 23, .18), rgba(2, 6, 23, .48)),
        url("img/logo.jpg") center / min(1920px, 100vw) auto no-repeat,
        radial-gradient(circle at top right, rgba(37, 99, 235, .22), transparent 35%),
        linear-gradient(135deg, #020617, #0b1220 55%, #0f172a);
}
.login-box {
    width: 100%; max-width: 370px;
    position: relative;
    overflow: hidden;
    background: rgba(17, 24, 39, .78);
    backdrop-filter: blur(2px);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 30px 80px rgba(0,0,0,.42);
}
.login-box h1 { margin: 0; font-size: 22px; line-height: 1.2; }
.login-box p { color: var(--muted); margin-bottom: 20px; font-size: 13px; }
.alert {
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 14px;
    border: 1px solid rgba(239, 68, 68, .35);
    color: #fecaca;
    background: rgba(239, 68, 68, .1);
    font-size: 13px;
}
.alert-success {
    color: #bbf7d0;
    background: rgba(34, 197, 94, .1);
    border-color: rgba(34, 197, 94, .35);
}

@media (max-width: 900px) {
    .app-shell { display: block; }
    .sidebar { width: 100%; height: auto; position: static; }
    .cards { grid-template-columns: repeat(2, 1fr); }
    .topbar, .panel-head { align-items: flex-start; flex-direction: column; }
    .search { width: 100%; min-width: 0; }
    .table-wrap { overflow-x: auto; }
}

@media (max-width: 560px) {
    .cards, .form-grid { grid-template-columns: 1fr; }
    .main { padding: 18px; }
}
