/* ============================================================
   Locação Control — painel administrativo
   ============================================================ */

:root {
  color-scheme: dark;
  --bg: #070b11;
  --bg-soft: #0a1018;
  --panel: #101926;
  --panel-2: #0b1219;
  --panel-3: #0d1622;
  --border: #1c2837;
  --border-strong: #2a3a4f;
  --text: #e8eef6;
  --muted: #8798ad;
  --muted-2: #5b6b7f;
  --accent: #3b82f6;
  --accent-2: #2563eb;
  --accent-soft: rgba(59, 130, 246, 0.12);
  --ok: #22c55e;
  --ok-soft: rgba(34, 197, 94, 0.12);
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.12);
  --bad: #ef4444;
  --bad-soft: rgba(239, 68, 68, 0.12);
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Code", Consolas, "Courier New", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background:
    radial-gradient(1000px 520px at 12% -12%, rgba(59, 130, 246, 0.14), transparent 60%),
    radial-gradient(760px 420px at 105% -5%, rgba(239, 68, 68, 0.07), transparent 55%),
    radial-gradient(900px 700px at 50% 120%, rgba(59, 130, 246, 0.05), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(59, 130, 246, 0.35);
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

h1, h2, h3, p {
  margin: 0;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.w-full {
  width: 100%;
}

.center {
  text-align: center;
}

/* ------------------------------ scrollbars ------------------------------ */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #223044;
  border-radius: 999px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: #2c3d55;
}

/* -------------------------------- botões -------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease,
    transform 0.08s ease, box-shadow 0.15s ease;
}

.btn svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn.primary {
  background: linear-gradient(180deg, #4b8ff8, var(--accent-2));
  color: #fff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn.primary:hover {
  background: linear-gradient(180deg, #5c9bfa, #2f6ff0);
}

.btn.ghost {
  background: var(--panel-2);
  border-color: var(--border);
  color: var(--muted);
}

.btn.ghost:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--panel-3);
}

.btn.danger {
  background: linear-gradient(180deg, #f15a5a, #dc2626);
  color: #fff;
  box-shadow: 0 8px 20px rgba(220, 38, 38, 0.25);
}

.btn.danger:hover {
  background: linear-gradient(180deg, #f56f6f, #e03030);
}

.plus {
  font-size: 17px;
  line-height: 1;
  margin-top: -1px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: var(--panel-2);
  color: var(--text);
}

/* -------------------------------- login -------------------------------- */

.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.login-card {
  width: min(400px, 100%);
  background: linear-gradient(180deg, rgba(16, 25, 38, 0.96), rgba(11, 18, 27, 0.98));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 32px 28px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeUp 0.35s ease;
}

.login-card h1 {
  font-size: 24px;
  letter-spacing: -0.02em;
  text-align: center;
}

.login-sub {
  text-align: center;
  font-size: 13px;
  margin-top: -8px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #8ec0ff;
  background: linear-gradient(160deg, rgba(59, 130, 246, 0.22), rgba(37, 99, 235, 0.06));
  border: 1px solid rgba(59, 130, 246, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  flex: none;
}

.brand-badge svg {
  width: 18px;
  height: 18px;
}

.brand-badge.large {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  align-self: center;
}

.brand-badge.large svg {
  width: 30px;
  height: 30px;
}

.login-foot {
  text-align: center;
  font-size: 11px;
  color: var(--muted-2);
  margin-top: 2px;
}

/* -------------------------------- topbar -------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 28px;
  background: rgba(7, 11, 17, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-title {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.topbar-title strong {
  font-size: 15px;
  letter-spacing: -0.01em;
}

.topbar-title span {
  font-size: 11px;
  color: var(--muted-2);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

.api-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--muted-2);
  padding: 4px 6px;
  white-space: nowrap;
}

.api-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14);
}

.api-status.offline i {
  background: var(--bad);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.14);
}

.api-status.offline {
  color: #fca5a5;
}

/* ------------------------------ layout/stats ------------------------------ */

.container {
  max-width: 1260px;
  margin: 0 auto;
  padding: 26px 28px 64px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: linear-gradient(180deg, rgba(16, 25, 38, 0.9), rgba(11, 18, 27, 0.9));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.stat-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: transparent;
}

.stat-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.stat-card.ok::after { background: linear-gradient(90deg, transparent, var(--ok), transparent); }
.stat-card.warn::after { background: linear-gradient(90deg, transparent, var(--warn), transparent); }
.stat-card.bad::after { background: linear-gradient(90deg, transparent, var(--bad), transparent); }

.stat-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.stat-label i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-strong);
}

.stat-card.ok .stat-label i { background: var(--ok); }
.stat-card.warn .stat-label i { background: var(--warn); }
.stat-card.bad .stat-label i { background: var(--bad); }

.stat-value {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------- tabs --------------------------------- */

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  padding: 11px 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  margin-bottom: -1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  font-size: 10.5px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

.tab.active .tab-count {
  background: var(--accent-soft);
  border-color: rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}

/* ------------------------------ toolbar/table ------------------------------ */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.panel-title {
  font-size: 16px;
  letter-spacing: -0.01em;
}

.panel-sub {
  font-size: 12px;
  color: var(--muted-2);
  margin-top: 2px;
}

.search {
  position: relative;
  width: min(340px, 100%);
}

.search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--muted-2);
  pointer-events: none;
}

.search input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search input::placeholder {
  color: var(--muted-2);
}

.search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

.table-card {
  background: linear-gradient(180deg, rgba(16, 25, 38, 0.92), rgba(11, 18, 27, 0.92));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.22);
}

.data-table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
}

.audit-table {
  min-width: 860px;
}

.audit-details {
  max-width: 460px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.data-table tbody td.empty {
  padding: 46px 24px;
  text-align: center;
  color: var(--muted-2);
}

.data-table thead th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.015);
  white-space: nowrap;
}

.data-table tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background 0.12s ease;
}

.data-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.035);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table th.center,
.data-table td.center {
  text-align: center;
}

.data-table th.narrow {
  width: 52px;
}

.data-table td.right {
  text-align: right;
}

.cell-main {
  font-weight: 600;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.cell-sub {
  font-size: 11.5px;
  color: var(--muted-2);
  margin-top: 3px;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty {
  padding: 46px 24px;
  text-align: center;
  color: var(--muted-2);
  font-size: 13px;
}

.empty strong {
  display: block;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 4px;
}

/* badges / tags */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.badge.ok {
  color: #6ee7a0;
  background: var(--ok-soft);
  border-color: rgba(34, 197, 94, 0.26);
}

.badge.warn {
  color: #fbd38d;
  background: var(--warn-soft);
  border-color: rgba(245, 158, 11, 0.26);
}

.badge.bad {
  color: #fca5a5;
  background: var(--bad-soft);
  border-color: rgba(239, 68, 68, 0.28);
}

.badge.neutral {
  color: var(--muted);
  background: rgba(135, 152, 173, 0.08);
  border-color: rgba(135, 152, 173, 0.20);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--warn-soft);
  color: #fbd38d;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.online-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  margin-right: 6px;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
  vertical-align: 1px;
}

.muted-sm {
  color: var(--muted-2);
  font-size: 12px;
}

/* switch */

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  vertical-align: middle;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.switch span {
  position: absolute;
  inset: 0;
  background: #1d2a3b;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s ease, box-shadow 0.18s ease;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.switch span::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #8496aa;
  top: 3px;
  left: 3px;
  transition: transform 0.18s ease, background 0.18s ease;
}

.switch input:checked + span {
  background: rgba(34, 197, 94, 0.24);
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.5);
}

.switch input:checked + span::before {
  transform: translateX(20px);
  background: var(--ok);
}

.switch input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ação "⋯" */

.more {
  font-size: 19px;
  letter-spacing: 1px;
  line-height: 1;
  padding-bottom: 5px;
}

/* ------------------------------ action menu ------------------------------ */

.action-menu {
  position: fixed;
  z-index: 90;
  width: 236px;
  background: #101a27;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  padding: 5px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  animation: menuIn 0.12s ease;
}

.action-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 12.5px;
  padding: 9px 11px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.12s ease;
}

.action-item:hover {
  background: rgba(59, 130, 246, 0.14);
}

.action-item.danger {
  color: #fca5a5;
}

.action-item.danger:hover {
  background: rgba(239, 68, 68, 0.14);
}

.action-sep {
  height: 1px;
  background: var(--border);
  margin: 5px 8px;
}

/* -------------------------------- dialogs -------------------------------- */

.dialog {
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: linear-gradient(180deg, #111b28, #0c141e);
  color: var(--text);
  padding: 0;
  width: min(520px, calc(100vw - 24px));
  box-shadow: var(--shadow);
}

.dialog.wide {
  width: min(740px, calc(100vw - 24px));
}

.dialog::backdrop {
  background: rgba(3, 6, 10, 0.72);
  backdrop-filter: blur(4px);
}

.dialog[open] {
  animation: dialogIn 0.18s ease;
}

.dialog-form {
  display: flex;
  flex-direction: column;
  max-height: min(86vh, 820px);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.dialog-head h2 {
  font-size: 15.5px;
  letter-spacing: -0.01em;
}

.dialog-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  overflow-y: auto;
}

.dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.dialog-text {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}

.dialog-text strong {
  color: var(--text);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--muted-2);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

.field textarea {
  resize: vertical;
  min-height: 72px;
}

.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted-2) 50%),
    linear-gradient(135deg, var(--muted-2) 50%, transparent 50%);
  background-position: calc(100% - 16px) calc(50% - 2px), calc(100% - 11px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

.hint {
  font-size: 11.5px;
  color: var(--muted-2);
  line-height: 1.45;
}

.form-error {
  font-size: 12.5px;
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 8px;
  padding: 8px 11px;
}

.warning-box {
  font-size: 12px;
  color: #fbd38d;
  background: var(--warn-soft);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 8px;
  padding: 9px 11px;
}

.checkbox-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
  cursor: pointer;
  user-select: none;
}

.checkbox-line input {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  accent-color: var(--accent);
  flex: none;
}

.code-display {
  font-family: var(--mono);
  font-size: clamp(26px, 6vw, 34px);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-align: center;
  padding: 18px 12px;
  border-radius: 12px;
  background: #060b12;
  border: 1px solid var(--border-strong);
  color: #bfdbfe;
  text-shadow: 0 0 24px rgba(59, 130, 246, 0.35);
  user-select: all;
}

.code-block {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.55;
  background: #060b12;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 14px;
  max-height: 340px;
  overflow: auto;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #c3d3e6;
  user-select: text;
}

/* -------------------------------- toasts -------------------------------- */

.toast-root {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(390px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #111b28;
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--ok);
  border-radius: 10px;
  padding: 11px 13px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  font-size: 12.5px;
  line-height: 1.45;
  animation: toastIn 0.22s ease;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.error { border-left-color: var(--bad); }
.toast.warn { border-left-color: var(--warn); }
.toast.success { border-left-color: var(--ok); }

.toast-icon {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  margin-top: 1px;
  background: var(--ok-soft);
  color: #6ee7a0;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.toast.error .toast-icon {
  background: var(--bad-soft);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}

.toast.warn .toast-icon {
  background: var(--warn-soft);
  color: #fbd38d;
  border-color: rgba(245, 158, 11, 0.3);
}

.toast-text {
  flex: 1;
  padding-top: 1px;
}

.toast.leaving {
  opacity: 0;
  transform: translateX(14px);
}

/* -------------------------------- loading -------------------------------- */

.boot-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 300;
}

.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(59, 130, 246, 0.18);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

/* -------------------------------- animações -------------------------------- */

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes dialogIn {
  from { opacity: 0; transform: translateY(6px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes menuIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(14px); }
  to { opacity: 1; transform: translateX(0); }
}

/* -------------------------------- responsivo -------------------------------- */

@media (max-width: 1080px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .topbar {
    padding: 10px 16px;
    flex-wrap: wrap;
  }

  .topbar-actions {
    gap: 6px;
  }

  .container {
    padding: 18px 16px 56px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar {
    align-items: stretch;
  }

  .search {
    width: 100%;
  }

  .toolbar > .btn {
    width: 100%;
  }

  .panel-title {
    font-size: 15px;
  }
}

@media (max-width: 560px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .api-status span {
    display: none;
  }

  .topbar-title span {
    display: none;
  }

  .btn {
    padding: 8px 11px;
  }

  .stat-value {
    font-size: 23px;
  }

  .dialog {
    width: calc(100vw - 16px);
  }

  .toast-root {
    right: 8px;
    top: 8px;
    width: calc(100vw - 16px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
