:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --panel-soft: #f8fafc;
    --line: #d9e2ec;
    --line-soft: #e7edf4;
    --text: #101828;
    --muted: #667085;
    --sidebar: #111827;
    --sidebar-soft: #1f2937;
    --accent: #2563eb;
    --accent-soft: #dbeafe;
    --warning: #fef3c7;
    --danger: #fee2e2;
    --success: #dcfce7;
    --shadow: 0 14px 35px rgba(15, 23, 42, .08);
    --density-content-padding: 14px;
    --density-panel-padding: 10px;
    --density-gap: 8px;
    --density-radius: 8px;
    --density-control-y: 6px;
    --density-control-x: 10px;
}

* { box-sizing: border-box; }

html, body {
    min-height: 100%;
    height: 100%;
}

body {
    margin: 0;
    font-family: Inter, Segoe UI, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    overflow: hidden;
}

a { color: inherit; }

.layout {
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
}

.sidebar {
    height: 100vh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--sidebar), var(--sidebar-soft));
    color: white;
    padding: 10px 10px;
    overflow: hidden;
    overscroll-behavior: contain;
}

.sidebar-fixed {
    flex: 0 0 auto;
    min-width: 0;
}

.sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-top: 7px;
    margin-top: 8px;
    border-top: 1px solid rgba(255,255,255,.10);
}

.brand {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 2px 2px 8px;
    border-bottom: 1px solid rgba(255,255,255,.10);
    margin-bottom: 8px;
}

.brand-mark {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(255,255,255,.12);
    font-weight: 800;
    font-size: 1rem;
}

.brand h2 {
    margin: 0;
    font-size: 1.04rem;
    letter-spacing: 0;
}

.brand span {
    color: rgba(255,255,255,.66);
    font-size: .72rem;
    overflow-wrap: anywhere;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 9px;
}

.nav-section:last-child {
    margin-bottom: 0;
}

.nav-caption {
    margin: 7px 7px 3px;
    color: rgba(255,255,255,.46);
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.sidebar a {
    color: rgba(255,255,255,.84);
    text-decoration: none;
    padding: 6px 8px;
    border-radius: 8px;
    font-weight: 600;
    font-size: .86rem;
}

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

.nav-parent-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 28px;
    align-items: center;
    gap: 2px;
}

.sidebar .nav-parent-link,
.nav-parent-button {
    min-width: 0;
}

.nav-parent-button,
.nav-toggle {
    border: 0;
    color: rgba(255,255,255,.84);
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: .86rem;
    font-weight: 700;
}

.nav-parent-button {
    text-align: left;
    padding: 6px 8px;
    border-radius: 8px;
}

.nav-toggle {
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.nav-parent-button:hover,
.nav-parent-button.active,
.nav-toggle:hover,
.nav-group.is-open .nav-toggle {
    color: #fff;
    background: rgba(255,255,255,.12);
}

.nav-chevron {
    display: inline-block;
    line-height: 1;
    transition: transform .12s ease;
}

.nav-group.is-open .nav-chevron {
    transform: rotate(90deg);
}

.nav-children {
    display: grid;
    gap: 1px;
    padding-left: 10px;
    margin-left: 8px;
    border-left: 1px solid rgba(255,255,255,.16);
}

.sidebar .nav-children a {
    padding: 5px 8px;
    font-size: .82rem;
    font-weight: 650;
    color: rgba(255,255,255,.74);
}

.sidebar .nav-children a.active {
    color: #fff;
    background: rgba(37,99,235,.42);
}

.sidebar a:hover,
.sidebar a.active {
    color: #fff;
    background: rgba(255,255,255,.12);
}

.global-note-button {
    width: 100%;
    border: 1px solid rgba(255,255,255,.18);
    background: rgba(255,255,255,.1);
    color: #fff;
    border-radius: 8px;
    padding: 6px 8px;
    font-weight: 800;
    cursor: pointer;
    margin-bottom: 4px;
}

.global-note-button:hover {
    background: rgba(255,255,255,.16);
}

.sidebar-tools {
    display: grid;
    gap: 5px;
    margin-bottom: 0;
}

.quick-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    margin-bottom: 1px;
}

.quick-action-grid a {
    text-align: center;
    padding: 5px 6px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.07);
}

.global-search {
    position: relative;
    display: grid;
    gap: 5px;
}

.global-search label {
    color: rgba(255,255,255,.66);
    font-size: .72rem;
    font-weight: 800;
}

.global-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px;
}

.global-search-row input {
    min-width: 0;
    width: 100%;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 8px;
    padding: 6px 7px;
    background: rgba(255,255,255,.08);
    color: #fff;
}

.global-search-row input::placeholder {
    color: rgba(255,255,255,.52);
}

.global-search-row button {
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 8px;
    background: rgba(255,255,255,.12);
    color: #fff;
    font-weight: 800;
    padding: 6px 8px;
}

.global-search-panel {
    display: grid;
    gap: 9px;
    max-height: 420px;
    overflow-y: auto;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 8px;
    padding: 8px;
    background: rgba(15, 23, 42, .94);
}

.global-search-state {
    margin: 0;
    color: rgba(255,255,255,.74);
    font-size: .88rem;
}

.global-search-group {
    display: grid;
    gap: 5px;
}

.global-search-group > strong {
    color: rgba(255,255,255,.64);
    font-size: .72rem;
    text-transform: uppercase;
}

.global-search-result {
    display: grid;
    gap: 3px;
    width: 100%;
    text-align: left;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 8px;
    background: rgba(255,255,255,.06);
    color: #fff;
    padding: 8px;
}

.global-search-result span,
.global-search-result small,
.global-search-result em {
    min-width: 0;
    overflow-wrap: anywhere;
}

.global-search-result small {
    color: rgba(255,255,255,.66);
}

.global-search-result em {
    color: rgba(255,255,255,.52);
    font-size: .78rem;
    font-style: normal;
}

.content {
    padding: var(--density-content-padding);
    max-width: 1840px;
    width: 100%;
    min-width: 0;
    height: 100vh;
    overflow-y: auto;
    overscroll-behavior: contain;
}

h1, h2, h3 { margin-top: 0; }

h1 { font-size: 1.85rem; letter-spacing: 0; margin-bottom: 4px; line-height: 1.12; }
h2 { font-size: 1.05rem; margin-bottom: 8px; line-height: 1.2; }

.lead {
    max-width: 880px;
    color: var(--muted);
    font-size: .92rem;
    line-height: 1.35;
    margin: 0;
}

.card {
    background: var(--panel);
    border: 1px solid var(--line-soft);
    padding: var(--density-panel-padding);
    border-radius: var(--density-radius);
    box-shadow: var(--shadow);
}

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

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: var(--density-gap);
    margin-top: var(--density-gap);
}

.customer-workspace {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
    gap: var(--density-gap);
    align-items: start;
}

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

.customer-timeline {
    position: sticky;
    top: 12px;
}

.hihub-context-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
    gap: var(--density-gap);
    align-items: start;
    margin-top: var(--density-gap);
}

.customer-detail-workspace,
.project-detail-workspace {
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
}

.documents-preview-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 42vw);
}

.hihub-context-main {
    min-width: 0;
}

.hihub-context-panel {
    min-width: 0;
}

.hihub-context-panel-sticky {
    position: sticky;
    top: 12px;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
}

.hihub-context-card {
    margin-top: 0;
}

.hihub-context-card .timeline-list {
    gap: 10px;
}

.document-preview-panel {
    min-height: 560px;
}

.document-preview-frame {
    width: 100%;
    height: min(72vh, 760px);
    border: 1px solid var(--line-soft);
    border-radius: var(--density-radius);
    background: #f8fafc;
}

.hihub-list-table tr.is-selected {
    background: #eef4ff;
}

.page-header {
    display: flex;
    justify-content: space-between;
    gap: var(--density-gap);
    align-items: start;
    margin-bottom: 8px;
}

.module-hero {
    background: linear-gradient(135deg, #ffffff 0%, #eef4ff 100%);
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    padding: 11px 14px;
    box-shadow: var(--shadow);
}

.hero-copy {
    flex: 1 1 360px;
    min-width: 0;
}

.hero-copy h1,
.hero-copy .lead {
    overflow-wrap: anywhere;
}

.eyebrow {
    margin-bottom: 3px;
    color: var(--accent);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.status-pill,
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: fit-content;
    border-radius: 999px;
    background: var(--accent-soft);
    color: #1e40af;
    padding: 3px 7px;
    font-size: .76rem;
    font-weight: 700;
}

.module-grid { align-items: stretch; }
.module-card { min-height: 220px; }

.module-note { margin-top: 12px; }

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

.note-grid p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

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

.detail-grid p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.action-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.check-list,
.step-list {
    padding-left: 20px;
    margin: 0;
    color: #344054;
    line-height: 1.65;
}

.check-list li,
.step-list li { margin-bottom: 6px; }

.small { font-size: .9rem; }

.toolbar {
    display: flex;
    align-items: end;
    gap: var(--density-gap);
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.sort-bar {
    align-items: center;
    justify-content: flex-end;
    margin-top: 0;
}

.sort-bar label {
    margin-bottom: 0;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 160px;
}

.grow,
.field.grow { flex: 1; min-width: 240px; }

label {
    color: #475467;
    font-size: .78rem;
    font-weight: 700;
}

.field input,
.field select,
.field textarea {
    padding: var(--density-control-y) var(--density-control-x);
    border: 1px solid var(--line);
    border-radius: var(--density-radius);
    font: inherit;
    background: white;
}

button,
.button-link {
    border: 1px solid var(--line);
    padding: var(--density-control-y) var(--density-control-x);
    border-radius: var(--density-radius);
    background: white;
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 700;
}

button:disabled {
    cursor: not-allowed;
    color: #667085;
    background: var(--panel-soft);
}

button.primary,
.button-link.primary,
.primary {
    background: var(--sidebar);
    color: white;
    border-color: var(--sidebar);
}

button.outline { background: white; color: var(--sidebar); border-color: var(--sidebar); }
button.danger { color: #991b1b; border-color: #fecaca; background: #fff7f7; }

.message {
    padding: 9px 10px;
    margin: 8px 0;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--density-radius);
}

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

.demo-welcome h2 {
    margin-bottom: 6px;
}

.demo-welcome p {
    margin: 0;
}

.demo-welcome-links {
    justify-content: flex-end;
}

.pinned-row {
    border-color: #bfdbfe;
    background: #f8fbff;
}

.document-flow-notice {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin: 16px 0 12px;
    padding: 14px;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    background: #eff6ff;
}

.document-flow-notice strong,
.empty-position-state strong {
    display: block;
    color: var(--text);
}

.document-flow-notice p,
.empty-position-state p {
    margin: 4px 0 0;
    color: var(--muted);
}

.document-total-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 16px 0 12px;
}

.document-total-strip div,
.empty-position-state {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-soft);
    padding: 12px;
}

.document-total-strip span {
    display: block;
    color: var(--muted);
    font-size: .9rem;
}

.document-total-strip strong {
    display: block;
    margin-top: 4px;
    font-size: 1.12rem;
}

.empty-position-state {
    display: grid;
    gap: 10px;
    margin: 10px 0 14px;
}

.empty-position-state button {
    justify-self: start;
}

.pending-total {
    color: #92400e;
    font-size: 1rem;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: var(--density-gap);
    margin: 8px 0;
}

.stat strong {
    display: block;
    font-size: 1.25rem;
    letter-spacing: 0;
}

.stat span,
.muted { color: var(--muted); }

.customer-list {
    display: flex;
    flex-direction: column;
    gap: var(--density-gap);
}

.view-preference-bar {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
    margin: 10px 0 12px;
}

.view-preference-bar > div:first-child {
    min-width: 160px;
}

.view-preference-bar label {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.view-density-compact {
    gap: 7px;
}

.customer-row,
.project-row {
    display: flex;
    gap: 14px;
    align-items: start;
    justify-content: space-between;
}

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

.section-heading h2 {
    margin: 0;
}

.title {
    font-weight: 800;
    font-size: 1.08rem;
    color: var(--text);
    text-decoration: none;
}

.title:hover { color: var(--accent); }

.badges {
    display: flex;
    gap: 7px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.badge { background: #eef2f6; color: #344054; }
.badge.warn { background: var(--warning); color: #92400e; }
.badge.hot { background: var(--danger); color: #991b1b; }
.badge.success { background: var(--success); color: #166534; }

.metrics {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: var(--muted);
    min-width: 160px;
}

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

.dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    background: rgba(15, 23, 42, .48);
    display: grid;
    place-items: center;
    padding: 24px;
    overflow: auto;
}

.dialog {
    width: min(760px, 100%);
    max-height: 90vh;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dialog-header {
    position: sticky;
    top: -1px;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line-soft);
    background: var(--panel);
}

.dialog-header h2 {
    margin: 0;
}

.dialog-header .muted {
    margin: 4px 0 0;
}

.dialog-close {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    font-size: 1.35rem;
    line-height: 1;
    padding: 0;
}

.dialog-close:hover:not(:disabled) {
    background: var(--panel-soft);
}

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

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    color: var(--text);
}

.dialog-actions {
    position: sticky;
    bottom: -1px;
    z-index: 1;
    display: flex;
    justify-content: end;
    gap: 10px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--line-soft);
    background: var(--panel);
}

.compact-mode .content {
    padding: 16px;
}

.compact-mode .sidebar {
    padding: 14px 12px;
}

.compact-mode .brand {
    padding-bottom: 14px;
    margin-bottom: 12px;
}

.compact-mode .nav-section {
    gap: 2px;
    margin-bottom: 12px;
}

.compact-mode .sidebar a {
    padding: 7px 9px;
    font-size: .9rem;
}

.compact-mode .nav-parent-button {
    padding: 7px 9px;
    font-size: .9rem;
}

.compact-mode .nav-toggle {
    width: 26px;
    height: 26px;
    padding: 0;
}

.compact-mode .sidebar .nav-children a {
    padding: 4px 7px;
    font-size: .8rem;
}

.compact-mode .global-note-button,
.compact-mode button,
.compact-mode .button-link {
    padding: 7px 10px;
}

.compact-mode .module-hero,
.compact-mode .card {
    padding: 10px;
}

.compact-mode .page-header,
.compact-mode .toolbar,
.compact-mode .stats,
.compact-mode .grid-2,
.compact-mode .customer-list,
.compact-mode .tenant-list,
.compact-mode .table-list,
.compact-mode .form-grid {
    gap: 8px;
}

.compact-mode .module-hero {
    border-radius: 12px;
}

.compact-mode h1 {
    font-size: 1.9rem;
    margin-bottom: 4px;
}

.compact-mode h2 {
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.compact-mode .lead,
.compact-mode .muted {
    line-height: 1.35;
}

.compact-mode .badge,
.compact-mode .status-pill {
    padding: 4px 8px;
    font-size: .8rem;
}

.compact-mode .badges {
    gap: 5px;
    margin-top: 6px;
}

.compact-mode .field input,
.compact-mode .field select,
.compact-mode .field textarea {
    padding: 7px 9px;
}

.compact-mode .stat strong {
    font-size: 1.32rem;
}

@media (max-height: 720px) and (min-width: 1001px) {
    .sidebar {
        padding-block: 10px;
    }

    .brand {
        gap: 8px;
        padding-bottom: 9px;
        margin-bottom: 8px;
    }

    .brand-mark {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    .sidebar-tools {
        gap: 5px;
    }

    .global-note-button {
        padding-block: 7px;
    }

    .quick-action-grid a {
        padding-block: 5px;
    }

    .global-search-row input,
    .global-search-row button {
        padding-block: 6px;
    }

    .sidebar-nav {
        margin-top: 9px;
        padding-top: 8px;
    }
}

@media (max-width: 1000px) {
    body { overflow: auto; }
    .layout { grid-template-columns: 1fr; }
    .layout { height: auto; overflow: visible; }
    .sidebar { height: auto; min-height: auto; overflow: visible; }
    .sidebar-nav { overflow: visible; max-height: none; }
    .content { height: auto; overflow: visible; padding: 16px; }
    .grid, .stats, .grid-2, .note-grid, .detail-grid, .customer-workspace, .hihub-context-workspace, .product-form-grid, .product-detail-grid, .product-package-form-grid, .product-document-form-grid { grid-template-columns: 1fr; }
    .customer-timeline, .hihub-context-panel-sticky { position: static; max-height: none; overflow: visible; }
    .customer-row, .project-row, .page-header { flex-direction: column; }
    .demo-welcome { flex-direction: column; align-items: flex-start; }
    .actions { justify-content: start; }
}


.hero-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
    flex: 0 1 auto;
    max-width: 100%;
}

.hero-action-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 0;
}

.hero-actions > .hero-action-group {
    padding-left: 8px;
    border-left: 1px solid rgba(148, 163, 184, .38);
}

.hero-actions > .hero-action-group:first-child,
.hero-action-group > .hero-action-group:first-child {
    padding-left: 0;
    border-left: 0;
}

.hero-action-group > .hero-action-group {
    padding-left: 8px;
    border-left: 1px solid rgba(148, 163, 184, .38);
}

.hero-action-group.primary-actions {
    border-left: 0;
    padding-left: 0;
}

.hero-action-group.shell-actions {
    justify-content: flex-end;
}

.warning-message {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #7c2d12;
}

.warning-message p { margin: 6px 0 0; }

.warning-message details {
    margin-top: 10px;
    color: #9a3412;
}

.warning-message code {
    display: block;
    margin-top: 8px;
    white-space: pre-wrap;
    font-family: Consolas, monospace;
    font-size: .86rem;
}

.table-list {
    display: flex;
    flex-direction: column;
    gap: var(--density-gap);
}

.inline-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.form-section-title {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--line-soft);
}

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--line-soft);
}

.section-title-row .form-section-title {
    margin: 0;
    padding: 0;
    border-top: 0;
}

.checkbox-field {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding-top: 18px;
}

.checkbox-field input { width: 18px; height: 18px; }

textarea { min-height: 72px; resize: vertical; }

.button-as-link {
    border: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    justify-content: flex-start;
}

.small-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 18px;
}

.compact-list {
    gap: 10px;
}

.mini-card {
    padding: 12px;
    box-shadow: none;
}

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

.finance-overview { align-items: stretch; }

.finance-line {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line-soft);
}

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

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

.finance-kpi-list div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line-soft);
}

.finance-kpi-list div:last-child { border-bottom: 0; }

.finance-kpi-list span,
.finance-month-row span { color: var(--muted); }

.finance-ratio strong {
    display: block;
    font-size: 2.4rem;
    margin-bottom: 12px;
    letter-spacing: 0;
}

.finance-bar {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--line-soft);
}

.finance-bar span {
    display: block;
    min-width: 2px;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
}

.finance-bar.secondary span { background: #0f766e; }
.finance-bar.expense span { background: #b45309; }

.finance-months { margin-top: 16px; }

.finance-month-grid {
    display: grid;
    gap: 12px;
}

.finance-month-row {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--line-soft);
}

.finance-month-row:last-child { border-bottom: 0; }

.danger-soft {
    border-color: #fecaca;
    background: #fff7f7;
}

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

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

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


.form-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 1.25rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    max-width: 760px;
}

.login-card {
    max-width: 520px;
}

.form-grid.compact {
    display: grid;
    gap: 1rem;
}

.form-grid label {
    display: grid;
    gap: 0.35rem;
    color: #334155;
    font-weight: 650;
}

.input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 0.75rem 0.85rem;
    font: inherit;
}

.alert {
    margin-top: 1rem;
    border-radius: 12px;
    padding: 0.8rem 0.9rem;
}

.alert.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.actions-row {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    align-items: center;
}

.muted {
    color: #64748b;
}

.small-note {
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* Auth UI Block 10 */
.content:has(.login-page) {
    max-width: none;
    padding: 0;
}

.login-page {
    min-height: 100vh;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(360px, 520px);
    gap: 32px;
    align-items: center;
    padding: 48px;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, .18), transparent 34%),
        linear-gradient(135deg, #f8fafc 0%, #eef4ff 48%, #f8fafc 100%);
}

.login-visual {
    max-width: 760px;
}

.login-brand-mark {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    margin-bottom: 26px;
    border-radius: 22px;
    background: linear-gradient(135deg, #111827, #1d4ed8);
    color: white;
    font-size: 2rem;
    font-weight: 900;
    box-shadow: 0 22px 45px rgba(30, 64, 175, .22);
}

.login-visual h1 {
    font-size: 4.6rem;
    line-height: .9;
    margin-bottom: 18px;
}

.login-feature-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 28px;
}

.login-feature-list span {
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    padding: 9px 12px;
    background: rgba(255, 255, 255, .72);
    color: #1e3a8a;
    font-weight: 750;
    font-size: .9rem;
}

.login-panel {
    width: 100%;
    padding: 30px;
    border-radius: 26px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .14);
}

.login-panel-header h2 {
    font-size: 2rem;
    letter-spacing: 0;
    margin-bottom: 8px;
}

.login-form {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}

.field.full {
    min-width: 0;
}

.field.full span {
    color: #334155;
    font-weight: 800;
}

.login-form .input,
.security-card .input {
    min-height: 48px;
    border-radius: 14px;
}

.login-submit {
    width: 100%;
    min-height: 48px;
    margin-top: 4px;
}

.login-hint {
    margin: 18px 0 0;
    color: #64748b;
    font-size: .92rem;
    line-height: 1.55;
}

.login-legal-links,
.legal-footer {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    color: #64748b;
    font-size: .9rem;
}

.login-legal-links {
    margin: 16px 0 0;
}

.legal-footer {
    margin: 28px auto 0;
    padding: 14px 0 4px;
}

.login-legal-links a,
.legal-footer a {
    color: #1d4ed8;
    font-weight: 700;
    text-decoration: none;
}

.login-legal-links a:hover,
.legal-footer a:hover {
    text-decoration: underline;
}

.public-page {
    width: min(980px, 100%);
    margin: 0 auto;
    display: grid;
    gap: 16px;
    padding: 24px;
}

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

.public-nav a {
    text-decoration: none;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 12px;
    background: #fff;
    color: var(--text);
    font-weight: 750;
    font-size: .92rem;
}

.public-nav a:hover,
.public-nav .public-nav-primary {
    border-color: #1d4ed8;
    background: var(--accent-soft);
    color: #1e40af;
}

.public-card-grid {
    align-items: stretch;
}

.public-plan-card,
.public-feature-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.public-plan-card ul {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    line-height: 1.55;
}

.public-cta-row {
    justify-content: flex-start;
}

.auth-form-page {
    min-height: calc(100vh - 96px);
    place-items: center;
}

.legal-card {
    display: grid;
    gap: 6px;
}

.legal-card p {
    margin: 0;
    color: #475569;
    line-height: 1.55;
}

.legal-card ul {
    margin: 4px 0 0;
    padding-left: 20px;
    color: #475569;
    line-height: 1.55;
}

.legal-card li + li {
    margin-top: 4px;
}

.warn-card {
    border-color: #f59e0b;
    background: #fffbeb;
}

.task-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--line-soft);
}

.task-row:first-of-type {
    border-top: 0;
}

.form-grid.one-column,
.form-grid.compact.one-column {
    grid-template-columns: 1fr;
}

.alert.success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.security-card {
    max-width: 620px;
}

@media (max-width: 900px) {
    .login-page {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .login-visual h1 {
        font-size: 3.2rem;
    }
}

.auth-content {
    max-width: none;
    padding: 0;
    width: 100%;
}

/* Block 16: Einstellungen-Zentrum */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.settings-card {
    min-height: 210px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 20px;
    border: 1px solid var(--line-soft);
    border-radius: 22px;
    background: var(--panel);
    box-shadow: var(--shadow);
    color: var(--text);
    text-decoration: none;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.settings-card:hover {
    transform: translateY(-2px);
    border-color: #bfdbfe;
    box-shadow: 0 22px 46px rgba(15, 23, 42, .11);
}

.settings-card h2 {
    margin-bottom: 8px;
    font-size: 1.15rem;
}

.settings-card p {
    margin: 0 0 14px;
    color: var(--muted);
    line-height: 1.5;
}

.settings-card span {
    display: inline-flex;
    width: fit-content;
    border-radius: 999px;
    padding: 6px 10px;
    background: #eef2f6;
    color: #344054;
    font-size: .84rem;
    font-weight: 800;
}

.settings-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: var(--accent-soft);
    font-size: 1.35rem;
}

.settings-card.primary-card {
    background: linear-gradient(135deg, #ffffff 0%, #eef4ff 100%);
    border-color: #bfdbfe;
}

.settings-card.primary-card span {
    background: var(--sidebar);
    color: white;
}

.settings-card.muted-card {
    background: #fbfcfe;
}

.settings-note {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-top: 18px;
}

.settings-note > div {
    width: 100%;
}

.settings-note p { margin-bottom: 0; }

.settings-subnav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin: 10px 0 12px;
    padding: 8px;
    background: #fff;
    border: 1px solid #d8e0ea;
    border-radius: 8px;
}

.settings-subnav a {
    color: #344054;
    text-decoration: none;
    font-weight: 750;
    font-size: 0.84rem;
    padding: 6px 9px;
    border-radius: 6px;
}

.settings-subnav a:hover,
.settings-subnav a.active {
    color: #0f3f8f;
    background: #eef5ff;
}

.settings-subnav-separator {
    width: 1px;
    height: 22px;
    background: #d8e0ea;
    margin: 0 3px;
}

.settings-pdf-grid {
    margin: 16px 0 12px;
}

.settings-wide-field {
    grid-column: 1 / -1;
}

.settings-wide-field textarea {
    min-height: 86px;
}

.settings-inline-note {
    margin-top: 6px;
}

.settings-phase-list {
    display: grid;
    gap: 12px;
    margin: 16px 0 12px;
}

.settings-phase-row {
    display: grid;
    grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
    gap: 14px;
    align-items: end;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.settings-phase-row small {
    display: block;
    color: var(--muted);
    margin-top: 3px;
}

.settings-actions {
    margin-top: 4px;
}

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

@media (max-width: 700px) {
    .settings-grid { grid-template-columns: 1fr; }
    .settings-note { flex-direction: column; align-items: start; }
    .settings-phase-row { grid-template-columns: 1fr; align-items: stretch; }
}

.tenant-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 16px;
}

.tenant-row {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
}

.row-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.row-title h2 {
    margin: 0;
    font-size: 1.25rem;
}

.user-badges {
    margin-top: 12px;
}

.wide-dialog {
    max-width: 860px;
}

.board-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(220px, 1fr));
    gap: 14px;
    align-items: start;
}

.board-column {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.board-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 40px;
}

.board-column-header h2 {
    margin: 0;
}

.board-card {
    display: grid;
    gap: 12px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .07);
}

.board-card p {
    margin: 0;
}

.board-card-metrics {
    min-width: 0;
}

.timeline-list {
    display: grid;
    gap: 12px;
}

.timeline-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.timeline-item .button-link {
    margin-left: auto;
}

.timeline-dot {
    width: 12px;
    height: 12px;
    margin-top: 5px;
    border-radius: 999px;
    background: var(--accent);
    flex: 0 0 auto;
}

.integration-card {
    min-height: 260px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.notification-row.is-read {
    background: #fbfcfe;
    box-shadow: none;
}

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

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

.header-action-button {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    border-radius: 8px;
    padding: 8px 11px;
    font-weight: 750;
    cursor: pointer;
    line-height: 1.1;
}

.header-action-button.primary {
    border-color: #1d4ed8;
    background: #2563eb;
    color: #fff;
}

.header-action-button:hover {
    border-color: #93c5fd;
    background: #f8fbff;
}

.header-action-button.primary:hover {
    background: #1d4ed8;
}

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

.settings-hub-grid {
    align-items: start;
}

.settings-section {
    background: var(--panel);
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
}

.settings-section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.settings-section-heading h2 {
    margin: 0;
    font-size: 1rem;
}

.settings-section-heading p {
    margin: 0;
    color: var(--muted);
    font-size: .86rem;
}

.settings-link-list {
    display: grid;
    gap: 7px;
}

.settings-link-row {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 9px 10px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: #fff;
    text-decoration: none;
}

.settings-link-row:hover {
    border-color: #bfdbfe;
    background: #f8fbff;
}

.settings-link-row.disabled {
    color: var(--muted);
    background: #f8fafc;
}

.settings-link-row strong,
.settings-link-row small {
    display: block;
}

.settings-link-row strong {
    font-size: .94rem;
    margin-bottom: 2px;
}

.settings-link-row small {
    color: var(--muted);
    line-height: 1.35;
}

.settings-dot {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 8px;
    background: var(--accent-soft);
    color: #1e40af;
    font-size: .76rem;
    font-weight: 850;
}

.primary-row .settings-dot {
    background: #1e40af;
    color: #fff;
}

.note-list .note-row,
.note-inline-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.note-row h2,
.note-inline-row p {
    margin-bottom: 5px;
}

.note-row p {
    margin-top: 0;
}

.board-grid {
    grid-template-columns: repeat(5, minmax(190px, 1fr));
    gap: 10px;
}

.board-column {
    gap: 8px;
}

.board-column-header {
    min-height: 30px;
}

.board-card {
    gap: 8px;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .06);
}

.board-card .title {
    font-size: .96rem;
    line-height: 1.25;
}

.board-card .badges {
    gap: 5px;
    margin-top: 0;
}

.board-card .badge {
    padding: 3px 7px;
    font-size: .74rem;
}

.board-card .metrics {
    display: grid;
    gap: 3px;
    font-size: .82rem;
}

.board-card .field label {
    margin-bottom: 4px;
}

.board-card select,
.board-card button {
    min-height: 34px;
}

.compact-mode .content {
    padding: 12px;
}

.compact-mode .module-hero {
    padding: 10px 12px;
}

.compact-mode .card,
.compact-mode .settings-section {
    padding: 9px;
    border-radius: 8px;
}

.compact-mode .stats,
.compact-mode .grid,
.compact-mode .grid-2,
.compact-mode .settings-layout,
.compact-mode .table-list,
.compact-mode .compact-list {
    gap: 7px;
}

.compact-mode .board-grid {
    gap: 7px;
    grid-template-columns: repeat(5, minmax(170px, 1fr));
}

.compact-mode .board-card {
    gap: 6px;
    padding: 8px;
}

.compact-mode .settings-link-row {
    padding: 7px 8px;
}

.compact-mode .header-action-button,
.compact-mode button,
.compact-mode .button-link {
    padding: 6px 9px;
}

.compact-mode .hero-action-group,
.compact-mode .hero-actions {
    gap: 5px;
}

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

@media (max-width: 760px) {
    .note-list .note-row,
    .note-inline-row,
    .settings-section-heading {
        flex-direction: column;
        align-items: stretch;
    }
}

.dashboard-stats,
.task-stats {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.dashboard-work-grid {
    margin-bottom: 12px;
}

.dashboard-focus-grid {
    margin-top: 12px;
}

.dashboard-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.highlight-row {
    border-color: #93c5fd;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .12);
}

.code-block {
    max-height: 18rem;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.75rem;
    background: var(--panel-soft);
    font-size: 0.85rem;
}

.quick-date-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 6px;
}

.quick-date-actions button {
    padding: 5px 7px;
    font-size: .82rem;
}

.compact-heading {
    margin-bottom: 10px;
}

.compact-heading h2,
.compact-heading p {
    margin-bottom: 4px;
}

.task-toolbar {
    justify-content: space-between;
    align-items: end;
    gap: 10px;
}

.segmented {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.segmented button {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 999px;
    padding: 7px 10px;
    font-weight: 750;
}

.segmented button.active {
    border-color: #1d4ed8;
    background: var(--accent-soft);
    color: #1e40af;
}

.sort-field {
    min-width: 180px;
}

.task-list {
    gap: 7px;
}

.task-row {
    border-left: 3px solid transparent;
}

.task-row.card {
    padding: 10px 12px;
}

.dashboard-task-row,
.task-context-row {
    box-shadow: none;
}

.task-title-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 4px;
}

.task-title-line strong {
    margin-right: 3px;
}

.task-row p,
.task-context-row p,
.dashboard-task-row p {
    margin: 4px 0 0;
}

.is-overdue {
    border-left-color: #dc2626;
    background: #fff7f7;
}

.is-due-today {
    border-left-color: #f59e0b;
    background: #fffaf0;
}

.is-high-priority {
    border-left-color: #2563eb;
}

.is-done {
    opacity: .68;
    background: #fbfcfe;
}

.overdue-stat strong {
    color: #b91c1c;
}

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

.workflow-suggestion span {
    color: var(--muted);
}

.compact-mode .segmented button {
    padding: 5px 8px;
}

.compact-mode .task-row.card,
.compact-mode .task-context-row,
.compact-mode .dashboard-task-row {
    padding: 8px 9px;
}

.checkout-honeypot {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.commercial-editor-head,
.commercial-positions,
.compact-disclosure,
.commercial-totals {
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
}

.commercial-head-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1.15fr) minmax(240px, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.commercial-head-grid.secondary {
    grid-template-columns: minmax(150px, .75fr) minmax(280px, 1.45fr) minmax(130px, .7fr) minmax(130px, .7fr) minmax(96px, .5fr) minmax(130px, .7fr);
    margin-top: 10px;
}

.commercial-field-wide {
    min-width: 0;
}

.picker-combo {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    gap: 6px;
    align-items: center;
}

.picker-combo button {
    min-height: 34px;
    padding: 0;
    border-radius: 7px;
    font-weight: 850;
}

.commercial-head-actions,
.commercial-product-entry {
    display: flex;
    gap: 8px;
    align-items: end;
    flex-wrap: wrap;
}

.commercial-list-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}

.commercial-list-shell {
    overflow-x: visible;
    padding: 0;
}

.commercial-list-shell > article {
    padding: 10px;
}

.commercial-list-table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    font-size: 0.86rem;
    table-layout: auto;
}

.commercial-list-table th,
.commercial-list-table td {
    padding: 5px 8px;
    border-bottom: 1px solid #e6ecf2;
    text-align: left;
    vertical-align: middle;
    white-space: normal;
}

.commercial-list-table th {
    color: #475467;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0;
    background: #f8fafc;
}

.commercial-list-table tbody tr:hover,
.commercial-list-table tbody tr.is-selected {
    background: #f5f9ff;
}

.commercial-list-table a,
.commercial-list-table .button-as-link {
    color: #0f3f8f;
    text-decoration: none;
}

.strong-link {
    font-weight: 800;
}

.commercial-list-table .number-cell {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.commercial-list-table .row-actions {
    text-align: right;
    white-space: nowrap;
    min-width: 128px;
}

.commercial-list-table .row-actions > * {
    margin-left: 5px;
}

.commercial-pager {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    padding: 6px 8px;
    background: #f8fafc;
    border-top: 1px solid #e6ecf2;
}

.product-list-shell {
    margin-top: 8px;
}

.product-list-table {
    min-width: 0;
}

.hihub-work-list {
    margin-top: 8px;
}

.hihub-list-table td,
.hihub-list-table th {
    line-height: 1.25;
}

.table-subline {
    margin-top: 2px;
    color: var(--muted);
    font-size: .78rem;
    max-width: 460px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-list-table th:nth-child(2),
.customer-list-table td:nth-child(2),
.project-list-table th:nth-child(2),
.project-list-table td:nth-child(2),
.document-list-table th:first-child,
.document-list-table td:first-child {
    min-width: 220px;
}

.commercial-document-workspace .commercial-list-full,
.commercial-list-full {
    grid-column: 1 / -1;
}

.invoice-list-table,
.document-list-table {
    min-width: 0;
}

@media (max-width: 1100px) {
    .commercial-list-shell {
        overflow-x: auto;
    }

    .commercial-list-table {
        min-width: 820px;
    }
}

.product-view-toggle {
    min-height: 30px;
}

.product-list-table tr.is-muted {
    color: #667085;
    background: #fafafa;
}

.view-density-compact .customer-row,
.view-density-compact .project-row {
    padding-top: 9px;
    padding-bottom: 9px;
}

.view-density-compact .badges {
    margin-top: 6px;
}

.view-density-compact .commercial-list-table th,
.view-density-compact .commercial-list-table td {
    padding: 4px 6px;
}

.product-card-view {
    padding: 8px;
}

.product-card-row.is-muted {
    color: #667085;
    background: #fafafa;
}

.inventory-desktop-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
    gap: 10px;
    align-items: start;
}

.layout-editor-bar,
.layout-hidden-picker {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 10px 0;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.layout-hidden-picker {
    justify-content: flex-start;
    flex-wrap: wrap;
}

.layout-editor-status {
    margin-left: 8px;
    color: var(--accent);
    font-weight: 700;
}

.layout-editor-divider {
    width: 1px;
    height: 24px;
    background: var(--line);
}

.layout-workspace-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 10px;
    align-items: start;
}

.layout-workspace-section {
    min-width: 0;
}

.layout-workspace-section.is-editing {
    border: 1px dashed var(--accent);
    border-radius: 8px;
    padding: 6px;
    background: rgba(37, 99, 235, 0.04);
}

.layout-section-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    padding: 4px 6px;
    border-radius: 6px;
    background: var(--panel-soft);
}

.layout-section-toolbar .inline-actions {
    flex-wrap: wrap;
}

.layout-section-toolbar button.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(37, 99, 235, 0.10);
}

.layout-section-body {
    min-width: 0;
}

.layout-section-body > .card,
.layout-section-body > section,
.layout-section-body > article {
    margin: 0;
}

.layout-editor-loading {
    margin: 10px 0;
}

.inventory-stock-column {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.inventory-booking-column {
    min-width: 0;
}

.inventory-booking-panel {
    position: sticky;
    top: 10px;
}

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

.inventory-conversion-note {
    padding: 7px 9px;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    background: #eff6ff;
    color: #1e3a8a;
    font-size: .82rem;
    font-weight: 700;
}

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

.inventory-summary-strip {
    margin-top: 0;
}

.inventory-stock-ratio {
    display: flex;
    height: 5px;
    min-width: 76px;
    margin-top: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--line-soft);
}

.inventory-stock-ratio span {
    display: block;
}

.inventory-stock-ratio .reserved {
    background: #b45309;
}

.inventory-stock-ratio .available {
    background: #0f766e;
}

.inventory-insight-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, .85fr);
    gap: 10px;
    align-items: start;
    margin-top: 10px;
}

.inventory-compact-table {
    overflow-x: auto;
}

.inventory-compact-table .commercial-list-table {
    min-width: 620px;
}

.inventory-location-bars {
    gap: 6px;
}

.inventory-location-bars small {
    grid-column: 2 / 4;
    margin-top: -4px;
}

.inventory-unit-summary {
    margin-top: 10px;
}

.product-overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
    gap: 10px;
    align-items: start;
}

.product-overview-main {
    grid-column: span 1;
}

.product-overview-facts {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.compact-empty {
    margin: 0;
}

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

.compact-list-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #edf2f7;
    font-size: .84rem;
}

.compact-list-row:last-child {
    border-bottom: 0;
}

.compact-list-row strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .inventory-desktop-workspace,
    .inventory-insight-grid,
    .layout-workspace-grid,
    .product-overview-grid {
        grid-template-columns: 1fr;
    }

    .layout-workspace-section {
        grid-column: 1 / -1 !important;
    }

    .inventory-booking-panel {
        position: static;
    }
}

.product-row-description {
    margin-top: 2px;
    max-width: 340px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-detail-layout {
    display: grid;
    gap: 12px;
}

.product-detail-tabs {
    margin: 0 0 12px;
}

.product-detail-section {
    overflow-x: auto;
}

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

.product-edit-form {
    display: grid;
    gap: 12px;
}

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

.product-inline-editor {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e6ecf2;
}

.product-package-form-grid,
.product-document-form-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.product-package-table {
    min-width: 1120px;
}

.product-document-table {
    min-width: 1180px;
}

.commercial-detail-panel {
    position: sticky;
    top: 12px;
}

.compact-detail-head h2 {
    margin-bottom: 4px;
}

.compact-footnote {
    margin-top: 10px;
}

.entity-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0;
}

.entity-quick-links a {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    border: 1px solid #d8e0ea;
    border-radius: 6px;
    color: #0f3f8f;
    background: #f8fbff;
    font-weight: 700;
    text-decoration: none;
}

.entity-quick-links a:hover {
    background: #edf5ff;
}

.commercial-suggestions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 7px;
    margin-top: 8px;
}

.compact-disclosure {
    margin-top: 12px;
}

.compact-disclosure > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    cursor: pointer;
    font-weight: 800;
}

.compact-disclosure > summary small {
    color: var(--muted);
    font-weight: 600;
    text-align: right;
}

.compact-disclosure[open] > summary {
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--line-soft);
}

.field-label-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.field-label-actions button {
    min-height: 0;
    padding: 4px 7px;
    border-radius: 8px;
    font-size: .78rem;
}

.commercial-table {
    display: grid;
    gap: 0;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    overflow: visible;
    background: #fff;
}

.commercial-table-head,
.commercial-row {
    display: grid;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.offer-table .commercial-table-head,
.offer-table .commercial-row {
    grid-template-columns: 30px 50px minmax(84px, .55fr) minmax(170px, 1.25fr) minmax(94px, .65fr) 70px 86px 66px 88px 68px 96px 58px 36px;
}

.invoice-table .commercial-table-head,
.invoice-table .commercial-row {
    grid-template-columns: 30px 50px minmax(90px, .6fr) minmax(190px, 1.35fr) minmax(94px, .65fr) 72px 90px 70px 96px 72px 104px 36px;
}

.commercial-document-editor-page {
    display: block;
}

.commercial-invoice-editor-full {
    width: 100%;
}

.warning-message {
    border-color: #f59e0b;
    background: #fffbeb;
    color: #92400e;
}

.calculation-table .commercial-table-head,
.calculation-table .commercial-row {
    grid-template-columns: 34px minmax(76px, .5fr) minmax(220px, 1.4fr) 86px 76px 104px 110px;
}

.commercial-table-head {
    min-height: 34px;
    padding: 0 8px;
    border-bottom: 1px solid var(--line-soft);
    background: #f8fafc;
    color: #475467;
    font-size: .78rem;
    font-weight: 850;
}

.commercial-row {
    min-height: 48px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--line-soft);
}

.commercial-row:last-child {
    border-bottom: 0;
}

.commercial-row.is-optional {
    background: #fbfcfe;
}

.commercial-row.is-duplicate {
    opacity: .6;
}

.commercial-row input,
.commercial-row select,
.commercial-row textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 5px 6px;
    background: transparent;
    font: inherit;
}

.commercial-row input:focus,
.commercial-row select:focus,
.commercial-row textarea:focus {
    border-color: #93c5fd;
    background: #fff;
    outline: 0;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .12);
}

.commercial-row .number-input,
.number-cell,
.money-cell {
    text-align: right;
}

.commercial-unit-total {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.commercial-unit-total small,
.commercial-package-empty {
    display: block;
    overflow: hidden;
    color: #64748b;
    font-size: .74rem;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.money-cell {
    justify-self: stretch;
    color: var(--text);
    white-space: nowrap;
}

.commercial-icon-button {
    width: 26px;
    height: 26px;
    min-height: 0;
    padding: 0;
    border-radius: 6px;
}

.commercial-checkbox {
    display: grid;
    place-items: center;
}

.commercial-checkbox input {
    width: 18px;
    height: 18px;
}

.row-menu {
    position: relative;
    justify-self: end;
}

.row-menu > summary {
    width: 30px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    list-style: none;
}

.row-menu > summary::-webkit-details-marker {
    display: none;
}

.row-menu > div {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 5;
    display: grid;
    gap: 5px;
    min-width: 140px;
    padding: 7px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.row-menu button {
    justify-content: flex-start;
    padding: 6px 8px;
    border-radius: 7px;
}

.commercial-row-details {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid var(--line-soft);
    background: #fbfcfe;
}

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

.commercial-row-details textarea {
    min-height: 76px;
}

.commercial-empty {
    padding: 18px;
    color: var(--muted);
}

.commercial-product-entry {
    margin-top: 10px;
}

.commercial-totals {
    position: sticky;
    bottom: 70px;
    z-index: 4;
    display: flex;
    gap: 10px;
    align-items: stretch;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 12px;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(8px);
}

.commercial-totals div {
    min-width: 120px;
    padding: 7px 9px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: #fbfcfe;
}

.commercial-totals span {
    display: block;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 750;
}

.commercial-totals strong {
    display: block;
    margin-top: 2px;
    text-align: right;
    white-space: nowrap;
}

.commercial-totals .grand-total {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.commercial-totals .grand-total strong {
    font-size: 1.16rem;
}

.commercial-sticky-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 0 0;
    background: linear-gradient(180deg, rgba(245, 247, 251, 0), var(--bg) 28%);
}

.commercial-dialog-actions-top {
    position: static;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.calculation-row {
    cursor: pointer;
}

@media (max-width: 1180px) {
    .commercial-head-grid,
    .commercial-head-grid.secondary,
    .commercial-row-details {
        grid-template-columns: 1fr;
    }

    .commercial-table {
        border: 0;
        background: transparent;
        gap: 8px;
    }

    .commercial-table-head {
        display: none;
    }

    .offer-table .commercial-row,
    .invoice-table .commercial-row,
    .calculation-table .commercial-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        border: 1px solid var(--line-soft);
        border-radius: 8px;
        background: #fff;
    }

    .commercial-row .commercial-icon-button,
    .commercial-row .row-menu {
        justify-self: start;
    }
}

.public-plan-card.highlight {
    border-color: var(--accent);
    box-shadow: 0 14px 30px rgba(37, 99, 235, .14);
}

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

.usage-grid > div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    background: #fff;
}

.usage-grid span,
.usage-grid strong {
    display: block;
}

.compact-mode .usage-grid {
    gap: 7px;
}

.compact-mode .usage-grid > div {
    padding: 8px 9px;
}

.storage-settings-grid {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 14px;
}

.storage-area-list,
.file-segment-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.storage-area-button {
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: flex-start;
    width: 100%;
    padding: 9px 10px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    text-align: left;
}

.storage-area-button.active {
    border-color: var(--accent);
    background: #eff6ff;
}

.storage-area-button span,
.storage-preview span,
.storage-preview small {
    color: var(--muted);
    font-size: .82rem;
}

.storage-template-editor {
    display: grid;
    gap: 10px;
}

.file-segment-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 34px 34px 34px;
    align-items: center;
    gap: 7px;
}

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

.button-row.right {
    justify-content: flex-end;
}

.compact-select {
    max-width: 220px;
}

.storage-preview {
    display: grid;
    gap: 3px;
    padding: 10px 12px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: #f8fafc;
}

@media (max-width: 1200px) {
    .dashboard-stats,
    .task-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .storage-settings-grid,
    .dashboard-stats,
    .task-stats {
        grid-template-columns: 1fr;
    }

    .task-toolbar,
    .task-row,
    .dashboard-task-row,
    .task-context-row {
        grid-template-columns: 1fr;
    }
}

.board-summary-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 8px 12px;
    margin: 8px 0;
}

.board-summary-bar span {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    white-space: nowrap;
}

.board-summary-bar strong {
    font-size: 1.04rem;
    font-variant-numeric: tabular-nums;
}

.board-filter-toolbar {
    display: flex;
    align-items: end;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.board-filter-toolbar .field {
    min-width: 150px;
}

.board-filter-toolbar .field.grow {
    min-width: 260px;
}

.board-active-toggle {
    align-self: center;
    min-height: 34px;
    padding-top: 18px;
}

.view-toggle {
    display: inline-flex;
    gap: 4px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
}

.view-toggle button {
    min-height: 28px;
    padding: 4px 10px;
    border-color: transparent;
    background: transparent;
}

.view-toggle button.active {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: #0b4ddb;
}

.board-loading {
    padding: 12px;
    color: var(--muted);
}

.board-workspace {
    min-height: 0;
    height: clamp(420px, calc(100vh - 310px), 760px);
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 6px;
}

.board-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(230px, 270px);
    grid-template-columns: none;
    align-items: stretch;
    gap: 8px;
    min-height: 100%;
}

.board-column {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: rgba(255,255,255,.62);
}

.board-column-header {
    position: sticky;
    top: 0;
    z-index: 1;
    min-height: 34px;
    padding: 7px 9px;
    border-bottom: 1px solid var(--line-soft);
    background: rgba(248,250,252,.96);
}

.board-column-header h2 {
    margin: 0;
    font-size: .92rem;
    line-height: 1.15;
}

.board-column-scroll {
    display: grid;
    align-content: start;
    gap: 7px;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 7px;
}

.board-empty-column {
    margin: 0;
    padding: 10px 4px;
    color: var(--muted);
    font-size: .84rem;
    text-align: center;
}

.board-card {
    gap: 6px;
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 5px 12px rgba(15, 23, 42, .05);
}

.board-card.is-overdue {
    border-left: 3px solid #ef4444;
}

.board-card-main {
    display: grid;
    gap: 2px;
    text-decoration: none;
    min-width: 0;
}

.board-card-main:hover .title,
.board-card-main:focus .title {
    color: var(--accent);
    text-decoration: underline;
}

.board-card-number {
    color: #0046a8;
    font-weight: 800;
    font-size: .76rem;
    line-height: 1.15;
}

.board-card .title {
    font-size: .9rem;
    line-height: 1.18;
    overflow-wrap: anywhere;
}

.board-card .muted {
    font-size: .8rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.board-card-badges,
.board-card-meta,
.board-move-compact {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.board-card-badges .badge {
    padding: 2px 6px;
    font-size: .7rem;
}

.board-card-meta {
    color: var(--muted);
    font-size: .75rem;
    line-height: 1.2;
}

.board-card-meta span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.board-move-compact {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
}

.board-move-compact select {
    min-height: 28px;
    padding: 3px 6px;
    font-size: .78rem;
}

.board-move-compact button {
    min-height: 28px;
    padding: 3px 8px;
    font-size: .78rem;
}

.board-list-shell {
    margin-top: 8px;
}

.commercial-list-table tr.row-warning td {
    background: #fff7ed;
}

@media (min-width: 1500px) {
    .board-grid {
        grid-auto-columns: minmax(240px, 1fr);
    }
}

@media (max-width: 900px) {
    .board-workspace {
        height: clamp(420px, calc(100vh - 360px), 720px);
    }

    .board-grid {
        grid-auto-columns: minmax(225px, 82vw);
    }

    .board-filter-toolbar .field,
    .board-filter-toolbar .field.grow {
        min-width: 100%;
    }
}

.business-kpi-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    margin: 10px 0;
}

.business-kpi-strip article {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .04);
}

.business-kpi-strip strong {
    display: block;
    overflow: hidden;
    font-size: 1.18rem;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.business-kpi-strip span,
.inline-metrics span,
.commercial-list-table td span,
.status-summary-grid span,
.status-summary-grid small {
    color: var(--muted);
}

.business-kpi-strip article.attention {
    border-color: #fed7aa;
    background: #fff7ed;
}

.business-kpi-strip article.danger {
    border-color: #fecaca;
    background: #fff7f7;
}

.business-kpi-strip article.danger strong {
    color: #b91c1c;
}

.business-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 2.25fr) minmax(260px, .8fr);
    gap: 10px;
    margin-top: 10px;
}

.business-chart-card,
.business-side-card,
.accounting-entry-card,
.calculation-list-card,
.calculation-control-card,
.accounting-filter-card {
    border-radius: 8px;
}

.business-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.business-card-head h2 {
    margin: 0;
}

.business-card-head .muted,
.compact-note {
    margin: 3px 0 0;
}

.finance-ratio.compact strong {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.finance-kpi-list.compact {
    gap: 0;
    margin-top: 8px;
}

.finance-kpi-list.compact div {
    padding: 7px 0;
}

.month-chart {
    display: grid;
    gap: 5px;
}

.month-chart-row {
    display: grid;
    grid-template-columns: 64px minmax(160px, 1fr) 108px 108px 108px;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    font-size: .84rem;
}

.month-chart-row > strong,
.month-chart-row > span,
.comparison-bars strong,
.finance-table .number-cell,
.calculation-work-table .number-cell {
    font-variant-numeric: tabular-nums;
}

.month-bars {
    display: grid;
    gap: 3px;
}

.month-bars .bar {
    display: block;
    min-width: 2px;
    height: 5px;
    border-radius: 999px;
    background: var(--accent);
}

.month-bars .bar.payment,
.legend-dot.payment {
    background: #0f766e;
}

.month-bars .bar.expense,
.legend-dot.expense {
    background: #b45309;
}

.month-bars .bar.neutral,
.legend-dot.neutral {
    background: #64748b;
}

.month-bars .bar.danger {
    background: #dc2626;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 9px;
    color: var(--muted);
    font-size: .8rem;
}

.chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--accent);
}

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

.finance-table .commercial-list-table,
.calculation-work-table .commercial-list-table {
    min-width: 760px;
}

.finance-table td,
.calculation-work-table td {
    vertical-align: top;
}

.finance-table td span,
.calculation-work-table td span {
    display: block;
    margin-top: 2px;
    font-size: .78rem;
    line-height: 1.2;
}

.actions-cell {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
    white-space: nowrap;
}

.actions-cell button {
    min-height: 28px;
    padding: 4px 8px;
    font-size: .78rem;
}

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

.status-summary-grid > div {
    display: grid;
    gap: 2px;
    padding: 9px 10px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: #fbfcfe;
}

.status-summary-grid b {
    font-size: 1rem;
}

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

.accounting-entry-grid .field.grow {
    grid-column: span 2;
}

.accounting-entry-grid textarea {
    min-height: 48px;
}

.inline-metrics {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.inline-metrics span {
    display: inline-flex;
    gap: 4px;
    padding: 5px 8px;
    border-radius: 999px;
    background: var(--panel-soft);
    font-size: .82rem;
    white-space: nowrap;
}

.comparison-bars {
    display: grid;
    gap: 10px;
}

.comparison-bars > div {
    display: grid;
    grid-template-columns: 86px minmax(180px, 1fr) 120px;
    align-items: center;
    gap: 10px;
}

.calculation-work-table .commercial-list-table {
    min-width: 1080px;
}

.calculation-work-table .detail-row td {
    border-top: 0;
    background: #fbfcfe;
    color: var(--muted);
    font-size: .82rem;
}

.finance-status-strip {
    margin-top: 10px;
}

@media (max-width: 1180px) {
    .business-dashboard-grid,
    .accounting-entry-grid {
        grid-template-columns: 1fr;
    }

    .accounting-entry-grid .field.grow {
        grid-column: auto;
    }

    .month-chart-row {
        grid-template-columns: 58px minmax(150px, 1fr);
    }

    .month-chart-row > span {
        display: none;
    }

    .comparison-bars > div {
        grid-template-columns: 76px minmax(120px, 1fr);
    }

    .comparison-bars strong {
        grid-column: 2;
    }
}
