:root {
    color-scheme: light;
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-muted: #eef2f7;
    --text: #18202f;
    --muted: #677086;
    --line: #d9e0ea;
    --brand: #176b87;
    --brand-dark: #0f4d61;
    --accent: #b9822f;
    --danger: #b42318;
    --success: #157f3b;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

body.modal-open {
    overflow: hidden;
}

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

.site-shell {
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr;
}

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.topbar-inner,
.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.topbar-inner {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: var(--brand-dark);
}

.brand-mark {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    background: var(--brand);
    color: #fff;
}

.brand-logo {
    max-width: 42px;
    max-height: 42px;
    object-fit: contain;
}

.nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.nav a,
.button,
button {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    border: 1px solid transparent;
    padding: 8px 14px;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
}

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

.nav a:hover {
    color: var(--brand-dark);
    background: var(--surface-muted);
}

.button,
button {
    background: var(--brand);
    color: #fff;
}

.button.secondary {
    background: var(--surface);
    color: var(--brand-dark);
    border-color: var(--line);
}

.main {
    padding: 34px 0;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    gap: 28px;
    align-items: center;
    min-height: 440px;
}

.hero h1 {
    font-size: clamp(36px, 6vw, 68px);
    line-height: 1;
    margin: 0 0 18px;
    letter-spacing: 0;
}

.hero p {
    color: var(--muted);
    font-size: 18px;
    max-width: 640px;
}

.hero-panel,
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.hero-panel {
    padding: 24px;
}

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

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

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

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.section-head h2 {
    margin: 0;
}

.compact-list {
    display: grid;
    gap: 8px;
}

.compact-list a {
    display: grid;
    gap: 3px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.compact-list a:hover {
    border-color: #bddbe5;
    background: #f8fcfd;
}

.compact-list span {
    color: var(--muted);
    font-size: 13px;
}

.card {
    padding: 18px;
}

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

.page-head h1 {
    margin: 0 0 6px;
}

.notice {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid #b7dfc5;
    border-radius: 8px;
    background: #edf8f0;
    color: var(--success);
    font-weight: 700;
}

.notice.danger {
    border-color: #f0b8b8;
    background: #fff0f0;
    color: var(--danger);
}

.registration-closed-notice {
    max-width: 620px;
    display: grid;
    gap: 8px;
    margin-top: 18px;
    color: #1f4d34;
}

.registration-closed-notice strong {
    color: var(--success);
}

.registration-closed-notice .button {
    width: fit-content;
}

.metric {
    color: var(--brand-dark);
    font-size: 30px;
    font-weight: 800;
}

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

.layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 24px;
}

.sidebar {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    align-self: start;
}

.sidebar a {
    display: block;
    padding: 10px 12px;
    border-radius: 6px;
    color: var(--muted);
    font-weight: 650;
}

.nav-count {
    float: right;
    min-width: 22px;
    min-height: 22px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-size: 12px;
}

.sidebar a:hover {
    background: var(--surface-muted);
    color: var(--brand-dark);
}

.sidebar a.active {
    background: #e6f4f8;
    color: var(--brand-dark);
}

.sidebar-toggle {
    display: none;
    margin-bottom: 12px;
}

.content {
    min-width: 0;
}

.table-wrap {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

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

.actions form {
    margin: 0;
}

.danger {
    background: var(--danger);
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    padding: 3px 9px;
    background: var(--surface-muted);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.badge.success {
    background: #e8f6ed;
    color: var(--success);
}

.badge.danger-badge {
    background: #fdecec;
    color: var(--danger);
}

.status-submitted,
.status-in_review,
.status-pending,
.status-sent,
.status-assigned,
.status-started,
.status-overdue,
.status-unpaid {
    background: #fff4de;
    color: #9a5c00;
}

.status-approved,
.status-confirmed,
.status-completed,
.status-reviewed,
.status-paid {
    background: #e8f6ed;
    color: var(--success);
}

.status-rejected,
.status-cancelled,
.status-void,
.status-refunded {
    background: #fdecec;
    color: var(--danger);
}

.status-draft {
    background: var(--surface-muted);
    color: var(--muted);
}

.line-item-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 110px 160px;
    gap: 12px;
    align-items: start;
}

.thread {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

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

.feature-image {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: 8px;
    margin: 12px 0 20px;
}

.message-bubble {
    max-width: 760px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.message-bubble.mine {
    justify-self: end;
    background: #eef8fb;
    border-color: #bddbe5;
}

.message-bubble.theirs {
    justify-self: start;
}

.message-bubble header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 8px;
}

.message-bubble p {
    margin: 0;
    white-space: pre-wrap;
}

.message-moderation-form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.message-moderation-form input {
    min-height: 36px;
    font-size: 13px;
}

.status-archived,
.status-closed,
.status-draft {
    background: var(--surface-muted);
    color: var(--muted);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table-wrap table {
    min-width: 920px;
}

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

th {
    color: var(--muted);
    background: #f8fafc;
    font-size: 12px;
    text-transform: uppercase;
}

.form-card {
    width: min(460px, calc(100% - 32px));
    margin: 42px auto;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

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

.span-2,
.form-actions {
    grid-column: 1 / -1;
}

.checkbox-field label,
.check-list label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.checkbox-field input,
.check-list input {
    width: auto;
    min-height: auto;
}

.check-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
}

.workflow-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.inline-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.inline-filters input,
.inline-filters select {
    width: auto;
    min-width: 180px;
}

.inline-filters .field {
    margin-bottom: 0;
}

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

.availability-row {
    display: grid;
    grid-template-columns: 150px 150px 150px;
    gap: 10px;
    align-items: center;
}

.blocked-date-row {
    grid-template-columns: 160px 130px 130px minmax(180px, 1fr);
}

.availability-row label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.availability-row input[type="checkbox"] {
    width: auto;
    min-height: auto;
}

.pagination-wrap {
    margin-top: 16px;
}

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

.detail-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 16px;
}

.definition-list {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 10px 18px;
    margin: 0;
}

.definition-list dt {
    color: var(--muted);
    font-weight: 800;
}

.definition-list dd {
    margin: 0;
}

.alert-card {
    border-color: #f2b8b5;
    background: #fff7f7;
    margin-bottom: 16px;
}

.notice-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.notice-card p {
    margin: 6px 0 0;
}

.note-list {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.note-card {
    display: grid;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.note-card__body {
    white-space: pre-wrap;
    color: var(--text);
    line-height: 1.65;
}

.note-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    color: var(--muted);
    font-size: 13px;
}

.note-card__edit {
    display: grid;
    gap: 10px;
}

.notification-matrix {
    margin-top: 4px;
}

.notification-matrix table {
    min-width: 520px;
}

.notification-matrix th:nth-child(2),
.notification-matrix th:nth-child(3),
.notification-matrix td:nth-child(2),
.notification-matrix td:nth-child(3) {
    width: 120px;
    text-align: center;
}

.compact-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text);
    font-weight: 650;
}

.confirm-modal[hidden] {
    display: none;
}

.confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 20px;
}

.confirm-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(24, 32, 47, 0.52);
}

.confirm-modal__panel {
    position: relative;
    z-index: 1;
    width: min(440px, 100%);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
}

.confirm-modal__icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #fdecec;
    color: var(--danger);
    font-weight: 900;
}

.confirm-modal__panel h2 {
    margin: 0 0 6px;
}

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

.confirm-modal__actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

body.drawer-open {
    overflow: hidden;
}

details > summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    cursor: pointer;
}

details > summary::-webkit-details-marker {
    display: none;
    width: 0;
    height: 0;
}

details > summary::marker {
    content: "";
    font-size: 0;
}

details > summary::after {
    content: "";
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    margin-left: 2px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    opacity: 0.62;
    transform: rotate(45deg) translateY(-1px);
    transform-origin: center;
    transition: transform 140ms ease, opacity 140ms ease;
}

details[open] > summary::after {
    opacity: 0.78;
    transform: rotate(225deg) translate(-1px, -1px);
}

details > summary svg,
.accordion svg,
.accordion-icon,
.chevron,
.caret,
.expand-icon,
.collapse-icon,
[data-accordion] svg,
[aria-expanded] svg {
    width: 16px;
    height: 16px;
    min-width: 16px;
    max-width: 16px;
    min-height: 16px;
    max-height: 16px;
    flex: 0 0 16px;
    font-size: 16px;
    line-height: 1;
}

details[open]::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(17, 24, 39, 0.42);
}

details[open] .nested-form {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    width: min(760px, 100vw);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    overflow-y: auto;
    padding: 24px;
    border-left: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}

.drawer-head {
    position: sticky;
    top: -24px;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: -24px -24px 4px;
    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
}

.drawer-head h2 {
    margin: 0;
}

.inline-filter {
    min-width: 220px;
}

.inline-edit {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 360px;
}

.inline-edit select {
    width: auto;
    min-width: 120px;
}

.stack {
    display: grid;
    gap: 14px;
}

.answer-block {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.answer-block p:last-child {
    margin-bottom: 0;
}

.choice-list {
    display: grid;
    gap: 8px;
    padding: 10px 0;
}

.choice-list label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.choice-list input {
    width: auto;
    min-height: auto;
}

.required {
    color: var(--danger);
}

.hidden-field {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.field {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
}

label {
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 9px 11px;
    font: inherit;
}

input:focus,
textarea:focus,
select:focus,
button:focus,
a:focus {
    outline: 3px solid rgba(23, 107, 135, 0.25);
    outline-offset: 2px;
}

.field-invalid {
    border-color: var(--danger);
    background: #fff8f8;
}

.notification-card {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.notification-card.unread {
    border-color: #bddbe5;
    background: #f8fcfd;
}

.export-button {
    margin: 0 0 10px;
}

.table-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 12px;
}

.table-search {
    width: min(320px, 100%);
}

.table-toolbar .export-button {
    margin: 0;
}

button.is-loading {
    opacity: 0.78;
    pointer-events: none;
}

.error {
    color: var(--danger);
    font-size: 14px;
}

.option-list {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

.option-list label {
    align-items: center;
    display: flex;
    font-weight: 500;
    gap: 8px;
}

.option-list input {
    min-height: auto;
    width: auto;
}

.slot-picker {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
}

.slot-button {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-height: 58px;
    padding: 10px;
    text-align: left;
}

.slot-button small {
    color: var(--muted);
    font-size: 12px;
}

.slot-button.active,
.slot-button:hover {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.slot-button.active small,
.slot-button:hover small {
    color: #e7f7fb;
}

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

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

    .sidebar {
        display: none;
    }

    .sidebar.open {
        display: block;
    }

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

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

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

    .detail-grid,
    .definition-list,
    .line-item-grid,
    .availability-row {
        grid-template-columns: 1fr;
    }

    .page-head {
        flex-direction: column;
    }
}

@media (max-width: 560px) {
    .topbar-inner {
        align-items: flex-start;
        flex-direction: column;
        padding: 14px 0;
    }

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

/* Platform UI refinement layer */
:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-muted: #f3f6fa;
    --surface-strong: #eaf2f6;
    --text: #111827;
    --muted: #5f6b7a;
    --line: #dbe4ef;
    --line-strong: #c7d5e5;
    --brand: #0e6f86;
    --brand-dark: #084b5c;
    --brand-soft: #e5f4f7;
    --accent: #b8842f;
    --accent-soft: #fff5e4;
    --danger: #b42318;
    --success: #0f7a43;
    --warning: #9a5c00;
    --radius-sm: 6px;
    --radius: 8px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 14px 34px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.14);
}

body {
    background:
        radial-gradient(circle at top left, rgba(14, 111, 134, 0.09), transparent 28rem),
        linear-gradient(180deg, #f8fbfe 0%, var(--bg) 26rem);
    font-size: 15px;
}

h1,
h2,
h3 {
    color: #0d1829;
    line-height: 1.18;
}

h1 {
    font-size: clamp(30px, 3.4vw, 42px);
    margin: 0 0 8px;
    font-weight: 650;
}

h2 {
    font-size: clamp(20px, 2vw, 26px);
    margin: 0 0 10px;
    font-weight: 650;
}

h3 {
    font-size: 17px;
    font-weight: 650;
    margin: 0 0 8px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    margin-bottom: 8px;
    color: var(--brand);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    box-shadow: 0 1px 0 rgba(219, 228, 239, 0.8);
}

.topbar-inner,
.container {
    width: min(1240px, calc(100% - 32px));
}

.brand {
    font-size: 18px;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    box-shadow: 0 10px 24px rgba(14, 111, 134, 0.22);
}

.nav {
    gap: 6px;
}

.mobile-nav-toggle {
    display: none;
}

.nav a {
    border-radius: var(--radius-sm);
    color: #566174;
}

.nav a.button {
    color: #fff;
}

.nav a:hover {
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.nav a.button:hover {
    background: var(--brand-dark);
    color: #fff;
}

.button,
button {
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease;
}

.button:hover,
button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.button.secondary {
    background: #fff;
}

.main {
    padding: 36px 0 56px;
}

.hero {
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
    gap: 34px;
    min-height: 470px;
}

.hero-copy {
    max-width: 760px;
}

.hero h1 {
    max-width: 680px;
    font-size: clamp(38px, 5vw, 58px);
    line-height: 1.06;
    font-weight: 650;
}

.hero p {
    color: #4b5b6f;
    font-size: 17px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
}

.trust-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.trust-strip span {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.72);
    color: #3f4f63;
    font-size: 14px;
    font-weight: 600;
}

.hero-panel,
.card,
.form-card,
.table-wrap,
.sidebar {
    border-color: rgba(199, 213, 229, 0.9);
    box-shadow: var(--shadow-sm);
}

.hero-panel,
.card,
.form-card {
    background: rgba(255, 255, 255, 0.94);
}

.hero-panel {
    padding: 24px;
    box-shadow: var(--shadow-md);
}

.service-preview {
    position: relative;
    overflow: hidden;
}

.service-preview::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--brand), var(--accent));
}

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

.service-tile,
.feature-card,
.stat-card {
    position: relative;
    overflow: hidden;
}

.service-tile {
    min-height: 104px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #fff, #f8fbfd);
}

.homepage-hero-image {
    width: 100%;
    min-height: 320px;
    max-height: 520px;
    display: block;
    border-radius: 8px;
    object-fit: cover;
}

.homepage-content-block {
    max-width: 920px;
}

.landing-section {
    margin-top: 28px;
}

.landing-section .section-head h2,
.service-preview .section-head h2 {
    font-size: clamp(22px, 2.2vw, 30px);
    font-weight: 650;
    line-height: 1.2;
}

.service-preview > .muted,
.landing-section .section-head .muted {
    font-size: 16px;
    line-height: 1.65;
}

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

.feature-card {
    min-height: 164px;
}

.feature-icon {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 30px;
    margin-bottom: 18px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 900;
}

.layout {
    grid-template-columns: 282px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.sidebar {
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 112px);
    overflow: auto;
    padding: 14px;
}

.sidebar-section + .sidebar-section {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.sidebar-label {
    display: block;
    margin: 0 0 7px 10px;
    color: #8692a3;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.sidebar a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 9px 10px;
}

.sidebar a::before {
    content: attr(data-icon);
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    background: var(--surface-muted);
    color: #667085;
    font-size: 10px;
    font-weight: 900;
}

.sidebar a.active {
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.sidebar a.active::before {
    background: var(--brand);
    color: #fff;
}

.sidebar-toggle {
    width: 100%;
    justify-content: space-between;
}

.page-head {
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(219, 228, 239, 0.75);
}

.page-head .actions {
    justify-content: flex-end;
}

.card {
    padding: 20px;
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.card:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-md);
}

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

.stat-card {
    min-height: 142px;
    display: grid;
    align-content: space-between;
    gap: 8px;
}

.stat-card::after {
    content: "";
    position: absolute;
    right: -34px;
    bottom: -42px;
    width: 118px;
    height: 118px;
    border-radius: 50%;
    background: rgba(14, 111, 134, 0.08);
}

.stat-card.attention::after {
    background: rgba(184, 132, 47, 0.13);
}

.stat-card span {
    color: #526071;
    font-size: 13px;
    font-weight: 850;
    text-transform: uppercase;
}

.metric {
    color: var(--brand-dark);
    font-size: 36px;
}

.dashboard-grid {
    gap: 20px;
}

.compact-list {
    gap: 10px;
}

.compact-list a {
    border-radius: var(--radius);
    transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.compact-list a:hover {
    transform: translateX(2px);
}

.compact-list:empty,
.empty-state {
    min-height: 120px;
    display: grid;
    place-items: center;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    background: #fbfdff;
    color: var(--muted);
}

.onboarding-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 20px;
    background: linear-gradient(135deg, #ffffff, #eff8fa);
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.table-wrap {
    border-radius: var(--radius);
    overflow: auto;
}

table {
    font-size: 14px;
}

th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f6f9fc;
    color: #536176;
    font-weight: 900;
}

td {
    background: #fff;
}

tbody tr:hover td {
    background: #f9fcfd;
}

.actions {
    gap: 10px;
}

.actions .button,
.actions button,
td .button,
td button {
    min-height: 34px;
    padding: 7px 11px;
}

.badge {
    min-height: 24px;
    border: 1px solid transparent;
}

.status-submitted,
.status-in_review,
.status-pending,
.status-sent,
.status-assigned,
.status-started,
.status-overdue,
.status-unpaid {
    background: var(--accent-soft);
    color: var(--warning);
}

.form-card,
.form-grid.card,
form.card {
    box-shadow: var(--shadow-sm);
}

.form-grid {
    gap: 18px;
}

.field {
    gap: 7px;
}

label {
    color: #172033;
    font-size: 14px;
}

input,
textarea,
select {
    border-color: #cfdbea;
    background: #fff;
    transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input:hover,
textarea:hover,
select:hover {
    border-color: #b6c7d9;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(14, 111, 134, 0.12);
}

.notice {
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.confirm-modal__panel {
    border-radius: var(--radius);
}

.message-bubble {
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.slot-button {
    border-color: var(--line);
}

@media (max-width: 1040px) {
    .stat-grid,
    .feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero {
        grid-template-columns: 1fr;
        min-height: auto;
    }
}

@media (max-width: 840px) {
    .layout {
        gap: 16px;
    }

    .sidebar {
        position: static;
        max-height: none;
    }

    .page-head {
        align-items: flex-start;
    }

    .page-head .actions,
    .quick-actions {
        justify-content: flex-start;
    }

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

@media (max-width: 640px) {
    .topbar-inner,
    .container {
        width: min(100% - 22px, 1240px);
    }

    .nav {
        width: 100%;
    }

    .nav a,
    .nav form,
    .nav button {
        flex: 1 1 auto;
    }

    .hero h1 {
        font-size: 38px;
    }

    .service-grid,
    .stat-grid,
    .feature-grid {
        grid-template-columns: 1fr;
    }

    .card,
    .hero-panel,
    .form-card {
        padding: 16px;
    }

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

    details[open] .nested-form {
        grid-template-columns: 1fr;
        padding: 18px;
    }

    .drawer-head {
        margin: -18px -18px 2px;
        padding: 18px;
    }
}

/* === CRM-inspired workspace shell === */
.workspace-mode {
    background: #eef3f8;
}

.workspace-mode .site-shell {
    display: block;
}

.workspace-mode > .site-shell > .topbar {
    display: none;
}

.workspace-mode .main {
    padding: 0;
}

.workspace-shell {
    --workspace-sidebar: 282px;
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(23, 107, 135, 0.12), transparent 34rem),
        #eef3f8;
}

.workspace-shell .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    width: var(--workspace-sidebar);
    height: 100vh;
    max-height: 100vh;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #101c2d;
    border: 0;
    border-radius: 0;
    box-shadow: 16px 0 42px rgba(15, 28, 45, 0.14);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 76px;
    flex: 0 0 76px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar-brand-mark,
.sidebar-avatar {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    background: linear-gradient(135deg, #2b9ec2, #22d3ee);
    color: #fff;
    font-weight: 900;
    box-shadow: 0 12px 26px rgba(34, 211, 238, 0.22);
}

.sidebar-brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 17px;
}

.sidebar-brand strong,
.sidebar-profile strong {
    display: block;
    font-weight: 600;
    line-height: 1.15;
}

.sidebar-brand small,
.sidebar-profile small {
    display: block;
    margin-top: 3px;
    color: #98a7ba;
    font-size: 12px;
}

.sidebar-nav {
    flex: 1;
    min-height: 0;
    max-height: calc(100vh - 145px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 14px 10px 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 8px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.24);
    border-radius: 999px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.36);
}

.workspace-shell .sidebar-section + .sidebar-section {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.workspace-shell .sidebar-label {
    margin: 0 0 8px 12px;
    color: rgba(255, 255, 255, 0.42);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
}

.workspace-shell .sidebar a {
    min-height: 42px;
    margin: 2px 0;
    padding: 9px 10px;
    color: #c1cad8;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 560;
    line-height: 1.35;
    transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.workspace-shell .sidebar a::before {
    background: rgba(255, 255, 255, 0.07);
    color: #b8c7d9;
    border-radius: 9px;
    font-weight: 650;
    letter-spacing: 0;
}

.workspace-shell .sidebar a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transform: translateX(2px);
}

.workspace-shell .sidebar a.active {
    background: linear-gradient(135deg, #176b87, #1a7fa0);
    color: #fff;
    box-shadow: 0 10px 24px rgba(23, 107, 135, 0.28);
}

.workspace-shell .sidebar a.active::before {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px;
    flex: 0 0 auto;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    font-size: 13px;
}

.workspace-main {
    min-height: 100vh;
    margin-left: var(--workspace-sidebar);
}

.workspace-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 28px;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid #dce5ef;
    backdrop-filter: blur(14px);
}

.workspace-topbar-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.workspace-topbar strong {
    display: block;
    color: #111827;
    font-size: 15px;
    font-weight: 560;
    line-height: 1.35;
}

.workspace-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.workspace-topbar-actions form {
    margin: 0;
}

.workspace-mode .content {
    padding: 28px;
    max-width: 1440px;
}

.workspace-mode .page-head {
    border: 0;
    padding: 0;
    margin-bottom: 22px;
}

.workspace-mode .page-head h1 {
    font-size: clamp(25px, 2.3vw, 30px);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0;
}

.workspace-mode .page-head .muted {
    font-size: 15px;
    line-height: 1.7;
}

.workspace-mode h2 {
    font-size: clamp(19px, 1.7vw, 23px);
    font-weight: 600;
    line-height: 1.28;
}

.workspace-mode .section-head h2 {
    font-size: 20px;
    font-weight: 600;
}

.workspace-mode .card,
.workspace-mode .table-card,
.workspace-mode form.card {
    border-color: #d8e3ef;
    box-shadow: 0 8px 24px rgba(15, 28, 45, 0.06);
}

.workspace-mode .card:hover {
    box-shadow: 0 12px 30px rgba(15, 28, 45, 0.08);
}

.workspace-mode .stat-grid {
    gap: 14px;
}

.workspace-mode .stat-card {
    min-height: 126px;
    border: 0;
    background: linear-gradient(180deg, #fff, #f9fbfd);
}

.workspace-mode .stat-card span {
    color: #667085;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: none;
}

.workspace-mode .metric {
    color: #101c2d;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 0;
}

.workspace-mode .table-toolbar {
    margin: 0 0 12px;
}

.workspace-mode th {
    background: #f1f5f9;
}

.workspace-mode tbody tr:hover td {
    background: #f8fbff;
}

.workspace-mode .badge {
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.workspace-mode .eyebrow {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
}

.settings-image-preview {
    display: block;
    width: auto;
    max-width: 220px;
    max-height: 76px;
    margin-top: 8px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    object-fit: contain;
}

.settings-image-preview--small {
    max-width: 64px;
    max-height: 64px;
}

.pagination-wrap {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}

.pagination-wrap nav,
nav[role="navigation"][aria-label*="Pagination"],
nav[role="navigation"][aria-label*="pagination"] {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    max-width: 100%;
    text-align: center;
}

.pagination-wrap svg,
nav[role="navigation"][aria-label*="Pagination"] svg,
nav[role="navigation"][aria-label*="pagination"] svg,
.w-5.h-5,
svg.w-5,
svg.h-5 {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px;
    max-width: 20px;
    min-height: 20px;
    max-height: 20px;
    flex: 0 0 20px;
}

.pagination-wrap a,
.pagination-wrap span,
nav[role="navigation"][aria-label*="Pagination"] a,
nav[role="navigation"][aria-label*="Pagination"] span,
nav[role="navigation"][aria-label*="pagination"] a,
nav[role="navigation"][aria-label*="pagination"] span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.pagination-wrap nav > div,
nav[role="navigation"][aria-label*="Pagination"] > div,
nav[role="navigation"][aria-label*="pagination"] > div {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pagination-wrap nav > div:first-child,
nav[role="navigation"][aria-label*="Pagination"] > div:first-child,
nav[role="navigation"][aria-label*="pagination"] > div:first-child {
    display: none !important;
    width: 100%;
    color: var(--muted);
    font-size: 14px;
}

.pagination-wrap nav > div:last-child,
nav[role="navigation"][aria-label*="Pagination"] > div:last-child,
nav[role="navigation"][aria-label*="pagination"] > div:last-child {
    width: 100%;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pagination-wrap .hidden,
nav[role="navigation"][aria-label*="Pagination"] .hidden,
nav[role="navigation"][aria-label*="pagination"] .hidden {
    display: flex !important;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.workspace-mode .sidebar-toggle {
    display: none;
}

@media (max-width: 1100px) {
    .workspace-shell {
        --workspace-sidebar: 260px;
    }

    .workspace-mode .content {
        padding: 22px;
    }
}

@media (max-width: 860px) {
    .workspace-shell .sidebar {
        height: 100vh;
        max-height: 100vh;
        transform: translateX(-100%);
        transition: transform 180ms ease;
    }

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

    .workspace-main {
        margin-left: 0;
    }

    .workspace-mode .sidebar-toggle {
        position: static;
        z-index: auto;
        width: 48px;
        height: 48px;
        display: inline-grid;
        place-items: center;
        gap: 4px;
        padding: 12px;
        flex: 0 0 48px;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: #fff;
        color: var(--brand-dark);
        box-shadow: var(--shadow-sm);
    }

    .workspace-mode .sidebar-toggle span {
        width: 18px;
        height: 2px;
        display: block;
        border-radius: 999px;
        background: currentColor;
        transition: transform 160ms ease, opacity 160ms ease;
    }

    .workspace-mode .sidebar-toggle[aria-expanded="true"] span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .workspace-mode .sidebar-toggle[aria-expanded="true"] span:nth-child(2) {
        opacity: 0;
    }

    .workspace-mode .sidebar-toggle[aria-expanded="true"] span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    .workspace-topbar,
    .workspace-mode .content {
        padding-left: 18px;
        padding-right: 18px;
    }
}

/* === Mobile-first responsive polish === */
@media (max-width: 900px) {
    body {
        font-size: 14px;
    }

    .main {
        padding: 22px 0 42px;
    }

    .topbar-inner,
    .container {
        width: min(100% - 24px, 1240px);
    }

    .topbar-inner {
        min-height: 58px;
        gap: 12px;
    }

    .brand {
        font-size: 16px;
    }

    .brand-mark {
        width: 36px;
        height: 36px;
    }

    .nav {
        gap: 4px;
    }

    .nav a,
    .nav button,
    .button,
    button {
        min-height: 42px;
        padding: 9px 12px;
    }

    h1 {
        font-size: clamp(28px, 7vw, 38px);
        line-height: 1.16;
    }

    h2,
    .landing-section .section-head h2,
    .service-preview .section-head h2 {
        font-size: clamp(20px, 5.2vw, 26px);
        line-height: 1.22;
    }

    h3 {
        font-size: 16px;
    }

    .hero {
        gap: 18px;
        min-height: auto;
    }

    .hero h1 {
        max-width: 100%;
        font-size: clamp(34px, 10vw, 46px);
        line-height: 1.08;
    }

    .hero p,
    .service-preview > .muted,
    .landing-section .section-head .muted {
        font-size: 15px;
        line-height: 1.68;
    }

    .hero-actions,
    .trust-strip {
        margin-top: 18px;
    }

    .hero-actions .button,
    .hero-actions button {
        flex: 1 1 160px;
    }

    .trust-strip span {
        font-size: 13px;
        padding: 7px 10px;
    }

    .card,
    .hero-panel,
    .form-card,
    form.card {
        padding: 16px;
    }

    .grid,
    .stat-grid,
    .feature-grid,
    .dashboard-grid,
    .service-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .feature-card,
    .stat-card,
    .service-tile {
        min-height: auto;
    }

    .homepage-hero-image {
        min-height: 220px;
        max-height: 340px;
    }

    .page-head,
    .section-head,
    .table-toolbar,
    .onboarding-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .page-head .actions,
    .section-head .actions,
    .quick-actions,
    .table-toolbar {
        justify-content: flex-start;
    }

    .quick-actions .button,
    .quick-actions button,
    .section-head .button,
    .section-head button {
        width: 100%;
    }

    .form-grid,
    .form-grid.card,
    .nested-form,
    details[open] .nested-form {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .span-2 {
        grid-column: auto;
    }

    input,
    textarea,
    select {
        min-height: 46px;
        font-size: 16px;
    }

    textarea {
        line-height: 1.55;
    }

    .checkbox-field label,
    .check-list label {
        min-height: 42px;
        align-items: center;
    }

    .slot-picker {
        grid-template-columns: 1fr;
    }

    .slot-button {
        min-height: 64px;
        padding: 12px;
    }
}

@media (max-width: 760px) {
    .topbar {
        z-index: 80;
    }

    .topbar-inner {
        min-height: 56px;
        flex-direction: row;
        align-items: center;
        padding: 8px 0;
    }

    .brand {
        min-width: 0;
        max-width: calc(100% - 58px);
        font-size: 15px;
        line-height: 1.15;
    }

    .brand span:last-child {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .brand-mark,
    .brand-logo {
        width: 34px;
        height: 34px;
        max-width: 34px;
        max-height: 34px;
        flex: 0 0 34px;
    }

    .mobile-nav-toggle {
        width: 42px;
        height: 42px;
        display: inline-grid;
        place-items: center;
        gap: 4px;
        padding: 10px;
        border: 1px solid var(--line);
        border-radius: 10px;
        background: #fff;
        color: var(--brand-dark);
        box-shadow: var(--shadow-sm);
    }

    .mobile-nav-toggle span {
        width: 18px;
        height: 2px;
        display: block;
        border-radius: 999px;
        background: currentColor;
        transition: transform 160ms ease, opacity 160ms ease;
    }

    .mobile-nav-toggle[aria-expanded="true"] span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .mobile-nav-toggle[aria-expanded="true"] span:nth-child(2) {
        opacity: 0;
    }

    .mobile-nav-toggle[aria-expanded="true"] span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    .nav {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 90;
        width: min(84vw, 320px);
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 78px 18px 20px;
        overflow-y: auto;
        background: rgba(255, 255, 255, 0.98);
        border-left: 1px solid var(--line);
        box-shadow: -22px 0 48px rgba(15, 28, 45, 0.18);
        transform: translateX(105%);
        transition: transform 180ms ease;
    }

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

    .nav a,
    .nav form,
    .nav button {
        width: 100%;
    }

    .nav a,
    .nav button {
        justify-content: flex-start;
        min-height: 44px;
        padding: 10px 12px;
        border-radius: 10px;
        font-size: 14px;
        font-weight: 600;
    }

    body.mobile-nav-open {
        overflow: hidden;
    }

    body.mobile-nav-open::after {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 70;
        background: rgba(15, 28, 45, 0.34);
        backdrop-filter: blur(3px);
    }

    body.mobile-nav-open .topbar {
        z-index: 100;
    }

    body.mobile-nav-open .nav {
        z-index: 110;
    }

    body.mobile-nav-open .mobile-nav-toggle {
        position: relative;
        z-index: 120;
    }

    .main {
        padding: 16px 0 34px;
    }

    .hero {
        gap: 14px;
        padding-top: 6px;
    }

    .hero h1 {
        font-size: clamp(28px, 8.8vw, 38px);
        line-height: 1.1;
        margin-bottom: 12px;
    }

    .hero p {
        font-size: 14px;
        line-height: 1.62;
    }

    .hero-actions {
        gap: 8px;
        margin-top: 14px;
    }

    .hero-actions .button,
    .hero-actions button {
        min-height: 42px;
        flex-basis: 100%;
    }

    .trust-strip {
        gap: 7px;
        margin-top: 14px;
    }

    .registration-closed-notice {
        margin-top: 14px;
    }

    .registration-closed-notice .button {
        width: 100%;
    }

    .trust-strip span {
        padding: 6px 9px;
        font-size: 12px;
    }

    .landing-section {
        margin-top: 18px;
    }

    .landing-section .section-head h2,
    .service-preview .section-head h2,
    h2 {
        font-size: clamp(19px, 6vw, 23px);
        line-height: 1.2;
    }

    .service-tile,
    .feature-card,
    .stat-card,
    .card,
    .hero-panel,
    .form-card,
    form.card {
        padding: 13px;
        border-radius: 10px;
    }

    .service-tile {
        min-height: 84px;
    }

    .homepage-hero-image {
        min-height: 180px;
        max-height: 260px;
    }

    .form-card {
        width: min(100% - 22px, 440px);
        margin: 20px auto;
    }

    .field {
        gap: 5px;
        margin-bottom: 11px;
    }

    label {
        font-size: 13px;
        font-weight: 650;
    }

    input,
    textarea,
    select {
        min-height: 44px;
        padding: 9px 10px;
    }

    .checkbox-field label,
    .check-list label {
        min-height: 36px;
        gap: 9px;
        font-size: 14px;
        line-height: 1.35;
    }

    input[type="checkbox"],
    input[type="radio"],
    .checkbox-field input,
    .check-list input,
    .choice-list input {
        width: 18px;
        height: 18px;
        min-width: 18px;
        min-height: 18px;
        flex: 0 0 18px;
        padding: 0;
        accent-color: var(--brand);
    }

    .workspace-mode .content {
        padding: 16px 14px 32px;
    }

    .workspace-topbar {
        min-height: auto;
        align-items: center;
        flex-direction: row;
        padding: 12px 14px;
        gap: 10px;
    }

    .workspace-topbar-title {
        flex: 1 1 auto;
        min-width: 0;
    }

    .workspace-topbar strong {
        font-size: 14px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .workspace-topbar-actions {
        width: auto;
        display: flex;
        flex: 0 0 auto;
        gap: 8px;
    }

    .workspace-topbar-actions .button,
    .workspace-topbar-actions button,
    .workspace-topbar-actions form {
        width: auto;
    }

    .workspace-mode .page-head h1 {
        font-size: clamp(24px, 8vw, 30px);
    }

    .workspace-mode .page-head .muted {
        font-size: 14px;
        line-height: 1.6;
    }

    .workspace-mode h2,
    .workspace-mode .section-head h2 {
        font-size: 19px;
    }

    .workspace-mode .metric {
        font-size: 24px;
    }

    .workspace-shell .sidebar {
        width: min(86vw, 310px);
        box-shadow: 18px 0 42px rgba(15, 28, 45, 0.28);
    }

    .workspace-shell .sidebar a {
        min-height: 46px;
        font-size: 14px;
    }

    .workspace-mode .sidebar-toggle {
        min-height: 48px;
        padding: 12px;
        border-radius: 12px;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    body.sidebar-open::after {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 55;
        background: rgba(15, 28, 45, 0.42);
    }

    body.sidebar-open .workspace-shell .sidebar {
        z-index: 950;
    }

    .table-card,
    .table-wrap {
        overflow: visible;
    }

    .table-toolbar {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 12px;
    }

    .table-toolbar input,
    .table-toolbar .button,
    .table-toolbar button {
        width: 100%;
    }

    .table-wrap table {
        min-width: 0;
        width: 100%;
        border-collapse: separate;
        border-spacing: 0 10px;
    }

    .table-wrap thead {
        display: none;
    }

    .table-wrap tbody,
    .table-wrap tr,
    .table-wrap td {
        display: block;
        width: 100%;
    }

    .table-wrap tr {
        overflow: hidden;
        border: 1px solid var(--line);
        border-radius: 10px;
        background: #fff;
        box-shadow: var(--shadow-sm);
    }

    .table-wrap td {
        display: grid;
        grid-template-columns: minmax(108px, 38%) minmax(0, 1fr);
        gap: 10px;
        align-items: start;
        padding: 10px 12px;
        border-bottom: 1px solid #edf2f7;
        background: #fff;
        word-break: break-word;
    }

    .table-wrap td:last-child {
        border-bottom: 0;
    }

    .table-wrap td::before {
        content: attr(data-label);
        color: #667085;
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .table-wrap td[colspan] {
        display: block;
    }

    .table-wrap td[colspan]::before {
        content: "";
        display: none;
    }

    td.actions,
    .table-wrap td.actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    td.actions::before,
    .table-wrap td.actions::before {
        flex: 0 0 100%;
    }

    td.actions .button,
    td.actions button,
    td.actions form {
        flex: 1 1 120px;
        width: 100%;
    }

    .confirm-modal {
        align-items: flex-end;
        padding: 0;
    }

    .confirm-modal__panel {
        width: 100%;
        max-width: none;
        border-radius: 16px 16px 0 0;
        padding: 18px;
    }

    .confirm-modal__actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    details[open] .nested-form {
        width: min(100vw - 20px, 620px);
        max-height: calc(100vh - 24px);
        overflow: auto;
    }
}

@media (max-width: 480px) {
    .topbar-inner,
    .container {
        width: min(100% - 18px, 1240px);
    }

    .hero h1 {
        font-size: clamp(26px, 9.5vw, 34px);
    }

    .hero-panel,
    .card,
    .form-card,
    form.card {
        padding: 14px;
    }

    .table-wrap td {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .workspace-topbar-actions {
        gap: 6px;
    }

    .workspace-topbar-actions .button,
    .workspace-topbar-actions button {
        min-height: 40px;
        padding: 8px 10px;
        font-size: 13px;
    }
}

/* Final mobile drawer guard: keep public navigation from inheriting desktop/wrapped nav rules. */
@media (max-width: 760px) {
    .topbar,
    .topbar-inner {
        overflow: visible;
    }

    .topbar .nav[data-mobile-nav] {
        position: fixed !important;
        top: 56px !important;
        right: 0 !important;
        bottom: auto !important;
        left: auto !important;
        z-index: 1110 !important;
        width: min(86vw, 330px) !important;
        height: calc(100vh - 56px);
        height: calc(100dvh - 56px);
        max-height: calc(100vh - 56px);
        max-height: calc(100dvh - 56px);
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        gap: 4px !important;
        padding: 12px !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        background: #ffffff !important;
        filter: none !important;
        backdrop-filter: none !important;
        border-left: 1px solid var(--line);
        box-shadow: -18px 0 42px rgba(15, 28, 45, 0.18);
        transform: translateX(105%) !important;
        transition: transform 180ms ease, opacity 180ms ease, visibility 180ms ease;
    }

    .topbar .nav[data-mobile-nav].open,
    body.mobile-nav-open .topbar .nav[data-mobile-nav] {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
        transform: translateX(0) !important;
    }

    .topbar .nav[data-mobile-nav] a,
    .topbar .nav[data-mobile-nav] form,
    .topbar .nav[data-mobile-nav] button {
        flex: 0 0 auto !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .topbar .nav[data-mobile-nav] a,
    .topbar .nav[data-mobile-nav] button {
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        padding: 8px 10px !important;
        color: #18202f !important;
        text-align: left !important;
        white-space: normal !important;
        border-radius: 8px !important;
        line-height: 1.25 !important;
    }

    .topbar .nav[data-mobile-nav] .button,
    .topbar .nav[data-mobile-nav] button {
        color: #fff !important;
    }

    body.mobile-nav-open::after {
        z-index: 900 !important;
        pointer-events: auto;
        backdrop-filter: none !important;
        background: rgba(15, 28, 45, 0.42) !important;
    }

    body.mobile-nav-open .topbar {
        z-index: 1100 !important;
    }

    body.mobile-nav-open .mobile-nav-toggle {
        z-index: 1120 !important;
    }
}

/* Final mobile workspace drawer guard for admin/client dashboards. */
@media (max-width: 860px) {
    .workspace-mode .workspace-topbar {
        z-index: 1000;
    }

    .workspace-mode .sidebar-toggle {
        display: inline-grid !important;
    }

    .workspace-shell .sidebar[data-sidebar] {
        position: fixed !important;
        inset: 0 auto 0 0 !important;
        z-index: 1100 !important;
        width: min(84vw, 320px) !important;
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        display: flex !important;
        overflow: hidden !important;
        transform: translateX(-105%) !important;
        transition: transform 180ms ease;
    }

    .workspace-shell .sidebar[data-sidebar].open,
    body.sidebar-open .workspace-shell .sidebar[data-sidebar] {
        transform: translateX(0) !important;
    }

    .workspace-shell .sidebar-nav {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    body.sidebar-open::after {
        z-index: 1000 !important;
        background: rgba(15, 28, 45, 0.48) !important;
        backdrop-filter: none !important;
    }

    body.sidebar-open .workspace-mode .sidebar-toggle {
        position: relative;
        z-index: 1150;
    }
}
