:root {
  --p: #1a7b88;
  --pd: #115864;
  --soft: #e8f5f4;
  --bg: #f4f7f8;
  --card: #fff;
  --text: #17323c;
  --muted: #6b7f87;
  --border: #dfe8eb;
  --ok: #159c5b;
  --danger: #d94550;
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--bg);
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
}
body.cargando:after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: #ffffffa8;
  backdrop-filter: blur(2px);
}
body.cargando:before {
  content: "";
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 9999;
  width: 38px;
  height: 38px;
  margin: -19px;
  border: 4px solid #dce8e9;
  border-top-color: var(--p);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at top right, #1a7b882b, transparent 34%),
    linear-gradient(#f8fbfb, #eef4f5);
}
.login-card {
  width: min(100%, 430px);
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 24px 70px #17323c21;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand div {
  display: flex;
  flex-direction: column;
}
.brand small {
  color: var(--p);
  font-weight: 900;
  letter-spacing: 2px;
}
.brand strong {
  font-size: 18px;
}
.logo {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #fff;
  background: var(--p);
  font-size: 24px;
}
.login-copy {
  padding: 32px 0 22px;
}
.eyebrow {
  color: var(--p);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.login-copy h1 {
  margin: 8px 0;
  font-size: 31px;
  line-height: 1.08;
}
.login-copy p,
.profile p {
  color: var(--muted);
  line-height: 1.5;
}
form {
  display: grid;
  gap: 15px;
}
label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
}
input {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  outline: none;
}
input:focus {
  border-color: var(--p);
  box-shadow: 0 0 0 4px #1a7b8817;
}
.btn {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 13px;
  font-weight: 800;
}
.primary {
  border: 0;
  color: #fff;
  background: var(--p);
}
.secondary {
  border: 1px solid #1a7b8840;
  color: var(--p);
  background: var(--soft);
}
.ghost {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
}
.danger {
  width: 100%;
  border: 0;
  color: #fff;
  background: var(--danger);
}
.danger-outline {
  border: 1px solid #d9455047;
  color: var(--danger);
  background: #fff;
}
.detail {
  border: 0;
  color: #fff;
  background: var(--p);
}
.shell {
  min-height: 100vh;
  padding-bottom: 82px;
}
.header {
  padding: 18px 18px 25px;
  color: #fff;
  background:
    radial-gradient(circle at top right, #ffffff2d, transparent 30%),
    linear-gradient(135deg, var(--pd), var(--p));
  border-radius: 0 0 28px 28px;
}
.header-row,
.welcome,
.section-title,
.order-head,
.order-bottom,
.modal-head,
.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand.light small,
.brand.light strong {
  color: #fff;
}
.availability {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #ffffff3d;
  border-radius: 999px;
  color: #fff;
  background: #ffffff1f;
  font-size: 12px;
  font-weight: 800;
}
.availability i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
}
.online i {
  background: #50e99b;
}
.offline i {
  background: #ffb56e;
}
.welcome {
  margin-top: 28px;
}
.welcome h1 {
  margin: 4px 0;
  font-size: 25px;
}
.icon-btn {
  width: 42px;
  height: 42px;
  border: 1px solid #ffffff40;
  border-radius: 13px;
  color: #fff;
  background: #ffffff1f;
  font-size: 20px;
}
.icon-btn.dark {
  color: var(--text);
  border-color: var(--border);
  background: #fff;
}
#vista {
  width: min(100%, 860px);
  margin: auto;
}
.section {
  padding: 22px 16px;
}
.section-title {
  margin-bottom: 16px;
}
.section-title.secondary {
  margin-top: 24px;
}
.section-title h2 {
  margin: 5px 0;
  font-size: 21px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.metrics article {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
}
.metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 21px;
}
.orders {
  display: grid;
  gap: 14px;
}
.order-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
}
.order-head strong,
.order-head small {
  display: block;
}
.order-head small {
  margin-top: 4px;
  color: var(--muted);
}
.status,
.payment,
.count {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}
.status.asignado,
.status.preparando,
.status.listo {
  color: #805600;
  background: #fff2cc;
}
.status.en_camino,
.status.recogido,
.status.llegue {
  color: #2f5ad7;
  background: #e7efff;
}
.status.entregado {
  color: #087a45;
  background: #dcf7e7;
}
.status.no_entregado {
  color: #b92f3a;
  background: #ffe3e6;
}
.address {
  display: flex;
  gap: 8px;
  padding: 15px 0;
  color: var(--muted);
  line-height: 1.4;
}
.order-data {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px;
  border-radius: 15px;
  background: #f7fafb;
}
.order-data span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}
.order-data strong {
  display: block;
  margin-top: 4px;
  font-size: 13px;
}
.order-bottom {
  margin-top: 14px;
}
.payment.paid {
  color: #087a45;
  background: #dcf7e7;
}
.payment.pending {
  color: #b92f3a;
  background: #ffe3e6;
}
.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  min-height: 74px;
  border-top: 1px solid var(--border);
  background: #fffffff2;
  backdrop-filter: blur(12px);
}
.bottom-nav button {
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
}
.bottom-nav b {
  display: block;
  margin-bottom: 4px;
  font-size: 20px;
}
.bottom-nav .activo {
  color: var(--p);
}
.empty {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 25px;
  border: 2px dashed var(--border);
  border-radius: 20px;
  text-align: center;
  background: #ffffff73;
}
.empty b {
  font-size: 42px;
  color: #a8b6bc;
}
.empty span {
  color: var(--muted);
  font-size: 13px;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
}
.modal.oculto {
  display: none;
}
.backdrop {
  position: absolute;
  inset: 0;
  background: #0f1f255e;
}
.modal-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  max-height: 94vh;
  overflow: auto;
  border-radius: 26px 26px 0 0;
  background: var(--bg);
}
.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: #fffffff2;
  backdrop-filter: blur(12px);
}
.modal-head h2 {
  margin: 5px 0;
}
.modal-body {
  display: grid;
  gap: 14px;
  width: min(100%, 760px);
  margin: auto;
  padding: 16px 16px 30px;
}
.info-card,
.payment-grid,
.products {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
}
.info-card small,
.info-card strong,
.info-card span {
  display: block;
}
.info-card span {
  margin-top: 5px;
  color: var(--muted);
}
.actions {
  align-items: stretch;
}
.actions .btn {
  flex: 1;
}
.payment-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.payment-grid div {
  padding: 12px;
  border-radius: 14px;
  background: #f7fafb;
}
.payment-grid span,
.payment-grid strong {
  display: block;
}
.payment-grid span {
  color: var(--muted);
  font-size: 12px;
}
.product {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.product:last-child {
  border-bottom: 0;
}
.product small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}
.delivery-actions {
  display: grid;
  gap: 10px;
}
.profile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
}
.avatar {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  color: #fff;
  background: var(--p);
  font-size: 28px;
  font-weight: 900;
}
.profile h2 {
  margin: 5px 0;
}
.profile-data {
  margin: 16px 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
}
.profile-data div {
  display: flex;
  justify-content: space-between;
  padding: 15px;
  border-bottom: 1px solid var(--border);
}
.profile-data div:last-child {
  border-bottom: 0;
}
.profile-data span {
  color: var(--muted);
}
.toast {
  position: fixed;
  right: 16px;
  bottom: 92px;
  z-index: 10000;
  max-width: calc(100vw - 32px);
  padding: 13px 16px;
  border-radius: 14px;
  color: #fff;
  background: var(--text);
  box-shadow: 0 16px 40px #17323c38;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: 0.22s;
}
.toast.visible {
  opacity: 1;
  transform: none;
}
.toast.error {
  background: var(--danger);
}
@media (min-width: 760px) {
  .header {
    padding-right: max(24px, calc((100vw - 860px) / 2));
    padding-left: max(24px, calc((100vw - 860px) / 2));
  }
  .metrics {
    grid-template-columns: repeat(4, 1fr);
  }
  .modal-panel {
    top: 4vh;
    bottom: 4vh;
    left: 50%;
    width: min(760px, calc(100vw - 40px));
    border-radius: 26px;
    transform: translateX(-50%);
  }
}
@media (max-width: 420px) {
  .order-data {
    grid-template-columns: 1fr 1fr;
  }
  .order-data div:last-child {
    grid-column: 1/-1;
  }
  .actions {
    flex-direction: column;
  }
}
