:root {
  --bg: #f5f7fa;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-strong: #ffffff;
  --line: rgba(16, 24, 40, 0.1);
  --ink: #101828;
  --muted: #667085;
  --nav-bg: #111827;
  --nav-surface: rgba(255, 255, 255, 0.075);
  --nav-line: rgba(255, 255, 255, 0.11);
  --nav-muted: rgba(255, 255, 255, 0.62);
  --accent: #0f8a7f;
  --accent-strong: #0a5c56;
  --accent-soft: rgba(15, 138, 127, 0.12);
  --brand-tint: rgba(10, 92, 86, 0.18);
  --danger: #b42318;
  --danger-soft: rgba(180, 35, 24, 0.1);
  --warning: #b54708;
  --warning-soft: rgba(181, 71, 8, 0.1);
  --success: #067647;
  --success-soft: rgba(6, 118, 71, 0.1);
  --shadow: 0 18px 45px rgba(16, 24, 40, 0.08);
  --shadow-soft: 0 10px 28px rgba(16, 24, 40, 0.06);
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
}

html {
  font-size: 16px;
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(17, 24, 39, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, #f8fafc 0%, var(--bg) 100%);
  background-size: 44px 44px, auto;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 292px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.35rem 1rem;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(17, 24, 39, 0.98)),
    var(--nav-bg);
  border-right: 1px solid var(--nav-line);
  color: white;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.brand-lockup {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 0.65rem 0.6rem 1rem;
  border-bottom: 1px solid var(--nav-line);
}

.brand-mark {
  width: 3rem;
  height: 3rem;
  border-radius: 0.95rem;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
  font-weight: 800;
  font-family: "IBM Plex Mono", monospace;
}

.brand-mark.brand-mark-image {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.brand-logo-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.35rem;
}

.brand-name {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: "IBM Plex Sans", sans-serif;
  color: white;
}

.brand-subtitle,
.subtle-text,
.detail-label,
.metric-label,
.topbar-label,
.eyebrow {
  color: var(--muted);
}

.sidebar .brand-subtitle,
.sidebar .eyebrow {
  color: var(--nav-muted);
}

.brand-subtitle,
.eyebrow,
.topbar-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
}

.sidebar-nav {
  display: grid;
  gap: 0.22rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.nav-link {
  padding: 0.72rem 0.85rem;
  border-radius: 0.75rem;
  color: var(--nav-muted);
  font-size: 0.95rem;
  font-weight: 600;
  transition: background-color 140ms ease, color 140ms ease, transform 140ms ease, border-color 140ms ease;
}

.nav-link:hover,
.nav-link.active {
  background: var(--nav-surface);
  color: white;
  transform: translateX(2px);
}

.nav-link.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.sidebar-note,
.summary-panel,
.hero-panel,
.table-shell,
.form-shell,
.detail-grid,
.system-toast,
.validation-summary {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.sidebar-note,
.form-shell,
.table-shell,
.summary-panel,
.hero-panel {
  border-radius: var(--radius-lg);
}

.sidebar-note {
  padding: 1rem;
  flex-shrink: 0;
  background: var(--nav-surface);
  border-color: var(--nav-line);
  box-shadow: none;
}

.sidebar-note p {
  margin: 0.5rem 0 0;
  line-height: 1.6;
  color: var(--nav-muted);
}

.workspace {
  min-width: 0;
  padding: 1.1rem 1.35rem 2rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.1rem;
  padding: 0.95rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.topbar-title {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: clamp(1.2rem, 2.4vw, 1.75rem);
  font-weight: 700;
}

.auth-panel {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.auth-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.auth-value {
  font-weight: 700;
}

.nav-toggle,
.ghost-button,
.primary-button,
.primary-link,
.ghost-link {
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, opacity 140ms ease, background-color 140ms ease;
}

.nav-toggle {
  display: none;
  width: 3rem;
  height: 3rem;
  padding: 0.8rem;
  background: var(--surface-strong);
  box-shadow: var(--shadow-soft);
  flex-direction: column;
  justify-content: center;
  gap: 0.3rem;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--ink);
}

.ghost-button,
.ghost-link {
  padding: 0.72rem 0.95rem;
  background: #f8fafc;
  border: 1px solid var(--line);
  color: var(--ink);
}

.primary-button,
.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.78rem 1.05rem;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  color: white;
  box-shadow: 0 10px 22px rgba(10, 92, 86, 0.18);
}

.primary-button:hover,
.primary-link:hover,
.ghost-button:hover,
.ghost-link:hover {
  transform: translateY(-1px);
}

.page-content {
  display: grid;
  gap: 1rem;
}

.page-section,
.hero-grid,
.dashboard-grid,
.auth-shell,
.split-grid,
.config-stack {
  display: grid;
  gap: 1.25rem;
}

.page-section,
.summary-panel,
.hero-panel,
.form-shell {
  padding: 1.25rem;
}

.narrow {
  max-width: 960px;
}

.section-heading h1,
.section-heading h2,
.hero-copy h1,
.auth-copy h1 {
  margin: 0.15rem 0 0;
  font-family: "IBM Plex Sans", sans-serif;
  font-weight: 700;
  line-height: 1.05;
}

.section-heading.with-actions {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.hero-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  align-items: stretch;
}

.hero-copy,
.auth-copy {
  padding: clamp(1.5rem, 2vw, 2rem);
  border-radius: var(--radius-xl);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.hero-copy h1,
.auth-copy h1 {
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  max-width: 12ch;
}

.hero-copy p,
.auth-copy p,
.summary-panel p {
  max-width: 60ch;
  line-height: 1.7;
  color: var(--muted);
  margin: 0;
}

.hero-actions,
.action-band,
.form-actions {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  align-items: center;
}

.report-pagination,
.table-pagination {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.report-pagination-summary,
.table-pagination-summary {
  display: grid;
  gap: 0.2rem;
  color: var(--muted);
}

.report-pagination-summary strong,
.table-pagination-summary strong {
  color: var(--ink);
}

.report-pagination-controls,
.table-pagination-controls {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  align-items: center;
}

.report-pagination-controls label,
.table-pagination-controls label {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  color: var(--muted);
  font-weight: 700;
}

.field-input.compact {
  min-width: 5.2rem;
  padding: 0.65rem 0.75rem;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

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

.metric-strip > div {
  padding: 0.95rem 1rem;
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.metric-value {
  display: block;
  font-size: clamp(1.6rem, 3vw, 2.8rem);
  font-family: "IBM Plex Mono", monospace;
  font-weight: 700;
}

.dashboard-grid,
.auth-shell {
  grid-template-columns: minmax(0, 1fr);
}

.split-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  align-items: start;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.75rem;
  align-items: center;
}

.compact-toolbar {
  grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(0, 0.85fr)) auto auto;
}

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

.field-grid.single {
  grid-template-columns: minmax(0, 1fr);
}

.field-block {
  display: grid;
  gap: 0.35rem;
}

.field-block.span-2 {
  grid-column: span 2;
}

.field-block label {
  font-weight: 700;
}

.field-input {
  width: 100%;
  min-height: 3.2rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: var(--surface-strong);
  color: var(--ink);
}

.field-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.field-input.color-input {
  padding: 0.45rem;
}

.area-input {
  min-height: 7.5rem;
  resize: vertical;
}

.toggle-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.toggle-field {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.validation-summary {
  padding: 1rem 1.1rem;
  color: var(--danger);
  border-radius: var(--radius-md);
  background: #fff;
}

.validation-summary:empty {
  display: none;
}

.field-error {
  color: var(--danger);
  font-size: 0.9rem;
}

.helper-text {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
  font-size: 0.92rem;
}

.field-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
}

.table-shell {
  overflow-x: auto;
  overflow-y: hidden;
  box-shadow: var(--shadow-soft);
}

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

.app-table th,
.app-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.app-table th {
  color: #475467;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: #f8fafc;
}

.actions-column {
  width: 1%;
  white-space: nowrap;
}

.inline-form {
  display: inline;
}

.inline-link {
  color: var(--accent-strong);
  font-weight: 700;
  margin-right: 0.75rem;
}

.inline-link.destructive {
  color: var(--danger);
  background: none;
  border: 0;
  padding: 0;
}

.status {
  display: inline-flex;
  padding: 0.32rem 0.68rem;
  border-radius: 999px;
  font-size: 0.83rem;
  font-weight: 700;
}

.status.done {
  background: var(--success-soft);
  color: var(--success);
}

.status.active {
  background: rgba(241, 185, 79, 0.16);
  color: #8a5a00;
}

.status.pending {
  background: var(--warning-soft);
  color: var(--warning);
}

.empty-state {
  padding: 2rem 0;
  text-align: center;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
}

.detail-block {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  border-radius: 1rem;
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.detail-block.span-2 {
  grid-column: span 2;
}

.detail-value {
  font-weight: 700;
}

.meta-band {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--muted);
}

.inline-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  margin-right: 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.inline-badge.warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.inline-badge.ok {
  background: var(--success-soft);
  color: var(--success);
}

.table-row-attention td {
  background: rgba(181, 71, 8, 0.045);
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  font-weight: 700;
}

.doc-card-grid,
.document-grid {
  display: grid;
  gap: 1.25rem;
}

.doc-card-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.doc-card,
.document-card-panel,
.document-hero,
.document-toolbar,
.report-filter-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  box-shadow: var(--shadow-soft);
}

.doc-card,
.document-card-panel,
.document-hero,
.document-toolbar,
.report-filter-panel {
  border-radius: var(--radius-lg);
}

.doc-card,
.document-card-panel {
  padding: 1.5rem;
}

.doc-card h3,
.document-card-panel h2,
.document-hero h1 {
  margin: 0.2rem 0 0.65rem;
  font-family: "IBM Plex Sans", sans-serif;
}

.doc-card p,
.document-hero p,
.narrative-stack p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.compact-heading h2 {
  font-size: 1.25rem;
}

.document-page {
  display: grid;
  gap: 1.25rem;
}

.print-layout {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

.print-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem;
}

.document-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: flex-end;
  padding: 1rem 1.1rem;
}

.document-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.5rem;
}

.document-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.detail-grid.compact {
  padding: 0;
}

.timeline-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.timeline-grid > div,
.report-filter-panel .field-grid {
  padding: 0;
}

.timeline-grid > div {
  display: grid;
  gap: 0.2rem;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.timeline-grid strong {
  font-size: 0.92rem;
}

.narrative-stack {
  display: grid;
  gap: 1rem;
}

.narrative-stack strong {
  display: block;
  margin-bottom: 0.35rem;
}

.print-shell-block {
  box-shadow: none;
  border: 1px solid var(--line);
}

.dispatch-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.dispatch-switcher a {
  text-decoration: none;
}

.readonly-field {
  display: flex;
  align-items: center;
  min-height: 3.25rem;
}

.recipient-grid {
  display: grid;
  gap: 0.9rem;
}

.recipient-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem;
  align-items: start;
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  cursor: pointer;
}

.recipient-card input[type="checkbox"] {
  margin-top: 0.2rem;
}

.recipient-card strong,
.recipient-meta span {
  display: block;
}

.recipient-card > div span {
  color: var(--muted);
}

.recipient-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin-top: 0.45rem;
  font-size: 0.92rem;
}

.dispatch-history-list {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.brand-preview-panel,
.security-note {
  padding: 1.5rem;
}

.brand-preview {
  margin-top: 1rem;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.9)),
    linear-gradient(135deg, var(--preview-primary), var(--preview-secondary));
  border: 1px solid rgba(255, 255, 255, 0.7);
  display: grid;
  gap: 1rem;
}

.brand-preview-header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem;
  align-items: center;
}

.brand-preview-header strong,
.brand-preview-body strong {
  display: block;
  font-family: "IBM Plex Sans", sans-serif;
}

.brand-preview-header span,
.brand-preview-body span {
  color: var(--muted);
}

.brand-preview-logo-frame,
.brand-preview-mark {
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 1.25rem;
  display: grid;
  place-items: center;
}

.brand-preview-logo-frame {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.brand-preview-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.45rem;
}

.brand-preview-mark {
  background: linear-gradient(135deg, var(--preview-primary), var(--preview-secondary));
  color: white;
  font-size: 1.35rem;
  font-weight: 800;
  font-family: "IBM Plex Mono", monospace;
}

.brand-preview-body {
  display: grid;
  gap: 0.2rem;
}

.brand-palette {
  display: flex;
  gap: 0.75rem;
}

.brand-palette span {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 0 0 1px rgba(22, 35, 44, 0.08);
}

.config-meta-grid {
  margin-top: 1rem;
}

.compact-empty-state {
  padding: 1rem 0;
}

.document-footer-note {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.document-footer-note span {
  display: block;
  font-weight: 700;
  color: var(--ink);
}

.document-footer-note p {
  margin: 0.35rem 0 0;
  line-height: 1.6;
}

.role-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.role-chip {
  display: inline-flex;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.85rem;
  font-weight: 700;
}

.security-cell {
  display: grid;
  gap: 0.4rem;
}

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

.scope-option-list {
  display: grid;
  gap: 0.75rem;
}

.scope-option-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: start;
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.scope-option-card strong,
.scope-option-card small {
  display: block;
}

.scope-option-card small {
  margin-top: 0.2rem;
  color: var(--muted);
  line-height: 1.45;
}

.scope-option-card input {
  margin-top: 0.25rem;
}

.inner-shell {
  padding: 1.25rem;
  margin-top: 1rem;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: none;
}

.role-selection-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.role-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: start;
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.role-option strong,
.role-option small {
  display: block;
}

.role-option small {
  margin-top: 0.2rem;
  color: var(--muted);
  line-height: 1.5;
}

.role-option input {
  margin-top: 0.25rem;
}

.info-banner,
.info-banner h2,
.info-banner p {
  margin: 0;
}

.info-banner {
  display: grid;
  gap: 0.45rem;
}

.password-hint {
  margin-top: 0.85rem;
}

.report-filter-panels {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.report-hub {
  display: grid;
  gap: 1rem;
}

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

.report-card {
  display: grid;
  gap: 0.4rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-soft);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.report-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.report-card strong {
  font-size: 0.98rem;
}

.report-card span {
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.92rem;
}

.report-card.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.system-toast {
  display: grid;
  gap: 0.18rem;
  justify-self: end;
  max-width: min(100%, 620px);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: #ffffff;
  border-left: 4px solid var(--accent);
  box-shadow: var(--shadow-soft);
  animation: slideFadeIn 180ms ease both;
}

.system-toast span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.system-toast strong {
  font-weight: 600;
}

@keyframes slideFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.report-filter-panel {
  display: none;
  padding: 1rem;
}

.report-filter-panel.active {
  display: block;
}

.permission-layout {
  display: grid;
  gap: 1.25rem;
}

.permission-shell {
  display: grid;
  gap: 1rem;
}

.permission-group {
  display: grid;
  gap: 0.85rem;
}

.permission-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.permission-table th.center-cell,
.permission-table td.center-cell {
  text-align: center;
}

.permission-table input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
}

.compact-input {
  max-width: 7rem;
}

.permission-card {
  min-height: 100%;
}

.permission-checks,
.inline-filter {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.permission-checks label,
.inline-filter label {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 0.86rem;
  gap: 0.35rem;
  margin: 0;
}

.inline-filter .field-input {
  min-width: min(20rem, 100%);
}

.mobile-backdrop {
  display: none;
}

@media (max-width: 1100px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .split-grid {
    grid-template-columns: 1fr;
  }

  .doc-card-grid,
  .document-grid.two-up,
  .timeline-grid,
  .role-selection-grid,
  .scope-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(84vw, 320px);
    transform: translateX(-110%);
    transition: transform 180ms ease;
    z-index: 20;
  }

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

  .mobile-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(12, 18, 22, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
    z-index: 10;
  }

  body.nav-open .mobile-backdrop {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  .nav-toggle {
    display: inline-flex;
  }
}

@media (max-width: 760px) {
  .workspace {
    padding: 1rem 1rem 1.5rem;
  }

  .toolbar,
  .field-grid,
  .detail-grid,
  .metric-strip,
  .metric-strip.dense,
  .doc-card-grid,
  .document-grid.two-up,
  .timeline-grid {
    grid-template-columns: 1fr;
  }

  .field-block.span-2,
  .detail-block.span-2 {
    grid-column: span 1;
  }

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

  .brand-preview-header {
    grid-template-columns: 1fr;
  }

  .document-hero,
  .document-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-panel {
    width: 100%;
    justify-content: space-between;
  }
}

@media print {
  body.print-layout {
    background: white;
  }

  .document-toolbar,
  .nav-toggle,
  .mobile-backdrop,
  .topbar,
  .sidebar {
    display: none !important;
  }

  .print-shell {
    max-width: none;
    padding: 0;
  }

  .document-card-panel,
  .document-hero,
  .table-shell,
  .detail-grid {
    background: white;
    box-shadow: none;
    backdrop-filter: none;
  }

  a {
    color: inherit;
    text-decoration: none;
  }
}
