:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #dde3ee;
  --ok: #16a34a;
  --bad: #dc2626;
  --warn: #ca8a04;
  --accent: #0f766e;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", sans-serif; background: linear-gradient(180deg,#f8fbff,#eef2f9); color: var(--text); }
.portal-page {
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.10), transparent 32%),
    radial-gradient(circle at top right, rgba(2, 132, 199, 0.10), transparent 28%),
    linear-gradient(180deg, #f7fbff 0%, #edf3fb 100%);
}
.container { max-width: 1400px; margin: 24px auto; padding: 0 16px 40px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.muted { color: var(--muted); }
textarea { width: 100%; min-height: 130px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; resize: vertical; }
.actions { display: flex; gap: 10px; margin-top: 12px; align-items: center; }
.actions.wrap { flex-wrap: wrap; }
button { border: 0; background: var(--accent); color: white; padding: 10px 14px; border-radius: 8px; cursor: pointer; }
button.secondary { background: #374151; }
button:disabled { opacity: 0.6; cursor: not-allowed; }
input, select { border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; background: #fff; }
.hidden { display: none !important; }
.config-info { display: grid; gap: 12px; }
.config-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 10px; }
.config-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #f8fafc; display: grid; gap: 4px; }
.config-card.ok { border-color: rgba(22,163,74,.4); background: #ecfdf3; }
.config-card.bad { border-color: rgba(220,38,38,.4); background: #fef2f2; }
.config-title { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.config-card strong { font-size: 16px; }
.config-card small { color: var(--muted); word-break: break-all; }
.integration-settings {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  display: grid;
  gap: 12px;
}
.integration-settings h3 { margin: 0; font-size: 18px; }
.integration-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.integration-field {
  display: grid;
  gap: 6px;
}
.integration-field span {
  font-size: 13px;
  font-weight: 700;
  color: #374151;
}
.integration-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
}
.integration-field small {
  color: var(--muted);
  line-height: 1.35;
  word-break: break-all;
}
.integration-settings .actions {
  margin-top: 0;
}
.config-issues { margin: 0; padding-left: 18px; color: #991b1b; }
.config-issues.compact { margin-top: 6px; font-size: 12px; }
#progressWrap { width: 100%; background: #e5e7eb; border-radius: 999px; height: 12px; overflow: hidden; }
#progressBar { width: 0%; height: 100%; background: #0284c7; transition: width .2s; }
.stats { margin-top: 8px; display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; }
#tableScroll { margin-top: 10px; max-height: 520px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
table { table-layout: fixed; }
thead th { position: sticky; top: 0; background: #f8fafc; z-index: 1; }
tbody tr { height: 38px; }
th, td {
  border-bottom: 1px solid var(--line);
  padding: 6px 8px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
td a { color: #0f766e; text-decoration: none; }
td a:hover { text-decoration: underline; }
.status-completed,
.status-complete,
.status-success {
  background: #e9fbe9;
}

.status-completed > td,
.status-complete > td,
.status-success > td {
  background: #e9fbe9;
}

.status-pending,
.status-pendiente,
.status-processing,
.status-inprogress,
.status-revisando {
  background: #fff7d6;
}

.status-pending > td,
.status-pendiente > td,
.status-processing > td,
.status-inprogress > td,
.status-revisando > td {
  background: #fff7d6;
}

.status-servicio_no_detectado,
.status-unknown,
.status-metrica_no_disponible,
.status-link_roto {
  background: #fff1f2;
}

.status-servicio_no_detectado > td,
.status-unknown > td,
.status-metrica_no_disponible > td,
.status-link_roto > td {
  background: #fff1f2;
}

.status-tiene_caida,
.status-cayo {
  background: #fee2e2;
}

.status-tiene_caida > td,
.status-cayo > td {
  background: #fee2e2;
}

.status-sin_caida,
.status-no_cayo {
  background: #ffffff;
}

.status-sin_caida > td,
.status-no_cayo > td {
  background: #ffffff;
}

.status-subio {
  background: #dbeafe;
}

.status-subio > td {
  background: #dbeafe;
}

.status-sin_datos {
  background: #f3f4f6;
}

.status-sin_datos > td {
  background: #f3f4f6;
}

.status-error_api {
  background: #ffedd5;
}

.status-error_api > td {
  background: #ffedd5;
}

.status-error_panel,
.status-error_temporal,
.status-error_configuracion,
.status-error {
  background: #ffedd5;
}

.status-error_panel > td,
.status-error_temporal > td,
.status-error_configuracion > td,
.status-error > td {
  background: #ffedd5;
}

.portal-card.status-completed,
.portal-card.status-complete,
.portal-card.status-success {
  background: #e9fbe9;
}

.portal-card.status-pending,
.portal-card.status-pendiente,
.portal-card.status-processing,
.portal-card.status-inprogress,
.portal-card.status-revisando {
  background: #fff7d6;
}

.portal-card.status-servicio_no_detectado,
.portal-card.status-unknown,
.portal-card.status-metrica_no_disponible,
.portal-card.status-link_roto {
  background: #fff1f2;
}

.portal-card.status-tiene_caida,
.portal-card.status-cayo {
  background: #fee2e2;
}

.portal-card.status-sin_caida,
.portal-card.status-no_cayo {
  background: #ffffff;
}

.portal-card.status-subio {
  background: #dbeafe;
}

.portal-card.status-sin_datos {
  background: #f3f4f6;
}

.portal-card.status-error_api,
.portal-card.status-error_panel,
.portal-card.status-error_temporal,
.portal-card.status-error_configuracion,
.portal-card.status-error {
  background: #ffedd5;
}

.privacy-cell {
  min-width: 84px;
  max-width: 104px;
  padding: 6px 8px;
  text-align: center;
  white-space: nowrap;
  font-weight: 700;
}

tr.privacy-privada td.privacy-cell {
  color: #991b1b;
}

tr.privacy-publica td.privacy-cell {
  color: #047857;
}

tr.privacy-no_disponible td.privacy-cell {
  color: var(--muted);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.brand-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 8px 18px rgba(15, 23, 42, 0.12));
}

.topbar h1 {
  margin: 0;
  font-size: clamp(24px, 2vw, 32px);
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.topbar p {
  margin: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.session-chip {
  min-width: 165px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  padding: 9px 11px;
  display: grid;
  gap: 3px;
}

.session-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.session-chip strong {
  font-size: 13px;
}

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-shell {
  width: min(100%, 460px);
}

.auth-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  display: grid;
  gap: 14px;
}

.auth-logo {
  width: min(160px, 48vw);
  height: auto;
  display: block;
  margin: 0 auto 4px;
  filter: drop-shadow(0 10px 20px rgba(15, 23, 42, 0.16));
}

.auth-kicker {
  margin: 0;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.auth-card h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
}

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

.auth-form label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: var(--text);
}

.auth-form span {
  font-weight: 600;
}

.auth-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 12px;
  background: #fff;
}

.auth-form button {
  width: 100%;
  margin-top: 4px;
  padding: 12px 16px;
}

.auth-error {
  margin: 0;
  min-height: 20px;
  color: #b91c1c;
  font-size: 14px;
}
.admin-shell {
  display: grid;
  gap: 16px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.admin-list {
  overflow: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  vertical-align: top;
  word-break: break-word;
}

.admin-table th {
  background: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 1;
}

.admin-form {
  display: grid;
  gap: 12px;
}

.admin-form .field {
  display: grid;
  gap: 6px;
}

.admin-form .field span {
  font-weight: 600;
  font-size: 14px;
}

.admin-form .inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 700;
}

.user-state {
  font-weight: 700;
}

.user-state.active {
  color: #047857;
}

.user-state.inactive {
  color: #b91c1c;
}

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.admin-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.portal-provider-layout {
  display: grid;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.portal-provider-list {
  min-width: 0;
}

.portal-search {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.portal-search .actions,
.portal-search .portal-hint,
.portal-search .auth-error {
  grid-column: 1 / -1;
}

.portal-search .field {
  display: grid;
  gap: 6px;
}

.portal-search .field span {
  font-weight: 600;
  font-size: 14px;
}

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

.portal-results {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.portal-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  margin-bottom: 10px;
}

.portal-results.empty {
  min-height: 120px;
  place-items: center;
  text-align: center;
}

.portal-status-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.portal-status-tab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
}

.portal-status-tab:hover {
  transform: translateY(-1px);
}

.portal-status-tab.active {
  background: linear-gradient(135deg, var(--brand), #106d69);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 20px rgba(14, 133, 120, 0.18);
}

.portal-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: #f1f5f9;
  font-weight: 700;
  font-size: 12px;
}

.portal-results .table-scroll.compact .portal-table th,
.portal-results .table-scroll.compact .portal-table td {
  padding-top: 7px;
  padding-bottom: 7px;
}

.portal-history-table {
  table-layout: auto;
  width: 100%;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.portal-history-table th,
.portal-history-table td {
  white-space: normal;
  text-overflow: clip;
  overflow: visible;
  vertical-align: top;
}

.portal-history-table th {
  background: linear-gradient(180deg, #eef8f6 0%, #e5f3f0 100%);
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 12px;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.portal-history-table tr.portal-history-row.status-completed td,
.portal-history-table tr.portal-history-row.status-complete td,
.portal-history-table tr.portal-history-row.status-success td {
  background: #f0fdf4;
}

.portal-history-table tr.portal-history-row.status-pending td,
.portal-history-table tr.portal-history-row.status-pendiente td,
.portal-history-table tr.portal-history-row.status-processing td,
.portal-history-table tr.portal-history-row.status-inprogress td,
.portal-history-table tr.portal-history-row.status-revisando td {
  background: #fff7ed;
}

.portal-history-table tr.portal-history-row.status-tiene_caida td,
.portal-history-table tr.portal-history-row.status-cayo td,
.portal-history-table tr.portal-history-row.status-error_api td,
.portal-history-table tr.portal-history-row.status-error_panel td,
.portal-history-table tr.portal-history-row.status-error_temporal td,
.portal-history-table tr.portal-history-row.status-error_configuracion td,
.portal-history-table tr.portal-history-row.status-error td {
  background: #fef2f2;
}

.portal-history-table tr.portal-history-row.status-sin_caida td,
.portal-history-table tr.portal-history-row.status-no_cayo td,
.portal-history-table tr.portal-history-row.status-subio td {
  background: #ecfdf5;
}

.portal-history-table tr.portal-history-row.status-servicio_no_detectado td,
.portal-history-table tr.portal-history-row.status-unknown td,
.portal-history-table tr.portal-history-row.status-metrica_no_disponible td,
.portal-history-table tr.portal-history-row.status-link_roto td {
  background: #f8fafc;
}

.portal-history-table .portal-provider-cell,
.portal-history-table .portal-date-cell,
.portal-history-table .portal-number-cell,
.portal-history-table .portal-status-cell {
  vertical-align: top;
}

.portal-history-table .portal-service-cell,
.portal-history-table .portal-link-cell {
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.portal-history-table .portal-provider-cell {
  min-width: 140px;
}

.portal-history-table .portal-date-cell {
  min-width: 110px;
}

.portal-history-table .portal-number-cell {
  min-width: 78px;
  white-space: nowrap;
}

.portal-history-table .portal-status-cell {
  min-width: 110px;
}

.portal-history-table .portal-link-cell {
  min-width: 220px;
}

.portal-history-table .portal-guarantee-state {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  color: #0f766e;
}

.portal-history-table .portal-inline-action {
  display: inline-flex;
  margin-top: 2px;
  min-width: 180px;
  text-decoration: none;
}

.portal-history-error-row td,
.portal-history-link-row td {
  background: transparent !important;
  border-bottom: none;
  padding-top: 4px;
  padding-bottom: 12px;
}

.portal-history-error-row .portal-result-error {
  margin-top: 0;
}

.portal-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.portal-order-cards {
  display: grid;
  gap: 14px;
}

.portal-card-head {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}

.portal-result-error {
  border-left: 4px solid #dc2626;
  padding: 10px 12px;
  background: #fef2f2;
  color: #991b1b;
  border-radius: 10px;
}

.portal-order-actions {
  justify-content: flex-end;
}

.portal-order-actions .primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  text-decoration: none;
}

.portal-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}

.portal-table th,
.portal-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.portal-table td.portal-service-cell {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
  min-width: 320px;
}

.portal-table th:nth-child(1),
.portal-table td:nth-child(1) {
  min-width: 125px;
}

.portal-table th:nth-child(2),
.portal-table td:nth-child(2) {
  min-width: 130px;
}

.portal-table th:nth-child(3),
.portal-table td:nth-child(3) {
  min-width: 280px;
}

.portal-table th:nth-child(4),
.portal-table td:nth-child(4),
.portal-table th:nth-child(5),
.portal-table td:nth-child(5),
.portal-table th:nth-child(6),
.portal-table td:nth-child(6),
.portal-table th:nth-child(8),
.portal-table td:nth-child(8),
.portal-table th:nth-child(9),
.portal-table td:nth-child(9) {
  min-width: 100px;
}

.portal-table td.portal-link-cell {
  white-space: normal;
  word-break: break-all;
  overflow-wrap: anywhere;
  min-width: 260px;
}

.portal-table td.portal-link-cell a {
  white-space: normal;
  word-break: break-all;
  overflow-wrap: anywhere;
}

.portal-table .nowrap {
  white-space: nowrap;
}

.portal-table th {
  background: #f8fafc;
}

.table-scroll.compact {
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.portal-page .history-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.04);
}

.provider-form {
  min-width: 0;
}

.provider-form input[type="url"],
.provider-form input[type="text"],
.provider-form input[type="password"] {
  width: 100%;
}

.portal-form {
  display: grid;
  gap: 12px;
}

.portal-form .field {
  display: grid;
  gap: 6px;
}

.portal-form .field span {
  font-weight: 600;
  font-size: 14px;
}

.portal-form .field input {
  width: 100%;
}

.portal-result {
  display: grid;
  gap: 14px;
}

.portal-result.empty {
  min-height: 120px;
  place-items: center;
  text-align: center;
}

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

.portal-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: #e5e7eb;
  color: #374151;
}

.portal-chip.ok {
  background: #dcfce7;
  color: #166534;
}

.portal-chip.warn {
  background: #fef3c7;
  color: #92400e;
}

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

.portal-item {
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 4px;
}

.portal-item span,
.portal-link span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}

.portal-item strong {
  font-size: 15px;
  word-break: break-word;
}

.portal-link {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.portal-link a {
  color: #0f766e;
  word-break: break-all;
}

.portal-raw {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  padding: 12px;
}

.portal-raw summary {
  cursor: pointer;
  font-weight: 700;
  color: #374151;
}

.portal-raw pre {
  margin: 12px 0 0;
  padding: 12px;
  overflow: auto;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.45;
}

.portal-page .container {
  max-width: 1320px;
}

.portal-page .panel {
  border-radius: 18px;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.05);
}

.portal-page .topbar {
  margin-bottom: 18px;
  padding: 8px 2px 0;
}

.portal-page .portal-search-hero {
  display: grid;
  gap: 16px;
  max-width: 1080px;
  margin: 0 auto 12px;
  padding: 22px;
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.94), rgba(248,250,252,0.98)),
    linear-gradient(135deg, rgba(15,118,110,0.04), rgba(2,132,199,0.03));
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
}

.portal-page .portal-search-head h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.portal-page .portal-search-head .admin-note {
  margin-top: 6px;
  font-size: 14px;
}

.portal-page .portal-search-card {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px 16px;
  align-items: end;
}

.portal-page .portal-search-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(320px, 2.2fr) minmax(220px, 1fr) minmax(190px, 0.9fr);
  gap: 12px;
  align-items: end;
}

.portal-page .portal-search-card .field {
  grid-column: span 4;
}

.portal-page .portal-search-card .portal-query-field {
  grid-column: auto;
}

.portal-page .portal-search-card .portal-query-main input {
  min-height: 56px;
  font-size: 16px;
}

.portal-page .portal-search-card .actions {
  grid-column: 1 / -1;
  justify-content: center;
  margin-top: 4px;
}

.portal-page .portal-search-card .primary-action {
  min-width: 180px;
  padding: 13px 20px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
}

.portal-page .portal-search-card .secondary {
  padding: 13px 18px;
  border-radius: 12px;
}

.portal-page .portal-search-card .field span {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.portal-page .portal-search-card .field input,
.portal-page .portal-search-card .field select {
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 15px;
}

.portal-page .portal-search-card .field input:focus,
.portal-page .portal-search-card .field select:focus {
  outline: 2px solid rgba(15, 118, 110, 0.14);
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.08);
}

.portal-page .portal-search-card .portal-hint,
.portal-page .portal-search-card .auth-error {
  text-align: center;
  grid-column: 1 / -1;
}

.portal-page .portal-search-card .portal-hint {
  margin: 4px auto 0;
  max-width: 860px;
  font-size: 14px;
  line-height: 1.45;
}

.portal-page .portal-status-filters,
.portal-page .portal-results-head,
.portal-page .portal-results {
  max-width: 1320px;
  margin-left: auto;
  margin-right: auto;
}

.portal-page .portal-results-head {
  margin-top: 14px;
  margin-bottom: 10px;
  padding: 0 4px;
}

.portal-page .table-scroll.compact {
  border-radius: 16px;
}

.portal-page .portal-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.portal-page .portal-table th,
.portal-page .portal-table td {
  padding: 10px 12px;
}

.portal-page .portal-table td.portal-link-cell {
  width: 24%;
}

.portal-page .portal-table td.portal-service-cell {
  width: 28%;
}

.portal-page .portal-history-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}

.portal-page .portal-history-table th:nth-child(1),
.portal-page .portal-history-table td:nth-child(1) { width: 12%; }
.portal-page .portal-history-table th:nth-child(2),
.portal-page .portal-history-table td:nth-child(2) { width: 10%; }
.portal-page .portal-history-table th:nth-child(3),
.portal-page .portal-history-table td:nth-child(3) { width: 11%; }
.portal-page .portal-history-table th:nth-child(4),
.portal-page .portal-history-table td:nth-child(4) { width: 18%; }
.portal-page .portal-history-table th:nth-child(5),
.portal-page .portal-history-table td:nth-child(5) { width: 8%; }
.portal-page .portal-history-table th:nth-child(6),
.portal-page .portal-history-table td:nth-child(6) { width: 8%; }
.portal-page .portal-history-table th:nth-child(7),
.portal-page .portal-history-table td:nth-child(7) { width: 25%; }
.portal-page .portal-history-table th:nth-child(8),
.portal-page .portal-history-table td:nth-child(8) { width: 10%; }
.portal-page .portal-history-table th:nth-child(9),
.portal-page .portal-history-table td:nth-child(9) { width: 6%; }

.portal-page .portal-history-table .portal-link-cell {
  min-width: 0;
}

.portal-page .portal-history-table .portal-service-cell {
  min-width: 0;
}

.portal-page .portal-history-table .portal-provider-cell,
.portal-page .portal-history-table .portal-date-cell,
.portal-page .portal-history-table .portal-number-cell,
.portal-page .portal-history-table .portal-status-cell {
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal-page .admin-badge {
  box-shadow: 0 8px 24px rgba(15, 118, 110, 0.10);
}

@media (max-width: 768px) { table { min-width: 1600px; } }

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .session-chip {
    width: 100%;
  }

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

  .portal-provider-layout {
    grid-template-columns: 1fr;
  }

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

  .portal-page .portal-search-card {
    grid-template-columns: 1fr;
  }

  .portal-page .portal-search-row {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .portal-page .portal-search-card .field,
  .portal-page .portal-search-card .portal-query-field,
  .portal-page .portal-search-card .actions,
  .portal-page .portal-search-card .portal-hint,
  .portal-page .portal-search-card .auth-error {
    grid-column: 1 / -1;
  }
}


