:root {
  --bg: #060a10;
  --panel: #0d1420;
  --panel-2: #111c2a;
  --line: rgba(255, 255, 255, 0.12);
  --text: #f6f9ff;
  --muted: #a8b5c7;
  --blue: #0877ff;
  --cyan: #5ee7ff;
  --danger: #ff5c7a;
  --ok: #33d69f;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(circle at top left, rgba(8,119,255,.16), transparent 34rem), var(--bg);
  font-family: Inter, Arial, sans-serif;
}
a { color: inherit; text-decoration: none; }
code { color: var(--cyan); overflow-wrap: anywhere; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: rgba(0, 0, 0, .58);
}
.logo {
  display: block;
  margin-bottom: 28px;
  font-size: 1.28rem;
  font-weight: 900;
}
.logo span { color: var(--blue); }
.sidebar nav { display: grid; gap: 8px; }
.sidebar nav a, .logout {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
}
.sidebar nav a:hover, .sidebar nav a.active {
  color: #fff;
  background: rgba(8, 119, 255, .17);
}
.logout {
  position: absolute;
  right: 22px;
  bottom: 22px;
  left: 22px;
  border: 1px solid var(--line);
}
.main { margin-left: 248px; padding: 24px; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.topbar h1 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.8rem); }
.topbar small, .userbox span { color: var(--cyan); font-weight: 900; text-transform: uppercase; }
.userbox { text-align: right; font-weight: 900; }
.userbox span { display: block; margin-top: 4px; font-size: .72rem; }
.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.cards article, .panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.02));
}
.cards article { padding: 20px; }
.cards span { color: var(--muted); }
.cards strong { display: block; margin-top: 10px; font-size: 2.4rem; }
.panel { padding: 20px; margin-bottom: 18px; }
.panel h2 { margin: 0 0 16px; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.grid.two {
  display: grid;
  grid-template-columns: minmax(280px, .45fr) minmax(0, 1fr);
  gap: 18px;
}
.form { display: grid; gap: 14px; align-content: start; }
.form.wide { display: block; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
label { display: grid; gap: 7px; color: var(--text); font-weight: 800; }
input, select, textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  background: #050910;
  font: inherit;
}
textarea { resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; min-height: auto; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #fff;
  background: rgba(255,255,255,.05);
  font-weight: 900;
  cursor: pointer;
}
.btn.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--blue), #00a3ff);
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th { color: var(--cyan); font-size: .82rem; text-transform: uppercase; }
.badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  color: #fff;
  background: rgba(8,119,255,.22);
  font-size: .78rem;
  font-weight: 900;
}
.badge.resolvido, .badge.fechado, .badge.executada, .ok { color: var(--ok); }
.danger, .flash.error { color: var(--danger); }
.flash {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ok);
  background: rgba(255,255,255,.04);
}
.details {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px;
}
.details dt { color: var(--cyan); font-weight: 900; }
.details dd { margin: 0; color: var(--muted); }
.messages { display: grid; gap: 12px; margin-bottom: 14px; }
.messages article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0,0,0,.24);
}
.messages span { display: block; color: var(--muted); font-size: .85rem; }
.messages em {
  margin-left: 6px;
  color: var(--cyan);
  font-size: .75rem;
  font-style: normal;
}
.row-form, .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.signature-pad {
  width: 100%;
  height: 220px;
  border: 1px dashed rgba(94,231,255,.52);
  border-radius: 8px;
  background: #fff;
  touch-action: none;
}
.signature-preview {
  max-width: 360px;
  padding: 8px;
  border-radius: 8px;
  background: #fff;
}
.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  display: grid;
  gap: 14px;
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.print-page {
  color: #111827;
  background: #e5e7eb;
}
.print-sheet {
  width: min(900px, calc(100% - 32px));
  min-height: 1120px;
  margin: 16px auto;
  padding: 44px;
  background: #fff;
}
.print-sheet p, .print-sheet td, .print-sheet th { color: #111827; }
@media print {
  .no-print { display: none; }
  .print-page { background: #fff; }
  .print-sheet { width: 100%; min-height: auto; margin: 0; padding: 0; }
}
@media (max-width: 980px) {
  .sidebar { position: static; width: auto; }
  .logout { position: static; margin-top: 12px; }
  .main { margin-left: 0; padding: 16px; }
  .cards, .grid.two, .form-grid { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .userbox { text-align: left; }
}
