:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #5f6b7a;
  --line: #dde4ed;
  --paper: #ffffff;
  --wash: #f6f8fb;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --gold: #d99a00;
  --red: #b42318;
  --blue: #2563eb;
  --brand-background: #ffffff;
  --shadow: 0 12px 28px rgba(23, 32, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--wash);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: 24px;
  background:
    linear-gradient(color-mix(in srgb, var(--teal) 88%, transparent), color-mix(in srgb, var(--teal-dark) 88%, transparent)),
    var(--brand-background);
}

.login-panel {
  width: min(100%, 420px);
  margin: 0 auto;
  background: var(--paper);
  border-radius: 8px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: contain;
}

.brand h1,
.brand p {
  margin: 0;
}

.brand h1 {
  font-size: 1.35rem;
}

.brand p {
  color: var(--muted);
  font-size: 0.92rem;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  background: var(--wash);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 10;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 12px;
  padding: 16px 14px;
  overflow-y: auto;
  background: var(--paper);
  border-right: 1px solid var(--line);
}

.sidebar .brand {
  margin: 0;
}

.sidebar .brand h1 {
  font-size: 1rem;
}

.sidebar-toggle {
  min-height: 36px;
  border-radius: 8px;
  background: #e9eef5;
  color: var(--ink);
}

.nav {
  display: grid;
  gap: 14px;
  align-content: start;
}

.nav-section {
  display: grid;
  gap: 5px;
}

.nav-section h2 {
  margin: 0;
  padding: 0 10px;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  border-radius: 8px;
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.nav button.active {
  background: #e7f5f3;
  color: var(--teal-dark);
  font-weight: 700;
}

.nav-icon {
  flex: 0 0 30px;
  min-height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eef7ff;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 800;
}

.sidebar-logout {
  width: 100%;
}

.main-stage {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--line);
}

.topbar h1,
.topbar p {
  margin: 0;
}

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

.topbar p {
  color: var(--muted);
  font-size: 0.9rem;
}

.topbar-action {
  white-space: nowrap;
}

.topbar-title {
  min-width: 0;
}

.topbar-tools {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 8px;
  margin-left: auto;
}

.notification-bell-wrap {
  position: relative;
  display: inline-grid;
}

.notification-bell {
  position: relative;
}

.bell-svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notification-badge {
  position: absolute;
  top: -5px;
  right: -6px;
  display: grid;
  place-items: center;
  min-width: 20px;
  min-height: 20px;
  padding: 0 5px;
  border: 2px solid var(--paper);
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.notification-drawer {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  width: min(360px, calc(100vw - 24px));
  max-height: min(560px, calc(100vh - 92px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.notification-drawer header,
.notification-drawer footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.notification-drawer footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.notification-drawer header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.notification-drawer-list {
  min-height: 80px;
  overflow-y: auto;
  padding: 8px 12px;
}

.notification-drawer-item {
  width: 100%;
  min-height: 64px;
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  white-space: normal;
}

.notification-drawer-item:hover,
.notification-drawer-item:focus-visible {
  background: #eef7ff;
}

.notification-drawer-item span {
  display: grid;
  gap: 2px;
}

.notification-drawer-item small {
  color: var(--muted);
}

.notification-unread {
  border-left: 4px solid var(--teal);
  padding-left: 10px;
}

.compact-button {
  min-height: 36px;
  padding: 0 10px;
}

.push-toast-region {
  position: fixed;
  top: 78px;
  right: 18px;
  z-index: 40;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 24px));
}

.push-toast {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.push-toast-body {
  display: grid;
  gap: 4px;
  min-height: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  white-space: normal;
}

.push-toast-body span {
  color: var(--muted);
}

.push-toast-close {
  width: 34px;
  min-height: 34px;
  border-radius: 8px;
  background: #e9eef5;
  color: var(--ink);
}

.onboarding-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 18px 0;
  padding: 12px;
  border: 1px solid #bdd7f0;
  border-radius: 8px;
  background: #f8fbff;
}

.onboarding-banner div:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.onboarding-banner span {
  color: var(--muted);
  font-size: 0.9rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(23, 32, 42, 0.48);
}

.modal-card {
  width: min(480px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  display: grid;
  gap: 12px;
  padding: 20px;
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.modal-card h2,
.modal-card p {
  margin: 0;
}

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

.install-steps {
  display: grid;
  gap: 8px;
  padding-left: 0;
  list-style: none;
}

.install-steps li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.step-icon {
  width: 28px;
  min-height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
}

.install-nudge-card {
  border-color: #bdd7f0;
  background: #f8fbff;
}

.ui-version {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  margin-left: 6px;
  padding: 0 7px;
  border-radius: 999px;
  background: #e7f5f3;
  color: var(--teal-dark);
  font-size: 0.76rem;
  font-weight: 800;
}

.menu-button {
  display: none;
}

.hamburger-icon,
.hamburger-icon::before,
.hamburger-icon::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.hamburger-icon {
  position: relative;
}

.hamburger-icon::before,
.hamburger-icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.hamburger-icon::before {
  top: -6px;
}

.hamburger-icon::after {
  top: 6px;
}

.nav-scrim {
  display: none;
}

.nav-collapsed {
  grid-template-columns: 76px minmax(0, 1fr);
}

.nav-collapsed .sidebar {
  padding: 14px 10px;
}

.nav-collapsed .brand-copy,
.nav-collapsed .nav-label,
.nav-collapsed .nav-section h2,
.nav-collapsed .sidebar-logout {
  display: none;
}

.nav-collapsed .brand {
  justify-content: center;
}

.nav-collapsed .brand-mark {
  width: 38px;
  height: 38px;
}

.nav-collapsed .sidebar-toggle {
  padding: 0;
  font-size: 0;
}

.nav-collapsed .sidebar-toggle::before {
  content: ">";
  font-size: 1rem;
}

.nav-collapsed .nav button {
  justify-content: center;
  padding: 0;
}

.nav button,
.icon-button,
.primary,
.secondary,
.danger,
.button-link {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 14px;
  white-space: nowrap;
}

.primary {
  background: var(--teal);
  color: white;
}

.secondary {
  background: #e9eef5;
  color: var(--ink);
}

.button-link {
  display: inline-grid;
  place-items: center;
  text-decoration: none;
}

.danger {
  background: #fee4e2;
  color: var(--red);
}

.icon-button {
  width: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  background: #eef7ff;
  color: var(--blue);
}

.page {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 24px 18px 44px;
}

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

.page-header h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 1.9rem);
}

.page-header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.dashboard-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.quick-actions button {
  min-height: 48px;
  border-radius: 8px;
  font-weight: 700;
}

.command-filter-panel {
  margin-bottom: 16px;
}

.command-filter-actions {
  align-self: end;
  margin-bottom: 0;
}

.command-center-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.command-section {
  display: grid;
  gap: 14px;
  align-content: start;
}

.command-section-title {
  display: flex;
  align-items: start;
  gap: 12px;
}

.command-section-title > div {
  display: grid;
  gap: 8px;
  width: 100%;
}

.command-section-title h3,
.command-details h4 {
  margin: 0;
}

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

.command-metric {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

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

.command-metric strong {
  display: block;
  margin-top: 4px;
  font-size: 1.15rem;
  overflow-wrap: anywhere;
}

.command-alert-list {
  display: grid;
  gap: 10px;
}

.command-alert {
  padding: 12px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
}

.command-alert.critical {
  border-left-color: var(--red);
}

.command-alert.warning {
  border-left-color: var(--gold);
}

.command-alert.info {
  border-left-color: var(--teal);
}

.command-details {
  display: grid;
  gap: 8px;
}

.compact-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
}

.card,
.panel,
.table-wrap {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.card {
  padding: 18px;
}

.card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.card strong {
  display: block;
  margin-top: 6px;
  font-size: 2rem;
}

.metrics-grid,
.card-grid,
.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.metrics-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.metric-card {
  min-width: 0;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.metric-card strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-size: 1.15rem;
}

.media-create-section {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.media-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.media-preview-card,
.audio-preview-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.media-preview-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  background: #e5e7eb;
}

.media-preview-card strong,
.audio-preview-card strong {
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

.audio-preview-card audio {
  width: 100%;
}

.attachment-card {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.attachment-card:last-child {
  border-bottom: 0;
}

.attachment-card-body {
  display: grid;
  gap: 4px;
}

.attachment-card-body p,
.attachment-card-body small {
  margin: 0;
  color: var(--muted);
}

.attachment-audio audio {
  display: block;
  width: 100%;
  max-width: 560px;
}

.attachment-thumb {
  width: min(280px, 100%);
  display: grid;
  gap: 6px;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.attachment-thumb img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e5e7eb;
}

.attachment-thumb span {
  color: var(--teal);
  font-weight: 700;
}

.attachment-thumb.preview-unavailable img {
  display: none;
}

.attachment-thumb.preview-unavailable::before {
  content: "Preview unavailable";
  display: grid;
  place-items: center;
  min-height: 120px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
}

.secondary-pill {
  background: #e9eef5;
  color: var(--ink);
  text-decoration: none;
}

.attachment-more {
  width: fit-content;
}

.attachment-more summary {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 8px;
  background: #e9eef5;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

.attachment-more .pill {
  margin-top: 8px;
}

.attachment-viewer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(15, 23, 42, 0.72);
}

.attachment-viewer {
  width: min(980px, 100%);
  max-height: calc(100vh - 28px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.attachment-viewer header,
.attachment-viewer footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.attachment-viewer header div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.attachment-viewer header small {
  color: var(--muted);
}

.attachment-viewer-close {
  min-width: 92px;
}

.attachment-viewer-stage {
  min-height: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #111827;
  overflow: hidden;
}

.attachment-viewer-stage img {
  max-width: 100%;
  max-height: calc(100vh - 220px);
  object-fit: contain;
}

.attachment-viewer-nav {
  display: flex;
  gap: 8px;
}

.voice-actions {
  align-items: stretch;
}

.panel {
  padding: 18px;
  margin-top: 14px;
}

.panel h3 {
  margin: 0 0 14px;
  font-size: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.88rem;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  background: white;
  color: var(--ink);
}

input[type="file"] {
  padding: 8px;
}

textarea {
  resize: vertical;
}

.checks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  width: auto;
  font-weight: 700;
}

.inline-check input {
  width: 18px;
  min-height: 18px;
}

.check input {
  width: 18px;
  min-height: 18px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.helper-text {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 0.82rem;
  margin: 2px;
}

.pill.good {
  background: #dcfce7;
  color: #166534;
}

.pill.bad {
  background: #fee2e2;
  color: var(--red);
}

.notice {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
}

.empty-state,
.error-state {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 14px;
  border: 1px dashed #c8d4e3;
  border-radius: 8px;
  background: #fbfcfe;
}

.empty-state strong,
.error-state h3 {
  margin: 0;
  color: var(--ink);
}

.empty-state p,
.error-state p {
  margin: 0;
  color: var(--muted);
}

.error-state {
  border-color: #fed7aa;
  background: #fff7ed;
}

.notification {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.notification:last-child {
  border-bottom: 0;
}

.notification strong {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

.notification p {
  margin: 0;
  color: var(--muted);
}

.preview-block {
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.compact-activity {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.staff-record-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.staff-record-fields span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  overflow-wrap: anywhere;
}

.staff-record-fields strong {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

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

.tab-row button {
  min-height: 44px;
}

.tab-row .active-tab {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.report-chart {
  align-content: start;
}

.report-bar {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px 0;
}

.report-bar-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.report-bar-label span {
  overflow-wrap: anywhere;
}

.report-bar-label strong {
  color: var(--ink);
}

.report-bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef5;
}

.report-bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.report-row .staff-record-fields {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

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

.install-panel {
  display: grid;
  gap: 16px;
}

.install-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.install-brand img {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  border-radius: 16px;
  object-fit: contain;
  background: var(--brand-background);
}

.install-brand h3,
.install-brand p {
  margin: 0;
}

.instruction-list {
  margin: 0;
  padding-left: 22px;
  color: var(--ink);
}

.branding-preview {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--preview-bg);
}

.branding-preview-icon,
.branding-preview-login,
.branding-preview-sidebar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.branding-preview-icon {
  width: 84px;
  height: 84px;
  justify-content: center;
  background: var(--preview-theme);
}

.branding-preview-icon img,
.branding-preview-login img,
.branding-preview-sidebar img,
.logo-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.branding-preview-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.branding-preview-copy strong {
  font-size: 1.2rem;
}

.branding-preview-copy span,
.branding-preview-copy small {
  color: var(--muted);
}

.branding-preview-login,
.branding-preview-sidebar {
  grid-column: 1 / -1;
  min-height: 58px;
}

.branding-preview-login img,
.branding-preview-sidebar img {
  width: 36px;
  height: 36px;
}

.branding-preview-sidebar {
  background: var(--preview-theme);
  color: var(--preview-text);
}

.logo-upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.logo-upload-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.logo-preview {
  display: grid;
  place-items: center;
  height: 92px;
  border: 1px dashed #c8d4e3;
  border-radius: 8px;
  background: #fff;
}

.checklist-items {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.checklist-item {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.compact-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.compact-details summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 700;
}

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

.choice-actions button {
  min-height: 52px;
  border-radius: 8px;
  color: white;
  font-weight: 700;
}

.choice-ok {
  background: #15803d;
}

.choice-bad {
  background: var(--red);
}

.choice-na {
  background: var(--muted);
}

.roster-builder,
.roster-day-list,
.briefing-staff-source,
.roster-department-picker,
.roster-department-rows {
  display: grid;
  gap: 12px;
}

.entry-type-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.entry-type-preview {
  min-height: 28px;
}

.roster-intel-section {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.roster-intel-section h4 {
  margin: 0;
  font-size: 0.95rem;
}

.roster-staff-card,
.roster-person {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.roster-total-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #c8d4e3;
  border-radius: 8px;
  background: #eef7ff;
}

.roster-total-row > strong {
  color: var(--ink);
}

.roster-staff-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}

.inactive-staff {
  border-color: #fecaca;
  background: #fff7f7;
}

.auto-status-row {
  border-color: #fbbf24;
  background: #fffbeb;
}

.compact-checks {
  max-height: 180px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.access-block {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.section-heading h3,
.section-heading p {
  margin: 0;
}

.section-heading p {
  color: var(--muted);
  font-size: 0.9rem;
}

.muted-copy {
  margin: 0 0 12px;
  color: var(--muted);
}

.department-selection-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin-bottom: 12px;
}

.department-shortcuts {
  margin-top: 0;
}

.department-checks .check {
  min-height: 44px;
  align-items: center;
}

.permission-template-panel,
.roster-tools {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.permission-groups {
  display: grid;
  gap: 10px;
}

.permission-group summary {
  justify-content: space-between;
  gap: 10px;
}

.permission-group-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.permission-check span {
  display: grid;
  gap: 2px;
}

.permission-check small {
  color: var(--muted);
  font-size: 0.78rem;
}

.permission-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.sticky-form-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  padding: 12px 0;
  background: linear-gradient(rgba(255, 255, 255, 0.92), #fff);
  border-top: 1px solid var(--line);
}

.coverage-summary,
.warning-stack,
.comparison-grid {
  display: grid;
  gap: 12px;
}

.coverage-card {
  display: grid;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.coverage-card:last-child {
  border-bottom: 0;
}

.coverage-day-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.coverage-day,
.comparison-row > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.coverage-day span,
.comparison-row span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.coverage-day strong,
.comparison-row strong {
  overflow-wrap: anywhere;
}

.comparison-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

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

.good-notice {
  background: #ecfdf3;
  color: #166534;
}

.danger-notice {
  background: #fee4e2;
  color: var(--red);
}

.roster-day-list {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.roster-day-row {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.roster-day-row > strong {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink);
}

.roster-week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(92px, 1fr));
  gap: 8px;
}

.roster-day {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.roster-day span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.roster-day strong {
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

.total-cell {
  border-color: #bdd7f0;
  background: #f8fbff;
}

.hidden {
  display: none !important;
}

.floating-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  max-width: min(420px, calc(100vw - 32px));
  box-shadow: var(--shadow);
}

@media (max-width: 760px) {
  button,
  input,
  select,
  textarea {
    font-size: 1rem;
  }

  .app-shell,
  .app-shell.nav-collapsed {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, 320px);
    height: 100vh;
    transform: translateX(-102%);
    transition: transform 160ms ease;
    box-shadow: var(--shadow);
  }

  .nav-open .sidebar {
    transform: translateX(0);
  }

  .nav-open .nav-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 9;
    background: rgba(23, 32, 42, 0.38);
  }

  .nav-collapsed .brand-copy,
  .nav-collapsed .nav-label,
  .nav-collapsed .nav-section h2,
  .nav-collapsed .sidebar-logout {
    display: block;
  }

  .nav-collapsed .nav button {
    justify-content: flex-start;
    padding: 0 10px;
  }

  .nav-collapsed .sidebar-toggle::before {
    content: "";
  }

  .sidebar-toggle {
    display: none;
  }

  .menu-button {
    display: grid;
  }

  .topbar {
    align-items: center;
    min-height: 62px;
    padding: 10px 14px;
  }

  .topbar-title p {
    display: none;
  }

  .topbar-tools {
    gap: 6px;
  }

  .topbar-action {
    margin-left: 0;
    min-height: 42px;
  }

  .topbar-action {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .notification-drawer {
    position: fixed;
    top: 64px;
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100vh - 82px);
  }

  .push-toast-region {
    top: 70px;
    right: 12px;
    left: 12px;
    width: auto;
  }

  .onboarding-banner {
    display: grid;
    margin: 10px 12px 0;
  }

  .onboarding-banner .actions,
  .onboarding-banner button {
    width: 100%;
  }

  .page-header {
    display: grid;
  }

  .page {
    padding: 18px 12px 34px;
    width: 100%;
    overflow-x: hidden;
  }

  .card {
    padding: 14px;
  }

  .card strong {
    font-size: 1.45rem;
    overflow-wrap: anywhere;
  }

  .grid,
  .dashboard-grid,
  .form-grid,
  .checks {
    grid-template-columns: 1fr;
  }

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

  .command-center-grid,
  .command-metrics {
    grid-template-columns: 1fr;
  }

  .command-section-title {
    align-items: center;
  }

  .quick-actions button,
  .actions button,
  .primary,
  .secondary,
  .danger,
  .nav button,
  .icon-button {
    min-height: 48px;
  }

  input,
  select,
  textarea {
    min-height: 48px;
    padding: 11px 12px;
  }

  label {
    font-size: 0.95rem;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .actions button,
  .actions .primary,
  .actions .secondary,
  .actions .danger,
  .actions .button-link {
    width: 100%;
    white-space: normal;
  }

  .attachment-card {
    gap: 12px;
  }

  .attachment-thumb,
  .attachment-audio audio,
  .attachment-more,
  .attachment-more .pill {
    width: 100%;
    max-width: none;
  }

  .attachment-more summary {
    min-height: 48px;
    justify-content: center;
  }

  .attachment-viewer-backdrop {
    padding: 8px;
  }

  .attachment-viewer {
    max-height: calc(100vh - 16px);
    padding: 10px;
  }

  .attachment-viewer header,
  .attachment-viewer footer,
  .attachment-viewer-nav {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .attachment-viewer footer .pill,
  .attachment-viewer footer button,
  .attachment-viewer-close {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }

  .attachment-viewer-stage img {
    max-height: calc(100vh - 270px);
  }

  .permission-group-actions,
  .comparison-row,
  .comparison-grid {
    grid-template-columns: 1fr;
  }

  .permission-group-actions {
    display: grid;
  }

  .permission-group-actions button {
    width: 100%;
  }

  .sticky-form-actions {
    margin-left: -12px;
    margin-right: -12px;
    padding: 12px;
  }

  .table-wrap {
    padding: 0;
    overflow: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 12px;
  }

  tr {
    padding: 14px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
  }

  td {
    display: grid;
    grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
    gap: 10px;
    padding: 8px 0;
    border: 0;
    overflow-wrap: anywhere;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
  }

  td[colspan]::before {
    content: "";
  }

  td[data-label="Actions"] {
    display: grid;
    grid-template-columns: 1fr;
  }

  td[data-label="Actions"] button {
    width: 100%;
    margin-top: 8px;
  }

  .notification {
    gap: 8px;
    padding: 14px 0;
  }

  .notification strong {
    justify-content: flex-start;
  }

  .pill {
    min-height: 28px;
    font-size: 0.86rem;
  }

small {
  font-size: 0.88rem;
}

.checklist-item {
    padding: 14px;
  }

  .choice-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .choice-actions button {
    min-height: 64px;
    white-space: normal;
  }

  .roster-day-list,
  .roster-week-grid {
    grid-template-columns: 1fr;
  }

  .login-panel {
    padding: 22px;
  }
}
