/* Luster Team – dark bar theme built from the Luster palette (bordeaux, rosé, cream from the logo). */

@font-face {
  font-family: 'Red Hat Display';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('/assets/fonts/red-hat-display-latin.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;
}
@font-face {
  font-family: 'Red Hat Display';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('/assets/fonts/red-hat-display-latin-ext.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;
}

:root {
  --bordeaux: #6d071a;
  --bordeaux-deep: #3e0410;
  --bordeaux-bright: #8e1028;
  --rose: #f2c2c2;
  --rose-ink: #4a0e0e;
  --cream: #fffbe8;
  --coral: #ec5c48;
  --red: #b92525;

  --bg: #0e0a0b;
  --surface: #171112;
  --surface-2: #201718;
  --surface-3: #2b1f21;
  --line: rgba(255, 251, 232, 0.09);
  --line-strong: rgba(255, 251, 232, 0.18);
  --text: #fffbe8;
  --text-2: rgba(255, 251, 232, 0.7);
  --text-3: rgba(255, 251, 232, 0.48);

  --ok: #8fc9a3;
  --warn: #e8b86a;
  --danger: #ec5c48;
  --info: #9fb8e0;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  --sidebar-w: 248px;
  --tabbar-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* No double-tap zoom when tapping the same key quickly (PIN pad, steppers); pinch zoom stays available. */
html,
body,
button,
a,
label,
input,
select,
textarea,
summary {
  touch-action: manipulation;
}

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(109, 7, 26, 0.45), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Red Hat Display', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.45;
  font-feature-settings: 'tnum' 0;
}

img,
svg {
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--rose);
  text-decoration: none;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  line-height: 1.2;
}

p {
  margin: 0;
}

.num {
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--text-2);
}

.faint {
  color: var(--text-3);
}

.small {
  font-size: 0.875rem;
}

.tiny {
  font-size: 0.78rem;
}

.mt {
  margin-top: 12px;
}

.person-head {
  margin-bottom: 16px;
}

.person-head h2 {
  font-size: 1.25rem;
  font-weight: 500;
}

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

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

.icon {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sm {
  width: 18px;
  height: 18px;
}

/* ---------- Boot ---------- */

.boot {
  min-height: 100dvh;
  display: grid;
  place-items: center;
}

.boot-glass {
  height: 120px;
  width: auto;
  opacity: 0.85;
  animation: glow 1.6s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    opacity: 0.45;
    transform: translateY(2px);
  }
  to {
    opacity: 0.95;
    transform: translateY(-2px);
  }
}

/* ---------- Shell ---------- */

.shell {
  min-height: 100dvh;
  /* Nothing may push the page sideways on phones (clip keeps sticky headers working). */
  overflow-x: clip;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(10px + var(--safe-t)) 16px 10px;
  background: linear-gradient(180deg, rgba(14, 10, 11, 0.96), rgba(14, 10, 11, 0.82));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar-logo {
  height: 30px;
  width: auto;
}

.main {
  padding: 18px 16px calc(var(--tabbar-h) + var(--safe-b) + 28px);
  max-width: 1080px;
  margin: 0 auto;
}

.tabbar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: rgba(23, 6, 11, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(242, 194, 194, 0.12);
}

.tabbar.tabs-4 {
  grid-template-columns: repeat(4, 1fr);
}

.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-3);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

.tab .icon {
  width: 24px;
  height: 24px;
}

.tab[aria-current='page'] {
  color: var(--rose);
}

.tab[aria-current='page']::before {
  content: '';
  position: absolute;
  top: 0;
  width: 28px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--rose);
}

.badge-dot {
  position: absolute;
  top: 9px;
  left: calc(50% + 8px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--coral);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.sidebar {
  display: none;
}

@media (min-width: 960px) {
  .topbar,
  .tabbar {
    display: none;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    padding: 28px 18px 22px;
    background:
      radial-gradient(140% 50% at 0% 0%, rgba(236, 92, 72, 0.18), transparent 60%),
      linear-gradient(180deg, var(--bordeaux) 0%, var(--bordeaux-deep) 100%);
    border-right: 1px solid rgba(242, 194, 194, 0.12);
  }

  .sidebar-logo {
    width: 160px;
    height: auto;
    margin: 0 0 34px 10px;
  }

  .side-nav {
    display: grid;
    gap: 4px;
  }

  .side-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 14px;
    border-radius: 12px;
    color: rgba(255, 251, 232, 0.72);
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
  }

  .side-link:hover {
    background: rgba(255, 251, 232, 0.06);
    color: var(--cream);
  }

  .side-link[aria-current='page'] {
    background: rgba(242, 194, 194, 0.16);
    color: var(--cream);
  }

  .side-link .badge-dot {
    position: static;
    margin-left: auto;
  }

  .side-user {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.22);
  }

  .main {
    margin-left: var(--sidebar-w);
    padding: 36px 40px 60px;
    max-width: none;
  }

  .main > * {
    max-width: 1040px;
  }
}

/* ---------- Page header ---------- */

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.eyebrow {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--rose);
}

.page-title {
  font-size: clamp(1.6rem, 4.5vw, 2.2rem);
  font-weight: 300;
  letter-spacing: 0.04em;
}

.section-title {
  margin: 28px 0 12px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-3);
}

.head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Cards & lists ---------- */

.card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.card + .card {
  margin-top: 12px;
}

.card-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.grid-2 {
  display: grid;
  gap: 12px;
}

.grid-2 > * {
  min-width: 0;
}

@media (min-width: 720px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.list {
  display: grid;
  gap: 8px;
}

.item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
  transition: border-color 0.2s, background 0.2s;
}

button.item {
  cursor: pointer;
}

button.item:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.item-main {
  flex: 1;
  min-width: 0;
}

.item-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-sub {
  margin-top: 2px;
  color: var(--text-2);
  font-size: 0.875rem;
}

.item-end {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
}

.item.dim {
  opacity: 0.55;
}

.empty {
  padding: 30px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--text-2);
  text-align: center;
}

.empty .icon {
  margin: 0 auto 10px;
  width: 30px;
  height: 30px;
  color: var(--text-3);
}

.day-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 18px 4px 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
}

.day-label:first-child {
  margin-top: 0;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.12s, opacity 0.2s;
  white-space: nowrap;
}

@media (hover: hover) {
  .btn:hover {
    background: rgba(255, 251, 232, 0.06);
  }
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

.btn-primary {
  background: var(--rose);
  border-color: var(--rose);
  color: var(--rose-ink);
}

.btn-primary:hover {
  background: #f7d3d3;
}

.btn-wine {
  background: var(--bordeaux);
  border-color: var(--bordeaux-bright);
  color: var(--cream);
}

.btn-wine:hover {
  background: var(--bordeaux-bright);
}

.btn-danger {
  border-color: rgba(236, 92, 72, 0.5);
  color: var(--coral);
}

.btn-danger:hover {
  background: rgba(236, 92, 72, 0.12);
}

.btn-ok {
  border-color: rgba(143, 201, 163, 0.45);
  color: var(--ok);
}

.btn-ok:hover {
  background: rgba(143, 201, 163, 0.1);
}

.btn-ghost {
  border-color: transparent;
  color: var(--text-2);
}

.btn-sm {
  min-height: 36px;
  padding: 0 14px;
  font-size: 0.86rem;
}

.btn-lg {
  min-height: 56px;
  padding: 0 26px;
  font-size: 1.05rem;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 44px;
  padding: 0;
}

.btn-icon.btn-sm {
  width: 36px;
}

.btn[aria-busy='true'] {
  opacity: 0.7;
  pointer-events: none;
}

.fab {
  position: fixed;
  right: 18px;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px);
  z-index: 25;
  box-shadow: var(--shadow);
}

@media (min-width: 960px) {
  .fab {
    display: none;
  }
}

/* ---------- Pills & avatars ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 251, 232, 0.07);
  color: var(--text-2);
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
}

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

.pill.plain::before {
  display: none;
}

.pill.ok {
  background: rgba(143, 201, 163, 0.12);
  color: var(--ok);
}

.pill.warn {
  background: rgba(232, 184, 106, 0.13);
  color: var(--warn);
}

.pill.danger {
  background: rgba(236, 92, 72, 0.13);
  color: var(--coral);
}

.pill.info {
  background: rgba(159, 184, 224, 0.13);
  color: var(--info);
}

.pill.rose {
  background: rgba(242, 194, 194, 0.14);
  color: var(--rose);
}

.avatar {
  --c: var(--red);
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  background: color-mix(in srgb, var(--c) 28%, var(--surface-2));
  border: 1.5px solid color-mix(in srgb, var(--c) 70%, transparent);
  color: var(--cream);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.avatar.sm {
  width: 30px;
  height: 30px;
  font-size: 0.7rem;
}

.avatar.lg {
  width: 56px;
  height: 56px;
  font-size: 1.05rem;
}

.swatch {
  --c: var(--red);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--c);
  flex: none;
}

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

.form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 6px;
}

.form > *,
.field > *,
.row-2 > *,
.row-3 > * {
  min-width: 0;
}

.seg.seg-wrap {
  flex-wrap: wrap;
}

.seg.seg-wrap label {
  flex: 1 1 40%;
}

.field > span,
.field-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-2);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.textarea {
  min-height: 84px;
  resize: vertical;
}

.select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fffbe8' stroke-opacity='.6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(242, 194, 194, 0.18);
}

.input[aria-invalid='true'],
.select[aria-invalid='true'],
.textarea[aria-invalid='true'] {
  border-color: var(--coral);
}

.input::-webkit-calendar-picker-indicator {
  filter: invert(0.9);
  opacity: 0.6;
}

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

.field-hint {
  color: var(--text-3);
  font-size: 0.8rem;
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  cursor: pointer;
}

.check input {
  appearance: none;
  position: relative;
  width: 46px;
  height: 28px;
  flex: none;
  margin: 0;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  cursor: pointer;
  transition: background 0.2s;
}

.check input::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text-2);
  transition: transform 0.2s var(--ease), background 0.2s;
}

.check input:checked {
  background: var(--bordeaux-bright);
  border-color: var(--rose);
}

.check input:checked::after {
  transform: translateX(18px);
  background: var(--rose);
}

.seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.seg::-webkit-scrollbar {
  display: none;
}

.seg button,
.seg label {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.seg [aria-pressed='true'],
.seg label:has(input:checked) {
  background: var(--rose);
  color: var(--rose-ink);
}

.seg label:has(input:focus-visible) {
  outline: 2px solid var(--rose);
  outline-offset: 1px;
}

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.weekdays label {
  display: grid;
  place-items: center;
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.weekdays input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.weekdays label:has(input:checked) {
  background: var(--bordeaux);
  border-color: var(--rose);
  color: var(--cream);
}

.weekdays label:has(input:focus-visible) {
  outline: 2px solid var(--rose);
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.swatches label {
  --c: var(--red);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--c);
  border: 3px solid transparent;
  box-shadow: 0 0 0 1px var(--line-strong);
  cursor: pointer;
}

.swatches input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.swatches label:has(input:checked) {
  border-color: var(--bg);
  box-shadow: 0 0 0 2px var(--cream);
}

.stepper {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  gap: 8px;
  align-items: center;
}

.stepper .input {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-2);
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
}

.chip[aria-pressed='true'] {
  background: rgba(242, 194, 194, 0.16);
  border-color: var(--rose);
  color: var(--rose);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin-top: 6px;
}

.form-actions .spacer {
  flex: 1;
}

.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(232, 184, 106, 0.1);
  border: 1px solid rgba(232, 184, 106, 0.25);
  color: var(--warn);
  font-size: 0.88rem;
}

.notice.info {
  background: rgba(242, 194, 194, 0.08);
  border-color: rgba(242, 194, 194, 0.2);
  color: var(--text-2);
}

.notice.danger {
  background: rgba(236, 92, 72, 0.1);
  border-color: rgba(236, 92, 72, 0.3);
  color: var(--coral);
}

/* ---------- Sheet (dialog) ---------- */

dialog.sheet {
  width: 100%;
  max-width: 100%;
  max-height: 92dvh;
  margin: auto 0 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  border-top: 1px solid rgba(242, 194, 194, 0.18);
  overflow: hidden;
}

dialog.sheet[open] {
  display: flex;
  flex-direction: column;
  animation: sheet-up 0.28s var(--ease);
}

dialog.sheet::backdrop {
  background: rgba(5, 2, 3, 0.66);
  backdrop-filter: blur(3px);
}

@keyframes sheet-up {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--line);
}

.sheet-head h2 {
  font-size: 1.15rem;
  font-weight: 600;
}

.sheet-body {
  padding: 18px 20px calc(22px + var(--safe-b));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* Only up and down: nothing in a form may slide sideways. */
  touch-action: pan-y;
}

/* While a dialog is open the page behind it stays put. */
html:has(dialog[open]) {
  overflow: hidden;
}

/* Phones: forms become a full-screen page with a fixed header and a save bar that never scrolls away. */
@media (max-width: 719px) {
  dialog.sheet.full {
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
    border-top: 0;
  }

  dialog.sheet.full[open] {
    animation: page-in 0.2s var(--ease);
  }

  dialog.sheet.full .sheet-head {
    padding-top: calc(14px + var(--safe-t));
  }

  dialog.sheet.full .sheet-body {
    flex: 1;
    padding-bottom: 0;
  }

  dialog.sheet.full .form-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    flex-wrap: nowrap;
    margin: 6px -20px 0;
    padding: 12px 20px calc(12px + var(--safe-b));
    background: var(--surface);
    border-top: 1px solid var(--line);
  }

  dialog.sheet.full .form-actions .btn {
    flex: 1;
    min-height: 52px;
  }

  dialog.sheet.full .form-actions .btn-primary {
    flex: 2;
  }

  dialog.sheet.full .form-actions .spacer {
    display: none;
  }
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

/* iOS draws date/time inputs wider than their box unless told otherwise. */
input[type='date'].input,
input[type='time'].input {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  min-width: 0;
}

.input::-webkit-date-and-time-value {
  text-align: left;
}

/* ---------- Reservation form ---------- */

.date-pick {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.date-pick .chip,
.time-grid .chip {
  min-height: 46px;
  font-size: 0.95rem;
}

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

.time-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.time-grid .chip {
  padding: 0;
  font-variant-numeric: tabular-nums;
}

.other-time {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 4px;
  color: var(--text-2);
  font-size: 0.85rem;
  font-weight: 600;
}

.stepper.stepper-lg {
  grid-template-columns: 56px minmax(0, 1fr) 56px;
}

.stepper-lg .btn-icon {
  width: 56px;
  min-height: 52px;
}

.stepper-lg .input {
  min-height: 52px;
  font-size: 1.3rem;
}

.more-fields > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--text-2);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.more-fields > summary::-webkit-details-marker {
  display: none;
}

.more-fields > summary .icon {
  transition: transform 0.2s;
}

.more-fields[open] > summary .icon {
  transform: rotate(90deg);
}

.more-fields > .form {
  margin-top: 8px;
}

.danger-link {
  justify-self: start;
  color: var(--coral);
}

@media (min-width: 720px) {
  dialog.sheet {
    width: min(560px, calc(100% - 48px));
    margin: auto;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(242, 194, 194, 0.18);
  }

  dialog.sheet.wide {
    width: min(760px, calc(100% - 48px));
  }

  dialog.sheet[open] {
    animation: pop 0.22s var(--ease);
  }

  @keyframes pop {
    from {
      transform: scale(0.97);
      opacity: 0;
    }
  }
}

/* ---------- Toast & offline ---------- */

.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 18px);
  z-index: 100;
  display: grid;
  gap: 8px;
  width: min(420px, calc(100% - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}

@media (min-width: 960px) {
  .toasts {
    left: calc(50% + var(--sidebar-w) / 2);
    bottom: 28px;
  }
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-radius: 14px;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  font-size: 0.92rem;
  font-weight: 500;
  animation: toast-in 0.25s var(--ease);
}

.toast.ok .icon {
  color: var(--ok);
}

.toast.error {
  border-color: rgba(236, 92, 72, 0.45);
}

.toast.error .icon {
  color: var(--coral);
}

.toast.out {
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.25s;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

.offline {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 8px 16px;
  background: var(--warn);
  color: #2a1a00;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
}

/* ---------- Login ---------- */

.login {
  min-height: 100dvh;
  overflow-x: clip;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: calc(18px + var(--safe-t)) 16px calc(24px + var(--safe-b));
  background:
    radial-gradient(90% 55% at 50% 0%, rgba(236, 92, 72, 0.22), transparent 60%),
    linear-gradient(180deg, var(--bordeaux) 0%, var(--bordeaux-deep) 55%, var(--bg) 100%);
}

.login-top {
  display: flex;
  justify-content: flex-end;
}

.login-center {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 26px;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.login-logo {
  width: min(240px, 64vw);
  height: auto;
}

.login-tagline {
  margin-top: -12px;
  font-size: 0.76rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(255, 251, 232, 0.6);
}

.login-card {
  width: 100%;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: rgba(14, 10, 11, 0.62);
  border: 1px solid rgba(242, 194, 194, 0.16);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.login-card h2 {
  margin-bottom: 14px;
  font-size: 1.05rem;
  font-weight: 500;
  text-align: center;
}

.recent {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.recent button {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 14px 6px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 251, 232, 0.03);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}

.recent button:hover {
  border-color: var(--rose);
}

.pin-who {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  min-height: 18px;
  margin: 18px 0 20px;
}

.pin-dots span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 251, 232, 0.5);
  transition: background 0.15s, transform 0.15s;
}

.pin-dots span.on {
  background: var(--rose);
  border-color: var(--rose);
  transform: scale(1.08);
}

.pin-dots.shake {
  animation: shake 0.4s;
}

@keyframes shake {
  20%,
  60% {
    transform: translateX(-8px);
  }
  40%,
  80% {
    transform: translateX(8px);
  }
}

.pinpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.pinpad button {
  height: 64px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 251, 232, 0.05);
  font-size: 1.5rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, transform 0.08s;
}

.pinpad button:active {
  background: rgba(242, 194, 194, 0.2);
  transform: scale(0.96);
}

.pinpad .key-ok {
  background: var(--rose);
  border-color: var(--rose);
  color: var(--rose-ink);
  font-size: 1rem;
  font-weight: 700;
}

.pinpad .key-fn {
  display: grid;
  place-items: center;
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
}

.login-error {
  min-height: 20px;
  margin-top: 12px;
  color: var(--rose);
  text-align: center;
  font-size: 0.9rem;
}

/* ---------- Home ---------- */

.greet {
  margin-bottom: 20px;
}

.greet h1 {
  font-size: clamp(1.7rem, 5vw, 2.3rem);
  font-weight: 300;
}

.greet p {
  margin-top: 4px;
  color: var(--text-2);
}

.clock-card {
  position: relative;
  overflow: hidden;
  padding: 24px 20px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(90% 90% at 100% 0%, rgba(236, 92, 72, 0.28), transparent 60%),
    linear-gradient(160deg, var(--bordeaux) 0%, var(--bordeaux-deep) 100%);
  border: 1px solid rgba(242, 194, 194, 0.22);
  text-align: center;
}

.clock-card::after {
  content: '';
  position: absolute;
  right: -18px;
  bottom: -26px;
  width: 120px;
  height: 200px;
  background: url('/assets/glass.png') center / contain no-repeat;
  opacity: 0.09;
  transform: rotate(12deg);
  pointer-events: none;
}

.clock-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 251, 232, 0.8);
}

.clock-state::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-3);
}

.clock-state.on::before {
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(143, 201, 163, 0.2);
  animation: pulse 1.8s infinite;
}

.clock-state.pause::before {
  background: var(--warn);
}

@keyframes pulse {
  50% {
    box-shadow: 0 0 0 7px rgba(143, 201, 163, 0);
  }
}

.clock-time {
  margin: 16px 0 4px;
  font-size: clamp(3rem, 14vw, 4.4rem);
  font-weight: 300;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.clock-sub {
  min-height: 1.4em;
  color: rgba(255, 251, 232, 0.7);
  font-size: 0.92rem;
}

.clock-actions {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.clock-actions.two {
  grid-template-columns: 1fr 1fr;
}

.clock-actions .btn {
  min-height: 58px;
  font-size: 1.05rem;
}

.btn.btn-clock-in {
  background: var(--rose);
  border-color: var(--rose);
  color: var(--rose-ink);
}

.btn.btn-clock-out {
  background: var(--cream);
  border-color: var(--cream);
  color: var(--bordeaux-deep);
}

.btn.btn-pause {
  background: rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 251, 232, 0.25);
}

@media (hover: hover) {
  .btn.btn-clock-in:hover {
    background: #f7d3d3;
  }

  .btn.btn-clock-out:hover {
    background: #fff;
  }

  .btn.btn-pause:hover {
    background: rgba(0, 0, 0, 0.35);
  }
}

.home-grid {
  margin-top: 14px;
  align-items: start;
}

.home-grid.no-clock {
  margin-top: 0;
}

.home-grid .notice {
  margin-top: 12px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 720px) {
  .stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}

.stat-label {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.stat-value {
  margin-top: 4px;
  font-size: 1.5rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.stat-value.pos {
  color: var(--ok);
}

.stat-value.neg {
  color: var(--coral);
}

.stat-hint {
  margin-top: 2px;
  color: var(--text-3);
  font-size: 0.76rem;
}

.mini-res {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.mini-res:first-of-type {
  border-top: 0;
}

.mini-time {
  width: 52px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.people {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.person {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 0.9rem;
}

/* ---------- Month switcher / filters ---------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.toolbar .select {
  width: auto;
  min-width: 180px;
  min-height: 44px;
}

.toolbar .input[type='date'] {
  width: auto;
  min-height: 44px;
  padding-block: 8px;
}

.switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.switcher-label {
  min-width: 132px;
  text-align: center;
  font-weight: 600;
}

.switcher-date {
  width: 150px;
  min-height: 36px;
  padding: 0 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  text-align: center;
}

.switcher-date::-webkit-calendar-picker-indicator {
  filter: invert(0.9);
  opacity: 0.6;
}

@media (max-width: 380px) {
  .switcher-date {
    width: 120px;
  }

  .toolbar [data-today] {
    padding: 0 12px;
  }
}

@media (max-width: 959px) {
  .desktop-only {
    display: none !important;
  }
}

/* ---------- Time entries ---------- */

.entry-times {
  font-size: 1.05rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.entry-net {
  font-size: 1.05rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.warn-icon {
  color: var(--warn);
}

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

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

.table th,
.table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.table th {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.table td.n,
.table th.n {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr.click {
  cursor: pointer;
}

.table tbody tr.click:hover {
  background: var(--surface-2);
}

.pos {
  color: var(--ok);
}

.neg {
  color: var(--coral);
}

/* ---------- Absences ---------- */

.balance {
  display: flex;
  align-items: center;
  gap: 18px;
}

.balance-ring {
  --p: 0;
  position: relative;
  width: 96px;
  height: 96px;
  flex: none;
  border-radius: 50%;
  background: conic-gradient(var(--rose) calc(var(--p) * 1%), rgba(255, 251, 232, 0.08) 0);
  display: grid;
  place-items: center;
}

.balance-ring::before {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--surface-2);
}

.balance-ring strong {
  position: relative;
  font-size: 1.7rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.balance-facts {
  display: grid;
  grid-template-columns: auto auto;
  gap: 2px 16px;
  font-size: 0.9rem;
}

.balance-facts dt {
  color: var(--text-2);
}

.balance-facts dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.type-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 12px;
  background: rgba(242, 194, 194, 0.1);
  color: var(--rose);
}

.type-icon.sick {
  background: rgba(236, 92, 72, 0.12);
  color: var(--coral);
}

.type-icon.comp {
  background: rgba(159, 184, 224, 0.12);
  color: var(--info);
}

.type-icon.other {
  background: rgba(232, 184, 106, 0.12);
  color: var(--warn);
}

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

.cal {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.78rem;
}

.cal th,
.cal td {
  padding: 0;
  text-align: center;
}

.cal thead th {
  position: sticky;
  top: 0;
  height: 44px;
  min-width: 28px;
  background: var(--surface);
  color: var(--text-3);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}

.cal thead th small {
  display: block;
  font-size: 0.64rem;
  font-weight: 500;
}

.cal thead th.today {
  color: var(--rose);
}

.cal th.who {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 120px;
  padding: 0 12px;
  background: var(--surface);
  text-align: left;
  color: var(--text);
  font-weight: 600;
  font-size: 0.85rem;
  border-right: 1px solid var(--line);
  white-space: nowrap;
}

.cal tbody td {
  height: 38px;
  min-width: 28px;
  border-bottom: 1px solid var(--line);
}

.cal tbody tr:last-child td,
.cal tbody tr:last-child th {
  border-bottom: 0;
}

.cal td.off {
  background: rgba(255, 251, 232, 0.025);
}

.cal td.today {
  box-shadow: inset 1px 0 0 rgba(242, 194, 194, 0.35), inset -1px 0 0 rgba(242, 194, 194, 0.35);
}

.cal .cell {
  display: block;
  height: 24px;
  margin: 0 2px;
  border-radius: 6px;
}

.cal button.cell {
  width: calc(100% - 4px);
  padding: 0;
  border: 0;
  cursor: pointer;
}

.cal button.cell.pending {
  border: 1.5px dashed currentColor;
}

.icon-xs {
  width: 12px;
  height: 12px;
  stroke-width: 2.2;
}

.cell.vacation {
  background: var(--rose);
}

.cell.sick {
  background: var(--coral);
}

.cell.comp {
  background: var(--info);
}

.cell.other {
  background: var(--warn);
}

.cell.pending {
  background: transparent !important;
  border: 1.5px dashed currentColor;
}

.cell.pending.vacation {
  color: var(--rose);
}

.cell.pending.comp {
  color: var(--info);
}

.cell.pending.other {
  color: var(--warn);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
  color: var(--text-2);
  font-size: 0.8rem;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  display: inline-block;
  width: 14px;
  height: 10px;
  border-radius: 3px;
}

/* ---------- Reservations ---------- */

/* One week that always fits the screen: no sideways swiping. */
.datestrip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}

.date-chip {
  display: grid;
  justify-items: center;
  gap: 1px;
  min-width: 0;
  padding: 8px 2px 7px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.date-chip .wd {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
}

.date-chip .d {
  font-size: 1.15rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.date-chip .g {
  min-height: 1.1em;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--rose);
}

@media (min-width: 720px) {
  .datestrip {
    gap: 10px;
  }

  .date-chip {
    padding: 10px 6px 9px;
    border-radius: 16px;
  }

  .date-chip .wd {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
  }

  .date-chip .d {
    font-size: 1.3rem;
  }
}

.date-chip.closed {
  opacity: 0.5;
}

.date-chip.today .wd {
  color: var(--rose);
}

.date-chip[aria-pressed='true'] {
  background: var(--bordeaux);
  border-color: var(--rose);
}

.date-chip[aria-pressed='true'] .wd,
.date-chip[aria-pressed='true'] .g {
  color: var(--cream);
}

.capacity {
  height: 6px;
  margin-top: 10px;
  border-radius: 999px;
  background: rgba(255, 251, 232, 0.08);
  overflow: hidden;
}

.capacity span {
  display: block;
  height: 100%;
  width: var(--w, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rose), var(--coral));
}

.res {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}

.res.dim {
  opacity: 0.5;
}

.res.arrived {
  border-color: rgba(143, 201, 163, 0.35);
}

.res-time {
  font-size: 1.3rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.res-time small {
  display: block;
  margin-top: 4px;
  color: var(--text-3);
  font-size: 0.72rem;
  font-weight: 500;
}

.res-name {
  font-weight: 600;
  font-size: 1.02rem;
  word-break: break-word;
}

.res-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-top: 4px;
  color: var(--text-2);
  font-size: 0.86rem;
}

.res-meta span,
.res-meta a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.res-notes {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 251, 232, 0.04);
  color: var(--text-2);
  font-size: 0.86rem;
  font-style: italic;
  white-space: pre-wrap;
  word-break: break-word;
}

.res-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.res-summary {
  padding: 14px 16px;
}

/* Phones: two columns, buttons pinned top right, tighter type. */
@media (max-width: 600px) {
  .res {
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 2px 10px;
    padding: 12px;
  }

  .res-time {
    font-size: 1.08rem;
  }

  .res-time small {
    margin-top: 3px;
    font-size: 0.68rem;
  }

  .res-name {
    min-height: 36px;
    padding-right: 82px;
    font-size: 0.98rem;
  }

  .res-meta {
    gap: 4px 10px;
    font-size: 0.82rem;
  }

  .res-notes {
    margin-top: 6px;
    padding: 6px 8px;
    font-size: 0.82rem;
  }

  .res-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    flex-direction: row;
    gap: 6px;
  }

  .res-actions .btn {
    width: 36px;
    min-height: 36px;
    padding: 0;
  }

  .res-btn-label {
    display: none;
  }

  .res-summary {
    padding: 12px 14px;
  }

  /* “confirmed” is the normal case; only arrived / no-show / cancelled need a label on a small screen. */
  .res .pill.is-confirmed,
  .res-by {
    display: none;
  }

  .page-head {
    margin-bottom: 14px;
  }

  .page-title {
    font-size: 1.5rem;
  }
}

/* Room under the last card so the floating “Neu” button never covers it. */
@media (max-width: 959px) {
  .has-fab {
    padding-bottom: 76px;
  }
}

.search {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}

.search .input {
  padding-left: 44px;
  min-height: 44px;
  border-radius: 999px;
}

/* ---------- Team ---------- */

.member-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 3px;
  color: var(--text-2);
  font-size: 0.84rem;
}

/* ---------- Settings / more ---------- */

.profile {
  display: flex;
  align-items: center;
  gap: 16px;
}

.menu {
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.menu > * {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
  font-weight: 500;
  cursor: pointer;
}

.menu > *:last-child {
  border-bottom: 0;
}

.menu > *:hover {
  background: var(--surface-2);
}

.menu .chev {
  margin-left: auto;
  color: var(--text-3);
}

details.card > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
}

details.card > summary::-webkit-details-marker {
  display: none;
}

details.card[open] > summary {
  margin-bottom: 14px;
}

details.card > summary .icon {
  transition: transform 0.2s;
}

details.card[open] > summary .icon {
  transform: rotate(90deg);
}

.log {
  display: grid;
  gap: 0;
  font-size: 0.86rem;
}

.log div {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.log div:first-child {
  border-top: 0;
}

.app-foot {
  margin-top: 36px;
  color: var(--text-3);
  font-size: 0.78rem;
  text-align: center;
}

/* ---------- Loading ---------- */

.loading {
  display: grid;
  place-items: center;
  min-height: 40vh;
}

.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid rgba(242, 194, 194, 0.2);
  border-top-color: var(--rose);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Print (Monatsbericht) ---------- */

.print-only {
  display: none;
}

@media print {
  body {
    background: #fff;
    color: #000;
  }

  .sidebar,
  .topbar,
  .tabbar,
  .fab,
  .toolbar,
  .head-actions,
  .toasts,
  .no-print {
    display: none !important;
  }

  .main {
    margin: 0;
    padding: 0;
  }

  .print-only {
    display: block;
  }

  .print-title {
    margin-bottom: 12px;
    font-size: 1.1rem;
    font-weight: 600;
  }

  .card,
  .item,
  .stat,
  .table-wrap {
    background: #fff;
    border-color: #ccc;
    color: #000;
  }

  .muted,
  .faint,
  .item-sub,
  .stat-label {
    color: #444;
  }
}
