:root {
  color-scheme: dark;
  --base-font-size: 16px;
  --content-pad: 28px;
  --meta-gap: 10px;
  --settings-gap: 18px;
  --bg: #0c1220;
  --bg-elevated: #0c1220;
  --bg-soft: #101827;
  --surface: #101827;
  --surface-strong: #131c2b;
  --surface-hover: #182234;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(245, 158, 11, 0.24);
  --text: #e6e8ee;
  --muted: #8a92a5;
  --subtle: #c5cad5;
  --accent: #f59e0b;
  --accent-strong: #d97706;
  --accent-soft: rgba(245, 158, 11, 0.1);
  --danger: #d16464;
  --danger-soft: rgba(239, 68, 68, 0.12);
  --success: #5ea977;
  --success-soft: rgba(34, 197, 94, 0.12);
  --info: #7e98ab;
  --info-soft: rgba(126, 152, 171, 0.12);
  --low: rgba(255, 255, 255, 0.04);
  --shadow: none;
  --sidebar-width: 220px;
  --radius: 10px;
  --radius-sm: 7px;
  --transition-fast: 100ms ease;
  --transition-med: 220ms ease;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f6f8;
  --bg-elevated: #f5f6f8;
  --bg-soft: #ffffff;
  --surface: #ffffff;
  --surface-strong: #fbfbfc;
  --surface-hover: #f1f3f5;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(210, 153, 61, 0.22);
  --text: #171923;
  --muted: #687182;
  --subtle: #353d4c;
  --accent-soft: rgba(210, 153, 61, 0.1);
  --danger-soft: rgba(184, 107, 114, 0.1);
  --success-soft: rgba(111, 155, 124, 0.1);
  --info-soft: rgba(126, 152, 171, 0.1);
  --low: rgba(15, 23, 42, 0.04);
  --shadow: none;
}

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

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: "Inter", sans-serif;
  font-size: var(--base-font-size);
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
}

:root[data-font-size="small"] {
  --base-font-size: 15px;
}

:root[data-font-size="standard"] {
  --base-font-size: 16px;
}

:root[data-font-size="large"] {
  --base-font-size: 17px;
}

:root[data-density="compact"] {
  --content-pad: 22px;
  --meta-gap: 8px;
  --settings-gap: 14px;
}

:root[data-density="comfortable"] {
  --content-pad: 28px;
  --meta-gap: 10px;
  --settings-gap: 18px;
}

:root[data-density="airy"] {
  --content-pad: 34px;
  --meta-gap: 14px;
  --settings-gap: 22px;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
h4,
h5,
h6,
strong {
  font-weight: 500;
  letter-spacing: 0;
}

body.drawer-open,
body.onboarding-open,
body.shortcut-open {
  overflow: hidden;
}

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

button {
  cursor: pointer;
}

button,
input,
textarea,
select {
  outline: none;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22);
}

.marketing-shell,
.auth-shell {
  min-height: 100vh;
}

.marketing-shell {
  padding: 28px;
}

.marketing-topbar,
.marketing-main,
.auth-layout {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.marketing-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

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

.brand-logo {
  display: block;
  width: 156px;
  height: 28px;
  object-fit: cover;
  object-position: center 24%;
}

.marketing-brand-copy {
  color: var(--muted);
  font-size: 0.95rem;
}

.marketing-actions,
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.marketing-main {
  display: grid;
  gap: 26px;
}

.hero-card {
  display: grid;
  grid-template-columns: 1fr 0.95fr;
  gap: 18px;
  align-items: stretch;
}

.hero-copy,
.hero-preview,
.marketing-card,
.auth-card,
.auth-aside {
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.hero-copy {
  padding: 28px;
  background: var(--surface);
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
}

.hero-copy h1,
.marketing-section-head h2 {
  margin: 16px 0 0;
  color: var(--text);
  font-size: clamp(2rem, 3vw, 3.2rem);
  line-height: 1.08;
  font-weight: 600;
}

.marketing-section-head h2 {
  font-size: clamp(1.7rem, 2.8vw, 2.4rem);
}

.hero-copy p,
.marketing-card p,
.auth-aside p,
.auth-aside-point span,
.preview-row p {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.hero-proof {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.hero-proof div,
.auth-aside-point {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-strong);
}

.hero-proof strong,
.preview-row strong,
.marketing-card h3,
.auth-aside h2,
.auth-aside-point strong {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.hero-preview {
  padding: 24px;
  display: grid;
  gap: 18px;
  background: var(--surface);
}

.hero-preview-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.hero-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.preview-metric,
.marketing-card {
  padding: 16px;
  background: var(--surface-strong);
}

.preview-metric span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
}

.preview-metric strong {
  display: block;
  margin-top: 10px;
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--text);
}

.preview-list,
.auth-aside-points {
  display: grid;
  gap: 12px;
}

.preview-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
}

.marketing-section {
  display: grid;
  gap: 18px;
}

.marketing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.auth-shell {
  display: grid;
  place-items: center;
  padding: 28px;
}

.auth-layout {
  display: grid;
  grid-template-columns: 0.88fr 1.12fr;
  gap: 16px;
  align-items: stretch;
}

.auth-aside,
.auth-card {
  padding: 24px;
  background: var(--surface);
}

.auth-aside {
  display: grid;
  align-content: start;
  gap: 20px;
  background: var(--surface);
}

.auth-card h1,
.auth-card h2 {
  margin: 0;
  font-size: 1.8rem;
  line-height: 1.1;
  font-weight: 600;
}

.auth-card p {
  color: var(--muted);
}

.auth-step-badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--subtle);
  font-size: 0.78rem;
  font-weight: 500;
}

.auth-stack,
.auth-form,
.auth-helper,
.account-stack,
.settings-stack {
  display: grid;
  gap: 16px;
}

.auth-form {
  margin-top: 18px;
}

.auth-form .field {
  gap: 10px;
}

.auth-actions-inline,
.copy-code-row,
.requests-actions,
.member-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.auth-subtle {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.choice-card,
.role-callout,
.request-item,
.settings-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.choice-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  text-align: left;
}

.choice-card h3,
.role-callout h3,
.request-item h3,
.settings-card h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.choice-card p,
.role-callout p,
.request-item p,
.settings-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.choice-card.is-active,
.choice-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.role-callout,
.settings-card,
.request-item {
  padding: 18px;
}

.dashboard-role-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.dashboard-role-panel:empty {
  display: none;
}

.dashboard-role-panel.compact {
  margin-bottom: 18px;
}

.role-callout-top,
.request-item-top,
.member-row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.join-code {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.member-list,
.request-list-inline {
  display: grid;
  gap: 12px;
}

.member-row {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.shell-note {
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--muted);
  line-height: 1.6;
}

.status-banner {
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-strong);
}

.status-banner strong {
  display: block;
  margin-bottom: 6px;
}

.turn-blocker-banner {
  border-left: 3px solid var(--danger);
  background: color-mix(in srgb, var(--surface-strong) 88%, var(--danger-soft));
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px 18px 24px;
  background: #080f1a;
  border-right: 1px solid var(--border);
}

:root[data-theme="light"] .sidebar {
  background: var(--surface);
}

.sidebar .brand-logo {
  object-position: center 76%;
}

:root[data-theme="light"] .sidebar .brand-logo {
  object-position: center 24%;
}

.sidebar-top {
  display: grid;
  gap: 28px;
}

.brand-block {
  display: grid;
  gap: 8px;
}

.brand-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 12px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  text-align: left;
  font-weight: 400;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

:root[data-theme="light"] .nav-item:hover {
  background: rgba(15, 23, 42, 0.04);
}

.nav-item.is-active {
  border-left-color: var(--accent);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.sidebar-user-shell {
  position: relative;
}

.sidebar-user {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 12px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  border-radius: var(--radius);
  transition:
    border-color var(--transition-fast),
    background var(--transition-fast);
}

.sidebar-user:hover,
.sidebar-user.is-open {
  border-color: var(--border-strong);
}

.sidebar-user-copy {
  flex: 1;
  min-width: 0;
}

.sidebar-user-caret {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
}

.sidebar-user-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 10px);
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 20px 40px rgba(3, 7, 18, 0.22);
  z-index: 10;
}

.sidebar-menu-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}

.sidebar-menu-item:hover {
  background: var(--surface-hover);
}

.sidebar-menu-item.danger {
  color: var(--danger);
}

:root[data-theme="light"] .sidebar-user {
  background: rgba(15, 23, 42, 0.03);
}

.avatar-circle,
.staff-avatar {
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(210, 153, 61, 0.14);
  color: var(--accent);
  font-weight: 600;
}

.avatar-circle {
  width: 38px;
  height: 38px;
  font-size: 0.88rem;
}

.sidebar-user-line,
.sidebar-user-subline {
  display: block;
}

.sidebar-user-line {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
}

.sidebar-user-subline {
  color: var(--muted);
  font-size: 0.82rem;
}

.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  padding: var(--content-pad);
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 400;
}

.topbar h1,
.panel h2,
.drawer-content h2,
.metric-card strong,
.room-card h3,
.staff-card h3 {
  margin: 0;
}

.topbar h1 {
  font-size: 1.4rem;
  line-height: 1;
}

.view-subtitle {
  margin: 10px 0 0;
  max-width: 58rem;
  color: var(--muted);
  line-height: 1.6;
}

.topbar-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--meta-gap);
}

.topbar-workspace-control {
  display: flex;
  align-items: flex-start;
  align-self: flex-start;
}

.topbar-select-shell {
  min-width: 260px;
}

.topbar-select-shell select {
  min-width: 260px;
  padding: 10px 36px 10px 12px;
  background: var(--surface);
}

.topbar-select-shell .searchable-select-trigger {
  min-width: 260px;
  background: var(--surface);
  padding: 10px 12px;
}

.topbar-pill,
.badge,
.mini-chip,
.status-dot {
  border-radius: 999px;
}

.topbar-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--subtle);
  font-weight: 500;
}

.topbar-pill.muted {
  color: var(--muted);
}

:root[data-theme="light"] .topbar-pill {
  background: rgba(255, 255, 255, 0.7);
}

.connection-pill .status-dot {
  display: inline-flex;
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
}

.status-dot.connected {
  background: var(--success);
  box-shadow: 0 0 0 4px var(--success-soft);
}

.status-dot.disconnected {
  background: var(--danger);
  box-shadow: 0 0 0 4px var(--danger-soft);
}

.view {
  animation: none;
}

.view.is-active {
  animation: slide-up-fade 120ms ease;
}

.surface {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: none;
  backdrop-filter: none;
}

.panel {
  border-radius: var(--radius);
  padding: 20px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-head-tight {
  margin-bottom: 14px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.metric-card {
  border-radius: var(--radius);
  padding: 18px;
  border-left: 2px solid transparent;
  transition:
    border-left-color 150ms ease,
    background 150ms ease;
}

.metric-card:hover {
  border-left-color: var(--accent);
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
}

.metric-card strong {
  display: block;
  margin: 10px 0 6px;
  font-size: 1.8rem;
  font-weight: 500;
}

.metric-card p,
.mini-copy,
.stack-item-meta,
.drawer-meta,
.detail-list dd,
.room-note-time,
.timeline-item time,
.comment-item time,
.employee-meta {
  margin: 0;
  color: var(--muted);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  gap: 18px;
}

.dashboard-ai-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 18px;
  margin-top: 18px;
}

.dashboard-ai-panel {
  min-height: 100%;
}

.panel-actions,
.ai-inline-actions,
.ai-card-top,
.shortcut-row,
.ai-priority-item-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-card-top {
  justify-content: space-between;
  flex-wrap: wrap;
}

.panel-actions,
.ai-inline-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dashboard-ai-content,
.shortcut-list,
.ai-skeleton,
.handoff-head,
.gm-brief-head,
.handoff-alerts,
.gm-note-list,
.gm-risk-list,
.ai-priority-list {
  display: grid;
  gap: 12px;
}

.ai-empty,
.ai-note {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  color: var(--muted);
  line-height: 1.6;
}

.ai-note {
  border-style: solid;
  background: var(--bg-soft);
}

.loading-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.94rem;
}

.loading-spinner {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(245, 158, 11, 0.18);
  border-top-color: var(--accent);
  animation: spin 700ms linear infinite;
}

.ticket-ai-suggestion {
  display: grid;
  gap: 10px;
}

.ticket-ai-suggestion[hidden] {
  display: none;
}

.ai-suggestion-card,
.ai-diagnosis-card,
.ai-handoff-card,
.gm-brief-card {
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-strong);
}

.ai-card-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.73rem;
  font-weight: 500;
}

.ai-suggestion-card {
  border-left: 3px solid var(--accent);
}

.ai-suggestion-grid,
.ai-diagnosis-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ai-field,
.ai-priority-item,
.gm-risk-list li {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
}

.ai-field span,
.ai-diagnosis-meta span,
.ai-priority-item-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.8rem;
}

.ai-reasoning,
.ai-diagnosis-copy,
.gm-brief-copy,
.ai-priority-copy,
.gm-risk-list p,
.gm-note-list p,
.handoff-alerts p {
  margin: 0;
  color: var(--subtle);
  line-height: 1.6;
}

.handoff-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.ai-priority-list {
  counter-reset: handoff-priority;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ai-priority-item-label::before {
  counter-increment: handoff-priority;
  content: counter(handoff-priority) ".";
  margin-right: 6px;
  color: var(--text);
  font-weight: 500;
}

.gm-risk-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.stack-list {
  display: grid;
  gap: 12px;
}

.stack-item,
.repeat-item,
.staff-card,
.room-card,
.employee-item,
.drawer-card,
.comment-item,
.timeline-item {
  border: 1px solid var(--border);
  background: var(--surface-strong);
  border-radius: var(--radius);
}

.stack-item,
.repeat-item,
.staff-card,
.room-card {
  transition:
    box-shadow 200ms ease,
    transform 200ms ease,
    background 150ms ease,
    border-color 150ms ease;
}

:root[data-theme="light"] .stack-item,
:root[data-theme="light"] .repeat-item,
:root[data-theme="light"] .staff-card,
:root[data-theme="light"] .room-card,
:root[data-theme="light"] .employee-item,
:root[data-theme="light"] .drawer-card,
:root[data-theme="light"] .comment-item,
:root[data-theme="light"] .timeline-item {
  background: var(--surface-strong);
}

.stack-item,
.repeat-item {
  padding: 14px 16px;
}

.stack-item-top,
.repeat-item-top,
.staff-top,
.employee-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.stack-item h3,
.repeat-item h3,
.room-card h3,
.staff-card h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
}

.stack-item-meta,
.repeat-item-meta {
  margin-top: 4px;
  font-size: 0.9rem;
}

.signal-banner {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  background: transparent;
  color: var(--subtle);
  font-size: 0.92rem;
  font-weight: 400;
}

.signal-banner.ai-breathing {
  animation: signal-breathe 2.6s ease-in-out infinite;
}

.active-turn-blockers {
  display: grid;
  margin-bottom: 16px;
}

.turn-blocker-panel {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid rgba(239, 68, 68, 0.18);
  border-left: 3px solid var(--danger);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-strong) 90%, var(--danger-soft));
}

.turn-blocker-panel-head,
.turn-blocker-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.turn-blocker-list {
  display: grid;
  gap: 10px;
}

.turn-blocker-item strong {
  display: block;
  margin-bottom: 4px;
}

.filter-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.filter-set {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.field,
.search-field {
  display: grid;
  gap: 8px;
}

.field span:first-child {
  color: var(--subtle);
  font-weight: 500;
  font-size: 0.94rem;
}

.field.compact span:first-child {
  font-size: 0.82rem;
}

.field input,
.field textarea,
.search-field input,
.select-shell select {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  border-radius: var(--radius);
  padding: 12px 14px;
  transition:
    border-color var(--transition-fast),
    background var(--transition-fast);
}

.field input:hover,
.field textarea:hover,
.search-field input:hover,
.select-shell select:hover {
  border-color: rgba(245, 158, 11, 0.24);
}

:root[data-theme="light"] .field input,
:root[data-theme="light"] .field textarea,
:root[data-theme="light"] .search-field input,
:root[data-theme="light"] .select-shell select {
  background: #f8fafc;
}

.field textarea {
  resize: vertical;
}

.field-error {
  min-height: 1em;
  color: #fca5a5;
  font-size: 0.82rem;
}

.select-shell {
  position: relative;
}

.select-shell.is-searchable::after {
  display: none;
}

.select-shell::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.select-shell select {
  appearance: none;
  padding-right: 40px;
}

.native-searchable-select {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.searchable-select {
  position: relative;
}

.searchable-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  border-radius: var(--radius);
  padding: 12px 14px;
  text-align: left;
  transition:
    border-color var(--transition-fast),
    background var(--transition-fast);
}

.searchable-select-trigger:hover,
.searchable-select.is-open .searchable-select-trigger {
  border-color: rgba(245, 158, 11, 0.24);
}

:root[data-theme="light"] .searchable-select-trigger {
  background: #f8fafc;
}

.searchable-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.searchable-select-arrow {
  color: var(--muted);
  font-size: 0.9rem;
}

.searchable-select.is-disabled .searchable-select-trigger {
  opacity: 0.6;
  cursor: not-allowed;
}

.searchable-select-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 18;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.16);
  overflow: hidden;
}

.searchable-select-search {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 12px 14px;
}

.searchable-select-list {
  max-height: 220px;
  overflow-y: auto;
  display: grid;
}

.searchable-select-option,
.searchable-select-empty {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  color: var(--subtle);
  padding: 11px 14px;
  text-align: left;
}

.searchable-select-empty {
  color: var(--muted);
}

.searchable-select-option:hover,
.searchable-select-option.is-highlighted {
  background: var(--surface-hover);
}

.searchable-select-option.is-selected {
  color: var(--accent);
  border-left-color: var(--accent);
}

.searchable-select-check {
  color: var(--accent);
  font-weight: 700;
}

.search-field {
  min-width: 340px;
}

.table-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

:root[data-theme="light"] .table-shell {
  background: var(--surface-strong);
}

.ticket-table {
  width: 100%;
  border-collapse: collapse;
}

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

.ticket-table th {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.ticket-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

:root[data-theme="light"] .ticket-table tbody tr:hover {
  background: rgba(15, 23, 42, 0.025);
}

.ticket-table td:last-child {
  width: 90px;
}

.table-room-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.arrival-badge {
  white-space: nowrap;
}

.ticket-id {
  font-weight: 500;
  letter-spacing: 0;
}

.view-btn,
.secondary-btn,
.submit-btn,
.ghost-btn {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    opacity var(--transition-fast);
}

.view-btn,
.secondary-btn,
.ghost-btn {
  padding: 10px 14px;
}

.view-btn {
  background: transparent;
  color: var(--subtle);
}

.view-btn:hover,
.secondary-btn:hover,
.submit-btn:hover,
.ghost-btn:hover {
  background: var(--surface-hover);
}

.view-btn:hover {
  border-color: var(--border-strong);
}

.secondary-btn {
  background: transparent;
  color: var(--subtle);
}

.ghost-btn {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}

.submit-btn {
  width: 100%;
  padding: 14px 18px;
  background: var(--accent);
  border-color: var(--accent);
  color: #171923;
}

.submit-btn:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.submit-btn.slim {
  width: auto;
}

.submit-btn:disabled,
.secondary-btn:disabled,
.ghost-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.composer-wrap {
  display: flex;
  justify-content: center;
}

.ticket-form {
  width: min(600px, 100%);
}

.ai-enhance-btn {
  width: auto;
  border-left: 2px solid #7c3aed;
}

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

.urgency-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-weight: 500;
}

.urgency-btn.is-selected {
  color: var(--text);
}

.urgency-btn.low.is-selected {
  background: var(--low);
  border-color: rgba(148, 163, 184, 0.24);
}

.urgency-btn.medium.is-selected {
  background: var(--accent-soft);
  border-color: rgba(245, 158, 11, 0.28);
}

.urgency-btn.urgent.is-selected {
  background: var(--danger-soft);
  border-color: rgba(239, 68, 68, 0.28);
}

.toggle-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  background: var(--surface-strong);
  color: var(--text);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: left;
  transition:
    border-color var(--transition-fast),
    background var(--transition-fast);
}

.toggle-row-copy {
  display: grid;
  gap: 4px;
}

.toggle-row-copy strong {
  font-size: 0.95rem;
}

.toggle-row-copy span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.toggle-row.is-active.toggle-row-danger {
  border-left-color: var(--danger);
  background: color-mix(in srgb, var(--surface-strong) 86%, var(--danger-soft));
}

.toggle-row.is-active.toggle-row-arrival {
  border-left-color: var(--accent);
  background: color-mix(in srgb, var(--surface-strong) 88%, var(--accent-soft));
}

.toggle-panel {
  display: grid;
  gap: 12px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin-top: 0;
  transition:
    max-height 200ms ease,
    opacity 200ms ease,
    margin-top 200ms ease;
}

.toggle-panel.is-open {
  max-height: 220px;
  opacity: 1;
  margin-top: 12px;
}

.composer-sellability-toggle .sellability-btn.sellable.is-selected {
  background: var(--low);
  border-color: rgba(148, 163, 184, 0.24);
}

.upload-zone {
  position: relative;
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 156px;
  padding: 18px;
  border: 1px dashed rgba(126, 152, 171, 0.5);
  background: var(--surface-strong);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
  overflow: hidden;
  transition:
    border-color var(--transition-fast),
    background var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
}

.upload-zone:hover,
.upload-zone.has-file {
  border-color: rgba(245, 158, 11, 0.45);
  background: color-mix(in srgb, var(--surface-strong) 88%, var(--accent-soft));
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 1.45rem;
  line-height: 1;
}

.upload-zone small {
  color: var(--muted);
}

.upload-zone strong {
  color: var(--text);
}

.upload-zone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow:
    0 0 0 2px var(--accent),
    0 0 20px rgba(245, 158, 11, 0.15);
  transform: translateY(-1px);
}

.upload-preview {
  width: min(180px, 100%);
  max-height: 110px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.checkbox-row,
.checkbox-column {
  display: flex;
  gap: 14px;
}

.checkbox-column {
  flex-direction: column;
}

.check-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--subtle);
  font-weight: 500;
}

.check-item input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

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

.rooms-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
}

.room-view-control {
  flex: 0 0 auto;
}

.rooms-filter-field {
  min-width: 190px;
}

.planner-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.room-add-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.room-add-form input {
  width: 150px;
  padding: 10px 12px;
}

.compact-select select {
  min-width: 142px;
  padding: 10px 34px 10px 12px;
}

.compact-select .searchable-select-trigger {
  min-width: 142px;
  padding: 10px 12px;
}

.room-card {
  position: relative;
  width: 100%;
  appearance: none;
  border-left: 4px solid transparent;
  padding: 16px;
  text-align: left;
  color: var(--text);
  transition:
    border-color var(--transition-fast),
    background var(--transition-fast),
    box-shadow 200ms ease,
    transform 200ms ease;
}

.stack-item:hover,
.repeat-item:hover,
.staff-card:hover,
.room-card:hover {
  box-shadow: none;
  transform: none;
  border-color: var(--border-strong);
}

.room-card:hover,
.staff-card:hover,
.employee-item:hover,
.stack-item:hover,
.repeat-item:hover {
  background: var(--surface-hover);
}

:root[data-theme="light"] .room-card:hover,
:root[data-theme="light"] .staff-card:hover,
:root[data-theme="light"] .employee-item:hover {
  background: var(--surface-hover);
}

.room-card.available {
  border-left-color: var(--success);
}

.room-card.occupied {
  border-left-color: var(--accent);
}

.room-card.maintenance {
  border-left-color: var(--danger);
}

.room-card.available:hover {
  border-color: rgba(94, 169, 119, 0.32);
}

.room-card.occupied:hover {
  border-color: rgba(245, 158, 11, 0.28);
}

.room-card.maintenance:hover {
  border-color: rgba(209, 100, 100, 0.3);
}

.room-status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.room-sellability-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 500;
}

.room-sellability-chip.sellable {
  color: var(--success);
}

.room-sellability-chip.inspect {
  color: var(--accent);
}

.room-sellability-chip.blocked {
  color: var(--danger);
}

.sellability-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex: 0 0 8px;
  background: currentColor;
}

.rooms-floor-view,
.rooms-planner-view {
  display: grid;
  gap: 16px;
}

.floor-band,
.planner-floor {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.floor-band {
  padding: 16px;
}

.floor-band-head,
.planner-floor-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.86rem;
}

.floor-band-head h3 {
  margin: 0;
  color: var(--text);
}

.floor-room-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.planner-note {
  color: var(--muted);
  font-size: 0.9rem;
}

.planner-board {
  display: grid;
  gap: 14px;
}

.planner-floor {
  overflow: hidden;
}

.planner-floor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.86rem;
}

.planner-floor-head .planner-floor-label {
  padding: 0;
  border: 0;
  background: transparent;
}

.planner-floor-head span:last-child {
  font-weight: 500;
}

.planner-floor-board {
  position: relative;
  overflow: hidden;
  min-height: 320px;
  padding: 18px;
  background:
    linear-gradient(rgba(126, 141, 171, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126, 141, 171, 0.08) 1px, transparent 1px),
    var(--surface);
  background-size: 46px 46px, 46px 46px, auto;
}

.planner-floor-board.is-editing {
  background:
    linear-gradient(rgba(89, 120, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(89, 120, 255, 0.12) 1px, transparent 1px),
    var(--surface);
}

.planner-floor-board.is-drop-target {
  box-shadow: inset 0 0 0 1px rgba(89, 120, 255, 0.24);
}

.planner-floor-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text);
  font-size: 0.96rem;
  font-weight: 600;
}

.planner-floor-board .room-plan-cell {
  position: absolute;
  width: 168px;
  min-height: 104px;
  margin: 0;
  overflow: hidden;
}

.room-plan-cell {
  appearance: none;
  display: grid;
  align-content: space-between;
  gap: 8px;
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--border);
  border-left: 4px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast);
}

.room-plan-cell:hover {
  background: var(--surface-hover);
  transform: translateY(-1px);
}

.room-plan-cell.available {
  border-left-color: var(--success);
}

.room-plan-cell.occupied {
  border-left-color: var(--accent);
}

.room-plan-cell.maintenance {
  border-left-color: var(--danger);
}

.room-plan-cell span,
.room-plan-cell small {
  color: var(--muted);
}

.room-plan-node {
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(15, 18, 32, 0.08);
}

.room-plan-node.is-editing {
  cursor: grab;
}

.room-plan-node.is-editing:active,
.planner-dragging .room-plan-node.is-editing {
  cursor: grabbing;
}

.room-plan-cell.is-dragging {
  z-index: 4;
  transform: scale(1.02);
  box-shadow: 0 18px 36px rgba(15, 18, 32, 0.16);
}

.room-plan-handle {
  display: inline-flex;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(89, 120, 255, 0.1);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 600;
}

.alert-pin {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(184, 107, 114, 0.16);
  color: white;
  font-size: 0.76rem;
  font-weight: 600;
}

.room-meta {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.room-meta-row,
.detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.room-label,
.detail-label {
  color: var(--muted);
  font-size: 0.86rem;
}

.room-value,
.detail-value {
  font-weight: 500;
  text-align: right;
}

.detail-inline-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-select-shell select {
  min-width: 164px;
}

.staff-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.staff-card {
  padding: 18px;
}

.staff-avatar {
  width: 46px;
  height: 46px;
  font-size: 0.95rem;
}

.staff-top {
  margin-bottom: 16px;
}

.staff-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.staff-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.staff-stat {
  padding: 12px;
  border-radius: var(--radius);
  background: var(--bg-soft);
}

:root[data-theme="light"] .staff-stat {
  background: var(--bg-soft);
}

.staff-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.staff-stat strong {
  display: block;
  margin-top: 6px;
  font-size: 1rem;
}

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

.workload-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  overflow: hidden;
}

.workload-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 600ms cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: left center;
  animation: workload-reveal 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--settings-gap);
}

.settings-span {
  grid-column: 1 / -1;
}

.settings-form,
.employee-form {
  display: grid;
  gap: 16px;
}

.employee-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  margin-bottom: 18px;
}

.employee-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.employee-item {
  padding: 14px 16px;
}

.employee-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.segmented-control {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.appearance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.appearance-group {
  display: grid;
  gap: 10px;
}

.appearance-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

:root[data-theme="light"] .segmented-control {
  background: var(--surface-strong);
}

.segment {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.segment.is-active {
  background: var(--accent-soft);
  color: var(--text);
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 8, 20, 0.58);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity var(--transition-med);
}

.drawer-overlay.is-visible {
  opacity: 1;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 23, 0.56);
  opacity: 0;
  transition: opacity var(--transition-med);
  z-index: 34;
}

.modal-overlay.is-visible {
  opacity: 1;
}

.onboarding-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(560px, calc(100vw - 48px));
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transform: translate(-50%, calc(-50% + 8px));
  opacity: 0;
  transition:
    opacity var(--transition-med),
    transform var(--transition-med);
  z-index: 35;
}

.onboarding-modal.is-open {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.onboarding-header,
.onboarding-step,
.onboarding-footer,
.onboarding-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.onboarding-header {
  margin-bottom: 14px;
}

.onboarding-step {
  justify-content: flex-start;
  margin-bottom: 16px;
}

.onboarding-points {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  color: var(--subtle);
  line-height: 1.55;
}

.onboarding-footer {
  margin-top: 20px;
}

.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(480px, 100vw);
  padding: 24px 20px 20px;
  background: #080f1a;
  border-left: 1px solid var(--border);
  box-shadow: none;
  transform: translateX(100%);
  transition: transform var(--transition-med);
  z-index: 20;
  overflow-y: auto;
}

:root[data-theme="light"] .detail-drawer {
  background: var(--surface);
}

.detail-drawer.is-open {
  transform: translateX(0);
  box-shadow:
    inset 1px 0 0 rgba(245, 158, 11, 0.08),
    -12px 0 28px rgba(0, 0, 0, 0.18);
}

.drawer-close {
  position: sticky;
  top: 0;
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  border-radius: 999px;
  z-index: 1;
}

.drawer-content {
  display: grid;
  gap: 16px;
}

.drawer-header {
  display: grid;
  gap: 12px;
}

.drawer-title-row,
.badge-row,
.timeline-row,
.comment-row,
.drawer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.drawer-subtitle {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.drawer-grid {
  display: grid;
  gap: 10px;
}

.drawer-card {
  padding: 16px;
}

.ai-diagnosis-card {
  display: grid;
  gap: 14px;
  border-left: 3px solid var(--accent);
}

.ai-diagnosis-card.monitor {
  border-left-color: var(--info);
}

.ai-diagnosis-card.investigate {
  border-left-color: var(--accent);
}

.ai-diagnosis-card.urgent-action {
  border-left-color: var(--danger);
}

.ai-skeleton-line {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04),
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0.04)
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s linear infinite;
}

.ai-skeleton-line.short {
  width: 58%;
}

.ai-skeleton-line.medium {
  width: 76%;
}

.drawer-card h3,
.timeline h3,
.comments h3 {
  margin: 0 0 12px;
  font-size: 0.98rem;
}

.detail-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.detail-list dt {
  color: var(--muted);
}

.detail-list dd {
  text-align: right;
  color: var(--text);
  font-weight: 600;
}

.timeline,
.comments {
  display: grid;
  gap: 12px;
}

.timeline-item,
.comment-item {
  padding: 14px 16px;
}

.timeline-item strong,
.comment-item strong {
  display: block;
  margin-bottom: 4px;
}

.drawer-textarea {
  width: 100%;
  min-height: 100px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  border-radius: var(--radius);
  padding: 12px 14px;
  resize: vertical;
}

.drawer-inline-actions,
.drawer-action-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.drawer-actions {
  justify-content: space-between;
}

.sellability-status-row {
  margin-bottom: 12px;
}

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

.sellability-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-weight: 500;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast);
}

.sellability-btn.is-selected {
  color: var(--text);
}

.sellability-btn.sellable.is-selected {
  background: var(--success-soft);
  border-color: rgba(94, 169, 119, 0.28);
}

.sellability-btn.inspect.is-selected {
  background: var(--accent-soft);
  border-color: rgba(245, 158, 11, 0.28);
}

.sellability-btn.blocked.is-selected {
  background: var(--danger-soft);
  border-color: rgba(209, 100, 100, 0.28);
}

.history-filters {
  margin-bottom: 16px;
}

.history-timeline {
  display: grid;
  gap: 12px;
}

.history-day-divider {
  padding-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
}

.history-item {
  border-left: 3px solid var(--border);
}

.history-item.flags {
  border-left-color: var(--danger);
}

.history-item.status {
  border-left-color: var(--accent);
}

.history-item.sellability {
  border-left-color: var(--info);
}

.history-item.resolutions {
  border-left-color: var(--success);
}

.history-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.drawer-image {
  width: 100%;
  margin-top: 14px;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.toast-stack {
  position: fixed;
  right: 22px;
  bottom: 22px;
  display: grid;
  gap: 10px;
  z-index: 30;
}

.toast {
  min-width: 280px;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface-strong);
  box-shadow: none;
  color: var(--text);
  animation:
    toast-in 220ms cubic-bezier(0.16, 1, 0.3, 1),
    toast-out 180ms ease 3.8s forwards;
}

.shortcut-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(460px, calc(100vw - 48px));
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transform: translate(-50%, calc(-50% + 8px));
  opacity: 0;
  transition:
    opacity var(--transition-med),
    transform var(--transition-med);
  z-index: 35;
}

.shortcut-modal.is-open {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.shortcut-row {
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--subtle);
}

.shortcut-key {
  display: inline-flex;
  min-width: 38px;
  justify-content: center;
  padding: 6px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 600;
}

:root[data-theme="light"] .toast {
  background: var(--surface-strong);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0;
  border: 1px solid transparent;
}

.badge.urgent {
  background: var(--danger-soft);
  color: #c79ba0;
  border-color: rgba(184, 107, 114, 0.16);
}

.member-row.is-current {
  border-color: var(--border-strong);
}

.member-row-actions {
  display: flex;
  justify-content: flex-end;
}

.danger-btn {
  width: fit-content;
  padding: 11px 14px;
  border: 1px solid rgba(184, 107, 114, 0.26);
  border-radius: var(--radius-sm);
  background: rgba(184, 107, 114, 0.08);
  color: #a9525e;
  font-weight: 500;
}

.danger-btn:hover {
  background: rgba(184, 107, 114, 0.12);
  border-color: rgba(184, 107, 114, 0.38);
}

.badge.medium {
  background: var(--accent-soft);
  color: #bfa172;
  border-color: rgba(210, 153, 61, 0.16);
}

.badge.low {
  background: var(--low);
  color: var(--muted);
  border-color: var(--border);
}

.badge.resolved {
  background: var(--success-soft);
  color: #8ca996;
  border-color: rgba(111, 155, 124, 0.16);
}

.badge.progress {
  background: var(--info-soft);
  color: #90a7b8;
  border-color: rgba(126, 152, 171, 0.16);
}

.badge.open {
  background: var(--low);
  color: var(--muted);
  border-color: var(--border);
}

.badge.repeat {
  background: var(--danger-soft);
  color: #c79ba0;
  border-color: rgba(184, 107, 114, 0.16);
}

.badge.sellable {
  background: var(--success-soft);
  color: #7ea98d;
  border-color: rgba(94, 169, 119, 0.2);
}

.badge.inspect {
  background: var(--accent-soft);
  color: #b68d45;
  border-color: rgba(245, 158, 11, 0.18);
}

.badge.blocked {
  background: var(--danger-soft);
  color: #c17979;
  border-color: rgba(209, 100, 100, 0.18);
}

.badge.department {
  background: rgba(148, 163, 184, 0.12);
  color: var(--subtle);
}

.badge.default {
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
}

.empty-message {
  display: grid;
  place-items: center;
  padding: 40px 16px;
  text-align: center;
  color: var(--muted);
}

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

@media (max-width: 1180px) {
  .hero-card,
  .auth-layout,
  .dashboard-grid,
  .dashboard-ai-grid {
    grid-template-columns: 1fr;
  }

  .marketing-grid,
  .settings-grid,
  .employee-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rooms-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .employee-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  :root {
    --content-pad: 20px;
    --settings-gap: 14px;
    --meta-gap: 8px;
  }

  .marketing-shell,
  .auth-shell {
    padding: 20px;
  }

  .marketing-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .marketing-brand {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .marketing-actions,
  .hero-actions {
    width: 100%;
  }

  .marketing-actions > *,
  .hero-actions > * {
    flex: 1 1 180px;
  }

  .hero-proof,
  .marketing-grid,
  .appearance-grid {
    grid-template-columns: 1fr;
  }

  .app-shell {
    min-height: 100dvh;
  }

  .sidebar {
    position: static;
    inset: auto;
    width: 100%;
    padding: 18px 20px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    gap: 16px;
  }

  .sidebar-top {
    gap: 16px;
  }

  .brand-block {
    gap: 6px;
  }

  .nav-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .nav-list::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
    border-left: 0;
    border-bottom: 2px solid transparent;
    border-radius: var(--radius-sm);
  }

  .nav-item.is-active {
    border-left-color: transparent;
    border-bottom-color: var(--accent);
  }

  .sidebar-user-shell {
    align-self: stretch;
  }

  .sidebar-user-menu {
    left: auto;
    right: 0;
    bottom: auto;
    top: calc(100% + 10px);
    min-width: 220px;
  }

  .main-content {
    margin-left: 0;
    min-height: auto;
    padding: 20px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .topbar-meta {
    width: 100%;
    align-items: stretch;
  }

  .topbar-workspace-control {
    flex: 1 1 100%;
  }

  .topbar-select-shell,
  .topbar-select-shell select,
  .topbar-select-shell .searchable-select-trigger {
    width: 100%;
    min-width: 0;
  }

  .topbar-pill {
    justify-content: center;
  }

  .filter-row {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-set {
    width: 100%;
  }

  .filter-set .field,
  .filter-set .select-shell,
  .filter-set .searchable-select,
  .search-field {
    flex: 1 1 100%;
    min-width: 0;
  }

  .search-field {
    width: 100%;
    min-width: 0;
  }

  .table-shell {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ticket-table {
    min-width: 760px;
  }

  .rooms-toolbar {
    align-items: stretch;
  }

  .room-view-control,
  .rooms-filter-field,
  .planner-toolbar-actions,
  .room-add-form {
    width: 100%;
  }

  .room-add-form {
    margin-left: 0;
    flex-wrap: wrap;
  }

  .room-add-form input,
  .compact-select select,
  .compact-select .searchable-select-trigger {
    width: 100%;
    min-width: 0;
  }

  .planner-toolbar-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .settings-grid,
  .employee-form,
  .employee-list {
    grid-template-columns: 1fr;
  }

  .detail-drawer {
    width: min(100vw, 640px);
  }
}

@media (max-width: 640px) {
  :root {
    --content-pad: 16px;
    --settings-gap: 12px;
  }

  .marketing-shell,
  .auth-shell {
    padding: 14px;
  }

  .brand-logo {
    width: 132px;
    height: 24px;
  }

  .marketing-brand-copy,
  .brand-copy {
    font-size: 0.88rem;
  }

  .hero-copy,
  .hero-preview,
  .auth-aside,
  .auth-card,
  .panel,
  .drawer-card,
  .metric-card,
  .floor-band {
    padding: 16px;
  }

  .hero-copy h1,
  .marketing-section-head h2 {
    font-size: clamp(1.8rem, 9vw, 2.5rem);
  }

  .auth-card h1,
  .auth-card h2 {
    font-size: 1.5rem;
  }

  .hero-preview-grid,
  .metric-grid,
  .rooms-grid {
    grid-template-columns: 1fr;
  }

  .hero-proof {
    margin-top: 18px;
  }

  .auth-actions-inline,
  .copy-code-row,
  .requests-actions,
  .member-actions,
  .drawer-inline-actions,
  .drawer-action-group,
  .drawer-actions,
  .planner-toolbar-actions,
  .marketing-actions,
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-actions-inline > *,
  .copy-code-row > *,
  .requests-actions > *,
  .member-actions > *,
  .drawer-inline-actions > *,
  .drawer-action-group > *,
  .drawer-actions > *,
  .planner-toolbar-actions > *,
  .marketing-actions > *,
  .hero-actions > * {
    width: 100%;
  }

  .choice-card,
  .preview-row,
  .role-callout-top,
  .request-item-top,
  .member-row-top,
  .turn-blocker-panel-head,
  .turn-blocker-item,
  .history-item-top,
  .stack-item-top,
  .repeat-item-top,
  .staff-top,
  .employee-top {
    grid-template-columns: 1fr;
    display: grid;
  }

  .topbar h1 {
    font-size: 1.25rem;
  }

  .view-subtitle {
    margin-top: 8px;
  }

  .topbar-meta {
    display: grid;
    grid-template-columns: 1fr;
  }

  .topbar-pill,
  .connection-pill,
  .topbar-workspace-control {
    width: 100%;
  }

  .field input,
  .field textarea,
  .search-field input,
  .select-shell select,
  .searchable-select-trigger,
  .toggle-row,
  .urgency-btn,
  .sellability-btn {
    font-size: 16px;
  }

  .urgency-toggle,
  .sellability-toggle {
    grid-template-columns: 1fr;
  }

  .checkbox-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .rooms-toolbar .segmented-control {
    width: 100%;
    justify-content: space-between;
  }

  .segment {
    flex: 1 1 0;
    text-align: center;
  }

  .floor-room-row {
    grid-template-columns: 1fr;
  }

  .planner-floor-board {
    min-height: 240px;
    padding: 12px;
    background-size: 36px 36px, 36px 36px, auto;
  }

  .planner-floor-board .room-plan-cell {
    width: 136px;
    min-height: 96px;
  }

  .detail-list div,
  .detail-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .detail-list dd {
    text-align: left;
  }

  .detail-inline-control {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .detail-drawer {
    width: 100vw;
    padding: 18px 14px 16px;
  }

  .drawer-close {
    position: sticky;
    top: 0;
  }

  .shortcut-modal,
  .onboarding-modal {
    width: calc(100vw - 24px);
    padding: 16px;
  }

  .onboarding-header,
  .onboarding-step,
  .onboarding-footer,
  .onboarding-actions {
    flex-wrap: wrap;
  }

  .toast-stack {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .toast {
    min-width: 0;
    max-width: none;
    width: 100%;
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(8px) translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(8px) translateY(8px);
  }
}

@keyframes slide-up-fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes skeleton-shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

@keyframes signal-breathe {
  0%,
  100% {
    border-left-color: rgba(245, 158, 11, 0.42);
  }
  50% {
    border-left-color: rgba(245, 158, 11, 0.85);
  }
}

@keyframes workload-reveal {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}
