/* Hamilton's Teahouse Manager — Abi handover lift */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;0,700;1,500&family=Karla:wght@400;500;600;700&display=swap');

.tm-root {
  font-family: 'Karla', system-ui, sans-serif;
  color: #21453a;
  background: #f1ece0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.tm-root a { color: #21453a; text-decoration: none; transition: color 0.2s ease; }
.tm-root a:hover { color: #c2a15c; }

.tm-wrap { max-width: 1240px; margin: 0 auto; padding: 0 28px; }
.tm-header {
  background: #16302a;
  color: #f5efe1;
  padding: 16px 28px;
}
.tm-header-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.tm-header-brand { display: flex; align-items: center; gap: 18px; min-width: 0; flex: 1 1 auto; }
.tm-header-brand > div { min-width: 0; overflow: hidden; }
.tm-header-logo { height: 48px; width: auto; }
.tm-header-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
}
.tm-header-sub {
  font-size: 12.5px;
  color: #a9c0b3;
  letter-spacing: 0.06em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(100%, 220px);
}
.tm-header-link {
  color: #dce6df;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tm-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 28px 0 0;
}
.tm-stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 10px 30px -24px rgba(22, 48, 42, 0.7);
}
.tm-stat-label {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 11.5px;
  font-weight: 700;
  color: #6a7f74;
  margin-bottom: 8px;
}
.tm-stat-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 38px;
  font-weight: 700;
  line-height: 1;
}

.tm-tabs-row { padding: 26px 0 10px; }
.tm-tabs {
  display: flex;
  gap: 8px;
  background: #fff;
  border-radius: 999px;
  padding: 6px;
  width: fit-content;
  box-shadow: 0 10px 30px -26px rgba(22, 48, 42, 0.7);
}
.tm-tab {
  border: none;
  cursor: pointer;
  padding: 12px 24px;
  border-radius: 999px;
  font-family: 'Karla', sans-serif;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 13px;
  transition: all 0.2s ease;
  background: transparent;
  color: #4a6156;
}
.tm-tab.is-active { background: #21453a; color: #f5efe1; }

.tm-section { padding: 18px 0 60px; }

.tm-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.tm-day-nav { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tm-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1.5px solid rgba(33, 69, 58, 0.25);
  background: #fff;
  color: #21453a;
  font-size: 16px;
  cursor: pointer;
}
.tm-diary-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
}
.tm-diary-sub { font-size: 12.5px; color: #6a7f74; letter-spacing: 0.04em; }
.tm-btn-ghost {
  background: transparent;
  border: 1.5px solid rgba(33, 69, 58, 0.25);
  color: #21453a;
  font-family: 'Karla', sans-serif;
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
}
.tm-btn-ghost:hover { background: rgba(33, 69, 58, 0.06); }
.tm-btn-slot {
  text-transform: none;
  letter-spacing: 0.02em;
}

.tm-view-pills {
  display: flex;
  gap: 4px;
  background: #fff;
  border-radius: 999px;
  padding: 4px;
  box-shadow: 0 10px 30px -26px rgba(22, 48, 42, 0.7);
}
.tm-view-pill {
  border: none;
  cursor: pointer;
  font-family: 'Karla', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 20px;
  border-radius: 999px;
  background: transparent;
  color: #4a6156;
}
.tm-view-pill.is-active { background: #21453a; color: #f5efe1; }

.tm-btn-primary {
  background: #21453a;
  color: #f5efe1;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 13px 24px;
  border-radius: 999px;
  text-transform: uppercase;
  font-size: 12.5px;
  border: none;
  cursor: pointer;
}
.tm-btn-primary:hover { background: #16302a; }
/* Links styled as buttons ("Open voucher to print", "Download"): .tm-root a would otherwise win. */
.tm-root a.tm-btn-primary,
.tm-root a.tm-btn-primary:hover { color: #f5efe1; display: inline-block; text-decoration: none; }
.tm-root a.tm-btn-ghost,
.tm-root a.tm-btn-ghost:hover { color: #21453a; display: inline-block; text-decoration: none; }
.tm-btn-brass {
  background: #c2a15c;
  color: #16302a;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 14px 26px;
  border-radius: 999px;
  text-transform: uppercase;
  font-size: 12.5px;
  border: none;
  cursor: pointer;
}
.tm-btn-brass:hover { background: #d4b774; }
.tm-btn-green { background: #2f7a52; color: #fff; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-size: 11.5px; padding: 11px 18px; border-radius: 999px; border: none; cursor: pointer; }
.tm-btn-danger-outline {
  background: transparent;
  color: #8a4a4a;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 11.5px;
  padding: 11px 16px;
  border-radius: 999px;
  border: 1.5px solid rgba(138, 74, 74, 0.4);
  cursor: pointer;
}

.tm-day-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  margin-bottom: 20px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.tm-day-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  min-width: 82px;
  padding: 12px 10px;
  border-radius: 12px;
  cursor: pointer;
  font-family: 'Karla', sans-serif;
  border: 1.5px solid rgba(33, 69, 58, 0.18);
  background: #fff;
  color: #21453a;
}
.tm-day-chip.is-active { border-color: #21453a; background: #21453a; color: #f5efe1; }
.tm-day-chip.is-closed { border-color: rgba(33, 69, 58, 0.12); background: #efeadf; color: #8b978e; }
.tm-day-chip-dow { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.75; }
.tm-day-chip-dom { font-family: 'Cormorant Garamond', serif; font-size: 24px; font-weight: 700; line-height: 1; }
.tm-day-chip-meta { font-size: 11.5px; opacity: 0.8; }
.tm-day-chip-wait { font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: #c2a15c; font-weight: 700; }

.tm-shift-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}
.tm-shift-card {
  background: #fff;
  border-radius: 14px;
  padding: 18px 22px;
  box-shadow: 0 10px 30px -24px rgba(22, 48, 42, 0.7);
}
.tm-shift-label {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  color: #6a7f74;
  margin-bottom: 6px;
}
.tm-shift-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
}
.tm-shift-note { font-size: 12.5px; color: #6a7f74; margin-top: 4px; }

.tm-panel {
  background: #fff;
  border-radius: 14px;
  padding: 26px;
  margin-bottom: 22px;
  box-shadow: 0 10px 30px -26px rgba(22, 48, 42, 0.7);
}
.tm-panel-accent-green { border-left: 5px solid #21453a; }
.tm-panel-accent-brass { border-left: 5px solid #c2a15c; }

.tm-field-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6a7f74;
  margin-bottom: 8px;
}
.tm-input,
.tm-select {
  box-sizing: border-box; /* width 100% includes padding and border, so boxes stay inside their card */
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid rgba(33, 69, 58, 0.25);
  border-radius: 10px;
  font-size: 15px;
  background: #fff;
  color: #21453a;
  font-family: 'Karla', sans-serif;
}
.tm-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tm-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.tm-step-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1.5px solid rgba(33, 69, 58, 0.3);
  background: #faf6ec;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  color: #21453a;
}
.tm-step-btn:disabled { color: rgba(33, 69, 58, 0.3); cursor: default; }

.tm-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
}

.tm-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 30px -26px rgba(22, 48, 42, 0.7);
  overflow: hidden;
}
.tm-card-head {
  display: grid;
  gap: 12px;
  padding: 16px 24px;
  background: #21453a;
  color: #f5efe1;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}
.tm-card-row {
  display: grid;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(33, 69, 58, 0.1);
  align-items: center;
  font-size: 14.5px;
}
.tm-card-row:last-child { border-bottom: none; }

.tm-timeline-head { display: grid; grid-template-columns: 150px minmax(0, 1fr); background: #21453a; color: #f5efe1; }
.tm-timeline-head-label { padding: 14px 18px; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; }
.tm-timeline-slots { display: grid; }
.tm-timeline-slot-label { padding: 14px 0; text-align: center; font-size: 11px; letter-spacing: 0.06em; font-weight: 700; border-left: 1px solid rgba(245, 239, 225, 0.14); }
.tm-timeline-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); border-bottom: 1px solid rgba(33, 69, 58, 0.1); align-items: stretch; }
.tm-timeline-row-label { padding: 14px 18px; }
.tm-timeline-track { display: grid; padding: 6px 0; min-height: 52px; }
.tm-block {
  margin: 2px 3px;
  padding: 8px 10px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  font-size: 13px;
}
.tm-block-meta { font-size: 11.5px; opacity: 0.85; }

.tm-block-pending { background: #fff; color: #21453a; border: 1.5px dashed #c2a15c; }
.tm-block-offered { background: #fff; color: #21453a; border: 1.5px dashed #8a6a2a; }
.tm-block-awaiting { background: #dce8f0; color: #1f4159; border: 1.5px solid #4a7fa5; }
.tm-block-paid { background: #21453a; color: #f5efe1; border: 1.5px solid #21453a; }
.tm-block-seated { background: #2f7a52; color: #fff; border: 1.5px solid #2f7a52; }
.tm-block-finished { background: #e8e4da; color: #4a6156; border: 1.5px solid #cfc8b8; }
.tm-block-noshow { background: #fbf2f2; color: #8a4a4a; border: 1.5px dashed #b98484; }
.tm-block-declined { background: #f3e6e6; color: #8a4a4a; border: 1.5px solid #d8bcbc; }

.tm-request-card {
  background: #fff;
  border-radius: 14px;
  padding: 24px 26px;
  box-shadow: 0 10px 30px -26px rgba(22, 48, 42, 0.7);
  border-left: 5px solid #c2a15c;
  margin-bottom: 14px;
}
.tm-request-name { font-family: 'Cormorant Garamond', serif; font-size: 24px; font-weight: 700; }
.tm-muted { color: #6a7f74; font-size: 13px; line-height: 1.6; }
.tm-empty { padding: 40px 24px; text-align: center; color: #6a7f74; font-size: 15px; }
.tm-notice-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f6ecd4;
  color: #5c4513;
  border-left: 5px solid #c2a15c;
  padding: 14px 20px 14px 22px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-weight: 600;
}
.tm-switch-row { display: flex; align-items: center; gap: 16px; margin-top: 18px; }
.tm-switch {
  position: relative;
  flex: none;
  width: 56px;
  height: 32px;
  border-radius: 999px;
  border: 1.5px solid rgba(33, 69, 58, 0.35);
  background: #e6e1d3;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease;
}
.tm-switch.is-on { background: #21453a; border-color: #21453a; }
.tm-switch:disabled { opacity: 0.6; cursor: progress; }
.tm-switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease;
}
.tm-switch.is-on .tm-switch-knob { transform: translateX(24px); }
.tm-error-banner { background: #f3e6e6; color: #8a4a4a; padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; }

.tm-confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(22, 48, 42, 0.55);
}
.tm-confirm-panel {
  width: min(100%, 420px);
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 24px 60px -28px rgba(22, 48, 42, 0.75);
}
.tm-confirm-message { font-size: 15px; line-height: 1.55; margin: 0 0 20px; }
.tm-confirm-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

.tm-timeline-row-unassigned .tm-timeline-row-label { color: #8a6a2a; }
.tm-timeline-row-unassigned .tm-timeline-track { background: rgba(194, 161, 92, 0.08); border-radius: 10px; }

.tm-month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.tm-month-cell {
  min-height: 96px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  border: 1.5px solid rgba(33, 69, 58, 0.15);
  background: #fff;
  color: #21453a;
}
.tm-month-cell.is-active { border-color: #21453a; background: #21453a; color: #f5efe1; }
.tm-month-cell.is-closed { border-color: rgba(33, 69, 58, 0.12); background: #efeadf; color: #8b978e; }
.tm-month-cell.is-busy { border-color: rgba(33, 69, 58, 0.2); background: #e4ecdf; }

.tm-login {
  max-width: 480px;
  margin: 4rem auto;
  padding: 2rem;
  text-align: center;
}

@media (max-width: 900px) {
  .tm-stats,
  .tm-shift-stats { grid-template-columns: repeat(2, 1fr); }
  .tm-grid-3,
  .tm-grid-4 { grid-template-columns: 1fr; }
  .tm-wrap { padding: 0 16px; }
  .tm-header { padding: 16px; }
}

/* Staff tables (diary list, tables, hours) keep fixed-width columns, which overlap on large
   phones and narrow windows. Stack them there too, not only at 390px and under. */
@media (max-width: 700px) {
  .tm-card-head,
  .tm-card-row { grid-template-columns: 1fr !important; }
}

/* Gift vouchers table: six columns squash and overlap below desktop width (tablets, narrow
   windows), so each voucher becomes a small labelled card instead. */
@media (max-width: 900px) {
  .tm-voucher-head { display: none !important; }
  .tm-voucher-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; row-gap: 12px; }
  .tm-voucher-row > :first-child,
  .tm-voucher-row > :last-child { grid-column: 1 / -1; }
  .tm-voucher-row [data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #6a7f74;
  }
}

@media (max-width: 390px) {
  .tm-stats,
  .tm-shift-stats { grid-template-columns: 1fr; }
  .tm-tabs { flex-wrap: wrap; width: 100%; border-radius: 14px; }
  .tm-tab { flex: 1; text-align: center; padding: 10px 12px; font-size: 11px; }
  .tm-toolbar { flex-direction: column; align-items: stretch; }
  .tm-view-pills { flex-wrap: wrap; }
  .tm-header-inner { gap: 12px; }
  .tm-header-link { font-size: 11px; letter-spacing: 0.04em; }
  .tm-header-sub { max-width: 140px; }
  .tm-day-strip {
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
  }
  .tm-day-chip { min-width: 72px; padding: 10px 8px; }
  .tm-timeline-head,
  .tm-timeline-row { grid-template-columns: 100px minmax(0, 1fr); }
  .tm-card-head,
  .tm-card-row { grid-template-columns: 1fr !important; }
  .tm-request-card { padding: 18px 16px; }
}
