:root {
  --bg: #f4efe6;
  --bg-accent: #e6dccb;
  --ink: #1a2433;
  --ink-soft: #536073;
  --line: rgba(26, 36, 51, 0.1);
  --navy: #1f335e;
  --navy-strong: #16274b;
  --sand: #d8b978;
  --mint: #d4f0da;
  --mint-ink: #166339;
  --amber: #f4dfa3;
  --amber-ink: #8b6200;
  --lavender: #dfe5ff;
  --lavender-ink: #3653b3;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 999px;
  --shadow-soft: 0 18px 50px rgba(30, 37, 56, 0.09);
  --shadow-edge: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top right, rgba(216, 185, 120, 0.3), transparent 26%),
    linear-gradient(180deg, #f7f2e8 0%, var(--bg) 46%, #efe5d3 100%);
  color: var(--ink);
  font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", sans-serif;
}

body[data-design-mode="ejecutivo"] {
  --radius-lg: 32px;
  --radius-md: 22px;
  --shadow-soft: 0 22px 60px rgba(30, 37, 56, 0.11);
}

body[data-design-mode="ejecutivo"] .page-shell {
  width: min(1400px, calc(100% - 40px));
}

body[data-design-mode="ejecutivo"] .hero,
body[data-design-mode="ejecutivo"] .panel,
body[data-design-mode="ejecutivo"] .stat-card {
  border-radius: 32px;
}

body[data-design-mode="ejecutivo"] .hero-brand,
body[data-design-mode="ejecutivo"] .hero-copy {
  padding: 34px;
}

body[data-design-mode="ejecutivo"] .panel {
  padding: 28px;
}

body[data-design-mode="ejecutivo"] .stat-card {
  padding: 26px 28px;
}

body[data-design-mode="ejecutivo"] .section-copy {
  max-width: 54ch;
}

body[data-design-mode="ejecutivo"] .commissions-table th,
body[data-design-mode="ejecutivo"] .commissions-table td {
  padding: 16px 18px;
}

body[data-design-mode="compacto"] {
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow-soft: 0 12px 28px rgba(30, 37, 56, 0.08);
}

body[data-design-mode="compacto"] .page-shell {
  width: min(1360px, calc(100% - 24px));
  margin: 18px auto 30px;
}

body[data-design-mode="compacto"] .hero,
body[data-design-mode="compacto"] .panel,
body[data-design-mode="compacto"] .stat-card {
  border-radius: 18px;
}

body[data-design-mode="compacto"] .hero,
body[data-design-mode="compacto"] .panel {
  padding: 18px;
}

body[data-design-mode="compacto"] .hero-brand,
body[data-design-mode="compacto"] .hero-copy {
  padding: 22px;
}

body[data-design-mode="compacto"] .stat-card {
  padding: 18px 20px;
}

body[data-design-mode="compacto"] .dashboard-toolbar {
  gap: 10px;
}

body[data-design-mode="compacto"] .filters {
  gap: 10px;
  margin-bottom: 14px;
}

body[data-design-mode="compacto"] .filter input,
body[data-design-mode="compacto"] .filter select {
  padding: 10px 12px;
}

body[data-design-mode="compacto"] .commissions-table th,
body[data-design-mode="compacto"] .commissions-table td {
  padding: 10px 12px;
}

body[data-design-mode="compacto"] .job-card,
body[data-design-mode="compacto"] .worker-list li {
  padding: 12px 14px;
}

button,
input,
select {
  font: inherit;
}

.hidden {
  display: none !important;
}

.auth-shell {
  width: min(560px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  place-items: center;
  padding: 32px 0;
}

.auth-card {
  width: 100%;
  display: grid;
  gap: 22px;
  padding: 28px;
  border-radius: 32px;
  background:
    radial-gradient(circle at 100% 0%, rgba(216, 185, 120, 0.28), transparent 22%),
    linear-gradient(180deg, #fbf7ef 0%, #f2e8d8 100%);
  border: 1px solid rgba(26, 36, 51, 0.08);
  box-shadow: var(--shadow-soft);
}

.auth-brand {
  display: grid;
  gap: 12px;
}

.auth-logo {
  display: block;
  width: min(100%, 360px);
  height: auto;
}

.auth-copy h1 {
  margin: 0;
  font-family: Georgia, "Palatino Linotype", serif;
  font-size: clamp(2rem, 4vw, 3rem);
}

.auth-copy p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-field {
  display: grid;
  gap: 8px;
}

.auth-field span {
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.auth-field input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(26, 36, 51, 0.12);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

.auth-feedback {
  min-height: 1.25rem;
  margin: 0;
  color: #8f1f1f;
}

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

.control-center-shell {
  display: grid;
  gap: 16px;
}

.control-center-topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.page-shell {
  width: min(1340px, calc(100% - 32px));
  margin: 24px auto 40px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
  gap: 16px;
  padding: 20px;
  border-radius: 34px;
  background:
    radial-gradient(circle at 10% 18%, rgba(239, 219, 171, 0.82), transparent 22%),
    radial-gradient(circle at 86% 0%, rgba(31, 51, 94, 0.26), transparent 22%),
    linear-gradient(180deg, #fbf7ef 0%, #f1e7d3 100%);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: rgba(255, 247, 232, 0.74);
}

.eyebrow-dark {
  color: rgba(26, 36, 51, 0.64);
}

.hero h1,
.panel h2 {
  margin: 0;
  font-family: Georgia, "Palatino Linotype", serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero-text {
  max-width: 42ch;
  margin: 0;
  line-height: 1.6;
  color: var(--ink);
}

.hero-copy .hero-text {
  color: rgba(251, 247, 240, 0.92);
}

.hero-logo {
  display: block;
  width: min(100%, 620px);
  height: auto;
  margin: 10px 0 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hero-brand {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
  justify-items: start;
  padding: 30px 32px 28px;
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(248, 242, 230, 0.96) 100%);
  border: 1px solid rgba(26, 36, 51, 0.08);
  box-shadow: var(--shadow-edge);
}

.brand-copy {
  width: 100%;
  min-width: 0;
}

.brand-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(31, 51, 94, 0.08);
  color: var(--navy);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-copy {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 24px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 88% 0%, rgba(244, 223, 160, 0.24), transparent 24%),
    linear-gradient(180deg, rgba(31, 51, 94, 0.98) 0%, rgba(22, 39, 75, 0.98) 100%);
  color: #fbf7f0;
  position: relative;
  overflow: hidden;
}

.hero-design-field {
  display: grid;
  justify-self: end;
  gap: 8px;
  width: min(220px, 100%);
}

.hero-design-field label {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-design-field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(14, 20, 33, 0.12);
}

.hero-copy::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 85% 0%, rgba(243, 215, 145, 0.22), transparent 22%),
    radial-gradient(circle at 0% 100%, rgba(255, 255, 255, 0.08), transparent 26%);
  pointer-events: none;
}

.hero-copy > * {
  position: relative;
  z-index: 1;
}

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

.hero-badge,
.hero-badge-alt,
.panel,
.stat-card,
.job-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-edge);
}

.hero-badge,
.hero-badge-alt {
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(250, 246, 239, 0.08);
}

.hero-badge span,
.hero-badge-alt span {
  display: block;
  margin-bottom: 6px;
  color: rgba(251, 247, 240, 0.64);
  font-size: 0.82rem;
}

.hero-badge strong,
.hero-badge-alt strong {
  font-size: 1rem;
  color: #ffffff;
}

.hero-badge {
  background: rgba(255, 251, 245, 0.08);
}

.hero-badge-alt {
  background: rgba(243, 215, 145, 0.14);
}

.layout {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.panel {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: rgba(255, 251, 245, 0.84);
  border-color: rgba(21, 33, 54, 0.08);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 18px;
}

.panel-header .secondary-button {
  flex: 0 0 auto;
}

.panel-header h2 {
  font-size: clamp(1.35rem, 2vw, 1.9rem);
}

.section-copy {
  max-width: 48ch;
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.5;
}

.tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tab-pill {
  min-width: 220px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.tab-pill:hover,
.tab-pill:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(31, 51, 94, 0.24);
  box-shadow: 0 10px 24px rgba(30, 37, 56, 0.08);
}

.tab-pill.active {
  background: linear-gradient(180deg, rgba(31, 51, 94, 0.12), rgba(31, 51, 94, 0.08));
  border-color: rgba(31, 51, 94, 0.3);
}

.tab-pill small {
  display: block;
  margin-top: 5px;
  color: var(--ink-soft);
}

.stats-grid {
  display: grid;
  gap: 18px;
}

.dashboard-toolbar {
  display: grid;
  gap: 18px;
}

.biller-switcher {
  display: grid;
  gap: 14px;
}

.biller-switcher-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}

.biller-switcher-header h3 {
  margin: 0;
  font-size: 1.02rem;
  color: var(--ink);
}

.biller-switcher-header p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  line-height: 1.45;
}

.biller-switcher-period {
  flex: 0 0 auto;
  margin: 0 !important;
  padding: 14px 18px;
  border-radius: 18px;
  border: 1px solid rgba(70, 111, 209, 0.24);
  background: rgba(70, 111, 209, 0.1);
  color: var(--navy) !important;
  white-space: nowrap;
}

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

.biller-tab {
  position: relative;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 14px 16px 12px;
  border-radius: 18px;
  border: 1px solid rgba(190, 202, 228, 0.9);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.biller-tab-accent {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 8px;
  height: 6px;
  border-radius: 999px;
  background: transparent;
}

.biller-tab-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(190, 202, 228, 0.8);
  background: rgba(255, 255, 255, 0.96);
  color: #2a5fd0;
  font-size: clamp(1rem, 2vw, 1.5rem);
  font-weight: 700;
  text-transform: uppercase;
}

.biller-tab-body {
  display: grid;
  min-width: 0;
}

.biller-tab-body strong {
  display: block;
  font-size: 0.92rem;
  color: #2d3748;
}

.biller-tab-body small {
  display: block;
  margin-top: 2px;
  color: #67738f;
  font-size: 0.76rem;
  line-height: 1.25;
}

.biller-tab-cuit {
  margin-top: 2px;
  color: #4c5b78;
}

.biller-tab-state {
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(95, 146, 255, 0.46);
  color: #5675b8;
  background: rgba(248, 251, 255, 0.95);
  font-size: 0.8rem;
  white-space: nowrap;
}

.biller-tab:hover,
.biller-tab:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(70, 111, 209, 0.55);
  box-shadow: 0 14px 28px rgba(24, 50, 106, 0.08);
}

.biller-tab.active {
  border-color: #4f79dd;
  box-shadow: 0 14px 32px rgba(24, 50, 106, 0.12);
}

.biller-tab.active .biller-tab-accent {
  background: #4674de;
}

.biller-tab.active .biller-tab-state {
  color: #3562cf;
  background: rgba(236, 244, 255, 0.98);
}

.dashboard-toolbar-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: end;
}

.dashboard-toolbar-panel .panel-header {
  margin-bottom: 14px;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  justify-self: end;
}

.toolbar-feedback {
  min-height: 1.2rem;
  margin: 12px 0 0;
  color: var(--ink-soft);
}

.toolbar-feedback[data-tone="error"] {
  color: #8f1f1f;
}

.toolbar-feedback[data-tone="success"] {
  color: var(--navy);
}

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

.stat-card {
  padding: 22px 24px;
  border-radius: 26px;
  background: rgba(255, 251, 245, 0.9);
  border-color: rgba(21, 33, 54, 0.08);
}

.stat-card-strong {
  background: linear-gradient(145deg, #f6ead0 0%, #f4dfb0 100%);
}

.stat-card-period {
  display: grid;
  align-content: start;
}

.stat-period-filter {
  margin: 0;
}

.stat-period-filter select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(26, 36, 51, 0.12);
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
}

.stat-label {
  display: block;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.stat-value {
  display: block;
  margin-top: 12px;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  font-family: Georgia, "Palatino Linotype", serif;
}

.filters {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) minmax(200px, 0.7fr);
  gap: 14px;
  margin-bottom: 18px;
}

#table-period-context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  max-width: none;
}

.table-visible-metric {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(70, 111, 209, 0.08);
  color: var(--navy);
  font-size: 0.8rem;
  white-space: nowrap;
}

.table-visible-metric strong {
  font-size: 0.92rem;
}

.filter {
  display: grid;
  gap: 8px;
}

.filter span {
  display: block;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.filter input,
.filter select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(26, 36, 51, 0.12);
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
}

.table-wrap {
  overflow: auto;
  border-radius: 22px;
  border: 1px solid rgba(26, 36, 51, 0.08);
  background: rgba(255, 255, 255, 0.74);
}

.commissions-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 880px;
}

.commissions-table th,
.commissions-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(26, 36, 51, 0.08);
  text-align: left;
  font-size: 0.94rem;
}

.commissions-table th {
  background: rgba(31, 51, 94, 0.08);
  color: var(--navy-strong);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.company-cell {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
  align-items: center;
}

.company-cell-logo {
  grid-template-columns: 1fr;
}

.company-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
}

.company-logo {
  display: block;
  max-width: 116px;
  max-height: 32px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.status-badge,
.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-pendiente {
  background: var(--amber);
  color: var(--amber-ink);
}

.status-lista,
.status-subida {
  background: var(--mint);
  color: var(--mint-ink);
}

.status-revision {
  background: var(--lavender);
  color: var(--lavender-ink);
}

.action-button {
  cursor: pointer;
  background: transparent;
  color: var(--navy);
  border-color: rgba(31, 51, 94, 0.22);
}

.action-button:hover,
.action-button:focus-visible {
  background: rgba(31, 51, 94, 0.08);
}

.worker-note p {
  margin-top: 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

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

.worker-list li,
.job-card {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(26, 36, 51, 0.08);
}

.worker-list code {
  display: block;
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.job-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.job-title {
  display: block;
  margin-bottom: 4px;
}

.job-meta {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.job-status {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--mint-ink);
  font-size: 0.78rem;
}

.job-status-success {
  background: var(--mint);
  color: var(--mint-ink);
}

.job-status-running {
  background: rgba(31, 51, 94, 0.12);
  color: var(--navy);
}

.job-status-failed {
  background: rgba(176, 45, 45, 0.12);
  color: #8f1f1f;
}

.job-status-dry-run {
  background: rgba(216, 185, 120, 0.22);
  color: #7b5d18;
}

.job-status-needs-config {
  background: rgba(244, 223, 163, 0.82);
  color: var(--amber-ink);
}

.runs-modal-card {
  width: min(1120px, calc(100vw - 24px));
}

.runs-modal-summary {
  margin-bottom: 16px;
}

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

.history-summary-card {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(26, 36, 51, 0.08);
  background: rgba(255, 255, 255, 0.8);
}

.history-summary-card span {
  display: block;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.history-summary-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.2rem;
}

.runs-history-list {
  display: grid;
  gap: 12px;
}

.run-history-card {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(26, 36, 51, 0.08);
  background: rgba(255, 255, 255, 0.78);
}

.run-history-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.run-history-card-top strong {
  display: block;
}

.run-history-card-top p,
.run-history-note {
  margin: 4px 0 0;
  color: var(--ink-soft);
}

.run-history-card small {
  display: block;
  margin-top: 10px;
  color: var(--ink-soft);
}

.activity-panel .jobs-list {
  display: grid;
  gap: 12px;
}

.empty-state {
  color: var(--ink-soft);
  text-align: center;
}

.settings-panel {
  overflow: hidden;
}

.settings-tabs,
.subtabs-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.settings-tabs {
  margin-bottom: 18px;
}

.settings-tab,
.subtab-button,
.primary-button,
.modal-close,
.company-config-card {
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.settings-tab,
.subtab-button {
  padding: 11px 16px;
  border-radius: 999px;
  border: 1px solid rgba(31, 51, 94, 0.14);
  background: rgba(255, 255, 255, 0.88);
  color: var(--navy);
  cursor: pointer;
}

.settings-tab.active,
.subtab-button.active {
  background: linear-gradient(180deg, rgba(31, 51, 94, 0.14), rgba(31, 51, 94, 0.08));
  border-color: rgba(31, 51, 94, 0.32);
}

.settings-form {
  display: grid;
  gap: 18px;
}

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

.settings-field {
  display: grid;
  gap: 8px;
}

.settings-field span {
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.settings-field input,
.settings-field select,
.settings-field textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(26, 36, 51, 0.12);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  resize: vertical;
}

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

.settings-field-checkbox input {
  width: 22px;
  height: 22px;
  padding: 0;
}

.settings-field-full {
  grid-column: 1 / -1;
}

.settings-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.billers-layout {
  display: grid;
  grid-template-columns: minmax(250px, 0.85fr) minmax(0, 1.15fr);
  gap: 16px;
}

.billers-list {
  display: grid;
  gap: 10px;
  align-content: start;
}

.biller-card,
.biller-create-button {
  width: 100%;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(26, 36, 51, 0.1);
  background: rgba(255, 255, 255, 0.86);
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 4px;
}

.biller-create-button {
  justify-items: start;
}

.biller-card strong,
.biller-create-button {
  color: var(--navy);
}

.biller-card small,
.biller-card span {
  color: var(--ink-soft);
}

.biller-card.active,
.biller-create-button.active {
  background: linear-gradient(180deg, rgba(31, 51, 94, 0.12), rgba(31, 51, 94, 0.06));
  border-color: rgba(31, 51, 94, 0.3);
}

.credentials-matrix {
  display: grid;
  gap: 12px;
}

.credential-row {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(26, 36, 51, 0.08);
  background: rgba(255, 255, 255, 0.76);
}

.credential-row-inactive {
  opacity: 0.72;
}

.credential-row-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.credential-row-head strong {
  color: var(--ink);
}

.credential-row-head small {
  color: var(--ink-soft);
}

.credentials-matrix-empty {
  align-items: start;
}

.settings-note {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.5;
}

.primary-button,
.secondary-button,
.modal-close {
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid rgba(31, 51, 94, 0.18);
  cursor: pointer;
}

.primary-button {
  background: linear-gradient(180deg, #203563 0%, #17284e 100%);
  color: #fbf7f0;
}

.secondary-button {
  background: rgba(255, 255, 255, 0.92);
  color: var(--navy);
}

.modal-close {
  background: rgba(255, 255, 255, 0.9);
  color: var(--navy);
}

.primary-button[disabled],
.secondary-button[disabled],
.modal-close[disabled],
.action-button[disabled] {
  opacity: 0.72;
  cursor: wait;
}

.primary-button.is-loading,
.secondary-button.is-loading {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.button-spinner {
  width: 15px;
  height: 15px;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.8s linear infinite;
}

.primary-button:hover,
.primary-button:focus-visible,
.secondary-button:hover,
.secondary-button:focus-visible,
.modal-close:hover,
.modal-close:focus-visible,
.company-config-card:hover,
.company-config-card:focus-visible,
.settings-tab:hover,
.settings-tab:focus-visible,
.subtab-button:hover,
.subtab-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(30, 37, 56, 0.08);
}

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

.company-config-card {
  padding: 18px;
  border: 1px solid rgba(26, 36, 51, 0.1);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.84);
  text-align: left;
  cursor: pointer;
}

.company-config-brand {
  min-height: 40px;
  display: flex;
  align-items: center;
}

.company-config-logo {
  display: block;
  max-width: 140px;
  max-height: 42px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.company-config-meta {
  display: grid;
  gap: 6px;
  margin: 14px 0 10px;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-shell.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(14, 20, 33, 0.42);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(980px, calc(100vw - 24px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 24px;
  border-radius: 28px;
  background: linear-gradient(180deg, #fbf7ef 0%, #f2e8d8 100%);
  box-shadow: 0 28px 80px rgba(14, 20, 33, 0.24);
}

.modal-topbar,
.modal-brand-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.modal-brand-row {
  margin-bottom: 16px;
}

.modal-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.modal-brand-block {
  display: grid;
  gap: 6px;
}

.modal-content {
  display: grid;
  gap: 18px;
}

.modal-panel {
  padding: 20px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(26, 36, 51, 0.08);
}

.modal-flash {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(212, 240, 218, 0.84);
  color: var(--mint-ink);
}

.modal-flash-info {
  background: rgba(31, 51, 94, 0.12);
  color: var(--navy);
}

.modal-flash-error {
  background: rgba(176, 45, 45, 0.12);
  color: #8f1f1f;
}

.history-stack,
.log-stack {
  display: grid;
  gap: 12px;
}

.history-card,
.log-card {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(26, 36, 51, 0.08);
}

.history-card-running {
  border-style: dashed;
  border-color: rgba(31, 51, 94, 0.26);
  background: rgba(31, 51, 94, 0.05);
}

.history-card p,
.log-card p {
  margin: 6px 0;
  color: var(--ink);
}

.history-card small,
.log-card small,
.company-config-card small {
  color: var(--ink-soft);
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1080px) {
  .dashboard-toolbar-filters,
  .stats-grid,
  .billers-layout,
  .settings-grid,
  .company-grid,
  .filters {
    grid-template-columns: 1fr;
  }

  .biller-tabs {
    grid-template-columns: 1fr;
  }

  .biller-tab {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .biller-tab-state {
    grid-column: 2;
    justify-self: start;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-badges {
    grid-template-columns: 1fr;
  }

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

  .control-center-topbar,
  .hero-actions,
  .toolbar-actions,
  .hero-design-field,
  .biller-switcher-header,
  .settings-actions,
  .modal-topbar,
  .modal-brand-row {
    flex-direction: column;
    align-items: start;
  }

  .toolbar-actions .secondary-button {
    width: 100%;
  }

  .auth-shell {
    min-height: auto;
    padding: 16px 0 24px;
  }
}

@media (max-width: 720px) {
  .auth-shell {
    width: min(100% - 20px, 100%);
  }

  .auth-card {
    padding: 20px;
    border-radius: 24px;
  }

  .page-shell {
    width: min(100% - 20px, 100%);
    margin-top: 12px;
  }

  .hero,
  .panel,
  .stat-card {
    padding: 20px;
    border-radius: 24px;
  }

  .hero-brand {
    padding: 20px;
  }

  .hero-design-field {
    justify-self: start;
    width: min(100%, 240px);
  }

  .biller-tab {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 18px 18px 16px;
  }

  .biller-tab-badge,
  .biller-tab-state {
    justify-self: start;
  }

  .tab-pill {
    min-width: 100%;
  }

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

  .modal-card {
    padding: 18px;
  }
}

