:root {
    --bg: #f7f7f7;
    --surface: #ffffff;
    --surface-soft: #f2f2f2;
    --soft: #fafafa;
    --ink: #171717;
    --muted: #666666;
    --line: #dedede;
    --line-strong: #c7c7c7;
    --brand-dark: #171717;
    --brand-light: #e5e5e5;
    --brand-on-dark: #ffffff;
    --brand-on-light: #171717;
    --primary: var(--brand-dark);
    --primary-strong: color-mix(in srgb, var(--brand-dark) 82%, #000000);
    --primary-soft: color-mix(in srgb, var(--brand-light) 52%, transparent);
    --primary-contrast: var(--brand-on-dark);
    --accent: var(--brand-dark);
    --button-bg: var(--primary);
    --button-bg-hover: var(--primary-strong);
    --button-ink: var(--primary-contrast);
    --control-bg: var(--surface);
    --control-bg-hover: var(--primary-soft);
    --control-border: var(--line);
    --control-border-hover: var(--primary);
    --control-ink: var(--primary);
    --utility-icon-ink: #000000;
    --row-hover: #eeeeee;
    --success-bg: #e5e5e5;
    --success-ink: #262626;
    --success-accent: #525252;
    --danger: #171717;
    --danger-bg: #eeeeee;
    --danger-bg-hover: #e5e5e5;
    --danger-border: #bdbdbd;
    --warning-bg: #f5f5f5;
    --warning-ink: #404040;
    --warning-border: #cfcfcf;
    --chart-pastel-mint: #91c9be;
    --chart-pastel-apricot: #efbd83;
    --chart-pastel-lavender: #b9a7df;
    --chart-pastel-blue: #8db7dc;
    --chart-pastel-sage: #9fc894;
    --chart-pastel-rose: #e5a0aa;
    --chart-pastel-slate: #afbdcc;
    --shadow: 0 16px 45px rgba(0, 0, 0, .08);
    --radius: 8px;
}

.theme-dark,
.theme-dark body {
    --bg: #181818;
    --surface: #000000;
    --surface-soft: #151515;
    --soft: #0d0d0d;
    --ink: #f3f3f3;
    --muted: #b8b8b8;
    --line: #353535;
    --line-strong: #4a4a4a;
    --brand-dark: #5f5f5f !important;
    --brand-on-dark: #ffffff !important;
    --primary: #5f5f5f !important;
    --primary-strong: #3f3f3f !important;
    --primary-contrast: #ffffff !important;
    --accent: #b8b8b8 !important;
    --primary-soft: #242424 !important;
    --button-bg: #e5e5e5;
    --button-bg-hover: #ffffff;
    --button-ink: #171717;
    --control-bg: #151515;
    --control-bg-hover: #2a2a2a;
    --control-border: #5f5f5f;
    --control-border-hover: #a3a3a3;
    --control-ink: #f3f3f3;
    --utility-icon-ink: #ffffff;
    --row-hover: #242424;
    --success-bg: #242424;
    --success-ink: #d4d4d4;
    --success-accent: #a3a3a3;
    --danger: #e5e5e5;
    --danger-bg: #202020;
    --danger-bg-hover: #303030;
    --danger-border: #737373;
    --warning-bg: #262626;
    --warning-ink: #d4d4d4;
    --warning-border: #737373;
    --shadow: 0 16px 45px rgba(0, 0, 0, .22);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

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

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

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

.auth-body {
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--brand-dark) 10%, transparent), transparent 34%),
        linear-gradient(315deg, color-mix(in srgb, var(--brand-light) 18%, transparent), transparent 38%),
        var(--bg);
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-panel {
    width: min(920px, 100%);
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    align-items: center;
}

.login-copy h1,
.topbar h1,
.page-intro h2 {
    margin: 0;
}

.login-copy h1 {
    font-size: 48px;
    line-height: 1.05;
}

.login-copy p {
    max-width: 520px;
    color: var(--muted);
    font-size: 18px;
}

.eyebrow {
    display: block;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.login-form {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    display: grid;
    gap: 16px;
}

.login-form label,
.toolbar label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

input,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 11px 12px;
    background: var(--surface);
    color: var(--ink);
}

input::placeholder,
textarea::placeholder {
    color: #9a9a9a;
}

input:focus,
select:focus {
    outline: 3px solid color-mix(in srgb, var(--primary) 22%, transparent);
    border-color: var(--primary);
}

.check-row {
    display: flex !important;
    grid-template-columns: none;
    align-items: center;
    gap: 10px !important;
}

.check-row input {
    width: auto;
}

.login-form button,
.toolbar button,
.primary-link,
.form-actions button,
.form-card button:not(.danger-button),
.danger-form button {
    border: 0;
    border-radius: var(--radius);
    background: var(--button-bg);
    color: var(--button-ink);
    padding: 11px 14px;
    font-weight: 800;
    cursor: pointer;
}

.login-form button:hover,
.toolbar button:hover,
.primary-link:hover,
.form-actions button:hover,
.form-card button:not(.danger-button):hover {
    background: var(--button-bg-hover);
}

.primary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.primary-link.muted {
    background: var(--surface-soft);
    color: var(--muted);
    pointer-events: none;
}

.secondary-link,
.danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px 13px;
    background: var(--surface);
    color: var(--muted);
    font-weight: 800;
    cursor: pointer;
}

.sortable-header {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.sortable-header:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--primary) 22%, transparent);
    outline-offset: -3px;
}

.sort-icon {
    margin-left: 6px;
    color: var(--muted);
    font-size: 11px;
    opacity: .55;
}

.sortable-header[aria-sort="ascending"] .sort-icon::before {
    content: "\f0de";
}

.sortable-header[aria-sort="descending"] .sort-icon::before {
    content: "\f0dd";
}

.danger-button {
    border-color: var(--danger-border);
    color: var(--danger);
    background: var(--danger-bg);
}

.danger-button:hover,
.danger-form button:hover {
    background: var(--danger-bg-hover);
}

.record-delete-form {
    display: inline-flex;
    margin: 0;
}

.record-delete-form .record-delete-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    border: 1px solid var(--danger-border);
    border-radius: var(--radius);
    padding: 10px 13px;
    background: var(--danger-bg);
    color: var(--danger);
    font: inherit;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.record-delete-form .record-delete-button:hover {
    background: var(--danger-bg-hover);
}

.record-delete-form .record-delete-button:focus-visible {
    outline: 3px solid rgba(0, 0, 0, .18);
    outline-offset: 2px;
}

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

.form-error {
    color: var(--danger);
    font-weight: 700;
    font-size: 13px;
}

.panel-error {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    border-radius: var(--radius);
    padding: 10px 12px;
}

.demo-credentials {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 13px;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
    transition: grid-template-columns .2s ease;
}

.sidebar-collapsed .app-shell {
    grid-template-columns: 82px 1fr;
}

.sidebar {
    background: #000000;
    color: #e5e5e5;
    padding: 18px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
    padding: 10px 0;
}

.sidebar-toggle {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    color: #e5e5e5;
    cursor: pointer;
}

.brand:hover {
    background: rgba(255, 255, 255, .10);
}

.sidebar-toggle:hover {
    background: transparent;
    color: #fff;
}

.brand {
    border-radius: var(--radius);
    padding-inline: 6px;
    transition: background-color .16s ease;
}

.brand-mark {
    width: 42px;
    height: 42px;
    min-width: 42px;
    flex: 0 0 42px;
    aspect-ratio: 1;
    border-radius: var(--radius);
    display: grid;
    place-items: center;
    background: var(--primary);
    color: var(--primary-contrast);
    border: 1px solid color-mix(in srgb, var(--primary-contrast) 34%, transparent);
    font-weight: 900;
}

.brand-logo {
    overflow: hidden;
    padding: 4px;
    background: #ffffff;
    border-color: rgba(255, 255, 255, .62);
    border-radius: 10px;
}

.brand-logo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    border-radius: 6px;
}

.brand strong,
.brand small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand small {
    color: #a3a3a3;
    margin-top: 2px;
}

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

.nav-link,
.nav-parent {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: 0;
    border-radius: var(--radius);
    padding: 10px;
    background: transparent;
    color: #d3d3d3;
    font-weight: 800;
    cursor: pointer;
    text-align: left;
    transition: background-color .16s ease, color .16s ease, transform .16s ease;
}

.nav-link:not(.disabled):hover,
.nav-parent:hover {
    background: rgba(255, 255, 255, .10);
    color: #ffffff;
    transform: translateX(2px);
}

.nav-link.active,
.nav-group.is-open .nav-parent {
    background: var(--brand-light);
    color: var(--brand-on-light);
    box-shadow: none;
}

.nav-link.active .nav-icon,
.nav-group.is-open .nav-parent .nav-icon {
    background: transparent;
    color: inherit;
}

.nav-icon {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 0;
    background: transparent;
    font-size: 12px;
}

.nav-group {
    display: grid;
    gap: 4px;
}

.nav-caret {
    margin-left: auto;
    font-size: 11px;
    transition: transform .15s ease;
}

.nav-group.is-open .nav-caret {
    transform: rotate(180deg);
}

.nav-children {
    display: none;
    gap: 2px;
    margin-left: 36px;
}

.nav-group.is-open .nav-children {
    display: grid;
}

.nav-children a,
.nav-children .disabled {
    display: block;
    border-radius: 6px;
    padding: 7px 10px;
    color: #a3a3a3;
    font-size: 14px;
    transition: background-color .16s ease, color .16s ease, transform .16s ease;
}

.nav-children a:hover {
    background: rgba(255, 255, 255, .10);
    color: #ffffff;
    transform: translateX(2px);
}

.nav-children a.active {
    color: var(--brand-on-light);
    background: var(--brand-light);
    box-shadow: none;
}

.nav-children .disabled {
    opacity: .5;
}

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

.sidebar-collapsed .brand span:not(.brand-mark),
.sidebar-collapsed .nav-label,
.sidebar-collapsed .nav-caret,
.sidebar-collapsed .nav-children {
    display: none;
}

.sidebar-collapsed .sidebar {
    padding-inline: 14px;
}

.sidebar-collapsed .brand-row {
    position: relative;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.sidebar-collapsed .brand {
    flex: 0 0 auto;
}

.sidebar-collapsed .sidebar-toggle {
    position: static;
    width: 28px;
    height: 28px;
}

.topbar {
    min-height: 76px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 16px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

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

.mobile-sidebar-toggle,
.sidebar-backdrop {
    display: none;
}

.breadcrumb {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 3px;
}

.topbar h1 {
    font-size: 22px;
}

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

.topbar-utilities {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-utilities .avatar-button {
    border-color: var(--brand-dark);
    background: var(--brand-dark);
    color: var(--brand-on-dark);
}

.topbar-utilities .avatar-button:hover {
    border-color: var(--primary-strong);
    background: var(--primary-strong);
    color: var(--brand-on-dark);
}

.topbar-utilities .icon-button {
    border-color: transparent;
    background: transparent;
    color: var(--utility-icon-ink);
}

.topbar-utilities .icon-button:hover {
    border-color: transparent;
    background: transparent;
    color: var(--utility-icon-ink);
}

.topbar-actions select {
    min-width: 210px;
}

.user-chip {
    display: grid;
    gap: 2px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 8px 10px;
    background: var(--surface-soft);
}

.user-chip span {
    color: var(--muted);
    font-size: 12px;
}

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 0;
    background: transparent;
    border-radius: 0;
    padding: 0;
    color: var(--utility-icon-ink);
    font-weight: 800;
    cursor: pointer;
}

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

.icon-button:hover {
    border-color: transparent;
    background: transparent;
    color: var(--utility-icon-ink);
}

.secondary-link:hover,
.row-actions a:hover,
.row-actions button:not(.danger-button):hover,
.button-row button:hover {
    border-color: var(--control-border-hover);
    background: var(--control-bg-hover);
    color: var(--control-ink);
}

.button-like {
    text-decoration: none;
}

.avatar-button {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 999px;
    background: var(--primary);
    color: var(--primary-contrast);
    font-weight: 900;
    cursor: pointer;
}

.avatar-menu,
.notification-menu {
    position: relative;
}

.has-badge {
    position: relative;
}

.has-badge > span {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border: 2px solid var(--surface);
    border-radius: 999px;
    background: #e53e3e;
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 10px;
    line-height: 1;
    font-weight: 900;
}

.avatar-dropdown,
.notification-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 30;
    display: none;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 18px 45px rgba(0, 0, 0, .16);
    overflow: hidden;
}

.avatar-dropdown {
    min-width: 190px;
}

.notification-dropdown {
    width: min(380px, calc(100vw - 32px));
}

.avatar-menu.is-open .avatar-dropdown {
    display: grid;
}

.notification-menu.is-open .notification-dropdown {
    display: grid;
}

.avatar-dropdown a,
.avatar-dropdown button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0;
    background: var(--surface);
    color: var(--ink);
    padding: 12px 14px;
    text-align: left;
    font-weight: 750;
    cursor: pointer;
}

.avatar-dropdown a:hover,
.avatar-dropdown button:hover {
    background: var(--soft);
}

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

.notification-header span,
.notification-header a {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.notification-header a {
    color: var(--accent);
    text-decoration: none;
}

.notification-list {
    display: grid;
    max-height: 390px;
    overflow: auto;
}

.notification-list a {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
}

.notification-list a.is-unread {
    background: rgba(0, 0, 0, .045);
}

.notification-list a.is-unread strong::after {
    content: "New";
    display: inline-flex;
    margin-left: 7px;
    padding: 2px 6px;
    border-radius: 999px;
    background: #000000;
    color: #fff;
    font-size: 9px;
    line-height: 1;
    text-transform: uppercase;
    vertical-align: middle;
}

.notification-row-unread {
    background: rgba(0, 0, 0, .035);
}

.project-progress-panel {
    display: grid;
    gap: 18px;
}

.project-progress-grid {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 24px;
    align-items: center;
}

.progress-gauge-card {
    display: grid;
    justify-items: center;
    gap: 10px;
}

.progress-gauge {
    width: 200px;
    height: 120px;
    position: relative;
}

.progress-gauge svg {
    width: 100%;
    height: 100%;
    display: block;
}

.progress-gauge-track,
.progress-gauge-fill {
    fill: none;
    stroke-width: 22;
    stroke-linecap: butt;
}

.progress-gauge-track {
    stroke: #e7e7e7;
}

.progress-gauge-fill {
    stroke: #525252;
}

.progress-gauge span {
    position: absolute;
    inset: auto 0 10px;
    text-align: center;
    font-size: 34px;
    font-weight: 900;
    color: var(--ink);
}

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

.project-progress-meta article {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
    padding: 18px;
    display: grid;
    gap: 6px;
}

.project-progress-meta span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.project-progress-meta strong {
    font-size: 24px;
}

.line-items-editor {
    display: grid;
    gap: 14px;
}

.line-items-list {
    display: grid;
    gap: 14px;
}

.line-item-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
    padding: 16px;
    display: grid;
    gap: 14px;
}

.line-item-row-head,
.line-item-row-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.line-item-row-actions {
    justify-content: flex-end;
}

.inline-action {
    background: transparent;
    border: 0;
    color: var(--accent);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    padding: 0;
}

.permission-matrix th .inline-action {
    color: inherit;
    text-transform: uppercase;
}

.permission-row-toggle {
    display: block;
    margin-top: 6px;
}

.line-item-fields {
    margin: 0;
}

.notification-list a:hover {
    background: var(--soft);
}

.notification-list i {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: var(--radius);
    background: var(--surface-soft);
    color: var(--accent);
}

.notification-list span {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.notification-list small {
    color: var(--accent);
    font-weight: 900;
    text-transform: uppercase;
}

.notification-list strong,
.notification-list em {
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-list em,
.empty-notifications {
    color: var(--muted);
    font-size: 13px;
    font-style: normal;
}

.pwa-install-guide {
    width: min(430px, calc(100vw - 32px));
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 28px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .22);
    text-align: center;
}

.pwa-install-guide::backdrop {
    background: rgba(0, 0, 0, .58);
}

.pwa-install-guide h2 {
    margin: 0 0 10px;
}

.pwa-install-guide p {
    color: var(--muted);
}

.pwa-install-guide button {
    width: 100%;
    margin-top: 10px;
}

.pwa-install-mark {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: var(--primary);
    color: var(--primary-contrast);
    font-size: 24px;
    font-weight: 900;
}

.pwa-connection-banner {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 10px 16px;
    background: #262626;
    color: #fff;
    text-align: center;
    font-size: 13px;
    font-weight: 800;
}

.employee-access-panel {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
    display: grid;
    gap: 18px;
}

.employee-login-fields {
    display: grid;
    gap: 18px;
}

.empty-notifications {
    padding: 16px;
}

.content {
    padding: 24px;
    display: grid;
    gap: 18px;
}

.shared-document-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px;
}

.shared-document-subtitle {
    margin: 8px 0 0;
    color: var(--muted);
    font-weight: 600;
}

.page-intro,
.workband,
.toolbar,
.table-panel,
.metric,
.metric-tile,
.form-panel,
.form-card,
.detail-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .04);
}

.page-intro {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px;
}

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

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

.button-row form,
.row-actions form {
    margin: 0;
}

.button-row button {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px 10px;
    background: var(--surface);
    color: var(--accent);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.reset-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    align-items: end;
    gap: 18px;
    padding: 18px;
}

.reset-panel h3 {
    margin: 4px 0 8px;
}

.reset-confirm-form {
    display: grid;
    gap: 10px;
}

.reset-confirm-form label {
    display: grid;
    gap: 6px;
    font-weight: 800;
    color: var(--muted);
}

.reset-confirm-form button {
    width: 100%;
}

.color-grid {
    align-items: end;
}

.color-input {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 10px;
}

.color-input input[type="color"] {
    width: 56px;
    height: 46px;
    padding: 4px;
    cursor: pointer;
}

.row-actions a,
.row-actions button {
    display: inline-flex;
    border: 1px solid var(--control-border);
    border-radius: 6px;
    padding: 7px 9px;
    color: var(--control-ink);
    font-size: 13px;
    font-weight: 800;
    background: var(--control-bg);
    white-space: nowrap;
}

.row-actions form {
    margin: 0;
}

.row-actions button.danger-button {
    border-color: var(--danger-border);
    background: var(--danger-bg);
    color: var(--danger);
}

.row-actions button {
    cursor: pointer;
}

.row-actions a:hover,
.row-actions button:hover,
.secondary-link:hover {
    border-color: var(--control-border-hover);
    background: var(--control-bg-hover);
    color: var(--control-ink);
}

.page-intro h2 {
    font-size: 24px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: var(--success-bg);
    color: var(--success-ink);
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 800;
    text-transform: capitalize;
    white-space: nowrap;
}

.project-status-progress {
    width: 160px;
}

.project-status-progress__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.project-status-progress__meta strong {
    color: var(--success-accent);
    font-size: 13px;
    white-space: nowrap;
}

.project-status-progress__track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5e5e5;
}

.project-status-progress__track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #525252;
    transition: width 180ms ease;
}

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

.metric,
.metric-tile {
    padding: 16px;
    display: grid;
    gap: 8px;
}

.metric span,
.metric-tile span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.metric strong,
.metric-tile strong {
    font-size: 24px;
    line-height: 1.1;
    word-break: break-word;
}

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

.workband h3 {
    margin: 0 0 4px;
}

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

.form-panel,
.form-card {
    padding: 18px;
    display: grid;
    gap: 18px;
}

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

.form-grid label,
.full-label,
.check-grid label,
.check-line {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.form-grid > label {
    align-self: start;
    align-content: start;
}

.check-line {
    display: inline-grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    justify-self: start;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--soft);
    color: var(--ink);
    padding: 11px 12px;
}

.check-line input,
.check-grid input {
    width: auto;
}

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

.check-grid label {
    grid-template-columns: auto 1fr;
    align-items: center;
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    color: var(--ink);
}

.line-panel {
    display: grid;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    background: var(--soft);
}

.form-card > .table-panel {
    box-shadow: none;
}

.numbering-card,
.numbering-card form,
.numbering-card .table-panel {
    min-width: 0;
    max-width: 100%;
}

.numbering-card .table-panel {
    width: 100%;
}

.line-panel h4 {
    margin: 0;
    color: var(--ink);
    font-size: 14px;
}

textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 11px 12px;
    background: var(--surface);
    color: var(--ink);
    resize: vertical;
    font: inherit;
}

textarea:focus {
    outline: 3px solid color-mix(in srgb, var(--primary) 22%, transparent);
    border-color: var(--primary);
}

.form-section-title,
.detail-panel h3 {
    margin: 0;
    font-size: 16px;
}

.organization-logo-preview {
    align-self: stretch;
}

.organization-logo-frame {
    min-height: 110px;
    margin-top: 10px;
    padding: 14px;
    display: grid;
    place-items: center;
    border: 1px dashed var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
    color: var(--muted);
}

.organization-logo-frame img {
    max-width: 180px;
    max-height: 90px;
    object-fit: contain;
}

.organization-logo-thumbnail {
    width: 52px;
    height: 42px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-soft);
    color: var(--accent);
    font-weight: 800;
}

.organization-logo-thumbnail img {
    width: 100%;
    height: 100%;
    padding: 4px;
    object-fit: contain;
}

.documentation-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.documentation-nav {
    position: sticky;
    top: 18px;
    display: grid;
    gap: 4px;
}

.documentation-nav a {
    padding: 8px 10px;
    border-radius: 6px;
    color: var(--muted);
    font-weight: 700;
}

.documentation-nav a:hover {
    background: var(--surface-soft);
    color: var(--accent);
}

.documentation-content {
    display: grid;
    gap: 18px;
}

.documentation-content section {
    scroll-margin-top: 18px;
}

.documentation-content h3 {
    margin: 3px 0 10px;
}

.documentation-content p,
.documentation-content li {
    line-height: 1.65;
}

.dashboard-module {
    display: grid;
    gap: 14px;
}

.workspace-overview-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px 28px;
    align-items: start;
}

.workspace-overview-notes {
    grid-column: 1 / -1;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.workspace-overview-notes textarea {
    min-height: 112px;
}

.dashboard-module + .dashboard-module {
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

.dashboard-module-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
}

.dashboard-module-heading h2 {
    margin: 2px 0 0;
    font-size: 22px;
}

.chart-panel {
    min-width: 0;
}

.pie-chart-layout {
    display: grid;
    grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
    gap: 24px;
    align-items: center;
    padding-top: 8px;
}

.pie-chart {
    width: min(100%, 180px);
    aspect-ratio: 1;
    position: relative;
    display: grid;
    place-items: center;
    border-radius: 50%;
}

.pie-chart::after {
    content: "";
    position: absolute;
    inset: 27%;
    border-radius: 50%;
    background: var(--surface);
}

.pie-chart > span {
    position: relative;
    z-index: 1;
    color: var(--ink);
    font-size: 24px;
    font-weight: 900;
}

.chart-legend {
    display: grid;
    gap: 8px;
}

.chart-legend > span,
.chart-legend > a {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    color: var(--ink);
}

.chart-legend i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.bar-chart {
    display: grid;
    gap: 11px;
    padding-top: 8px;
}

.bar-chart-row {
    display: grid;
    grid-template-columns: minmax(90px, 150px) minmax(100px, 1fr) minmax(78px, auto);
    gap: 10px;
    align-items: center;
    font-size: 13px;
}

.bar-chart-row > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bar-chart-row > div {
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--surface-soft);
}

.bar-chart-row i {
    display: block;
    min-width: 3px;
    height: 100%;
    border-radius: inherit;
}

.bar-chart-row strong {
    text-align: right;
}

.form-actions {
    justify-content: flex-end;
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

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

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

.policy-notes-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1.4fr) repeat(3, minmax(180px, 1fr));
    gap: 14px;
}

.policy-notes-grid .detail-panel {
    min-width: 0;
}

.policy-note {
    display: grid;
    align-content: center;
    gap: 7px;
}

.policy-note span {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.policy-section {
    min-width: 0;
}

.policy-table-scroll {
    overflow-x: auto;
    margin: 0 -18px;
}

.policy-table-scroll table {
    min-width: 900px;
}

.policy-table-scroll input,
.policy-table-scroll select {
    min-width: 112px;
}

.policy-table-scroll .check-row input {
    min-width: 0;
}

.policy-new-row td {
    background: var(--soft);
}

.impersonation-banner {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 8px 18px;
    background: var(--warning-bg);
    border-bottom: 1px solid var(--warning-border);
    color: var(--warning-ink);
    font-size: 13px;
    font-weight: 700;
}

.impersonation-banner form {
    margin: 0;
}

.impersonation-banner button {
    border: 1px solid var(--warning-border);
    border-radius: 6px;
    padding: 7px 10px;
    background: var(--surface);
    color: var(--warning-ink);
    font-weight: 800;
    cursor: pointer;
}

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

.detail-grid article {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .04);
    padding: 14px;
    display: grid;
    gap: 6px;
    min-width: 0;
}

.detail-grid span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.detail-grid strong {
    font-size: 15px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

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

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

.dashboard-grid.wide {
    align-items: start;
}

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

.mini-list a,
.mini-list > span {
    display: grid;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 11px 12px;
    background: var(--soft);
}

.mini-list a:hover {
    border-color: var(--line-strong);
    background: var(--row-hover);
}

.mini-list strong {
    font-size: 14px;
}

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

.detail-panel {
    padding: 18px;
}

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

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

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

.detail-list div,
.compact-list div {
    display: grid;
    gap: 3px;
}

dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

dd {
    margin: 0;
}

.side-stack {
    display: grid;
    gap: 18px;
    align-content: start;
}

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

.contact-line:last-child {
    border-bottom: 0;
}

.contact-line span,
.muted-text,
.notes-body {
    color: var(--muted);
}

.toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(150px, 220px)) auto;
    align-items: end;
    gap: 12px;
    padding: 14px;
}

.import-toolbar {
    grid-template-columns: auto minmax(320px, 1fr);
    align-items: center;
}

.import-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    align-items: end;
    gap: 12px;
    margin: 0;
}

.table-panel {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}

.table-panel table {
    width: max-content;
    min-width: 100%;
    background: var(--surface);
}

.table-panel > .detail-header {
    min-height: 72px;
    margin: 0;
    padding: 20px 22px 16px;
    border-bottom: 1px solid var(--line);
}

.table-panel > .detail-header h3 {
    margin: 0;
}

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

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

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    background: var(--soft);
    position: sticky;
    top: 0;
    z-index: 1;
}

td strong {
    display: block;
    line-height: 1.3;
}

td small {
    display: block;
    color: var(--muted);
    margin-top: 3px;
}

.table-primary-link-cell {
    padding: 0;
}

.table-primary-link {
    display: block;
    min-height: 100%;
    padding: 12px 14px;
    color: inherit;
    text-decoration: none;
}

.table-primary-link:hover strong,
.table-primary-link:focus-visible strong {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.table-primary-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -3px;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover td {
    background: var(--row-hover);
}

.table-total td {
    background: var(--soft);
    font-weight: 800;
}

.table-section td {
    background: var(--primary-soft);
    color: var(--accent);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.empty-state {
    color: var(--muted);
    text-align: center;
    padding: 28px;
}

.pagination-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    min-height: 40px;
    color: var(--muted);
    font-size: 13px;
}

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

.pagination-actions,
.page-size-form,
.page-size-form label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pagination-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
}

.page-size-form {
    margin: 0;
}

.page-size-form label {
    color: var(--muted);
    font-weight: 800;
}

.page-size-form select {
    min-width: 72px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 30px 0 10px;
    background-color: var(--surface);
    color: var(--ink);
    font: inherit;
    font-weight: 800;
}

.notice {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    color: var(--warning-ink);
    border-radius: var(--radius);
    padding: 10px 12px;
    font-weight: 700;
}

.notice-warning {
    background: var(--danger-bg);
    border-color: var(--danger-border);
    color: var(--danger);
    font-weight: 500;
}

.danger-form {
    display: flex;
    justify-content: flex-end;
}

.danger-form button {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: var(--danger);
}

.pagination-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 10px;
    background: var(--surface);
    color: var(--muted);
    font-weight: 800;
    line-height: 1;
}

a.pagination-control:hover {
    border-color: var(--primary);
    color: var(--accent);
    background: var(--surface-soft);
}

.pagination-control.is-current {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--primary-contrast);
}

.pagination-control.is-disabled {
    opacity: .45;
    cursor: not-allowed;
}

.pagination-ellipsis {
    min-width: 24px;
    text-align: center;
    color: var(--muted);
}

.platform-shell {
    --bg: #f5f5f5;
    --surface: #ffffff;
    --soft: #fafafa;
    --ink: #303030;
    --muted: #707070;
    --line: #e5e5e5;
    --brand-dark: #171717;
    --brand-light: #e5e5e5;
    --brand-on-dark: #ffffff;
    --radius: 4px;
}

.platform-shell .app-shell {
    grid-template-columns: 300px 1fr;
}

.platform-shell .sidebar {
    background: #171717;
    padding: 0;
    border-right: 1px solid #303030;
}

.platform-shell .brand-row {
    min-height: 88px;
    padding: 16px 22px;
    border-bottom: 1px solid #303030;
}

.platform-shell .brand {
    padding: 0;
}

.platform-shell .brand-mark {
    order: 2;
    margin-left: auto;
    width: 40px;
    height: 40px;
    min-width: 40px;
    flex-basis: 40px;
    border-radius: 6px;
    background: #fff;
    color: #171717;
    border: 1px solid #d8d8d8;
    font-size: 13px;
}

.platform-shell .brand-logo {
    padding: 3px;
}

.platform-shell .brand strong {
    color: #fff;
    font-size: 21px;
    line-height: 1.1;
}

.platform-shell .brand small {
    position: relative;
    color: #adadad;
    font-size: 16px;
    padding-left: 22px;
    margin-top: 5px;
}

.platform-shell .brand small::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #bdbdbd;
}

.platform-shell .sidebar-toggle {
    display: none;
}

.platform-shell .side-nav {
    gap: 0;
}

.platform-shell .nav-link,
.platform-shell .nav-parent {
    min-height: 62px;
    border-radius: 0;
    border-bottom: 1px solid #303030;
    color: #a3a3a3;
    padding: 0 24px;
    font-size: 18px;
    font-weight: 500;
}

.platform-shell .nav-link:hover {
    color: #fff;
    background: #262626;
}

.platform-shell .nav-link.active {
    color: var(--brand-on-light);
    background: var(--brand-light);
    box-shadow: none;
}

.platform-shell .nav-icon {
    background: transparent;
    color: inherit;
    width: 26px;
    font-size: 18px;
}

.platform-shell .main-shell {
    background: #f3f3f3;
}

.platform-shell .topbar {
    min-height: 88px;
    padding: 0 28px 0 36px;
    background: #fff;
    border-bottom: 1px solid #e7e7e7;
}

.platform-shell .topbar-title {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.platform-shell .topbar h1 {
    font-size: 25px;
    font-weight: 800;
}

.platform-shell .breadcrumb {
    color: #707070;
    font-size: 15px;
    margin: 0;
}

.platform-shell .topbar-actions {
    gap: 20px;
}

.platform-shell .icon-button,
.platform-shell .avatar-button {
    position: relative;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #707070;
    border-radius: 0;
    font-size: 20px;
}

.platform-shell .topbar-utilities .icon-button {
    border: 0;
    background: transparent;
    color: #000000;
}

.platform-shell .topbar-utilities .avatar-button {
    border: 0;
    background: transparent;
    color: #707070;
}

.platform-shell .avatar-button {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: #f0f0f0;
    color: #383838;
    font-size: 13px;
}

.platform-shell .avatar-dropdown {
    --surface: #ffffff;
    --soft: #f5f5f5;
    --ink: #303030;
    --line: #e5e5e5;
    border-radius: 5px;
}

.platform-shell .has-badge span {
    position: absolute;
    top: -9px;
    right: -9px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #171717;
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 800;
}

.platform-shell .content {
    padding: 0;
    gap: 0;
}

.platform-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px 40px;
    padding: 24px 36px 36px;
}

.platform-metric {
    min-height: 118px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 4px;
    padding: 26px 28px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .04);
}

.platform-metric span {
    display: block;
    color: #5c5c5c;
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 16px;
}

.platform-metric strong {
    color: #171717;
    font-size: 17px;
}

.platform-metric i {
    color: #707070;
    font-size: 25px;
}

.platform-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px 40px;
    padding: 0 36px 36px;
}

.platform-card,
.platform-table {
    background: #fff;
    border: 1px solid #e4e4e4;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}

.platform-card h3 {
    margin: 0;
    padding: 18px 24px;
    border-bottom: 1px solid #e7e7e7;
    font-size: 22px;
}

.platform-card table,
.platform-table table {
    min-width: 0;
}

.platform-card th,
.platform-table th {
    background: #fff;
    color: #707070;
    font-size: 15px;
    letter-spacing: 0;
    text-transform: none;
}

.platform-card td,
.platform-table td {
    color: #3b3b3b;
    font-size: 16px;
    padding: 14px 24px;
    vertical-align: middle;
}

.platform-table {
    margin: 0 36px 0;
}

.platform-searchbar {
    min-height: 62px;
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 0 36px;
    border: 0;
    border-bottom: 1px solid #e7e7e7;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
}

.platform-searchbar label {
    min-width: 380px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-right: 1px solid #e7e7e7;
    padding-right: 22px;
    color: #707070;
    font-size: 17px;
}

.platform-searchbar input,
.platform-searchbar select {
    border-radius: 4px;
    border-color: #e4e4e4;
    min-height: 40px;
    font-size: 18px;
}

.platform-searchbar .date-filter {
    min-width: 400px;
}

.platform-searchbar .company-filter {
    min-width: 220px;
}

.platform-searchbar .filter-toggle {
    margin-left: auto;
    border: 0;
    border-left: 1px solid #e7e7e7;
    border-radius: 0;
    background: #fff;
    color: #707070;
    padding: 0 18px;
    font-weight: 700;
}

.platform-actions {
    display: flex;
    align-items: center;
    padding: 26px 36px 20px;
}

.platform-actions.split {
    justify-content: space-between;
}

.platform-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border-radius: 5px;
    background: #171717;
    color: #fff;
    padding: 14px 17px;
    font-size: 18px;
    font-weight: 700;
}

.platform-primary:hover {
    background: #303030;
}

.sort-mark {
    float: right;
    color: #d9d9d9;
    font-weight: 500;
}

.module-cloud {
    display: grid;
    grid-template-columns: repeat(4, minmax(110px, 1fr));
    gap: 8px 18px;
}

.module-cloud span {
    color: #3b3b3b;
    font-size: 14px;
}

.module-cloud i {
    color: #525252;
    margin-right: 4px;
}

.recommended-badge {
    display: inline-flex;
    width: fit-content;
    margin-top: 8px;
    border-radius: 4px;
    background: #525252;
    color: #fff;
    padding: 2px 7px;
    font-size: 12px;
    font-weight: 800;
}

.kebab-button {
    width: 36px;
    height: 36px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #b3b3b3;
    border-radius: 5px;
    background: #fff;
    color: #707070;
    cursor: pointer;
}

.segmented {
    display: flex;
    border: 1px solid #a3a3a3;
    border-radius: 4px;
    overflow: hidden;
}

.segmented a {
    padding: 14px 16px;
    background: #fff;
    color: #707070;
    font-weight: 700;
}

.segmented a.active {
    background: #050505;
    color: #fff;
}

.segmented span {
    display: inline-grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    border-radius: 4px;
    background: #525252;
    color: #fff;
    font-size: 12px;
}

.stacked-detail {
    display: grid;
    gap: 5px;
}

.ok {
    color: #525252;
}

.bad {
    color: #171717;
}

.dot-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.dot-status::before {
    content: "";
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #a3a3a3;
}

.dot-status.active::before {
    background: #525252;
}

.dot-status.inactive::before,
.dot-status.suspended::before,
.dot-status.cancelled::before {
    background: #171717;
}

.gateway i {
    color: #525252;
}

.platform-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 0 36px 28px;
    padding: 16px 22px;
    background: #fff;
    border: 1px solid #e4e4e4;
    border-top: 0;
    color: #707070;
}

.platform-pagination nav {
    display: flex;
    gap: 8px;
}

.settings-workspace {
    display: grid;
    grid-template-columns: 320px 1fr;
    min-height: calc(100vh - 88px);
}

.settings-rail {
    background: #fff;
    border-right: 1px solid #e7e7e7;
    overflow: hidden;
}

.settings-search {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 32px;
    border: 1px solid #e4e4e4;
    border-radius: 5px;
    padding: 0 14px;
    color: #707070;
}

.settings-search input {
    border: 0;
    padding-inline: 0;
    font-size: 18px;
}

.settings-rail nav {
    display: grid;
    max-height: calc(100vh - 190px);
    overflow-y: auto;
}

.settings-rail a {
    padding: 20px 32px;
    border-top: 1px solid #e7e7e7;
    color: #707070;
    font-size: 20px;
}

.settings-rail a.active {
    background: #eeeeee;
    color: #383838;
    box-shadow: inset -3px 0 0 #383838;
}

.settings-panel {
    margin: 26px 28px;
    background: #fff;
    border: 1px solid #e4e4e4;
    border-radius: 5px;
}

.settings-tabs {
    display: flex;
    border-bottom: 1px solid #e7e7e7;
}

.settings-tabs button {
    border: 0;
    background: #fff;
    padding: 28px 34px;
    color: #383838;
    font-size: 20px;
    cursor: pointer;
}

.settings-tabs button.active {
    box-shadow: inset 0 -4px 0 #171717;
}

.settings-form {
    padding: 34px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 28px 34px;
}

.settings-grid label {
    display: grid;
    gap: 12px;
    color: #707070;
    font-size: 17px;
}

.settings-grid .check-row {
    display: flex !important;
    align-items: center;
    gap: 10px !important;
    align-self: end;
}

.settings-grid input[type="checkbox"] {
    width: 28px;
    height: 28px;
    accent-color: #171717;
}

.settings-actions {
    margin: 34px -34px -34px;
    border-top: 1px solid #e7e7e7;
    padding: 22px 34px;
}

.settings-actions button {
    border: 0;
    border-radius: 5px;
    background: #171717;
    color: #fff;
    padding: 14px 20px;
    font-size: 18px;
    font-weight: 700;
}

.placeholder-card {
    margin: 36px;
    padding-bottom: 22px;
}

.placeholder-card p {
    margin: 0;
    padding: 0 24px;
    color: #707070;
    font-size: 16px;
    max-width: 760px;
}

@media (max-width: 960px) {
    .documentation-layout {
        grid-template-columns: 1fr;
    }

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

    .pie-chart-layout {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .chart-legend {
        width: 100%;
    }
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 60;
        width: min(320px, calc(100vw - 48px));
        height: 100dvh;
        transform: translateX(-105%);
        transition: transform .2s ease;
        box-shadow: 20px 0 45px rgba(0, 0, 0, .28);
    }

    .mobile-sidebar-open {
        overflow: hidden;
    }

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

    .sidebar-backdrop {
        position: fixed;
        inset: 0 0 0 min(320px, calc(100vw - 48px));
        z-index: 55;
        border: 0;
        background: rgba(0, 0, 0, .52);
        cursor: pointer;
    }

    .mobile-sidebar-open .sidebar-backdrop {
        display: block;
    }

    .mobile-sidebar-toggle {
        display: inline-grid;
        place-items: center;
        width: 44px;
        height: 44px;
        padding: 0;
        flex: 0 0 auto;
    }

    .sidebar-collapsed .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar-collapsed .sidebar {
        width: min(320px, calc(100vw - 48px));
        padding: 18px;
    }

    .sidebar-collapsed .brand span:not(.brand-mark),
    .sidebar-collapsed .nav-label,
    .sidebar-collapsed .nav-caret {
        display: initial;
    }

    .sidebar-collapsed .nav-children {
        display: none;
    }

    .sidebar-collapsed .nav-group.is-open .nav-children {
        display: grid;
    }

    .sidebar-collapsed .brand-row {
        flex-direction: row;
        align-items: center;
        justify-content: initial;
    }

    .sidebar-collapsed .brand {
        flex: 1;
    }

    .sidebar-collapsed .sidebar-toggle {
        width: 34px;
        height: 34px;
    }

    .topbar,
    .topbar-actions,
    .page-intro,
    .workband,
    .pagination-row {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar-heading {
        width: 100%;
    }

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

    .topbar-title h1,
    .breadcrumb {
        overflow-wrap: anywhere;
    }

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

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

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

    input,
    select,
    textarea,
    .toolbar button,
    .primary-link,
    .secondary-link,
    .form-actions button,
    .button-row button,
    .row-actions a,
    .row-actions button,
    .nav-link,
    .nav-parent,
    .nav-children a {
        min-height: 44px;
    }

    .nav-children a,
    .nav-children .disabled {
        display: flex;
        align-items: center;
        padding: 10px 12px;
    }

    .page-intro .button-row,
    .page-intro .row-actions,
    .form-actions {
        width: 100%;
        justify-content: stretch;
    }

    .page-intro .button-row > *,
    .page-intro .row-actions > *,
    .form-actions > * {
        flex: 1 1 160px;
    }

    .table-panel {
        position: relative;
        padding-top: 34px;
        overscroll-behavior-inline: contain;
        -webkit-overflow-scrolling: touch;
    }

    .table-panel::before {
        content: "Swipe sideways to view all columns";
        position: absolute;
        top: 9px;
        left: 14px;
        color: var(--muted);
        font-size: 11px;
        font-weight: 800;
    }

    .table-panel th:first-child,
    .table-panel td:first-child {
        width: min(58vw, 220px);
        min-width: min(58vw, 220px);
        max-width: min(58vw, 220px);
        overflow-wrap: anywhere;
    }

    /*
     * Sticky first columns are opt-in. Freezing every table's first column
     * allows long values (emails, descriptions, etc.) to cover most of a
     * narrow viewport and makes the remaining columns unusable.
     */
    .table-panel.table-panel--sticky-first th:first-child,
    .table-panel.table-panel--sticky-first td:first-child {
        position: sticky;
        left: 0;
        z-index: 2;
        width: min(42vw, 180px);
        min-width: min(42vw, 180px);
        max-width: min(42vw, 180px);
        overflow-wrap: anywhere;
        background: var(--surface);
        box-shadow: 1px 0 0 var(--line);
    }

    .table-panel.table-panel--sticky-first th:first-child {
        z-index: 3;
        background: var(--soft);
    }

    .form-grid,
    .check-grid,
    .detail-grid,
    .dashboard-grid,
    .dashboard-grid.chart-grid,
    .detail-layout,
    .policy-notes-grid,
    .detail-list,
    .reset-panel,
    .workspace-overview-panel {
        grid-template-columns: 1fr;
    }

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

    .login-copy h1 {
        font-size: 38px;
    }

    .platform-shell .app-shell {
        grid-template-columns: 1fr;
    }

    .platform-shell .sidebar {
        position: static;
        height: auto;
    }

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

    .platform-shell .nav-link,
    .platform-shell .nav-parent {
        min-height: 54px;
        font-size: 15px;
        padding: 0 16px;
    }

    .platform-shell .topbar,
    .platform-shell .topbar-title,
    .platform-shell .topbar-actions {
        align-items: stretch;
        flex-direction: column;
    }

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

    .platform-shell .topbar-actions form {
        grid-column: 1 / -1;
    }

    .platform-metrics,
    .platform-dashboard-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .platform-metric,
    .platform-card {
        width: 100%;
        min-width: 0;
    }

    .platform-card {
        overflow-x: auto;
    }

    .platform-table,
    .platform-pagination {
        margin-left: 16px;
        margin-right: 16px;
    }

    .platform-searchbar,
    .platform-actions,
    .platform-actions.split {
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
        gap: 12px;
    }

    .platform-searchbar label,
    .platform-searchbar .date-filter,
    .platform-searchbar .company-filter {
        min-width: 0;
        width: 100%;
        border-right: 0;
        padding-right: 0;
    }

    .platform-searchbar .filter-toggle {
        border-left: 0;
        border: 1px solid #e7e7e7;
        padding: 12px;
    }

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

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

    .settings-panel {
        margin: 16px;
    }

    .settings-rail nav {
        max-height: 260px;
    }
}

@media (max-width: 560px) {
    .documentation-nav {
        grid-template-columns: 1fr;
    }

    .dashboard-module-heading {
        align-items: start;
    }

    .bar-chart-row {
        grid-template-columns: 80px minmax(60px, 1fr) minmax(72px, auto);
        gap: 7px;
    }
    .impersonation-banner {
        align-items: stretch;
        flex-direction: column;
        text-align: center;
    }

    .impersonation-banner button {
        width: 100%;
    }

    .content,
    .topbar {
        padding: 16px;
    }

    .topbar {
        min-height: 0;
        gap: 10px;
        padding-block: 12px;
    }

    .topbar-heading {
        gap: 10px;
    }

    .mobile-sidebar-toggle {
        width: 40px;
        height: 40px;
    }

    .topbar h1 {
        font-size: 20px;
        line-height: 1.1;
    }

    .breadcrumb {
        margin: 2px 0 0;
        font-size: 12px;
        line-height: 1.2;
    }

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

    .topbar-actions {
        width: 100%;
        display: flex;
        flex-direction: row;
        gap: 8px;
        align-items: center;
        justify-content: flex-end;
    }

    .topbar-actions > form {
        flex: 1 1 auto;
        min-width: 0;
    }

    .topbar-actions > form,
    .topbar-actions select {
        width: 100%;
        min-width: 0;
    }

    .topbar-actions select {
        height: 40px;
        padding: 7px 30px 7px 10px;
        font-size: 14px;
        text-overflow: ellipsis;
    }

    .topbar-utilities {
        flex: 0 0 auto;
        gap: 8px;
    }

    .topbar-utilities .icon-button,
    .topbar-utilities .avatar-button {
        width: 40px;
        height: 40px;
        padding: 0;
    }

    .page-intro h2 {
        font-size: 21px;
    }

    .page-intro,
    .workband,
    .form-panel,
    .form-card,
    .detail-panel {
        padding: 14px;
    }

    .form-actions > *,
    .page-intro .button-row > *,
    .page-intro .row-actions > * {
        flex-basis: 100%;
        width: 100%;
    }

    .row-actions {
        gap: 6px;
    }

    .table-panel table {
        font-size: 13px;
    }

    th,
    td {
        padding: 11px 12px;
    }

    .table-primary-link-cell {
        padding: 0;
    }

    .table-primary-link {
        padding: 11px 12px;
    }

    .avatar-dropdown {
        right: 0;
        left: auto;
        max-width: calc(100vw - 32px);
    }

    .notification-dropdown {
        right: -48px;
        left: auto;
    }

    .topbar .avatar-menu .avatar-dropdown {
        right: 0;
        left: auto;
        width: min(190px, calc(100vw - 32px));
    }

    .platform-shell .side-nav {
        grid-template-columns: 1fr;
    }

    .platform-card h3 {
        font-size: 18px;
    }

    .platform-card td,
    .platform-table td {
        font-size: 14px;
        padding: 12px 14px;
    }

    .platform-shell .topbar-actions {
        grid-template-columns: repeat(3, 44px);
        justify-content: end;
    }

    .project-progress-grid,
    .project-progress-meta {
        grid-template-columns: 1fr;
    }

    .line-item-row-head {
        align-items: flex-start;
        flex-direction: column;
    }
}
