/* DeliLife Admin — tema claro (cards, cantos arredondados, azul de destaque) */
:root {
  --admin-bg: #f1f5f9;
  --admin-surface: #ffffff;
  --admin-border: #e2e8f0;
  --admin-text: #0f172a;
  --admin-muted: #64748b;
  --admin-accent: #95061C;
  --admin-accent-soft: #fce8ec;
  --admin-accent-hover: #7a0517;
  --admin-danger: #dc2626;
  --admin-danger-soft: #fef2f2;
  --brand-red: #c41e3a;
  --sidebar-width: 260px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --font: 'Plus Jakarta Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  color: var(--admin-text);
  background: var(--admin-bg);
  line-height: 1.5;
}

/* ——— Login ——— */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, #fff0f2 0%, var(--admin-bg) 45%, #f8fafc 100%);
}

.login-box {
  width: 100%;
  max-width: 400px;
  background: var(--admin-surface);
  padding: 40px 36px;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--admin-border);
}

.login-brand { text-align: center; margin-bottom: 28px; }
.login-logo { height: 48px; margin-bottom: 12px; }
.login-brand h1 {
  margin: 0 0 4px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--admin-text);
  letter-spacing: -0.02em;
}
.login-brand p { margin: 0; color: var(--admin-muted); font-size: 0.9rem; }

.login-form .form-group { margin-bottom: 18px; }
.login-form label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.875rem; color: var(--admin-text); }
.login-form input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.login-form input:focus {
  outline: none;
  border-color: var(--admin-accent);
  box-shadow: 0 0 0 3px rgba(149, 6, 28, 0.15);
}
.login-form .btn { margin-top: 8px; padding: 12px; }

/* ——— Layout ——— */
.admin-body {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--admin-surface);
  border-right: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 12px rgba(15, 23, 42, 0.04);
}

.sidebar-brand {
  padding: 18px 16px 20px;
  border-bottom: 1px solid var(--admin-border);
}

.sidebar-brand-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-decoration: none;
  color: var(--admin-text);
}

.sidebar-logo-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 56px;
  object-fit: contain;
  object-position: left center;
  border-radius: 12px;
}

@media (min-width: 901px) {
  .sidebar-logo-img {
    max-height: 64px;
  }
}

.sidebar-logo-mark {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--admin-accent) 0%, #b91c3c 100%);
  flex-shrink: 0;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
}

@media (min-width: 901px) {
  .sidebar-logo-mark {
    min-height: 60px;
  }
}

.brand-text {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}

.sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 4px;
  border-radius: 10px;
  color: var(--admin-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
  transition: background 0.15s, color 0.15s;
}

.sidebar-nav .nav-group {
  margin-bottom: 6px;
}

.sidebar-nav .nav-group > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.sidebar-nav .nav-group > summary::-webkit-details-marker {
  display: none;
}

.sidebar-nav .nav-group-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--admin-muted);
  font-weight: 600;
  font-size: 0.92rem;
  transition: background 0.15s, color 0.15s;
}

.sidebar-nav .nav-group:hover > summary .nav-group-summary {
  background: #f8fafc;
  color: var(--admin-text);
}

.sidebar-nav .nav-group.is-active > summary .nav-group-summary {
  background: var(--admin-accent-soft);
  color: var(--admin-accent);
}

.sidebar-nav .nav-group-caret {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.8;
  transition: transform 0.15s ease;
}

.sidebar-nav details[open] > summary .nav-group-caret {
  transform: rotate(180deg);
}

.sidebar-nav .nav-subitems {
  margin-top: 6px;
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid var(--admin-border);
  display: grid;
  gap: 4px;
}

.sidebar-nav .nav-subitem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--admin-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
}

.sidebar-nav .nav-subitem:hover {
  background: #f8fafc;
  color: var(--admin-text);
}

.sidebar-nav .nav-subitem.active {
  background: var(--admin-accent-soft);
  color: var(--admin-accent);
}

.sidebar-nav .nav-item .nav-icon {
  flex-shrink: 0;
  opacity: 0.85;
}

.sidebar-nav .nav-item:hover {
  background: #f8fafc;
  color: var(--admin-text);
}

.sidebar-nav .nav-item.active {
  background: var(--admin-accent-soft);
  color: var(--admin-accent);
}

.sidebar-nav .nav-item.active .nav-icon {
  opacity: 1;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin: 0 10px 8px;
  border-radius: var(--radius);
  background: #f8fafc;
  border: 1px solid var(--admin-border);
}

.sidebar-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--admin-accent) 0%, #c41e3a 100%);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-user-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-user-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--admin-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 0.75rem;
  color: var(--admin-muted);
}

.sidebar-footer {
  padding: 12px 14px 18px;
  border-top: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-footer-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--admin-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.sidebar-footer-link:hover {
  background: #f8fafc;
  color: var(--admin-text);
}

.sidebar-footer-link-danger:hover {
  background: var(--admin-danger-soft);
  color: var(--admin-danger);
}

.admin-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-topbar {
  flex-shrink: 0;
  background: var(--admin-surface);
  border-bottom: 1px solid var(--admin-border);
  padding: 0 24px;
}

.admin-topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  background: var(--admin-surface);
  color: var(--admin-text);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}

.admin-menu-toggle:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.admin-sidebar-backdrop {
  display: none;
}

.admin-breadcrumb {
  font-size: 0.875rem;
  color: var(--admin-muted);
}

.admin-breadcrumb a {
  color: var(--admin-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.admin-breadcrumb a:hover {
  color: var(--admin-accent);
}

.admin-breadcrumb-sep {
  margin: 0 8px;
  opacity: 0.5;
}

.admin-breadcrumb-current {
  color: var(--admin-text);
  font-weight: 600;
}

.admin-main {
  flex: 1;
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  overflow-x: auto;
}

.admin-main:has(table.clientes-table) {
  max-width: 1680px;
}

/* ——— Page ——— */
.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--admin-text);
}

.page-header p {
  margin: 0;
  color: var(--admin-muted);
  font-size: 0.95rem;
}

/* ——— Cards dashboard ——— */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.card {
  background: var(--admin-surface);
  padding: 22px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--admin-border);
  box-shadow: var(--shadow);
}

.card-link {
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.card-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.card-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--admin-accent);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.card-label {
  font-size: 0.9rem;
  color: var(--admin-muted);
  margin-top: 4px;
}

/* ——— Dashboard KPI + gráfico ——— */
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.dash-kpi-card {
  display: flex;
  flex-direction: column;
  background: var(--admin-surface);
  border-radius: 14px;
  border: 1px solid var(--admin-border);
  box-shadow: var(--shadow);
  padding: 16px 18px 12px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  position: relative;
  overflow: hidden;
}

.dash-kpi-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 14px 0 0 14px;
  background: var(--kpi-accent, var(--admin-accent));
}

.dash-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.dash-kpi-card--rose { --kpi-accent: #95061c; --kpi-value: #95061c; }
.dash-kpi-card--violet { --kpi-accent: #8b5cf6; --kpi-value: #7c3aed; }
.dash-kpi-card--cyan { --kpi-accent: #0891b2; --kpi-value: #0e7490; }
.dash-kpi-card--amber { --kpi-accent: #ea580c; --kpi-value: #c2410c; }
.dash-kpi-card--emerald { --kpi-accent: #16a34a; --kpi-value: #15803d; }
.dash-kpi-card--teal { --kpi-accent: #0d9488; --kpi-value: #0f766e; }
.dash-kpi-card--sky { --kpi-accent: #0284c7; --kpi-value: #0369a1; }
.dash-kpi-card--fuchsia { --kpi-accent: #c026d3; --kpi-value: #a21caf; }
.dash-kpi-card--lime { --kpi-accent: #65a30d; --kpi-value: #4d7c0f; }
.dash-kpi-card--indigo { --kpi-accent: #4f46e5; --kpi-value: #3730a3; }
.dash-kpi-card--slate { --kpi-accent: #475569; --kpi-value: #334155; }

.dash-kpi-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.dash-kpi-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--admin-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dash-kpi-value {
  display: block;
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--kpi-value, var(--admin-accent));
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin-top: 4px;
}

.dash-kpi-value--money {
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.dash-kpi-trend-wrap {
  flex-shrink: 0;
  text-align: right;
}

.dash-kpi-trend {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
}

.dash-kpi-trend--up {
  background: #ecfdf5;
  color: #047857;
}

.dash-kpi-trend--down {
  background: #fef2f2;
  color: #b91c1c;
}

.dash-kpi-trend--flat {
  background: #f1f5f9;
  color: var(--admin-muted);
}

.dash-kpi-trend--na {
  background: #f8fafc;
  color: #94a3b8;
  font-weight: 600;
}

.dash-kpi-spark {
  height: 52px;
  margin: 0 -6px -4px;
  opacity: 0.95;
}

.dash-kpi-svg {
  display: block;
  width: 100%;
  height: 52px;
}

.dash-kpi-line {
  vector-effect: non-scaling-stroke;
}

.dashboard-split {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 24px;
  align-items: stretch;
}

.dashboard-actions-btns {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}

.dashboard-actions-btns .btn {
  text-align: center;
}

.dashboard-chart-panel h2 {
  margin-bottom: 6px;
}

.dashboard-chart-hint {
  margin: 0 0 16px;
  font-size: 0.85rem;
  color: var(--admin-muted);
  line-height: 1.45;
}

.dashboard-chart-hint code {
  font-size: 0.8rem;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
}

.dashboard-chart-wrap {
  position: relative;
  min-height: 300px;
  height: 320px;
  width: 100%;
}

.dashboard-top-sellers {
  margin-top: 24px;
}

.dashboard-top-sellers-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.dashboard-top-sellers-head h2 {
  margin: 0;
}

.dashboard-top-sellers-hint {
  margin: 0 0 16px;
  font-size: 0.85rem;
  color: var(--admin-muted);
  line-height: 1.45;
}

.dashboard-top-sellers-hint code {
  font-size: 0.8rem;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
}

.dashboard-top-sellers-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.dashboard-top-sellers-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 12px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  background: #ffffff;
}

.dashboard-top-sellers-rank {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--admin-accent);
  background: var(--admin-accent-soft);
}

.dashboard-top-sellers-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dashboard-top-sellers-name {
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--admin-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-top-sellers-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.dashboard-top-sellers-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #7a0517;
  background: #fff0f2;
  border: 1px solid #f5c2c7;
}

.dashboard-top-sellers-muted {
  font-size: 0.8rem;
  color: var(--admin-muted);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-top-sellers-value {
  text-align: right;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.dashboard-top-sellers-count {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--admin-text);
}

.dashboard-top-sellers-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--admin-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dash-cron-panel {
  margin-bottom: 24px;
}

.dash-cron-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.dash-cron-card {
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  padding: 14px 16px 16px;
  background: #fff;
  border-left: 4px solid #94a3b8;
}

.dash-cron-card--online,
.dash-cron-card--running {
  border-left-color: #16a34a;
  background: #f0fdf4;
}

.dash-cron-card--offline {
  border-left-color: #dc2626;
  background: #fef2f2;
}

.dash-cron-card-top {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.dash-cron-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
}

.dash-cron-badge--on {
  background: #dcfce7;
  color: #166534;
}

.dash-cron-badge--off {
  background: #fee2e2;
  color: #991b1b;
}

.dash-cron-badge--warn {
  background: #fef3c7;
  color: #92400e;
}

.dash-cron-badge--late {
  background: #ffedd5;
  color: #9a3412;
}

.dash-cron-card--late {
  border-color: #fdba74;
}

.dash-cron-title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 800;
}

.dash-cron-file {
  margin: 0 0 12px;
  font-size: 0.8rem;
  color: var(--admin-muted);
}

.dash-cron-meta {
  margin: 0;
  display: grid;
  gap: 8px;
}

.dash-cron-meta dt {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--admin-muted);
}

.dash-cron-meta dd {
  margin: 2px 0 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--admin-text);
}

.dash-cron-msg {
  margin: 10px 0 0;
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.4;
}

.dash-cron-run {
  margin-top: 12px;
}

.dash-cron-log-wrap {
  margin-top: 12px;
  font-size: 0.8rem;
}

.dash-cron-log-wrap summary {
  cursor: pointer;
  font-weight: 700;
  color: #7a0517;
}

.dash-cron-cpanel-wrap {
  margin-top: 14px;
}

.dash-cron-cpanel-wrap .dash-cron-log {
  max-height: none;
}

.dash-cron-log {
  margin: 8px 0 0;
  max-height: 180px;
  overflow: auto;
  padding: 8px 10px;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.72rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.dash-cron-flash {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.88rem;
}

.dash-cron-flash--ok {
  background: #ecfdf5;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.dash-cron-flash--err {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.dash-lists-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.dash-list-panel {
  margin-bottom: 0;
}

.dash-mini-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.dash-mini-list li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  background: #fff;
}

.dash-mini-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dash-mini-main a {
  font-weight: 700;
  color: var(--admin-text);
  text-decoration: none;
}

.dash-mini-main a:hover {
  color: var(--admin-accent);
}

.dash-mini-meta {
  font-size: 0.78rem;
  color: var(--admin-muted);
}

.dash-mini-value {
  flex-shrink: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: #166534;
}

.dash-pend-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.dash-pend-pill {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 999px;
  background: #fee2e2;
  color: #991b1b;
}

.dash-pend-pill.is-ok {
  background: #dcfce7;
  color: #166534;
}

/* ——— Ranking de cadastros por vendedor (meta) ——— */
.dashboard-rank-cadastros {
  margin-top: 24px;
}

.rank-cad-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 4px 0 18px;
}

.rank-cad-summary-item {
  background: #f8fafc;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rank-cad-summary-num {
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--admin-text);
  line-height: 1.1;
}

.rank-cad-summary-lbl {
  font-size: 0.78rem;
  color: var(--admin-muted);
}

.rank-cad-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.rank-cad-item {
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rank-cad-item--atingiu {
  border-color: #a7f3d0;
  background: #f0fdf4;
}

.rank-cad-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.rank-cad-rank {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--admin-accent);
  background: var(--admin-accent-soft);
}

.rank-cad-item--atingiu .rank-cad-rank {
  color: #065f46;
  background: #d1fae5;
}

.rank-cad-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rank-cad-name {
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--admin-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-cad-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.rank-cad-value {
  text-align: right;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.rank-cad-count {
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--admin-text);
}

.rank-cad-meta-suffix {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--admin-muted);
  margin-left: 2px;
}

.rank-cad-pct {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--admin-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rank-cad-item--atingiu .rank-cad-pct {
  color: #065f46;
}

.rank-cad-bar {
  width: 100%;
  height: 8px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
}

.rank-cad-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--admin-accent), #c41e3a);
  transition: width 0.3s ease;
}

.rank-cad-item--atingiu .rank-cad-bar-fill {
  background: linear-gradient(90deg, #16a34a, #22c55e);
}

@media (max-width: 720px) {
  .rank-cad-summary { grid-template-columns: 1fr; }
  .rank-cad-row { flex-wrap: wrap; }
  .rank-cad-value { text-align: left; flex-direction: row; gap: 8px; align-items: baseline; }
}

@media (max-width: 900px) {
  .dash-kpi-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-split,
  .dash-cron-grid,
  .dash-lists-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-chart-wrap {
    min-height: 260px;
    height: 280px;
  }
}

/* ——— Panel / Table ——— */
.panel {
  background: var(--admin-surface);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid var(--admin-border);
  box-shadow: var(--shadow);
}

.panel h2 {
  margin: 0 0 16px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--admin-text);
}

.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--admin-border); }

/* Tabelas de listagem: manter 1 linha por registro (sem quebra). */
.table-wrap table {
  table-layout: fixed;
}
.table-wrap table th,
.table-wrap table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

table th,
table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--admin-border);
}

table th {
  background: #f8fafc;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--admin-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

table tr:last-child td { border-bottom: none; }
table tbody tr:hover td { background: #fafbfc; }

.table-wrap table td a.table-link-name {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px dashed transparent;
}
.table-wrap table td a.table-link-name:hover {
  color: var(--admin-accent);
  border-bottom-color: currentColor;
}
.table-wrap table td a.table-num-link {
  color: inherit;
  text-decoration: none;
}
.table-wrap table td a.table-num-link:hover strong {
  color: var(--admin-accent);
}

.table-actions { display: flex; gap: 2px; flex-wrap: nowrap; align-items: center; }
.table-actions a { font-size: 0.9rem; }

table.clientes-table .c-col-check { width: 44px; }
table.clientes-table .c-col-nome { min-width: 160px; }
table.clientes-table .c-col-acesso { min-width: 108px; }
table.clientes-table .c-col-tipo { min-width: 90px; }
table.clientes-table .c-col-cpf { min-width: 128px; }
table.clientes-table .c-col-email { min-width: 180px; }
table.clientes-table .c-col-phone { min-width: 118px; }
table.clientes-table .c-col-date { min-width: 148px; }
table.clientes-table .c-col-vend { min-width: 160px; }
@media (min-width: 721px) {
  .panel:has(table.clientes-table) {
    max-width: 100%;
    overflow: hidden;
  }
  .table-wrap:has(table.clientes-table) {
    overflow-x: auto;
    max-width: 100%;
    width: 100%;
  }
  .table-wrap table.clientes-table {
    table-layout: auto;
    width: max-content;
    min-width: 100%;
  }
  .table-wrap table.clientes-table th,
  .table-wrap table.clientes-table td {
    overflow: visible;
    text-overflow: clip;
  }
  .table-wrap table.clientes-table .c-col-nome,
  .table-wrap table.clientes-table .c-col-email {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  table.clientes-table .c-col-nome .badge {
    display: none;
  }
  table.clientes-table tbody tr.clientes-row--bloqueado td {
    background: #fff7f7;
  }
  table.clientes-table th.c-col-acoes,
  table.clientes-table td.c-col-acoes {
    position: sticky;
    right: 0;
    background: #fff;
    box-shadow: -6px 0 8px -6px rgba(15, 23, 42, 0.16);
    z-index: 2;
  }
  table.clientes-table thead th.c-col-acoes {
    background: #f8fafc;
  }
  table.clientes-table tbody tr.clientes-row--bloqueado td.c-col-acoes {
    background: #fff7f7;
  }
}
table.clientes-table .c-col-acoes {
  width: 52px;
  text-align: right;
  overflow: visible;
  text-overflow: clip;
}
table.clientes-table th.c-col-acoes,
table.clientes-table td.c-col-acoes {
  overflow: visible;
}

.dl-row-actions {
  display: inline-flex;
  justify-content: flex-end;
  position: relative;
}
.dl-row-actions .js-row-actions {
  width: 36px;
  height: 36px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--admin-accent);
  border-color: var(--admin-accent);
  background: #fff;
}
.dl-row-actions .js-row-actions[aria-expanded="true"] {
  background: var(--admin-accent);
  color: #fff;
}
.dl-row-actions-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 10040;
}
.dl-row-actions-menu {
  z-index: 10050;
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
  min-width: 240px;
  overflow: hidden;
}
.dl-row-actions-menu[hidden],
.dl-row-actions-backdrop[hidden] {
  display: none !important;
}
.dl-row-actions-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border-bottom: 1px solid var(--admin-border);
}
.dl-row-actions-menu-title {
  font-size: 0.85rem;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dl-row-actions-close {
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
  padding: 0 4px;
}
.dl-row-actions-menu-body {
  display: flex;
  flex-direction: column;
  padding: 6px;
}
.dl-row-actions-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--admin-text);
  text-decoration: none;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  width: 100%;
}
.dl-row-actions-item:hover {
  background: var(--admin-accent-soft, #fce7eb);
  color: var(--admin-accent);
}
.dl-row-actions-item small {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--admin-muted);
  margin-top: 2px;
}
.dl-row-actions-item--app {
  border-top: 1px solid var(--admin-border);
  margin-top: 4px;
  padding-top: 12px;
  border-radius: 0 0 10px 10px;
}
.dl-row-actions-extra {
  margin-top: 6px;
  padding: 8px 10px 10px;
  border-top: 1px solid var(--admin-border);
}
.dl-row-actions-extra .dl-acesso-form,
.dl-row-actions-extra .dl-acesso-select {
  width: 100%;
  display: block;
}
body.dl-row-actions-open {
  overflow: hidden;
}

.dl-acesso-form {
  display: inline-flex;
  margin: 0;
  vertical-align: middle;
}
.dl-acesso-select {
  height: 36px;
  min-width: 108px;
  padding: 4px 8px;
  font-size: 0.8rem;
  border: 1px solid var(--admin-accent, #0d9488);
  border-radius: 8px;
  background: #fff;
  color: var(--admin-accent, #0d9488);
  cursor: pointer;
}
.dl-acesso-select.is-bloqueado {
  border-color: #b91c1c;
  color: #b91c1c;
  background: #fef2f2;
}
.clientes-mobile-actions .dl-acesso-select {
  height: 34px;
  min-width: 100px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.btn-icon span[aria-hidden="true"] { font-size: 16px; }

/* Compactar botões pequenos (principalmente nos ícones da grid) */
.table-actions .btn-sm {
  padding: 6px 2px;
  font-size: 0.85rem;
}
.table-actions .btn-outline {
  background: transparent;
  color: var(--admin-accent);
  border: 1px solid var(--admin-accent);
  padding: 6px 8px;
}
.table-actions .btn-outline:hover {
  background: var(--admin-accent-soft);
}

/* Vendedores: mobile — nome, cadastros e botão copiar link */
@media (max-width: 720px) {
  .table-wrap table.vendedores-table {
    table-layout: auto;
    border: none;
  }

  .table-wrap table.vendedores-table thead {
    display: none;
  }

  .table-wrap table.vendedores-table tbody tr {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "nome nome"
      "cadastros link";
    gap: 10px 12px;
    align-items: center;
    padding: 14px 12px;
    border-bottom: 1px solid var(--admin-border);
    background: #fff;
  }

  .table-wrap table.vendedores-table tbody tr:hover td {
    background: transparent;
  }

  .table-wrap table.vendedores-table tbody td {
    display: block;
    padding: 0;
    border: none;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .table-wrap table.vendedores-table .v-col-nome {
    grid-area: nome;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
  }

  .table-wrap table.vendedores-table .v-col-nome a {
    color: var(--admin-text);
  }

  .table-wrap table.vendedores-table .v-col-cadastros {
    grid-area: cadastros;
    font-size: 0.95rem;
    color: var(--admin-muted);
  }

  .table-wrap table.vendedores-table .v-col-cadastros::before {
    content: "Cadastros: ";
    font-weight: 600;
    color: var(--admin-muted);
  }

  .table-wrap table.vendedores-table .v-col-cadastros strong,
  .table-wrap table.vendedores-table .v-col-cadastros a {
    font-size: 1.125rem;
    color: var(--admin-text);
  }

  .table-wrap table.vendedores-table .v-col-link {
    grid-area: link;
    max-width: none !important;
    text-align: right;
  }

  .table-wrap table.vendedores-table .v-link-url-full,
  .table-wrap table.vendedores-table .v-link-codigo,
  .table-wrap table.vendedores-table .v-link-empty {
    display: none !important;
  }

  .table-wrap table.vendedores-table .v-link-actions {
    margin: 0 !important;
    justify-content: flex-end;
  }

  .table-wrap table.vendedores-table .copy-vend-link {
    white-space: nowrap;
    padding: 10px 14px !important;
    font-size: 0.875rem !important;
    color: var(--admin-accent) !important;
    border-color: var(--admin-accent) !important;
    background: #fff !important;
  }

  .table-wrap table.vendedores-table .v-col-email,
  .table-wrap table.vendedores-table .v-col-telefone,
  .table-wrap table.vendedores-table .v-col-superior,
  .table-wrap table.vendedores-table .v-col-vendas,
  .table-wrap table.vendedores-table .v-col-status,
  .table-wrap table.vendedores-table .v-col-acoes {
    display: none !important;
  }

  /* Sem coluna de link: cadastros ocupa a linha */
  .table-wrap table.vendedores-table:not(:has(.v-col-link)) tbody tr {
    grid-template-areas:
      "nome nome"
      "cadastros cadastros";
  }
}

/* Clientes: mobile em cartões — nome visível e um botão de ações */
@media (max-width: 720px) {
  .admin-main:has(table.clientes-table) {
    overflow: visible;
  }

  .panel:has(table.clientes-table) {
    padding: 12px;
    overflow: visible;
    max-width: 100%;
  }

  .table-wrap:has(table.clientes-table) {
    overflow: visible;
    border: none;
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
    width: 100%;
  }

  table.clientes-table {
    table-layout: auto;
    border: none;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  table.clientes-table .c-col-check,
  table.clientes-table .c-col-nome,
  table.clientes-table .c-col-acesso,
  table.clientes-table .c-col-tipo,
  table.clientes-table .c-col-cpf,
  table.clientes-table .c-col-email,
  table.clientes-table .c-col-phone,
  table.clientes-table .c-col-date,
  table.clientes-table .c-col-vend,
  table.clientes-table .c-col-reg,
  table.clientes-table .c-col-cob,
  table.clientes-table .c-col-acoes {
    min-width: 0;
  }

  table.clientes-table thead {
    display: none;
  }

  table.clientes-table tbody tr {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "check nome acoes"
      "check tipo acoes"
      "check phone acoes";
    gap: 2px 10px;
    align-items: center;
    padding: 12px 10px;
    margin-bottom: 8px;
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    background: #fff;
  }

  table.clientes-table tbody tr:hover td {
    background: transparent;
  }

  table.clientes-table tbody td {
    display: block;
    padding: 0;
    border: none;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  table.clientes-table .c-col-check { grid-area: check; width: auto; }
  table.clientes-table .c-col-nome {
    grid-area: nome;
    font-weight: 700;
    font-size: 0.98rem;
    line-height: 1.3;
  }
  table.clientes-table .c-col-tipo { grid-area: tipo; font-size: 0.8rem; color: var(--admin-muted); }
  table.clientes-table .c-col-phone { grid-area: phone; font-size: 0.85rem; color: var(--admin-muted); }
  table.clientes-table .c-col-acoes {
    grid-area: acoes;
    width: auto;
    align-self: start;
  }

  table.clientes-table .c-col-acesso,
  table.clientes-table .c-col-cpf,
  table.clientes-table .c-col-email,
  table.clientes-table .c-col-date,
  table.clientes-table .c-col-vend,
  table.clientes-table .c-col-reg,
  table.clientes-table .c-col-cob {
    display: none !important;
  }

  table.clientes-table--cobranca tbody tr {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "nome acoes"
      "phone acoes";
  }

  table.clientes-table tbody tr:not(:has(.c-col-check)) {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "nome acoes"
      "phone acoes";
  }

  table.clientes-table tbody tr:not(:has(.c-col-phone)):not(:has(.c-col-tipo)) {
    grid-template-areas:
      "check nome acoes";
  }

  table.clientes-table tbody tr:not(:has(.c-col-check)):not(:has(.c-col-phone)) {
    grid-template-areas:
      "nome acoes";
  }

  .table-actions { gap: 6px; }
  .btn-icon { width: 34px; height: 34px; }
  .dl-row-actions .js-row-actions { width: 40px; height: 40px; }
}

/* ——— Buttons ——— */
.btn {
  display: inline-block;
  padding: 10px 18px;
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.btn-primary {
  background: var(--admin-accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(149, 6, 28, 0.2);
}

.btn-primary:hover {
  background: var(--admin-accent-hover);
  opacity: 1;
}

.btn-outline {
  background: transparent;
  color: var(--admin-accent);
  border: 1px solid var(--admin-accent);
  padding: 9px 17px;
}

.btn-outline:hover {
  background: var(--admin-accent-soft);
}

.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-block { width: 100%; display: block; }

/* ——— Form ——— */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--admin-text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: var(--font);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--admin-accent);
  box-shadow: 0 0 0 3px rgba(149, 6, 28, 0.12);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.form-actions { margin-top: 24px; display: flex; gap: 12px; flex-wrap: wrap; }

.form-actions--sticky {
  position: sticky;
  bottom: 0;
  z-index: 40;
  margin: 24px -24px -24px;
  padding: 16px 24px;
  background: var(--admin-surface);
  border-top: 1px solid var(--admin-border);
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.06);
}

.page-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* ——— Alert ——— */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.9375rem;
}

.alert-error {
  background: var(--admin-danger-soft);
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.empty-state { text-align: center; padding: 48px 24px; color: var(--admin-muted); }
.empty-state p { margin: 0 0 16px; }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-ativo { background: #d1fae5; color: #065f46; }
.badge-cancelado { background: #fee2e2; color: #991b1b; }
.badge-bloqueado { background: #fef3c7; color: #92400e; }
.badge-pendente { background: #dbeafe; color: #1e40af; }
.badge-pago { background: #d1fae5; color: #065f46; }
.badge-atrasado { background: #fee2e2; color: #991b1b; }

/* ——— Paytime ——— */
.paytime-doc h2 { margin-top: 0; }
.paytime-doc h3 { margin-top: 20px; font-size: 1.05rem; }
.paytime-alert { background: #fffbeb; border: 1px solid #fde68a; padding: 12px 14px; border-radius: var(--radius-sm); }
.paytime-note { font-size: 0.9rem; color: var(--admin-muted); }
.paytime-code {
  background: #1e293b;
  color: #e2e8f0;
  padding: 16px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.45;
}

.paytime-response { max-height: 400px; overflow: auto; margin-top: 12px; }
.paytime-hint { font-size: 0.85rem; color: var(--admin-muted); }

.paytime-result-panel { border: 1px solid var(--admin-border); }
.paytime-result-active {
  border-color: var(--admin-accent);
  box-shadow: 0 0 0 1px rgba(149, 6, 28, 0.12);
}

.paytime-result-title { margin-top: 0; font-size: 1.15rem; font-weight: 600; }
.paytime-result-empty {
  color: var(--admin-muted);
  margin: 0;
  padding: 24px;
  text-align: center;
  background: #f8fafc;
  border-radius: var(--radius-sm);
}

.paytime-http {
  font-size: 1.75rem;
  font-weight: 800;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.paytime-http-ok { color: #059669; }
.paytime-http-warn { color: #d97706; }
.paytime-http-bad { color: #dc2626; }
.paytime-http-error { color: #dc2626; font-size: 1.25rem; }

.paytime-url-line { word-break: break-all; font-size: 0.9rem; margin: 0 0 16px; color: var(--admin-muted); }
.paytime-subh { font-size: 0.95rem; margin: 16px 0 8px; font-weight: 600; }
.paytime-response-main { min-height: 120px; max-height: 70vh; overflow: auto; font-size: 0.9rem; }
.paytime-details-raw { margin-top: 16px; }
.paytime-details-raw summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; color: var(--admin-accent); }

.paytime-radio { display: block; margin: 8px 0; font-weight: normal; cursor: pointer; }
.paytime-radio input { margin-right: 8px; }

.paytime-doc-alert { background: #fff0f2; border: 1px solid #f5c2c7; }
.paytime-doc-collapsed summary { cursor: pointer; padding: 8px 0; }
.paytime-doc-inner { padding-top: 12px; border-top: 1px solid var(--admin-border); }

.paytime-doc-panel summary {
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 0;
  color: var(--admin-text);
}

.paytime-doc-panel .paytime-doc-inner {
  padding-top: 16px;
  margin-top: 12px;
  border-top: 1px solid var(--admin-border);
}

.paytime-doc-panel .paytime-doc-steps {
  margin: 12px 0;
  padding-left: 1.25rem;
  line-height: 1.6;
}

.paytime-doc-panel .paytime-doc-list {
  margin: 8px 0 12px;
  padding-left: 1.25rem;
  line-height: 1.55;
}

.paytime-doc-panel .paytime-doc-note {
  font-size: 0.9rem;
  color: var(--admin-muted);
  margin: 12px 0 0;
}

.paytime-doc-panel .paytime-doc-warn {
  margin: 16px 0 0;
  padding: 10px 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.paytime-two-keys-info {
  margin-bottom: 20px;
  line-height: 1.55;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a5f;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
}

.alert.paytime-fallback-note {
  margin-bottom: 16px;
  background: #f0f9ff;
  border: 1px solid #7dd3fc;
  color: #0c4a6e;
  font-size: 0.9rem;
}

.paytime-401-help {
  line-height: 1.55;
  margin-bottom: 16px;
}

.paytime-401-help code {
  font-size: 0.85rem;
}

.paytime-integration-server {
  margin-bottom: 20px;
  line-height: 1.5;
}

.paytime-integration-missing {
  margin-bottom: 20px;
  line-height: 1.5;
}

.paytime-integration-missing code {
  font-size: 0.85rem;
}

.paytime-form-hint {
  font-size: 0.875rem;
  color: var(--admin-muted);
  margin: 0 0 16px;
  line-height: 1.45;
}

.paytime-credential-input {
  font-family: ui-monospace, 'Cascadia Code', 'Consolas', monospace;
  font-size: 0.9rem;
}

.paytime-prefill-ta {
  width: 100%;
  font-family: ui-monospace, 'Cascadia Code', 'Consolas', monospace;
  font-size: 12px;
  box-sizing: border-box;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--admin-border, #ddd);
}

.paytime-prefill-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}

.btn-lg { padding: 14px 28px; font-size: 1.05rem; }

/* ——— Cartão (preview) ——— */
.dl-card-preview {
  width: min(520px, 100%);
  aspect-ratio: 1.586 / 1; /* ~ formato cartão */
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
  background: linear-gradient(135deg, var(--admin-accent) 0%, #b91c3c 45%, #7a0517 100%);
  color: #fff;
  position: relative;
}
.dl-card-preview::before{
  content:"";
  position:absolute;
  inset:-60px -60px auto auto;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  filter: blur(0.2px);
}
.dl-card-preview::after{
  content:"";
  position:absolute;
  inset:auto auto -70px -70px;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
}
.dl-card-inner{
  position: relative;
  height: 100%;
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dl-card-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
}
.dl-card-brand{
  display:flex;
  flex-direction:column;
  gap: 4px;
  min-width: 0;
}
.dl-card-brand .dl-card-title{
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 1.05rem;
  margin: 0;
}
.dl-card-brand .dl-card-sub{
  font-size: 0.78rem;
  opacity: 0.9;
  font-weight: 600;
}
.dl-card-chip{
  width: 44px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(145deg, #fcd34d 0%, #d4a012 55%, #b45309 100%);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.18);
  flex-shrink: 0;
}
.dl-card-body{
  margin-top: auto;
  display:grid;
  gap: 10px;
}
.dl-card-name{
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  line-height: 1.2;
  word-break: break-word;
}
.dl-card-meta{
  display:flex;
  flex-wrap:wrap;
  gap: 10px 14px;
  align-items:flex-end;
}
.dl-card-meta .dl-card-k{
  font-size: 0.70rem;
  opacity: 0.85;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.dl-card-meta .dl-card-v{
  font-size: 0.92rem;
  font-weight: 800;
}
.dl-card-number{
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.95rem;
  letter-spacing: 0.10em;
  opacity: 0.95;
  white-space: nowrap;
}
.dl-card-footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  margin-top: 6px;
}
.dl-card-footer .dl-card-help{
  font-size: 0.75rem;
  opacity: 0.9;
  font-weight: 650;
}
.dl-card-photo{
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.30);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 900;
  letter-spacing: 0.02em;
  flex-shrink:0;
}

/* ——— Mobile: menu drawer + conteúdo em largura total ——— */
@media (max-width: 900px) {
  .admin-menu-toggle {
    display: inline-flex;
  }

  .admin-body.admin-nav-open {
    overflow: hidden;
  }

  .admin-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 190;
    background: rgba(15, 23, 42, 0.5);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }

  body.admin-nav-open .admin-sidebar-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    width: min(288px, 88vw);
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: none;
  }

  body.admin-nav-open .admin-sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(15, 23, 42, 0.18);
  }

  .admin-shell {
    flex: 1;
    width: 100%;
    min-width: 0;
  }

  .admin-topbar {
    padding: 0 12px 0 16px;
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .admin-topbar-inner {
    min-height: 52px;
  }

  .admin-breadcrumb {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .admin-main {
    padding: 16px;
  }

  .page-header h1 {
    font-size: 1.3rem;
  }

  .dashboard-cards {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    margin-left: -4px;
    margin-right: -4px;
    border-radius: var(--radius-sm);
  }

  table th,
  table td {
    padding: 10px 12px;
    font-size: 0.875rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 901px) {
  .admin-sidebar-backdrop {
    display: none !important;
  }
}

/* ——— Cliente extra_fields (legível) ——— */
.dl-extra-wrap {
  margin-top: 8px;
  display: grid;
  gap: 20px;
}
.dl-extra-block {
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid var(--admin-border, #e2e8f0);
  border-radius: var(--radius-sm, 8px);
}
.dl-extra-h4 {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 600;
}
.dl-extra-hint {
  margin: 0 0 14px;
  font-size: 0.875rem;
  color: var(--admin-muted, #64748b);
}
.dl-extra-list {
  margin: 0;
  padding-left: 1.2rem;
}
.dl-extra-list li {
  margin: 6px 0;
}
.dl-extra-k { font-weight: 600; margin-right: 4px; }
.dl-extra-yes { color: #065f46; font-weight: 600; }
.dl-extra-no { color: #64748b; }

.dl-sync-card {
  margin-bottom: 14px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--admin-border, #e2e8f0);
  border-radius: var(--radius-sm, 8px);
}
.dl-sync-card:last-child { margin-bottom: 0; }
.dl-sync-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.dl-sync-title { font-size: 0.95rem; }
.dl-sync-http {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
.dl-http-2xx { background: #d1fae5; color: #065f46; }
.dl-http-4xx { background: #fef3c7; color: #92400e; }
.dl-http-neutral { background: #e2e8f0; color: #334155; }
.dl-sync-summary {
  margin: 0 0 10px;
  font-size: 0.9375rem;
  line-height: 1.45;
}
.dl-sync-dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  font-size: 0.875rem;
}
.dl-sync-dl dt {
  margin: 0;
  color: var(--admin-muted, #64748b);
  font-weight: 500;
}
.dl-sync-dl dd {
  margin: 0;
}
.dl-sync-code {
  font-size: 0.8rem;
  word-break: break-all;
}
.dl-sync-details {
  margin-top: 10px;
  font-size: 0.85rem;
}
.dl-sync-details summary {
  cursor: pointer;
  color: var(--admin-accent, #95061c);
  font-weight: 500;
}
.dl-sync-pre {
  margin: 8px 0 0;
  padding: 12px;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: var(--radius-sm, 8px);
  overflow-x: auto;
  font-size: 0.78rem;
  line-height: 1.45;
  max-height: 320px;
}

/* ——— Pesquisa de rua (assistência) ——— */
.pa-admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
}

.pa-admin-tab {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--admin-text-muted, #64748b);
  background: var(--admin-surface, #fff);
  border: 1px solid var(--admin-border, #e2e8f0);
}

.pa-admin-tab.is-active {
  color: #fff;
  background: var(--admin-accent, #95061c);
  border-color: var(--admin-accent, #95061c);
}

.pa-filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}

.pa-filter-form label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
}

.pa-grid-wrap {
  overflow-x: auto;
}

.pa-data-grid {
  font-size: 0.82rem;
  min-width: 1100px;
}

.pa-data-grid th,
.pa-data-grid td {
  white-space: nowrap;
  vertical-align: top;
}

.pa-data-grid td:nth-child(6),
.pa-data-grid td:nth-child(7),
.pa-data-grid td:nth-child(8) {
  white-space: normal;
  max-width: 180px;
}

.pa-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.pa-kpi-card {
  background: var(--admin-surface, #fff);
  border: 1px solid var(--admin-border, #e2e8f0);
  border-radius: var(--radius, 12px);
  padding: 16px 18px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.pa-kpi-label {
  display: block;
  font-size: 0.8rem;
  color: var(--admin-text-muted, #64748b);
  margin-bottom: 6px;
}

.pa-kpi-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--admin-accent, #95061c);
  line-height: 1.1;
}

.pa-bar-chart {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pa-bar-chart li {
  display: grid;
  grid-template-columns: 52px 1fr 40px;
  gap: 10px;
  align-items: center;
}

.pa-bar-label {
  font-size: 0.82rem;
  color: var(--admin-text-muted, #64748b);
}

.pa-bar-track {
  height: 10px;
  background: #e8ecf1;
  border-radius: 999px;
  overflow: hidden;
}

.pa-bar-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #95061c, #c41e3a);
  border-radius: 999px;
}

.pa-bar-count {
  font-weight: 700;
  font-size: 0.88rem;
  text-align: right;
}

.pa-report-cols {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.pa-report-panel h3 {
  color: var(--admin-text, #0f172a);
}

@media (max-width: 720px) {
  .pa-report-cols {
    grid-template-columns: 1fr;
  }
}
