/* Colores corporativos de electric-legs.com (Elementor kit) */
:root {
  --ink: #161616;
  --muted: #6b6b6b;
  --line: #e2e2e2;
  --paper: #f5f7f7;
  --card: #ffffff;
  --accent: #e8501e;
  --accent-soft: #61cec1;
  --accent-warm: #ffbc7d;
  --danger: #9b2c2c;
  --status-entrega: #0f6e75;
  --status-entrega-bg: #e4f6f5;
  --status-ocupada: #9a5b12;
  --status-ocupada-bg: #fff1de;
  --status-recogida: #c43d12;
  --status-recogida-bg: #ffe8e0;
}

* { box-sizing: border-box; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.45;
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 0.9rem 1.5rem;
  background: var(--ink);
  color: #fff;
}

.brand {
  color: inherit;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.02em;
}

nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.account {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.account form { margin: 0; }

.account .link { color: #d8d8d8; }

nav a {
  color: #d8d8d8;
  text-decoration: none;
}

nav a:hover { color: var(--accent-soft); }

main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
}

main a {
  color: var(--accent);
}

.site-foot {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-foot a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.site-foot a:hover { color: var(--accent); }

.changelog {
  max-width: 40rem;
  padding-left: 1.2rem;
}

.changelog li { margin-bottom: 0.35rem; }

h1, h2 { font-weight: 650; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin-top: 2rem; }

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.85rem;
  align-items: end;
  margin-bottom: 1rem;
}

.filters .grow {
  flex: 1 1 14rem;
}

.home-switcher {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.85rem;
  margin-bottom: 1rem;
  padding: 0.55rem 0.75rem;
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: 8px;
  font-size: 0.9rem;
}

.home-switcher a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.home-switcher a.active {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.home-date-form {
  margin-bottom: 0.75rem;
}

.home-today,
.home-tomorrow {
  margin-bottom: 0.5rem;
}

.today-grid,
.move-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.75rem;
}

.move-panel,
.move-day {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem;
}

.move-day.today {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.move-day.focused {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.move-day h3 {
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
}

.move-day h4,
.move-panel h3 {
  font-size: 0.82rem;
  margin: 0 0 0.35rem;
  font-weight: 650;
  letter-spacing: 0.03em;
}

.status-heading {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-transform: uppercase;
}

.status-heading.status-entrega { color: var(--status-entrega); }
.status-heading.status-recogida { color: var(--status-recogida); }

.status-icon {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  vertical-align: middle;
}

.status-badge .status-icon {
  width: 0.9rem;
  height: 0.9rem;
}

.status-badge.status-entrega {
  color: var(--status-entrega);
  background: var(--status-entrega-bg);
}

.status-badge.status-ocupada {
  color: var(--status-ocupada);
  background: var(--status-ocupada-bg);
}

.status-badge.status-recogida {
  color: var(--status-recogida);
  background: var(--status-recogida-bg);
}

.matrix-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  justify-content: center;
  text-decoration: none;
}

.matrix-badges:hover .status-badge {
  filter: brightness(0.97);
}

.move-day ul,
.move-panel ul,
.avail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.move-day li,
.move-panel li,
.avail-item {
  display: grid;
  gap: 0.1rem;
}

.move-item {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  gap: 0.2rem;
}

.move-item:hover {
  border-color: color-mix(in srgb, var(--accent-soft) 55%, var(--line));
}

.move-day a,
.move-panel a,
.avail-state a {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}

.move-day a:hover,
.move-panel a:hover,
.avail-state a:hover {
  color: var(--accent);
}

.movements {
  display: grid;
  gap: 0.65rem;
}

.home-checker {
  margin-top: 1.5rem;
}

.avail-item {
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--card);
}

.avail-item.free {
  border-color: #a8e0d9;
  background: #eefaf8;
}

.avail-item.busy {
  border-color: var(--accent-warm);
  background: #fff5eb;
}

.avail-item.fleet-off {
  opacity: 0.65;
}

.avail-bike {
  font-weight: 600;
}

.table-wrap {
  overflow-x: auto;
}

.fleet-matrix-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}

.fleet-matrix {
  width: max-content;
  min-width: 100%;
  border: none;
  font-size: 0.78rem;
}

.fleet-matrix th,
.fleet-matrix td {
  padding: 0.35rem 0.45rem;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: center;
  white-space: nowrap;
  font-size: 0.72rem;
}

.fleet-matrix th:first-child,
.fleet-matrix td:first-child,
.fleet-matrix th.matrix-bike {
  text-align: left;
  position: sticky;
  left: 0;
  background: var(--card);
  z-index: 2;
  min-width: 10rem;
  font-size: 0.78rem;
}

.fleet-matrix th.matrix-slot,
.fleet-matrix th.matrix-slot-h {
  text-align: left;
  position: sticky;
  left: 10rem;
  background: var(--card);
  z-index: 2;
  min-width: 4.5rem;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.72rem;
}

.fleet-matrix tr.matrix-bike-alt td,
.fleet-matrix tr.matrix-bike-alt th.matrix-slot,
.fleet-matrix th.matrix-bike.matrix-bike-alt {
  background: #eceff0;
}

.fleet-matrix thead th:first-child,
.fleet-matrix thead th.matrix-slot-h {
  z-index: 3;
  background: var(--card);
}

.fleet-matrix tr.matrix-bike-start th.matrix-bike {
  border-top: 1px solid var(--line);
}

.fleet-matrix thead th.today {
  color: var(--accent);
}

.fleet-matrix .matrix-size th {
  text-align: left;
  background: #eef6f5;
  font-size: 0.8rem;
  z-index: 2;
}

.fleet-matrix .matrix-size td {
  background: #eef6f5;
  padding: 0;
  border-right: none;
}

.fleet-matrix td.free .dot {
  color: var(--muted);
}

.fleet-matrix td.busy .matrix-badges {
  text-decoration: none;
}

.fleet-matrix td.busy .status-badge {
  max-width: 7.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fleet-matrix tr.fleet-off {
  opacity: 0.55;
}

.planning-logistics {
  display: block;
  color: var(--muted);
  font-weight: 400;
  font-size: 0.78rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--line);
}

th, td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th { font-size: 0.85rem; color: var(--muted); font-weight: 600; }

.actions {
  white-space: nowrap;
  width: 1%;
}

.actions a,
.actions form {
  display: inline-block;
  vertical-align: middle;
}

.actions form {
  margin: 0 0 0 0.75rem;
}

.muted { color: var(--muted); }

.flash {
  padding: 0.7rem 0.85rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.error {
  background: #fde8e8;
  color: var(--danger);
}

.stack {
  display: grid;
  gap: 0.85rem;
  max-width: 480px;
}

.stack.wide { max-width: 640px; }

.picker {
  display: grid;
  gap: 0.35rem;
}

.picked-card {
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
}

.picked-card.empty {
  border-color: var(--line);
}

.picked-card strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 0.45rem;
}

.picked-card p {
  margin: 0;
}

.picked-card dl {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.2rem 0.75rem;
  margin: 0;
  font-size: 0.9rem;
}

.picked-card dt {
  color: var(--muted);
  font-weight: 600;
}

.picked-card dd { margin: 0; }

.new-customer {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
}

.new-customer summary {
  cursor: pointer;
  font-weight: 600;
}

.new-customer .stack {
  margin-top: 0.75rem;
  max-width: none;
}

.suggest {
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  max-height: 12rem;
  overflow: auto;
}

.suggest li.hint {
  padding: 0.45rem 0.55rem;
  color: var(--muted);
}

.suggest:empty { display: none; }

.periods {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
}

.suggest button {
  width: 100%;
  text-align: left;
  background: none;
  color: inherit;
  border: 0;
  border-radius: 0;
}

.suggest button:hover { background: #eef6f5; }

.chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.35rem 0.55rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.92rem;
}

.date-field {
  position: relative;
  display: block;
}

.date-field .date-text {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding-right: 2.6rem;
}

.date-field .date-cal {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  width: 1.9rem;
  height: 1.9rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: transparent;
  font-size: 0;
  cursor: pointer;
  overflow: hidden;
}

.date-field .date-cal::-webkit-datetime-edit,
.date-field .date-cal::-webkit-datetime-edit-fields-wrapper,
.date-field .date-cal::-webkit-datetime-edit-text,
.date-field .date-cal::-webkit-datetime-edit-month-field,
.date-field .date-cal::-webkit-datetime-edit-day-field,
.date-field .date-cal::-webkit-datetime-edit-year-field {
  display: none;
}

.date-field .date-cal::-webkit-calendar-picker-indicator {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  cursor: pointer;
  opacity: 1;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 1.15rem 1.15rem;
}

/* Firefox: oculta el texto del date y deja el icono nativo */
@supports (-moz-appearance: none) {
  .date-field .date-cal {
    color-scheme: light;
  }
}


input, select, textarea, button {
  font: inherit;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 0.4rem;
}

button, .button {
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
}

button.print-btn,
.print-btn {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

button.link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  cursor: pointer;
}

button.danger, .danger { color: var(--danger); }

@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
  table { font-size: 0.92rem; }
}

@media print {
  @page {
    size: A4;
    margin: 12mm;
  }

  body {
    background: #fff;
    color: #000;
  }

  .top {
    background: #fff;
    color: #000;
    padding: 0 0 0.75rem;
  }

  .top nav,
  .account,
  .site-foot,
  .home-switcher,
  .home-checker,
  .row .button,
  .print-btn {
    display: none;
  }

  main {
    max-width: none;
    padding: 0;
  }

  .today-grid,
  .move-cols {
    grid-template-columns: 1fr 1fr;
  }

  .move-item,
  .move-day,
  .move-panel {
    break-inside: avoid;
  }

  .status-heading,
  .status-badge {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .move-day a,
  .move-panel a {
    color: inherit;
    font-weight: 600;
    text-decoration: none;
  }
}
