/* SGAU — Design System (tipografia e componentes)
 * Tokens: site.css. Não redeclarar cores/hex aqui — só var(--*).
 * Tema v4: grafite/branco + vidro fosco em status/barras/modais. */

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

.scroll-thin,
.admin-sidebar,
.client-sidebar,
.main-content,
.table-wrap,
.modal-body {
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
}

/* ─── Tipografia ─── */

.t-display {
  font-size: clamp(26px, 3.8vw, 36px);
  font-weight: 600;
  letter-spacing: -0.038em;
  line-height: 1.06;
  color: var(--text-1);
}

.t-display strong {
  font-weight: 600;
  color: var(--text-1);
}

.t-h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text-1);
}

.t-h1 strong {
  font-weight: 600;
  color: var(--text-1);
}

.t-h2 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.024em;
  color: var(--text-1);
}

.t-h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
}

.t-h4 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
}

.t-body {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-2);
  line-height: 1.75;
}

.t-small {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-3);
}

.t-mono {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
}

.t-label,
.eyebrow {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 400;
  color: var(--text-3);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ─── Seções ─── */

.section-header {
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-1);
}

.section-eyebrow {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 400;
  color: var(--text-3);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.section-header .section-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: -0.03em;
}

.section-header .section-title strong {
  font-weight: 600;
  color: var(--text-1);
}

.section-desc {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-2);
  max-width: 540px;
  line-height: 1.75;
}

.section-bg {
  background-color: var(--surface-2);
  transition: background-color 0.3s var(--ease);
}

/* ─── Grids ─── */

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.col-span-2 {
  grid-column: span 2;
}

.divider {
  height: 1px;
  background: var(--border-1);
  margin: 40px 0;
}

.divider-label {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 36px 0;
}

.divider-label::before,
.divider-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-1);
}

.divider-label span {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .col-span-2 {
    grid-column: span 1;
  }
}

/* ─── Botões ─── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  height: var(--control-h);
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.008em;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.16s var(--ease),
    border-color 0.16s var(--ease),
    color 0.16s var(--ease),
    transform 0.12s var(--ease-out);
  text-decoration: none !important;
  user-select: none;
}

a.btn:hover,
a.btn:focus,
a.btn:active,
button.btn:hover,
button.btn:focus {
  text-decoration: none !important;
}

.btn:active {
  transform: scale(0.975);
}

.btn i {
  font-size: 10.5px;
}

.btn-sm {
  height: 26px;
  padding: 0 9px;
  font-size: 11.5px;
}

.btn-lg {
  height: 36px;
  padding: 0 16px;
  font-size: 13px;
}

.btn-icon {
  width: var(--control-h);
  padding: 0;
}

.btn-icon.btn-sm {
  width: 26px;
}

.btn-primary,
.btn-accent {
  background: var(--brand);
  color: var(--btn-on-primary);
  border-color: transparent;
  box-shadow: none;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-accent:hover,
.btn-accent:focus {
  background: var(--brand-light);
  color: var(--btn-on-primary);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text-1);
  border-color: var(--border-2);
}

.btn-secondary:hover,
.btn-secondary:focus {
  background: var(--surface-3);
  color: var(--text-1);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: var(--border-2);
  box-shadow: none;
}

.btn-ghost:hover,
.btn-ghost:focus {
  color: var(--text-1);
  background: var(--surface-2);
}

.btn-outline-primary {
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--brand);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background: var(--brand);
  color: var(--btn-on-primary);
}

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid var(--red-mid);
}

.btn-danger:hover,
.btn-danger:focus {
  background: color-mix(in srgb, var(--red) 14%, transparent);
  border-color: var(--red);
  color: var(--red);
}

.btn-text {
  background: transparent;
  color: var(--text-2);
  border: none;
  padding: 0 6px;
  height: auto;
  box-shadow: none;
}

.btn-text:hover {
  color: var(--text-1);
  transform: none;
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

a.btn.btn-link,
button.btn.btn-link,
.btn.btn-link {
  height: auto;
  min-height: 0;
  padding: 0.375rem 0.75rem;
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--brand);
  font-weight: 400;
}

a.btn.btn-link:hover,
button.btn.btn-link:hover,
.btn.btn-link:hover {
  transform: none;
  box-shadow: none;
  color: var(--brand-dark);
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 3px var(--brand-dim);
  outline: none;
}

/* ─── Badges (texto + bolinha) ─── */

.badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  box-shadow: none;
  color: var(--text-2);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

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

/* Ícone no lugar da bolinha, se houver */
.badge:has(> i)::before,
.badge:has(> svg)::before {
  display: none;
}

.badge > i {
  font-size: 9px;
  line-height: 1;
}

.badge-primary,
.badge-default,
.badge-secondary,
.badge-outline {
  color: var(--text-2);
  background: var(--surface-2);
  border-color: var(--border-2);
}

.badge-accent,
.badge-brand {
  color: var(--brand);
  background: var(--brand-dim);
  border-color: var(--brand-mid);
}

/* Status dinâmico (cor via --status-c / --status-bg / --status-border) */
.badge-status {
  color: var(--status-c, var(--text-2));
  background: var(--status-bg, var(--surface-2));
  border-color: var(--status-border, var(--border-2));
}

.badge-success {
  color: var(--green);
  background: var(--green-dim);
  border-color: var(--green-mid);
}

.badge-warning {
  color: var(--amber);
  background: var(--amber-dim);
  border-color: var(--amber-mid);
}

.badge-danger {
  color: var(--red);
  background: var(--red-dim);
  border-color: var(--red-mid);
}

.badge-info {
  color: var(--blue);
  background: var(--blue-dim);
  border-color: var(--blue-mid);
}

/* badge-dot: bolinha já vem em .badge::before */
.badge-dot::before {
  content: "";
}

.badge-live::before {
  animation: badge-pulse 2.4s var(--ease) infinite;
}

@keyframes badge-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* ─── Area cards (canvas + meta) ─── */

.area-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.area-card {
  --area-thumb-stroke: var(--brand);
  --area-thumb-fill: var(--brand-dim);
  display: flex;
  flex-direction: column;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  overflow: hidden;
  height: 100%;
  transition: border-color 0.18s var(--ease);
}

.area-card:hover {
  border-color: var(--border-2);
}

.area-card-map {
  position: relative;
  height: 148px;
  background:
    linear-gradient(180deg, var(--surface-2), var(--surface-1));
  border-bottom: 1px solid var(--border-1);
  overflow: hidden;
}

.area-thumb-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.area-thumb-canvas.is-empty {
  opacity: 0;
}

.area-card-map-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-3);
  font-size: 11px;
  pointer-events: none;
}

.area-card-map-empty i {
  font-size: 22px;
  opacity: 0.55;
}

.area-card-status {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
}

.area-card-body {
  padding: 14px 14px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.area-card-code {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

.area-card-name {
  margin: 2px 0 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-1);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.area-card-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11.5px;
  color: var(--text-2);
}

.area-card-meta i {
  width: 12px;
  margin-right: 4px;
  color: var(--text-3);
  font-size: 10px;
}

.area-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.area-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  font-size: 10.5px;
  color: var(--text-2);
}

.area-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border-1);
  background: var(--surface-1);
}

.area-card-date {
  font-size: 10.5px;
  color: var(--text-3);
  font-family: var(--mono);
}

.area-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.panel-quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.panel-quick-action {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  background: var(--surface-1);
  text-decoration: none !important;
  color: var(--text-1);
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease);
}

.panel-quick-action:hover {
  border-color: var(--border-2);
  background: var(--surface-2);
  color: var(--text-1);
  text-decoration: none !important;
}

.panel-quick-action i {
  font-size: 14px;
  color: var(--text-3);
}

.panel-quick-action strong {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.panel-quick-action span {
  font-size: 11px;
  color: var(--text-3);
}

@media (max-width: 900px) {
  .panel-quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .panel-quick-actions {
    grid-template-columns: 1fr;
  }
}

/* ─── Vidro (barras, painéis, modais) ─── */

.glass,
.glass-panel {
  background: var(--glass-2);
  backdrop-filter: var(--blur-2);
  -webkit-backdrop-filter: var(--blur-2);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--glass-highlight);
}

.glass-bar {
  background: var(--glass-2);
  backdrop-filter: var(--blur-2);
  -webkit-backdrop-filter: var(--blur-2);
  border-bottom: 1px solid var(--glass-border);
}

.glass-modal {
  background: var(--glass-3);
  backdrop-filter: var(--blur-3);
  -webkit-backdrop-filter: var(--blur-3);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg), inset 0 1px 0 var(--glass-highlight);
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: var(--scrim);
  backdrop-filter: saturate(120%) blur(3px);
  -webkit-backdrop-filter: saturate(120%) blur(3px);
  display: grid;
  place-items: center;
  padding: 20px;
}

/* ─── Cards ─── */

.card,
.ds-card {
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  box-shadow: none;
  color: var(--text-1);
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease);
  overflow: hidden;
}

.card:not(:has(> .card-body)),
.ds-card {
  padding: 20px;
}

.card:not(:has(> .card-body)):hover,
.ds-card:hover {
  border-color: var(--border-2);
  background: var(--surface-1);
}

.card:has(> .card-body) {
  padding: 0;
}

.card:has(> .card-body):hover {
  border-color: var(--border-2);
}

.card > .card-header,
.card > .card-body,
.card > .card-footer {
  background: transparent;
}

.card:not(:has(> .card-body)) > .card-header,
.card:not(:has(> .card-body)) > .card-body,
.card:not(:has(> .card-body)) > .card-footer {
  padding: 0;
  margin: 0;
  border: none;
}

.card:not(:has(> .card-body)) > .card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card:not(:has(> .card-body)) > .card-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-1) !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.card:has(> .card-body) > .card-header {
  padding: 16px 20px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border-1);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
}

.card:has(> .card-body) > .card-body {
  padding: 16px 20px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text-2);
}

.card:has(> .card-body) > .card-footer {
  padding: 14px 20px;
  margin-top: 0;
  border-top: 1px solid var(--border-1);
  color: var(--text-2);
}

.card-title,
.ds-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 0;
}

.card-sub,
.ds-card-sub {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-3);
  margin-top: 3px;
}

.card-elevated {
  box-shadow: var(--shadow-lg);
}

.card-flat {
  box-shadow: none;
}

.card-flat:hover {
  box-shadow: var(--shadow-card);
}

.card-compact:not(:has(> .card-body)) {
  padding: 16px;
}

.card-stat .stat-value {
  font-size: 28px;
  font-weight: 300;
  color: var(--text-1);
  letter-spacing: -0.04em;
  line-height: 1;
}

.card-stat .stat-value strong {
  font-weight: 800;
  color: var(--brand);
}

.card-stat .stat-label {
  margin-top: 6px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.card-stat .stat-delta {
  font-size: 10px;
  font-weight: 600;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.delta-up { color: var(--green); }
.delta-down { color: var(--red); }
.delta-neu { color: var(--text-3); }

.card-accent-green { border-left: 3px solid var(--green); }
.card-accent-amber { border-left: 3px solid var(--amber); }
.card-accent-blue { border-left: 3px solid var(--blue); }

/* ─── Formulários ─── */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.ds-form-row,
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

label.field-label,
.form-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: 0;
  text-transform: none;
  margin-bottom: 0;
}

.field-hint {
  font-size: 10px;
  color: var(--text-3);
  margin-top: 4px;
}

.field-error,
.invalid-feedback {
  font-size: 10px;
  font-weight: 500;
  color: var(--red);
  margin-top: 4px;
}

.valid-feedback {
  font-size: 10px;
  font-weight: 500;
  color: var(--green);
  margin-top: 4px;
}

.form-control,
.form-select {
  width: 100%;
  background-color: var(--surface-1);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  padding: 0 11px;
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text-1);
  outline: none;
  height: var(--input-h);
  min-height: var(--input-h);
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
  box-shadow: none;
}

.form-control::placeholder {
  color: var(--text-3);
  opacity: 1;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-dim);
  background-color: var(--surface-1);
  color: var(--text-1);
}

.form-control:hover:not(:focus),
.form-select:hover:not(:focus) {
  border-color: var(--border-3);
}

.form-select {
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238b93a5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 10px 6px;
}

textarea.form-control {
  resize: vertical;
  min-height: 90px;
  line-height: 1.6;
}

.form-check-input {
  border-radius: var(--r-sm);
  border: 1px solid var(--border-2);
  background-color: var(--surface-1);
  transition: all 0.15s var(--ease);
}

.form-check-input:checked {
  background-color: var(--brand);
  border-color: var(--brand);
}

.form-check-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-dim);
}

.form-check-label {
  font-size: 12px;
  color: var(--text-2);
}

.form-switch .form-check-input {
  border-radius: var(--r-pill);
}

.input-group {
  display: flex;
  align-items: stretch;
  width: 100%;
  flex-wrap: nowrap;
}

.input-group > .form-control,
.input-group > .form-select {
  flex: 1 1 auto;
  min-width: 0;
  width: 1%;
}

.input-group > .form-control:not(:last-child),
.input-group > .form-select:not(:last-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-group > .btn {
  height: var(--input-h);
  min-height: var(--input-h);
  flex: 0 0 auto;
  align-self: stretch;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  margin-left: -1px;
}

.input-group > .btn.btn-sm {
  height: var(--input-h);
  min-height: var(--input-h);
  padding: 0 12px;
  font-size: 12px;
}

.input-group-text {
  display: flex;
  align-items: center;
  height: var(--input-h);
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  color: var(--text-2);
  font-size: 12px;
  padding: 0 11px;
}

.form-control.is-valid {
  border-color: var(--green-mid);
  box-shadow: 0 0 0 3px var(--green-dim);
}

.form-control.is-invalid {
  border-color: var(--red-mid);
  box-shadow: 0 0 0 3px var(--red-dim);
}

@media (max-width: 576px) {
  .ds-form-row,
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ─── Alertas ─── */

.alert,
.ds-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--r-lg);
  border: 1px solid transparent;
  margin-bottom: 16px;
}

.alert-info,
.ds-alert-info {
  background: var(--blue-dim);
  border-color: var(--blue-mid);
  color: var(--blue);
}

.alert-success,
.ds-alert-success {
  background: var(--green-dim);
  border-color: var(--green-mid);
  color: var(--green);
}

.alert-warning,
.ds-alert-warning {
  background: var(--amber-dim);
  border-color: var(--amber-mid);
  color: var(--amber);
}

.alert-danger,
.ds-alert-danger {
  background: var(--red-dim);
  border-color: var(--red-mid);
  color: var(--red);
}

/* ─── Tabelas ─── */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  background: var(--surface-1);
}

.table-wrap table,
.table-wrap .table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0;
  color: var(--text-1);
}

.table-wrap thead {
  background: var(--surface-2);
  position: sticky;
  top: 0;
  z-index: 2;
}

.table-wrap th {
  padding: 8px var(--pad);
  text-align: left;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 400;
  color: var(--text-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-1);
  white-space: nowrap;
  background: transparent;
}

.table-wrap td {
  padding: 9px var(--pad);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-1);
  border-bottom: 1px solid var(--border-1);
  vertical-align: middle;
}

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

.table-wrap tbody tr:hover td {
  background: var(--brand-dim);
}

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

.table-actions {
  display: flex;
  gap: 4px;
  white-space: nowrap;
}

.card-gradient {
  background: linear-gradient(135deg, var(--surface-1) 0%, var(--surface-2) 100%);
}

.card-icon {
  position: relative;
  padding-top: var(--spacing-2xl);
}

.card-icon::before {
  content: '';
  position: absolute;
  top: var(--spacing-lg);
  left: var(--spacing-xl);
  width: 3rem;
  height: 3rem;
  background-color: var(--brand);
  border-radius: var(--r-lg);
}

/* ─── Modal / Dropdown (vidro fosco — v4) ─── */

.modal-backdrop {
  background: var(--scrim);
}

.modal-backdrop.show {
  opacity: 1;
  backdrop-filter: saturate(120%) blur(3px);
  -webkit-backdrop-filter: saturate(120%) blur(3px);
}

.modal-dialog {
  max-width: 420px;
}

.modal-dialog.modal-lg {
  max-width: 560px;
}

.modal-content {
  border-radius: var(--r-lg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg), inset 0 1px 0 var(--glass-highlight);
  background: var(--glass-3);
  backdrop-filter: var(--blur-3);
  -webkit-backdrop-filter: var(--blur-3);
  color: var(--text-1);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--glass-border);
  background: transparent;
}

.modal-eyebrow {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 3px;
}

.modal-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.024em;
  color: var(--text-1);
  margin: 0;
  line-height: 1.25;
}

.modal-subtitle {
  font-size: 11.5px;
  color: var(--text-2);
  margin: 4px 0 0;
  line-height: 1.45;
}

.modal-header .btn-close {
  width: 26px;
  height: 26px;
  padding: 0;
  margin: 0;
  flex: none;
  border-radius: var(--r-sm);
  border: 1px solid var(--glass-border);
  background: transparent;
  opacity: 1;
  background-image: none;
  color: var(--text-2);
  display: grid;
  place-items: center;
  font-size: 10px;
  box-shadow: none;
  transition: background 0.16s var(--ease), color 0.16s var(--ease), transform 0.16s var(--ease-out);
}

.modal-header .btn-close::before {
  content: "✕";
  font-size: 11px;
  line-height: 1;
  color: currentColor;
}

.modal-header .btn-close:hover {
  background: var(--brand-dim);
  color: var(--text-1);
  transform: rotate(90deg);
  opacity: 1;
}

.modal-body {
  padding: 16px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  padding: 12px 16px;
  border-top: 1px solid var(--glass-border);
  background: var(--brand-dim);
}

.modal-result-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  overflow: hidden;
  margin: 0;
}

.modal-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface-1);
  margin: 0;
}

.modal-result-row .k {
  font-size: 11px;
  color: var(--text-2);
  flex-shrink: 0;
}

.modal-result-row .v {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-1);
  text-align: right;
  word-break: break-all;
}

.dropdown-menu {
  border-radius: var(--r-md);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg), inset 0 1px 0 var(--glass-highlight);
  background: var(--glass-3);
  backdrop-filter: var(--blur-3);
  -webkit-backdrop-filter: var(--blur-3);
  padding: 6px 0;
}

.dropdown-item {
  border-radius: var(--r-md);
  padding: 9px 16px;
  font-size: 12px;
  font-family: var(--font);
  color: var(--text-2);
  transition: all 0.12s var(--ease);
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--brand-dim);
  color: var(--text-1);
}

.dropdown-divider {
  border-color: var(--border-1);
  margin: 4px 0;
}

/* ─── Progress / Skeleton / Empty ─── */

.progress {
  height: 4px;
  background: var(--surface-3);
  border-radius: var(--r-pill);
  overflow: hidden;
}

.progress-bar {
  background: linear-gradient(90deg, var(--brand), var(--brand-light));
  border-radius: var(--r-pill);
  transition: width 0.6s var(--ease);
}

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: ds-skeleton-wave 1.8s ease infinite;
  border-radius: var(--r-md);
}

@keyframes ds-skeleton-wave {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-2);
  border-top-color: var(--brand);
  animation: ds-spin 0.7s linear infinite;
  display: inline-block;
}

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

.empty-state {
  padding: 48px 24px;
  text-align: center;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-xl);
}

.empty-state-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 6px;
}

.empty-state-desc {
  font-size: 12px;
  color: var(--text-3);
  max-width: 340px;
  margin: 0 auto 20px;
  line-height: 1.65;
}

.pagination-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border-1);
}

.ds-pagination {
  display: flex;
  gap: 4px;
}

.ds-pagination a,
.ds-pagination span,
.ds-pagination button,
.pagination .page-link {
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-family: var(--font);
  color: var(--text-2);
  background: var(--surface-1);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  text-decoration: none;
  transition: all 0.15s var(--ease);
}

.ds-pagination a:hover,
.pagination .page-link:hover {
  border-color: var(--brand-mid);
  color: var(--brand);
  background: var(--brand-dim);
}

.pagination .page-item.active .page-link,
.ds-pagination .active {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--btn-on-primary);
}

/* ─── Utilitários ─── */

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-12 { margin-bottom: 12px; }
.mb-24 { margin-bottom: 24px; }
.w-full { width: 100%; }
