:root {
  --brand: #0057b8;
  --brand-deep: #003c7a;
  --accent: #4da3ff;
  --sand: #d0e4f7;
  --sand-light: #e8f1fb;
  --concrete: #4b5563;
  --iron: #1f2937;
  --dust: #d0e4f7;
  --ok: #0f766e;
  --warn: #b45309;
  --danger: #b91c1c;
  --white: #ffffff;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0, 60, 122, 0.18);
  --font-display: "Manrope", system-ui, sans-serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  color: var(--iron);
  background:
    radial-gradient(ellipse 120% 80% at 10% -10%, rgba(77, 163, 255, 0.22), transparent 55%),
    radial-gradient(ellipse 90% 60% at 100% 0%, rgba(0, 87, 184, 0.18), transparent 50%),
    linear-gradient(165deg, #e8f1fb 0%, #d0e4f7 42%, #b8d4f0 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  background-image: repeating-linear-gradient(
    -12deg,
    transparent,
    transparent 11px,
    #003c7a 11px,
    #003c7a 12px
  );
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 1rem 1rem 5.5rem;
}

.brand {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  font-size: clamp(2rem, 10vw, 2.6rem);
  font-weight: 800;
  line-height: 1.05;
  color: var(--brand-deep);
  margin: 0;
}

.brand span {
  display: block;
  color: var(--accent);
}

.tagline {
  margin: 0.4rem 0 0;
  color: var(--concrete);
  font-size: 1rem;
  font-weight: 600;
}

.screen {
  animation: rise 0.45s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero-login {
  padding: 2.5rem 0 1.5rem;
}

.panel {
  background: color-mix(in srgb, var(--white) 88%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid color-mix(in srgb, var(--dust) 55%, transparent);
  border-radius: var(--radius);
  padding: 1.1rem;
  box-shadow: var(--shadow);
}

.panel + .panel {
  margin-top: 0.9rem;
}

.panel h2,
.panel h3 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--brand-deep);
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--concrete);
  margin: 0.65rem 0 0.3rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1.5px solid var(--dust);
  background: var(--sand-light);
  border-radius: 10px;
  padding: 0.85rem 0.9rem;
  font: inherit;
  font-size: 1.05rem;
  line-height: 1.25;
  color: var(--iron);
  min-height: 3.15rem;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 1.4rem;
  height: 1.4rem;
  min-width: 1.4rem;
  min-height: 1.4rem;
  max-width: 1.4rem;
  max-height: 1.4rem;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  border: 2px solid var(--brand);
  border-radius: 6px;
  background-color: var(--sand-light);
  background-image: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 0.95rem 0.95rem;
  box-sizing: border-box;
  cursor: pointer;
  vertical-align: middle;
}

input[type="checkbox"]:checked {
  border-color: var(--brand-deep);
  background-color: var(--brand-deep);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.2l3 3.1 6-6.4'/%3E%3C/svg%3E");
}

input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

input[type="date"],
input[type="time"] {
  display: block;
  min-height: 3.15rem;
  max-height: 3.15rem;
  padding: 0.7rem 0.9rem;
}

.subhead {
  margin: 1.1rem 0 0.2rem;
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brand-deep);
}

.report {
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--dust) 70%, transparent);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  color: var(--iron);
  overflow: hidden;
}

.report-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 2px solid var(--brand-deep);
  margin-bottom: 0.9rem;
}

.report-brand {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  color: var(--brand-deep);
  font-size: 1.4rem;
  font-weight: 800;
}

.report-header h2 {
  margin: 0.15rem 0 0.35rem;
  font-size: 1.15rem;
  color: var(--iron);
}

.report-meta,
.report-period {
  margin: 0;
  font-size: 0.88rem;
  color: var(--concrete);
}

.report-period {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.report-period span {
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.report-kpis {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

@media (min-width: 420px) {
  .report-kpis {
    grid-template-columns: repeat(3, 1fr);
  }
}

.kpi {
  background: var(--sand-light);
  border-radius: 10px;
  padding: 0.65rem 0.7rem;
}

.kpi span {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--concrete);
  font-weight: 700;
}

.kpi strong {
  font-size: 1.05rem;
  color: var(--iron);
}

.kpi-extra {
  background: #d1fae5;
}

.kpi-extra strong {
  color: var(--ok);
}

.kpi-debit {
  background: #fee2e2;
}

.kpi-debit strong {
  color: var(--danger);
}

.report-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -0.25rem;
  padding: 0 0.25rem;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  font-size: 0.82rem;
}

.report-table th,
.report-table td {
  border-bottom: 1px solid var(--sand);
  padding: 0.55rem 0.4rem;
  text-align: left;
  white-space: nowrap;
}

.report-table th {
  background: var(--sand-light);
  color: var(--brand-deep);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.report-table tbody tr:nth-child(even) {
  background: #f8fbff;
}

.row-extra {
  background: #ecfdf5 !important;
}

.row-debit {
  background: #fef2f2 !important;
}

.extra-cell {
  color: var(--ok);
  font-weight: 700;
}

.debit-cell {
  color: var(--danger);
  font-weight: 700;
}

.empty-cell {
  text-align: center !important;
  color: var(--concrete);
  padding: 1.2rem 0.5rem !important;
}

.report-footer {
  margin-top: 0.85rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--sand);
  font-size: 0.8rem;
  color: var(--concrete);
}

.report-footer p {
  margin: 0.2rem 0;
}

@media print {
  body::before,
  .nav,
  .no-print,
  .topbar .btn {
    display: none !important;
  }

  #app {
    max-width: none;
    padding: 0;
  }

  .report {
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 0;
  }

  .report-table {
    min-width: 0;
    font-size: 10pt;
  }
}

select {
  background-image: linear-gradient(45deg, transparent 50%, var(--concrete) 50%),
    linear-gradient(135deg, var(--concrete) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.2rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 70%, white);
  border-color: var(--accent);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  align-items: end;
}

.field {
  min-width: 0;
}

.field label {
  margin-top: 0.65rem;
}

.field input,
.field select {
  width: 100%;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 0.95rem 1rem;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--brand-deep));
  color: var(--white);
  box-shadow: 0 8px 20px rgba(0, 60, 122, 0.28);
  margin-top: 1rem;
}

.btn-secondary {
  background: var(--sand);
  color: var(--iron);
  margin-top: 0.6rem;
}

.btn-ok {
  background: linear-gradient(135deg, #14b8a6, var(--ok));
  color: white;
  margin-top: 0.75rem;
}

.btn-ghost {
  background: transparent;
  color: var(--brand-deep);
  border: 1.5px solid var(--dust);
  margin-top: 0.6rem;
}

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

.msg {
  margin-top: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
}

.msg-error {
  background: #fee2e2;
  color: var(--danger);
}

.msg-ok {
  background: #ccfbf1;
  color: var(--ok);
}

.msg-warn {
  background: #fef3c7;
  color: var(--warn);
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.topbar .brand {
  font-size: 1.75rem;
}

.user-chip {
  text-align: right;
  font-size: 0.85rem;
  color: var(--concrete);
}

.user-chip strong {
  display: block;
  color: var(--iron);
  font-size: 0.95rem;
}

.clock {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
  color: var(--brand-deep);
  margin: 0.2rem 0;
}

.clock-sub {
  text-align: center;
  color: var(--concrete);
  margin: 0 0 1rem;
  font-weight: 600;
}

.status-pill {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-trabalhando {
  background: #ccfbf1;
  color: var(--ok);
}
.status-almoco {
  background: #fef3c7;
  color: var(--warn);
}
.status-saiu {
  background: #e5e7eb;
  color: var(--concrete);
}
.status-sem_batida {
  background: var(--sand-light);
  color: var(--brand);
}

.status-pendente {
  background: #fef3c7;
  color: var(--warn);
}

.status-aprovado {
  background: #ccfbf1;
  color: var(--ok);
}

.status-rejeitado {
  background: #fee2e2;
  color: var(--danger);
}

.saldo-dia {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.75rem 0 0;
}

.saldo-dia .saldo-valor {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
}

.saldo-extra {
  color: var(--ok);
}

.saldo-debito {
  color: var(--danger);
}

.justificativa-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  background: color-mix(in srgb, var(--accent) 20%, white);
  color: var(--brand-deep);
  margin: 0.5rem 0;
}

.person-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--dust) 70%, transparent);
}

.person-row:last-child {
  border-bottom: none;
}

.person-row .name {
  font-weight: 700;
  font-size: 1.05rem;
}

.person-row .meta {
  grid-column: 1 / -1;
  color: var(--concrete);
  font-size: 0.9rem;
}

.setor-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(480px, 100%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.25rem;
  padding: 0.55rem 0.5rem calc(0.55rem + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--iron) 94%, black);
  border-top: 1px solid rgba(77, 163, 255, 0.25);
  z-index: 20;
}

.nav-gestor {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto;
  max-height: 7.8rem;
  overflow-y: auto;
}

#app:has(.nav-gestor) {
  padding-bottom: 8rem;
}

.nav-colab {
  grid-template-columns: repeat(3, 1fr);
}

.nav button {
  border: none;
  background: transparent;
  color: var(--sand);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.45rem 0.2rem;
  border-radius: 10px;
  cursor: pointer;
}

.nav button.active {
  background: rgba(77, 163, 255, 0.35);
  color: var(--white);
}

.punch-btn {
  min-height: 5.5rem;
  font-size: 1.25rem;
  border-radius: 16px;
  margin-top: 1rem;
}

.timeline {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}

.timeline li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0;
  border-bottom: 1px dashed var(--dust);
  font-size: 0.95rem;
}

.timeline li span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.foto-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.foto-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0;
  border: 1.5px solid var(--dust);
  border-radius: 10px;
  background: var(--sand-light);
  overflow: hidden;
  cursor: pointer;
  width: 4.5rem;
  font: inherit;
  color: var(--concrete);
  font-size: 0.68rem;
  font-weight: 700;
}

.foto-thumb img {
  width: 100%;
  height: 3.4rem;
  object-fit: cover;
  display: block;
  background: #ddd;
}

.foto-thumb.mini {
  width: 2.2rem;
  border-radius: 6px;
}

.foto-thumb.mini img {
  height: 2.2rem;
}

.foto-thumb span {
  padding: 0.15rem 0.2rem 0.3rem;
  text-align: center;
  line-height: 1.1;
}

.foto-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  gap: 0.75rem;
}

.foto-lightbox[hidden] {
  display: none !important;
}

.foto-lightbox img {
  max-width: min(96vw, 480px);
  max-height: 70vh;
  border-radius: 12px;
  object-fit: contain;
  background: #111;
}

.foto-lightbox-title {
  color: #fff;
  margin: 0;
  font-weight: 700;
  text-align: center;
}

.foto-lightbox-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

.camera-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(15, 23, 42, 0.72);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0.75rem;
}

.camera-sheet {
  width: min(520px, 100%);
  background: var(--white);
  border-radius: 18px 18px 12px 12px;
  padding: 1rem 1rem 1.1rem;
  box-shadow: var(--shadow);
}

.camera-sheet h2 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--brand-deep);
  font-size: 1.35rem;
  font-weight: 700;
}

.camera-frame {
  margin-top: 0.75rem;
  border-radius: 14px;
  overflow: hidden;
  background: #1a1410;
  aspect-ratio: 3 / 4;
  max-height: 55vh;
}

.camera-frame video,
.camera-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hint {
  font-size: 0.88rem;
  color: var(--concrete);
  margin: 0.5rem 0 0;
}

.row-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.row-actions .btn {
  margin-top: 0;
}

.crud-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.45rem;
  margin-top: 0.25rem;
  flex-wrap: wrap;
}

.btn-mini {
  width: auto;
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
  margin-top: 0;
  background: var(--sand);
  color: var(--iron);
}

.btn-danger-mini {
  background: #fee2e2;
  color: var(--danger);
}

.btn-ok-mini {
  background: #ccfbf1;
  color: var(--ok);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
  background: color-mix(in srgb, var(--sand) 70%, white);
  padding: 0.3rem;
  border-radius: 12px;
}

.auth-tab {
  border: none;
  background: transparent;
  font: inherit;
  font-weight: 700;
  padding: 0.65rem;
  border-radius: 10px;
  color: var(--concrete);
  cursor: pointer;
}

.auth-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--brand-deep));
  color: var(--white);
}

.check-row {
  display: flex !important;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.85rem;
  font-size: 0.95rem;
  color: var(--iron);
  cursor: pointer;
  user-select: none;
}

.check-row input[type="checkbox"] {
  width: 1.4rem;
  height: 1.4rem;
  min-width: 1.4rem;
  min-height: 1.4rem;
  margin: 0;
}

.empty {
  text-align: center;
  color: var(--concrete);
  padding: 1.2rem 0.5rem;
  font-weight: 600;
}

.demo-hint {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--concrete);
  line-height: 1.4;
}

.saldo-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.saldo-kpis .kpi {
  text-align: center;
}

.saldo-kpis .kpi strong {
  display: block;
  font-size: 0.95rem;
}

@media (max-width: 360px) {
  .saldo-kpis {
    grid-template-columns: 1fr;
  }

  .nav-gestor button {
    font-size: 0.62rem;
    padding: 0.4rem 0.12rem;
  }
}

.plan-grid {
  display: grid;
  gap: 0.75rem;
}

.plan-card {
  border: 1px solid var(--dust);
  border-radius: var(--radius);
  padding: 0.9rem;
  background: #fff;
}

.plan-card.plan-current {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
}

.plan-price {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--brand-deep);
  margin: 0.4rem 0 0.2rem;
}

.plan-price span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--concrete);
}

.plan-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.paywall-banner {
  border-color: #fcd34d;
  background: #fffbeb;
}

.trial-banner {
  border-color: #6ee7b7;
  background: #ecfdf5;
}

body.admin-shell {
  background: #f1f5f9;
}

body.admin-shell::before {
  display: none;
}

body.admin-shell #app {
  max-width: none;
  margin: 0;
  min-height: 100dvh;
  padding: 0;
}

.ad-shell {
  display: flex;
  min-height: 100dvh;
  background: #f1f5f9;
  color: #0f172a;
}

.ad-sidebar {
  width: 16rem;
  flex-shrink: 0;
  background: #0f172a;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #1e293b;
}

.ad-brand {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  padding: 1.1rem 1rem;
  border-bottom: 1px solid #1e293b;
}

.ad-shield {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.6rem;
  background: #334155;
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.75rem;
}

.ad-brand strong {
  display: block;
  color: #fff;
  font-size: 0.9rem;
}

.ad-brand span {
  display: block;
  font-size: 0.75rem;
  color: #94a3b8;
}

.ad-nav {
  flex: 1;
  padding: 0.75rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.ad-nav button {
  appearance: none;
  border: 0;
  background: transparent;
  color: #cbd5e1;
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-radius: 0.6rem;
  font: inherit;
  cursor: pointer;
}

.ad-nav button:hover,
.ad-nav button.active {
  background: #1e293b;
  color: #fff;
}

.ad-logout {
  appearance: none;
  border: 0;
  background: transparent;
  color: #cbd5e1;
  text-align: left;
  padding: 0.85rem 1.1rem;
  border-top: 1px solid #1e293b;
  font: inherit;
  cursor: pointer;
}

.ad-logout:hover {
  background: #450a0a;
  color: #f87171;
}

.ad-main {
  flex: 1;
  min-width: 0;
  padding: 1.5rem;
}

.ad-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
}

.ad-header p {
  margin: 0.25rem 0 1rem;
  color: #64748b;
}

.ad-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.85rem;
}

.ad-kpi,
.ad-card,
.ad-plan-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.85rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.ad-kpi {
  padding: 1rem 1.1rem;
}

.ad-kpi span {
  display: block;
  font-size: 0.8rem;
  color: #64748b;
}

.ad-kpi strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.35rem;
  font-family: var(--font-display);
}

.ad-toolbar {
  margin-bottom: 0.85rem;
}

.ad-toolbar input {
  width: min(420px, 100%);
  border: 1px solid #e2e8f0;
  border-radius: 0.7rem;
  padding: 0.65rem 0.8rem;
  font: inherit;
}

.ad-table-wrap {
  overflow-x: auto;
}

.ad-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.ad-table th {
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.75rem 1rem;
}

.ad-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}

.ad-table tr:hover td {
  background: #f8fafc;
}

.ad-muted {
  color: #64748b;
  font-size: 0.8rem;
}

.ad-empty {
  margin: 0;
  padding: 2rem;
  text-align: center;
  color: #64748b;
}

.ad-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
  margin-right: 0.25rem;
}

.ad-badge-ok {
  background: #dcfce7;
  color: #166534;
}

.ad-badge-info {
  background: #dbeafe;
  color: #1d4ed8;
}

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

.ad-badge-danger {
  background: #fee2e2;
  color: #b91c1c;
}

.ad-actions-cell {
  position: relative;
  width: 3rem;
}

.ad-icon-btn {
  width: 2rem;
  height: 2rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 0.5rem;
  cursor: pointer;
  color: #475569;
}

.ad-menu {
  position: absolute;
  right: 0.5rem;
  top: 2.4rem;
  z-index: 20;
  min-width: 14rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  padding: 0.35rem 0;
}

.ad-menu p {
  margin: 0;
  padding: 0.35rem 0.85rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
}

.ad-menu button {
  display: block;
  width: 100%;
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.5rem 0.85rem;
  font: inherit;
  font-size: 0.85rem;
  color: #334155;
  cursor: pointer;
}

.ad-menu button:hover {
  background: #f8fafc;
}

.ad-menu button.danger {
  color: #dc2626;
}

.ad-menu hr {
  border: 0;
  border-top: 1px solid #f1f5f9;
  margin: 0.3rem 0;
}

.ad-plans {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem;
}

.ad-plan-card {
  padding: 1.1rem;
}

.ad-plan-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.ad-plan-head h3 {
  margin: 0;
}

.ad-price {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0.5rem 0 0.2rem;
}

.ad-price span {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 600;
}

.ad-btn-primary {
  background: #334155;
  color: #fff;
  border: 0;
}

.ad-btn-outline {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
}

.ad-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: grid;
  place-items: center;
  z-index: 50;
  padding: 1rem;
}

.ad-modal {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 0.9rem;
  padding: 1.25rem;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
}

.ad-modal h3 {
  margin: 0 0 0.35rem;
}

.ad-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

@media (max-width: 860px) {
  .ad-shell {
    flex-direction: column;
  }

  .ad-sidebar {
    width: 100%;
  }

  .ad-nav {
    flex-direction: row;
    overflow-x: auto;
  }

  .ad-nav button {
    white-space: nowrap;
  }
}

.ciclo-toggle {
  display: inline-flex;
  border: 1px solid var(--dust);
  border-radius: 10px;
  padding: 0.2rem;
  margin-bottom: 0.75rem;
  background: #f8fafc;
}

.ciclo-toggle button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
  color: var(--concrete);
}

.ciclo-toggle button.active {
  background: var(--brand);
  color: #fff;
}

.pay-option {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 12px;
  padding: 0.85rem;
  margin-top: 0.6rem;
  cursor: pointer;
}

.pay-option strong {
  display: block;
}

.pay-option strong span {
  font-weight: 500;
  color: #64748b;
  font-size: 0.85rem;
}

.pay-option > span {
  display: block;
  margin-top: 0.2rem;
  color: #64748b;
  font-size: 0.85rem;
}

.pix-box {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.pix-box img {
  width: 160px;
  height: 160px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  padding: 0.4rem;
}

.boleto-linha {
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  word-break: break-all;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.7rem;
  background: #fff;
}

.cobranca-box {
  border-color: #93c5fd;
}
