/* GoYoga Teacher App - brand tokens + Apple-inspired interaction model */
:root {
  --linen: #faf9f6;
  --cream: #f2efe9;
  --sand: #8a7055;
  --sand-deep: #6f5944;
  --ink: #282420;
  --ash: #6b6057;
  --clay: #e8e2da;
  --lotus: #db2777;
  --lotus-deep: #be185d;
  --petal: #fdf2f8;
  --pink-100: #fce7f3;
  --pink-200: #fbcfe8;
  --pink-700: #be185d;
  --pink-800: #9d174d;
  --gray-50: #f5f5f7;
  --gray-100: #ebebef;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --ok: #3d6b4f;
  --danger: #b54a4a;
  --warn: #b45309;
  --surface: #ffffff;
  --grouped: #f2efe9;
  --separator: rgba(60, 60, 67, 0.12);
  --shadow-sm: 0 1px 2px rgba(40, 36, 32, 0.04);
  --shadow: 0 8px 28px rgba(40, 36, 32, 0.08);
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --tap: 48px;
  --nav-h: calc(52px + env(safe-area-inset-bottom, 0px));
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--grouped);
}

h1, h2, h3, h4, h5, h6,
.brand,
.panel-title,
.auth-title,
.auth-request-title,
.home-greeting,
.side-brand,
.large-title {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}

a {
  color: var(--lotus);
  text-decoration: none;
}
a:hover { color: var(--lotus-deep); }

/* --- Auth --- */
body.auth {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 80% 50% at 0% 0%, rgba(138, 112, 85, 0.1), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(219, 39, 119, 0.05), transparent 50%),
    var(--linen);
}

body.auth::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("/logo-mark.png");
  background-repeat: no-repeat;
  background-position: 78% 22%;
  background-size: min(48vw, 300px);
  opacity: 0.06;
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  margin: auto;
  padding: 2.5rem 1.25rem 3rem;
  animation: rise 0.55s var(--ease) both;
}

.auth-kicker {
  display: inline-block;
  margin: 0 0 0.75rem;
  padding: 0.28rem 0.75rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pink-700);
  background: var(--pink-100);
  border-radius: var(--radius-pill);
}

.auth-title {
  margin: 0;
  font-weight: 400;
  font-size: clamp(2.2rem, 7vw, 2.7rem);
  line-height: 1.05;
}

.auth-lede {
  margin: 0.65rem 0 0;
  color: var(--ash);
  font-size: 1.05rem;
  max-width: 28ch;
}

.auth-panel {
  margin-top: 1.6rem;
  padding: 1.35rem 1.2rem 1.25rem;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(232, 226, 218, 0.8);
}

label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ash);
  margin-bottom: 0.35rem;
}

input, select, textarea {
  width: 100%;
  background: var(--gray-50);
  border: 1px solid transparent;
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 0.85rem 0.9rem;
  margin-bottom: 0.85rem;
  font: inherit;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  background: #fff;
  border-color: rgba(219, 39, 119, 0.35);
  box-shadow: 0 0 0 4px rgba(219, 39, 119, 0.1);
}
textarea { min-height: 120px; resize: vertical; }

.auth-actions,
.row {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  align-items: center;
}

button, .btn {
  appearance: none;
  border: 0;
  border-radius: var(--radius-pill);
  min-height: 44px;
  padding: 0.7rem 1.2rem;
  background: var(--gray-900);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: transform 0.12s var(--ease), background 0.2s var(--ease), opacity 0.2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
button:hover, .btn:hover { background: var(--lotus); }
button:active, .btn:active { transform: scale(0.98); }
button.secondary, .btn.secondary {
  background: var(--surface);
  color: var(--lotus);
  border: 1px solid var(--pink-200);
}
button.secondary:hover, .btn.secondary:hover {
  background: var(--petal);
  color: var(--lotus-deep);
}
button.danger { background: var(--danger); color: #fff; }
button.ok-btn { background: var(--ok); color: #fff; }
button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.full-btn { width: 100%; margin-top: 0.5rem; }

.err { color: var(--danger); font-size: 0.9rem; margin: 0.4rem 0 0; min-height: 1.2em; }
.ok { color: var(--ok); }
.meta { color: var(--ash); font-size: 0.9rem; margin: 0; }
.lede { color: var(--ash); font-size: 1.02rem; margin: 0 0 1.1rem; max-width: 36ch; }

.auth-request {
  margin-top: 1.75rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--clay);
}
.auth-request-title {
  margin: 0;
  font-weight: 400;
  font-size: 1.35rem;
}
.auth-request-lede {
  margin: 0.35rem 0 1rem;
  color: var(--ash);
}
.auth-request .optional { font-weight: 400; text-transform: none; letter-spacing: 0; }
.auth-request-ok { margin: 0.55rem 0 0; }

.hold-btn {
  position: relative;
  overflow: hidden;
  user-select: none;
  touch-action: none;
  min-width: 11.5rem;
  background: var(--lotus);
}
.hold-btn:hover { background: var(--lotus-deep); }
.hold-btn-progress {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: rgba(255, 255, 255, 0.28);
  pointer-events: none;
}
.hold-btn.is-holding .hold-btn-progress { animation: holdFill 10s linear forwards; }
.hold-btn-label { position: relative; z-index: 1; }
.auth-hold-hint { margin: 0.55rem 0 0; color: var(--ash); font-size: 0.88rem; max-width: 36ch; }
@keyframes holdFill { from { width: 0%; } to { width: 100%; } }

.auth-foot { margin: 1.25rem 0 0; font-size: 0.85rem; color: var(--ash); }
.auth-back { display: inline-block; margin-top: 0.35rem; font-size: 0.95rem; font-weight: 500; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 480px) {
  .auth-actions { flex-direction: column; align-items: stretch; }
  .auth-actions .btn, .auth-actions button { width: 100%; }
}

/* --- App shell --- */
body.app-body {
  min-height: 100dvh;
  background: var(--grouped);
}

.app-frame {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.app-main {
  flex: 1;
  min-width: 0;
  width: 100%;
}

.app-top {
  max-width: 720px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem 0.35rem;
  animation: rise 0.4s var(--ease) both;
}

.app-brand-mobile {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.65rem;
}
.app-logo-mobile {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}
.app-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 0.1rem;
}
.app-brand-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1;
}
.app-role-mobile {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ash);
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-transform: capitalize;
}
.app-top.is-home .app-eyebrow,
.app-top.is-home .large-title,
.app-top.is-home .sub {
  display: none;
}
.app-top.is-home {
  padding-bottom: 0.15rem;
}
.app-top.is-home .app-brand-mobile {
  margin-bottom: 0;
}

.session-banner {
  position: sticky;
  top: 0;
  z-index: 25;
  padding: 0.65rem 1rem;
  background: rgba(255, 244, 214, 0.94);
  border-bottom: 1px solid rgba(255, 159, 10, 0.35);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  animation: rise 0.35s var(--ease) both;
}
.session-banner-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}
.session-banner-copy {
  flex: 1 1 16rem;
  min-width: 0;
}
.session-banner-copy strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 650;
  color: #7a4b00;
  letter-spacing: -0.01em;
}
.session-banner-copy p {
  margin: 0.2rem 0 0;
  font-size: 0.86rem;
  color: #8a5a10;
  line-height: 1.35;
}
.session-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.session-banner-primary {
  min-height: 36px;
  padding: 0.4rem 0.85rem;
  border-radius: 10px;
  background: #ff9f0a;
  color: #1c1200;
  font-size: 0.85rem;
  font-weight: 650;
  box-shadow: none;
}
.session-banner-primary:hover { background: #f09500; color: #1c1200; }
.session-banner-primary:disabled { opacity: 0.65; }
.session-banner-dismiss {
  min-height: 36px;
  padding: 0.4rem 0.7rem;
  border-radius: 10px;
  background: transparent;
  color: #7a4b00;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: none;
}
.session-banner-dismiss:hover {
  background: rgba(255, 159, 10, 0.18);
  color: #7a4b00;
}

.app-eyebrow {
  margin: 0 0 0.15rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ash);
}

.large-title {
  margin: 0;
  font-size: clamp(1.85rem, 6vw, 2.15rem);
  font-weight: 400;
  line-height: 1.1;
  color: var(--ink);
}

.sub {
  margin: 0.25rem 0 0;
  color: var(--ash);
  font-size: 0.92rem;
}

.wrap,
.app-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0.35rem 1rem calc(var(--nav-h) + 1.25rem);
}

/* Groups + inset lists (iOS Settings pattern) */
.group {
  margin: 0 0 1.35rem;
}

.group-label {
  margin: 0 0 0.45rem;
  padding: 0 0.85rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ash);
}

.group-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
  padding: 0 0.2rem;
}
.group-label-row .group-label {
  margin: 0;
  padding: 0 0.65rem;
}

.text-btn {
  background: transparent;
  color: var(--lotus);
  border: 0;
  min-height: auto;
  padding: 0.25rem 0.5rem;
  font-weight: 600;
  font-size: 0.92rem;
  box-shadow: none;
}
.text-btn:hover { background: transparent; color: var(--lotus-deep); }

.inset-list {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(232, 226, 218, 0.7);
}

.inset-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
  background: transparent;
  color: inherit;
  border: 0;
  border-radius: 0;
  min-height: var(--tap);
  padding: 0.85rem 1rem;
  font: inherit;
  cursor: pointer;
  box-shadow: none;
  border-bottom: 1px solid var(--separator);
  transition: background 0.15s var(--ease);
}
.inset-row:last-child { border-bottom: 0; }
.inset-row:hover { background: rgba(219, 39, 119, 0.04); color: inherit; }
.inset-row:active { background: rgba(219, 39, 119, 0.08); transform: none; }

.inset-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.inset-copy strong {
  font-weight: 600;
  font-size: 1rem;
}
.inset-copy .meta { font-size: 0.86rem; }

.inset-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--gray-100);
  color: var(--ink);
}
.inset-icon.accent {
  background: var(--pink-100);
  color: var(--lotus);
}
.inset-icon.warn {
  background: #fff7ed;
  color: var(--warn);
}
.inset-icon svg {
  width: 17px;
  height: 17px;
  display: block;
}

.row-chevron {
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid #c7c7cc;
  border-bottom: 2px solid #c7c7cc;
  transform: rotate(-45deg);
  flex-shrink: 0;
  margin-left: 0.15rem;
}

.row-check {
  width: 1.15rem;
  height: 0.55rem;
  border-left: 2.5px solid transparent;
  border-bottom: 2.5px solid transparent;
  transform: rotate(-45deg);
  flex-shrink: 0;
  margin: 0 0.2rem 0.25rem 0.35rem;
  opacity: 0;
  transition: opacity 0.12s var(--ease), border-color 0.12s var(--ease);
}
.select-row.is-selected .row-check {
  border-left-color: var(--lotus);
  border-bottom-color: var(--lotus);
  opacity: 1;
}
.select-row.is-selected .inset-copy strong {
  color: var(--ink);
}
.inset-static-row {
  cursor: default;
}
.inset-static-row:hover,
.inset-static-row:active {
  background: transparent;
  transform: none;
}

.group-caption {
  margin: 0.45rem 0 0;
  padding: 0 0.85rem;
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--ash);
}

.field-row {
  gap: 0.55rem;
  cursor: default;
}
.field-row:hover,
.field-row:active {
  background: transparent;
  transform: none;
}
.field-row input[type='text'] {
  flex: 1;
  margin: 0;
  min-height: 36px;
  padding: 0.45rem 0;
  border: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}
.field-row input[type='text']:focus {
  outline: none;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.field-row .text-btn {
  flex-shrink: 0;
  padding: 0.25rem 0.15rem;
}

.restock-extra-list {
  margin-top: 0.55rem;
}

.form-cta-group {
  margin-top: 0.15rem;
}
.form-cta {
  width: 100%;
  min-height: 50px;
  border-radius: 12px;
  font-size: 1.02rem;
}
.inset-loading {
  padding: 0.85rem 1rem;
  margin: 0;
}

.inset-empty { padding: 1.25rem 1rem; }
.inset-static {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.inset-static strong { font-size: 1.05rem; }

.danger-row { color: var(--danger); }
.danger-row:hover { background: #fef2f2; color: var(--danger); }
.danger-row strong { color: var(--danger); }

.home-hero {
  padding: 0.15rem 0.35rem 1rem;
  animation: rise 0.45s var(--ease) both;
}
.home-greeting {
  margin: 0 0 0.35rem;
  font-size: clamp(1.75rem, 6vw, 2.2rem);
  font-weight: 400;
}

.toolbar-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 0.9rem;
}

.logs-search {
  display: block;
  margin: 0 0 0.9rem;
}
.logs-search input[type="search"] {
  width: 100%;
  margin: 0;
  min-height: 44px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid rgba(232, 226, 218, 0.9);
  box-shadow: var(--shadow-sm);
}
.logs-search input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  height: 14px;
  width: 14px;
  background: linear-gradient(45deg, transparent 46%, var(--ash) 46%, var(--ash) 54%, transparent 54%),
    linear-gradient(-45deg, transparent 46%, var(--ash) 46%, var(--ash) 54%, transparent 54%);
  cursor: pointer;
}

.logs-panel { padding: 0.85rem 0.9rem 1rem; }
.logs-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.75rem;
}
.logs-sev-filter { margin: 0 0 0.75rem; }
.segmented.seg-4 { grid-template-columns: repeat(4, 1fr); }
.segmented.seg-5 { grid-template-columns: repeat(5, 1fr); }
.logs-sev-filter button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  font-size: 0.72rem;
  padding-left: 0.2rem;
  padding-right: 0.2rem;
}
.sev-count {
  display: inline-flex;
  min-width: 1.1rem;
  justify-content: center;
  font-variant-numeric: tabular-nums;
  opacity: 0.72;
  font-size: 0.68rem;
}
.logs-summary { margin: 0 0 0.75rem; }
.logs-range,
.logs-density,
.logs-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0 0 0.75rem;
}
.logs-range-label { flex-shrink: 0; }
.logs-days-filter,
.logs-density-filter,
.logs-group-filter { flex: 1 1 12rem; min-width: 0; }
.segmented.seg-2 { grid-template-columns: repeat(2, 1fr); }
.logs-older-hint {
  margin: 0 0 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.5rem;
}
.logs-tz-note {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.85rem;
  margin: -0.35rem 0 1rem;
}
.logs-tz-now {
  font-variant-numeric: tabular-nums;
  color: var(--text, #1d1d1f);
}
.logs-tz-now time {
  font-weight: 600;
}

.sev-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.4rem;
  padding: 0.18rem 0.45rem;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
  flex-shrink: 0;
}
.sev-pill.sev-ok {
  background: rgba(52, 199, 89, 0.16);
  color: #1b7a38;
}
.sev-pill.sev-notice {
  background: rgba(255, 159, 10, 0.18);
  color: #9a5b00;
}
.sev-pill.sev-alert {
  background: rgba(255, 69, 58, 0.14);
  color: #c12b22;
}
.sev-pill.sev-critical {
  background: rgba(175, 82, 222, 0.16);
  color: #7a2ea3;
}

.log-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.log-day-break,
.log-user-break {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.85rem 0 0.2rem;
  padding: 0 0.1rem;
}
.log-day-break:first-child,
.log-user-break:first-child { margin-top: 0.15rem; }
.log-day-break::before,
.log-day-break::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--separator);
}
.log-user-break {
  margin-top: 1.15rem;
  padding: 0.35rem 0.15rem 0.15rem;
}
.log-user-break + .log-day-break { margin-top: 0.45rem; }
.log-day-label {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ash);
}
.log-user-label {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.log-user-label strong {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink, #1d1d1f);
}
.log-row {
  position: relative;
  padding: 0;
  border-radius: 12px;
  background: var(--gray-50);
  border: 1px solid var(--separator);
  border-left-width: 3px;
  animation: rise 0.28s var(--ease) both;
  overflow: hidden;
}
.log-row.sev-ok { border-left-color: #34c759; }
.log-row.sev-notice { border-left-color: #ff9f0a; }
.log-row.sev-alert { border-left-color: #ff453a; background: rgba(255, 69, 58, 0.04); }
.log-row.sev-critical {
  border-left-color: #af52de;
  background: rgba(175, 82, 222, 0.06);
}
.log-row-main {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  margin: 0;
  padding: 0.65rem 0.7rem 0.65rem 0.8rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
}
.log-row-main:hover {
  background: rgba(255, 255, 255, 0.45);
  color: inherit;
}
.log-feed.is-expanded-view .log-row-main { cursor: default; }
.log-compact-copy {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
  flex: 1;
}
.log-title {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.log-compact-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.65rem;
  margin: 0;
}
.log-user {
  font-weight: 500;
  color: var(--ink, #1d1d1f);
}
.log-device {
  color: var(--ash);
}
.log-expand-chevron {
  width: 0.55rem;
  height: 0.55rem;
  border-right: 1.5px solid var(--ash);
  border-bottom: 1.5px solid var(--ash);
  transform: rotate(-45deg);
  flex-shrink: 0;
  opacity: 0.55;
  transition: transform 0.15s ease;
  margin-right: 0.15rem;
}
.log-row.is-open .log-expand-chevron,
.log-feed.is-expanded-view .log-expand-chevron {
  transform: rotate(45deg);
}
.log-feed.is-expanded-view .log-expand-chevron { opacity: 0.35; }
.log-row-extra {
  padding: 0 0.75rem 0.7rem 0.85rem;
  border-top: 1px solid var(--separator);
}
.log-details {
  margin: 0.55rem 0 0;
  display: grid;
  gap: 0.35rem;
}
.log-detail-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.5rem;
  align-items: start;
}
.log-detail-row dt {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ash);
  padding-top: 0.12rem;
}
.log-detail-row dd {
  margin: 0;
  min-width: 0;
}
.log-detail-row code {
  display: block;
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  line-height: 1.35;
  word-break: break-all;
  white-space: pre-wrap;
  background: transparent;
  padding: 0;
}
.log-empty { padding: 0.85rem 0.25rem; }

@media (max-width: 420px) {
  .logs-sev-filter { grid-template-columns: repeat(3, 1fr); }
  .logs-sev-filter button[data-sev="critical"],
  .logs-sev-filter button[data-sev="all"] { grid-column: span 1; }
}

.segmented {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  padding: 2px;
  background: rgba(118, 118, 128, 0.12);
  border-radius: 9px;
}
.segmented button {
  min-height: 32px;
  padding: 0.35rem 0.3rem;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow: none;
}
.segmented button:hover { background: rgba(255, 255, 255, 0.35); color: var(--ink); }
.segmented button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-icon {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.35rem;
  background: var(--lotus);
  flex-shrink: 0;
}
.btn-icon:hover { background: var(--lotus-deep); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: var(--pink-100);
  color: var(--pink-700);
  flex-shrink: 0;
}
.badge.submitted { background: var(--petal); color: var(--pink-800); }
.badge.in_review { background: var(--cream); color: var(--sand-deep); }
.badge.in_progress { background: var(--cream); color: var(--sand-deep); }
.badge.approved, .badge.applied, .badge.resolved { background: #ecfdf3; color: var(--ok); }
.badge.rejected { background: #fef2f2; color: var(--danger); }

/* Panels used by forms / detail */
.panel,
.card {
  background: var(--surface);
  border: 1px solid rgba(232, 226, 218, 0.7);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  margin-bottom: 0.85rem;
  box-shadow: var(--shadow-sm);
}
.panel-title {
  font-weight: 400;
  font-size: 1.3rem;
  margin: 0 0 0.4rem;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.panel-head .panel-title { margin: 0; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 0.75rem;
}
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
}

.stack-form button { width: 100%; }

.expander {
  margin: 0 0 0.95rem;
  border: 1px solid var(--clay);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  background: var(--gray-50);
}
.expander summary { cursor: pointer; font-weight: 600; color: var(--lotus); }
.expander[open] summary { margin-bottom: 0.65rem; }
.expander-panel summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--ink);
}

.locale-block { border: 0; margin: 0 0 0.5rem; padding: 0; }
.locale-block legend {
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ash);
  margin-bottom: 0.4rem;
}

.sticky-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  position: sticky;
  bottom: calc(var(--nav-h) + 0.35rem);
  padding: 0.75rem 0 0.35rem;
  background: linear-gradient(180deg, rgba(242, 239, 233, 0), var(--grouped) 40%);
  z-index: 2;
}

.field-diff { display: grid; gap: 0.65rem; }
.diff-row {
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.8rem;
  background: var(--gray-50);
}
.diff-row.changed {
  border-color: var(--pink-200);
  background: var(--petal);
}
.diff-key {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ash);
  margin-bottom: 0.35rem;
}
.diff-vals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
@media (max-width: 560px) {
  .diff-vals { grid-template-columns: 1fr; }
}
.diff-label { display: block; font-size: 0.72rem; color: var(--ash); margin-bottom: 0.1rem; }
.diff-val { font-size: 0.92rem; white-space: pre-wrap; word-break: break-word; }
.status-live { margin: 0.75rem 0 0; color: var(--ok); font-weight: 600; }

.users-intro { margin: 0 0 0.85rem; padding: 0 0.35rem; }
.btn-sm { min-height: 36px; padding: 0.4rem 0.75rem; font-size: 0.85rem; }

.vitals-space-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.vitals-space {
  margin: 0;
  padding: 0;
  border: 1px solid rgba(232, 226, 218, 0.75);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.vitals-space-main {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  margin: 0;
  padding: 0.9rem 1rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
}
.vitals-space-main:hover {
  background: rgba(255, 255, 255, 0.55);
  color: inherit;
}
.vitals-space-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1;
}
.vitals-space-name {
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.vitals-space-summary {
  font-variant-numeric: tabular-nums;
}
.vitals-expand-chevron {
  width: 0.55rem;
  height: 0.55rem;
  border-right: 1.5px solid var(--ash);
  border-bottom: 1.5px solid var(--ash);
  transform: rotate(-45deg);
  flex-shrink: 0;
  opacity: 0.55;
  transition: transform 0.15s ease;
  margin-right: 0.15rem;
}
.vitals-space.is-open .vitals-expand-chevron {
  transform: rotate(45deg);
}
.vitals-space-extra {
  padding: 0 1rem 0.85rem;
  border-top: 1px solid var(--separator);
}
.vitals-metrics {
  margin: 0.7rem 0 0;
  display: grid;
  gap: 0.45rem;
}
.vitals-metric {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.5rem;
  align-items: baseline;
}
.vitals-metric dt {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ash);
}
.vitals-metric dd {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.vitals-updated {
  margin: 0.65rem 0 0;
}
.vitals-subhead {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ash);
}
.vitals-lights {
  margin-top: 0.95rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--separator);
}
.vitals-lights .vitals-subhead { margin-bottom: 0.45rem; }
.lights-space-block {
  margin: 0 0 1.1rem;
}
.lights-space-block .vitals-lights {
  margin-top: 0.35rem;
  padding-top: 0;
  border-top: 0;
}
.light-toggle-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.light-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: rgba(232, 226, 218, 0.35);
  border: 1px solid transparent;
}
.light-toggle-row.is-on {
  background: rgba(255, 214, 10, 0.16);
  border-color: rgba(255, 204, 0, 0.35);
}
.light-toggle-label {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.light-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
  cursor: pointer;
}
.light-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.light-switch-ui {
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: rgba(60, 60, 67, 0.22);
  position: relative;
  transition: background 0.15s ease;
}
.light-switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease;
}
.light-switch input:checked + .light-switch-ui {
  background: #34c759;
}
.light-switch input:checked + .light-switch-ui::after {
  transform: translateX(20px);
}
.light-switch input:disabled + .light-switch-ui {
  opacity: 0.55;
}
.vitals-windows {
  margin-top: 0.95rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--separator);
}
.vitals-windows .vitals-subhead { margin-bottom: 0.45rem; }
.windows-space-block {
  margin: 0 0 1.1rem;
}
.windows-space-block .vitals-windows {
  margin-top: 0.35rem;
  padding-top: 0;
  border-top: 0;
}
.window-toggle-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.window-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: rgba(232, 226, 218, 0.35);
  border: 1px solid transparent;
}
.window-toggle-row.is-open {
  background: rgba(10, 132, 255, 0.12);
  border-color: rgba(10, 132, 255, 0.28);
}
.window-toggle-label {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.window-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
  cursor: pointer;
}
.window-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.window-switch-ui {
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: rgba(60, 60, 67, 0.22);
  position: relative;
  transition: background 0.15s ease;
}
.window-switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease;
}
.window-switch input:checked + .window-switch-ui {
  background: #0a84ff;
}
.window-switch input:checked + .window-switch-ui::after {
  transform: translateX(20px);
}
.window-switch input:disabled + .window-switch-ui {
  opacity: 0.55;
}
.vitals-doors {
  margin-top: 0.95rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--separator);
}
.vitals-doors .vitals-subhead { margin-bottom: 0.45rem; }
.doors-space-block {
  margin: 0 0 1.1rem;
}
.doors-space-block .vitals-doors {
  margin-top: 0.35rem;
  padding-top: 0;
  border-top: 0;
}
.door-toggle-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.door-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: rgba(232, 226, 218, 0.35);
  border: 1px solid transparent;
}
.door-toggle-row.is-open {
  background: rgba(255, 69, 58, 0.1);
  border-color: rgba(255, 69, 58, 0.28);
}
.door-toggle-label {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.door-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
  cursor: pointer;
}
.door-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.door-switch-ui {
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: rgba(60, 60, 67, 0.22);
  position: relative;
  transition: background 0.15s ease;
}
.door-switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease;
}
.door-switch input:checked + .door-switch-ui {
  background: #ff453a;
}
.door-switch input:checked + .door-switch-ui::after {
  transform: translateX(20px);
}
.door-switch input:disabled + .door-switch-ui {
  opacity: 0.55;
}
.vitals-presence {
  margin-top: 0.95rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--separator);
}
.vitals-presence .vitals-subhead { margin-bottom: 0.45rem; }
.presence-entrance-block {
  margin: 0.35rem 0 1rem;
}
.presence-rooms-block {
  margin: 0.15rem 0 0;
}
.presence-space-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.presence-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: rgba(232, 226, 218, 0.35);
  border: 1px solid transparent;
}
.presence-toggle-row.is-present {
  background: rgba(52, 199, 89, 0.12);
  border-color: rgba(52, 199, 89, 0.32);
}
.presence-toggle-label {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.presence-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
  cursor: pointer;
}
.presence-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.presence-switch-ui {
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: rgba(60, 60, 67, 0.22);
  position: relative;
  transition: background 0.15s ease;
}
.presence-switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease;
}
.presence-switch input:checked + .presence-switch-ui {
  background: #34c759;
}
.presence-switch input:checked + .presence-switch-ui::after {
  transform: translateX(20px);
}
.presence-switch input:disabled + .presence-switch-ui {
  opacity: 0.55;
}

.ticket-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
}
.ticket-form .field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ash);
  margin: 0 0 0.35rem;
}
.ticket-form .inset-form label {
  display: block;
  margin-top: 0.75rem;
}
.ticket-form .inset-form label:first-child {
  margin-top: 0;
}
.ticket-form select,
.ticket-form textarea,
.ticket-actions + .field textarea,
#ticket-admin-note {
  width: 100%;
  border: 1px solid var(--separator);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  margin: 0;
  font: inherit;
  background: var(--gray-50);
  color: var(--ink);
}
.ticket-form select:focus,
.ticket-form textarea:focus,
#ticket-admin-note:focus {
  outline: none;
  background: #fff;
  border-color: rgba(219, 39, 119, 0.35);
  box-shadow: 0 0 0 4px rgba(219, 39, 119, 0.1);
}
.ticket-form textarea { resize: vertical; min-height: 4.5rem; }
#ticket-filter {
  margin-bottom: 0.65rem;
}
.ticket-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.55rem;
}
.ticket-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.ticket-timeline li {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: rgba(232, 226, 218, 0.35);
}

.keybox-code-panel {
  padding: 0.85rem 0.2rem 0.35rem;
}
.keybox-code {
  margin: 0 0 0.45rem;
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink);
  word-break: break-all;
}
.keybox-access-list {
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.keybox-access-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: rgba(232, 226, 218, 0.35);
  border: 1px solid transparent;
}
.keybox-access-row.is-on {
  background: rgba(52, 199, 89, 0.12);
  border-color: rgba(52, 199, 89, 0.32);
}
.keybox-access-label {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.wifi-network {
  margin-bottom: 0.25rem;
}
.wifi-creds {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0.65rem 0 0.85rem;
}
.wifi-cred-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr auto;
  gap: 0.35rem 0.65rem;
  align-items: center;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: rgba(232, 226, 218, 0.35);
}
.wifi-ssid,
.wifi-pass {
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 1rem;
  word-break: break-all;
}
.wifi-qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  margin: 0.35rem 0 0.75rem;
  padding: 1rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--separator);
}
.wifi-qr {
  width: min(220px, 70vw);
}
.wifi-qr svg {
  display: block;
  width: 100%;
  height: auto;
}
.wifi-student .wifi-qr-wrap {
  border-color: rgba(52, 199, 89, 0.35);
}
.wifi-edit-form {
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--separator);
}
.wifi-edit-form:last-child {
  border-bottom: 0;
  margin-bottom: 0;
}

.people-group .group-label {
  padding-left: 1rem;
  padding-right: 1rem;
}
.people-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.people-card {
  background: var(--surface);
  border: 1px solid rgba(232, 226, 218, 0.7);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 0.95rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
}
.people-card-main {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  text-align: left;
}
.people-card-name {
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.people-card-meta {
  margin: 0;
  text-align: left;
  word-break: break-word;
}
.people-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  padding-top: 0.15rem;
  border-top: 1px solid var(--separator);
}
.people-card-focus {
  border-color: rgba(255, 159, 10, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 159, 10, 0.18), var(--shadow-sm);
  background: rgba(255, 244, 214, 0.55);
}

.admin-task-table-wrap {
  overflow-x: auto;
  margin-top: 0.35rem;
  border: 1px solid var(--separator);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.admin-task-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 28rem;
}
.admin-task-table th,
.admin-task-table td {
  text-align: left;
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--separator);
  vertical-align: middle;
}
.admin-task-table tr:last-child td { border-bottom: 0; }
.admin-task-table th {
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ash);
  background: rgba(242, 239, 233, 0.55);
}
.admin-task-space {
  display: block;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.admin-task-table-sub {
  display: block;
  margin-top: 0.15rem;
  max-width: 22ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-task-age {
  white-space: nowrap;
  color: var(--ash);
  font-variant-numeric: tabular-nums;
}
.admin-task-open-cell {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

/* Phones only: stack rows so the list fits without sideways scroll. */
@media (max-width: 560px) {
  .admin-task-table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  .admin-task-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
  }
  .admin-task-table thead {
    display: none;
  }
  .admin-task-table tbody {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
  }
  .admin-task-table tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 0.55rem;
    row-gap: 0.3rem;
    padding: 0.8rem 0.85rem;
    border: 1px solid var(--separator);
    border-radius: var(--radius-sm);
    background: var(--surface);
  }
  .admin-task-table td {
    border: 0;
    padding: 0;
  }
  .admin-task-main {
    flex: 1 1 calc(100% - 4.75rem);
    min-width: 0;
    order: 1;
  }
  .admin-task-open-cell {
    flex: 0 0 auto;
    width: auto;
    order: 2;
    align-self: start;
  }
  .admin-task-age {
    flex: 0 0 auto;
    order: 3;
  }
  .admin-task-status-cell {
    flex: 0 0 auto;
    order: 4;
  }
  .admin-task-table-sub {
    max-width: none;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }
}

.admin-task-modal {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: calc(100vw - 1.5rem);
  width: min(28rem, 100%);
}
.admin-task-modal::backdrop {
  background: rgba(40, 36, 32, 0.45);
}
.admin-task-modal-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.admin-task-modal-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--separator);
}
.admin-task-modal-head h2 {
  margin: 0;
  flex: 1;
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.admin-task-modal-head .icon-btn {
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ash);
  border: 1px solid transparent;
  font-size: 1.35rem;
  line-height: 1;
}
.admin-task-modal-head .icon-btn:hover {
  background: rgba(242, 239, 233, 0.9);
  color: var(--ink);
}
.admin-task-modal-body {
  padding: 1rem;
  max-height: min(70vh, 36rem);
  overflow: auto;
}
.admin-task-modal-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.65rem;
}
.admin-task-modal-body .lede {
  margin-bottom: 0.65rem;
}
.admin-task-modal-items {
  margin: 0 0 0.65rem;
  padding-left: 1.1rem;
}
.admin-task-modal-items li { margin: 0.15rem 0; }
.admin-task-modal-update,
.admin-task-modal-progress {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--separator);
}
.admin-task-modal-update .group-label,
.admin-task-modal-progress .group-label {
  margin-bottom: 0.55rem;
}
.admin-task-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.collapse-panel { margin: 0; }
.collapse-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.95rem 1rem;
  user-select: none;
  min-height: var(--tap);
}
.collapse-summary::-webkit-details-marker { display: none; }
.collapse-summary::marker { content: ""; }
.collapse-summary-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.collapse-summary strong { font-size: 1rem; font-weight: 600; }
.collapse-meta { font-size: 0.85rem; }
.collapse-chevron {
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--lotus);
  border-bottom: 2px solid var(--lotus);
  transform: rotate(45deg);
  transition: transform 0.2s var(--ease);
  flex-shrink: 0;
}
.collapse-panel[open] .collapse-chevron {
  transform: rotate(-135deg);
}
.collapse-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--separator);
  animation: rise 0.25s var(--ease) both;
}

.diff {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 720px) {
  .diff { grid-template-columns: 1fr; }
}
pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--gray-50);
  border: 1px solid var(--clay);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  font-size: 0.8rem;
  max-height: 360px;
  overflow: auto;
  font-family: "Roboto Mono", ui-monospace, monospace;
}
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
  border-left: 2px solid var(--pink-200);
  padding: 0.35rem 0 0.75rem 1rem;
  margin-left: 0.35rem;
}

.chip-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin: 0 0 0.85rem;
}
.chip {
  background: var(--surface);
  color: var(--ash);
  border: 1px solid var(--clay);
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  min-height: 36px;
}
.chip:hover { background: var(--petal); color: var(--pink-800); }
.chip.active {
  background: var(--pink-100);
  border-color: var(--pink-200);
  color: var(--pink-700);
}

/* Bottom tab bar - iPhone style */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 0.35rem 0.4rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
  background: rgba(250, 249, 246, 0.86);
  border-top: 1px solid var(--separator);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.bottom-nav.is-admin { grid-template-columns: repeat(4, 1fr); }
.bottom-nav.is-teacher-report { grid-template-columns: repeat(5, 1fr); }

.bottom-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  min-height: 48px;
  padding: 0.3rem 0.2rem;
  background: transparent;
  color: var(--ash);
  border: 0;
  border-radius: 12px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: none;
}
.bottom-nav button .nav-ico {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.bottom-nav button .nav-ico svg {
  width: 22px;
  height: 22px;
}
.bottom-nav button.active {
  color: var(--lotus);
  background: transparent;
}
.bottom-nav button:hover {
  background: rgba(219, 39, 119, 0.06);
  color: var(--lotus-deep);
}
.bottom-nav button:active { transform: scale(0.96); }

/* Desktop - Mac-like sidebar */
.side-nav { display: none; }

@media (min-width: 960px) {
  .app-frame {
    flex-direction: row;
    align-items: stretch;
  }
  .side-nav {
    display: flex;
    flex-direction: column;
    width: 260px;
    flex-shrink: 0;
    padding: 1.5rem 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.72);
    border-right: 1px solid var(--separator);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    height: 100dvh;
  }
  .side-brand-block { padding: 0 0.55rem 1rem; }
  .side-brand-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
  }
  .side-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
  }
  .side-brand-text { min-width: 0; }
  .side-brand {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 400;
    line-height: 1.1;
  }
  .side-sub {
    margin: 0.15rem 0 0;
    color: var(--ash);
    font-size: 0.9rem;
  }
  .app-brand-mobile { display: none; }
  .app-top.is-home {
    display: none;
  }
  .side-nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
    overflow: auto;
  }
  .side-nav-group {
    margin: 0;
    border: 0;
    padding: 0;
  }
  .side-nav-group > .side-section-label {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 0.35rem 0.35rem 0.2rem;
    padding: 0.4rem 0.45rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8e8e93;
    cursor: pointer;
    user-select: none;
  }
  .side-nav-group > .side-section-label::-webkit-details-marker { display: none; }
  .side-nav-group > .side-section-label::marker { content: ""; }
  .side-nav-group > .side-section-label:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--ink);
  }
  .side-group-chevron {
    width: 0.4rem;
    height: 0.4rem;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.18s var(--ease);
    opacity: 0.7;
    flex-shrink: 0;
    margin-right: 0.15rem;
  }
  .side-nav-group[open] > .side-section-label .side-group-chevron {
    transform: rotate(45deg);
  }
  .side-nav-group-items {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
  }
  .side-nav-links button {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
    background: transparent;
    color: var(--ink);
    border: 0;
    border-radius: 10px;
    min-height: 40px;
    padding: 0.55rem 0.7rem;
    font-weight: 500;
    font-size: 0.95rem;
    box-shadow: none;
    gap: 0.65rem;
  }
  .side-nav-links button .nav-ico {
    width: 22px;
    height: 22px;
    display: inline-flex;
    color: var(--ash);
  }
  .side-nav-links button .nav-ico svg { width: 20px; height: 20px; }
  .side-nav-links button:hover {
    background: rgba(219, 39, 119, 0.07);
    color: var(--ink);
  }
  .side-nav-links button.active {
    background: var(--pink-100);
    color: var(--pink-700);
  }
  .side-nav-links button.active .nav-ico { color: var(--lotus); }
  .side-logout {
    margin-top: 0.75rem;
    width: 100%;
  }
  .bottom-nav { display: none; }
  .wrap, .app-wrap {
    padding: 0.5rem 1.75rem 2.5rem;
    max-width: 780px;
  }
  .app-top {
    padding: 1.35rem 1.75rem 0.4rem;
    max-width: 780px;
  }
  .sticky-actions { bottom: 0.75rem; }
  .app-main { padding-left: 0.25rem; }
  .inset-row:hover { background: rgba(0, 0, 0, 0.03); }
}

.hidden { display: none !important; }

.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;
}

/* Navigation chrome */
.back-bar {
  margin: -0.15rem 0 0.65rem;
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 40px;
  padding: 0.35rem 0.55rem 0.35rem 0.2rem;
  background: transparent;
  color: var(--lotus);
  font-size: 1.02rem;
  font-weight: 500;
  box-shadow: none;
  border-radius: 8px;
}
.back-btn:hover {
  background: rgba(219, 39, 119, 0.07);
  color: var(--lotus-deep);
}
.back-chevron {
  width: 0.55rem;
  height: 0.55rem;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-right: 0.15rem;
}

/* Grouped form sheets */
.form-sheet {
  margin: 0 0 1.25rem;
}
.form-sheet .lede { margin-bottom: 0.85rem; }
.inset-form {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0.85rem 1rem 0.35rem;
  border: 1px solid rgba(232, 226, 218, 0.7);
  box-shadow: var(--shadow-sm);
}
.inset-form label {
  margin-top: 0.55rem;
}
.inset-form label:first-child,
.inset-form > .meta:first-child,
.inset-form > .field-hint:first-child {
  margin-top: 0;
}
.field-hint { margin: 0 0 0.65rem; }

.status-hero {
  margin: 0 0 1.15rem;
  padding: 1.15rem 1.2rem 1.25rem;
  border-radius: var(--radius);
  background:
    linear-gradient(165deg, rgba(253, 242, 248, 0.95), rgba(255, 255, 255, 0.92)),
    var(--surface);
  border: 1px solid rgba(251, 207, 232, 0.65);
  box-shadow: var(--shadow-sm);
  animation: rise 0.4s var(--ease) both;
}
.status-hero .badge { margin-bottom: 0.55rem; }
.status-title {
  margin: 0.15rem 0 0.35rem;
  font-size: clamp(1.55rem, 5vw, 1.9rem);
  font-weight: 400;
  text-transform: capitalize;
}
.status-sub {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 600;
}
.status-hero .admin-note {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ash);
  font-size: 0.92rem;
}
.status-hero.status-applied {
  border-color: rgba(61, 107, 79, 0.25);
  background: linear-gradient(165deg, #ecfdf3, #fff);
}
.status-hero.status-rejected {
  border-color: rgba(181, 74, 74, 0.25);
  background: linear-gradient(165deg, #fef2f2, #fff);
}
.status-hero.status-in_progress {
  background: linear-gradient(180deg, rgba(255, 214, 10, 0.14), transparent);
}
.status-hero.status-resolved {
  background: linear-gradient(180deg, rgba(52, 199, 89, 0.12), transparent);
}
.status-hero.status-in_review,
.status-hero.status-approved {
  border-color: rgba(138, 112, 85, 0.28);
  background: linear-gradient(165deg, #f7f1ea, #fff);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 1.35rem 1.15rem;
  text-align: left;
}
.empty-state strong {
  font-size: 1.05rem;
  font-weight: 600;
}
.empty-state .meta { margin: 0 0 0.55rem; max-width: 32ch; }
.empty-state button { margin-top: 0.15rem; }

.toast-host {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 0.85rem);
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  width: min(92vw, 360px);
  pointer-events: none;
}
.toast {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(40, 36, 32, 0.92);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 500;
  text-align: center;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.toast-ok { /* default */ }
.toast-err { background: rgba(181, 74, 74, 0.95); }

.action-stack {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.75rem;
}
.action-stack button { width: 100%; }

.segmented.seg-3 {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 1rem;
}

.raw-details {
  margin-bottom: 1rem;
}
.raw-details > summary.group-label {
  list-style: none;
}
.raw-details > summary::-webkit-details-marker { display: none; }

@media (min-width: 960px) {
  .toast-host { bottom: 1.5rem; }
  .sticky-actions {
    position: static;
    background: transparent;
    padding-top: 0.35rem;
  }
}

/* Focus + motion accessibility */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--lotus);
  outline-offset: 2px;
}
button:focus-visible,
.inset-row:focus-visible,
.back-btn:focus-visible {
  outline: 2px solid var(--lotus);
  outline-offset: 2px;
}

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

/* Legacy aliases still referenced in places */
.list-row { /* mapped conceptually to inset-row */ }
.nav { display: none; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-top: 1rem; }
.chooser { display: grid; gap: 0.65rem; }
.notice-panel, .notice-list { border-color: var(--pink-200); }
.notice-list { background: var(--petal); }
