:root {
  --bg: #0b1220;
  --card: #152238;
  --border: #2a3b55;
  --text: #e8eef8;
  --muted: #8fa3bf;
  --accent: #1d8cff;
  --green: #16a34a;
  --red: #dc2626;
  --yellow: #ca8a04;
  --orange: #ea580c;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(900px 500px at 0% 0%, #1a3358 0%, transparent 55%),
    radial-gradient(800px 400px at 100% 10%, #12263f 0%, transparent 50%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}
.wrap { max-width: 920px; margin: 0 auto; padding: 20px 14px 56px; }
.wrap.narrow { max-width: 420px; }
h1 { margin: 0 0 4px; font-size: 1.45rem; }
h2 { margin: 0 0 12px; font-size: 1.1rem; }
.sub { color: var(--muted); margin: 0 0 18px; font-size: 0.95rem; }
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  margin-bottom: 16px;
}
.nav a { color: var(--accent); text-decoration: none; font-size: 0.9rem; }
.nav .spacer { flex: 1; }
.nav .user { color: var(--muted); font-size: 0.85rem; }
.card {
  background: color-mix(in srgb, var(--card) 94%, transparent);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}
label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 5px; }
input[type="text"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0d1626;
  color: var(--text);
  font-size: 1rem;
}
.field { margin-bottom: 12px; }
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: end;
}
.row-3 { grid-template-columns: 1fr 1fr auto; }
@media (max-width: 700px) {
  .row, .row-3 { grid-template-columns: 1fr; }
}
button, .btn {
  display: inline-block;
  padding: 11px 16px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 650;
  cursor: pointer;
  font-size: 0.95rem;
  text-decoration: none;
  text-align: center;
}
button:disabled, .btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost { background: #334155; }
.btn-green { background: var(--green); }
.btn-red { background: var(--red); }
.btn-block { width: 100%; }
.status { margin-top: 10px; color: var(--muted); min-height: 1.3em; font-size: 0.9rem; }
.ok { color: #4ade80; }
.erro { color: #f87171; }
.flash {
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 0.92rem;
}
.flash.ok { background: #14532d55; color: #86efac; border: 1px solid #166534; }
.flash.erro { background: #7f1d1d55; color: #fca5a5; border: 1px solid #991b1b; }
.meta { color: var(--muted); font-size: 0.88rem; margin-bottom: 12px; }
.lista { display: grid; gap: 10px; }
.item {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: linear-gradient(180deg, #13233b 0%, #101b2d 100%);
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color .15s, transform .1s;
}
.item:hover { border-color: #3b82f6; transform: translateY(-1px); }
.item .top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
}
.item .rom { font-size: 1.15rem; font-weight: 700; }
.item .badge {
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 999px;
  background: #1e3a5f;
  color: #93c5fd;
  white-space: nowrap;
}
.item .muted { color: var(--muted); font-size: 0.88rem; }
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th { color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: .03em; }
.actions-inline { display: flex; flex-wrap: wrap; gap: 6px; }
.actions-inline form { display: inline; }
.actions-inline button, .actions-inline .btn {
  padding: 7px 10px;
  font-size: 0.8rem;
}
.empty {
  color: var(--muted);
  padding: 24px 10px;
  text-align: center;
}
.tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs a {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
}
.tabs a.active {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}
