/* Painel SoftSP License — CSS próprio (sem build). Servido em /assets/admin.css */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --border: #e3e6ea;
  --text: #1f2733;
  --muted: #6b7684;
  --primary: #2f6fed;
  --primary-dark: #2358c9;
  --sidebar: #141b2d;
  --sidebar-muted: #8b96ad;
  --sidebar-active: #2f6fed;
  --danger: #d64545;
  --success: #2e9e5b;
  --warn: #c9821a;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(20,27,45,.08), 0 1px 2px rgba(20,27,45,.04);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Layout autenticado ---- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; background: var(--sidebar); color: #fff; flex-shrink: 0;
  display: flex; flex-direction: column; padding: 20px 0;
}
.sidebar .brand { padding: 0 22px 18px; font-weight: 700; font-size: 15px; letter-spacing: .2px; }
.sidebar .brand small { display: block; color: var(--sidebar-muted); font-weight: 400; font-size: 11px; margin-top: 2px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px; color: var(--sidebar-muted);
  padding: 10px 22px; font-weight: 500; border-left: 3px solid transparent;
}
.sidebar nav a:hover { color: #fff; text-decoration: none; background: rgba(255,255,255,.03); }
.sidebar nav a.active { color: #fff; border-left-color: var(--sidebar-active); background: rgba(47,111,237,.12); }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 60px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 26px;
}
.topbar .who { color: var(--muted); font-size: 13px; }
.topbar .who strong { color: var(--text); }
.content { padding: 26px; max-width: 1080px; width: 100%; }
.page-title { font-size: 20px; font-weight: 700; margin: 0 0 18px; }

/* ---- Cards / grid ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 22px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card .k { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.card .v { font-size: 26px; font-weight: 700; margin-top: 6px; }

/* ---- Tabela ---- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel .panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.panel .panel-head h2 { font-size: 15px; margin: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 18px; border-bottom: 1px solid var(--border); }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
tr:last-child td { border-bottom: none; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }

/* ---- Badges ---- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.badge.active { background: #e5f4ea; color: var(--success); }
.badge.disabled { background: #f0f1f3; color: var(--muted); }

/* ---- Botões ---- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  background: var(--primary); color: #fff; border: 1px solid var(--primary);
  padding: 9px 16px; border-radius: 8px; font-weight: 600; font-size: 13.5px; text-decoration: none;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn.secondary { background: #fff; color: var(--text); border-color: var(--border); }
.btn.secondary:hover { background: #f7f8fa; }
.btn.small { padding: 6px 12px; font-size: 12.5px; }
.btn.link { background: none; border: none; color: var(--primary); padding: 0; font-weight: 600; }

/* ---- Forms ---- */
.form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.form .row { margin-bottom: 16px; }
.form label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 13px; }
.form .hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], textarea, select {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47,111,237,.15); }
textarea { min-height: 84px; resize: vertical; font-family: ui-monospace, monospace; font-size: 12.5px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; }

/* ---- Alerts ---- */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 13.5px; }
.alert.success { background: #e5f4ea; color: #1c6b3c; border: 1px solid #bfe3cc; }
.alert.error { background: #fbe9e9; color: #a12c2c; border: 1px solid #f2c9c9; }
.alert.info { background: #e9f0fc; color: #234a94; border: 1px solid #cadaf6; }
.errors { margin: 0 0 16px; padding: 12px 16px 12px 30px; background: #fbe9e9; border: 1px solid #f2c9c9; border-radius: 8px; color: #a12c2c; font-size: 13px; }

/* ---- Auth (guest) ---- */
.guest { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); width: 100%; max-width: 400px; padding: 30px; }
.auth-card h1 { font-size: 18px; margin: 0 0 4px; }
.auth-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.auth-card .brand-badge { font-weight: 700; color: var(--primary); font-size: 13px; letter-spacing: .3px; margin-bottom: 16px; }
.qr { display: flex; justify-content: center; padding: 14px; background: #fff; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 14px; }
.qr svg { width: 200px; height: 200px; }
.secret-line { text-align: center; font-family: ui-monospace, monospace; font-size: 13px; background: #f5f6f8; padding: 8px; border-radius: 6px; margin-bottom: 16px; word-break: break-all; }
.recovery-codes { columns: 2; font-family: ui-monospace, monospace; font-size: 14px; background: #f5f6f8; border: 1px solid var(--border); border-radius: 8px; padding: 14px 18px; margin: 12px 0; }
.recovery-codes span { display: block; padding: 3px 0; }
.muted { color: var(--muted); }
