:root {
  color-scheme: light;
  --ink: #172331;
  --muted: #5d6b7a;
  --line: #d9e1ea;
  --soft: #eef4f8;
  --surface: #ffffff;
  --surface-2: #f7fafc;
  --primary: #176d9c;
  --primary-strong: #0d557e;
  --accent: #e4a32f;
  --danger: #b8333a;
  --ok: #19784f;
  --shadow: 0 18px 45px rgba(23, 35, 49, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #f4f8fb 0%, #edf3f7 100%);
  color: var(--ink);
}

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

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(200px, 1fr) auto minmax(200px, 1fr);
  align-items: center;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 42px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  grid-column: 1;
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-shrink: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.brand-title-bios {
  color: var(--ink);
}

.brand-title-conecta {
  color: var(--primary);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.topbar .toolbar {
  grid-column: 2;
  justify-self: center;
  max-width: 100%;
  justify-content: center;
  gap: 4px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.topbar .toolbar::-webkit-scrollbar {
  display: none;
}

.topbar .toolbar .button {
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 0.86rem;
  flex-shrink: 0;
  transition: transform 150ms ease, background 150ms ease, color 150ms ease;
}

.topbar .toolbar .button:hover {
  transform: translateY(-1px);
}

.topbar .toolbar .button.secondary {
  background: transparent;
  color: var(--muted);
}

.topbar .toolbar .button.secondary:hover {
  background: var(--soft);
  color: var(--ink);
}

.topbar .toolbar .button.nav-activo {
  background: #eaf2fb;
  color: var(--primary);
  border-color: transparent;
}

.topbar .toolbar .button.nav-activo svg {
  stroke: var(--primary);
}

.icon-chevron {
  width: 14px;
  height: 14px;
  opacity: 0.65;
}

.solo-movil {
  display: none;
}

.main {
  width: min(1180px, calc(100% - 28px));
  margin: 24px auto 42px;
}

.view-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.view-title h2 {
  margin: 0;
  font-size: clamp(1.15rem, 1.8vw, 1.5rem);
  line-height: 1.2;
}

.view-title p {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 760px;
}

.grid {
  display: grid;
  gap: 16px;
}

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

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

.panel,
.choice,
.record-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.choice {
  min-height: 210px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.choice:hover,
.choice:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(23, 109, 156, 0.4);
  box-shadow: 0 22px 52px rgba(23, 35, 49, 0.12);
  outline: none;
}

.choice-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e8f3f8;
  color: var(--primary);
}

.choice h3,
.panel h3,
.record-card h3 {
  margin: 14px 0 8px;
  font-size: 1.12rem;
}

.choice p,
.record-card p {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.panel {
  padding: 18px;
}

.section-band {
  margin: 22px -18px 16px;
  padding: 9px 18px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 0.78rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.section-band:first-child {
  margin-top: -18px;
  border-radius: 8px 8px 0 0;
}

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

.field {
  display: grid;
  gap: 7px;
}

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

.field label,
.label {
  color: #253546;
  font-weight: 700;
  font-size: 0.86rem;
}

.field small,
.hint {
  color: var(--muted);
  font-size: 0.78rem;
}

.attachment-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.attachment-preview figure,
.file-chip {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  overflow: hidden;
}

.attachment-preview img {
  width: 100%;
  height: 150px;
  display: block;
  object-fit: contain;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.attachment-preview figcaption,
.file-chip {
  padding: 8px 10px;
  color: #314356;
  font-size: 0.78rem;
  line-height: 1.25;
}

.file-chip {
  display: grid;
  gap: 4px;
}

.file-chip span,
.file-chip em {
  color: var(--muted);
  font-style: normal;
}

input,
textarea,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

textarea {
  min-height: 112px;
  resize: vertical;
  overflow: hidden;
}

.auto-grow-textarea {
  overflow: hidden;
  resize: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 109, 156, 0.13);
}

.segmented,
.check-grid {
  display: grid;
  gap: 8px;
}

.segmented {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.radio-pill {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
}

.radio-pill input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--primary);
}

.check-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.check-table th,
.check-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  vertical-align: middle;
}

.check-table th:first-child,
.check-table td:first-child {
  text-align: left;
}

.check-table th {
  background: #edf5f9;
  color: #314356;
  font-size: 0.82rem;
}

.check-table tr:last-child td {
  border-bottom: 0;
}

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

.signature-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 10px;
}

.signature-box canvas {
  width: 100%;
  height: 190px;
  display: block;
  background: #fff;
  border: 1px solid #cfd9e3;
  border-radius: 7px;
  touch-action: none;
}

.signature-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
  text-align: center;
}

.signature-actions small {
  flex: 1 1 auto;
  text-align: center;
}

.order-panel {
  padding: 0;
  overflow: hidden;
}

.order-sheet {
  width: 7.95in;
  min-height: 10.45in;
  margin: 0 auto;
  background: #fff;
  border: 1px solid rgba(160, 177, 194, 0.38);
  border-radius: 22px;
  overflow: hidden;
  color: #0b1722;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 9.6pt;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
}

.order-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
}

.order-table td {
  border: 1px solid #d6e0ea;
  vertical-align: middle;
  padding: 0.03in 0.045in;
  font-size: 9.6pt;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.order-gap {
  margin-top: 0.06in;
}

.order-center {
  text-align: center;
}

.order-bold {
  font-weight: 700;
}

.order-title-big,
.order-head-big {
  font-size: 13.8pt;
  font-weight: 700;
  letter-spacing: 0.15px;
}

.order-small {
  font-size: 8.2pt;
}

.order-logo-cell {
  padding: 0.04in !important;
}

.order-logo-img {
  height: 0.28in;
  max-width: 100%;
  object-fit: contain;
}

.order-section {
  background: linear-gradient(135deg, #2e648f, #447fae);
  color: #fff;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.order-field-cell {
  padding: 0 !important;
}

.order-text-input,
.order-text-area {
  width: 100%;
  border: 0;
  border-radius: 0;
  padding: 0.045in 0.055in;
  font: inherit;
  color: inherit;
  box-shadow: none;
  background: #f7fafc;
  outline: none;
}

.order-text-input:focus,
.order-text-area:focus {
  background: #eef6fd;
  box-shadow: inset 0 0 0 1px #8db7df;
}

.order-row-tight .order-text-input {
  min-height: 0.22in;
}

.order-text-area {
  resize: none;
  min-height: 0.56in;
  line-height: 1.2;
  overflow: hidden;
}

.order-text-area.order-desc {
  min-height: 0.50in;
}

.order-text-area.order-obs {
  min-height: 0.72in;
}

.order-svc-box {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 0.025in;
}

.order-service-choice {
  height: 0.39in;
  vertical-align: middle !important;
  line-height: 1.05;
}

.order-svc-box input,
.order-status-cell input {
  width: auto;
  min-height: auto;
  margin: 0;
  padding: 0;
  transform: scale(1.02);
  accent-color: #0f4c81;
}

.order-check-table td {
  padding-top: 0.024in;
  padding-bottom: 0.024in;
}

.order-check-item {
  font-weight: 700;
  font-size: 8.9pt;
}

.order-status-head {
  font-weight: 700;
  text-align: center;
  font-size: 8.4pt;
  color: #5d7184;
}

.order-status-cell {
  text-align: center;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.order-sig-label {
  font-weight: 700;
  margin-bottom: 0.015in;
}

.order-sig-box {
  margin-top: 0.03in;
  border: 1px solid #bfcddd;
  border-radius: 14px;
  background: linear-gradient(180deg, #fcfeff 0%, #f4f8fb 100%);
  padding: 0.04in 0.035in 0.04in;
}

.order-recepcion-table td {
  vertical-align: top;
}

.order-sig-frame {
  padding: 0.03in 0.025in 0.015in;
  border: 1px solid #d7e2ec;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.order-sig-pad-wrap {
  min-height: 1.28in;
  display: flex;
  align-items: end;
  justify-content: center;
  padding: 0.02in 0.015in 0;
}

.order-sig-pad {
  width: 100%;
  height: 1.02in;
  display: block;
  border: none;
  border-radius: 0;
  background: transparent;
  touch-action: none;
  cursor: crosshair;
}

.order-sig-line {
  border-top: 1.6px solid #38485a;
  margin: 0.01in 0.01in 0;
  height: 0;
}

.order-sig-caption {
  text-align: center;
  font-size: 7.8pt;
  color: #5d7184;
  margin-top: 0.02in;
  letter-spacing: 0.2px;
  font-weight: 800;
  text-transform: uppercase;
}

.order-sig-actions {
  margin-top: 0.03in;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  text-align: center;
}

.order-sig-actions .button {
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 8pt;
}

.order-sig-actions small {
  font-size: 7.7pt;
  color: #5d7184;
  line-height: 1.2;
  text-align: center;
}

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: 7px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.button:hover {
  background: var(--primary-strong);
}

.button.secondary {
  background: #e9f0f4;
  color: #1e3448;
}

.button.secondary:hover {
  background: #dbe7ef;
}

.button.warning {
  background: var(--accent);
  color: #241700;
}

.button.danger {
  background: var(--danger);
}

.button.form-clear {
  background: #c7323d;
  color: #fff;
}

.button.form-clear:hover {
  background: #a92530;
}

.button.form-save {
  background: #176d9c;
  color: #fff;
}

.button.form-save:hover {
  background: #0d557e;
}

.button.form-sync {
  background: #f2a72b;
  color: #1f1605;
}

.button.form-sync:hover {
  background: #d88f12;
}

.button.form-output {
  background: #e8f3f8;
  color: #12344c;
}

.button.form-output:hover {
  background: #d3e8f2;
}

.form-actions .button[data-action="clear-form"] {
  background: #c7323d !important;
  color: #fff !important;
}

.form-actions .button[data-action="clear-form"]:hover {
  background: #a92530 !important;
}

.form-actions .button[data-action="save-form"] {
  background: #176d9c !important;
  color: #fff !important;
}

.form-actions .button[data-action="save-form"]:hover {
  background: #0d557e !important;
}

.form-actions .button[data-action="save-sync-form"] {
  background: #f2a72b !important;
  color: #1f1605 !important;
}

.form-actions .button[data-action="save-sync-form"]:hover {
  background: #d88f12 !important;
}

.form-actions .button[data-action="print-form"],
.form-actions .button[data-action="pdf-form"] {
  background: #e8f3f8 !important;
  color: #12344c !important;
}

.form-actions .button[data-action="print-form"]:hover,
.form-actions .button[data-action="pdf-form"]:hover {
  background: #d3e8f2 !important;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.form-actions,
.record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.form-actions {
  justify-content: center;
  padding: 18px 10px 4px;
}

.record-actions {
  justify-content: flex-end;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #e9f0f4;
  color: #294053;
  font-weight: 800;
  font-size: 0.76rem;
}

.badge.ok {
  background: #e1f2ea;
  color: var(--ok);
}

.badge.pending {
  background: #fff2d7;
  color: #835408;
}

.badge.danger {
  background: #fae6e8;
  color: var(--danger);
}

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

.record-card {
  padding: 16px;
  box-shadow: none;
}

.record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.empty-state {
  padding: 34px 18px;
  border: 1px dashed #b7c8d6;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  text-align: center;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(420px, calc(100% - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #122335;
  color: #fff;
  box-shadow: var(--shadow);
}

.hidden {
  display: none !important;
}

@media (max-width: 820px) {
  body {
    overflow-x: hidden;
  }

  .main {
    width: min(100% - 16px, 1180px);
    margin-top: 14px;
  }

  .topbar {
    grid-template-columns: auto 1fr;
  }

  .topbar .toolbar {
    grid-column: 2;
    justify-self: end;
  }

  .view-title {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar,
  .form-actions,
  .record-actions {
    justify-content: stretch;
  }

  .button {
    flex: 1 1 auto;
    min-width: min(100%, 150px);
    white-space: normal;
    text-align: center;
  }

  .grid.two,
  .grid.three,
  .form-grid,
  .signature-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 14px;
  }

  .section-band {
    margin-left: -14px;
    margin-right: -14px;
    line-height: 1.2;
  }

  .field,
  .radio-pill,
  .record-card {
    min-width: 0;
  }

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

  input,
  textarea,
  select {
    min-width: 0;
  }

  .attachment-preview {
    grid-template-columns: 1fr;
  }

  .attachment-preview img {
    height: auto;
    max-height: 230px;
  }

  .order-panel {
    padding: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .order-sheet {
    width: 680px;
    min-width: 680px;
    min-height: auto;
    border-radius: 14px;
    font-size: 8.2pt;
    box-shadow: none;
  }

  .order-table td {
    padding: 0.024in 0.032in;
    font-size: 8.2pt;
    line-height: 1.12;
  }

  .order-title-big,
  .order-head-big {
    font-size: 12pt;
  }

  .order-small {
    font-size: 7.4pt;
  }

  .order-logo-img {
    height: 0.22in;
  }

  .order-text-input,
  .order-text-area {
    padding: 0.045in 0.045in;
    font-size: 11pt;
  }

  .order-text-area {
    min-height: 0.72in;
  }

  .order-text-area.order-obs {
    min-height: 0.9in;
  }

  .order-check-item {
    font-size: 8pt;
    line-height: 1.12;
  }

  .order-status-head {
    font-size: 7.4pt;
  }

  .order-status-cell input,
  .order-svc-box input {
    transform: scale(1.15);
  }

  .order-sig-box {
    padding: 0.04in;
  }

  .order-sig-pad-wrap {
    min-height: 1.12in;
  }

  .order-sig-pad {
    height: 0.92in;
  }

  .order-sig-actions {
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
  }

  .order-sig-actions .button {
    width: 100%;
  }

  .check-table {
    font-size: 0.82rem;
  }

  .check-table th,
  .check-table td {
    padding: 8px 6px;
  }
}

@media (max-width: 430px) {
  .brand {
    align-items: flex-start;
  }

  .brand h1 {
    font-size: 0.98rem;
  }

  .brand p {
    font-size: 0.76rem;
  }

  .toolbar,
  .form-actions,
  .record-actions {
    gap: 7px;
  }

  .form-actions {
    padding-left: 0;
    padding-right: 0;
  }

  .form-actions .button,
  .record-actions .button {
    flex-basis: 100%;
  }

  .order-sheet {
    width: 650px;
    min-width: 650px;
  }

  .order-table td {
    font-size: 7.8pt;
  }
}

@media print {
  @page {
    size: Letter;
    margin: 0.25in;
  }

  body {
    background: #fff;
  }

  .topbar,
  .view-title,
  .form-actions,
  .no-print,
  .toast,
  .barra-inferior {
    display: none !important;
  }

  .main {
    width: 100%;
    margin: 0;
  }

  .panel,
  .order-panel {
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .order-sheet {
    width: 100%;
    min-height: auto;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    font-size: 9.5pt;
  }

  .order-table td {
    border-color: #7f7f7f;
    padding: 0.03in 0.045in;
  }

  .order-text-input,
  .order-text-area {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0.03in 0.045in;
  }

  input,
  textarea,
  canvas,
  .order-section {
    color: #000;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .order-sig-box,
  .order-sig-frame {
    border: 0 !important;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0.02in 0 0;
  }

  .order-sig-pad-wrap {
    min-height: 0.42in;
    padding: 0;
  }

  .order-sig-pad {
    height: 0.46in;
  }

  .order-sig-line {
    border-top: 1px solid #000;
    margin-top: 0.01in;
  }

  .order-sig-caption {
    color: #000 !important;
    margin-top: 0.015in;
  }

  .signature-actions {
    display: none;
  }

  input[type="file"] {
    display: none !important;
  }

  .attachment-preview {
    break-inside: avoid;
    grid-template-columns: 1fr;
  }

  .attachment-preview img {
    height: auto;
    max-height: 600px;
  }
}

.button.loading {
  opacity: 0.8;
  cursor: wait;
  pointer-events: none;
}

.icon-spin {
  animation: button-spin 0.9s linear infinite;
}

@keyframes button-spin {
  to {
    transform: rotate(360deg);
  }
}

.button.nav-activo {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.button.nav-activo svg {
  stroke: #fff;
}

.nav-globo {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--accent);
  color: #241700;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.barra-inferior {
  display: none;
}

@media screen and (max-width: 820px) {
  .toolbar .nav-item {
    display: none;
  }

  .toolbar .button {
    flex: 0 0 auto;
    min-width: 0;
  }

  .install-button {
    padding: 8px;
  }

  .install-button span {
    display: none;
  }

  .solo-movil {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: none;
    border: 0;
    color: var(--muted);
    font-family: inherit;
    font-size: 0.68rem;
    line-height: 1.1;
    cursor: pointer;
    padding: 2px;
  }

  .solo-movil svg {
    width: 22px;
    height: 22px;
  }

  .main {
    padding-bottom: calc(86px + env(safe-area-inset-bottom));
  }

  .barra-inferior {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    background: #fff;
    border-top: 1px solid var(--line);
    padding: 6px 2px calc(8px + env(safe-area-inset-bottom));
  }

  .barra-inferior-item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 4px 1px;
    background: none;
    border: 0;
    color: var(--muted);
    font-family: inherit;
    font-size: clamp(0.56rem, 2.2vw, 0.68rem);
    line-height: 1.15;
    cursor: pointer;
    position: relative;
  }

  .barra-inferior-item span {
    width: 100%;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .barra-inferior-item svg {
    width: clamp(18px, 5vw, 22px);
    height: clamp(18px, 5vw, 22px);
  }

  .barra-inferior-item.activo {
    color: var(--primary);
    font-weight: 700;
  }

  .barra-inferior-item.activo svg {
    stroke: var(--primary);
  }

  #toast {
    bottom: calc(90px + env(safe-area-inset-bottom));
    z-index: 30;
  }

  .barra-inferior-item .nav-globo {
    position: absolute;
    top: 0;
    left: 50%;
    margin-left: 3px;
  }
}

.repo-buscador {
  margin-bottom: 12px;
}

.repo-buscador input {
  width: 100%;
}

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

.stat-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}

.stat-tile-icon {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8f3f8;
  color: var(--primary);
}

.stat-tile-icon .icon {
  width: 24px;
  height: 24px;
}

.stat-tile-label {
  display: block;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.86rem;
}

.stat-tile-value {
  display: block;
  font-size: 1.5rem;
  color: var(--primary);
  line-height: 1.25;
}

.stat-tile-sub {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
}

@media (max-width: 900px) {
  .stat-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .stat-tiles {
    grid-template-columns: 1fr;
  }
}

.buscador-filtros {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.search-input-wrap .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--muted);
  pointer-events: none;
}

.search-input-wrap input[type="search"] {
  width: 100%;
  padding-left: 44px;
  border-radius: 10px;
}

.buscador-filtros select {
  min-width: 150px;
}

.doc-list-titulo {
  margin: 18px 0 10px;
  font-size: 1rem;
  color: var(--ink);
}

.doc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
}

.doc-row-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #e8f3f8;
  color: var(--primary);
}

.doc-row-icon .icon {
  width: 22px;
  height: 22px;
}

.doc-row .doc-info {
  flex: 1;
  min-width: 0;
}

.doc-row .doc-info h4 {
  margin: 0 0 3px;
  font-size: 0.95rem;
  color: var(--ink);
}

.doc-row .doc-info small {
  color: var(--muted);
  font-size: 0.78rem;
  display: block;
}

.doc-row .doc-abrir {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
  text-decoration: none;
}

@media (max-width: 820px) {
  .doc-row {
    flex-wrap: wrap;
  }

  .doc-row .doc-info {
    flex-basis: 200px;
  }

  .doc-row .badge,
  .doc-row .doc-abrir {
    margin-top: 6px;
  }
}
