:root {
  --bg: #eef2ec;
  --surface: #ffffff;
  --ink: #1b2822;
  --muted: #55655b;
  --line: #d6dfd2;
  --green: #1d5b3e;
  --green-dark: #154630;
  --green-soft: #e3f0e8;
  --red: #8a2a1c;
  --red-soft: #fbeceb;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(27, 40, 34, 0.06), 0 4px 16px rgba(27, 40, 34, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101612;
    --surface: #18211b;
    --ink: #e8efe9;
    --muted: #9fb1a5;
    --line: #2a372e;
    --green: #4fa57a;
    --green-dark: #3d8a64;
    --green-soft: #1d3326;
    --red: #e08a7c;
    --red-soft: #3a1e19;
    --shadow: none;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Roboto, system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---- encabezado ---- */
.top {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  font-weight: 700;
  font-size: 18px;
}
.brand small {
  display: block;
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
}
.who {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}
.tabs {
  display: flex;
  gap: 4px;
  margin-top: 18px;
}
.tab {
  padding: 8px 16px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}
.tab[aria-current='page'] {
  background: var(--green-soft);
  color: var(--green);
  font-weight: 700;
}

main {
  padding-top: 18px;
  padding-bottom: 48px;
}

/* ---- tarjetas y formularios ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}
.card h2 {
  font-size: 17px;
}
.card h3 {
  font-size: 14px;
  margin: 18px 0 6px;
}
.hint {
  color: var(--muted);
  font-size: 13px;
  margin: 2px 0 12px;
}
.grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  align-items: end;
}
label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
input,
select {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 400;
}
input:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

button {
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
button.primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
button.primary:hover:not(:disabled) {
  background: var(--green-dark);
}
button.link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--green);
  text-decoration: underline;
  font-weight: 500;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.row .grow {
  flex: 1;
  min-width: 0;
}
.row input,
.row select {
  margin-top: 0;
  width: auto;
}
.row input.grow {
  width: auto;
  min-width: 160px;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}
.list li:first-child {
  border-top: 0;
}
.muted {
  color: var(--muted);
  font-size: 13px;
}
.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--green-soft);
  color: var(--green);
}
.pill.off {
  background: var(--bg);
  color: var(--muted);
}

.hotel-head {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.hotel-head img {
  width: 128px;
  height: 128px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
}
.code {
  font-weight: 700;
  letter-spacing: 0.08em;
}
.inactive {
  opacity: 0.6;
}
.url {
  word-break: break-all;
  font-size: 13px;
  color: var(--muted);
}

/* ---- avisos ---- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  max-width: min(92vw, 520px);
  padding: 11px 16px;
  border-radius: 12px;
  font-weight: 500;
  background: var(--green);
  color: #fff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}
.toast.error {
  background: var(--red);
}

/* ---- login ---- */
.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.login form {
  width: 100%;
  max-width: 380px;
}
.login h1 {
  font-size: 22px;
  margin-bottom: 4px;
}
.login .field {
  margin-top: 12px;
}
.login button {
  width: 100%;
  margin-top: 18px;
  padding: 11px;
}
.alert {
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 13px;
  font-weight: 500;
}

.mt {
  margin-top: 10px;
}
.row input.narrow {
  width: 80px;
}

/* ---- tabla de restaurantes ---- */
.wrap.wide {
  max-width: 1480px;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 12px;
}
.toolbar input {
  margin-top: 0;
  max-width: 420px;
}
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}
table.data {
  width: 100%;
  min-width: 1100px;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.data th,
table.data td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
table.data th {
  position: sticky;
  top: 0;
  background: var(--green-soft);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
table.data tbody tr:last-child td {
  border-bottom: 0;
}
table.data tbody tr:hover td {
  background: var(--green-soft);
}
table.data .num {
  text-align: right;
}
table.data .nowrap {
  white-space: nowrap;
}
table.data .off {
  opacity: 0.55;
  text-decoration: line-through;
}
table.data small {
  font-size: 12px;
}
.copy {
  white-space: nowrap;
  padding: 2px 6px;
  border: 1px dashed var(--line);
  background: transparent;
  font-weight: 400;
  cursor: copy;
}
.copy code {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.copy:hover code {
  color: var(--ink);
}
.pill {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}
.empty {
  margin-top: 12px;
}
/* ---- paginado ---- */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
}
.pager[hidden] {
  display: none;
}
.pager span {
  font-size: 13px;
  color: var(--muted);
  min-width: 110px;
  text-align: center;
}
.pager button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
/* ---- hoteles: lista y detalle ---- */
.rowlink {
  color: var(--ink);
  text-decoration: none;
}
.rowlink:hover {
  text-decoration: underline;
}
.open {
  color: var(--green);
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
}
.open:hover {
  text-decoration: underline;
}
.back {
  display: inline-block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.back:hover {
  color: var(--ink);
}
table.data tbody tr.row-off td {
  opacity: 0.6;
}
table.data.compact {
  min-width: 0;
}
table.data .actions {
  text-align: right;
  white-space: nowrap;
}
table.data .actions button + button {
  margin-left: 6px;
}
.code-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 4px 12px;
  border-radius: 10px;
  background: var(--green-soft);
}
.code-chip code {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink);
}
.detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.tiles {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin-top: 16px;
}
.tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.tile-code {
  grid-column: span 2;
  background: var(--green-soft);
  border-color: transparent;
}
.tile-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.tile-num {
  font-size: 28px;
  line-height: 1.1;
}
.code-big {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.08em;
  word-break: break-all;
}
.tile-code button.link {
  align-self: flex-start;
}
.sec-title {
  font-size: 16px;
  margin: 0 0 4px;
}
.field-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 4px;
}
.qr-block {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 10px;
}
.qr-block img {
  display: block;
  width: 170px;
  height: 170px;
  margin-bottom: 6px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
}
.qr-block .grow {
  flex: 1;
  min-width: 260px;
}
@media (max-width: 560px) {
  .tile-code {
    grid-column: auto;
  }
}