/*! OS VALIDADOR — dark modern UI */
:root {
  --bg0: #070809;
  --bg1: #0d0f12;
  --bg2: #14171c;
  --card: #12151a;
  --line: rgba(255,255,255,.08);
  --line2: rgba(255,255,255,.14);
  --text: #f3f5f7;
  --muted: #9aa3ad;
  --accent: #3b82f6;
  --accent2: #60a5fa;
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --radius: 16px;
  --shadow: 0 20px 50px rgba(0,0,0,.45);
  --glow: 0 0 40px rgba(59,130,246,.18);
  font-family: "Segoe UI", Inter, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--text);
  background:
    radial-gradient(900px 480px at 12% -10%, rgba(59,130,246,.18), transparent 55%),
    radial-gradient(700px 420px at 90% 10%, rgba(16,185,129,.08), transparent 50%),
    linear-gradient(180deg, var(--bg0), var(--bg1) 40%, #080a0c);
}
a { color: var(--accent2); text-decoration: none; }
a:hover { color: #fff; }

.shell { display: flex; min-height: 100vh; }
.side {
  width: 248px;
  padding: 26px 18px;
  background: linear-gradient(180deg, #0a0c10, #10141a);
  border-right: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.side::before {
  content: "";
  position: absolute; inset: -20% auto auto -30%;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(59,130,246,.25), transparent 70%);
  pointer-events: none;
}
.brand {
  font-size: 1.15rem; font-weight: 750; letter-spacing: .2px;
  margin-bottom: 28px; position: relative;
}
.brand small {
  display: block; margin-top: 6px; color: var(--muted); font-weight: 500; font-size: .78rem;
}
.side nav a {
  display: flex; align-items: center; gap: 10px;
  color: #c9d1d9; padding: 11px 12px; border-radius: 12px;
  margin-bottom: 6px; border: 1px solid transparent;
  transition: .2s ease;
}
.side nav a:hover, .side nav a.active {
  background: rgba(59,130,246,.12);
  border-color: rgba(59,130,246,.28);
  color: #fff;
  text-decoration: none;
  box-shadow: var(--glow);
}
.main { flex: 1; padding: 28px 32px 48px; }
.topbar h1 {
  margin: 0 0 6px;
  font-size: 1.55rem;
  letter-spacing: -.02em;
}
.topbar .sub { color: var(--muted); margin-bottom: 18px; }

.card {
  background: linear-gradient(180deg, rgba(255,255,255,.03), transparent 40%), var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 16px;
  animation: rise .45s ease both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: 1.2fr .9fr; }
@media (max-width: 980px) {
  .shell { display: block; }
  .side { width: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .grid.cols-2 { grid-template-columns: 1fr; }
  .main { padding: 18px 16px 36px; }
}

label { display: block; font-size: .86rem; color: var(--muted); margin: 12px 0 7px; }
input[type=text], input[type=password], input[type=file], select, textarea {
  width: 100%;
  color: var(--text);
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: 12px;
  padding: 11px 12px;
  outline: none;
  transition: .2s ease;
}
textarea {
  min-height: 180px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9rem;
  line-height: 1.45;
}
input:focus, textarea:focus, select:focus {
  border-color: rgba(59,130,246,.7);
  box-shadow: 0 0 0 3px rgba(59,130,246,.18);
}

.btn, button {
  font: inherit; font-weight: 650;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 16px;
  cursor: pointer;
  transition: .18s ease;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn.primary, button.primary, button[type=submit] {
  background: linear-gradient(180deg, #4f8cff, var(--accent));
  color: #fff;
  box-shadow: 0 8px 24px rgba(59,130,246,.28);
}
.btn.primary:hover, button.primary:hover, button[type=submit]:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}
.btn.ghost, button.ghost, .btn.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--line2);
}
.btn.ghost:hover, button.ghost:hover, .btn.secondary:hover {
  background: rgba(255,255,255,.04);
  text-decoration: none;
  color: #fff;
}
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }

.flash {
  padding: 11px 13px; border-radius: 12px; margin-bottom: 12px;
  border: 1px solid; animation: rise .35s ease both;
}
.flash.ok { background: rgba(52,211,153,.1); border-color: rgba(52,211,153,.35); color: var(--ok); }
.flash.warn { background: rgba(251,191,36,.1); border-color: rgba(251,191,36,.35); color: var(--warn); }
.flash.error { background: rgba(248,113,113,.1); border-color: rgba(248,113,113,.35); color: var(--err); }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .86rem; }

.pill {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: .72rem; font-weight: 750; letter-spacing: .04em;
  background: rgba(59,130,246,.18); color: #93c5fd;
}
.pill.off { background: rgba(255,255,255,.08); color: #aab2bb; }
.pill.err { background: rgba(248,113,113,.15); color: #fca5a5; }
.pill.run { background: rgba(96,165,250,.15); color: #93c5fd; }
.pill.ok, .pill:not(.off):not(.err):not(.run) { }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { border-bottom: 1px solid var(--line); padding: 10px 6px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }

/* Dropzone */
.dropzone {
  border: 1.5px dashed rgba(255,255,255,.18);
  border-radius: 16px;
  padding: 28px 18px;
  text-align: center;
  background: rgba(255,255,255,.02);
  transition: .2s ease;
  cursor: pointer;
  position: relative;
}
.dropzone:hover, .dropzone.dragover {
  border-color: rgba(59,130,246,.65);
  background: rgba(59,130,246,.08);
  box-shadow: var(--glow);
}
.dropzone strong { display: block; font-size: 1.02rem; margin-bottom: 6px; }
.dropzone input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}
.hint {
  margin-top: 10px; font-size: .86rem; color: var(--muted); line-height: 1.45;
}
.codebox {
  background: #0a0c10; border: 1px solid var(--line);
  color: #dbe4ee; padding: 12px 14px; border-radius: 12px;
  overflow: auto; font-family: ui-monospace, monospace; font-size: 12.5px; line-height: 1.45;
}
.check {
  display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; margin-top: 12px;
}
.check input { width: auto; }

/* Login */
.login-body {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(700px 420px at 20% 0%, rgba(59,130,246,.22), transparent 60%),
    radial-gradient(600px 380px at 90% 80%, rgba(16,185,129,.12), transparent 55%),
    #050607;
}
.login-card {
  width: min(420px, 94vw);
  background: linear-gradient(180deg, rgba(255,255,255,.04), transparent 35%), #10131a;
  border: 1px solid var(--line2);
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: var(--shadow), var(--glow);
  animation: rise .5s ease both;
}
.login-card h1 { margin: 0 0 6px; font-size: 1.45rem; }
.login-card .muted { margin-bottom: 8px; }

.stat-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.stat {
  flex: 1; min-width: 110px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}
.stat b { display: block; font-size: 1.2rem; }
.stat span { color: var(--muted); font-size: .78rem; }
