:root {
  --accent: #005bbf;
  --accent-hover: #004499;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #16181d;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --danger: #c0392b;
  --danger-bg: #fdecea;
  --success: #1a7f37;
  --success-bg: #e9f7ee;
  --warn: #9a6700;
  --warn-bg: #fff6e0;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  background: #0e0f12;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
}

.topbar .brand { font-weight: 700; letter-spacing: 0.3px; }
.topbar .brand span { color: var(--accent); }
.topbar nav a { color: #cfd3da; margin-left: 20px; font-size: 14px; }
.topbar nav a.active, .topbar nav a:hover { color: #fff; }
.topbar .user { color: #9aa0aa; font-size: 13px; margin-left: 20px; }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-header h1 { font-size: 22px; margin: 0; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn.secondary { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn.secondary:hover { background: #f2f3f5; }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #a3301f; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

table.list { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; }
table.list th, table.list td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
table.list th { background: #fafbfc; color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; }
table.list tr:last-child td { border-bottom: none; }
table.list tr:hover td { background: #fafbfc; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.PENDENTE { background: var(--warn-bg); color: var(--warn); }
.badge.ASSINADO { background: var(--success-bg); color: var(--success); }
.badge.RECUSADO, .badge.CANCELADO { background: var(--danger-bg); color: var(--danger); }
.badge.EXPIRADO { background: #eee; color: #666; }

form.form-box { max-width: 560px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.field .hint { color: var(--text-muted); font-size: 12px; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=file], textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,91,191,0.12); }

.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 20px; font-size: 14px; }
.alert.error { background: var(--danger-bg); color: var(--danger); }
.alert.success { background: var(--success-bg); color: var(--success); }
.alert.info { background: #eaf2fc; color: #0b4a8f; }

.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #0e0f12; }
.login-box { background: #fff; padding: 40px; border-radius: 12px; width: 100%; max-width: 380px; }
.login-box h1 { font-size: 20px; margin: 0 0 24px; text-align: center; }

.audit-trail { list-style: none; margin: 0; padding: 0; }
.audit-trail li { display: flex; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.audit-trail li:last-child { border-bottom: none; }
.audit-trail .quando { color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.muted { color: var(--text-muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; word-break: break-all; }

.empty-state { text-align: center; padding: 64px 24px; color: var(--text-muted); }
