:root {
  --portal-bg: #f4f2ee;
  --portal-card: #ffffff;
  --portal-blue: #3076d3;
  --portal-green: #188a55;
  --portal-amber: #e08a18;
  --portal-pink: #fce8ea;
}

.portal-body {
  min-height: 100vh;
  background: var(--portal-bg);
}

.hidden {
  display: none !important;
}

.portal-container {
  width: min(1220px, calc(100% - 40px));
  margin-inline: auto;
}

.portal-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 78px;
  background: rgba(255, 255, 255, 0.91);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.portal-nav {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
}

.portal-nav-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.portal-nav-actions a:hover {
  color: var(--red);
}

.portal-help {
  padding: 11px 17px;
  color: var(--white) !important;
  border-radius: 999px;
  background: var(--green);
}

.auth-view {
  position: relative;
  min-height: calc(100vh - 78px);
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.87)),
    repeating-linear-gradient(90deg, transparent 0, transparent 79px, rgba(27, 27, 27, 0.03) 80px),
    var(--paper);
}

.auth-view::before,
.auth-view::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.auth-view::before {
  width: 540px;
  height: 540px;
  right: -260px;
  top: -280px;
  border: 105px solid rgba(181, 18, 27, 0.06);
}

.auth-view::after {
  width: 360px;
  height: 360px;
  left: -180px;
  bottom: -210px;
  background: rgba(255, 122, 26, 0.06);
}

.auth-layout {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 78px);
  display: grid;
  grid-template-columns: 1fr minmax(410px, 0.72fr);
  align-items: center;
  gap: clamp(60px, 9vw, 125px);
  padding-block: 70px;
}

.portal-kicker {
  color: var(--red);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.15em;
}

.auth-intro h1 {
  max-width: 650px;
  margin: 18px 0 22px;
  font-size: clamp(48px, 5.5vw, 76px);
  line-height: 0.99;
  letter-spacing: -0.065em;
}

.auth-intro > p {
  max-width: 570px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.auth-benefits {
  display: grid;
  gap: 17px;
  max-width: 550px;
  margin-top: 35px;
}

.auth-benefits > div {
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 14px;
}

.auth-benefits > div > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--red);
  border: 1px solid #e5bfc1;
  border-radius: 50%;
  background: var(--white);
  font-size: 9px;
  font-weight: 950;
}

.auth-benefits p,
.auth-benefits strong,
.auth-benefits small {
  display: block;
  margin: 0;
}

.auth-benefits strong {
  margin-bottom: 4px;
  font-size: 13px;
}

.auth-benefits small {
  color: var(--muted);
  font-size: 11px;
}

.auth-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 25px;
  background: var(--white);
  box-shadow: 0 28px 65px rgba(26, 17, 17, 0.14);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  background: #f8f7f4;
}

.auth-tab {
  min-height: 47px;
  color: var(--muted);
  border: 0;
  border-radius: 13px;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.auth-tab.active {
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 5px 15px rgba(25, 25, 25, 0.07);
}

.auth-form {
  display: none;
  gap: 16px;
  padding: 31px;
}

.auth-form.active {
  display: grid;
}

.form-title h2 {
  margin-bottom: 6px;
  font-size: 25px;
  letter-spacing: -0.045em;
}

.form-title p {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
}

.auth-form label,
.portal-data-form label {
  display: grid;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 850;
}

.auth-form input,
.auth-form select,
.portal-data-form input,
.portal-data-form select,
.portal-data-form textarea {
  width: 100%;
  border: 1px solid #d7d4cf;
  border-radius: 11px;
  background: #fbfaf8;
  color: var(--ink);
  outline: none;
  transition: border 180ms ease, box-shadow 180ms ease;
}

.auth-form input,
.auth-form select,
.portal-data-form input,
.portal-data-form select {
  height: 48px;
  padding: 0 13px;
}

.portal-data-form textarea {
  padding: 13px;
  resize: vertical;
}

.auth-form input:focus,
.auth-form select:focus,
.portal-data-form input:focus,
.portal-data-form select:focus,
.portal-data-form textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(181, 18, 27, 0.09);
}

.portal-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.portal-check {
  grid-template-columns: 18px 1fr !important;
  align-items: start;
  gap: 10px !important;
  cursor: pointer;
  font-weight: 650 !important;
  line-height: 1.5;
}

.portal-check input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--red);
}

.portal-submit {
  width: 100%;
  border: 0;
}

.reset-link {
  justify-self: center;
  color: var(--red);
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

.auth-legal {
  margin: -4px 0 0;
  color: #89898e;
  font-size: 8px;
  line-height: 1.55;
  text-align: center;
}

.field-help {
  color: var(--muted);
  font-size: 8px;
  font-weight: 650;
  line-height: 1.45;
}

.verification-notice {
  padding: 11px 13px;
  border: 1px solid #efd58d;
  border-radius: 10px;
  background: #fff8df;
  color: #785900;
  font-size: 9px;
  font-weight: 750;
  line-height: 1.5;
}

.verification-notice.verified {
  border-color: #9cd8ba;
  background: #ebf9f1;
  color: #146b40;
}

.verification-notice.rejected {
  border-color: #efb4b8;
  background: #fff0f1;
  color: var(--red);
}

.portal-status {
  display: none;
  padding: 11px 13px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
}

.portal-status.show {
  display: block;
  color: #146b40;
  background: #e7f8ef;
}

.portal-status.error {
  color: #9d141d;
  background: #fce9ea;
}

.dashboard-view {
  min-height: calc(100vh - 78px);
}

.dashboard-shell {
  display: grid;
  grid-template-columns: 235px 1fr;
  gap: 38px;
  padding-block: 34px 75px;
}

.dashboard-sidebar {
  position: sticky;
  top: 112px;
  height: calc(100vh - 145px);
  min-height: 520px;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 5px 7px 20px;
  border-bottom: 1px solid var(--line);
}

.profile-avatar {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--white);
  border-radius: 14px;
  background: linear-gradient(135deg, var(--red), #db2630);
  font-size: 11px;
  font-weight: 950;
}

.sidebar-profile p,
.sidebar-profile strong,
.sidebar-profile small {
  display: block;
  min-width: 0;
  margin: 0;
}

.sidebar-profile strong {
  max-width: 135px;
  overflow: hidden;
  margin-bottom: 4px;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-profile small {
  color: var(--muted);
  font-size: 9px;
}

.dashboard-nav {
  display: grid;
  gap: 5px;
  margin-top: 18px;
}

.dashboard-nav button {
  min-height: 46px;
  display: grid;
  grid-template-columns: 27px 1fr;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  color: var(--muted);
  border: 0;
  border-radius: 11px;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
  text-align: left;
}

.dashboard-nav button > span {
  font-size: 15px;
  text-align: center;
}

.dashboard-nav button:hover,
.dashboard-nav button.active {
  color: var(--red);
  background: var(--red-soft);
}

.logout-button {
  min-height: 42px;
  margin-top: auto;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--white);
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

.dashboard-content {
  min-width: 0;
}

.dashboard-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 25px;
  margin-bottom: 29px;
}

.dashboard-topbar h1 {
  margin: 7px 0 0;
  font-size: 37px;
  line-height: 1;
  letter-spacing: -0.055em;
}

.dashboard-panel {
  display: none;
}

.dashboard-panel.active {
  display: block;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 15px;
  margin-bottom: 34px;
}

.payment-summary {
  margin-bottom: 20px;
  padding: 22px;
}

.payment-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.payment-summary-head span,
.payment-summary-total span {
  display: block;
  color: var(--muted);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.payment-summary-head h3 {
  margin: 5px 0 0;
  font-size: 20px;
}

.payment-summary-total {
  text-align: right;
}

.payment-summary-total strong {
  display: block;
  margin-top: 5px;
  color: var(--red);
  font-size: 26px;
}

.payment-summary-actions {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.payment-summary-actions button,
.client-row > button,
.client-actions button {
  min-height: 34px;
  padding: 0 13px;
  color: var(--white);
  border: 0;
  border-radius: 9px;
  background: var(--red);
  cursor: pointer;
  font-size: 8px;
  font-weight: 850;
}

.payment-summary-actions button:disabled,
.client-row > button:disabled,
.client-actions button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.client-actions {
  display: grid;
  gap: 6px;
}

.payment-summary-lines {
  display: grid;
}

.payment-summary-line {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(130px, 0.8fr) auto;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.payment-summary-line:last-child {
  border-bottom: 0;
}

.payment-summary-line strong,
.payment-summary-line small {
  display: block;
}

.payment-summary-line strong {
  font-size: 10px;
}

.payment-summary-line small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
}

.payment-summary-line > strong:last-child {
  font-size: 12px;
  text-align: right;
}

.payment-summary-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 8px;
}

.calculated-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 14px 16px;
  border: 1px solid #edd1d3;
  border-radius: 12px;
  background: #fff7f7;
}

.calculated-total span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.calculated-total strong {
  color: var(--red);
  font-size: 17px;
}

.stats-grid article {
  min-height: 132px;
  display: flex;
  flex-direction: column;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--white);
}

.stats-grid article > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.stats-grid article strong {
  margin: 11px 0 5px;
  font-size: 34px;
  letter-spacing: -0.055em;
}

.stats-grid article small {
  margin-top: auto;
  color: var(--muted);
  font-size: 9px;
}

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

.dashboard-section-head span,
.admin-banner > span {
  color: var(--red);
  font-size: 8px;
  font-weight: 950;
  letter-spacing: 0.14em;
}

.dashboard-section-head h2,
.admin-banner h2 {
  margin: 6px 0 0;
  font-size: 24px;
  letter-spacing: -0.045em;
}

.dashboard-section-head button {
  color: var(--red);
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  font-weight: 850;
}

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

.shipments-grid.compact .shipment-card:nth-child(n + 3) {
  display: none;
}

.shipment-card {
  min-height: 285px;
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
}

.shipment-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.shipment-card-top small,
.shipment-card-top strong {
  display: block;
}

.shipment-card-top small {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.shipment-card-top strong {
  font-size: 13px;
}

.status-pill,
.request-pill {
  padding: 7px 9px;
  color: var(--portal-blue);
  border-radius: 999px;
  background: #eaf2fd;
  font-size: 8px;
  font-weight: 900;
  white-space: nowrap;
}

.shipment-card-held {
  border-color: #db9499;
  box-shadow: 0 15px 34px rgba(197, 16, 28, 0.12);
}

.status-pill-held {
  max-width: 170px;
  color: #92101a;
  background: #fde4e6;
  line-height: 1.3;
  text-align: center;
  white-space: normal;
}

.shipment-hold-alert {
  display: grid;
  gap: 5px;
  margin: -4px 0 18px;
  padding: 12px;
  color: #7e1119;
  border: 1px solid #efc0c3;
  border-radius: 11px;
  background: #fff1f2;
}

.shipment-hold-alert strong {
  font-size: 10px;
}

.shipment-hold-alert span {
  font-size: 9px;
  line-height: 1.5;
}

.shipment-card-held .shipment-progress span {
  background: #be1420;
}

.shipment-description {
  margin: 20px 0 17px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.45;
}

.shipment-progress {
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: #ebe9e5;
}

.shipment-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--orange));
}

.shipment-progress-label {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  color: var(--muted);
  font-size: 8px;
}

.shipment-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: auto;
  padding-top: 19px;
  border-top: 1px solid var(--line);
}

.shipment-meta span,
.shipment-meta strong {
  display: block;
}

.shipment-meta span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 8px;
}

.shipment-meta strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 42px 24px;
  color: var(--muted);
  border: 1px dashed #cfcac3;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.55);
  text-align: center;
}

.empty-state strong,
.empty-state span {
  display: block;
}

.empty-state strong {
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 13px;
}

.empty-state span {
  font-size: 10px;
}

.request-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  align-items: start;
  gap: 22px;
}

.portal-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
}

.portal-data-form {
  display: grid;
  gap: 17px;
  padding: 25px;
}

.portal-data-form h3,
.admin-requests-card h3 {
  margin: 0 0 3px;
  font-size: 18px;
  letter-spacing: -0.035em;
}

.portal-data-form label > small {
  color: var(--muted);
  font-weight: 600;
}

.portal-data-form > .button {
  width: max-content;
  min-width: 170px;
  border: 0;
}

.side-title {
  margin: 3px 0 13px;
  font-size: 15px;
}

.requests-list,
.admin-requests {
  display: grid;
  gap: 10px;
}

.request-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--white);
}

.request-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.request-item strong,
.request-item small {
  display: block;
}

.request-item strong {
  margin-bottom: 4px;
  font-size: 11px;
}

.request-item small,
.request-item p {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.request-item p {
  margin: 12px 0 0;
}

.request-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.request-item-actions button,
.request-item-actions a {
  padding: 7px 9px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #faf9f7;
  cursor: pointer;
  font-size: 8px;
  font-weight: 800;
}

.usa-addresses {
  margin: 30px 0 34px;
}

.address-heading {
  align-items: flex-end;
}

.address-heading > small {
  max-width: 280px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  line-height: 1.5;
  text-align: right;
}

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

.address-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
  box-shadow: 0 13px 30px rgba(28, 24, 25, 0.06);
}

.address-card header {
  min-height: 142px;
  padding: 22px;
}

.address-card header > span {
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.address-card header h3 {
  margin: 8px 0 14px;
  font-size: 19px;
  line-height: 1.18;
}

.address-card-newark header {
  color: var(--white);
  background: linear-gradient(135deg, #19191b, #343438);
}

.address-card-newark header > span {
  color: #ff8b92;
}

.address-card-hialeah header {
  color: #5d0c12;
  background: linear-gradient(135deg, #fde8e9, #fff4f4);
}

.address-card-hialeah header > span {
  color: var(--red);
}

.address-rates {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.address-rates strong {
  padding: 7px 9px;
  border-radius: 999px;
  color: inherit;
  background: rgba(255, 255, 255, 0.13);
  font-size: 9px;
}

.address-card-hialeah .address-rates strong {
  background: rgba(181, 18, 27, 0.09);
}

.address-fields {
  padding: 8px 20px 0;
}

.address-field {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid #ece9e5;
}

.address-field > span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
  text-transform: uppercase;
}

.address-field > strong {
  overflow-wrap: anywhere;
  font-size: 10px;
  line-height: 1.35;
}

.address-field button {
  padding: 6px 8px;
  color: var(--red);
  border: 1px solid #e8c4c7;
  border-radius: 8px;
  background: #fff7f7;
  cursor: pointer;
  font-size: 8px;
  font-weight: 800;
}

.address-warning {
  min-height: 52px;
  margin: 14px 20px;
  padding: 11px 12px;
  color: #7c4b13;
  border-radius: 10px;
  background: #fff5dc;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.5;
}

.address-copy-main {
  width: calc(100% - 40px);
  min-height: 44px;
  margin: 0 20px 20px;
  color: var(--white);
  background: var(--ink);
  box-shadow: none;
}

.profile-form {
  max-width: 760px;
}

.account-danger {
  width: min(760px, 100%);
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-color: #edc7ca;
  background: #fff8f8;
}

.account-danger span,
.dialog-kicker {
  color: var(--red);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.account-danger h3 {
  margin: 6px 0;
}

.account-danger p,
.delete-account-form > p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.button-danger-outline {
  flex: 0 0 auto;
  min-height: 44px;
  color: var(--red);
  border-color: #dcaeb2;
  background: var(--white);
  box-shadow: none;
}

.button-danger {
  min-height: 44px;
  color: var(--white);
  background: #a90f18;
  box-shadow: 0 10px 22px rgba(169, 15, 24, 0.2);
}

.delete-dialog {
  width: min(520px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: var(--white);
  box-shadow: 0 28px 80px rgba(21, 17, 18, 0.3);
}

.delete-dialog::backdrop {
  background: rgba(20, 17, 18, 0.62);
  backdrop-filter: blur(4px);
}

.delete-account-form {
  padding: 28px;
}

.delete-account-form h2 {
  margin: 7px 0 8px;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 10px;
}

.profile-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-radius: 12px;
  background: var(--red-soft);
}

.profile-code span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.profile-code strong {
  color: var(--red);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.admin-banner {
  margin-bottom: 22px;
  padding: 24px;
  color: var(--white);
  border-radius: 18px;
  background: linear-gradient(135deg, #171719, #2d2d31);
}

.admin-banner > span {
  color: #ff777f;
}

.admin-banner p {
  margin: 8px 0 0;
  color: #aaaab0;
  font-size: 10px;
}

.admin-stats article:first-child strong {
  color: var(--portal-blue);
}

.admin-stats article:nth-child(2) strong {
  color: var(--portal-green);
}

.admin-stats article:nth-child(3) strong {
  color: var(--portal-amber);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.75fr);
  align-items: start;
  gap: 18px;
}

.admin-requests-card {
  padding: 25px;
}

.admin-requests-card h3 {
  margin-bottom: 17px;
}

.admin-alerts-heading,
.admin-alert-bulk,
.admin-alert-title,
.admin-alert-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-alerts-heading {
  justify-content: space-between;
  margin-bottom: 14px;
}

.admin-alerts-heading span {
  color: var(--portal-red);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.admin-alerts-heading h3 {
  margin: 3px 0 0;
}

.admin-alerts-heading label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.admin-alerts-heading select,
.admin-alert-bulk select,
.admin-alert-actions select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
  padding: 7px 9px;
  color: var(--ink);
  font: inherit;
}

.admin-alert-bulk {
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 11px;
  background: var(--paper);
}

.admin-alert-bulk .portal-check {
  margin-right: auto;
}

.admin-alert-bulk button,
.admin-alert-actions button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
  padding: 7px 10px;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.admin-alert-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.admin-alert-row:last-child {
  border-bottom: 0;
}

.admin-alert-row.is-archived {
  opacity: 0.72;
}

.admin-alert-title {
  justify-content: space-between;
}

.admin-alert-title strong {
  font-size: 11px;
}

.admin-alert-title span {
  border-radius: 999px;
  background: var(--portal-pink);
  padding: 5px 8px;
  color: var(--portal-red);
  font-size: 8px;
  font-weight: 900;
}

.admin-alert-main small,
.admin-alert-main p,
.admin-alert-meta {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.admin-alert-main p {
  margin: 7px 0;
  color: var(--ink);
}

.admin-alert-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px 10px;
}

.admin-alert-actions {
  grid-column: 2;
  flex-wrap: wrap;
}

.admin-alert-actions select {
  flex: 1 1 180px;
}

.admin-alert-actions .danger-link {
  color: var(--portal-red);
}

.admin-table-card {
  margin-top: 18px;
  padding: 24px;
}

.admin-row,
.client-row {
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.admin-row {
  grid-template-columns: 1.2fr 1fr 1fr 160px;
}

.client-row {
  grid-template-columns: 1.1fr 1fr 0.8fr 0.7fr 150px;
}

.admin-row:last-child,
.client-row:last-child {
  border-bottom: 0;
}

.admin-row p,
.client-row p,
.admin-row strong,
.client-row strong,
.admin-row small,
.client-row small {
  display: block;
  min-width: 0;
  margin: 0;
}

.admin-row strong,
.client-row strong {
  overflow: hidden;
  margin-bottom: 4px;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-row small.admin-status-date {
  overflow: visible;
  margin-top: 3px;
  color: #4f494c;
  font-size: 9px;
  line-height: 1.35;
  text-overflow: clip;
  white-space: normal;
}

.admin-row small,
.client-row small {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-row select {
  width: 100%;
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #faf9f7;
  font-size: 8px;
  font-weight: 750;
}

.admin-row-actions {
  display: grid;
  gap: 7px;
}

.admin-row-actions button {
  min-height: 34px;
  color: var(--red);
  border: 1px solid #e2b5b8;
  border-radius: 9px;
  background: #fff7f7;
  cursor: pointer;
  font-size: 8px;
  font-weight: 800;
}

.admin-row-actions button:hover {
  background: var(--red-soft);
}

.shipment-edit-dialog {
  width: min(610px, calc(100% - 32px));
}

.shipment-edit-dialog h2 {
  margin: 7px 0 0;
}

.shipment-delete-button {
  width: 100%;
  margin-top: 2px;
}

.global-status {
  position: fixed;
  z-index: 200;
  right: 22px;
  bottom: 22px;
  max-width: 360px;
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.15);
}

@media (max-width: 980px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-intro {
    max-width: 720px;
  }

  .auth-card {
    max-width: 620px;
  }

  .dashboard-shell {
    grid-template-columns: 1fr;
  }

  .dashboard-sidebar {
    position: static;
    height: auto;
    min-height: 0;
  }

  .dashboard-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .dashboard-nav button {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 9px 5px;
    text-align: center;
  }

  .logout-button {
    margin-top: 15px;
  }

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

@media (max-width: 680px) {
  .portal-container {
    width: min(calc(100% - 24px), 1220px);
  }

  .portal-header {
    height: 68px;
  }

  .portal-nav .brand span,
  .portal-nav .brand small {
    display: none;
  }

  .portal-nav-actions > a:first-child {
    display: none;
  }

  .auth-layout {
    min-height: calc(100vh - 68px);
    gap: 42px;
    padding-block: 52px;
  }

  .auth-intro h1 {
    font-size: 45px;
  }

  .auth-intro > p {
    font-size: 15px;
  }

  .auth-benefits {
    display: none;
  }

  .auth-form {
    padding: 24px 20px;
  }

  .portal-form-row,
  .stats-grid,
  .shipments-grid {
    grid-template-columns: 1fr;
  }

  .payment-summary-head {
    align-items: stretch;
    flex-direction: column;
  }

  .payment-summary-total {
    text-align: left;
  }

  .payment-summary-actions {
    justify-items: start;
  }

  .payment-summary-line {
    grid-template-columns: 1fr auto;
  }

  .payment-summary-line > span:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .address-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .address-heading > small {
    max-width: none;
    text-align: left;
  }

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

  .address-field {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .address-field > span {
    grid-column: 1 / -1;
  }

  .account-danger {
    align-items: flex-start;
    flex-direction: column;
  }

  .account-danger .button,
  .dialog-actions .button {
    width: 100%;
  }

  .delete-account-form {
    padding: 23px;
  }

  .dialog-actions {
    grid-template-columns: 1fr;
  }

  .dashboard-shell {
    gap: 22px;
    padding-block: 18px 55px;
  }

  .dashboard-sidebar {
    padding: 12px;
  }

  .sidebar-profile {
    display: none;
  }

  .dashboard-nav {
    grid-template-columns: repeat(4, 1fr);
    margin-top: 0;
    overflow-x: auto;
  }

  .dashboard-nav button {
    min-width: 72px;
    font-size: 8px;
  }

  .dashboard-nav .admin-nav:not(.hidden) {
    grid-column: 1 / -1;
  }

  .logout-button {
    min-height: 36px;
  }

  .dashboard-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-topbar .button {
    width: 100%;
  }

  .dashboard-topbar h1 {
    font-size: 31px;
  }

  .shipment-card {
    min-height: 305px;
  }

  .portal-data-form {
    padding: 20px;
  }

  .portal-data-form > .button {
    width: 100%;
  }

  .admin-row,
  .client-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .reviews-summary {
    flex-direction: column;
  }
}
.form-help-banner {
  margin: 0 0 4px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff5df;
  color: #714600;
  font-weight: 700;
}

.request-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 14px;
  margin: 10px 0;
  color: #5e5a5a;
  font-size: 0.78rem;
}

@media (max-width: 620px) {
  .request-details { grid-template-columns: 1fr; }
  .admin-alerts-heading { align-items: stretch; flex-direction: column; }
  .admin-alert-meta { grid-template-columns: 1fr; }
  .admin-alert-actions { align-items: stretch; flex-direction: column; }
  .admin-alert-actions select,
  .admin-alert-actions button,
  .admin-alert-bulk select,
  .admin-alert-bulk button { width: 100%; }
}

/* Operación v3: paneles separados, búsqueda y lectura móvil */
.admin-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-stats article { cursor: pointer; transition: transform 160ms ease, box-shadow 160ms ease; }
.admin-stats article:hover { transform: translateY(-2px); box-shadow: 0 12px 25px rgba(34,25,26,.08); }
.admin-commandbar { position: sticky; top: 12px; z-index: 8; display: grid; gap: 14px; margin: 24px 0; padding: 16px; border: 1px solid #e5dfdc; border-radius: 18px; background: rgba(255,255,255,.96); box-shadow: 0 12px 30px rgba(30,24,25,.08); }
.admin-tabs { display: flex; gap: 8px; overflow-x: auto; }
.admin-tabs button { min-width: max-content; padding: 10px 16px; border: 1px solid #ddd5d2; border-radius: 999px; color: #39353a; background: #fff; cursor: pointer; font-weight: 800; }
.admin-tabs button.active { color: #fff; border-color: #b5121b; background: #b5121b; }
.admin-global-search { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.admin-global-search input { min-height: 48px; padding: 0 16px; border: 1px solid #d9d5d3; border-radius: 12px; }
.admin-global-search button { padding: 0 18px; border: 0; border-radius: 12px; color: #fff; background: #222126; cursor: pointer; font-weight: 800; }
.admin-section { display: none; }
.admin-section.active { display: block; }
.admin-section[data-admin-section-panel="create"] > form { max-width: 760px; margin: 0 auto; }
.admin-inline-filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.admin-inline-filters select { min-height: 42px; padding: 0 10px; border: 1px solid #ddd7d4; border-radius: 10px; background: #fff; }
.admin-row-held { border-left: 4px solid #ed9c1b; background: #fffaf1; }
.admin-row-actions a { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 12px; border-radius: 8px; color: #b5121b; background: #fff0f1; font-size: 12px; font-weight: 850; }
.admin-groups-card { display: grid; gap: 18px; }
.group-create-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; padding: 14px; border: 1px solid #e5dfdc; border-radius: 14px; background: #faf8f7; }
.group-create-form label, .group-search-label { display: grid; gap: 7px; color: #262329; font-size: 12px; font-weight: 800; }
.group-create-form input, .group-search-label input { width: 100%; min-height: 44px; padding: 0 13px; border: 1px solid #d9d2cf; border-radius: 10px; background: #fff; }
.group-create-form button, .group-bulk-actions button { min-height: 44px; padding: 0 18px; border: 0; border-radius: 10px; color: #fff; background: #b5121b; cursor: pointer; font-weight: 850; }
.group-create-form button:disabled, .group-bulk-actions button:disabled { opacity: .55; cursor: wait; }
.groups-layout { display: grid; grid-template-columns: minmax(210px, .75fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.groups-list { display: grid; gap: 8px; }
.group-list-item { display: grid; gap: 4px; width: 100%; padding: 14px; border: 1px solid #e1dbd8; border-radius: 12px; text-align: left; background: #fff; cursor: pointer; }
.group-list-item strong { color: #262329; }
.group-list-item small { color: #716b6e; }
.group-list-item.active { border-color: #b5121b; background: #fff0f1; box-shadow: inset 3px 0 #b5121b; }
.group-detail { min-width: 0; display: grid; gap: 14px; }
.group-detail-head span { color: #b5121b; font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.group-detail-head h3 { margin: 5px 0 3px; }
.group-detail-head p { margin: 0; color: #716b6e; font-size: 13px; }
.group-bulk-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.group-bulk-actions select { min-height: 44px; padding: 0 11px; border: 1px solid #d9d2cf; border-radius: 10px; background: #fff; }
.group-search-results { display: grid; gap: 6px; padding: 10px; border: 1px solid #e5dfdc; border-radius: 12px; background: #faf8f7; }
.group-search-results > small { padding: 5px; color: #716b6e; }
.group-search-results button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 10px 12px; border: 1px solid #e1dbd8; border-radius: 10px; text-align: left; background: #fff; cursor: pointer; }
.group-search-results button span { display: grid; min-width: 0; gap: 3px; }
.group-search-results button strong, .group-search-results button small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-search-results button small { color: #716b6e; }
.group-search-results button b { color: #b5121b; font-size: 12px; }
.shipment-secondary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 18px; margin-top: 15px; color: #67636a; font-size: 12px; }
.shipment-client-note { margin: 14px 0 0; padding: 12px; border-radius: 10px; color: #4b3436; background: #fff4f4; font-size: 13px; }
.shipment-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.shipment-actions button, .shipment-actions a { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 0 13px; border: 1px solid #d9d2cf; border-radius: 9px; color: #303036; background: #fff; cursor: pointer; font-size: 12px; font-weight: 800; }
.shipment-card-held .shipment-actions button:first-child { color: #fff; border-color: #b5121b; background: #b5121b; }

.profile-incomplete { color: #a56608 !important; font-weight: 800; }
.profile-complete { color: #23754c !important; font-weight: 800; }
.client-detail-dialog { width: min(820px, calc(100% - 28px)); }
.client-profile-alert { display: grid; gap: 3px; padding: 11px 13px; border-radius: 10px; font-size: 12px; }
.client-profile-alert.incomplete { color: #815305; border: 1px solid #efd59d; background: #fff8e8; }
.client-profile-alert.complete { color: #286d4b; border: 1px solid #bfe0cc; background: #effaf4; }
.client-copy-preview { padding: 13px; border: 1px dashed #cec5c1; border-radius: 10px; color: #5c5759; background: #faf8f7; white-space: pre-line; font-size: 12px; line-height: 1.55; }

.admin-arrivals-card { display: grid; gap: 18px; }
.arrival-create-form { display: grid; gap: 13px; padding: 16px; border: 1px solid #e6dfdc; border-radius: 14px; background: #faf8f7; }
.arrival-create-form fieldset { margin: 0; padding: 12px; border: 1px solid #ddd4d0; border-radius: 11px; }
.arrival-create-form legend { padding: 0 7px; color: #5f595c; font-size: 11px; font-weight: 900; }
.arrival-group-options { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.arrival-group-option { display: flex; align-items: flex-start; gap: 8px; padding: 10px; border: 1px solid #e2dbd7; border-radius: 10px; background: #fff; cursor: pointer; }
.arrival-group-option input { margin-top: 3px; }
.arrival-group-option span { display: grid; gap: 3px; }
.arrival-group-option small { color: #777075; font-size: 10px; }
.arrival-group-option:has(input:disabled) { opacity: .58; cursor: not-allowed; }
.arrival-empty-note { margin: 0; color: #777075; font-size: 12px; }
.arrivals-layout { display: grid; grid-template-columns: minmax(190px, .7fr) minmax(0, 2fr); gap: 16px; }
.arrivals-list { display: grid; align-content: start; gap: 8px; }
.arrival-list-item { display: grid; gap: 4px; width: 100%; padding: 12px; border: 1px solid #e0d9d6; border-radius: 11px; text-align: left; background: #fff; cursor: pointer; }
.arrival-list-item span { color: #8a8386; font-size: 9px; font-weight: 900; letter-spacing: .09em; }
.arrival-list-item small { color: #777075; font-size: 10px; }
.arrival-list-item.active { color: #fff; border-color: #b5121b; background: #b5121b; }
.arrival-list-item.active span, .arrival-list-item.active small { color: #ffe6e7; }
.arrival-detail { min-width: 0; display: grid; gap: 12px; }
.arrival-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.arrival-detail-head span { color: #b5121b; font-size: 9px; font-weight: 900; letter-spacing: .1em; }
.arrival-detail-head h3 { margin: 4px 0; }
.arrival-detail-head p { margin: 0; color: #777075; font-size: 11px; }
.arrival-detail-head button, .arrival-client-row button, .arrival-account-actions button { min-height: 37px; padding: 0 12px; border: 1px solid #d8cfcb; border-radius: 9px; color: #29262a; background: #fff; cursor: pointer; font-size: 11px; font-weight: 900; }
.arrival-metrics { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.arrival-metrics article { display: grid; gap: 3px; padding: 11px; border: 1px solid #e6dfdc; border-radius: 10px; background: #fff; }
.arrival-metrics span { color: #817a7d; font-size: 9px; font-weight: 800; }
.arrival-metrics strong { font-size: 17px; }
.arrival-check { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 10px 12px; color: #286d4b; border: 1px solid #c4e2d0; border-radius: 9px; background: #effaf4; font-size: 11px; }
.arrival-client-list { display: grid; gap: 7px; }
.arrival-client-row { display: grid; grid-template-columns: minmax(125px,1.4fr) repeat(4,minmax(85px,1fr)) auto; align-items: center; gap: 9px; padding: 10px; border: 1px solid #e7e0dd; border-radius: 10px; }
.arrival-client-row p { display: grid; gap: 3px; margin: 0; min-width: 0; }
.arrival-client-row p span, .arrival-client-row small { color: #817a7d; font-size: 9px; }
.arrival-client-row p strong { overflow-wrap: anywhere; font-size: 11px; }
.amount-pending { color: #b5121b; }.amount-paid { color: #23754c; }
.arrival-account-dialog { width: min(780px, calc(100% - 24px)); padding: 0; overflow: hidden; }
.arrival-account-content { display: grid; }
.arrival-account-head { display: flex; justify-content: space-between; padding: 20px 22px 13px; }
.arrival-account-head span { color: #b5121b; font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.arrival-account-head h2 { margin: 5px 0; }.arrival-account-head p { margin: 0; color: #777075; font-size: 11px; }
.arrival-account-head button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: #f1edeb; font-size: 22px; cursor: pointer; }
.arrival-account-summary { display: flex; flex-wrap: wrap; gap: 9px 20px; padding: 12px 22px; border-block: 1px solid #e8e1de; background: #faf8f7; font-size: 11px; font-weight: 800; }
.arrival-account-paid-note { padding: 10px 22px; color: #286d4b; background: #effaf4; font-size: 11px; }
.arrival-account-lines { padding: 0 22px; max-height: 320px; overflow: auto; }
.arrival-account-line { display: grid; grid-template-columns: 1.7fr 1fr auto; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid #eee8e5; font-size: 11px; }
.arrival-account-line span { display: grid; gap: 3px; }.arrival-account-line small { color: #817a7d; font-size: 9px; }
.arrival-account-total { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; color: #fff; background: #242126; }
.arrival-account-total span { font-size: 10px; font-weight: 900; letter-spacing: .09em; }.arrival-account-total strong { font-size: 23px; }
.arrival-account-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 14px 22px 20px; }
.arrival-account-actions button.primary { color: #fff; border-color: #b5121b; background: #b5121b; }

.register-shortcut { width: 100%; min-height: 44px; border: 1px solid #b5121b; border-radius: 10px; color: #b5121b; background: #fff; cursor: pointer; font-weight: 900; }
.register-status { position: sticky; top: 6px; z-index: 2; margin-bottom: 4px; box-shadow: 0 5px 18px rgba(35,25,27,.08); }
.client-auto-summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 18px 0 28px; padding: 18px 20px; border-left: 5px solid #23754c; }
.client-auto-summary.warning { border-left-color: #c0790a; background: #fffaf0; }
.client-auto-summary.payment { border-left-color: #b5121b; background: #fff5f5; }
.client-auto-summary > div:first-child > span { color: #b5121b; font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.client-auto-summary h3 { margin: 5px 0; font-size: 18px; }
.client-auto-summary p { margin: 0; color: #706a6d; font-size: 12px; }
.client-latest { display: block; margin-top: 8px; color: #777075; font-size: 10px; }
.client-auto-metrics { display: flex; flex-wrap: wrap; gap: 8px; }
.client-auto-metrics span { display: grid; min-width: 78px; padding: 9px 11px; border: 1px solid #e5dfdc; border-radius: 9px; text-align: center; background: #fff; font-size: 10px; }
.client-auto-metrics strong { font-size: 17px; }

.admin-control-card, .trace-card { display: grid; gap: 16px; }
.control-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.control-summary article { display: grid; gap: 4px; padding: 13px; border: 1px solid #e5dfdc; border-radius: 11px; background: #faf8f7; }
.control-summary article.urgent { border-color: #efb8bc; background: #fff2f3; }
.control-summary article.ok { border-color: #bfe0cc; background: #effaf4; }
.control-summary span, .control-summary small { color: #777075; font-size: 10px; }
.control-summary strong { font-size: 18px; }
.control-list { display: grid; gap: 8px; }
.control-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 1px solid #e5dfdc; border-left: 4px solid #9a9497; border-radius: 10px; }
.control-item.urgent { border-left-color: #b5121b; }.control-item.warning { border-left-color: #c0790a; }.control-item.ok { border-left-color: #23754c; }
.control-item > div { display: flex; align-items: center; gap: 12px; }
.control-item > div > span { min-width: 34px; color: #b5121b; font-size: 22px; font-weight: 900; }
.control-item p { display: grid; gap: 3px; margin: 0; }
.control-item small { color: #777075; font-size: 10px; }
.control-item button { min-height: 36px; padding: 0 12px; border: 1px solid #d8cfcb; border-radius: 8px; background: #fff; cursor: pointer; font-weight: 850; }
.control-item button:disabled { opacity: .45; cursor: default; }

.trace-search-label { display: grid; gap: 7px; font-size: 12px; font-weight: 850; }
.trace-search-label input { min-height: 48px; padding: 0 15px; border: 1px solid #d9d2cf; border-radius: 11px; }
.trace-results { display: grid; gap: 8px; }
.trace-result { display: grid; grid-template-columns: 1.5fr 1fr; gap: 12px; width: 100%; padding: 13px 14px; border: 1px solid #e3dcda; border-radius: 10px; text-align: left; background: #fff; cursor: pointer; }
.trace-result span { display: grid; gap: 4px; min-width: 0; }
.trace-result span:last-child { text-align: right; }
.trace-result strong { overflow-wrap: anywhere; }
.trace-result small { color: #777075; font-size: 10px; }
.trace-dialog { width: min(900px,calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; overflow: auto; }
.trace-dialog-content { display: grid; }
.trace-dialog-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; gap: 15px; padding: 19px 22px; border-bottom: 1px solid #e7e0dd; background: #fff; }
.trace-dialog-head > div > span { color: #b5121b; font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.trace-dialog-head h2 { margin: 5px 0; overflow-wrap: anywhere; font-size: 21px; }
.trace-dialog-head p { margin: 0; color: #777075; font-size: 11px; }
.trace-dialog-head button { flex: 0 0 34px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #f1edeb; cursor: pointer; font-size: 22px; }
.trace-facts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; padding: 18px 22px; background: #faf8f7; }
.trace-facts article { display: grid; gap: 4px; padding: 11px; border: 1px solid #e5dfdc; border-radius: 9px; background: #fff; }
.trace-facts span { color: #777075; font-size: 9px; font-weight: 850; }.trace-facts strong { overflow-wrap: anywhere; font-size: 12px; }
.trace-notes { margin: 16px 22px 0; padding: 12px; border: 1px solid #eadfdb; border-radius: 9px; background: #fff8f5; }
.trace-notes p { margin: 4px 0 0; color: #605a5d; font-size: 11px; white-space: pre-line; }
.trace-timeline { padding: 18px 22px 24px; }.trace-timeline h3 { margin: 0 0 14px; }
.trace-event { display: grid; grid-template-columns: 130px 13px 1fr; gap: 10px; min-height: 58px; }
.trace-event time { color: #777075; font-size: 10px; text-align: right; }
.trace-event > span { position: relative; width: 10px; height: 10px; border: 2px solid #b5121b; border-radius: 50%; background: #fff; }
.trace-event > span::after { content: ""; position: absolute; top: 10px; bottom: -49px; left: 2px; width: 2px; background: #ead8d9; }
.trace-event:last-child > span::after { display: none; }
.trace-event p { display: grid; align-content: start; gap: 4px; margin: 0; }
.trace-event small { color: #777075; font-size: 10px; }
.trace-missing { color: #777075; }
.arrival-client-actions { display: grid; gap: 5px; }
.arrival-client-actions .deliver-direct { color: #fff; border-color: #23754c; background: #23754c; }

@media (max-width: 980px) {
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .admin-commandbar { position: static; padding: 12px; }
  .admin-global-search { grid-template-columns: 1fr; }
  .admin-global-search button { min-height: 44px; }
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-inline-filters { width: 100%; display: grid; grid-template-columns: 1fr; }
  .admin-inline-filters select { width: 100%; }
  .shipment-actions { display: grid; grid-template-columns: 1fr; }
  .shipment-actions button, .shipment-actions a { width: 100%; }
  .shipment-secondary { display: grid; }
  .group-create-form, .groups-layout, .group-bulk-actions { grid-template-columns: 1fr; }
  .arrival-group-options, .arrivals-layout, .arrival-metrics { grid-template-columns: 1fr; }
  .arrival-client-row { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .arrival-client-row > p:first-child, .arrival-client-actions { grid-column: 1 / -1; }
  .arrival-account-line { grid-template-columns: 1fr auto; }
  .arrival-account-line > span:nth-child(2) { grid-column: 1; }
  .group-create-form button, .group-bulk-actions button { width: 100%; }
  .client-auto-summary { align-items: stretch; flex-direction: column; }
  .client-auto-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
  .control-summary, .trace-facts { grid-template-columns: 1fr; }
  .control-item { align-items: stretch; flex-direction: column; }
  .control-item button { width: 100%; }
  .trace-result { grid-template-columns: 1fr; }
  .trace-result span:last-child { text-align: left; }
  .trace-event { grid-template-columns: 82px 13px 1fr; }
}

/* Operación v4: evita cortes horizontales en teléfonos angostos. */
.dashboard-shell > *,
.dashboard-content > *,
.admin-section,
.admin-table-card,
.admin-alert-main,
.shipment-card,
.request-item {
  min-width: 0;
  max-width: 100%;
}

.shipment-card-top strong,
.admin-alert-meta span,
.request-item p,
.shipment-secondary span {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 520px) {
  .portal-container { width: calc(100% - 16px); }
  .dashboard-shell { gap: 14px; padding-top: 10px; }
  .dashboard-sidebar { padding: 9px; border-radius: 14px; }
  .dashboard-nav { display: flex; width: 100%; padding-bottom: 3px; }
  .dashboard-nav button { flex: 0 0 78px; min-width: 78px; }
  .dashboard-nav .admin-nav:not(.hidden) { flex-basis: 108px; }
  .dashboard-topbar { margin-bottom: 20px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stats-grid article { min-height: 108px; padding: 15px; }
  .stats-grid article strong { font-size: 27px; }
  .shipment-card { min-height: 0; padding: 16px; }
  .shipment-card-top { align-items: stretch; flex-direction: column; }
  .status-pill { width: fit-content; max-width: 100%; white-space: normal; }
  .shipment-meta { grid-template-columns: 1fr; }
  .shipment-meta strong { white-space: normal; }
  .admin-banner, .admin-table-card, .admin-requests-card { padding: 15px; }
  .admin-alert-row { grid-template-columns: 18px minmax(0, 1fr); }
  .admin-alert-title { align-items: flex-start; flex-direction: column; }
  .admin-alert-actions { grid-column: 1 / -1; }
  .global-status { right: 8px; bottom: 8px; left: 8px; max-width: none; }
  .delete-dialog, .shipment-edit-dialog { width: calc(100% - 16px); max-height: calc(100dvh - 16px); }
}
