/*
 * Vivestay operator console — design system (RM000009).
 *
 * Independent product identity: predominantly white surfaces, a Vivestay blue as
 * the primary action colour, orange as a restrained attention accent, generous
 * spacing, subtle borders and shadows, accessible contrast. Desktop-first
 * operator workflows that stay usable on tablets. Dependency-free, no inline
 * styles (strict CSP), no design tokens derived from any tenant.
 */

:root {
  --brand: #1f5fd6;
  --brand-strong: #17429b;
  --brand-soft: #eaf1fc;
  --accent: #ef7d10;
  --accent-soft: #fdefdd;

  --canvas: #f6f8fb;
  --surface: #ffffff;
  --text: #16202e;
  --muted: #5c6b7a;
  --faint: #8493a2;
  --border: #e4e9f0;
  --border-strong: #d3dbe4;

  --ok: #1a7f52;
  --ok-soft: #e6f4ec;
  --warn: #a8620a;
  --warn-soft: #fbeed9;
  --danger: #c0362c;
  --danger-soft: #fbe9e7;
  --info: #2f6b8f;
  --info-soft: #e7f1f6;

  --radius: 10px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 2px rgba(20, 32, 46, 0.06);
  --shadow: 0 2px 8px rgba(20, 32, 46, 0.08);
  --shadow-lg: 0 10px 30px rgba(20, 32, 46, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--canvas);
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  line-height: 1.55;
  font-size: 15px;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.01em;
}

a {
  color: var(--brand);
}

/* --- App shell ----------------------------------------------------------- */

.shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1.25rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.15rem 0.5rem;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  box-shadow: var(--shadow-sm);
}

.brand-name {
  font-weight: 700;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.brand-name .accent {
  color: var(--accent);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.65rem;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font: inherit;
  font-weight: 550;
  text-align: left;
  cursor: pointer;
  width: 100%;
}

.nav-item:hover {
  background: var(--canvas);
  color: var(--text);
}

.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
  flex: none;
}

.sidebar-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0 0.5rem;
  color: var(--faint);
  font-size: 0.8rem;
}

.org-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 600;
  font-size: 0.85rem;
}

.main {
  padding: 1.75rem 2rem 4rem;
  max-width: 1120px;
  width: 100%;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-head h1 {
  font-size: 1.5rem;
}

.page-head .sub {
  color: var(--muted);
  margin-top: 0.2rem;
}

.crumb {
  background: none;
  border: none;
  color: var(--brand);
  font: inherit;
  font-weight: 550;
  cursor: pointer;
  padding: 0;
  margin-bottom: 0.75rem;
}

/* --- Cards & layout ------------------------------------------------------ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem 1.35rem;
}

.card + .card {
  margin-top: 1.1rem;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.card-head h2 {
  font-size: 1.05rem;
}

.card-head h3 {
  font-size: 0.95rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
  }
  .nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .sidebar-foot {
    margin: 0 0 0 auto;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .main {
    padding: 1.25rem 1rem 3rem;
  }
}

/* --- Buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.12s ease,
    border-color 0.12s ease;
}

.btn:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  color: #fff;
}

.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background: #d86c06;
  border-color: #d86c06;
  color: #fff;
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--brand);
}

.btn-ghost:hover {
  background: var(--brand-soft);
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
}

.btn-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

/* --- Forms --------------------------------------------------------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.9rem;
}

.field label {
  font-weight: 600;
  font-size: 0.88rem;
}

.field .hint {
  color: var(--muted);
  font-size: 0.82rem;
}

.field .optional {
  color: var(--faint);
  font-weight: 500;
}

input,
select,
textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.65rem;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.field.invalid input,
.field.invalid select {
  border-color: var(--danger);
}

.field-error {
  color: var(--danger);
  font-size: 0.82rem;
}

/* --- Badges / states ----------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 650;
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.badge-info {
  background: var(--info-soft);
  color: var(--info);
}
.badge-warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.badge-danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.badge-accent {
  background: var(--accent-soft);
  color: var(--accent);
}
.badge-neutral {
  background: var(--canvas);
  color: var(--muted);
}

/* --- Tables -------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
}

thead th {
  text-align: left;
  padding: 0.6rem 0.9rem;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border);
  background: var(--canvas);
}

tbody td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr.clickable {
  cursor: pointer;
}

tbody tr.clickable:hover {
  background: var(--brand-soft);
}

.cell-strong {
  font-weight: 600;
}

.cell-muted {
  color: var(--muted);
}

/* --- Definition lists ---------------------------------------------------- */

.fields {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0.55rem 1rem;
  margin: 0;
}

.fields dt {
  color: var(--muted);
  font-size: 0.88rem;
}

.fields dd {
  margin: 0;
  font-weight: 550;
}

/* --- Readiness checklist ------------------------------------------------- */

.checklist {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.check-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 800;
  flex: none;
  margin-top: 1px;
}

.check-icon.done {
  background: var(--ok-soft);
  color: var(--ok);
}
.check-icon.todo {
  background: var(--warn-soft);
  color: var(--warn);
}
.check-icon.na {
  background: var(--canvas);
  color: var(--faint);
}

.check-body .t {
  font-weight: 600;
}

.check-body .d {
  color: var(--muted);
  font-size: 0.85rem;
}

/* --- Notices ------------------------------------------------------------- */

.notice {
  border: 1px solid var(--border);
  border-left: 3px solid var(--info);
  background: var(--info-soft);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  color: var(--text);
  font-size: 0.9rem;
}

.notice.warn {
  border-left-color: var(--accent);
  background: var(--accent-soft);
}

.notice.danger {
  border-left-color: var(--danger);
  background: var(--danger-soft);
}

.error-banner {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #f3cdc8;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  font-weight: 550;
  margin-bottom: 1rem;
}

.empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
}

.empty .empty-title {
  font-weight: 650;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.muted {
  color: var(--muted);
}
.mono {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.85em;
}
.hidden {
  display: none !important;
}
.spacer {
  flex: 1;
}
.copy-field {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.copy-field input {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.85rem;
}

/* --- Connect (sign-in) screen ------------------------------------------- */

.connect-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.connect-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 1.75rem;
}

.connect-card .brand {
  justify-content: center;
  margin-bottom: 1.25rem;
}

.connect-card h1 {
  font-size: 1.15rem;
  text-align: center;
  margin-bottom: 0.35rem;
}

.connect-card .sub {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

/* --- Filter bar & lists (Reservations) ----------------------------------- */

.filter-bar {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
  padding: 1rem 1.15rem;
}

.filter-cell {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 150px;
  flex: 1;
}

.filter-cell.filter-actions {
  flex: 0 0 auto;
  min-width: 0;
}

.filter-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.plain-list {
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.plain-list li {
  padding: 0.4rem 0.6rem;
  background: var(--canvas);
  border-radius: var(--radius-sm);
  font-weight: 550;
}

h4 {
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--text);
}

/* --- Overview attention tiles (Priority 5) ------------------------------- */

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  align-items: flex-start;
  text-align: left;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font: inherit;
  transition:
    box-shadow 0.12s ease,
    transform 0.06s ease;
}

.tile:hover {
  box-shadow: var(--shadow);
}

.tile-active {
  box-shadow: 0 0 0 2px var(--brand-soft);
}

.tile-count {
  font-size: 1.8rem;
  font-weight: 750;
  line-height: 1;
  color: var(--text);
}

.tile-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.tile-empty {
  opacity: 0.6;
}
.tile-empty .tile-count {
  color: var(--faint);
}

.tile-danger {
  border-left-color: var(--danger);
}
.tile-danger .tile-count {
  color: var(--danger);
}
.tile-warn {
  border-left-color: var(--accent);
}
.tile-accent {
  border-left-color: var(--accent);
}
.tile-accent .tile-count {
  color: var(--accent);
}
.tile-info {
  border-left-color: var(--brand);
}
.tile-neutral {
  border-left-color: var(--border-strong);
}

/* --- CSP-safe layout utilities (replace inline style attrs; see ui.js) --- */

.u-mt-0 {
  margin-top: 0;
}
.u-mt-xs {
  margin: 0.25rem 0 0;
}
.u-mt-sm {
  margin-top: 0.5rem;
}
.u-mt-md {
  margin-top: 0.75rem;
}
.u-mt-1 {
  margin-top: 1rem;
}
.u-mb-1 {
  margin-bottom: 1rem;
}
.u-m-0 {
  margin: 0;
}
.u-h4top {
  margin: 1rem 0 0.25rem;
}
.u-fs-sm {
  font-size: 0.85rem;
}
.u-fs-xs {
  font-size: 0.82rem;
}
.u-w-full {
  width: 100%;
}
.u-minw {
  min-width: 260px;
}
.u-form {
  max-width: 620px;
}

.signin-foot {
  margin-top: 1rem;
  text-align: center;
}

/* English helper beside a Spanish Anexo I label (RM000016). */
.field-help {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: -0.1rem;
}
