:root {
  --navy: #102d42;
  --navy-2: #174059;
  --teal: #007d74;
  --teal-light: #e0f6f1;
  --blue: #276dd9;
  --ink: #163246;
  --muted: #587185;
  --bg: #eff4f8;
  --line: #d8e3eb;
  --surface: #fff;
  --danger: #b42332;
  --radius: 18px;
  --shadow: 0 3px 0 #dce6ec, 0 12px 30px rgba(28, 66, 87, 0.06);
  font-family:
    Inter,
    Segoe UI,
    Arial,
    sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--bg);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  line-height: 1.5;
}
a {
  color: var(--teal);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.6;
}
.icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  vertical-align: middle;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 1.85rem;
  line-height: 1.25;
  letter-spacing: -0.035em;
  margin-bottom: 8px;
}
h2 {
  font-size: 1.23rem;
  line-height: 1.3;
  margin-bottom: 18px;
}
h3 {
  font-size: 1rem;
}
small,
.small {
  font-size: 0.85rem;
}
.muted {
  color: var(--muted);
}
.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 750;
  color: var(--teal);
  margin-bottom: 12px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 17px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  font-size: 0.91rem;
  font-weight: 650;
  line-height: 1.25;
  text-align: center;
  transition:
    transform 0.13s,
    box-shadow 0.13s;
}
.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px #153a5014;
}
.btn.primary {
  background: var(--teal);
  color: white;
  border-color: var(--teal);
  box-shadow: 0 3px 0 #005e58;
}
.btn.blue {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.btn.danger {
  color: var(--danger);
  border-color: #ebc8ce;
  background: #fff7f8;
}
.btn.small {
  min-height: 36px;
  padding: 7px 11px;
  font-size: 0.84rem;
}
.btn.icon-only {
  padding: 9px;
  min-width: 44px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.panel,
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
}
.panel.flush {
  padding: 0;
  overflow: hidden;
}
.panel-top {
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.panel-top h2 {
  margin: 0;
}
.stack > * + * {
  margin-top: 18px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.span-all {
  grid-column: 1/-1;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin: 4px 0 26px;
}
.page-heading p {
  margin: 0;
  color: var(--muted);
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 7px;
  font-weight: 650;
  font-size: 0.78rem;
  background: #eaf0f5;
  color: #3b596b;
  white-space: nowrap;
}
.badge.confirmado {
  background: #e1f5ed;
  color: #146140;
}
.badge.anulado {
  background: #fde9ec;
  color: #a32b40;
}
.badge.borrador {
  background: #fff2cf;
  color: #80611b;
}
.notice {
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 10px;
  padding: 15px 18px;
  background: #edf5ff;
  margin-bottom: 22px;
}
.notice.error {
  background: #fff1f3;
  border-color: #f1c3ca;
  border-left-color: var(--danger);
  color: #921e2c;
}
.notice.success {
  background: #eaf9f2;
  border-color: #b6e8cc;
  border-left-color: #228554;
  color: #165d3a;
}
.empty {
  padding: 52px 20px;
  text-align: center;
  color: var(--muted);
}
.empty .icon {
  width: 34px;
  height: 34px;
  margin-bottom: 13px;
  color: var(--teal);
}
.empty h3 {
  color: var(--ink);
  margin-bottom: 6px;
}
.empty p {
  max-width: 470px;
  margin: 0 auto 20px;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 266px;
  background: linear-gradient(160deg, var(--navy), #0c2537);
  color: #d5e6ed;
  z-index: 40;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 27px 22px 24px;
  color: #fff;
}
.brand strong {
  display: block;
  letter-spacing: 0.04em;
  font-size: 1.1rem;
}
.brand small {
  display: block;
  color: #adc5d3;
  font-size: 0.73rem;
  letter-spacing: 0.07em;
}
.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 43px;
  height: 45px;
  border-radius: 12px;
  background: linear-gradient(140deg, #2ad0b3, #048878);
  box-shadow:
    3px 4px 0 #071f2e,
    0 5px 22px #04b19433;
  color: #fff;
}
.sidebar-nav {
  overflow: auto;
  padding: 0 13px 22px;
  scrollbar-width: thin;
}
.sidebar a {
  color: inherit;
}
.nav-label {
  font-size: 0.71rem;
  letter-spacing: 0.12em;
  color: #8daeba;
  padding: 20px 12px 8px;
  font-weight: 700;
}
.nav-link,
.nav-group > summary {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 11px 12px;
  border-radius: 9px;
  font-size: 0.87rem;
  cursor: pointer;
  list-style: none;
  margin: 3px 0;
}
.nav-group > summary::after {
  content: "›";
  margin-left: auto;
  font-size: 1.2rem;
  color: #98b7c6;
}
.nav-group[open] > summary::after {
  transform: rotate(90deg);
}
.nav-link:hover,
.nav-group > summary:hover {
  background: #ffffff0d;
  text-decoration: none;
}
.nav-link.active {
  background: #0d695f;
  color: #fff;
  box-shadow: inset 3px 0 #42d4b5;
}
.subnav {
  padding-left: 21px;
  margin-left: 20px;
  border-left: 1px solid #ffffff1f;
}
.subnav .nav-link {
  padding: 9px 9px;
  font-size: 0.84rem;
  line-height: 1.4;
}
.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid #ffffff12;
  padding: 16px 23px;
  font-size: 0.76rem;
  color: #91adbd;
}
.main {
  margin-left: 266px;
  min-height: 100vh;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 32px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-title {
  font-size: 0.85rem;
  color: var(--muted);
}
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #e4f3ef;
  color: #087566;
  border-radius: 10px;
  font-weight: 750;
}
.content {
  padding: 30px 32px 48px;
  max-width: 1800px;
  margin: 0 auto;
}
.menu-toggle {
  display: none;
}
.sidebar-backdrop {
  display: none;
}
.stat {
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  box-shadow: var(--shadow);
  position: relative;
  min-height: 156px;
}
.stat-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.85rem;
  gap: 10px;
  margin-bottom: 22px;
}
.stat-label .icon {
  color: var(--teal);
}
.stat-value {
  font-size: clamp(1.25rem, 1.65vw, 1.8rem);
  letter-spacing: -0.035em;
  font-weight: 750;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.stat p {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 6px 0 0;
}
.stats {
  margin-bottom: 28px;
}
.welcome {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 30px;
  background: linear-gradient(115deg, #e2f6f0, #e8f1fd);
  border: 1px solid #c0dfd8;
  border-radius: 18px;
  padding: 28px;
  margin-bottom: 28px;
}
.welcome h2 {
  font-size: 1.55rem;
  letter-spacing: -0.025em;
  margin: 0 0 8px;
}
.welcome p {
  margin: 0;
  color: #3e6571;
  max-width: 610px;
}
.table-wrap {
  overflow: auto;
  width: 100%;
  border-radius: 12px;
}
.data-table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-size: 0.87rem;
}
.data-table th {
  background: #f6f9fb;
  color: #617889;
  font-weight: 650;
  font-size: 0.78rem;
  border-bottom: 1px solid var(--line);
  padding: 13px 16px;
  white-space: nowrap;
}
.data-table td {
  padding: 15px 16px;
  border-bottom: 1px solid #e6edf2;
  vertical-align: middle;
  max-width: 360px;
  overflow-wrap: anywhere;
}
.data-table tr:last-child td {
  border-bottom: 0;
}
.data-table tbody tr:hover {
  background: #f9fcfd;
}
.data-table .numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.data-table input,
.data-table select {
  min-width: 90px;
}
.data-table .lookup {
  min-width: 190px;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  gap: 16px;
  color: var(--muted);
  font-size: 0.86rem;
}
.pagination .pages {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.pagination .current {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
label.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.86rem;
  font-weight: 650;
  color: #36536a;
  min-width: 0;
}
.field input,
.field select,
.field textarea,
input.control,
select.control {
  width: 100%;
  padding: 11px 12px;
  min-height: 45px;
  border: 1px solid #c9d8e2;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 400;
}
.field textarea {
  min-height: 92px;
  resize: vertical;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--teal);
  outline: 3px solid #008d791a;
}
.field .help {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--muted);
}
.required {
  color: var(--danger);
}
.lookup {
  position: relative;
  display: flex;
  gap: 7px;
  align-items: stretch;
  min-width: 0;
}
.lookup-input {
  min-width: 0;
  flex: 1;
}
.lookup .lookup-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 250px;
  overflow: auto;
  z-index: 70;
  background: #fff;
  border: 1px solid #baccd8;
  border-radius: 10px;
  box-shadow: 0 14px 25px #153a5026;
  padding: 5px;
  font-weight: 400;
}
.lookup-results[hidden] {
  display: none;
}
.lookup-results button {
  width: 100%;
  text-align: left;
  padding: 11px;
  border: 0;
  background: none;
  color: var(--ink);
  border-radius: 6px;
  font-size: 0.88rem;
}
.lookup-results button:hover,
.lookup-results button:focus {
  background: #e8f6f2;
}
.lookup-results .no-result {
  padding: 12px;
  font-size: 0.85rem;
  color: var(--muted);
}
.quick-add {
  color: var(--teal);
  background: #e6f6f1;
  border: 1px solid #b8e0d7;
  border-radius: 9px;
  min-width: 42px;
  font-size: 1.35rem;
  line-height: 1;
}
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  align-items: end;
}
.filters {
  padding: 19px 22px;
}
.filters > summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0;
}
.filters[open] > summary {
  margin-bottom: 18px;
}
.form-footer {
  position: sticky;
  bottom: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 -8px 30px #1e41540b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  z-index: 20;
  margin-top: 20px;
}
.totals {
  margin-top: 20px;
  text-align: right;
  font-size: 1.18rem;
  font-weight: 700;
}
.hint-box {
  padding: 15px 18px;
  border-radius: 10px;
  background: #f0f6fa;
  color: #426478;
  font-size: 0.88rem;
  margin-bottom: 20px;
}
.details-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
}
.details-grid dt {
  font-size: 0.79rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.details-grid dd {
  margin: 0;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}
.doc-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}
.modal {
  border: 0;
  padding: 0;
  border-radius: 18px;
  width: min(760px, calc(100% - 28px));
  max-height: 90dvh;
  box-shadow: 0 30px 100px #08223455;
  color: var(--ink);
  background: white;
  overflow: hidden;
}
.modal::backdrop {
  background: #0c243973;
}
.modal-shell {
  display: flex;
  flex-direction: column;
  max-height: 90dvh;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 19px 23px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.modal-header h2 {
  margin: 0;
}
.modal-body {
  padding: 22px;
  overflow: auto;
  flex: 1;
}
.modal-footer {
  padding: 15px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}
.modal-shell > form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.modal-body {
  min-height: 0;
}
.modal.error {
  padding: 25px;
}
.auth-page {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  background: #fff;
}
.auth-story {
  background: linear-gradient(145deg, #0a2e41, #145571);
  padding: 55px max(45px, 7vw);
  display: flex;
  flex-direction: column;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.auth-story .brand {
  padding: 0;
}
.auth-copy {
  margin: auto 0;
  padding: 55px 0;
}
.auth-copy .eyebrow {
  color: #70e6cc;
}
.auth-copy h1 {
  font-size: clamp(2.5rem, 4vw, 4rem);
  line-height: 1.12;
  max-width: 600px;
  letter-spacing: -0.045em;
}
.auth-copy p {
  font-size: 1.04rem;
  color: #b4d1df;
  max-width: 460px;
  margin: 24px 0 35px;
}
.auth-capabilities {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 430px;
}
.auth-capabilities span {
  background: #ffffff0d;
  border: 1px solid #ffffff20;
  box-shadow: 0 5px 0 #071e2936;
  padding: 12px 15px;
  border-radius: 12px;
  font-size: 0.85rem;
}
.auth-bottom {
  color: #83a9ba;
  font-size: 0.79rem;
}
.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 45px 30px;
}
.auth-form {
  width: 100%;
  max-width: 440px;
}
.auth-form h1 {
  font-size: 2rem;
}
.auth-form .intro {
  color: var(--muted);
  margin-bottom: 28px;
}
.auth-form form > .field {
  margin-bottom: 20px;
}
.auth-form .btn.wide {
  width: 100%;
  margin-top: 6px;
}
.auth-security {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.79rem;
  color: var(--muted);
  margin-top: 26px;
}
.auth-security .icon {
  width: 17px;
}
.auth-mobile-brand {
  display: none;
}
.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  font-size: 0.86rem;
  margin: 18px 0;
}
.secret {
  padding: 12px;
  background: #f0f6fa;
  border: 1px dashed #bbceda;
  border-radius: 10px;
  word-break: break-all;
  text-align: center;
  font: 600 1rem monospace;
}
.qr {
  display: block;
  margin: 15px auto;
  max-width: 190px;
}
.recovery-codes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0;
  list-style: none;
}
.recovery-codes li {
  background: #f1f5f8;
  padding: 10px;
  text-align: center;
  border-radius: 8px;
  font-family: monospace;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.check-row input {
  width: 19px;
  height: 19px;
  accent-color: var(--teal);
}
.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 16px;
}
.permission-group {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 15px;
}
.permission-group h3 {
  text-transform: capitalize;
  margin-bottom: 10px;
}
.guide-steps {
  list-style: none;
  padding: 0;
  counter-reset: steps;
  display: grid;
  gap: 18px;
}
.guide-steps > li {
  counter-increment: steps;
  position: relative;
  padding: 23px 23px 23px 76px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}
.guide-steps > li:before {
  content: counter(steps);
  position: absolute;
  left: 22px;
  top: 23px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--teal-light);
  color: var(--teal);
  font-weight: 750;
  box-shadow: 0 3px 0 #b4e2d6;
}
.guide-steps h3 {
  margin-bottom: 7px;
}
.guide-steps p {
  color: var(--muted);
  font-size: 0.93rem;
  margin: 0 0 14px;
}
.guide-tab[aria-selected="true"] {
  background: var(--teal);
  color: white;
  border-color: var(--teal);
}
.guide-panel[hidden] {
  display: none;
}
.tabbar {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 24px;
}
.document-meta {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.error-view {
  max-width: 650px;
  margin: 60px auto;
  text-align: center;
}
.inline-form {
  display: inline;
}
.upload-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.screen-reader {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
@media (max-width: 1190px) {
  .grid.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .content {
    padding: 24px;
  }
  .topbar {
    padding: 15px 24px;
  }
  .details-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .auth-story {
    padding: 35px;
  }
  .auth-copy h1 {
    font-size: 2.9rem;
  }
}
@media (max-width: 980px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.18s;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main {
    margin-left: 0;
  }
  .menu-toggle {
    display: inline-flex;
  }
  .sidebar-backdrop.show {
    display: block;
    position: fixed;
    inset: 0;
    background: #142a3b70;
    z-index: 35;
  }
  .auth-page {
    grid-template-columns: 0.85fr 1fr;
  }
  .auth-copy h1 {
    font-size: 2.4rem;
  }
  .grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* Cards are only used at phone width. Tablet and desktop retain tables. */
@media (max-width: 640px) {
  :root {
    font-size: 16px;
  }
  .content {
    padding: 22px 16px 30px;
  }
  .topbar {
    padding: 11px 16px;
  }
  .topbar-title {
    display: none;
  }
  .topbar .user-name {
    display: none;
  }
  .grid,
  .grid.three,
  .grid.four {
    grid-template-columns: 1fr;
  }
  .stats.grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .stat {
    padding: 15px;
    min-height: 140px;
    border-radius: 13px;
  }
  .stat-label {
    font-size: 0.78rem;
    margin-bottom: 16px;
    align-items: flex-start;
  }
  .stat-label .icon {
    width: 18px;
    height: 18px;
  }
  .stat-value {
    font-size: 1.16rem;
  }
  .stat p {
    font-size: 0.75rem;
  }
  .page-heading {
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
  }
  h1 {
    font-size: 1.65rem;
  }
  .panel,
  .card {
    padding: 18px;
    border-radius: 14px;
  }
  .panel-top {
    padding: 18px;
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .welcome {
    grid-template-columns: 1fr;
    padding: 22px;
    gap: 18px;
  }
  .welcome h2 {
    font-size: 1.3rem;
  }
  .filter-grid {
    grid-template-columns: 1fr;
  }
  .filters {
    padding: 17px;
  }
  .data-table.cards,
  .data-table.cards tbody {
    display: block;
  }
  .data-table.cards thead {
    display: none;
  }
  .data-table.cards tr {
    display: block;
    background: white;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 13px;
    margin-bottom: 13px;
    box-shadow: 0 3px 0 #dce6ec66;
  }
  .data-table.cards td {
    display: grid;
    grid-template-columns: minmax(95px, 0.75fr) minmax(0, 1.25fr);
    gap: 12px;
    max-width: none;
    padding: 9px 0;
    border-bottom: 1px solid #edf2f6;
    font-size: 0.9rem;
    align-items: center;
  }
  .data-table.cards td:before {
    content: attr(data-label);
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 650;
  }
  .data-table.cards td:last-child {
    border: 0;
  }
  .data-table.cards td.numeric {
    text-align: left;
  }
  .data-table.cards td[data-label="Acciones"] {
    display: flex;
    flex-wrap: wrap;
    padding-top: 12px;
  }
  .data-table.cards td[data-label="Acciones"]:before {
    display: none;
  }
  .data-table.cards .lookup {
    min-width: 0;
  }
  .data-table.cards input,
  .data-table.cards select {
    min-width: 0;
  }
  .table-wrap {
    overflow: visible;
  }
  .panel.flush {
    padding: 14px;
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
  }
  .panel.flush .panel-top {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 15px;
  }
  .details-grid {
    grid-template-columns: 1fr;
  }
  .form-footer {
    border-radius: 12px;
    padding: 14px;
    flex-wrap: wrap;
    bottom: 5px;
  }
  .form-footer .actions {
    width: 100%;
  }
  .form-footer .actions > .btn {
    flex: 1;
  }
  .pagination {
    flex-direction: column;
    align-items: flex-start;
  }
  .modal {
    width: calc(100% - 18px);
    max-height: 94dvh;
    border-radius: 14px;
  }
  .modal-shell {
    max-height: 94dvh;
  }
  .modal-body {
    padding: 18px;
  }
  .modal-header,
  .modal-footer {
    padding: 15px 18px;
  }
  .modal-footer .btn {
    flex: 1;
  }
  .auth-page {
    display: block;
    background: #f0f5f8;
    padding: 20px 12px;
    min-height: 100dvh;
  }
  .auth-story {
    display: none;
  }
  .auth-main {
    min-height: calc(100dvh - 40px);
    padding: 28px 22px;
    background: white;
    border-radius: 20px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  .auth-mobile-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 36px;
  }
  .auth-mobile-brand strong {
    font-size: 0.95rem;
    letter-spacing: 0.06em;
  }
  .auth-mobile-brand small {
    display: block;
    color: var(--muted);
  }
  .auth-form h1 {
    font-size: 1.8rem;
  }
  .auth-form .intro {
    font-size: 0.95rem;
  }
  .guide-steps > li {
    padding: 20px 18px 20px 65px;
  }
  .guide-steps > li:before {
    left: 17px;
    top: 20px;
  }
  .topbar .btn.small {
    font-size: 0.78rem;
  }
  .data-table.cards td[colspan] {
    display: block;
    text-align: center;
  }
  .data-table.cards td[colspan]:before {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .btn:hover {
    transform: none;
  }
}
@media print {
  .sidebar,
  .topbar,
  .form-footer,
  .actions,
  .filters,
  .pagination,
  .no-print {
    display: none !important;
  }
  .main {
    margin: 0;
  }
  .content {
    padding: 0;
  }
  .panel {
    box-shadow: none;
  }
  .data-table.cards {
    display: table;
  }
  .recovery-codes {
    font-size: 18px;
  }
}

.modal-page {
  width: min(1200px, calc(100% - 32px));
  max-height: 94dvh;
}
.modal-page > .modal-shell {
  max-height: 94dvh;
}
.modal-page > .modal-shell > .modal-body {
  background: var(--bg);
  padding: 24px;
}
.modal-page .form-footer {
  bottom: -12px;
}
.modal-page .page-heading {
  margin-top: 0;
}
.modal-page .panel {
  box-shadow: 0 2px 0 #dce6ec;
}
.modal-page .modal-title {
  font-size: 1.05rem;
}
.modal-page .grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.modal-page .panel.flush {
  overflow: visible;
}
.modal-page .page-heading h1 {
  font-size: 1.5rem;
}
@media (max-width: 640px) {
  .modal-page {
    width: calc(100% - 12px);
    max-height: 96dvh;
  }
  .modal-page > .modal-shell {
    max-height: 96dvh;
  }
  .modal-page > .modal-shell > .modal-body {
    padding: 14px;
  }
  .modal-page .grid.three {
    grid-template-columns: 1fr;
  }
  .modal-page .form-footer {
    bottom: -6px;
  }
  .modal-page .form-footer .small {
    display: none;
  }
  .modal-page .form-footer .actions {
    width: 100%;
  }
  .modal-page .form-footer .btn {
    width: 100%;
  }
  .modal-page .page-heading h1 {
    font-size: 1.3rem;
  }
}

/* Native top-layer dialogs styled alongside Bootstrap, with explicit X-only lifecycle. */
dialog.modal:not([open]) {
  display: none;
}
dialog.modal[open] {
  display: block;
  position: fixed;
  inset: 0;
  margin: auto;
  height: fit-content;
  overflow: hidden;
  z-index: 1055;
}
.modal-page[open] {
  max-height: 94dvh;
}
.badge {
  line-height: 1.4;
}
.sidebar .nav-link {
  color: inherit;
}
.grid {
  display: grid;
}
.modal .swal2-container {
  position: fixed;
  inset: 0;
}
.agro-alert {
  border-radius: 18px;
}
.swal2-popup {
  font-family: inherit;
}
.swal2-close {
  color: #587185;
}
.help-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border: 1px solid #9dbbbf;
  border-radius: 50%;
  background: #eef8f6;
  color: #237167;
  font-size: 12px;
  font-weight: 700;
}
.field .form-control,
.field .form-select {
  font-size: 0.94rem;
}
.btn {
  --bs-btn-border-width: 1px;
}
