:root {
    --bg: #eef0f3;
    --surface: #f5f5f6;
    --surface-soft: #eef1f4;
    --panel: #ffffff;
    --panel-muted: #f0f0f1;
    --ink: #2f333b;
    --muted: #8c93a3;
    --line: #d7dbe1;
    --header: #2f3239;
    --sidebar: #353941;
    --sidebar-deep: #000000;
    --brand: #ef3848;
    --primary: #21a4dd;
    --primary-strong: #1598d2;
    --accent: #ff9800;
    --success: #2f975b;
    --danger: #c93f3f;
    --radius: 10px;
    --shadow: 0 8px 24px rgba(17, 26, 39, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: "Open Sans", "Segoe UI", Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
}

body {
    min-height: 100vh;
}

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

.shell-body {
    background: var(--bg);
}

.shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: var(--sidebar);
    color: #ffffff;
    display: flex;
    flex-direction: column;
}

.legacy-brand {
    background: var(--sidebar-deep);
    padding: 18px 18px 12px;
    margin: 0;
}

.legacy-brand h1 {
    margin: 0;
    color: var(--brand);
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    text-transform: lowercase;
}

.legacy-user-card {
    background: var(--sidebar-deep);
    padding: 0 18px 18px;
    border: 0;
    border-radius: 0;
}

.welcome-label {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.legacy-user-card strong,
.legacy-user-card small {
    display: block;
}

.legacy-user-card strong {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
}

.legacy-user-card small {
    margin-top: 4px;
    color: #42ace2;
    font-size: 14px;
    font-weight: 600;
}

.nav {
    display: grid;
    gap: 0;
    padding: 0;
}

.legacy-nav {
    flex: 1 1 auto;
    padding-top: 4px;
}

.nav-divider {
    height: 24px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 18px;
    color: #ffffff;
    border-left: 3px solid transparent;
    background: transparent;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.04);
}

.nav-link.is-active {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--primary);
}

.nav-icon {
    width: 22px;
    flex: 0 0 22px;
    min-height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.84);
}

.nav-icon-image {
    width: 18px;
    height: 18px;
    object-fit: contain;
    display: block;
}

.nav-copy {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
}

.sidebar-footer {
    margin-top: auto;
    padding: 18px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 11px;
    text-transform: uppercase;
}

.content {
    background: var(--bg);
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: var(--header);
    color: #ffffff;
    padding: 16px 28px;
}

.topbar-title h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 28px;
}

.topbar-user strong,
.topbar-user small {
    display: block;
    text-align: left;
}

.topbar-user strong {
    font-size: 14px;
}

.topbar-user small {
    margin-top: 4px;
    color: #42ace2;
    font-size: 13px;
    font-weight: 600;
}

.logout-link {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
}

.menu-toggle {
    display: none;
}

.page-head,
.dashboard-shell,
.filter-bar,
.workspace,
.card,
.dashboard-status {
    margin-left: 28px;
    margin-right: 28px;
}

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

.page-head h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #333740;
    text-transform: uppercase;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.lead {
    margin: 8px 0 0;
    color: #4a5160;
    line-height: 1.5;
    font-size: 14px;
}

.badge,
.mini-pill,
.record-chip,
.segment {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 6px;
    background: #9296ad;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.alert-error,
.alert-success {
    margin: 0 28px 18px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
}

.alert-error {
    background: #f8e5e5;
    border: 1px solid #efc8c8;
    color: #a43737;
}

.alert-success {
    background: #e5f3ea;
    border: 1px solid #c6e4d1;
    color: #2a7a49;
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    margin-bottom: 18px;
}

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

.admin-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
    align-items: end;
}

.admin-summary-pills {
    margin-top: 16px;
}

.table-pager {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
    margin-top: 12px;
}

.ghost-button.is-disabled {
    pointer-events: none;
    opacity: 0.45;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-chip.tone-green {
    background: #dff4e7;
    color: #24784b;
}

.status-chip.tone-red {
    background: #f9dfe1;
    color: #af2f3a;
}

.status-chip.tone-blue {
    background: #dceefe;
    color: #166ea1;
}

.status-chip.tone-amber {
    background: #ffefcf;
    color: #a36200;
}

.status-chip.tone-neutral {
    background: #eceff3;
    color: #6e7586;
}

.stack-card {
    margin-top: 18px;
    padding: 18px 20px;
    border: 1px solid #d6d9e5;
    border-radius: 14px;
    background: #ffffff;
}

.stack-card h5 {
    margin: 0 0 14px;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #7d86a7;
}

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

.attachment-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #d6d9e5;
    border-radius: 10px;
    background: #f7f8fc;
}

.upload-shell {
    margin-top: 18px;
}

.legacy-entity-panel {
    margin: 18px 0;
}

.legacy-entity-title,
.legacy-entity-subtitle {
    padding: 12px 16px;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
}

.legacy-entity-title {
    background: #55a8d6;
    font-size: 16px;
}

.legacy-entity-subtitle {
    margin-top: 10px;
    background: #3b7db8;
    font-size: 14px;
}

.legacy-entity-body {
    padding: 18px 16px 10px;
}

.legacy-entity-name {
    margin: 0 0 18px;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    color: #24324a;
}

.legacy-entity-contact {
    margin: -6px 0 18px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    color: #5a6a86;
}

.legacy-entity-actions {
    display: flex;
    gap: 10px;
    margin: 0 0 16px;
}

.legacy-company-picker-row {
    display: none;
}

.legacy-company-picker-row.is-open {
    display: grid;
}

.admin-filter-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

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

.analytics-card {
    background: #ffffff;
    border: 1px solid #e0e3e7;
    padding: 18px;
}

.analytics-card-wide {
    grid-column: 1 / -1;
}

.trend-chart {
    margin-top: 18px;
}

.trend-lines {
    display: grid;
    gap: 12px;
}

.trend-series {
    display: grid;
    gap: 8px;
}

.trend-series-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #333740;
    font-size: 13px;
    font-weight: 700;
}

.trend-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    flex: 0 0 auto;
}

.trend-series svg {
    width: 100%;
    height: 90px;
    display: block;
    background:
        linear-gradient(to top, #eef2f7 1px, transparent 1px) 0 0 / 100% 25% repeat-y;
}

.trend-axis {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
    color: #727a8c;
    font-size: 12px;
    text-align: center;
}

.mix-bars,
.owner-bars {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.mix-row,
.owner-row {
    display: grid;
    gap: 10px;
    align-items: center;
}

.mix-copy,
.owner-copy {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: #333740;
}

.mix-copy strong,
.owner-copy strong {
    font-size: 14px;
}

.mix-copy span,
.owner-copy span,
.owner-total {
    color: #727a8c;
    font-size: 13px;
    font-weight: 700;
}

.mix-track,
.owner-track {
    width: 100%;
    height: 10px;
    background: #e8edf3;
    overflow: hidden;
}

.mix-fill,
.owner-fill {
    display: block;
    height: 100%;
}

.mix-sky {
    background: #3aa0d8;
}

.mix-green {
    background: #2a9d62;
}

.mix-amber {
    background: #f29a1f;
}

.owner-row {
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) 48px;
}

.owner-fill {
    background: linear-gradient(90deg, #3aa0d8 0%, #2d6cdf 100%);
}

.filter-bar input,
.login-form input,
.field input,
.field textarea,
.field select {
    width: 100%;
    border: 1px solid #9396ab;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    font-size: 15px;
    border-radius: 4px;
    padding: 10px 12px;
    outline: none;
}

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

.rich-editor {
    border: 1px solid #ccd3df;
    background: #fff;
}

.rich-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    border-bottom: 1px solid #dde3ec;
    background: #f5f7fb;
}

.rich-editor-button {
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid #b8c1d2;
    background: #ffffff;
    color: #24324a;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.rich-editor-surface {
    min-height: 220px;
    padding: 12px;
    color: var(--ink);
    outline: none;
}

.rich-editor-surface ul,
.rich-editor-surface ol {
    padding-left: 22px;
}

.rich-editor-source {
    display: none;
}

.rich-editor.is-readonly .rich-editor-surface {
    background: #f8f9fb;
}

.history-shell {
    border: 1px solid #dde3ec;
    background: #fff;
}

.history-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 14px 14px 0;
}

.history-tab {
    min-height: 34px;
    padding: 8px 14px;
    border: 0;
    background: #d8dce5;
    color: #5a6275;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
}

.history-tab.is-active {
    background: #55a8d6;
    color: #fff;
}

.history-panel {
    display: none;
    padding: 14px;
}

.history-panel.is-active {
    display: block;
}

.filter-bar button,
.ghost-button,
.secondary-button,
.primary-button,
.login-form button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 10px 16px;
    border: 0;
    border-radius: 5px;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
}

.filter-bar button,
.primary-button,
.login-form button {
    background: var(--primary);
    color: #ffffff;
}

.secondary-button {
    background: #9296ad;
    color: #ffffff;
}

.ghost-button {
    background: #d5d9e3;
    color: #333740;
}

.workspace {
    display: grid;
    gap: 18px;
    margin-bottom: 28px;
}

.legacy-panel {
    margin: 0 28px 18px;
    padding: 0;
    background: var(--surface);
    border: 1px solid #e0e3e7;
}

.legacy-detail-stack {
    padding: 24px;
}

.legacy-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 16px 16px 0;
}

.legacy-tab {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 8px 16px;
    background: #cdcbcb;
    color: #818287;
    border-radius: 10px 10px 0 0;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.legacy-tab.is-active {
    background: #ffffff;
    color: #333740;
}

.legacy-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px 0;
}

.legacy-toolbar-copy strong {
    display: block;
    color: #333740;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
}

.legacy-toolbar-copy p {
    margin: 6px 0 0;
    color: #727a8c;
    font-size: 14px;
}

.legacy-section {
    padding: 24px;
}

.legacy-section + .legacy-section {
    padding-top: 6px;
}

.legacy-section h4 {
    margin: 0 0 14px;
    color: #9296ad;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
}

.legacy-table-wrap {
    overflow-x: auto;
    background: #ffffff;
}

.legacy-table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
    background: #ffffff;
}

.legacy-table th {
    background: #4ea7d9;
    color: #ffffff;
    padding: 13px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    border: 1px solid #69b3dc;
    white-space: nowrap;
}

.legacy-table td {
    padding: 12px 10px;
    border: 1px solid #e3e7ec;
    font-size: 13px;
    color: #333740;
    text-align: center;
    background: #ffffff;
}

.legacy-empty {
    color: #7f8695;
    font-weight: 600;
    text-align: center;
}

.is-selected-row td {
    background: #eef8fd;
}

.table-link {
    color: #337ab7;
    font-weight: 700;
}

.card,
.records-pane,
.detail-pane,
.dashboard-status {
    background: var(--surface);
    border-radius: 0;
    border: 1px solid #e0e3e7;
    box-shadow: none;
    padding: 24px;
}

.pane-head,
.detail-hero,
.editor-head,
.section-head,
.section-headline,
.timeline-item {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
}

.section-head h3,
.section-headline h4,
.editor-head h3,
.detail-hero h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #333740;
    text-transform: uppercase;
}

.ops-strip,
.queue-board,
.compact-list,
.record-list,
.mini-stats,
.timeline {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

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

.ops-card,
.queue-section,
.record-card,
.compact-row,
.detail-section,
.editor-shell,
.collapsible-shell,
.module-card,
.role-card {
    background: #ffffff;
    border: 1px solid #e0e3e7;
    border-radius: 0;
    box-shadow: none;
}

.ops-card,
.queue-section,
.editor-shell,
.collapsible-shell {
    padding: 18px;
}

.ops-card strong {
    display: block;
    margin: 6px 0;
    color: #333740;
    font-size: 28px;
    font-weight: 700;
}

.ops-card p,
.compact-main p,
.compact-meta small,
.record-main p,
.record-side small,
.detail-section p,
.summary-copy p,
.kpi-card p,
.kpi-card span,
.legacy-row p,
.role-card p {
    margin: 0;
    color: #727a8c;
}

.compact-row,
.record-card {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
}

.compact-row.is-active,
.record-card.is-active {
    border-color: var(--primary);
    background: #eef8fd;
}

.compact-main strong,
.record-main strong,
.detail-section strong {
    display: block;
    font-size: 15px;
    color: #333740;
}

.compact-meta,
.record-side,
.detail-kpis {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

.detail-grid,
.form-grid,
.kpi-grid,
.two-col,
.module-grid,
.role-grid {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.detail-grid,
.form-grid,
.kpi-grid,
.two-col,
.module-grid,
.role-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.field span,
.section-label {
    font-size: 13px;
    font-weight: 700;
    color: #333740;
    text-transform: uppercase;
}

.field-full {
    grid-column: 1 / -1;
}

.field-checkbox {
    align-content: start;
}

.field-checkbox input {
    width: auto;
    margin-top: 2px;
}

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

.legacy-inline-grid.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.legacy-inline-grid.three-col {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.action-row,
.segmented-row,
.pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.collapsible-shell summary {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    list-style: none;
    cursor: pointer;
}

.collapsible-shell summary::-webkit-details-marker {
    display: none;
}

.editor-shell-inline {
    margin-top: 0;
    padding: 18px 0 0;
    border: 0;
}

.dashboard-shell {
    padding-top: 28px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 34px 34px;
    margin: 0 auto;
    max-width: 1480px;
}

.dashboard-tile {
    min-height: 94px;
    background: var(--primary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 16px 18px;
    color: #ffffff;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: none;
}

.dashboard-tile-accent {
    background: var(--accent);
}

.dashboard-tile strong {
    font-size: 16px;
    font-weight: 700;
}

.dashboard-tile-icon {
    min-width: 36px;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
}

.dashboard-tile-image {
    width: 34px;
    height: 34px;
    object-fit: contain;
    display: block;
}

.dashboard-status {
    margin-top: 32px;
}

.login-body {
    background:
        radial-gradient(circle at 12% 16%, rgba(255, 255, 255, 0.12) 0 2px, transparent 3px),
        radial-gradient(circle at 78% 24%, rgba(255, 255, 255, 0.16) 0 2px, transparent 3px),
        radial-gradient(circle at 82% 74%, rgba(255, 255, 255, 0.12) 0 2px, transparent 3px),
        linear-gradient(180deg, #0f4a78 0%, #0f4a78 100%);
    min-height: 100vh;
}

.login-legacy {
    position: relative;
}

.login-legacy::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 220px 220px;
    mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
    opacity: 0.22;
    pointer-events: none;
}

.login-shell {
    width: min(100%, 760px);
    margin: 0 auto;
    padding: 24px;
}

.legacy-login-card {
    max-width: 570px;
    margin: 24px auto 0;
    padding: 44px 84px 36px;
    background: #eff1f3;
    border-radius: 16px;
    border: 0;
    box-shadow: none;
}

.login-brand h1 {
    margin: 0 0 34px;
    color: var(--brand);
    font-size: 54px;
    font-weight: 800;
    line-height: 0.95;
    text-align: center;
    text-transform: lowercase;
}

.login-copy {
    margin: 0 0 28px;
    color: #333740;
    font-size: 16px;
    line-height: 1.35;
}

.legacy-login-form {
    display: grid;
    gap: 20px;
}

.legacy-login-form label {
    display: grid;
    gap: 8px;
}

.legacy-login-form span {
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    color: #333740;
}

.legacy-login-form button {
    width: 180px;
    margin: 8px auto 0;
}

.remember-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.remember-row em {
    font-style: normal;
    color: #333740;
    font-size: 16px;
}

.remember-row input {
    width: auto;
}

.login-footer-note {
    margin-top: 30px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(51, 55, 64, 0.76);
}

.bottom-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    display: none;
    gap: 8px;
    padding: 8px;
    border-radius: 10px;
    background: var(--header);
    z-index: 30;
}

.bottom-link {
    min-width: 0;
    flex: 1 1 0;
    display: grid;
    gap: 4px;
    justify-items: center;
    padding: 9px 6px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.72);
}

.bottom-link.is-active {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.bottom-link span {
    font-size: 11px;
    font-weight: 700;
}

.bottom-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 18px;
}

.bottom-icon-image {
    width: 18px;
    height: 18px;
    object-fit: contain;
    display: block;
}

.bottom-link small {
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 981px) {
    .workspace {
        grid-template-columns: minmax(420px, 1.2fr) minmax(340px, 0.8fr);
        align-items: start;
    }

    .detail-pane {
        position: sticky;
        top: 16px;
    }
}

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

    .sidebar {
        position: fixed;
        z-index: 40;
        left: 0;
        top: 0;
        bottom: 0;
        width: min(82vw, 260px);
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }

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

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 38px;
        padding: 0 14px;
        border: 0;
        border-radius: 6px;
        background: rgba(255, 255, 255, 0.08);
        color: #ffffff;
        font: inherit;
        font-size: 14px;
        font-weight: 700;
        cursor: pointer;
    }

    .topbar,
    .compact-row,
    .record-card,
    .detail-hero,
    .editor-head,
    .pane-head,
    .section-head,
    .section-headline,
    .collapsible-shell summary,
    .page-head {
        flex-direction: column;
    }

    .topbar-user,
    .detail-kpis,
    .compact-meta,
    .record-side {
        justify-content: flex-start;
    }

    .dashboard-grid,
    .ops-strip,
    .detail-grid,
    .form-grid,
    .legacy-inline-grid,
    .kpi-grid,
    .admin-filter-grid,
    .admin-analytics-grid,
    .two-col,
    .module-grid,
    .role-grid {
        grid-template-columns: 1fr;
    }

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

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

    .content {
        padding-bottom: 80px;
    }

    .page-head,
    .dashboard-shell,
    .filter-bar,
    .workspace,
    .card,
    .dashboard-status,
    .legacy-panel {
        margin-left: 16px;
        margin-right: 16px;
    }

    .topbar {
        padding-left: 16px;
        padding-right: 16px;
    }

    .alert-error,
    .alert-success {
        margin-left: 16px;
        margin-right: 16px;
    }

    .bottom-nav {
        display: flex;
    }
}

@media (max-width: 640px) {
    .legacy-login-card {
        padding: 28px 20px 26px;
        margin-top: 8px;
    }

    .login-brand h1 {
        font-size: 42px;
    }

    .legacy-login-form span {
        font-size: 16px;
    }

    .dashboard-tile {
        min-height: 80px;
        border-radius: 10px;
    }

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

    .legacy-entity-actions {
        flex-direction: column;
        align-items: stretch;
    }
}
