/* Whirlpool Foot Spa Records — main stylesheet
   Plain CSS, no framework. Built for a tablet on a busy salon floor first,
   desktop second. Touch targets are large on purpose. */

:root {
  --bg: #faf6f0;
  --surface: #ffffff;
  --ink: #2b2118;
  --ink-soft: #6b5d4f;
  --accent: #7a3b2e;
  --accent-dark: #5c2a20;
  --accent-contrast: #ffffff;
  --success-bg: #e4f1e8;
  --success-ink: #1f5c3a;
  --danger-bg: #fbe9e7;
  --danger-ink: #8a2a20;
  --border: #e4d9c9;
  --border-strong: #c9b89e;
  --radius: 12px;
  --radius-lg: 18px;
  --focus-ring: #1c6dd0;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.4;
  font-size: 18px;
}

a {
  color: var(--accent-dark);
}

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Header / nav --- */

.app-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem;
  background: var(--accent);
  color: var(--accent-contrast);
}

.app-header__brand {
  color: var(--accent-contrast);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
}

.app-header__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.app-header__nav a {
  color: var(--accent-contrast);
  text-decoration: none;
  font-size: 1rem;
  padding: 0.4rem 0.2rem;
}

.app-header__nav a:hover,
.app-header__nav a:focus-visible {
  text-decoration: underline;
}

.app-header__admin {
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  padding: 0.3rem 0.8rem !important;
}

/* Pill-shaped log out button, in the two contexts it appears: inside the
   terracotta admin nav bar, and alone on the cream staff background. */
.app-header__nav a.app-header__logout {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.35rem 1rem !important;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

.app-header__nav a.app-header__logout:hover,
.app-header__nav a.app-header__logout:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  text-decoration: none;
}

.staff-bar {
  display: flex;
  justify-content: flex-end;
  padding: 0.75rem 1.25rem 0;
}

.staff-bar__logout {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.45rem 1.2rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent-dark);
  background: var(--surface);
  border: 2px solid var(--border-strong);
  text-decoration: none;
}

.staff-bar__logout:hover,
.staff-bar__logout:focus-visible {
  background: var(--bg);
  border-color: var(--accent);
  text-decoration: none;
}

.app-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

.app-main--wide {
  max-width: 1500px;
}

.page-title {
  font-size: 1.6rem;
  margin: 0 0 0.25rem;
}

.page-subtitle {
  color: var(--ink-soft);
  margin-top: 0;
}

/* --- Flash messages --- */

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

.flash-messages__item {
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1.05rem;
}

.flash-messages__item--success {
  background: var(--success-bg);
  color: var(--success-ink);
  border: 2px solid var(--success-ink);
}

.flash-messages__item--error {
  background: var(--danger-bg);
  color: var(--danger-ink);
  border: 2px solid var(--danger-ink);
}

/* --- Buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.7rem 1.3rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-contrast);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background: var(--accent-dark);
}

.btn--secondary {
  background: var(--surface);
  color: var(--accent-dark);
  border-color: var(--border-strong);
}

.btn--secondary:hover,
.btn--secondary:focus-visible {
  background: var(--bg);
}

.btn--danger {
  background: var(--danger-ink);
  color: #fff;
}

.btn--large {
  min-height: 56px;
  font-size: 1.2rem;
  padding: 0.9rem 1.6rem;
}

/* --- Login --- */

.login-page {
  max-width: 420px;
  margin: 3rem auto;
  text-align: center;
}

.login-page__title {
  font-size: 1.7rem;
  margin-bottom: 0.25rem;
}

.login-page__subtitle {
  color: var(--ink-soft);
  margin-top: 0;
}

.login-page__lockout {
  background: var(--danger-bg);
  color: var(--danger-ink);
  padding: 1rem;
  border-radius: var(--radius);
  font-weight: 600;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 1.5rem;
}

.login-form__label {
  font-weight: 600;
  text-align: left;
}

.login-form__input {
  font-size: 2rem;
  padding: 0.9rem;
  border-radius: var(--radius);
  border: 2px solid var(--border-strong);
  text-align: center;
  letter-spacing: 0.15em;
}

.login-form__error {
  color: var(--danger-ink);
  font-weight: 600;
}

.login-form__submit {
  margin-top: 0.5rem;
}

/* --- Home / find-a-record --- */

.finder-form {
  max-width: 700px;
}

.finder-form__columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem 2.5rem;
}

.finder-form__column {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.finder-form__column label {
  font-weight: 600;
  font-size: 1.05rem;
}

.finder-form__column input {
  font-size: 1.4rem;
  padding: 0.8rem;
  border-radius: var(--radius);
  border: 2px solid var(--border-strong);
  min-height: 56px;
}

.finder-form__submit {
  align-self: flex-start;
  margin-top: 0.25rem;
}

.finder-form__admin {
  margin-top: 1.75rem;
}

/* --- Landing / entry form --- */

.entry-form__section {
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem 1.2rem;
  margin: 0 0 1.25rem;
}

.entry-form__section legend {
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0 0.4rem;
}

.entry-form__section select {
  width: 100%;
  font-size: 1.6rem;
  padding: 0.8rem;
  border-radius: var(--radius);
  border: 2px solid var(--border-strong);
  min-height: 56px;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.checkbox-tile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem;
  border: 2px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 1.05rem;
  cursor: pointer;
  background: var(--surface);
}

.checkbox-tile:has(input:checked) {
  background: var(--success-bg);
  border-color: var(--success-ink);
}

.checkbox-tile input[type="checkbox"] {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.employee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.employee-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-height: 72px;
  padding: 0.9rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
}

.employee-tile:hover,
.employee-tile:focus-visible {
  border-color: var(--accent);
  background: var(--bg);
}

.employee-tile__license {
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.entry-form__manual {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  border-top: 1px dashed var(--border-strong);
  padding-top: 1rem;
}

.entry-form__manual label {
  width: 100%;
  font-weight: 600;
}

.entry-form__manual input[type="text"] {
  flex: 1;
  min-width: 180px;
  font-size: 1.2rem;
  padding: 0.7rem;
  border-radius: var(--radius);
  border: 2px solid var(--border-strong);
  min-height: 44px;
}

.field-error {
  color: var(--danger-ink);
  font-weight: 600;
}

.field-error--form {
  font-size: 1.1rem;
}

.all-records-link {
  margin-top: 0.5rem;
}

/* --- Chair index --- */

.chair-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.9rem;
}

.chair-card {
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  overflow: hidden;
}

.chair-card__link {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.1rem;
  text-decoration: none;
  color: var(--ink);
  min-height: 44px;
}

.chair-card__number {
  font-size: 1.3rem;
  font-weight: 700;
}

.chair-card__status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.status-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chair-card--ok {
  background: var(--success-bg);
}

.chair-card--ok .status-dot {
  background: var(--success-ink);
}

.chair-card--ok .chair-card__status {
  color: var(--success-ink);
}

.chair-card--missing {
  background: var(--danger-bg);
}

.chair-card--missing .status-dot {
  background: var(--danger-ink);
  /* Shape difference (ring) so the indicator isn't color-only */
  box-shadow: 0 0 0 3px var(--danger-bg), 0 0 0 5px var(--danger-ink);
}

.chair-card--missing .chair-card__status {
  color: var(--danger-ink);
}

/* --- Compliance record (TDLR form) --- */

.record-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.record-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tdlr-record {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 3rem;
}

.tdlr-record__header {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  flex-wrap: wrap;
  border-bottom: 3px solid var(--ink);
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}

.tdlr-record__logo {
  width: 88px;
  height: 88px;
  flex-shrink: 0;
}

.tdlr-record__agency-name {
  font-weight: 700;
  font-size: 1.55rem;
  margin: 0;
}

.tdlr-record__contact {
  font-size: 1rem;
  color: var(--ink-soft);
  margin: 0.4rem 0 0;
  line-height: 1.6;
}

.tdlr-record__program {
  text-align: center;
  font-size: 1.7rem;
  font-weight: 700;
  margin: 1.25rem 0;
}

.tdlr-record__banner {
  background: #1a1a1a;
  color: #fff;
  font-weight: 700;
  font-size: 1.3rem;
  text-align: center;
  padding: 1.1rem 1.5rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
}

.tdlr-record__banner em {
  font-style: italic;
  font-weight: 400;
}

.tdlr-info-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.tdlr-info-table th,
.tdlr-info-table td {
  border: 1px solid var(--ink);
  padding: 0.9rem 1.25rem;
  text-align: left;
  vertical-align: middle;
}

.tdlr-info-table th {
  font-weight: 700;
  background: var(--bg);
  white-space: nowrap;
}

.table-scroll {
  overflow-x: auto;
}

.tdlr-table,
.admin-table,
.lookup-summary-table,
.lookup-entries-table {
  width: 100%;
  border-collapse: collapse;
}

.tdlr-table th,
.tdlr-table td,
.admin-table th,
.admin-table td,
.lookup-summary-table th,
.lookup-summary-table td,
.lookup-entries-table th,
.lookup-entries-table td {
  border: 1px solid var(--border-strong);
  padding: 0.5rem 0.6rem;
  text-align: center;
  vertical-align: middle;
}

.tdlr-table th,
.tdlr-table td {
  padding: 0.9rem 1rem;
  font-size: 1.05rem;
}

.tdlr-table thead th {
  background: #1a1a1a;
  color: #fff;
}

.admin-table thead th {
  background: var(--accent);
  color: var(--accent-contrast);
}

.tdlr-table tbody tr:nth-child(even),
.admin-table tbody tr:nth-child(even) {
  background: var(--bg);
}

.tdlr-table__num-col {
  width: 2.2rem;
}

.tdlr-table__subnote {
  font-weight: 400;
  font-size: 0.75em;
  opacity: 0.85;
}

.tdlr-table__license {
  display: block;
  font-size: 0.85em;
  color: var(--ink-soft);
}

.tdlr-record__footer {
  margin-top: 1.75rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.tdlr-record__footer-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.tdlr-record__retention-note {
  text-align: center;
  color: var(--danger-ink);
  font-weight: 700;
  font-size: 1.05rem;
  margin: 1rem 0 0;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  font-weight: 600;
}

/* --- Lookup --- */

.lookup-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}

.lookup-form label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
}

.lookup-form input {
  min-height: 44px;
  font-size: 1.1rem;
  padding: 0.5rem;
  border-radius: var(--radius);
  border: 2px solid var(--border-strong);
}

.lookup-not-found {
  color: var(--danger-ink);
  font-weight: 600;
}

/* --- Admin panel --- */

.admin-breadcrumb {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  text-decoration: none;
}

.admin-breadcrumb:hover,
.admin-breadcrumb:focus-visible {
  text-decoration: underline;
}

.admin-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.admin-page-header .page-title {
  margin: 0;
}

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.9rem;
  margin: 1.25rem 0 1.5rem;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1.1rem 1.2rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--ink);
}

.stat-card:hover,
.stat-card:focus-visible {
  border-color: var(--accent);
}

.stat-card--warn {
  background: var(--danger-bg);
  border-color: var(--danger-ink);
}

.stat-card__number {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.stat-card__label {
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.95rem;
}

.stat-card--warn .stat-card__label {
  color: var(--danger-ink);
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.admin-panel__section {
  margin-bottom: 2rem;
}

.chip-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}

.chip--warn {
  background: var(--danger-bg);
  color: var(--danger-ink);
  border: 2px solid var(--danger-ink);
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
}

.status-badge--active {
  background: var(--success-bg);
  color: var(--success-ink);
}

.status-badge--inactive {
  background: var(--border);
  color: var(--ink-soft);
}

.empty-state {
  color: var(--ink-soft);
  padding: 1rem 0;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 480px;
}

.admin-form__field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.admin-form__field input,
.admin-form__field select,
.admin-form__field textarea {
  width: 100%;
  min-height: 44px;
  font-size: 1.1rem;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius);
  border: 2px solid var(--border-strong);
  font-family: inherit;
}

.admin-form__note {
  background: var(--bg);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  color: var(--ink-soft);
}

.admin-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* --- Small screens --- */

@media (max-width: 480px) {
  body {
    font-size: 16px;
  }

  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .tdlr-record {
    padding: 1rem;
  }
}
