/*
 * Local utility stylesheet (Tailwind-style class names, no CDN, no build step).
 * Replace with a compiled Tailwind CSS file if you prefer a full utility set.
 */
:root {
  color-scheme: dark;
  --bg: #020617;
  --panel: #0f172a;
  --panel-2: #1e293b;
  --line: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-2: #0284c7;
  --danger: #f87171;
  --ok: #4ade80;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px; line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.25; }
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 1rem; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
pre { background: #020617; border: 1px solid var(--line); border-radius: .6rem; padding: 1rem; overflow: auto; font-size: .8rem; }
code { background: #1e293b; padding: .1rem .35rem; border-radius: .25rem; font-size: .9em; }

/* utilities */
.min-h-screen { min-height: 100vh; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.block { display: block; }
.hidden { display: none; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1 1 0%; }
.grow { flex-grow: 1; }
.gap-1 { gap: .35rem; } .gap-2 { gap: .6rem; } .gap-3 { gap: .85rem; }
.gap-4 { gap: 1.1rem; } .gap-6 { gap: 1.5rem; }
.p-3 { padding: .85rem; } .p-4 { padding: 1rem; } .p-6 { padding: 1.5rem; } .p-8 { padding: 2rem; }
.px-2 { padding-left: .6rem; padding-right: .6rem; }
.px-3 { padding-left: .85rem; padding-right: .85rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-1 { padding-top: .25rem; padding-bottom: .25rem; }
.py-2 { padding-top: .5rem; padding-bottom: .5rem; }
.py-3 { padding-top: .85rem; padding-bottom: .85rem; }
.mt-2 { margin-top: .5rem; } .mt-3 { margin-top: .85rem; } .mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; } .mb-2 { margin-bottom: .5rem; } .mb-3 { margin-bottom: .85rem; }
.mb-4 { margin-bottom: 1rem; } .mb-6 { margin-bottom: 1.5rem; }
.w-full { width: 100%; }
.max-w-lg { max-width: 32rem; } .max-w-xl { max-width: 40rem; }
.max-w-3xl { max-width: 52rem; } .max-w-5xl { max-width: 72rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.text-xs { font-size: .75rem; } .text-sm { font-size: .85rem; } .text-lg { font-size: 1.15rem; }
.text-xl { font-size: 1.3rem; } .text-2xl { font-size: 1.75rem; } .text-3xl { font-size: 2.1rem; }
.font-bold { font-weight: 700; } .font-semibold { font-weight: 650; }
.text-slate-100 { color: #f1f5f9; } .text-slate-200 { color: var(--text); }
.text-slate-300 { color: #cbd5e1; } .text-slate-400 { color: var(--muted); }
.text-slate-500 { color: #64748b; } .text-red-400 { color: var(--danger); }
.text-green-400 { color: var(--ok); } .text-sky-400 { color: var(--accent); }
.bg-slate-900 { background: var(--panel); } .bg-slate-950 { background: var(--bg); }
.bg-slate-800 { background: var(--panel-2); }
.rounded { border-radius: .5rem; } .rounded-lg { border-radius: .75rem; }
.text-center { text-align: center; } .text-right { text-align: right; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overflow-x-auto { overflow-x: auto; }
.whitespace-nowrap { white-space: nowrap; }
.relative { position: relative; }
.sticky { position: sticky; } .top-0 { top: 0; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.opacity-70 { opacity: .7; }
.uppercase { text-transform: uppercase; }

/* components */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: .85rem; }
.card-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.card-body { padding: 1.25rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); border-radius: .5rem; padding: .5rem .85rem; font: inherit;
  font-size: .875rem; font-weight: 600; cursor: pointer; line-height: 1.2; }
.btn:hover { background: #334155; text-decoration: none; }
.btn-primary { background: var(--accent-2); border-color: #38bdf8; color: #fff; }
.btn-primary:hover { background: #0369a1; }
.btn-danger { background: #7f1d1d; border-color: #b91c1c; color: #fff; }
.btn-danger:hover { background: #991b1b; }
.btn-sm { padding: .3rem .6rem; font-size: .8rem; }
.input, .select, .textarea { width: 100%; background: #020617; border: 1px solid var(--line); color: var(--text);
  border-radius: .5rem; padding: .55rem .75rem; font: inherit; font-size: .9rem; }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--accent-2); outline-offset: 1px; border-color: var(--accent); }
.textarea { min-height: 90px; resize: vertical; }
.label { display: block; font-size: .8rem; font-weight: 650; color: #cbd5e1; margin-bottom: .35rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.field { min-width: 0; }
.field-full { grid-column: 1 / -1; }
.checkbox-line { display: flex; align-items: center; gap: .5rem; padding-top: 1.3rem; }
.checkbox-line input { width: 1rem; height: 1rem; accent-color: var(--accent-2); }
.checkbox-line label { font-size: .85rem; }
.badge { display: inline-block; padding: .15rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 650; }
.alert { border-radius: .6rem; padding: .85rem 1rem; margin-bottom: 1rem; border: 1px solid; font-size: .9rem; }
.alert-error { background: #450a0a; border-color: #991b1b; color: #fecaca; }
.alert-ok { background: #052e16; border-color: #166534; color: #bbf7d0; }
.alert-info { background: #082f49; border-color: #075985; color: #bae6fd; }

/* table */
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th { text-align: left; color: var(--muted); font-weight: 650; font-size: .75rem; text-transform: uppercase;
  letter-spacing: .05em; padding: .7rem .8rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: .7rem .8rem; border-bottom: 1px solid #1e293b; vertical-align: middle; }
tbody tr:hover { background: #16233a; }
tbody tr:last-child td { border-bottom: 0; }
.empty { padding: 2rem; text-align: center; color: var(--muted); }

/* app shell */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: #0b1220; border-right: 1px solid var(--line); padding: 1.25rem 1rem; display: flex; flex-direction: column; gap: 1.5rem; }
.brand { display: flex; align-items: center; gap: .7rem; font-weight: 800; font-size: 1.15rem; color: #f8fafc; }
.brand-mark { width: 34px; height: 34px; border-radius: .6rem; background: linear-gradient(135deg, #0ea5e9, #4f46e5); display: grid; place-items: center; font-size: 1rem; }
.nav-group-title { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: #64748b; font-weight: 700; margin: 0 0 .4rem .65rem; }
.nav-link { display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; border-radius: .5rem; color: #cbd5e1; font-size: .9rem; margin-bottom: .15rem; }
.nav-link:hover { background: #1e293b; text-decoration: none; color: #fff; }
.nav-link.active { background: #0c4a6e; color: #e0f2fe; font-weight: 650; }
.nav-icon { width: 1.2rem; text-align: center; opacity: .9; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { background: #0b1220; border-bottom: 1px solid var(--line); padding: .85rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.content { padding: 1.5rem; max-width: 1500px; width: 100%; margin: 0 auto; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; }
.stat-card { padding: 1.1rem; }
.stat-label { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 2rem; font-weight: 750; margin-top: .3rem; }
.pagination { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); font-size: 1.4rem; cursor: pointer; }
.login-box { max-width: 430px; margin: 8vh auto; padding: 2rem; }
.doc-list { margin: 0; padding-left: 1.2rem; }
.doc-list li { margin-bottom: .4rem; }
.status-dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; margin-right: .4rem; }
.status-ok { background: var(--ok); } .status-bad { background: var(--danger); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; position: absolute; z-index: 20; width: 260px; height: auto; top: 60px; left: 0; }
  .sidebar.open { display: flex; }
  .nav-toggle { display: block; }
  .content { padding: 1rem; }
  .topbar { padding: .7rem 1rem; }
}
