/* Rubik, self-hosted. License: vendor/fonts/rubik/OFL.txt. */
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/rubik-latin-ext-af1efb48.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/rubik-latin-692ca1b0.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --ink: #1d2433;
  --muted: #5d6677;
  --line: #d9dee7;
  --surface: #ffffff;
  --table-header-bg: #e9eef3;
  --page: #f4f6f9;
  --brand-turquoise: #4fafae;
  --brand-navy: #0d283f;
  --brand: #246d6c;
  --red: #b42318;
  --red-bg: #fde8e6;
  --amber: #8a5200;
  --amber-bg: #ffecc7;
  --green: #0b6b3a;
  --green-bg: #dcf5e6;
  --red-border: #f4b6b0;
  --amber-border: #f1cf87;
  --green-border: #a6dfbf;
  --control-border: #aab3c2;
  --status-bg: #e9edf3;
  --progress-bg: #dff2f1;
  --progress-ink: #246d6c;
  --topbar: var(--brand-navy);
  --primary-bg: var(--brand-turquoise);
  --primary-ink: var(--brand-navy);
  --focus: #287f7e;
  --radius: 8px;
}

/* Set before first paint; shared tokens also theme native form controls. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e6edf5;
  --muted: #a8b6c8;
  --line: #344459;
  --surface: #192535;
  --table-header-bg: #243448;
  --page: #101923;
  --brand: var(--brand-turquoise);
  --red: #ffb4ac;
  --red-bg: #452522;
  --red-border: #81504b;
  --amber: #ffd18a;
  --amber-bg: #3c301e;
  --amber-border: #78613b;
  --green: #8ee0b1;
  --green-bg: #193b2c;
  --green-border: #3e7356;
  --control-border: #61748c;
  --status-bg: #2b394b;
  --progress-bg: #1c3e40;
  --progress-ink: #94d9d6;
  --topbar: var(--brand-navy);
  --primary-bg: var(--brand-turquoise);
  --primary-ink: var(--brand-navy);
  --focus: #94d9d6;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.5 "Rubik", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--brand); }
h1 { font-size: 1.6rem; margin: 0 0 .75rem; line-height: 1.25; }
h2 { font-size: 1.15rem; margin: 0 0 .5rem; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* Layout */
.topbar { background: var(--topbar); color: #fff; border-bottom: 3px solid var(--brand-turquoise); }
.topbar__inner {
  max-width: 1100px; margin: 0 auto; padding: .6rem 1rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem;
}
.brand { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; flex-shrink: 0; text-decoration: none; }
.brand__logo { display: block; width: 36px; height: 36px; object-fit: contain; }
.nav { display: flex; gap: 1rem; flex: 1; }
.nav a { color: #dbe7f3; text-decoration: none; padding: .2rem 0; }
.nav a.is-current, .nav a:hover { color: var(--brand-turquoise); border-bottom: 2px solid var(--brand-turquoise); }
.topbar :focus-visible { outline-color: #94d9d6; }
.topbar__user { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; max-width: 100%; font-size: .9rem; }
.topbar__email { min-width: 0; overflow-wrap: anywhere; }
.topbar__user form { margin: 0; }
.topbar__user .link-button { color: #fff; }
.create-menu { position: relative; flex-shrink: 0; }
.create-menu > summary { list-style: none; cursor: pointer; }
.create-menu > summary::-webkit-details-marker { display: none; }
.create-menu__items {
  position: absolute; z-index: 20; top: calc(100% + .5rem); right: 0;
  min-width: 160px; padding: .3rem; border: 1px solid var(--line);
  border-radius: 4px; background: var(--surface); box-shadow: 0 5px 16px #0003;
}
.create-menu__items a {
  display: flex; align-items: center; gap: .5rem; padding: .5rem .65rem;
  border-radius: 3px; color: var(--ink); text-decoration: none;
}
.create-menu__items a:hover, .create-menu__items a:focus-visible { background: var(--table-header-bg); }

.container { max-width: 1100px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.section { margin-top: 2rem; }
.section__head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .5rem 1rem; margin-bottom: .75rem;
}
.section__head h1, .section__head h2 { margin: 0; }
.section__head--actions { justify-content: flex-end; }
.crumbs { margin: 0 0 .25rem; font-size: .9rem; color: var(--muted); }
.muted, .hint { color: var(--muted); }
.hint { font-size: .875rem; margin: .25rem 0 0; }
.empty {
  background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 1rem; color: var(--muted);
}

/* Cards */
.dashboard-charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.dashboard-chart { padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.dashboard-chart h2 { font-size: 1rem; margin-bottom: .1rem; }
.dashboard-chart__subtitle { color: var(--muted); font-size: .8rem; margin: 0 0 1rem; }
.dashboard-chart__body--donut { display: flex; align-items: center; gap: .8rem; min-height: 130px; }
.dashboard-chart__ring { position: relative; width: 120px; height: 120px; flex-shrink: 0; }
.dashboard-chart__visual svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); }
.dashboard-chart__base, .dashboard-chart__segment { fill: none; stroke-width: 13; }
.dashboard-chart__base { stroke: var(--status-bg); }
.dashboard-chart__segment { transition: stroke-width .15s ease; }
.dashboard-chart__segment.is-highlighted { stroke-width: 17; }
.dashboard-chart__total { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.dashboard-chart__total strong { font-size: 1.65rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.dashboard-chart__total span { font-size: .75rem; color: var(--muted); }
.dashboard-chart__legend { list-style: none; padding: 0; margin: 0; flex: 1; min-width: 0; }
.dashboard-chart__legend li + li { margin-top: .7rem; }
.dashboard-chart__label { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .8rem; color: var(--chart-color); }
.dashboard-chart__label > span { display: flex; align-items: center; gap: .4rem; }
.dashboard-chart__badge { padding: .1rem .35rem; border-radius: 3px; background: var(--chart-fill); }
.dashboard-chart__label strong { font-variant-numeric: tabular-nums; }
.dashboard-chart__swatch { width: 8px; height: 8px; flex-shrink: 0; border-radius: 2px; background: var(--chart-color); }
.dashboard-chart__track { height: 8px; margin-top: .35rem; border-radius: 2px; overflow: hidden; background: var(--page); }
.dashboard-chart__track span { display: block; height: 100%; width: 0; background: var(--chart-fill); }
.dashboard-chart__empty { margin: .6rem 0 0; font-size: .8rem; color: var(--muted); }
@media (max-width: 900px) { .dashboard-charts { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }
@media (max-width: 340px) { .dashboard-charts { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .dashboard-chart__segment { transition: none; } }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem; color: inherit;
}
.card--link { text-decoration: none; display: block; }
.card--link:hover, .card--link:focus-visible { border-color: var(--brand); box-shadow: 0 1px 6px rgb(79 175 174 / .18); }
.tally { margin: 0; }
.tally dt { font-size: .8rem; color: var(--muted); margin-top: .6rem; }
.tally dd { margin: .15rem 0 0; display: flex; flex-wrap: wrap; gap: .35rem; }

/* Traffic lights. The text label is always present; colour is a second cue. */
.light, .status {
  display: inline-block; padding: .1rem .6rem; border-radius: 4px;
  font-size: .8rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent;
}
.light::before { content: "●"; margin-right: .3rem; }
.light--red { background: var(--red-bg); color: var(--red); border-color: var(--red-border); }
.light--amber { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-border); }
.light--green { background: var(--green-bg); color: var(--green); border-color: var(--green-border); }
.status { background: var(--status-bg); color: var(--ink); }
.status--resolved { background: var(--green-bg); color: var(--green); }
.status--in_progress { background: var(--progress-bg); color: var(--progress-ink); }

.lights { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.light-option {
  display: flex; gap: .6rem; align-items: flex-start; cursor: pointer;
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: .65rem .75rem;
}
.light-option__body { display: flex; flex-direction: column; font-size: .875rem; color: var(--muted); }
.light-option__body strong { font-size: 1rem; }
.light-option--red strong { color: var(--red); }
.light-option--amber strong { color: var(--amber); }
.light-option--green strong { color: var(--green); }
.light-option--red:has(:checked) { border-color: var(--red); background: var(--red-bg); }
.light-option--amber:has(:checked) { border-color: var(--amber); background: var(--amber-bg); }
.light-option--green:has(:checked) { border-color: var(--green); background: var(--green-bg); }

/* Tables */
.table-wrap {
  overflow-x: auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
}
table { width: 100%; border-collapse: collapse; }
.table-wrap .issues-table { table-layout: fixed; min-width: 890px; }
.table-wrap .issues-table--all { min-width: 1040px; }
.issues-table__priority { width: 120px; }
.issues-table__hotel, .issues-table__location { width: 150px; }
.issues-table__status, .issues-table__assignee, .issues-table__date { width: 128px; }
.issues-table td { white-space: nowrap; vertical-align: middle; }
.issues-table__text, .table-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-wrap .inspections-table { table-layout: fixed; min-width: 850px; }
.table-wrap .inspections-table--all { min-width: 1000px; }
.inspections-table td { white-space: nowrap; vertical-align: middle; }
.inspections-table__hotel { width: 150px; }
.inspections-table__category { width: 145px; }
.inspections-table__frequency { width: 130px; }
.inspections-table__date { width: 120px; }
.inspections-table__status { width: 170px; }
.inspections-table__action { width: 110px; }
th, td { padding: .6rem .75rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { font-size: 1rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
thead th { background: var(--table-header-bg); }
tbody tr:last-child td { border-bottom: 0; }
tr.is-inactive { color: var(--muted); }
.cell-action { text-align: right; white-space: nowrap; }

.pagination-footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .75rem; margin-top: .85rem;
}
.pagination-summary { margin: 0; color: var(--muted); font-size: .875rem; }
.pagination-footer .pagy { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.pagination-footer .pagy a {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; min-height: 34px; padding: .3rem .6rem;
  border: 1px solid var(--control-border); border-radius: 6px;
  background: linear-gradient(180deg, rgb(255 255 255 / .08), rgb(0 0 0 / .04)), var(--surface);
  color: var(--ink); font-size: .875rem; font-weight: 600; text-decoration: none;
}
.pagination-footer .pagy a[href]:hover { border-color: var(--brand); color: var(--brand); }
.pagination-footer .pagy a[aria-disabled="true"] { color: var(--muted); background: var(--page); }
.pagination-footer .pagy a[aria-current="page"] {
  background: var(--primary-bg); border-color: #367f80; color: var(--primary-ink);
}
.pagination-footer .pagy a[role="separator"] { border-color: transparent; background: none; }

/* Details */
.details {
  display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.25rem; margin: 0 0 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem;
}
.details dt { color: var(--muted); font-size: .9rem; }
.details dd { margin: 0; }
.prose { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .25rem 1rem; }
.comment { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem; margin-bottom: .6rem; }
.comment p { margin: .35rem 0 0; }

/* Forms */
.form { max-width: 640px; }
.field { margin: 0 0 1rem; border: 0; padding: 0; min-width: 0; }
.field > label, .field > legend { display: block; font-weight: 600; margin-bottom: .3rem; padding: 0; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], select, textarea {
  width: 100%; padding: .55rem .65rem; font: inherit; color: inherit;
  background: var(--surface); border: 1px solid var(--control-border); border-radius: 6px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, .button:focus-visible, a:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 1px;
}
.input--narrow { max-width: 8rem; }
.inline { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.inline > input[type="text"] { flex: 1 1 240px; }
.inline > select { width: auto; }
.inline form { margin: 0; }
.check { display: flex; gap: .5rem; align-items: baseline; margin: .3rem 0; font-weight: 400; }
.filters { display: flex; flex-wrap: wrap; gap: .75rem 1rem; margin-bottom: 1rem; }
.filters .field { margin: 0; min-width: 180px; }

.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.actions form { margin: 0; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 42px; padding: .55rem 1rem; font: inherit; font-weight: 600; line-height: 1.4;
  cursor: pointer; vertical-align: middle; text-align: center; text-decoration: none;
  color: var(--ink); border: 1px solid var(--control-border); border-radius: 8px;
  background: linear-gradient(180deg, rgb(255 255 255 / .09), rgb(0 0 0 / .06)), var(--surface);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .25), 0 1px 2px rgb(13 40 63 / .15);
  text-shadow: 0 1px 0 rgb(255 255 255 / .5);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}
:root[data-theme="dark"] .button { text-shadow: 0 1px 1px rgb(0 0 0 / .35); }
.button:not(:disabled):hover {
  border-color: var(--brand); transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .3), 0 3px 6px rgb(13 40 63 / .2);
}
.button.button--primary {
  background: linear-gradient(180deg, #6abfbd, var(--primary-bg));
  border-color: #367f80; color: var(--primary-ink);
  text-shadow: 0 1px 0 rgb(255 255 255 / .3);
}
.button.button--danger {
  background: linear-gradient(180deg, rgb(255 255 255 / .08), rgb(0 0 0 / .04)), var(--red-bg);
  color: var(--red); border-color: var(--red-border);
}
.button--danger:not(:disabled):hover { border-color: var(--red); }
.button:not(:disabled):active {
  transform: translateY(0);
  box-shadow: inset 0 2px 3px rgb(13 40 63 / .18);
}
.button:disabled { opacity: .6; cursor: wait; box-shadow: none; }
.button--small { min-height: 32px; padding: .25rem .65rem; font-size: .85rem; gap: .4rem; }
.button .fa-icon { font-size: .95em; }
.issues-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .85rem; }
.issues-filters { align-items: center; flex: 1; gap: .5rem; margin: 0; }
.issues-filters .field { min-width: 0; max-width: 100%; }
.issues-filters select { height: 34px; padding: .3rem .55rem; font-size: .875rem; }
.issues-filters select[name="hotel"] { width: 180px; }
.issues-filters select[name="status"] { width: 175px; }
.issues-filters select[name="priority"] { width: 140px; }
.schedule-filters select[name="category"] { width: 180px; }
.schedule-filters select[name="state"] { width: 145px; }
.quick-filters { display: flex; flex-wrap: wrap; gap: .4rem; }
.button.priority-filter {
  min-height: 34px; padding: .3rem .65rem; gap: .35rem; font-size: .875rem;
  color: var(--quick-ink); border-color: var(--quick-border);
  background: linear-gradient(180deg, rgb(255 255 255 / .08), rgb(0 0 0 / .04)), var(--quick-bg);
}
.priority-filter::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }
.priority-filter--red { --quick-ink: var(--red); --quick-border: var(--red-border); --quick-bg: var(--red-bg); }
.priority-filter--amber { --quick-ink: var(--amber); --quick-border: var(--amber-border); --quick-bg: var(--amber-bg); }
.priority-filter--green { --quick-ink: var(--green); --quick-border: var(--green-border); --quick-bg: var(--green-bg); }
.button.priority-filter:hover, .button.priority-filter.is-active { border-color: var(--quick-ink); }
.button.priority-filter.is-active { box-shadow: inset 0 0 0 1px var(--quick-ink); }
@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
  .button:not(:disabled):hover { transform: none; }
}
.link-button {
  background: none; border: 0; padding: 0; font: inherit; color: var(--brand);
  text-decoration: underline; cursor: pointer;
}
.link-button .fa-icon { margin-right: .3rem; vertical-align: -.1em; }

/* Messages */
.flash, .errors, .notice-box {
  border-radius: var(--radius); padding: .7rem 1rem; margin-bottom: 1rem; border: 1px solid var(--line);
}
.flash { display: flex; justify-content: space-between; gap: 1rem; }
.flash--notice { background: var(--green-bg); border-color: var(--green-border); color: var(--green); }
.flash--alert, .errors { background: var(--red-bg); border-color: var(--red-border); color: var(--red); }
.flash__close { background: none; border: 0; font-size: 1.2rem; line-height: 1; cursor: pointer; color: inherit; }
.errors ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.notice-box { background: var(--amber-bg); border-color: var(--amber-border); }
.notice-box p { margin: 0 0 .5rem; }

/* Signed-out pages */
.auth-card {
  max-width: 420px; margin: 8vh auto 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem;
}
.auth-brand {
  display: flex; justify-content: center; padding: 1.5rem;
  margin: -1.5rem -1.5rem 1.5rem;
  background: var(--brand-navy); border-bottom: 3px solid var(--brand-turquoise);
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
}
.auth-brand__logo { display: block; width: 240px; max-width: 100%; height: auto; }

@media (max-width: 600px) {
  .details { grid-template-columns: 1fr; gap: 0; }
  .details dd { margin-bottom: .6rem; }
  th, td { padding: .5rem; }
}

/* On phones, let wide tables scroll sideways instead of crushing columns. */
@media (max-width: 600px) {
  .table-wrap table { min-width: 560px; }
}

/* Theme control, shared by the navigation and signed-out pages. */
.theme-toolbar {
  max-width: 1100px; margin: 0 auto; padding: .75rem 1rem 0;
  display: flex; justify-content: flex-end;
}
.theme-toggle {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 44px;
  padding: .35rem .65rem; border: 1px solid var(--control-border); border-radius: 999px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: .875rem;
  font-weight: 600; cursor: pointer; white-space: nowrap;
}
.theme-toggle:hover { border-color: var(--brand); }
.theme-toggle__switch {
  display: inline-flex; align-items: center; width: 2rem; height: 1.15rem;
  padding: 2px; border: 1px solid var(--muted); border-radius: 999px;
  background: var(--status-bg);
}
.theme-toggle__switch::before {
  content: ""; width: .75rem; height: .75rem; border-radius: 50%; background: var(--muted);
}
.theme-toggle[aria-pressed="true"] .theme-toggle__switch { background: var(--brand); border-color: var(--brand); }
.theme-toggle[aria-pressed="true"] .theme-toggle__switch::before { transform: translateX(.8rem); background: var(--page); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); }
