:root {
  --canvas: #f5f6f8;
  --surface: #fff;
  --inset: #f0f2f5;
  --ink: #20252e;
  --secondary: #616977;
  --muted: #8b929e;
  --line: #20252e12;
  --accent: #4254c5;
  --accent-soft: #eef0fd;
  --good: #237354;
  --bad: #aa3939;
  --shadow: 0 0 0 1px #20252e06, 0 4px 20px #20252e05;
  --r: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
* { box-sizing: border-box }
body { margin: 0 }
button, input, select { font: inherit }
button, .button {
  min-height: 44px; cursor: pointer; border: 0; border-radius: 10px;
  background: var(--inset); color: var(--ink); padding: 10px 16px; font-weight: 600;
  transition: transform .15s, opacity .15s; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
}
button:hover, .button:hover { filter: brightness(.97) }
button:active { transform: scale(.98) }
button:disabled { opacity: .45; cursor: wait }
.primary { background: var(--accent); color: white }
.danger { color: var(--bad) }
.quiet { background: transparent }
input, select {
  background: var(--inset); border: 1px solid transparent; border-radius: 9px;
  min-height: 44px; padding: 10px 12px; width: 100%; color: var(--ink);
}
input[type=checkbox] { width: 20px; min-height: 20px; accent-color: var(--accent) }
:focus-visible { outline: 3px solid #4254c555; outline-offset: 3px }
label { display: grid; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 16px }
h1 { font-size: 32px; letter-spacing: -1px; line-height: 1.15; margin: 0 0 12px }
h2 { font-size: 18px; letter-spacing: -.3px; margin: 0 0 20px }
h3 { font-size: 14px; margin: 0 0 8px }
p { line-height: 1.6; color: var(--secondary) }
small, .muted { color: var(--secondary) }
.eyebrow { font-size: 11px; letter-spacing: 1.8px; font-weight: 700; color: var(--accent); margin: 0 0 20px }
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh }
aside { padding: 32px 20px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 32px }
aside .brand { font-weight: 750; font-size: 17px; padding: 0 12px }
.brand i { font-style: normal; display: inline-grid; place-items: center; border-radius: 10px; background: var(--accent); color: #fff; width: 32px; height: 32px; margin-right: 8px }
nav { display: grid; gap: 8px }
nav button { justify-content: flex-start; background: transparent; color: var(--secondary) }
nav button.active { background: var(--accent-soft); color: var(--accent) }
.aside-foot { margin-top: auto; font-size: 12px; padding: 12px }
.content { padding: 40px 48px; max-width: 1600px; width: 100% }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 28px }
.page-head p { margin: 0 }
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 24px; margin-bottom: 24px }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-bottom: 28px }
.stat { padding: 8px 24px 8px 0; border-right: 1px solid var(--line) }
.stat:last-child { border: 0 }
.stat strong { display: block; font-size: 34px; letter-spacing: -1px; margin: 8px 0 }
.stat small { font-size: 12px }
.grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 24px }
.hero { padding: 28px }
.hero-number { font-size: 42px; font-weight: 650; letter-spacing: -1.4px; margin: 16px 0 8px }
.status { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 600; color: var(--good); background: #2373540c; padding: 6px 10px; border-radius: 30px }
.status.bad { color: var(--bad); background: #aa39390c }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line) }
.kv:last-child { border: 0 }
.kv span { color: var(--secondary) }
.kv strong { font-weight: 550; text-align: right }
.table-wrap { overflow: auto }
table { width: 100%; border-collapse: collapse; text-align: left }
th { font-size: 11px; color: var(--muted); letter-spacing: .5px; text-transform: uppercase; font-weight: 600; white-space: nowrap }
th, td { padding: 14px 12px; border-bottom: 1px solid var(--line) }
td:first-child, th:first-child { padding-left: 0 }
td:last-child, th:last-child { padding-right: 0 }
tr:last-child td { border: 0 }
td small { display: block; margin-top: 4px }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center }
.stepper { display: inline-flex; align-items: center; gap: 12px }
.stepper button { min-width: 40px; padding: 8px }
.login { max-width: 440px; margin: 9vh auto; padding: 36px; background: var(--surface); border-radius: 24px; box-shadow: var(--shadow) }
.login h1 { margin-bottom: 16px }
.login p { margin-bottom: 28px }
.login button { width: 100% }
.error { color: var(--bad); font-size: 13px }
.empty { text-align: center; padding: 40px; color: var(--secondary) }
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; border-radius: 12px; padding: 14px 20px;
  box-shadow: var(--shadow); max-width: calc(100vw - 32px); display: none; z-index: 20;
}
dialog { border: 0; border-radius: 22px; box-shadow: 0 24px 90px #0003; padding: 28px; max-width: 560px; width: calc(100% - 32px); max-height: 85vh; overflow: auto }
dialog::backdrop { background: #20252e55; backdrop-filter: blur(3px) }
dialog header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px }
dialog h2 { margin: 0 }
.notice { padding: 16px; background: var(--accent-soft); border-radius: 12px; font-size: 13px; line-height: 1.6; color: var(--secondary); margin-bottom: 20px }
.timeline { padding-left: 16px; border-left: 2px solid var(--line) }
.timeline p { margin: 0 0 16px; font-size: 13px }
.timeline small { display: block }
.progress { height: 5px; background: var(--inset); border-radius: 5px; overflow: hidden; margin-top: 12px }
.progress span { display: block; height: 100%; background: var(--accent) }
.inline-check { display: flex; align-items: flex-start; gap: 12px; font-weight: 400 }
.split { display: flex; align-items: center; justify-content: space-between; gap: 16px }
.loading { opacity: .5; pointer-events: none }
.link-field { word-break: break-all; font-size: 12px; background: var(--inset); padding: 16px; border-radius: 10px; user-select: all }
.install-icon { font-size: 32px; background: var(--accent-soft); padding: 16px; border-radius: 18px; width: 72px; text-align: center; margin-bottom: 24px }
.install .button { width: 100%; margin-bottom: 12px }
.note { font-size: 12px }
.mobile-brand { display: none }

/* Selo "Em uso" no histórico do rodízio */
.status.in-use { margin-left: 8px }

@media(max-width:1000px) {
  .content { padding: 32px 24px }
  .shell { grid-template-columns: 200px minmax(0, 1fr) }
  .grid { grid-template-columns: 1fr }
  .stats { gap: 12px }
  .stat { padding-right: 12px }
}
@media(max-width:700px) {
  .shell { display: block }
  aside { padding: 16px; border-right: 0; border-bottom: 1px solid var(--line); gap: 16px }
  aside .brand { padding: 0 }
  nav { display: flex; overflow: auto; gap: 4px }
  nav button { white-space: nowrap; font-size: 12px; padding: 8px 12px }
  .aside-foot { display: none }
  .content { padding: 24px 16px }
  .page-head { align-items: flex-start }
  h1 { font-size: 27px }
  .stats { grid-template-columns: repeat(2, 1fr) }
  .stat:nth-child(2) { border: 0 }
  .stat strong { font-size: 30px }
  .card { padding: 20px }
  .login { margin: 32px 16px; padding: 28px; max-width: none }
  .hero-number { font-size: 34px }
  .page-head > .actions button { font-size: 12px }
  .kv { font-size: 12px }
}
@media(prefers-reduced-motion:reduce) {
  * { transition: none !important }
}
