:root {
    --bg: #f2f3f4;
    --panel: #ffffff;
    --line: #d8dee6;
    --text: #3c3c3b;
    --muted: #6b7280;
    --brand: #1baca0;
    --brand-dark: #075e56;
    --danger: #8b0101;
    --danger-bg: #fef2f2;
    --success-bg: #ecfdf5;
    --edi-burgundy: #8b0101;
}

* { box-sizing: border-box; }

body.pm-body {
    margin: 0;
    font-family: "Montserrat", "Segoe UI", system-ui, sans-serif;
    color: var(--text);
    background: var(--bg);
}

h1, h2, h3, .pm-page-head h1 {
    font-family: "Raleway", "Montserrat", sans-serif;
}

.pm-card-value,
.pm-statement-kpi-grid strong,
.pm-finance-waterfall-row strong,
.pm-portfolio-table td:nth-child(n+3) {
    font-family: "JetBrains Mono", ui-monospace, monospace;
}

code {
    background: #eef2f7;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.92em;
}

.pm-shell {
    min-height: 100vh;
    display: flex;
    position: relative;
}

.pm-sidebar-backdrop {
    display: none;
}

.pm-sidebar {
    background: #075e56;
    color: #ecfdf5;
    display: flex;
    flex-direction: column;
    padding: 20px 14px 16px;
    min-height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    width: 290px;
    flex-shrink: 0;
    transition: width 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.pm-shell--sidebar-collapsed .pm-sidebar {
    width: 0;
    padding-left: 0;
    padding-right: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-12px);
}

.pm-main-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: -8px 0 16px;
}

.pm-sidebar-toggle {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    border-radius: 8px;
    padding: 8px 12px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.pm-main-topbar-extra {
    min-width: 0;
    flex: 1;
}

.pm-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0 0 10px;
    font-size: 0.88rem;
    color: var(--muted);
}

.pm-breadcrumbs a {
    color: var(--brand-dark);
    text-decoration: none;
}

.pm-breadcrumbs a:hover {
    text-decoration: underline;
}

.pm-breadcrumb-sep {
    color: #94a3b8;
}

.pm-breadcrumb-current {
    color: var(--text);
    font-weight: 600;
}

.pm-project-chrome {
    position: sticky;
    top: 0;
    z-index: 4;
    margin: 0 0 16px;
    padding: 0 0 10px;
    background: linear-gradient(var(--bg) 80%, rgba(244, 246, 248, 0));
}

.pm-project-chrome .pm-doc-tabs {
    margin-bottom: 0;
}

.pm-brand {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.pm-brand span,
.pm-brand-center span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.85rem;
}

.pm-brand-center {
    text-align: center;
    margin-bottom: 20px;
}

.pm-sidebar-nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 2px;
    margin-bottom: 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

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

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

.pm-nav-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.pm-nav-section + .pm-nav-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.pm-nav-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
}

.pm-nav-section-title {
    margin: 0 0 4px;
    padding: 0 10px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
}

.pm-nav-hint {
    margin: 0 0 6px;
    padding: 0 10px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.62);
    line-height: 1.45;
}

.pm-sidebar-project-form {
    margin-bottom: 6px;
    width: 100%;
    max-width: 100%;
}

.pm-sidebar-project-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    max-width: 100%;
    padding: 0 2px 4px;
}

.pm-sidebar-project-label-text {
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.62);
    padding: 0 8px;
}

.pm-sidebar-project-select {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 7px 28px 7px 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.18);
    color: #ecfdf5;
    font: inherit;
    font-size: 0.84rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ecfdf5' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.pm-nav-link {
    display: flex;
    align-items: flex-start;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    color: #ecfdf5;
    text-decoration: none;
    padding: 9px 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
    transition: background-color 0.15s ease;
}

.pm-nav-link:not(.is-disabled):hover {
    background: rgba(255, 255, 255, 0.1);
}

.pm-nav-link.is-active {
    background: rgba(255, 255, 255, 0.16);
    font-weight: 600;
}

.pm-nav-link.is-disabled {
    opacity: 0.42;
    cursor: not-allowed;
    pointer-events: none;
}

.pm-nav-link--cta {
    font-weight: 600;
    background: rgba(255, 255, 255, 0.12);
}

.pm-nav-list--cta {
    margin-top: 8px;
}

.pm-sidebar-foot {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    display: grid;
    gap: 10px;
    flex-shrink: 0;
}

.pm-dashboard-module-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 8px;
    max-width: 620px;
}

.pm-module-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    text-decoration: none;
    font-size: 0.82rem;
    line-height: 1.2;
    text-align: center;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.pm-module-action:hover {
    border-color: var(--brand);
    background: #f0fdfa;
}

.pm-module-action-primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    font-weight: 600;
}

.pm-module-action-primary:hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #fff;
}

.pm-dashboard-quick-actions {
    margin-top: 16px;
}

.pm-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.pm-documents-layout {
    display: grid;
    grid-template-columns: minmax(280px, 420px) 1fr;
    gap: 16px;
    align-items: start;
}

.pm-documents-form + .pm-documents-form {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.pm-documents-form {
    display: grid;
    gap: 14px;
}

.pm-doc-type-hint {
    margin: -6px 0 0;
    font-size: 0.88rem;
    color: var(--muted);
}

.pm-doc-template-summary {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafc;
}

.pm-doc-template-summary > div {
    display: grid;
    gap: 4px;
}

.pm-doc-template-summary strong {
    font-size: 0.98rem;
}

.pm-doc-template-summary span,
.pm-doc-template-summary dd {
    color: var(--muted);
    font-size: 0.9rem;
}

.pm-doc-template-summary dl,
.pm-doc-source-list {
    display: grid;
    gap: 6px 12px;
    grid-template-columns: minmax(120px, 180px) 1fr;
    margin: 0;
}

.pm-doc-template-summary dt,
.pm-doc-source-list dt {
    font-weight: 700;
    color: var(--text);
}

.pm-doc-template-summary dd,
.pm-doc-source-list dd {
    margin: 0;
}

.pm-doc-dynamic-fields {
    padding: 14px 0 0;
    border-top: 1px solid var(--line);
}

.pm-doc-missing-panel {
    margin-top: 16px;
}

.pm-doc-missing-list {
    display: grid;
    gap: 10px;
}

.pm-doc-missing-list article {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.pm-doc-missing-list p {
    margin: 4px 0 0;
    color: var(--muted);
}

.pm-doc-preview-data {
    margin-bottom: 16px;
}

.pm-document-preview-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px 20px;
    margin: 16px 0 24px;
}

.pm-document-preview-meta div {
    display: grid;
    gap: 4px;
}

.pm-document-preview-meta dt {
    font-size: 0.82rem;
    color: var(--muted);
}

.pm-document-preview-meta dd {
    margin: 0;
    font-weight: 600;
}

@media (max-width: 900px) {
    .pm-documents-layout {
        grid-template-columns: 1fr;
    }
}

.pm-btn.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.pm-module-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pm-dashboard-projects-wrap {
    max-height: none;
}

.pm-dashboard-projects-table td {
    white-space: normal;
    vertical-align: top;
}

.pm-budget-table-wrap {
    max-height: calc(100vh - 220px);
}

.pm-main:has(.pm-budget-workspace) {
    min-width: 0;
    overflow: hidden;
    padding: 18px 18px 0;
}

.pm-budget-workspace {
    height: calc(100vh - 18px);
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}

.pm-budget-workspace .pm-page-head {
    flex-shrink: 0;
}

.pm-budget-workspace .pm-tab-nav {
    flex-shrink: 0;
}

.pm-tab-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
}

.pm-tab-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 13px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 650;
    line-height: 1.15;
    background: #f2f5f8;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.pm-tab-nav a:hover {
    border-color: rgba(15, 118, 110, 0.28);
    background: #e7f4f1;
    color: var(--brand-dark);
}

.pm-tab-nav a.is-active {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.pm-budget-version-panel {
    flex-shrink: 0;
    padding: 14px 18px;
}

.pm-budget-data-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.pm-budget-data-panel > h2 {
    flex-shrink: 0;
    margin: 0;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
}

.pm-budget-table-shell {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.pm-budget-table-shell .pm-budget-table-wrap {
    flex: 1;
    min-height: 0;
    max-height: none;
    border: 0;
    border-radius: 0;
    background: #fff;
}

.pm-budget-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    font-size: 0.8rem;
}

.pm-budget-table th,
.pm-budget-table td {
    max-width: none;
    padding: 6px 7px;
    vertical-align: middle;
}

.pm-budget-table thead th {
    background: #edf1f6;
    color: var(--text);
    font-weight: 700;
    z-index: 3;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.15;
}

.pm-budget-table tr.is-hidden {
    display: none;
}

.pm-budget-col-line {
    width: 5.8%;
}

.pm-budget-col-item {
    width: 22.5%;
}

.pm-budget-col-qty {
    width: 6.4%;
}

.pm-budget-col-unit {
    width: 5.4%;
}

.pm-budget-col-money {
    width: 11.5%;
}

.pm-budget-col-total {
    width: 12.5%;
}

.pm-budget-table .pm-budget-item-cell {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.35;
}

.pm-text-left {
    text-align: left;
}

.pm-text-center {
    text-align: center;
}

.pm-money {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.pm-sheet-tabs {
    flex-shrink: 0;
    display: flex;
    gap: 0;
    min-height: 42px;
    padding: 6px 14px 0;
    overflow-x: auto;
    border-top: 1px solid var(--line);
    background: #f7f9fb;
}

.pm-sheet-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    max-width: 260px;
    min-height: 34px;
    padding: 7px 14px;
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
    background: #e7ebf1;
    color: var(--text);
    font: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pm-sheet-tab + .pm-sheet-tab {
    margin-left: -1px;
}

.pm-sheet-tab.is-active {
    background: #fff;
    color: var(--brand-dark);
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.pm-sheet-tab span {
    margin-left: auto;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.pm-pagination {
    margin-top: 12px;
}

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

.pm-pagination a,
.pm-pagination span {
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.88rem;
}

.pm-user span {
    display: block;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.85rem;
}

.pm-main {
    min-width: 0;
    flex: 1;
    padding: 28px;
}

.pm-page-head h1 {
    margin: 0 0 6px;
    font-size: 1.75rem;
}

.pm-page-head p {
    margin: 0;
    color: var(--muted);
}

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

.pm-form-wide {
    max-width: 560px;
}

.pm-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.pm-sheet-panel {
    margin-top: 20px;
}

.pm-sheet-head h2 {
    margin: 0 0 4px;
    font-size: 1.15rem;
}

.pm-preview-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    max-height: 420px;
    background: #fafbfc;
}

.pm-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.pm-preview-table th,
.pm-preview-table td {
    border: 1px solid var(--line);
    padding: 6px 8px;
    white-space: nowrap;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pm-preview-table thead th {
    position: sticky;
    top: 0;
    background: #eef2f7;
    z-index: 1;
}

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

.pm-section-head h2 {
    margin: 0 0 4px;
    font-size: 1.12rem;
}

.pm-section-head p {
    margin: 0;
}

.pm-section-summary-wrap {
    max-height: 300px;
    margin-bottom: 14px;
}

.pm-section-summary-table th,
.pm-section-summary-table td {
    max-width: 280px;
}

.pm-section-summary-table .pm-section-name {
    min-width: 190px;
    white-space: normal;
}

.pm-section-summary-table .pm-section-source {
    min-width: 180px;
    white-space: normal;
}

.pm-section-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 12px 0 16px;
}

.pm-preview-row-no {
    background: #f3f4f6;
    color: var(--muted);
    text-align: center;
    min-width: 42px;
}

.pm-mapping-table .pm-preview-row-no,
.pm-mapping-table thead th.pm-preview-row-no {
    position: sticky;
    left: 0;
    z-index: 2;
}

.pm-mapping-table thead th.pm-preview-row-no {
    z-index: 3;
}

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

.pm-btn.is-disabled,
.pm-btn-primary.is-disabled {
    opacity: 0.55;
    pointer-events: none;
    cursor: not-allowed;
}

.pm-validation-warnings {
    margin-top: 8px;
    color: #92400e;
}

.pm-preview-modal {
    width: min(96vw, 1400px);
    max-height: 92vh;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0;
}

.pm-preview-modal::backdrop {
    background: rgba(15, 23, 42, 0.45);
}

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

.pm-preview-modal-head h2 {
    margin: 0;
    font-size: 1rem;
}

.pm-preview-modal-wrap {
    max-height: calc(92vh - 64px);
}

.pm-row-issue-skipped {
    color: var(--muted);
}

.pm-row-issue-error {
    color: var(--danger);
}

.pm-page-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pm-mapping-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 16px;
    align-items: start;
}

.pm-mapping-sidebar {
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 32px);
    overflow: auto;
}

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

.pm-mapping-section h2 {
    margin: 0 0 10px;
    font-size: 1rem;
}

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

.pm-mapping-section-head h2 {
    margin: 0;
}

.pm-mapping-form {
    display: grid;
    gap: 10px;
}

.pm-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    background: #fff;
}

.pm-block-list {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.pm-block-option {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
}

.pm-block-option.is-active,
.pm-block-option:has(input:checked) {
    border-color: var(--brand);
    background: #ecfdf5;
}

.pm-block-option input {
    margin-top: 4px;
}

.pm-block-option strong {
    display: block;
    font-size: 0.92rem;
}

.pm-block-option small {
    color: var(--muted);
}

.pm-inline-field {
    display: flex;
    gap: 8px;
}

.pm-inline-field input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
}

.pm-field-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.pm-field-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    border-left: 4px solid var(--field-color, #d1d5db);
}

.pm-field-item.is-active {
    border-color: var(--brand);
    box-shadow: 0 0 0 1px var(--brand);
}

.pm-field-btn {
    border: 0;
    background: transparent;
    text-align: left;
    padding: 10px 12px;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.pm-field-label {
    display: block;
    font-weight: 600;
    font-size: 0.92rem;
}

.pm-field-label em {
    font-style: normal;
    color: var(--muted);
    font-weight: 400;
    font-size: 0.82rem;
}

.pm-field-map {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.85rem;
}

.pm-field-clear {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 10px;
}

.pm-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.pm-badge-manual {
    background: #dbeafe;
    color: #1d4ed8;
}

.pm-badge-auto {
    background: #f3f4f6;
    color: #6b7280;
}

.pm-btn-sm {
    padding: 6px 10px;
    font-size: 0.85rem;
}

.pm-validation-list {
    margin: 0;
    padding-left: 18px;
}

.pm-mapping-preview-wrap {
    max-height: calc(100vh - 180px);
}

.pm-mapping-table .pm-map-col {
    cursor: pointer;
    text-align: center;
    min-width: 56px;
    vertical-align: bottom;
}

.pm-mapping-table .pm-map-col:hover {
    outline: 2px solid var(--brand);
    outline-offset: -2px;
}

.pm-mapping-table .pm-header-row {
    background: #fffbeb;
}

.pm-mapping-table .pm-header-row td {
    font-weight: 600;
}

.pm-row-select {
    cursor: pointer;
}

.pm-row-select:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

.pm-col-tags {
    display: block;
    margin-top: 4px;
}

.pm-col-tag {
    display: block;
    font-size: 0.68rem;
    font-weight: 500;
    line-height: 1.2;
    color: #374151;
}

.pm-import-preview-panel {
    margin-top: 20px;
}

.pm-import-preview-wrap {
    max-height: calc(100vh - 320px);
}

.pm-import-preview-table .pm-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.pm-finalize-form {
    margin: 16px 0;
}

.pm-progress-panel {
    margin-top: 16px;
}

.pm-progress-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.pm-progress-head h2 {
    margin: 0 0 4px;
}

.pm-progress-head-actions {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.pm-progress-entry-dialog {
    width: min(560px, calc(100vw - 32px));
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0;
}

.pm-progress-entry-dialog::backdrop {
    background: rgb(15 23 42 / 0.45);
}

.pm-progress-entry-dialog-form {
    padding: 18px;
}

.pm-progress-entry-dialog-form header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.pm-progress-entry-dialog-form header h3 {
    margin: 0;
}

.pm-progress-view-form {
    width: min(420px, 100%);
    flex: 0 0 min(420px, 100%);
}

.pm-progress-table-wrap {
    max-height: calc(100vh - 280px);
}

.pm-progress-table th,
.pm-progress-table td {
    font-size: 0.82rem;
}

.pm-progress-table {
    min-width: 1560px;
}

.pm-progress-table .pm-progress-group-start {
    border-left-width: 2px;
    border-left-color: #94a3b8;
}

.pm-progress-table .pm-progress-col--meta {
    background: #ffffff;
}

.pm-progress-table thead .pm-progress-col--meta {
    background: #e8edf3;
}

.pm-progress-table .pm-progress-sticky {
    position: sticky;
    z-index: 3;
    box-shadow: 1px 0 0 var(--line);
}

.pm-progress-table thead .pm-progress-sticky {
    z-index: 5;
}

.pm-progress-table .pm-progress-sticky-no {
    left: 0;
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    text-align: center;
}

.pm-progress-table .pm-progress-sticky-item {
    left: 44px;
    width: 320px;
    min-width: 320px;
    max-width: 320px;
    text-align: left;
}

.pm-progress-table .pm-progress-sticky-unit {
    left: 364px;
    width: 52px;
    min-width: 52px;
    max-width: 52px;
    text-align: center;
}

.pm-progress-table .pm-progress-qty,
.pm-progress-daily .pm-progress-qty {
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.pm-progress-table .pm-progress-money,
.pm-progress-change-table .pm-progress-money,
.pm-progress-change-summary .pm-progress-money {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.pm-progress-change-table .pm-progress-count {
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.pm-progress-table .pm-progress-col--base {
    background: #f0fdfa;
}

.pm-progress-table thead .pm-progress-col--base {
    background: #ccfbf1;
}

.pm-progress-table .pm-progress-col--remaining {
    background: #f8fafc;
}

.pm-progress-table thead .pm-progress-col--remaining {
    background: #e2e8f0;
}

.pm-progress-table .pm-progress-col--reported {
    background: #eff6ff;
}

.pm-progress-table thead .pm-progress-col--reported {
    background: #dbeafe;
}

.pm-progress-table .pm-progress-col--pending {
    background: #fff7ed;
}

.pm-progress-table thead .pm-progress-col--pending {
    background: #ffedd5;
}

.pm-progress-table .pm-progress-col--in-tig {
    background: #eef2ff;
}

.pm-progress-table thead .pm-progress-col--in-tig {
    background: #e0e7ff;
}

.pm-progress-table .pm-progress-col--accepted {
    background: #ecfdf5;
}

.pm-progress-table thead .pm-progress-col--accepted {
    background: #d1fae5;
}

.pm-progress-table .pm-progress-col--open {
    background: #fffbeb;
}

.pm-progress-table thead .pm-progress-col--open {
    background: #fef3c7;
}

.pm-progress-table .pm-progress-col--correction {
    background: #faf5ff;
}

.pm-progress-table thead .pm-progress-col--correction {
    background: #ede9fe;
}

.pm-overrun-alert td {
    background: #fef2f2;
}

.pm-progress-corrections {
    margin-bottom: 16px;
}

.pm-tig-sla-warn td {
    background: #fffbeb;
}

.pm-tig-sla-danger td {
    background: #fef2f2;
}

.pm-progress-table .pm-progress-col--rejected {
    background: #fef2f2;
}

.pm-progress-table thead .pm-progress-col--rejected {
    background: #fee2e2;
}

.pm-progress-table .pm-progress-col--price {
    background: #f5f3ff;
}

.pm-progress-table thead .pm-progress-col--price {
    background: #ede9fe;
}

.pm-progress-table .pm-progress-col--delta {
    background: #fefce8;
}

.pm-progress-table thead .pm-progress-col--delta {
    background: #fef3c7;
}

.pm-progress-table .pm-progress-col--entry {
    background: #f7fee7;
}

.pm-progress-table thead .pm-progress-col--entry {
    background: #ecfccb;
}

.pm-progress-table tr.pm-delta-amber td:first-child {
    box-shadow: inset 4px 0 0 #f59e0b;
}

.pm-progress-table tr.pm-delta-warn td:first-child {
    box-shadow: inset 4px 0 0 #ef4444;
}

.pm-progress-change-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr)) auto;
    gap: 10px;
    align-items: stretch;
    margin-bottom: 12px;
}

.pm-progress-change-summary article {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.pm-progress-change-summary span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pm-progress-change-summary strong {
    display: block;
    margin-top: 6px;
    font-size: 1.15rem;
}

.pm-progress-change-summary .pm-btn {
    align-self: center;
    justify-self: end;
}

.pm-progress-change-table {
    min-width: 820px;
}

.pm-progress-entry-form {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    min-width: 280px;
}

.pm-progress-input {
    width: 72px;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
}

.pm-progress-note {
    width: 120px;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
}

.pm-progress-daily {
    margin-top: 16px;
}

.pm-inline-form {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    margin: 0 12px 12px 0;
    flex-wrap: wrap;
}

.pm-inline-form select {
    min-width: 180px;
    max-width: 360px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    background: #fff;
}

.pm-inline-form select[multiple] {
    min-width: 260px;
    white-space: normal;
}

.pm-tig-workflow .pm-inline-form {
    margin-bottom: 12px;
}

.pm-tig-preview {
    margin-top: 16px;
}

.pm-delta-amber td {
    background: #fffbeb;
}

.pm-delta-warn td {
    background: #fef2f2;
}

@media (max-width: 1100px) {
    .pm-progress-head,
    .pm-progress-change-summary {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .pm-progress-view-form {
        width: 100%;
        flex-basis: auto;
    }

    .pm-progress-change-summary .pm-btn {
        justify-self: stretch;
    }

    .pm-mapping-layout {
        grid-template-columns: 1fr;
    }

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

.pm-field select,
.pm-field input[type="file"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    background: #fff;
}

.pm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.pm-project-statement {
    margin: 18px 0 24px;
    padding: 18px;
    border: 1px solid #ccd6e2;
    border-radius: 10px;
    background: #ffffff;
}

.pm-project-statement-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.pm-project-statement-head h2 {
    margin: 0 0 4px;
}

.pm-project-statement-head p {
    margin: 0;
    color: var(--muted);
}

.pm-health-pill {
    min-width: 210px;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    text-align: right;
}

.pm-health-pill span,
.pm-statement-kpi-grid span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pm-health-pill strong {
    display: block;
    margin-top: 4px;
    font-size: 1.55rem;
}

.pm-health-pill small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
}

.pm-health-pill--good {
    border-color: #86efac;
    background: #f0fdf4;
    color: #166534;
}

.pm-health-pill--acceptable {
    border-color: #fde68a;
    background: #fffbeb;
    color: #92400e;
}

.pm-health-pill--bad {
    border-color: #fdba74;
    background: #fff7ed;
    color: #9a3412;
}

.pm-health-pill--critical {
    border-color: #fca5a5;
    background: #fef2f2;
    color: #991b1b;
}

.pm-statement-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.pm-statement-kpi-grid article {
    min-width: 0;
    padding: 12px;
    border: 1px solid #dbe3ec;
    border-radius: 8px;
    background: #f8fafc;
}

.pm-statement-kpi-grid strong {
    display: block;
    margin-top: 7px;
    font-size: 1.1rem;
    white-space: normal;
}

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

.pm-statement-block {
    min-width: 0;
    border: 1px solid #d8dee6;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
}

.pm-statement-block h3 {
    margin: 0;
    padding: 9px 12px;
    border-bottom: 1px solid #d8dee6;
    background: #eef6f5;
    color: #0f766e;
    font-size: 0.94rem;
}

.pm-statement-block--result h3 {
    background: #eef2ff;
    color: #3730a3;
}

.pm-statement-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.pm-statement-table th,
.pm-statement-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #eef2f7;
    vertical-align: middle;
}

.pm-statement-table tr:last-child th,
.pm-statement-table tr:last-child td {
    border-bottom: 0;
}

.pm-statement-table th {
    width: 58%;
    text-align: left;
    color: #334155;
    font-weight: 600;
}

.pm-statement-table td {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.pm-plan-actual {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
}

.pm-plan-actual-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.pm-plan-actual-head h3 {
    margin: 0;
}

.pm-plan-actual-head p {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
}

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

.pm-plan-actual-card {
    min-width: 0;
    padding: 12px;
    border: 1px solid #d8dee6;
    border-radius: 8px;
    background: #fbfdff;
}

.pm-plan-actual-card header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.pm-plan-diff {
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.pm-plan-diff--positive {
    color: #047857;
}

.pm-plan-diff--negative {
    color: #b91c1c;
}

.pm-plan-diff--neutral {
    color: var(--muted);
}

.pm-bar-pair {
    display: grid;
    gap: 8px;
}

.pm-bar-row {
    display: grid;
    grid-template-columns: 42px minmax(80px, 1fr) minmax(92px, auto);
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
}

.pm-bar-row span {
    color: var(--muted);
    font-weight: 700;
}

.pm-bar-row b {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.pm-bar-track {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5e7eb;
}

.pm-bar {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.pm-bar--planned {
    background: #94a3b8;
}

.pm-bar--actual {
    background: #0f766e;
}

.pm-finance-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.pm-finance-kpi-grid article {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.pm-finance-kpi-grid span,
.pm-finance-compare span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pm-finance-kpi-grid strong {
    display: block;
    margin-top: 6px;
    font-size: 1.16rem;
    font-variant-numeric: tabular-nums;
}

.pm-finance-kpi-grid small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.pm-finance-alert-danger {
    border-color: #fca5a5 !important;
    background: #fef2f2 !important;
    color: #991b1b;
}

.pm-finance-alert-ok {
    border-color: #86efac !important;
    background: #f0fdf4 !important;
    color: #166534;
}

.pm-finance-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.pm-finance-section-head h2 {
    margin-top: 0;
}

.pm-finance-compare {
    min-width: 260px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    text-align: right;
}

.pm-finance-compare strong {
    display: block;
    margin: 3px 0 8px;
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
}

.pm-finance-table {
    min-width: 900px;
}

.pm-finance-table th {
    text-align: left;
}

.pm-finance-table .pm-money,
.pm-finance-table th.pm-money {
    text-align: right;
}

.pm-finance-table tr.is-project-stock td {
    background: #ecfdf5;
}

.pm-finance-warehouse-search {
    display: grid;
    grid-template-columns: minmax(220px, 360px) auto;
    gap: 8px;
    align-items: end;
}

.pm-card,
.pm-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    padding: 18px;
}

.pm-card-label {
    display: block;
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.pm-card-value {
    font-size: 2rem;
}

.pm-card-value-sm {
    font-size: 1.2rem;
    text-transform: lowercase;
}

.pm-panel h2 {
    margin-top: 0;
    font-size: 1.1rem;
}

.pm-list {
    margin: 0;
    padding-left: 18px;
    line-height: 1.6;
}

.pm-hint {
    color: var(--muted);
    font-size: 0.92rem;
}

.pm-alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.pm-alert-error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #fecaca;
}

.pm-alert-success {
    background: var(--success-bg);
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.pm-alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.pm-peas-diagnostics h2 {
    margin-top: 0;
}

.pm-auth-body {
    display: grid;
    place-items: center;
    min-height: 100vh;
}

.pm-auth-card {
    width: min(100%, 420px);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 28px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.pm-interface-card {
    width: min(100%, 560px);
}

.pm-interface-lead {
    text-align: center;
    margin: 0 0 20px;
    color: var(--muted);
}

.pm-interface-options {
    display: grid;
    gap: 14px;
}

.pm-interface-option-form {
    margin: 0;
}

.pm-interface-option {
    display: grid;
    gap: 8px;
    width: 100%;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    text-align: left;
    cursor: pointer;
    font: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pm-interface-option:hover,
.pm-interface-option:focus-visible {
    border-color: var(--brand);
    box-shadow: 0 8px 24px rgba(15, 118, 110, 0.12);
    outline: none;
}

.pm-interface-option-foreman {
    background: #f0fdfa;
}

.pm-interface-option-icon {
    font-size: 1.5rem;
}

.pm-interface-option-desc {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.4;
}

.pm-form {
    display: grid;
    gap: 14px;
}

.pm-field {
    display: grid;
    gap: 6px;
}

.pm-field span {
    font-size: 0.92rem;
    color: var(--muted);
}

.pm-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
}

.pm-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    color: var(--muted);
}

.pm-btn {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    border-radius: 8px;
    padding: 10px 14px;
    font: inherit;
    cursor: pointer;
}

.pm-btn-primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.pm-btn-primary:hover {
    background: var(--brand-dark);
}

.pm-btn-ghost {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.25);
    color: #ecfdf5;
    width: 100%;
}

.pm-btn-block {
    width: 100%;
}

@media (max-width: 860px) {
    .pm-shell:not(.pm-shell--sidebar-collapsed) .pm-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 30;
        background: rgba(15, 23, 42, 0.45);
    }

    .pm-sidebar {
        position: fixed;
        z-index: 40;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(88vw, 290px);
        max-height: none;
        padding: 16px 14px 12px;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    }

    .pm-shell--sidebar-collapsed .pm-sidebar {
        transform: translateX(-105%);
        width: min(88vw, 290px);
        opacity: 1;
        pointer-events: none;
    }

    .pm-shell:not(.pm-shell--sidebar-collapsed) .pm-sidebar {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    .pm-sidebar-nav {
        max-height: calc(100vh - 220px);
        margin-bottom: 10px;
    }

    .pm-main {
        padding: 20px 16px;
    }

    .pm-dashboard-module-actions {
        max-width: none;
        grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    }

    .pm-project-chrome {
        top: 0;
    }

    .pm-project-statement-head,
    .pm-statement-table-grid,
    .pm-plan-actual-head,
    .pm-plan-actual-grid,
    .pm-finance-kpi-grid,
    .pm-finance-warehouse-search {
        grid-template-columns: 1fr;
    }

    .pm-project-statement-head,
    .pm-plan-actual-head,
    .pm-finance-section-head {
        display: grid;
    }

    .pm-finance-compare {
        min-width: 0;
        text-align: left;
    }

    .pm-health-pill {
        min-width: 0;
        text-align: left;
    }

    .pm-statement-kpi-grid {
        grid-template-columns: 1fr;
    }
}

.pm-foreman-body {
    background: #0f172a;
}

.pm-foreman-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.pm-foreman-header {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px 20px;
    background: #111827;
    color: #f8fafc;
}

.pm-foreman-brand {
    font-weight: 700;
    color: #ecfdf5;
    text-decoration: none;
}

.pm-foreman-main {
    padding: 20px;
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
}

.pm-foreman-page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    color: #f8fafc;
}

.pm-foreman-cards,
.pm-foreman-progress-cards {
    display: grid;
    gap: 16px;
}

.pm-foreman-card,
.pm-foreman-progress-card {
    display: block;
    padding: 0;
    border-radius: 16px;
    background: #1e293b;
    color: #f8fafc;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.pm-foreman-progress-card[hidden] {
    display: none;
}

.pm-foreman-card-summary {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 10px 12px;
    padding: 16px 20px;
    list-style: none;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.pm-foreman-card-summary::-webkit-details-marker {
    display: none;
}

.pm-foreman-progress-card[open] > .pm-foreman-card-summary {
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.pm-foreman-card-toggle {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 10px 12px;
    width: 100%;
    padding: 16px 20px;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.pm-foreman-card-toggle:focus-visible {
    outline: 2px solid #14b8a6;
    outline-offset: -2px;
}

.pm-foreman-progress-card.is-expanded .pm-foreman-card-toggle {
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.pm-foreman-card-title {
    font-weight: 700;
    line-height: 1.35;
}

.pm-foreman-card-remaining {
    font-size: 0.85rem;
    color: #cbd5e1;
    white-space: nowrap;
}

.pm-foreman-card-chevron {
    width: 10px;
    height: 10px;
    border-right: 2px solid #94a3b8;
    border-bottom: 2px solid #94a3b8;
    transform: rotate(45deg);
    transition: transform 0.15s ease;
}

.pm-foreman-progress-card.is-expanded .pm-foreman-card-chevron,
.pm-foreman-progress-card[open] .pm-foreman-card-chevron {
    transform: rotate(-135deg);
}

.pm-foreman-card-body {
    padding: 0 20px 20px;
}

.pm-foreman-toolbar {
    position: sticky;
    top: 0;
    z-index: 5;
    margin: 0 0 16px;
    padding: 12px 0 8px;
    background: linear-gradient(#0f172a 75%, rgba(15, 23, 42, 0));
    pointer-events: none;
}

.pm-foreman-toolbar * {
    pointer-events: auto;
}

.pm-foreman-search-sticky {
    display: grid;
    gap: 10px;
}

.pm-foreman-search-input {
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    font-size: 1.05rem;
    background: #1e293b;
    color: #f8fafc;
}

.pm-foreman-search-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    color: #cbd5e1;
    font-size: 0.9rem;
}

.pm-foreman-filter-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.pm-foreman-no-results {
    color: #cbd5e1;
    text-align: center;
    padding: 24px 12px;
}

@media (max-width: 640px) {
    .pm-foreman-card-summary,
    .pm-foreman-card-toggle {
        grid-template-columns: auto 1fr auto;
        grid-template-areas:
            "line title chevron"
            "remaining remaining remaining";
    }

    .pm-foreman-line-no {
        grid-area: line;
    }

    .pm-foreman-card-title {
        grid-area: title;
    }

    .pm-foreman-card-remaining {
        grid-area: remaining;
        white-space: normal;
    }

    .pm-foreman-card-chevron {
        grid-area: chevron;
    }
}

.pm-foreman-progress-card header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.pm-foreman-progress-card header strong {
    line-height: 1.35;
}

.pm-foreman-line-no {
    align-self: flex-start;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(20, 184, 166, 0.16);
    color: #99f6e4;
    font-size: 0.78rem;
    font-weight: 700;
}

.pm-foreman-unit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.pm-foreman-unit-grid div {
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.35);
}

.pm-foreman-unit-grid dt {
    margin-bottom: 4px;
    color: #cbd5e1;
    font-size: 0.78rem;
}

.pm-foreman-unit-grid dd {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.pm-foreman-entry-form .pm-field input {
    min-height: 48px;
    font-size: 1.1rem;
}

.pm-foreman-save-btn {
    width: 100%;
    min-height: 56px;
    font-size: 1.125rem;
}

.pm-foreman-search {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.pm-foreman-search input {
    flex: 1;
    min-height: 48px;
    font-size: 1.05rem;
}

.pm-foreman-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 20px;
}

@media (min-width: 640px) {
    .pm-foreman-tabs {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.pm-foreman-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #fff;
    color: #0f172a;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
}

.pm-foreman-tab.is-active {
    background: #0f172a;
    color: #fff;
    border-color: #0f172a;
}

.pm-foreman-today-panel,
.pm-foreman-closed-panel {
    margin-bottom: 20px;
}

.pm-foreman-today-panel {
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
}

.pm-foreman-today-panel summary {
    cursor: pointer;
    font-weight: 600;
}

.pm-foreman-today-list {
    margin-top: 12px;
}

.pm-foreman-today-entry,
.pm-foreman-procurement-item {
    padding: 12px 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.pm-foreman-today-entry:last-child,
.pm-foreman-procurement-item:last-child {
    border-bottom: 0;
}

.pm-foreman-entry-time {
    float: right;
    color: #64748b;
    font-size: 0.9rem;
}

.pm-foreman-enaplo-list {
    margin: 0;
    padding-left: 1.2rem;
}

.pm-foreman-close-form textarea,
.pm-foreman-procurement-form textarea {
    min-height: 120px;
    font-size: 1.05rem;
}

.pm-foreman-close-form input[type="file"],
.pm-foreman-entry-form input,
.pm-foreman-procurement-form input {
    min-height: 48px;
    font-size: 1.05rem;
}

.pm-page-head-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pm-documents-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.pm-permission-group {
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.pm-checkbox {
    display: block;
    margin-bottom: 6px;
}

.pm-doc-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

.pm-doc-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 13px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: #f2f5f8;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 650;
    line-height: 1.15;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.pm-doc-tab:hover {
    border-color: rgba(15, 118, 110, 0.28);
    background: #e7f4f1;
    color: var(--brand-dark);
}

.pm-doc-tab.is-active {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.pm-dropzone.is-dragover { outline: 2px dashed #0f6f5c; background: #e7f3f0; }
.pm-dropzone-field input[type=file] { width: 100%; min-height: 80px; }

.pm-document-preview-frame { padding: 0; overflow: hidden; }
.pm-document-preview-iframe { width: 100%; min-height: 80vh; border: 0; background: #fff; }

.pm-partner-search {
    position: relative;
}

.pm-partner-search.is-searching .pm-partner-search-input {
    background-image: linear-gradient(90deg, rgba(15, 111, 92, 0.08), rgba(15, 111, 92, 0.02));
}

.pm-partner-search-selected {
    margin: 8px 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(15, 111, 92, 0.08);
    border: 1px solid rgba(15, 111, 92, 0.2);
    font-weight: 600;
}

.pm-partner-search-input {
    width: 100%;
}

.pm-partner-search-results {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.pm-partner-search-option {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    cursor: pointer;
}

.pm-partner-search-option-title {
    font-weight: 600;
    color: #0f172a;
    line-height: 1.3;
}

.pm-partner-search-option-meta {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.25;
}

.pm-partner-search-option:hover,
.pm-partner-search-option:focus {
    background: rgba(15, 111, 92, 0.08);
    outline: none;
}

.pm-partner-search-clear {
    margin-top: 8px;
}

.pm-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px 16px;
    align-items: start;
}

.pm-panel-nested {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fafbfc;
}

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

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

.pm-field-checkbox input[type="checkbox"] {
    width: auto;
    justify-self: start;
}

.pm-field select,
.pm-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
}

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

.pm-input-group {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.pm-input-group input {
    flex: 1;
}

.pm-b2b-only[hidden] {
    display: none !important;
}

.pm-alert-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #fecaca;
}

.pm-repeater {
    margin-top: 16px;
    display: grid;
    gap: 12px;
}

.pm-repeater-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.pm-repeater-head h3 {
    margin: 0;
    font-size: 1rem;
}

.pm-repeater-row {
    position: relative;
    padding: 12px 44px 12px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.pm-repeater-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    min-width: 32px;
    padding: 4px 8px;
}

.pm-readonly-panel p {
    margin: 0;
}

.pm-badge-b2b {
    background: #dbeafe;
    color: #1d4ed8;
}

.pm-badge-b2c {
    background: #fce7f3;
    color: #be185d;
}

.pm-badge-flag {
    background: #ecfdf5;
    color: #047857;
}

.pm-badge-fad {
    background: #fff7ed;
    color: #c2410c;
}

.pm-page-head h1 .pm-badge {
    vertical-align: middle;
    margin-left: 8px;
}

/* EDI brand theme: hivatalos EDI arculati tokenek. */
:root {
    --bg: #f2f3f4;
    --panel: #ffffff;
    --panel-solid: #ffffff;
    --line: #d9e2e0;
    --line-strong: #bfd0cc;
    --text: #3c3c3b;
    --muted: #7a8585;
    --brand: #1baca0;
    --brand-dark: #075e56;
    --brand-soft: #e5f5f2;
    --brand-cyan: #1baca0;
    --edi-red: #8b0101;
    --edi-red-soft: #fff0ed;
    --danger: #8b0101;
    --danger-bg: rgba(139, 1, 1, 0.08);
    --success-bg: #f0fdf4;
    --warning-bg: #fffbeb;
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 18px 52px rgba(20, 31, 29, 0.11);
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 10px;
    --content-max: 1560px;
}

body.pm-body {
    color: var(--text);
    background: var(--bg);
    font-family: "Montserrat", "Segoe UI", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.pm-body::before {
    content: "";
    position: fixed;
    inset: 0 0 auto;
    z-index: -1;
    height: 4px;
    background: linear-gradient(90deg, var(--brand) 0 52%, var(--edi-red) 52% 86%, var(--brand-cyan) 86% 100%);
}

code {
    background: #eef4f3;
    color: #17312d;
    border: 1px solid #d8e7e4;
    border-radius: 7px;
}

.pm-sidebar {
    width: 224px;
    padding: 18px 14px 16px;
    background: #075E56;
    color: #f4fffc;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 18px 0 44px rgba(20, 31, 29, 0.12);
}

.pm-brand {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 58px;
    margin-bottom: 18px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.075);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.pm-brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: contain;
    background: #ffffff;
    box-shadow: 0 0 0 1px rgba(7, 166, 170, 0.38), 0 10px 22px rgba(0, 0, 0, 0.16);
}

.pm-brand-copy {
    min-width: 0;
}

.pm-brand strong {
    display: block;
    color: #ffffff;
    font-size: 1.02rem;
    line-height: 1.1;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.pm-brand span,
.pm-brand-center span {
    display: block;
    margin-top: 4px;
    color: rgba(244, 255, 252, 0.68);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.pm-brand-center {
    grid-template-columns: 62px minmax(0, auto);
    justify-content: center;
    text-align: left;
    max-width: 360px;
    margin: 0 auto 24px;
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(12, 107, 95, 0.16);
}

.pm-brand-center .pm-brand-logo {
    width: 58px;
    height: 58px;
}

.pm-brand-center strong {
    color: var(--text);
    font-size: 1.24rem;
}

.pm-brand-center span {
    color: var(--muted);
}

.pm-nav-section + .pm-nav-section {
    border-top-color: rgba(255, 255, 255, 0.11);
}

.pm-nav-section-title {
    color: rgba(244, 255, 252, 0.48);
    font-size: 0.66rem;
    letter-spacing: 0.11em;
}

.pm-sidebar-project-select,
.pm-nav-link {
    border-radius: 6px;
}

.pm-sidebar-project-select {
    min-height: 38px;
    background-color: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.16);
}

.pm-nav-link {
    position: relative;
    padding: 9px 10px 9px 12px;
    color: rgba(255, 255, 255, 0.6);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.pm-nav-link:not(.is-disabled):hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.pm-nav-link.is-active {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    box-shadow: none;
}

.pm-sidebar-foot {
    border-top-color: rgba(255, 255, 255, 0.12);
}

.pm-user strong {
    color: #ffffff;
}

.pm-user span {
    color: rgba(244, 255, 252, 0.62);
}

.pm-main {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 28px clamp(18px, 2.4vw, 36px);
}

.pm-main-topbar {
    position: sticky;
    top: 0;
    z-index: 8;
    min-height: 56px;
    margin: -8px 0 18px;
    padding: 10px 0 8px;
    background: linear-gradient(180deg, rgba(243, 246, 246, 0.96), rgba(243, 246, 246, 0));
    backdrop-filter: blur(14px);
}

.pm-sidebar-toggle,
.pm-btn,
.pm-module-action,
.pm-doc-tab,
.pm-tab-nav a,
.pm-sheet-tab,
.pm-foreman-tab {
    border-radius: 6px;
    font-weight: 600;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.pm-sidebar-toggle,
.pm-btn,
.pm-module-action {
    border: 1px solid var(--line);
    background: #ffffff;
    padding: 8px 16px;
    box-shadow: none;
}

.pm-sidebar-toggle:hover,
.pm-btn:hover,
.pm-module-action:hover {
    border-color: var(--brand);
    background: #ffffff;
    color: var(--brand);
    box-shadow: none;
}

.pm-btn-primary,
.pm-module-action-primary {
    border: none;
    background: var(--brand);
    color: #ffffff;
    box-shadow: none;
}

.pm-btn-primary:hover,
.pm-module-action-primary:hover {
    border: none;
    background: var(--brand-dark);
    color: #ffffff;
}

.pm-btn-ghost {
    background: rgba(255, 255, 255, 0.075);
    border-color: rgba(255, 255, 255, 0.16);
    color: #f4fffc;
    box-shadow: none;
}

.pm-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    box-shadow: none;
}

.pm-page-head {
    align-items: center;
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(191, 208, 204, 0.72);
}

.pm-page-head h1 {
    font-size: clamp(1.55rem, 2.2vw, 2.05rem);
    line-height: 1.08;
    letter-spacing: 0;
}

.pm-page-head p {
    max-width: 820px;
    color: var(--muted);
    line-height: 1.45;
}

.pm-card,
.pm-panel,
.pm-project-statement,
.pm-statement-block,
.pm-plan-actual-card,
.pm-finance-kpi-grid article,
.pm-finance-compare,
.pm-budget-version-panel,
.pm-budget-data-panel,
.pm-sheet-panel,
.pm-mapping-sidebar,
.pm-import-preview-panel,
.pm-progress-panel,
.pm-interface-option,
.pm-auth-card,
.pm-repeater-row,
.pm-panel-nested {
    border-color: rgba(191, 208, 204, 0.82);
    border-radius: var(--radius-lg);
    background: var(--panel);
    box-shadow: var(--shadow-sm);
}

.pm-card,
.pm-panel {
    padding: 18px;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.pm-card {
    position: relative;
    overflow: hidden;
}

.pm-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, var(--brand), var(--brand-cyan));
    opacity: 0.72;
}

.pm-card-label,
.pm-statement-kpi-grid span,
.pm-finance-kpi-grid span,
.pm-finance-compare span,
.pm-health-pill span {
    color: #7a8585;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 700;
}

.pm-card-value,
.pm-finance-kpi-grid strong,
.pm-statement-kpi-grid strong {
    color: var(--text);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
}

.pm-card-value {
    font-size: 28px;
    font-weight: 700;
}

.pm-card-value-sm {
    font-size: 16px;
    font-weight: 700;
    text-transform: none;
}

.pm-panel h2,
.pm-project-statement-head h2,
.pm-plan-actual-head h3,
.pm-sheet-head h2,
.pm-mapping-section h2,
.pm-repeater-head h3 {
    color: var(--text);
    letter-spacing: 0;
}

.pm-preview-wrap,
.pm-budget-table-wrap,
.pm-budget-table-shell,
.pm-progress-table-wrap,
.pm-mapping-preview-wrap,
.pm-import-preview-wrap {
    border-color: var(--line);
    border-radius: var(--radius-md);
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.pm-preview-table,
.pm-budget-table,
.pm-progress-table,
.pm-statement-table,
.pm-finance-table,
.pm-progress-change-table {
    color: var(--text);
}

.pm-preview-table th,
.pm-budget-table thead th,
.pm-progress-table th,
.pm-statement-table th,
.pm-finance-table th {
    background: #f9fafb;
    color: #7a8585;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.pm-preview-table td,
.pm-preview-table th,
.pm-budget-table th,
.pm-budget-table td,
.pm-progress-table th,
.pm-progress-table td,
.pm-statement-table th,
.pm-statement-table td {
    border-color: #e6eeec;
}

.pm-dashboard-module-actions {
    max-width: 720px;
}

.pm-tab-nav,
.pm-sheet-tabs,
.pm-doc-tabs,
.pm-foreman-tabs {
    gap: 8px;
}

.pm-tab-nav a,
.pm-sheet-tab,
.pm-doc-tab {
    background: rgba(255, 255, 255, 0.7);
    border-color: var(--line);
    color: #31413e;
}

.pm-tab-nav a:hover,
.pm-sheet-tab:hover,
.pm-doc-tab:hover {
    background: #ffffff;
    border-color: rgba(12, 107, 95, 0.34);
}

.pm-tab-nav a.is-active,
.pm-sheet-tab.is-active,
.pm-doc-tab.is-active {
    background: linear-gradient(135deg, var(--brand-soft), #ffffff);
    border-color: rgba(12, 107, 95, 0.42);
    color: var(--brand-dark);
    box-shadow: inset 0 -2px 0 var(--brand);
}

.pm-project-chrome {
    background: linear-gradient(180deg, rgba(243, 246, 246, 0.98) 72%, rgba(243, 246, 246, 0));
    backdrop-filter: blur(14px);
}

.pm-project-statement {
    padding: 20px;
    border-color: rgba(12, 107, 95, 0.18);
    background:
        linear-gradient(135deg, rgba(229, 245, 242, 0.7), rgba(255, 255, 255, 0.86) 32%),
        #ffffff;
}

.pm-health-pill {
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.pm-health-pill--good,
.pm-finance-alert-ok {
    border-color: rgba(27, 172, 160, 0.25) !important;
    background: rgba(27, 172, 160, 0.1) !important;
    color: #075E56;
}

.pm-health-pill--acceptable {
    border-color: rgba(180, 83, 9, 0.2);
    background: #fffbeb;
    color: #b45309;
}

.pm-health-pill--bad,
.pm-health-pill--critical,
.pm-finance-alert-danger {
    border-color: rgba(139, 1, 1, 0.2) !important;
    background: rgba(139, 1, 1, 0.08) !important;
    color: #8B0101;
}

.pm-statement-kpi-grid article {
    border-color: rgba(191, 208, 204, 0.82);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.74);
}

.pm-statement-block h3 {
    background: linear-gradient(90deg, var(--brand-soft), #ffffff);
    color: var(--brand-dark);
    border-bottom-color: var(--line);
}

.pm-statement-block--result h3 {
    background: linear-gradient(90deg, var(--edi-red-soft), #ffffff);
    color: var(--edi-red);
}

.pm-bar-track {
    background: #e7eeec;
}

.pm-bar--planned {
    background: #879693;
}

.pm-bar--actual {
    background: linear-gradient(90deg, var(--brand), var(--brand-cyan));
}

.pm-plan-diff--positive {
    color: var(--brand);
}

.pm-plan-diff--negative {
    color: var(--edi-red);
}

.pm-field input,
.pm-field select,
.pm-field textarea,
.pm-field input[type="file"],
.pm-select,
.pm-progress-input,
.pm-foreman-search-input,
.pm-foreman-close-form textarea,
.pm-foreman-procurement-form textarea,
.pm-foreman-close-form input[type="file"],
.pm-foreman-entry-form input,
.pm-foreman-procurement-form input,
.pm-partner-search-input {
    border-color: var(--line);
    border-radius: 10px;
    background: #ffffff;
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(20, 31, 29, 0.025);
}

.pm-field input:focus,
.pm-field select:focus,
.pm-field textarea:focus,
.pm-select:focus,
.pm-progress-input:focus,
.pm-foreman-search-input:focus,
.pm-partner-search-input:focus {
    outline: 2px solid rgba(7, 166, 170, 0.18);
    border-color: var(--brand-cyan);
}

.pm-field span,
.pm-check,
.pm-hint,
.pm-interface-option-desc {
    color: var(--muted);
}

.pm-alert {
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}

.pm-alert-success {
    background: var(--success-bg);
    color: var(--brand-dark);
    border-color: rgba(12, 107, 95, 0.2);
}

.pm-alert-warning {
    background: var(--warning-bg);
    color: #8a5b08;
    border-color: #f2d58a;
}

.pm-alert-error,
.pm-alert-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(151, 15, 3, 0.22);
}

.pm-badge,
.pm-badge-b2b,
.pm-badge-b2c,
.pm-badge-flag,
.pm-badge-fad {
    border-radius: 999px;
    font-weight: 800;
}

.pm-badge-b2b {
    background: #e3f3ff;
    color: #075985;
}

.pm-badge-b2c {
    background: var(--edi-red-soft);
    color: var(--edi-red);
}

.pm-badge-flag {
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.pm-badge-fad {
    background: #fff7e5;
    color: #9a6a14;
}

.pm-auth-body {
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(12, 107, 95, 0.12), rgba(255, 255, 255, 0) 42%),
        linear-gradient(315deg, rgba(151, 15, 3, 0.08), rgba(255, 255, 255, 0) 46%),
        #f3f6f6;
}

.pm-auth-card {
    width: min(100%, 440px);
    padding: 30px;
    border-color: rgba(191, 208, 204, 0.86);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-md);
}

.pm-interface-card {
    width: min(100%, 620px);
}

.pm-interface-option {
    grid-template-columns: auto 1fr;
    align-items: center;
    background: rgba(255, 255, 255, 0.78);
}

.pm-interface-option strong,
.pm-interface-option-desc {
    grid-column: 2;
}

.pm-interface-option-icon {
    grid-row: 1 / span 2;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0)),
        var(--brand-soft);
    box-shadow: inset 0 0 0 1px rgba(12, 107, 95, 0.16);
}

.pm-interface-option-icon::before,
.pm-interface-option-icon::after {
    content: "";
    display: block;
}

.pm-interface-option-icon-office::before {
    width: 22px;
    height: 18px;
    border-radius: 4px;
    background:
        linear-gradient(90deg, transparent 6px, rgba(255, 255, 255, 0.85) 6px 8px, transparent 8px 14px, rgba(255, 255, 255, 0.85) 14px 16px, transparent 16px),
        linear-gradient(180deg, var(--brand) 0 42%, var(--brand-cyan) 42%);
    box-shadow: 0 6px 0 -2px rgba(151, 15, 3, 0.82);
}

.pm-interface-option-icon-foreman::before {
    width: 18px;
    height: 24px;
    border-radius: 5px;
    border: 2px solid var(--brand);
    background: linear-gradient(180deg, #ffffff 0 68%, var(--brand-soft) 68%);
}

.pm-interface-option-icon-foreman::after {
    width: 5px;
    height: 5px;
    margin-top: -8px;
    border-radius: 50%;
    background: var(--edi-red);
}

.pm-interface-option:hover,
.pm-interface-option:focus-visible {
    border-color: rgba(12, 107, 95, 0.38);
    box-shadow: var(--shadow-md);
}

.pm-interface-option-foreman {
    background: linear-gradient(135deg, #ffffff, #eaf7f5);
}

.pm-foreman-body {
    background:
        linear-gradient(145deg, #062b29, #111827 54%, #250906),
        #111827;
}

.pm-foreman-header {
    background: rgba(9, 25, 25, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(16px);
}

.pm-foreman-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
}

.pm-foreman-logo {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: contain;
    background: #ffffff;
}

.pm-foreman-card,
.pm-foreman-progress-card {
    background: rgba(23, 35, 42, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
}

.pm-foreman-line-no {
    background: rgba(7, 166, 170, 0.16);
    color: #9df5f2;
}

.pm-foreman-tab.is-active {
    background: linear-gradient(135deg, var(--brand), var(--brand-cyan));
    border-color: transparent;
}

@media (max-width: 860px) {
    .pm-main {
        padding: 20px 16px;
    }

    .pm-brand {
        min-height: 54px;
    }

    .pm-sidebar {
        width: min(88vw, 304px);
    }

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

/* Full-page budget workspace. */
body:has(.pm-budget-workspace) {
    overflow: hidden;
}

.pm-main:has(.pm-budget-workspace) {
    width: 100%;
    max-width: none;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.pm-main:has(.pm-budget-workspace) .pm-main-topbar {
    display: none;
}

.pm-budget-workspace {
    height: 100vh;
    gap: 4px;
    padding: 0;
    overflow: hidden;
}

.pm-budget-workspace .pm-page-head {
    margin: 0;
    padding: 14px 22px 12px;
    border-bottom: 1px solid rgba(191, 208, 204, 0.82);
    background: rgba(255, 255, 255, 0.54);
    backdrop-filter: blur(16px);
}

.pm-budget-workspace .pm-project-chrome {
    position: static;
    margin: 0;
    padding: 0;
    background: transparent;
}

.pm-budget-workspace .pm-breadcrumbs {
    margin: 0;
    padding: 8px 22px 6px;
}

.pm-budget-workspace .pm-project-tabs,
.pm-budget-workspace > .pm-tab-nav,
.pm-budget-workspace .pm-budget-version-panel {
    margin-left: 0;
    margin-right: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
}

.pm-budget-workspace .pm-project-tabs {
    margin-bottom: 0;
    padding: 8px 14px;
    overflow-x: auto;
    flex-wrap: nowrap;
}

.pm-budget-workspace .pm-project-tabs .pm-doc-tab,
.pm-budget-workspace > .pm-tab-nav a {
    flex: 0 0 auto;
}

.pm-budget-workspace > .pm-tab-nav {
    padding: 8px 14px;
    overflow-x: auto;
    flex-wrap: nowrap;
}

.pm-budget-version-panel {
    padding: 10px 22px;
}

.pm-budget-version-panel .pm-form {
    gap: 6px;
}

.pm-budget-data-panel {
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    border-radius: 0;
    box-shadow: none;
}

.pm-budget-table-shell .pm-budget-table-wrap {
    border-top: 1px solid var(--line);
}

.pm-budget-workspace .pm-page-head {
    min-height: auto;
    padding: 6px 16px;
}

.pm-budget-workspace .pm-page-head h1 {
    font-size: 1.28rem;
}

.pm-budget-workspace .pm-page-head p {
    margin-top: 1px;
    font-size: 0.78rem;
}

.pm-budget-workspace .pm-page-head .pm-btn {
    min-height: 30px;
    padding: 5px 10px;
    font-size: 0.82rem;
}

.pm-budget-workspace .pm-breadcrumbs {
    display: none;
}

.pm-budget-workspace .pm-project-tabs,
.pm-budget-workspace > .pm-tab-nav {
    padding: 4px 10px;
}

.pm-budget-workspace .pm-project-tabs .pm-doc-tab,
.pm-budget-workspace > .pm-tab-nav a {
    min-height: 28px;
    padding: 4px 9px;
    font-size: 0.8rem;
}

.pm-budget-control-strip {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: minmax(420px, 0.9fr) minmax(360px, 1.1fr);
    align-items: stretch;
    gap: 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: #ffffff;
}

.pm-budget-version-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 14px;
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
}

.pm-budget-version-panel .pm-field {
    display: grid;
    grid-template-columns: auto minmax(220px, 1fr);
    align-items: center;
    gap: 3px;
}

.pm-budget-version-panel .pm-field span {
    font-size: 0.72rem;
}

.pm-budget-version-panel .pm-field select {
    min-height: 32px;
    padding: 5px 10px;
}

.pm-budget-version-panel .pm-hint {
    margin: 0;
    font-size: 0.78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pm-budget-sections-compact {
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    box-shadow: none;
}

.pm-budget-sections-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 42px;
    padding: 6px 14px;
    cursor: pointer;
    list-style: none;
}

.pm-budget-sections-summary::-webkit-details-marker {
    display: none;
}

.pm-budget-sections-summary strong {
    display: block;
    font-size: 0.9rem;
    color: var(--text);
}

.pm-budget-sections-summary span {
    color: var(--muted);
    font-size: 0.78rem;
}

.pm-budget-sections-toggle {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 5px 10px;
    background: #ffffff;
    color: var(--brand-dark) !important;
    font-weight: 760;
}

.pm-budget-sections-body {
    position: absolute;
    right: 14px;
    top: 218px;
    z-index: 20;
    width: min(980px, calc(100vw - 28px));
    display: grid;
    gap: 10px;
    max-height: 48vh;
    overflow: auto;
    padding: 10px 14px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: var(--shadow-md);
}

.pm-budget-sections-body .pm-preview-wrap {
    max-height: 150px;
}

.pm-budget-sections-body .pm-section-actions {
    margin: 0;
}

.pm-budget-sections-body .pm-form-grid {
    gap: 8px;
}

.pm-budget-sections-body .pm-field input,
.pm-budget-sections-body .pm-field select {
    min-height: 34px;
    padding: 6px 10px;
}

.pm-budget-data-panel {
    flex: 1 1 auto;
    min-height: 0;
}

.pm-budget-table {
    min-width: 1320px;
    table-layout: fixed;
    font-size: 0.77rem;
}

.pm-budget-table th,
.pm-budget-table td {
    height: 34px;
    padding: 4px 6px;
    line-height: 1.16;
    white-space: nowrap;
    max-width: none;
}

.pm-budget-table .pm-budget-col-line {
    position: sticky;
    left: 0;
    width: 52px;
    min-width: 52px;
    max-width: 52px;
    z-index: 4;
    background: #ffffff;
}

.pm-budget-table thead .pm-budget-col-line {
    z-index: 7;
    background: #edf1f6;
}

.pm-budget-table .pm-budget-col-item,
.pm-budget-table .pm-budget-item-cell {
    position: sticky;
    left: 52px;
    width: 420px;
    min-width: 420px;
    max-width: 420px;
    z-index: 4;
    background: #ffffff;
    box-shadow: 1px 0 0 var(--line);
}

.pm-budget-table thead .pm-budget-col-item {
    z-index: 7;
    background: #edf1f6;
}

.pm-budget-table .pm-budget-col-qty {
    width: 78px;
    min-width: 78px;
    max-width: 78px;
}

.pm-budget-table .pm-budget-col-unit {
    width: 58px;
    min-width: 58px;
    max-width: 58px;
}

.pm-budget-table .pm-budget-col-money {
    width: 132px;
    min-width: 132px;
    max-width: 132px;
}

.pm-budget-table .pm-budget-col-total {
    width: 144px;
    min-width: 144px;
    max-width: 144px;
}

.pm-budget-table .pm-budget-item-cell {
    white-space: normal;
    vertical-align: top;
}

.pm-budget-item-text {
    display: -webkit-box;
    overflow: hidden;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    word-break: break-word;
}

@media (max-width: 860px) {
    .pm-main:has(.pm-budget-workspace) {
        padding: 0;
    }

    .pm-budget-workspace .pm-page-head {
        padding: 12px 14px 10px;
    }

    .pm-budget-workspace .pm-breadcrumbs {
        padding-left: 14px;
        padding-right: 14px;
    }
}

/* Dense PM progress table workspace. */
body:has(.pm-progress-workspace) {
    overflow: hidden;
}

.pm-main:has(.pm-progress-workspace) {
    width: 100%;
    max-width: none;
    height: 100vh;
    margin: 0;
    padding: 6px 12px 0;
    overflow: hidden;
}

.pm-main:has(.pm-progress-workspace) .pm-main-topbar {
    display: none;
}

.pm-progress-workspace {
    display: flex;
    flex-direction: column;
    gap: 4px;
    height: calc(100vh - 4px);
    overflow: hidden;
}

.pm-progress-workspace .pm-project-chrome {
    margin: 0;
    padding: 0;
    background: transparent;
}

.pm-progress-workspace .pm-breadcrumbs {
    display: none;
}

.pm-progress-workspace .pm-project-tabs {
    margin: 0;
    padding: 5px 8px;
    overflow-x: auto;
    flex-wrap: nowrap;
}

.pm-progress-workspace .pm-project-tabs .pm-doc-tab {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 4px 10px;
    font-size: 0.8rem;
}

.pm-progress-topbar {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(260px, 420px) auto;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    max-height: 72px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
}

.pm-progress-topbar__lead {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.pm-progress-topbar__title {
    font-size: 1rem;
    line-height: 1.1;
}

.pm-progress-topbar__meta {
    color: var(--muted);
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pm-progress-topbar__switcher {
    min-width: 0;
}

.pm-progress-topbar__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: nowrap;
}

.pm-progress-alerts {
    display: grid;
    gap: 4px;
}

.pm-progress-alerts .pm-alert {
    margin: 0;
    padding: 6px 10px;
    font-size: 0.82rem;
}

.pm-progress-tig-bar {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
}

.pm-progress-tig-bar__summary {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 12px;
    cursor: pointer;
    list-style: none;
    font-size: 0.8rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pm-progress-tig-bar__summary::-webkit-details-marker {
    display: none;
}

.pm-progress-tig-bar__summary strong {
    color: var(--text);
    font-weight: 760;
}

.pm-progress-tig-bar__detail {
    padding: 0 10px 8px;
}

.pm-progress-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    padding: 6px 8px 8px;
}

.pm-progress-toolbar {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.pm-progress-toolbar__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-wrap: wrap;
}

.pm-progress-view-field,
.pm-progress-filter-field {
    display: grid;
    gap: 2px;
    margin: 0;
}

.pm-progress-view-field span,
.pm-progress-filter-field span {
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 720;
}

.pm-progress-view-field select,
.pm-progress-filter-field input {
    min-height: 32px;
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 0.82rem;
    background: #fff;
}

.pm-progress-view-form {
    width: auto;
    flex: 0 0 220px;
}

.pm-progress-filter-field {
    flex: 0 1 220px;
}

.pm-progress-view-hint {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.2;
}

.pm-progress-corrections-bar {
    margin-bottom: 6px;
    border: 1px solid #fde68a;
    border-radius: 8px;
    background: #fffbeb;
}

.pm-progress-corrections-bar summary {
    cursor: pointer;
    padding: 6px 10px;
    font-size: 0.8rem;
    font-weight: 720;
}

.pm-progress-corrections-wrap {
    max-height: 160px;
}

.pm-progress-daily-drawer {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
}

.pm-progress-daily-drawer summary {
    min-height: 36px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 720;
    list-style: none;
}

.pm-progress-daily-drawer summary::-webkit-details-marker {
    display: none;
}

.pm-progress-daily-drawer__body {
    padding: 0 10px 8px;
    max-height: 220px;
    overflow: auto;
}

.pm-progress-daily-table th,
.pm-progress-daily-table td {
    height: 32px;
    padding: 3px 7px;
    font-size: 0.8rem;
}

.pm-progress-page-head {
    align-items: center;
    margin: 0;
    padding-bottom: 6px;
}

.pm-progress-page-head h1 {
    font-size: 1.6rem;
}

.pm-progress-page-head p {
    font-size: 0.86rem;
}

.pm-progress-top-actions,
.pm-tig-inline-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.pm-progress-top-actions {
    justify-content: flex-end;
}

.pm-project-switcher {
    display: grid;
    gap: 3px;
    min-width: min(420px, 100%);
}

.pm-project-switcher span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 720;
}

.pm-project-switcher select {
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 6px 10px;
    background: #ffffff;
    color: var(--text);
    font-weight: 680;
}

.pm-btn-disabled,
.pm-btn:disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

.pm-tig-inline-list {
    padding: 10px 12px;
}

.pm-tig-inline-head h2 {
    margin: 0 0 3px;
    font-size: 1rem;
}

.pm-tig-inline-head .pm-hint {
    margin: 0;
    font-size: 0.8rem;
}

.pm-tig-list {
    display: grid;
    gap: 4px;
    margin-top: 8px;
}

.pm-tig-list-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 130px 110px 80px minmax(120px, auto);
    align-items: center;
    gap: 10px;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    text-decoration: none;
    font-size: 0.82rem;
}

.pm-tig-list-row:hover {
    border-color: rgba(12, 107, 95, 0.32);
    background: var(--brand-soft);
}

.pm-progress-panel {
    margin-top: 0;
    padding: 0;
    min-height: 0;
    overflow: hidden;
}

.pm-progress-main .pm-progress-table-wrap {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.pm-progress-table-wrap {
    max-height: calc(100vh - 325px);
}

.pm-progress-table {
    min-width: 1640px;
    table-layout: fixed;
}

.pm-progress-table--contract_budget {
    min-width: 1260px;
}

.pm-progress-table--pm_full {
    min-width: 3220px;
}

.pm-progress-table thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: #e8edf3;
}

.pm-progress-table thead .pm-progress-sticky {
    z-index: 6;
}

.pm-progress-table th,
.pm-progress-table td {
    height: 38px;
    padding: 4px 7px;
    line-height: 1.15;
    max-width: none;
    white-space: nowrap;
    font-size: 0.8rem;
}

.pm-progress-table .pm-progress-sticky-no {
    width: 44px;
    min-width: 44px;
    max-width: 44px;
}

.pm-progress-table .pm-progress-sticky-item {
    left: 44px;
    width: 320px;
    min-width: 320px;
    max-width: 320px;
    white-space: normal;
    vertical-align: top;
}

.pm-progress-table .pm-progress-sticky-unit {
    left: 364px;
    width: 52px;
    min-width: 52px;
    max-width: 52px;
}

.pm-progress-item-text {
    display: -webkit-box;
    overflow: hidden;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    word-break: break-word;
}

.pm-progress-table .pm-progress-qty {
    width: 92px;
    min-width: 92px;
    max-width: 104px;
}

.pm-progress-table .pm-progress-money {
    width: 126px;
    min-width: 126px;
    max-width: 142px;
}

.pm-progress-table .pm-progress-col--total {
    background: #e8f7f2;
}

.pm-progress-table thead .pm-progress-col--total {
    background: #c9f0e4;
}

/* Foreman progress table workspace. */
.pm-foreman-body {
    background:
        radial-gradient(circle at top left, rgba(7, 166, 170, 0.12), transparent 32%),
        linear-gradient(180deg, #f8fbfb, #eef5f4);
    color: var(--text);
}

.pm-foreman-header {
    min-height: 64px;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(191, 208, 204, 0.82);
    color: var(--text);
    box-shadow: 0 10px 30px rgba(20, 31, 29, 0.04);
}

.pm-foreman-brand {
    color: var(--text);
}

.pm-foreman-brand span {
    font-weight: 820;
}

.pm-foreman-user {
    color: var(--muted);
}

.pm-foreman-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-wrap: wrap;
}

.pm-foreman-logout-form {
    margin: 0;
}

.pm-foreman-header .pm-btn {
    width: auto;
    white-space: nowrap;
}

.pm-foreman-header .pm-btn-ghost {
    background: rgba(7, 166, 170, 0.08);
    border-color: rgba(7, 166, 170, 0.28);
    color: var(--text);
    box-shadow: none;
}

.pm-foreman-header .pm-btn-ghost:hover {
    background: rgba(7, 166, 170, 0.14);
    border-color: rgba(7, 166, 170, 0.36);
    color: var(--text);
}

.pm-foreman-switch-office {
    min-width: 9.5rem;
}

.pm-foreman-main {
    width: 100%;
    max-width: none;
    padding: 14px 18px 18px;
}

.pm-foreman-board-head {
    margin-bottom: 12px;
    color: var(--text);
}

.pm-foreman-board-head h1 {
    color: var(--text);
    font-size: clamp(1.45rem, 1.8vw, 2rem);
}

.pm-foreman-live-pill {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-weight: 820;
}

.pm-foreman-tabs {
    margin-bottom: 12px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pm-foreman-tab {
    border-color: rgba(191, 208, 204, 0.9);
    background: rgba(255, 255, 255, 0.86);
    color: var(--text);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.92);
}

.pm-foreman-tab.is-active {
    background: linear-gradient(135deg, var(--brand), var(--brand-cyan));
    color: #ffffff;
}

.pm-foreman-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.pm-foreman-summary-grid article {
    min-height: 76px;
    padding: 12px 14px;
    border: 1px solid rgba(191, 208, 204, 0.86);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-sm);
}

.pm-foreman-summary-grid span {
    display: block;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 840;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.pm-foreman-summary-grid strong {
    display: block;
    margin-top: 7px;
    color: var(--text);
    font-size: 1.55rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.pm-foreman-summary-grid article.is-alert strong {
    color: var(--edi-red);
}

.pm-foreman-board-toolbar {
    position: static;
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    margin: 0 0 12px;
    padding: 12px;
    border: 1px solid rgba(191, 208, 204, 0.86);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-sm);
    pointer-events: auto;
}

.pm-foreman-board-toolbar .pm-foreman-search-input {
    min-height: 48px;
    background: #ffffff;
    color: var(--text);
}

.pm-foreman-board-toolbar .pm-foreman-filter-label {
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    color: var(--text);
    font-weight: 820;
    white-space: nowrap;
}

.pm-foreman-match-count {
    color: var(--muted);
    font-weight: 820;
    white-space: nowrap;
}

.pm-foreman-board {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 12px;
    align-items: start;
    margin-bottom: 16px;
}

.pm-foreman-table-panel,
.pm-foreman-entry-panel {
    min-width: 0;
    border: 1px solid rgba(191, 208, 204, 0.86);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.pm-foreman-table-scroll {
    max-height: calc(100vh - 340px);
    min-height: 430px;
    overflow: auto;
}

.pm-foreman-progress-table {
    width: 100%;
    min-width: 920px;
    border-collapse: collapse;
    color: var(--text);
    table-layout: fixed;
}

.pm-foreman-progress-table th,
.pm-foreman-progress-table td {
    padding: 10px 9px;
    border-bottom: 1px solid #e4eeeb;
    vertical-align: middle;
}

.pm-foreman-progress-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: linear-gradient(180deg, #fbfdfd, #eef6f4);
    color: #3b4a47;
    font-size: 0.74rem;
    font-weight: 860;
    letter-spacing: 0.02em;
    text-align: left;
    text-transform: uppercase;
}

.pm-foreman-progress-table tbody tr {
    cursor: pointer;
    outline: none;
}

.pm-foreman-progress-table tbody tr:hover td,
.pm-foreman-progress-table tbody tr:focus-visible td {
    background: #f2faf8;
}

.pm-foreman-progress-table tbody tr.is-selected td {
    background: #e4f6f2;
    box-shadow: inset 0 1px 0 rgba(12, 107, 95, 0.06), inset 0 -1px 0 rgba(12, 107, 95, 0.06);
}

.pm-foreman-progress-table tr[hidden] {
    display: none;
}

.pm-foreman-progress-table th:nth-child(1),
.pm-foreman-progress-table td:nth-child(1) {
    width: 7%;
}

.pm-foreman-progress-table th:nth-child(2),
.pm-foreman-progress-table td:nth-child(2) {
    width: 34%;
}

.pm-foreman-progress-table th:nth-child(3),
.pm-foreman-progress-table td:nth-child(3) {
    width: 5%;
}

.pm-foreman-progress-table th:nth-child(4),
.pm-foreman-progress-table td:nth-child(4) {
    width: 7%;
}

.pm-foreman-progress-table th:nth-child(5),
.pm-foreman-progress-table td:nth-child(5),
.pm-foreman-progress-table th:nth-child(6),
.pm-foreman-progress-table td:nth-child(6) {
    width: 10%;
}

.pm-foreman-progress-table th:nth-child(7),
.pm-foreman-progress-table td:nth-child(7),
.pm-foreman-progress-table th:nth-child(8),
.pm-foreman-progress-table td:nth-child(8) {
    width: 8%;
}

.pm-foreman-progress-table th:nth-child(9),
.pm-foreman-progress-table td:nth-child(9),
.pm-foreman-progress-table th:nth-child(10),
.pm-foreman-progress-table td:nth-child(10) {
    width: 5.5%;
}

.pm-num {
    text-align: right !important;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.pm-foreman-item-cell {
    max-width: 330px;
    font-weight: 780;
    line-height: 1.25;
}

.pm-foreman-line-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 28px;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-size: 0.8rem;
    font-weight: 900;
}

.pm-foreman-status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #f4f8f7;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 840;
    white-space: nowrap;
}

.pm-foreman-status-pill.is-done,
.pm-foreman-entry-facts .is-done {
    background: #edf7f3;
    color: var(--brand-dark);
}

.pm-foreman-status-pill.is-warn {
    background: #fff4dc;
    color: #94650c;
}

.pm-foreman-status-pill.is-alert {
    background: var(--edi-red-soft);
    color: var(--edi-red);
}

.pm-foreman-mini-progress {
    display: block;
    width: 88px;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #deebe8;
}

.pm-foreman-mini-progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand), var(--brand-cyan));
}

.pm-foreman-entry-panel {
    position: sticky;
    top: 12px;
}

.pm-foreman-entry-panel > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff, #f7fbfa);
}

.pm-foreman-entry-panel h2 {
    margin: 0;
    color: var(--text);
    font-size: 1.05rem;
}

.pm-foreman-entry-panel > header span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 820;
}

.pm-foreman-entry-pane {
    display: grid;
    gap: 14px;
    padding: 16px;
}

.pm-foreman-entry-pane[hidden] {
    display: none;
}

.pm-foreman-active-line {
    padding: 14px;
    border: 1px solid rgba(12, 107, 95, 0.16);
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand-soft), #ffffff);
}

.pm-foreman-active-line strong {
    display: block;
    margin-top: 10px;
    color: var(--text);
    font-size: 1.1rem;
    line-height: 1.22;
}

.pm-foreman-active-line p {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.35;
}

.pm-foreman-entry-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pm-foreman-entry-facts span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #f4f8f7;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 840;
}

.pm-foreman-quick-form {
    display: grid;
    gap: 12px;
}

.pm-foreman-quick-form .pm-field {
    margin: 0;
}

.pm-foreman-quick-form .pm-field span {
    font-size: 0.82rem;
    font-weight: 820;
}

.pm-foreman-quick-form .pm-field input {
    min-height: 56px;
    font-size: 1.25rem;
    font-weight: 820;
}

.pm-foreman-save-btn {
    min-height: 54px;
}

.pm-foreman-today-panel {
    border: 1px solid rgba(191, 208, 204, 0.86);
    background: rgba(255, 255, 255, 0.9);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.pm-foreman-today-entry {
    border-bottom-color: var(--line);
}

.pm-foreman-entry-time {
    color: var(--muted);
}

.pm-foreman-no-results {
    color: var(--muted);
}

@media (max-width: 1120px) {
    .pm-foreman-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .pm-foreman-board {
        grid-template-columns: 1fr;
    }

    .pm-foreman-entry-panel {
        position: static;
    }
}

@media (max-width: 1380px) {
    .pm-foreman-progress-table th:nth-child(8),
    .pm-foreman-progress-table td:nth-child(8) {
        display: none;
    }

    .pm-foreman-progress-table {
        min-width: 0;
    }

    .pm-foreman-progress-table th,
    .pm-foreman-progress-table td {
        padding-left: 7px;
        padding-right: 7px;
    }

    .pm-foreman-progress-table th:nth-child(2),
    .pm-foreman-progress-table td:nth-child(2) {
        width: 30%;
    }

    .pm-foreman-progress-table th:nth-child(3),
    .pm-foreman-progress-table td:nth-child(3) {
        width: 5%;
    }

    .pm-foreman-progress-table th:nth-child(4),
    .pm-foreman-progress-table td:nth-child(4) {
        width: 7%;
    }

    .pm-foreman-progress-table th:nth-child(5),
    .pm-foreman-progress-table td:nth-child(5),
    .pm-foreman-progress-table th:nth-child(6),
    .pm-foreman-progress-table td:nth-child(6) {
        width: 12%;
    }

    .pm-foreman-progress-table th:nth-child(7),
    .pm-foreman-progress-table td:nth-child(7) {
        width: 10%;
    }

    .pm-foreman-progress-table th:nth-child(9),
    .pm-foreman-progress-table td:nth-child(9),
    .pm-foreman-progress-table th:nth-child(10),
    .pm-foreman-progress-table td:nth-child(10) {
        width: 8.5%;
    }
}

@media (max-width: 760px) {
    .pm-foreman-main {
        padding: 12px;
    }

    .pm-foreman-tabs,
    .pm-foreman-summary-grid,
    .pm-foreman-board-toolbar {
        grid-template-columns: 1fr;
    }

    .pm-foreman-table-scroll {
        max-height: none;
        min-height: 320px;
    }
}

.pm-assistant-metrics {
    margin-bottom: 18px;
}

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

.pm-assistant-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-left-width: 4px;
    border-radius: 8px;
    background: #fff;
}

.pm-assistant-item h3 {
    margin: 8px 0 4px;
    font-size: 1rem;
}

.pm-assistant-item p {
    margin: 0 0 6px;
    color: var(--muted);
    line-height: 1.5;
}

.pm-assistant-item strong {
    display: block;
    font-size: 0.92rem;
}

.pm-assistant-item-critical {
    border-left-color: var(--danger);
}

.pm-assistant-item-warning {
    border-left-color: #d97706;
}

.pm-assistant-item-info {
    border-left-color: var(--brand);
}

.pm-assistant-report {
    margin: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--text);
    white-space: pre-wrap;
    overflow-x: auto;
    line-height: 1.5;
}

@media (max-width: 760px) {
    .pm-assistant-item {
        flex-direction: column;
        align-items: stretch;
    }
}

.pm-project-module-tabs {
    margin-bottom: 14px;
}

.pm-portfolio-progress-track,
.pm-portfolio-row-progress {
    display: flex;
    width: 100%;
    min-height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: #e2e8f0;
}

.pm-portfolio-row-progress {
    min-width: 120px;
    max-width: 180px;
}

.pm-portfolio-progress-seg--invoiced { background: #1baca0; }
.pm-portfolio-progress-seg--inprogress { background: #64748b; }
.pm-portfolio-progress-seg--remaining { background: #cbd5e1; }

.pm-portfolio-progress-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--muted);
}

.pm-portfolio-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.pm-portfolio-card {
    display: block;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    color: inherit;
}

.pm-portfolio-card strong { display: block; }
.pm-portfolio-card span { display: block; margin-top: 4px; }
.pm-portfolio-card small { display: block; margin-top: 6px; color: var(--muted); }

.pm-portfolio-card--critical {
    border-color: #fca5a5;
    background: #fef2f2;
}

.pm-portfolio-card--watch {
    border-color: #fde68a;
    background: #fffbeb;
}

.pm-health-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.pm-health-badge--kritikus { background: rgba(139, 1, 1, 0.08); color: #8B0101; }
.pm-health-badge--figyelendo { background: #fffbeb; color: #b45309; }
.pm-health-badge--jo { background: rgba(27, 172, 160, 0.1); color: #075E56; }
.pm-health-badge--kivalo { background: #f0fdf4; color: #16a34a; }

.pm-health-pill--excellent {
    border-color: rgba(22, 163, 74, 0.2);
    background: #f0fdf4;
    color: #16a34a;
}

.pm-health-pill--warning {
    border-color: rgba(180, 83, 9, 0.2);
    background: #fffbeb;
    color: #b45309;
}

.pm-text-danger { color: #b91c1c; }

.pm-fe-tabs .pm-doc-tab.is-active {
    border-color: var(--brand);
    color: var(--brand-dark);
    background: #f0fdfa;
}

.pm-finance-waterfall {
    display: grid;
    gap: 0;
}

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

.pm-finance-waterfall-row--total {
    background: #f8fafc;
    font-weight: 700;
}

.pm-finance-waterfall-row--result {
    background: #f0fdfa;
    color: var(--brand-dark);
    font-weight: 700;
}

.pm-finance-waterfall-divider {
    height: 8px;
    background: #eef2f7;
}

.pm-finance-ok-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-weight: 700;
    font-size: 0.8rem;
}

.pm-finance-danger-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fee2e2;
    color: var(--edi-burgundy);
    font-weight: 700;
    font-size: 0.8rem;
}

.pm-site-log-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    min-height: 34px;
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.pm-site-log-bar-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #075e56;
    font-weight: 700;
    font-size: 12px;
    text-decoration: none;
}

.pm-site-log-bar-link:hover {
    color: #1baca0;
}

.pm-site-log-bar-meta {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(27, 172, 160, 0.12);
    color: #075e56;
    font-size: 11px;
    font-weight: 650;
}

.app-shell--bc .pm-site-log-bar {
    grid-column: 1 / -1;
}

/* Import wizard visual grid (summary rows, validation, preview). */
.pm-wizard-step-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 16px;
    align-items: start;
}

.pm-wizard-grid-panel {
    min-width: 0;
}

.pm-wizard-grid-wrap {
    max-height: calc(100vh - 280px);
}

.pm-wizard-side-panel {
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 32px);
    overflow: auto;
}

.pm-wizard-side-panel h2 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.pm-wizard-side-panel h3 {
    margin: 0 0 10px;
    font-size: 0.95rem;
}

.pm-wizard-step-actions {
    margin-top: 16px;
}

.pm-wizard-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 0.8rem;
    color: var(--muted);
}

.pm-wizard-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pm-wizard-legend-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid var(--line);
}

.pm-wizard-legend-swatch.is-mapped {
    background: #dcfce7;
}

.pm-wizard-legend-swatch.is-candidate {
    background: #fef9c3;
    border-color: #f59e0b;
}

.pm-wizard-legend-swatch.is-header {
    background: #fffbeb;
}

.pm-wizard-legend-swatch.is-error {
    background: #fee2e2;
    border-color: #ef4444;
}

.pm-wizard-grid tbody tr.is-selectable {
    cursor: pointer;
}

.pm-wizard-grid tbody tr.pm-wizard-row-candidate td {
    box-shadow: inset 3px 0 0 #f59e0b;
}

.pm-wizard-grid tbody tr.pm-wizard-row-candidate.is-resolved td {
    box-shadow: inset 3px 0 0 #22c55e;
}

.pm-wizard-grid tbody tr.is-selected td {
    background: #eff6ff !important;
}

.pm-wizard-grid tbody tr.pm-wizard-row-error td {
    box-shadow: inset 3px 0 0 #ef4444;
}

.pm-wizard-cell-error {
    background: #fee2e2 !important;
    color: #991b1b;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px #fca5a5;
}

.pm-wizard-row-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 4px;
    border-radius: 999px;
    background: #f59e0b;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    vertical-align: middle;
}

.pm-validation-issue-list {
    margin: 0 0 12px;
    padding-left: 18px;
    color: #991b1b;
    font-size: 0.88rem;
}

.pm-badge-warn {
    background: #fef3c7;
    color: #92400e;
}

.pm-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    margin-left: 6px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
}

.pm-wizard-summary-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.pm-wizard-summary-card {
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

.pm-wizard-summary-card.is-grand {
    border-color: rgba(12, 107, 95, 0.28);
    background: linear-gradient(135deg, #f0fdfa, #fff);
}

.pm-wizard-summary-label {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.pm-wizard-summary-value {
    display: block;
    margin-top: 8px;
    font-size: 1.35rem;
    font-variant-numeric: tabular-nums;
}

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

    .pm-wizard-side-panel {
        position: static;
        max-height: none;
    }

    .pm-wizard-summary-cards {
        grid-template-columns: 1fr;
    }
}

/* —— Jogosultságkezelés központ —— */
.pm-access-shell {
    display: grid;
    gap: 16px;
}

.pm-access-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #eef2f6;
}

.pm-access-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.12s ease, color 0.12s ease;
}

.pm-access-tab:hover {
    background: rgba(27, 172, 160, 0.1);
    color: var(--text);
}

.pm-access-tab.is-active {
    background: #fff;
    color: var(--brand-dark);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.pm-access-crumb {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.pm-access-crumb strong {
    color: var(--text);
    font-weight: 700;
}

.pm-access-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: -4px 0 4px;
}

.pm-access-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.pm-access-stat {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px 14px;
}

.pm-access-stat-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.pm-access-stat-value {
    display: block;
    margin-top: 6px;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--brand-dark);
}

.pm-access-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

.pm-access-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}

.pm-access-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #fafbfc, #fff);
}

.pm-access-panel-head h2 {
    margin: 0;
    font-size: 1.05rem;
}

.pm-access-panel-head .pm-hint {
    margin: 4px 0 0;
    font-size: 0.82rem;
}

.pm-access-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(27, 172, 160, 0.12);
    color: var(--brand-dark);
    font-size: 0.78rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.pm-access-panel-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 16px;
    flex: 1;
    min-height: 0;
}

.pm-access-search {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 12px;
    font: inherit;
    background: #fff;
}

.pm-access-search:focus {
    outline: 2px solid rgba(27, 172, 160, 0.2);
    border-color: var(--brand);
}

.pm-access-user-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: min(58vh, 520px);
    overflow: auto;
    padding-right: 2px;
}

.pm-access-user {
    display: grid;
    grid-template-columns: 18px 34px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease;
}

.pm-access-user:hover {
    background: #f5f7fa;
    border-color: #e5e9ef;
}

.pm-access-user:has(input:checked) {
    background: rgba(27, 172, 160, 0.08);
    border-color: rgba(27, 172, 160, 0.22);
}

.pm-access-user input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--brand);
    cursor: pointer;
}

.pm-access-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e8eef3;
    color: var(--brand-dark);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.pm-access-user-meta {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.pm-access-user-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pm-access-user-email {
    font-size: 0.76rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pm-access-panel-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid var(--line);
    background: #fafbfc;
}

.pm-access-empty {
    padding: 18px 8px;
    text-align: center;
    color: var(--muted);
    font-size: 0.88rem;
}

.pm-access-select-row {
    display: grid;
    gap: 6px;
}

.pm-access-select-row span {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.pm-access-select-row select {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    font: inherit;
    background: #fff;
}

@media (max-width: 960px) {
    .pm-access-split {
        grid-template-columns: 1fr;
    }

    .pm-access-user-list {
        max-height: 360px;
    }
}

/* —— Titulus / szerepkör űrlap —— */
.pm-role-form {
    display: grid;
    gap: 16px;
}

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

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

.pm-role-flag,
.pm-role-perm {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text);
}

.pm-role-flag:hover,
.pm-role-perm:hover {
    border-color: rgba(27, 172, 160, 0.35);
    background: #f7fbfb;
}

.pm-role-flag:has(input:checked),
.pm-role-perm:has(input:checked) {
    border-color: rgba(27, 172, 160, 0.45);
    background: rgba(27, 172, 160, 0.08);
}

.pm-role-flag input[type="checkbox"],
.pm-role-perm input[type="checkbox"] {
    width: 16px !important;
    min-width: 16px;
    max-width: 16px;
    height: 16px !important;
    min-height: 16px !important;
    margin: 2px 0 0;
    padding: 0;
    accent-color: var(--brand);
    cursor: pointer;
}

.pm-role-flag span,
.pm-role-perm span {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.pm-role-flag strong,
.pm-role-perm strong {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.25;
}

.pm-role-flag small,
.pm-role-perm small {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 500;
    line-height: 1.3;
    word-break: break-word;
}

.pm-role-perms {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fafbfc;
    overflow: hidden;
}

.pm-role-perms-head {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.pm-role-perms-head h3 {
    margin: 0;
    font-size: 1rem;
}

.pm-role-perms-head .pm-hint {
    margin: 4px 0 0;
}

.pm-role-perm-groups {
    display: grid;
    gap: 12px;
    padding: 12px;
}

.pm-role-perm-group {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}

.pm-role-perm-group > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #fafbfc, #fff);
}

.pm-role-perm-group > header strong {
    font-size: 0.9rem;
}

.pm-role-perm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 6px;
    padding: 10px;
}

.pm-role-item {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
    background: #fff;
}

.pm-role-item summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.pm-role-item summary::-webkit-details-marker {
    display: none;
}

@media (max-width: 800px) {
    .pm-role-form-basics,
    .pm-role-flag-grid {
        grid-template-columns: 1fr;
    }

    .pm-role-perm-grid {
        grid-template-columns: 1fr;
    }
}

