:root {
    --bg: #080c10;
    --panel: #111821;
    --panel2: #162230;
    --text: #f4f7fb;
    --muted: #98a6b8;
    --line: rgba(255,255,255,.09);
    --turquoise: #28d7d4;
    --red: #ff405c;
    --green: #34d399;
    --orange: #f59e0b;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top left, rgba(40,215,212,.14), transparent 28%), var(--bg);
    color: var(--text);
}
a { color: inherit; text-decoration: none; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar {
    width: 260px;
    background: rgba(13, 19, 27, .96);
    border-right: 1px solid var(--line);
    padding: 20px;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.brand-mark {
    width: 48px; height: 48px; border-radius: 14px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--turquoise), #116a75);
    color: #001114; font-weight: 900;
}
.brand span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.nav { display: grid; gap: 8px; }
.nav a {
    padding: 12px 14px;
    border-radius: 12px;
    color: #dbe6f3;
    background: transparent;
    border: 1px solid transparent;
}
.nav a.active, .nav a:hover { background: rgba(40,215,212,.12); border-color: rgba(40,215,212,.25); }
.nav a.disabled { opacity: .45; cursor: not-allowed; }
.main { margin-left: 260px; width: calc(100% - 260px); min-height: 100vh; }
.topbar {
    height: 72px; display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(8,12,16,.74); backdrop-filter: blur(10px);
    position: sticky; top: 0; z-index: 10;
}
.menu-btn { display: none; }
.content { padding: 24px; max-width: 1280px; margin: 0 auto; }
.logout, .btn {
    border: 0; border-radius: 12px; padding: 10px 14px;
    background: var(--turquoise); color: #001114; font-weight: 800; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn.secondary { background: var(--panel2); color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: var(--red); color: white; }
.btn.small { padding: 7px 10px; border-radius: 9px; font-size: 13px; }
.role-pill { color: var(--turquoise); border: 1px solid rgba(40,215,212,.35); padding: 3px 8px; border-radius: 999px; font-size: 12px; margin-left: 8px; }
h1 { margin: 0 0 18px; font-size: clamp(26px, 4vw, 40px); }
h2 { margin: 0 0 14px; }
.grid { display: grid; gap: 16px; }
.grid.cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
    background: linear-gradient(180deg, rgba(22,34,48,.96), rgba(13,19,27,.96));
    border: 1px solid var(--line); border-radius: 18px; padding: 18px;
    box-shadow: 0 18px 50px rgba(0,0,0,.22);
}
.stat { font-size: 34px; font-weight: 900; color: var(--turquoise); }
.muted { color: var(--muted); }
.alert { border: 1px solid rgba(255,64,92,.35); background: rgba(255,64,92,.12); color: #ffd7de; padding: 12px 14px; border-radius: 14px; margin-bottom: 12px; }
.success { border: 1px solid rgba(52,211,153,.35); background: rgba(52,211,153,.12); color: #cfffe9; padding: 12px 14px; border-radius: 14px; margin-bottom: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-row { display: grid; gap: 7px; }
label { color: #d8e4f1; font-weight: 700; font-size: 14px; }
input, select, textarea {
    width: 100%; border: 1px solid var(--line); background: #0b1219; color: var(--text);
    padding: 12px; border-radius: 12px; outline: none;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--turquoise); box-shadow: 0 0 0 3px rgba(40,215,212,.12); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.table-wrap { overflow-x: auto; border-radius: 16px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; min-width: 760px; background: rgba(13,19,27,.7); }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--turquoise); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; background: rgba(40,215,212,.12); color: var(--turquoise); border: 1px solid rgba(40,215,212,.28); font-size: 12px; font-weight: 800; }
.badge.red { background: rgba(255,64,92,.14); color: #ffacb9; border-color: rgba(255,64,92,.3); }
.badge.green { background: rgba(52,211,153,.14); color: #b9ffe5; border-color: rgba(52,211,153,.3); }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 22px; }
.login-card { width: min(440px, 100%); }
.print-only { display: none; }
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); transition: .2s ease; }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; width: 100%; }
    .menu-btn { display: inline-flex; border: 1px solid var(--line); background: var(--panel2); color: var(--text); border-radius: 10px; padding: 9px 12px; }
    .grid.cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .content { padding: 16px; }
    .topbar { padding: 0 14px; }
    .grid.cards { grid-template-columns: 1fr; }
    .logout { padding: 8px 10px; font-size: 13px; }
}
@media print {
    body { background: white; color: #111; }
    .no-print, .sidebar, .topbar { display: none !important; }
    .main, .content { margin: 0; width: 100%; padding: 0; max-width: none; }
    .card { box-shadow: none; border: 0; padding: 0; background: white; color: #111; }
    table { background: white; color: #111; min-width: 0; font-size: 12px; }
    th { color: #111; }
    th, td { border: 1px solid #999; padding: 7px; }
    .print-only { display: block; }
}
code {
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(0,0,0,.28);
    border: 1px solid var(--line);
    color: var(--turquoise);
}
