:root {
  --bg: #f7f3eb;
  --bg-strong: #efe5d6;
  --surface: rgba(255, 250, 242, 0.92);
  --surface-strong: #fff7eb;
  --ink: #1f1d1a;
  --muted: #6e6458;
  --line: rgba(73, 58, 37, 0.12);
  --accent: #0f766e;
  --accent-2: #b45309;
  --danger: #b42318;
  --income: #0d9488;
  --expense: #c2410c;
  --fee: #7c3aed;
  --balance: #1d4ed8;
  --shadow: 0 18px 40px rgba(55, 37, 7, 0.08);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Source Sans 3', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(180, 83, 9, 0.15), transparent 24%),
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.12), transparent 20%),
    linear-gradient(145deg, #f9f4ea 0%, #f2eadc 50%, #f5efe6 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 14px;
  padding: 0.85rem 1.15rem;
  cursor: pointer;
  background: linear-gradient(135deg, #0f766e, #155e75);
  color: white;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

button:hover,
.file-label:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.18);
}

button.secondary,
.file-label {
  background: rgba(255, 247, 235, 0.88);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}

button.danger {
  background: linear-gradient(135deg, #b42318, #7f1d1d);
}

.file-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 14px;
  padding: 0.85rem 1.15rem;
  font-weight: 700;
  cursor: pointer;
}

.save-toast {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent);
  border: 1px solid rgba(15, 118, 110, 0.18);
  font-weight: 700;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.save-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.app-shell {
  width: min(1400px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.top-nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: nowrap;
}

.top-nav {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  gap: 10px;
  padding: 8px;
  border-radius: 999px;
  background: rgba(255, 249, 240, 0.78);
  border: 1px solid rgba(73, 58, 37, 0.08);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  overflow-x: auto;
}

.top-nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  flex-wrap: nowrap;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  color: var(--ink);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.nav-link:hover {
  transform: translateY(-1px);
  background: rgba(15, 118, 110, 0.08);
}

.nav-link.active {
  background: linear-gradient(135deg, #0f766e, #155e75);
  color: #fff;
}

.icon-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  min-width: 60px;
  height: 60px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 1.35rem;
  line-height: 1;
  background: rgba(255, 247, 235, 0.88);
  color: var(--ink);
  border: 1px solid var(--line);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.icon-nav-link svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.icon-nav-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.18);
  background: rgba(255, 251, 245, 1);
}

.icon-nav-link.active {
  background: linear-gradient(135deg, #0f766e, #155e75);
  color: #fff;
  border-color: transparent;
}

.floating-settings,
.top-nav-settings {
  position: static;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 20px;
  padding: 28px;
  border-radius: 32px;
  background: linear-gradient(145deg, rgba(255, 249, 240, 0.92), rgba(248, 238, 221, 0.92));
  box-shadow: var(--shadow);
  border: 1px solid rgba(73, 58, 37, 0.08);
}

.eyebrow,
.section-tag {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.76rem;
  color: var(--accent-2);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
  max-width: 12ch;
}

.subtitle {
  max-width: 58ch;
  color: var(--muted);
  font-size: 1.05rem;
  margin: 12px 0 0;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.layout {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
}

.panel {
  background: var(--surface);
  border: 1px solid rgba(73, 58, 37, 0.08);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(12px);
}

.form-panel { grid-column: span 5; }
.dashboard-panel { grid-column: span 7; }
.config-panel,
.table-panel { grid-column: span 12; }
.report-panel { grid-column: span 12; }
.payments-form-panel { grid-column: span 4; }
.payments-dashboard-panel { grid-column: span 8; }
.clinical-side-panel { grid-column: span 4; }
.clinical-main-panel { grid-column: span 8; }
.admin-logs-filters-panel { grid-column: span 3; align-self: start; }
.admin-logs-table-panel { grid-column: span 9; }
.clinical-history-panel { grid-column: span 12; }

.config-panel-only {
  max-width: 100%;
}

.panel-header,
.table-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent);
  font-weight: 700;
}

.registro-form,
.field-group {
  display: grid;
  gap: 14px;
}

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

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(73, 58, 37, 0.16);
  background: rgba(255, 252, 246, 0.96);
  color: var(--ink);
  padding: 0.9rem 0.95rem;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.status-select {
  min-width: 128px;
  padding: 0.55rem 0.8rem;
  border-radius: 12px;
  background: rgba(255, 252, 246, 0.96);
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.4rem;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.status-select.pendente {
  background: rgba(180, 83, 9, 0.12);
  color: #8a4b07;
  border-color: rgba(180, 83, 9, 0.22);
}

.status-select.recebido {
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent);
  border-color: rgba(15, 118, 110, 0.22);
}

.table-date-input {
  min-width: 150px;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
}

.overdue-row td {
  background: rgba(180, 35, 24, 0.08);
}

.overdue-row td:last-child {
  background: transparent;
}

.summary-box {
  border-radius: 18px;
  padding: 18px;
  background: linear-gradient(145deg, rgba(249, 242, 229, 0.98), rgba(255, 249, 241, 0.96));
  border: 1px solid rgba(73, 58, 37, 0.08);
}

.clean-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(73, 58, 37, 0.08);
}

.clean-list li:last-child {
  border-bottom: 0;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

.form-actions-split {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.clinical-summary-box {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.validation-result {
  min-height: 118px;
}

.validation-result-content {
  display: grid;
  gap: 6px;
  text-align: left;
}

.helper-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  word-break: break-word;
}

.helper-link:hover {
  text-decoration: underline;
}

.document-type-block {
  gap: 18px;
}

.subpanel-header {
  margin-bottom: 0;
}

.prescription-items {
  display: grid;
  gap: 14px;
}

.prescription-item-card,
.document-preview-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(73, 58, 37, 0.08);
  background: rgba(255, 251, 245, 0.9);
}

.checkbox-field {
  align-content: start;
}

.checkbox-field input {
  width: auto;
}

.preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-weight: 600;
}

.preview-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.preview-list li {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(239, 229, 214, 0.44);
}

.preview-list small {
  color: var(--muted);
}

.json-preview {
  overflow: auto;
  border-radius: 16px;
  padding: 14px;
  background: #1f1d1a;
  color: #f7f3eb;
}

.json-preview pre {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  font-family: Consolas, monospace;
}

.table-actions-inline {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.public-validation-qr {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  border-radius: 18px;
  background: rgba(255, 251, 245, 0.9);
  border: 1px dashed rgba(73, 58, 37, 0.18);
}

.public-validation-qr img {
  width: min(100%, 220px);
  height: auto;
  border-radius: 12px;
}

.cards-grid,
.summary-grid {
  display: grid;
  gap: 14px;
}

.cards-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 16px;
}

.dashboard-cards-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.metric-card {
  padding: 18px;
  border-radius: 20px;
  color: white;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-card span {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.metric-card strong {
  font-size: 1.8rem;
}

.metric-card.income { background: linear-gradient(135deg, #0d9488, #0f766e); }
.metric-card.expense { background: linear-gradient(135deg, #ea580c, #c2410c); }
.metric-card.fee { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.metric-card.inss { background: linear-gradient(135deg, #0f766e, #b45309); }
.metric-card.balance { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.metric-card.real-balance { background: linear-gradient(135deg, #166534, #0f766e); }

.summary-grid {
  grid-template-columns: 1.1fr 1fr;
}

.dashboard-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.reports-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

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

.comparison-chart {
  display: grid;
  gap: 12px;
  margin-top: 4px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 251, 245, 0.9);
  border: 1px solid rgba(73, 58, 37, 0.08);
}

.comparison-chart-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.comparison-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-weight: 600;
}

.legend-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border-radius: 999px;
}

.legend-swatch.month1,
.comparison-bar.month1 {
  background: linear-gradient(135deg, #0d9488, #0f766e);
}

.legend-swatch.month2,
.comparison-bar.month2 {
  background: linear-gradient(135deg, #b45309, #ea580c);
}

.comparison-row {
  display: grid;
  grid-template-columns: 180px 1fr 1fr;
  gap: 14px;
  align-items: center;
}

.comparison-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
}

.comparison-bars {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.comparison-bar-track {
  height: 14px;
  border-radius: 999px;
  background: rgba(73, 58, 37, 0.08);
  overflow: hidden;
}

.comparison-bar {
  height: 100%;
  border-radius: inherit;
}

.clean-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.bars {
  display: grid;
  gap: 10px;
}

.executive-bars {
  display: grid;
  gap: 14px;
}

.executive-bar-header {
  display: grid;
  grid-template-columns: minmax(150px, 180px) repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: center;
  padding: 0 16px 6px;
  color: var(--muted);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.executive-bar-row {
  display: grid;
  grid-template-columns: minmax(150px, 180px) repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 251, 245, 0.9);
  border: 1px solid rgba(73, 58, 37, 0.08);
}

.executive-bar-label {
  display: grid;
  gap: 4px;
}

.executive-bar-label small {
  color: var(--muted);
}

.executive-bar-metrics {
  display: grid;
  gap: 8px;
}

.executive-bar-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(73, 58, 37, 0.08);
  overflow: hidden;
}

.executive-bar-fill {
  height: 100%;
  border-radius: inherit;
}

.executive-bar-fill.income { background: linear-gradient(135deg, #0d9488, #0f766e); }
.executive-bar-fill.expense { background: linear-gradient(135deg, #ea580c, #c2410c); }
.executive-bar-fill.balance { background: linear-gradient(135deg, #166534, #0f766e); }
.executive-bar-fill.danger { background: linear-gradient(135deg, #b42318, #7f1d1d); }

.dashboard-agenda-list,
.dashboard-action-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.dashboard-agenda-list li,
.dashboard-action-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 251, 245, 0.9);
  border: 1px solid rgba(73, 58, 37, 0.08);
}

.dashboard-agenda-list li > div:first-child,
.dashboard-action-list li {
  display: grid;
  gap: 4px;
}

.dashboard-agenda-list strong,
.dashboard-action-list strong {
  font-family: 'Space Grotesk', sans-serif;
}

.dashboard-agenda-list small,
.dashboard-action-list span {
  color: var(--muted);
}

.dashboard-agenda-meta {
  display: grid;
  gap: 4px;
  text-align: right;
  white-space: nowrap;
}

.dashboard-agenda-empty {
  justify-content: center;
  color: var(--muted);
}

.bar-row {
  display: grid;
  grid-template-columns: 100px 1fr 90px;
  gap: 10px;
  align-items: center;
  font-size: 0.95rem;
}

.bar-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: rgba(73, 58, 37, 0.08);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, #b45309, #0f766e);
}

.helper {
  margin: 0 0 16px;
  color: var(--muted);
}

.rates-table {
  display: grid;
  gap: 14px;
}

.rate-accordion {
  border-radius: 18px;
  border: 1px solid rgba(73, 58, 37, 0.08);
  background: rgba(255, 251, 245, 0.9);
  overflow: hidden;
}

.rate-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}

.rate-toggle:hover {
  transform: none;
  box-shadow: none;
  background: rgba(15, 118, 110, 0.06);
}

.rate-toggle span,
.rate-toggle strong {
  font-family: 'Space Grotesk', sans-serif;
}

.rate-panel {
  display: grid;
  gap: 12px;
  padding: 0 18px 18px;
  border-top: 1px solid rgba(73, 58, 37, 0.08);
}

.rate-subsection {
  display: grid;
  gap: 10px;
  padding-top: 14px;
}

.rate-subtitle {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
}

.inss-config-table {
  display: grid;
  gap: 14px;
}

.inss-config-row {
  display: grid;
  grid-template-columns: 120px 1fr 1fr 140px;
  gap: 14px;
  align-items: end;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(73, 58, 37, 0.08);
  background: rgba(255, 251, 245, 0.9);
}

.inss-year {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.rate-row {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 14px;
  align-items: start;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(73, 58, 37, 0.08);
  background: rgba(255, 251, 245, 0.9);
}

.rate-title {
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
}

.rate-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.table-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.compact-filter,
.table-filters label {
  min-width: 150px;
}

.table-wrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(73, 58, 37, 0.08);
}

.future-wrap {
  margin-top: 16px;
}

.future-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.selected-total-card {
  display: grid;
  gap: 8px;
  padding: 24px;
  margin-bottom: 16px;
  border-radius: 24px;
  background: linear-gradient(135deg, #0f766e, #155e75);
  color: #fff;
  box-shadow: var(--shadow);
}

.selected-total-card span {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  opacity: 0.9;
}

.selected-total-card strong {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
}

.future-month-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.1), rgba(180, 83, 9, 0.12));
  border: 1px solid rgba(73, 58, 37, 0.08);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.future-month-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(55, 37, 7, 0.08);
}

.future-month-card:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.22);
  outline-offset: 2px;
}

.future-month-card.active {
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.18), rgba(180, 83, 9, 0.2));
  border-color: rgba(15, 118, 110, 0.22);
}

.future-month-card span {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  color: var(--muted);
}

.future-month-card strong {
  font-size: 1.45rem;
  font-family: 'Space Grotesk', sans-serif;
}

.future-month-card small {
  color: var(--muted);
  font-weight: 600;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 251, 245, 0.92);
}

th,
td {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid rgba(73, 58, 37, 0.08);
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  background: rgba(246, 236, 218, 0.98);
  z-index: 1;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.88rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-weight: 700;
  font-size: 0.82rem;
}

.badge.receita { background: rgba(13, 148, 136, 0.12); color: var(--income); }
.badge.pendente { background: rgba(180, 83, 9, 0.12); color: #b45309; }
.badge.recebido { background: rgba(15, 118, 110, 0.12); color: var(--accent); }

.icon-button {
  padding: 0.55rem 0.8rem;
  border-radius: 12px;
  background: rgba(180, 35, 24, 0.12);
  color: var(--danger);
  font-weight: 700;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 30px;
}

.muted-inline {
  color: var(--muted);
  font-size: 0.92rem;
}

.log-status-stack {
  display: grid;
  gap: 4px;
}

.log-status-stack small {
  color: var(--muted);
  line-height: 1.2;
}

.top-login-shortcut {
  min-height: 60px;
  padding: 0.85rem 1.45rem;
  border-radius: 20px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1rem;
}

.admin-log-help {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(180, 83, 9, 0.08);
  color: #8b5a12;
  font-weight: 700;
}

.admin-log-help span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 600;
}

.hidden {
  display: none;
}

.auth-shell {
  width: min(760px, calc(100vw - 24px));
}

.auth-hero {
  min-height: 0;
  margin-bottom: 18px;
}

.auth-panel {
  grid-column: 3 / span 8;
}

.auth-message {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(15, 118, 110, 0.08);
  color: var(--accent);
  font-weight: 600;
}

.auth-message.error {
  background: rgba(180, 35, 24, 0.1);
  color: var(--danger);
}

.auth-help-box {
  margin-top: 18px;
}

.auth-help-box p {
  margin: 0.35rem 0;
}

@media (max-width: 1100px) {
  .form-panel,
  .dashboard-panel,
  .payments-form-panel,
  .payments-dashboard-panel,
  .config-panel,
  .table-panel,
  .clinical-side-panel,
  .clinical-main-panel,
  .clinical-history-panel,
  .admin-logs-filters-panel,
  .admin-logs-table-panel,
  .auth-panel {
    grid-column: span 12;
  }

  .cards-grid,
  .summary-grid,
  .comparison-grid,
  .reports-grid,
  .inss-config-row,
  .admin-logs-layout,
  .grid-4,
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .executive-bar-header {
    display: none;
  }

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

@media (max-width: 720px) {
  .app-shell {
    width: min(100vw - 16px, 100%);
    padding: 16px 0 32px;
  }

  .hero,
  .panel-header,
  .table-head,
  .hero-actions {
    flex-direction: column;
  }

  .top-nav {
    display: flex;
    width: 100%;
    overflow-x: auto;
  }

  .top-nav-shell {
    flex-direction: column;
    align-items: stretch;
  }

  .top-nav-actions {
    justify-content: flex-start;
  }

  .nav-link {
    flex: 1 0 auto;
  }

  .grid-2,
  .grid-3,
  .grid-4,
  .cards-grid,
  .summary-grid,
  .comparison-grid,
  .reports-grid,
  .inss-config-row,
  .admin-logs-layout {
    grid-template-columns: 1fr;
  }

  .comparison-chart-head,
  .comparison-bars {
    grid-template-columns: 1fr;
  }

  .comparison-chart-head {
    flex-direction: column;
    align-items: flex-start;
  }

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

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

  .dashboard-agenda-list li,
  .dashboard-action-list li {
    flex-direction: column;
  }

  .dashboard-agenda-meta {
    text-align: left;
  }
}
