.erp {
    --nano-product-color: var(--blue-500);
}

.content-container {
    background-color: var(--content-background-color);
    padding: 20px 20px;
}

/* Entities Grid */
.entities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.entity-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--content-background-color);
    border: 1px solid var(--border-color);
    border-radius: 0.125rem;
    padding: 24px;
    min-height: 160px;
    box-shadow: 0 2px 4px var(--shadow-color);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-color-primary);
}

.entity-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px var(--shadow-color);
    border-color: var(--nano-product-color);
}

/* Members Table (Project Details) */
.members-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    margin-bottom: 16px;
}

.members-table thead {
    background-color: var(--zinc-50);
}

.members-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
}

.members-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.members-table tbody tr:hover {
    background-color: var(--button-hover-background-color);
}

/* Shared toolbar (e.g. Strategy cockpit) */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Gantt Page (Update Project) — full-bleed, chart-first */
.gantt-page {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0.75rem 1rem 1rem;
    box-sizing: border-box;
    min-width: 0;
}

.gantt-page__chrome {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
}

.gantt-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--content-background-color);
    border: 1px solid var(--border-color);
    border-radius: 0.125rem;
}

.gantt-toolbar__left {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    min-width: 0;
}

.gantt-toolbar__status {
    font-size: 0.8125rem;
    color: var(--text-color-secondary);
    font-style: italic;
    white-space: nowrap;
}

.gantt-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.125rem;
    background: var(--content-background-color);
}

.gantt-filters__menu {
    position: relative;
    height: 2.5rem;
    max-height: 2.5rem;
}

.gantt-filters__menu > summary {
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
    gap: 0.45rem;
    height: 2.5rem;
    min-height: 2.5rem;
    max-height: 2.5rem;
    padding: 0 0.75rem;
    border: 1px solid var(--input-border-color, var(--border-color));
    border-radius: 0.125rem;
    background: var(--input-background-color, var(--content-background-color));
    font-family: inherit;
    color: var(--text-color-primary);
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.25rem;
    list-style: none;
    cursor: pointer;
}

.gantt-filters__menu > summary::-webkit-details-marker {
    display: none;
}

.gantt-filters__menu > summary::after {
    content: "";
    width: 0.4rem;
    height: 0.4rem;
    margin-top: -0.15rem;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    opacity: 0.55;
    transform: rotate(45deg);
}

.gantt-filters__menu[open] > summary {
    border-color: var(--input-focus-border-color, var(--accent-color));
    box-shadow: 0 0 0 2px var(--focus-shadow-color, var(--blue-100));
}

.gantt-filters__count {
    min-width: 1.15rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: var(--list-item-background-color-secondary);
    color: var(--text-color-secondary);
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.35rem;
    text-align: center;
}

.gantt-filters__panel {
    position: absolute;
    z-index: 30;
    top: calc(100% + 0.35rem);
    left: 0;
    min-width: 14rem;
    max-height: 16rem;
    overflow: auto;
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--content-background-color);
    box-shadow: 0 8px 24px var(--shadow-color);
}

.gantt-filters__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    flex-basis: 100%;
}

.gantt-filters__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    height: 1.6rem;
    padding: 0 0.55rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--list-item-background-color-secondary);
    color: var(--text-color-primary);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
}

.gantt-filters__chip:hover {
    border-color: var(--border-color-dark);
    background: var(--button-hover-background-color);
}

.gantt-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    height: calc(100vh - 200px);
    min-height: 420px;
    min-width: 0;
    border: 1px solid var(--border-color);
    border-radius: 0.125rem;
    overflow: hidden;
    background: var(--content-background-color);
}

.gantt-wrapper--with-inspector {
    grid-template-columns: minmax(0, 1fr) 300px;
}

/* Shared vertical scroll keeps task rows aligned with timeline bars */
.gantt-chart-scroll {
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
    align-items: start;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
    min-height: 0;
    height: 100%;
    background: var(--content-background-color);
}

.grid-pane {
    border-right: 1px solid var(--border-color);
    background: var(--content-background-color);
    overflow: visible;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.grid-header {
    height: 56px;
    min-height: 56px;
    border-bottom: 1px solid var(--border-color);
    background: var(--list-item-background-color-secondary);
    position: sticky;
    top: 0;
    z-index: 11;
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
}

.grid-header-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-color-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grid-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 2.5rem;
    align-items: center;
    padding: 0 0.25rem 0 0.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s ease, opacity 0.2s ease;
    height: 40px;
    box-sizing: border-box;
    position: relative;
}

.grid-row.is-dragging {
    opacity: 0.4;
    cursor: grabbing;
}

.drop-zone {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 5;
}

.drop-zone.before {
    top: 0;
    height: 12px;
}

.drop-zone.on {
    top: 12px;
    height: 16px;
}

.drop-zone.after {
    bottom: 0;
    height: 12px;
}

.grid-row.drop-on {
    background: var(--status-info-bg) !important;
    outline: 2px solid var(--status-info-color);
    outline-offset: -2px;
}

.grid-row.drop-before::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-color);
    z-index: 10;
    pointer-events: none;
}

.grid-row.drop-after::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-color);
    z-index: 10;
    pointer-events: none;
}

.grid-row:last-child {
    border-bottom: none;
}

.grid-row:hover {
    background: var(--button-hover-background-color);
}

.grid-row.selected {
    background: var(--status-info-bg);
    box-shadow: inset 3px 0 0 var(--accent-color);
}

.grid-row.phase-row {
    background: var(--list-item-background-color-secondary);
    font-weight: 600;
}

.grid-cell.name {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.grid-cell.name .text-box {
    width: 100%;
    margin: 0;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.gantt-task-status-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    color: var(--text-color-secondary);
}

.gantt-task-status-icon--completed {
    color: var(--status-success-color, #00915b);
}

.gantt-task-status-icon--blocked {
    color: var(--status-error-color);
}

.gantt-task-status-icon--inprogress {
    color: var(--status-info-color, var(--accent-color));
}

.gantt-task-status-icon--overdue {
    color: var(--status-warning-color, var(--status-error-color));
}

.gantt-task-status-icon svg {
    width: 1rem;
    height: 1rem;
    display: block;
    fill: currentColor;
}

.grid-cell.name .text-box__input {
    border-color: transparent;
    background: transparent;
    height: 38px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.grid-row .text-box {
    margin-bottom: 0;
}

.grid-cell.actions {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
}

.grid-cell.actions .action-menu {
    position: relative;
}

.grid-cell.actions .action-menu .action-menu__trigger.button,
.grid-cell.actions .action-menu .action-menu__trigger.button .button__input {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none;
}

.grid-cell.actions .action-menu .action-menu__trigger.button .button__input {
    color: var(--text-color-secondary);
}

.grid-cell.actions .action-menu .action-menu__trigger.button .button__input:hover:not(:disabled) {
    background: var(--button-hover-background-color) !important;
    color: var(--text-color-primary);
}

.timeline-pane {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--list-item-background-color-secondary);
    overflow-x: auto;
    overflow-y: visible;
    min-width: 0;
    min-height: 0;
    width: 100%;
}

.timeline-header {
    height: 56px;
    border-bottom: 1px solid var(--border-color);
    background: var(--list-item-background-color-secondary);
    position: sticky;
    top: 0;
    z-index: 11;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.25rem 0.75rem 0.35rem;
    box-sizing: border-box;
    flex-shrink: 0;
    min-width: 100%;
}

.timeline-header__meta {
    display: flex;
    align-items: center;
}

.timeline-header-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-color-secondary);
    white-space: nowrap;
}

.timeline-ticks {
    position: relative;
    height: 1rem;
    width: 100%;
}

.timeline-tick {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    font-size: 0.625rem;
    letter-spacing: -0.01em;
    color: var(--text-color-secondary);
    white-space: nowrap;
    pointer-events: none;
}

.timeline-body {
    position: relative;
    flex: 0 0 auto;
    background-color: var(--content-background-color);
    background-image: linear-gradient(var(--border-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
    background-size: 100% 40px, 40px 100%;
    background-attachment: local;
    box-sizing: border-box;
    border-bottom: 1px solid var(--border-color);
    min-width: 100%;
}

.bar {
    position: absolute;
    height: 24px;
    border-radius: 0.125rem;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 2px var(--shadow-color);
    transition: filter 0.2s ease;
}

.bar:hover {
    filter: brightness(1.05);
}

.task-bar {
    background: var(--accent-color);
    border: 1px solid var(--accent-color);
}

.task-bar.milestone {
    background: var(--status-warning-color);
    border: 1px solid var(--status-warning-color);
    width: 20px !important;
    height: 20px;
    transform: rotate(45deg);
    margin-top: 2px;
}

.phase-bar {
    background: var(--text-color-tertiary);
    height: 8px;
    border-radius: 4px;
    margin-top: 8px;
    border: 1px solid var(--border-color-dark);
}

.handle {
    position: absolute;
    width: 10px;
    top: 0;
    bottom: 0;
    background: var(--status-info-bg);
    cursor: ew-resize;
    opacity: 0;
    transition: opacity 0.2s;
}

.bar:hover .handle {
    opacity: 1;
}

.handle.start {
    left: 0;
}

.handle.end {
    right: 0;
}

.drag-surface {
    position: absolute;
    inset: 8px;
    cursor: grab;
}

.drag-surface:active {
    cursor: grabbing;
}

.today-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--status-error-color);
    z-index: 5;
    pointer-events: none;
}

.today-line__label {
    position: absolute;
    top: 0;
    left: 4px;
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--status-error-color);
}

.dependency-layer {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
}

.dependency-line {
    stroke: var(--text-color-secondary);
    stroke-width: 1.5;
    fill: none;
    marker-end: url(#arrowhead);
}

.gantt-inspector-backdrop {
    display: none;
}

.gantt-inspector {
    border-left: 1px solid var(--border-color);
    background: var(--content-background-color);
    overflow-x: hidden;
    overflow-y: auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.gantt-inspector__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--content-background-color);
    z-index: 2;
}

.gantt-inspector__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color-primary);
}

.gantt-inspector__close {
    flex-shrink: 0;
}

.gantt-inspector__close .button__input {
    width: 2.25rem;
    min-width: 2.25rem;
    height: 2.25rem;
    min-height: 2.25rem;
    padding: 0;
}

.gantt-inspector__fields {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    min-width: 0;
}

.gantt-inspector__fields .text-box,
.gantt-inspector__fields .form-field,
.gantt-inspector__fields .number-text-box,
.gantt-inspector__fields .date-picker,
.gantt-inspector__fields .dropdown,
.gantt-inspector__fields .enum-dropdown {
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.gantt-inspector .form-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-bottom: 0;
    min-width: 0;
}

.gantt-inspector .form-field label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-color-secondary);
    text-transform: uppercase;
}

.gantt-dep-summary {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.gantt-dep-summary__text {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-color-secondary);
}

.gantt-dep-modal__help {
    margin: 0 0 1rem;
    font-size: 0.875rem;
    color: var(--text-color-secondary);
}

.gantt-dep-modal__add {
    margin-top: 1rem;
}

.gantt-dep-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.gantt-dep-list__heading {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-color-secondary);
}

.gantt-dep-list__item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "name remove"
        "type remove";
    gap: 0.15rem 0.5rem;
    align-items: center;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 0.125rem;
    background: var(--list-item-background-color-secondary);
    min-width: 0;
}

.gantt-dep-list__name {
    grid-area: name;
    font-size: 0.8125rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gantt-dep-list__type {
    grid-area: type;
    font-size: 0.7rem;
    color: var(--text-color-secondary);
}

.gantt-dep-list__remove {
    grid-area: remove;
}

.dep-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
    width: 100%;
    min-width: 0;
}

.dep-actions .button {
    width: 100%;
    max-width: 100%;
}

.dep-actions .button .button__input {
    width: 100%;
    justify-content: center;
}

@media (max-width: 1024px) {
    .gantt-wrapper,
    .gantt-wrapper--with-inspector {
        grid-template-columns: minmax(0, 1fr);
        position: relative;
    }

    .gantt-chart-scroll {
        grid-template-columns: minmax(160px, 200px) minmax(0, 1fr);
    }

    .gantt-inspector-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 190;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(2px);
    }

    .gantt-inspector {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 200;
        width: min(100%, 360px);
        border-left: 1px solid var(--border-color);
        box-shadow: -8px 0 24px var(--shadow-color);
    }
}

@media (max-width: 768px) {
    .gantt-page {
        padding: 0.5rem;
    }

    .gantt-wrapper,
    .gantt-wrapper--with-inspector {
        grid-template-columns: 1fr;
        height: calc(100vh - 220px);
    }

    .gantt-chart-scroll {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(220px, 1fr);
    }

    .grid-pane {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        max-height: 40vh;
        overflow-y: auto;
    }

    .timeline-pane {
        overflow: auto;
        min-height: 220px;
    }

    .gantt-inspector {
        width: 100%;
        max-width: none;
    }

    .gantt-toolbar__left .button .button__input {
        min-height: 2.75rem;
    }

    .grid-cell.actions .action-menu .action-menu__trigger.button .button__input {
        width: 2.75rem;
        min-width: 2.75rem;
        height: 2.75rem;
        min-height: 2.75rem;
    }

    .handle {
        width: 14px;
        opacity: 0.85;
    }
}

/* Time Report Redesign */
.error-message,
.warning-message {
    border-radius: 0.125rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    border: 1px solid;
}

.error-message {
    background: var(--status-error-bg);
    border-color: var(--status-error-color);
    color: var(--status-error-color);
}

.warning-message {
    background: var(--status-warning-bg);
    border-color: var(--status-warning-color);
    color: var(--text-color-primary);
}

.time-report-summary {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: var(--page-background-color);
    border: 1px solid var(--border-color);
    border-radius: 0.125rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.summary-card.ai-insights {
    background: linear-gradient(135deg, #7f1d1d 0%, #b21f1f 52%, #f59e0b 100%);
    color: white;
    border: none;
}

.summary-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-card__title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
}

.ai-insights .summary-card__title {
    opacity: 1;
}

.ai-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.ai-title-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.total-hours {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.hours-large {
    font-size: 2.5rem;
    font-weight: 700;
}

.hours-separator {
    font-size: 1.5rem;
    opacity: 0.5;
}

.hours-planned {
    font-size: 1.25rem;
    opacity: 0.7;
}

.progress-bar-container {
    height: 8px;
    background: var(--border-color);
    border-radius: 0.125rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent-color);
    border-radius: 0.125rem;
}

.missing-hours {
    font-size: 0.875rem;
    color: var(--status-error-color);
    font-weight: 500;
}

.time-report-container {
    background: var(--page-background-color);
    border: 1px solid var(--border-color);
    border-radius: 0.125rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-swatch {
    width: 0.875rem;
    height: 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 0.125rem;
    display: inline-block;
}

.calendar-header {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    text-align: center;
    font-weight: 600;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.calendar-row {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: stretch;
}

.week-number {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--zinc-400);
    text-transform: uppercase;
}

.calendar-day {
    aspect-ratio: 1 / 1;
    min-height: unset;
    border: 1px solid var(--border-color);
    border-radius: 0.125rem;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    background: var(--page-background-color);
    transition: all 0.2s ease;
    position: relative;
}

.calendar-day.empty {
    border: none;
    background: transparent;
    cursor: default;
}

.calendar-day:hover:not(.empty) {
    background: var(--collection-row-hover-background);
    border-color: var(--accent-color);
}

.calendar-day.selected {
    outline: 2px solid var(--accent-color);
    outline-offset: -2px;
}

.calendar-day.holiday {
    background: var(--list-item-background-color-secondary);
}

.calendar-day.day-full,
.legend-swatch.day-full {
    background: var(--status-success-bg);
    border-color: var(--status-success-color);
}

.calendar-day.day-partial,
.legend-swatch.day-partial {
    background: var(--status-info-bg);
    border-color: var(--status-info-color);
}

.calendar-day.day-missing,
.legend-swatch.day-missing {
    background: var(--status-error-bg);
    border-color: var(--status-error-color);
}

.calendar-day.day-full:hover:not(.empty) {
    background: color-mix(in srgb, var(--status-success-color) 24%, var(--content-background-color));
    border-color: var(--status-success-color);
}

.calendar-day.day-partial:hover:not(.empty) {
    background: color-mix(in srgb, var(--status-info-color) 24%, var(--content-background-color));
    border-color: var(--status-info-color);
}

.calendar-day.day-missing:hover:not(.empty) {
    background: color-mix(in srgb, var(--status-error-color) 24%, var(--content-background-color));
    border-color: var(--status-error-color);
}

.day-number {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
}


.day-hours {
    font-size: 0.75rem;
    color: var(--accent-color);
    font-weight: 700;
}

.holiday-name {
    font-size: 0.625rem;
    color: var(--status-error-color);
    text-align: center;
    position: absolute;
    bottom: 4px;
    width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.weekly-report {
    background: var(--page-background-color);
    border: 1px solid var(--border-color);
    border-radius: 0.125rem;
    padding: 1.5rem;
}

.weekly-report__header {
    margin-bottom: 1.5rem;
}

.table-container {
    overflow: visible;
}

.time-entry-table {
    width: 100%;
    border-collapse: collapse;
}

.time-entry-table th {
    text-align: left;
    padding: 0.75rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--zinc-500);
    border-bottom: 1px solid var(--border-color);
}

.time-entry-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.column--center {
    text-align: center;
}

.column--day {
    width: 80px;
    text-align: center;
}

.column--total {
    width: 100px;
    text-align: right;
}

.column--action {
    width: 50px;
    text-align: center;
}

.day-label {
    font-weight: 700;
}

.date-label {
    font-size: 0.625rem;
}

.hours-input input {
    width: 100%;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 0.125rem;
    padding: 0.25rem;
}

.total-hours-value {
    font-weight: 700;
}

.icon-button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--zinc-400);
    padding: 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.icon-button:hover {
    color: var(--accent-color);
}

.icon-button.danger:hover {
    color: var(--status-error-color);
}

.comment-textarea,
.day-comment-textarea {
    width: 100%;
    border: 1px solid var(--input-border-color);
    border-radius: 0.125rem;
    padding: 0.5rem;
    font-size: 0.75rem;
    font-family: inherit;
    resize: vertical;
    background: var(--input-background-color);
    color: var(--text-color-primary);
}

.day-comment-textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    background: var(--input-background-color);
}

.font-bold {
    font-weight: 700;
}

.text-right {
    text-align: right;
}

.time-report-page {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
    max-width: 100%;
}

.time-report-page .time-report-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.time-report-page .time-report-summary {
    margin-bottom: 0;
}

.time-report-page .summary-card,
.time-report-page .time-report-container,
.time-report-page .weekly-report {
    border-radius: 0.5rem;
    box-shadow: 0 10px 20px -18px var(--card-shadow-color), 0 1px 2px var(--card-shadow-color-secondary);
    background: var(--content-background-color);
    color: var(--text-color-primary);
    min-width: 0;
    max-width: 100%;
}

.time-report-page .summary-card {
    min-height: 188px;
    background: var(--content-background-color);
}

.time-report-page .time-report-summary .summary-card:first-child {
    background: var(--content-background-color);
    border-color: var(--border-color);
}

.time-report-page .time-report-summary .summary-card:first-child .summary-card__title {
    color: var(--text-color-secondary);
    opacity: 1;
}

.time-report-page .time-report-summary .summary-card:first-child .hours-large {
    color: var(--text-color-primary);
}

.time-report-page .time-report-summary .summary-card:first-child .hours-separator {
    color: var(--text-color-secondary);
    opacity: 0.7;
}

.time-report-page .time-report-summary .summary-card:first-child .hours-planned {
    color: var(--text-color-secondary);
    opacity: 0.9;
}

.time-report-page .time-report-summary .summary-card:first-child .progress-bar-container {
    background: var(--border-color);
}

.time-report-page .time-report-summary .summary-card:first-child .progress-bar {
    background: var(--accent-color);
}

.time-report-page .time-report-summary .summary-card:first-child .missing-hours {
    color: var(--status-error-color);
    font-weight: 600;
}

.time-report-page .summary-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.time-report-page .summary-card.ai-insights {
    background: linear-gradient(135deg, #7f1d1d 0%, #b21f1f 52%, #f59e0b 100%);
}

.time-report-page .summary-card.ai-insights p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.92);
}

.time-report-page .calendar-view {
    min-width: 0;
}

.time-report-page .calendar-header {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
}

.time-report-page .calendar-header span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-color-secondary);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.time-report-page .calendar-row {
    margin-bottom: 0.5rem;
}

.time-report-page .week-number {
    color: var(--text-color-secondary);
    font-size: 0.75rem;
    min-width: 0;
}

.time-report-page .calendar-header,
.time-report-page .calendar-row {
    grid-template-columns: 2.5rem repeat(7, minmax(0, 1fr));
    min-width: 0;
}

.time-report-page .calendar-day {
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    min-height: 0;
    min-width: 0;
    aspect-ratio: 1;
    background: var(--content-background-color);
    color: var(--text-color-primary);
    overflow: hidden;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.time-report-page .calendar-day.empty {
    border: none;
    background: transparent;
}

.time-report-page .calendar-day:hover:not(.empty) {
    box-shadow: none;
}

.time-report-page .calendar-day.selected {
    outline: 2px solid var(--accent-color);
    outline-offset: -2px;
    box-shadow: none;
}

.time-report-page .day-number {
    background: transparent;
    border: none;
}

.time-report-page .day-hours {
    font-size: 0.8rem;
}

.time-report-page .holiday-name {
    left: auto;
    transform: none;
    width: 90%;
    background: transparent;
    border-radius: 0;
    padding: 0;
}

.time-report-page .calendar-day.day-full,
.time-report-page .legend-swatch.day-full {
    background: var(--status-success-bg);
    border-color: var(--status-success-color);
}

.time-report-page .calendar-day.day-partial,
.time-report-page .legend-swatch.day-partial {
    background: var(--status-info-bg);
    border-color: var(--status-info-color);
}

.time-report-page .calendar-day.day-missing,
.time-report-page .legend-swatch.day-missing {
    background: var(--status-error-bg);
    border-color: var(--status-error-color);
}

.time-report-page .weekly-report__header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.time-report-page .table-container {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
}

.time-report-page .time-entry-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--collection-header-background);
    color: var(--collection-header-text-color);
}

.time-report-page .time-entry-table td {
    color: var(--text-color-primary);
}

.time-report-page .time-entry-table tbody tr:hover td {
    background: var(--collection-row-hover-background);
}

.time-report-page .time-entry-table tfoot td {
    background: var(--list-item-background-color-secondary);
}

.time-report-page .hours-input input {
    border-radius: 0.35rem;
    padding: 0.4rem 0.25rem;
    font-weight: 600;
    font-size: 0.8125rem;
    background: var(--input-background-color);
    color: var(--text-color-primary);
    border-color: var(--input-border-color);
}

.time-report-page .hours-input input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--focus-shadow-color);
}

.time-report-page .icon-button {
    border-radius: 0.35rem;
    transition: color 0.18s ease, background-color 0.18s ease;
}

.time-report-page .icon-button:hover {
    background: var(--button-hover-background-color);
}

.time-report-page .icon-button.danger:hover {
    background: rgba(220, 38, 38, 0.12);
}

/* Currency Pages */
.content-container.currency-page {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.25rem;
    box-shadow: 0 10px 20px -18px rgba(15, 23, 42, 0.4), 0 1px 2px rgba(15, 23, 42, 0.08);
}

.content-container.currency-page h1 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.currency-list-view {
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    overflow: hidden;
    background: #ffffff;
}

.currency-list-page .currency-list-view a {
    color: var(--accent-color);
    font-weight: 600;
    text-decoration: none;
}

.currency-list-page .currency-list-view a:hover {
    text-decoration: underline;
}

.currency-page__actions {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

.currency-details-page .properties-container {
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    overflow: hidden;
    background: #ffffff;
}

.currency-details-page .property {
    margin: 0;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #edf2f7;
}

.currency-details-page .property:last-child {
    border-bottom: none;
}

.currency-details-page .property__name {
    color: #64748b;
    font-size: 0.8125rem;
}

.currency-details-page .property__value {
    color: #0f172a;
    font-weight: 600;
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .time-report-summary {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .time-report-page .time-report-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .time-report-page .time-report-container,
    .time-report-page .weekly-report,
    .time-report-page .summary-card {
        padding: 0.75rem;
    }

    .time-report-page .calendar-header,
    .time-report-page .calendar-row {
        grid-template-columns: 1.15rem repeat(7, minmax(0, 1fr));
        gap: 0.15rem;
        font-size: 0.7rem;
    }

    .time-report-page .week-number {
        font-size: 0.6rem;
    }

    .time-report-page .calendar-day {
        aspect-ratio: auto;
        min-height: 2.35rem;
        padding: 0.1rem;
        align-items: center;
        justify-content: center;
    }

    .time-report-page .day-number {
        position: static;
        min-width: 0;
        min-height: 0;
        font-size: 0.7rem;
    }

    .time-report-page .day-hours,
    .time-report-page .holiday-name {
        display: none;
    }

    .time-report-page .weekly-report .table-container {
        overflow: visible;
        border: none;
    }

    .time-report-page .weekly-report .time-entry-table thead {
        display: none;
    }

    .time-report-page .weekly-report .time-entry-table,
    .time-report-page .weekly-report .time-entry-table tbody,
    .time-report-page .weekly-report .time-entry-table tfoot {
        display: block;
        width: 100%;
    }

    .time-report-page .weekly-report .time-entry-table tr {
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 0.35rem 0.2rem;
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--border-color);
    }

    .time-report-page .weekly-report .time-entry-table td {
        display: block;
        width: auto;
        min-width: 0;
        padding: 0;
        border: none;
        background: transparent;
    }

    .time-report-page .weekly-report .time-entry-table tbody tr:not(.comment-row) > td:nth-child(1),
    .time-report-page .weekly-report .time-entry-table tbody tr:not(.comment-row) > td:nth-child(2),
    .time-report-page .weekly-report .time-entry-table tfoot td:nth-child(1),
    .time-report-page .weekly-report .time-entry-table tfoot td:nth-child(2) {
        grid-column: 1 / -1;
    }

    .time-report-page .weekly-report .time-entry-table tbody tr:not(.comment-row) > td.column--center {
        grid-column: 1 / 3;
        grid-row: 3;
    }

    .time-report-page .weekly-report .time-entry-table tbody tr:not(.comment-row) > td.column--total {
        grid-column: 4 / 7;
        grid-row: 3;
        align-self: center;
        text-align: right;
    }

    .time-report-page .weekly-report .time-entry-table tbody tr:not(.comment-row) > td.column--action {
        grid-column: 7;
        grid-row: 3;
        justify-self: end;
    }

    .time-report-page .weekly-report .time-entry-table tbody tr:not(.comment-row) > td.column--day:nth-child(4) { grid-column: 1; grid-row: 4; }
    .time-report-page .weekly-report .time-entry-table tbody tr:not(.comment-row) > td.column--day:nth-child(5) { grid-column: 2; grid-row: 4; }
    .time-report-page .weekly-report .time-entry-table tbody tr:not(.comment-row) > td.column--day:nth-child(6) { grid-column: 3; grid-row: 4; }
    .time-report-page .weekly-report .time-entry-table tbody tr:not(.comment-row) > td.column--day:nth-child(7) { grid-column: 4; grid-row: 4; }
    .time-report-page .weekly-report .time-entry-table tbody tr:not(.comment-row) > td.column--day:nth-child(8) { grid-column: 5; grid-row: 4; }
    .time-report-page .weekly-report .time-entry-table tbody tr:not(.comment-row) > td.column--day:nth-child(9) { grid-column: 6; grid-row: 4; }
    .time-report-page .weekly-report .time-entry-table tbody tr:not(.comment-row) > td.column--day:nth-child(10) { grid-column: 7; grid-row: 4; }

    .time-report-page .weekly-report .time-entry-table td.column--day::before {
        content: attr(data-day);
        display: block;
        margin-bottom: 0.15rem;
        font-size: 0.625rem;
        font-weight: 700;
        text-align: center;
        color: var(--text-color-secondary);
    }

    .time-report-page .weekly-report .time-entry-table tr.comment-row > td:first-child,
    .time-report-page .weekly-report .time-entry-table tr.comment-row > td:last-child,
    .time-report-page .weekly-report .time-entry-table tfoot td:last-child:empty {
        display: none;
    }

    .time-report-page .weekly-report .time-entry-table tr.comment-row > td.column--day:nth-child(2) { grid-column: 1; }
    .time-report-page .weekly-report .time-entry-table tr.comment-row > td.column--day:nth-child(3) { grid-column: 2; }
    .time-report-page .weekly-report .time-entry-table tr.comment-row > td.column--day:nth-child(4) { grid-column: 3; }
    .time-report-page .weekly-report .time-entry-table tr.comment-row > td.column--day:nth-child(5) { grid-column: 4; }
    .time-report-page .weekly-report .time-entry-table tr.comment-row > td.column--day:nth-child(6) { grid-column: 5; }
    .time-report-page .weekly-report .time-entry-table tr.comment-row > td.column--day:nth-child(7) { grid-column: 6; }
    .time-report-page .weekly-report .time-entry-table tr.comment-row > td.column--day:nth-child(8) { grid-column: 7; }

    .time-report-page .weekly-report .time-entry-table tfoot td.column--day:nth-child(3) { grid-column: 1; }
    .time-report-page .weekly-report .time-entry-table tfoot td.column--day:nth-child(4) { grid-column: 2; }
    .time-report-page .weekly-report .time-entry-table tfoot td.column--day:nth-child(5) { grid-column: 3; }
    .time-report-page .weekly-report .time-entry-table tfoot td.column--day:nth-child(6) { grid-column: 4; }
    .time-report-page .weekly-report .time-entry-table tfoot td.column--day:nth-child(7) { grid-column: 5; }
    .time-report-page .weekly-report .time-entry-table tfoot td.column--day:nth-child(8) { grid-column: 6; }
    .time-report-page .weekly-report .time-entry-table tfoot td.column--day:nth-child(9) { grid-column: 7; }

    .time-report-page .weekly-report .time-entry-table tfoot td.column--total {
        grid-column: 1 / -1;
        text-align: right;
    }
}

@media (max-width: 640px) {
    .summary-card {
        padding: 1rem;
    }

    .hours-large {
        font-size: 1.75rem;
    }
}

/* PublicLayout: sidbakgrund — gradient på body så mörk theme-body inte blir helt platt yta */
body#app-body.erp:has(.public-layout) {
    min-height: 100vh;
    background:
        radial-gradient(ellipse 100% 65% at 50% 0%, rgba(245, 158, 11, 0.16) 0%, transparent 50%),
        radial-gradient(ellipse 80% 50% at 100% 100%, rgba(99, 102, 241, 0.12) 0%, transparent 50%),
        linear-gradient(145deg, #0b0a10 0%, #1a1525 40%, #120e18 100%);
}

.erp .public-layout {
    min-height: 100vh;
    background: transparent;
}

/* Party selector (modal search, mirrors Ledger account-selector) */
.party-selector {
    width: 100%;
    min-width: 0;
}

.party-selector__trigger {
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    border: 1px solid var(--input-border-color);
    border-radius: 4px;
    background: var(--input-background-color);
    cursor: pointer;
    font: inherit;
    color: var(--text-color-primary);
}

.party-selector__trigger:hover:not(:disabled) {
    border-color: var(--border-color-dark);
    background: var(--button-hover-background-color);
}

.party-selector__trigger:focus-visible {
    outline: 2px solid var(--input-focus-border-color);
    outline-offset: 2px;
}

.party-selector__trigger:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.party-selector__selected {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
}

.party-selector__selected-name {
    font-weight: 500;
}

.party-selector__selected-meta,
.party-selector__selected-type {
    font-size: 0.85rem;
    color: var(--text-color-secondary);
}

.party-selector__placeholder {
    color: var(--text-color-tertiary);
}

.party-selector-modal__search {
    margin-bottom: 16px;
}

.party-selector-modal__search-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-color-secondary);
}

.party-selector-modal__search-input {
    width: 100%;
    box-sizing: border-box;
}

.party-selector-modal__list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.party-selector-modal__list--scroll {
    max-height: min(50vh, 360px);
    overflow-y: auto;
    padding-right: 4px;
}

.party-selector-modal__row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px 12px;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--list-item-background-color-primary);
    cursor: pointer;
    font: inherit;
    color: var(--text-color-primary);
}

.party-selector-modal__row:hover {
    background: var(--button-hover-background-color);
    border-color: var(--border-color-dark);
}

.party-selector-modal__row:focus-visible {
    outline: 2px solid var(--input-focus-border-color);
    outline-offset: 2px;
}

.party-selector-modal__row-name {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 500;
}

.party-selector-modal__row-meta,
.party-selector-modal__row-type {
    flex-shrink: 0;
    font-size: 0.875rem;
    color: var(--text-color-secondary);
}

.party-selector-modal__empty-hint {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-color-tertiary);
}

.party-selector-modal__actions {
    margin-top: 16px;
}

/* Product selector (modal search, mirrors party-selector) */
.product-selector {
    width: 100%;
    min-width: 0;
}

.product-selector__trigger {
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    border: 1px solid var(--input-border-color);
    border-radius: 4px;
    background: var(--input-background-color);
    cursor: pointer;
    font: inherit;
    color: var(--text-color-primary);
}

.product-selector__trigger:hover:not(:disabled) {
    border-color: var(--border-color-dark);
    background: var(--button-hover-background-color);
}

.product-selector__trigger:focus-visible {
    outline: 2px solid var(--input-focus-border-color);
    outline-offset: 2px;
}

.product-selector__trigger:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.product-selector__selected {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
}

.product-selector__selected-name {
    font-weight: 500;
}

.product-selector__selected-meta {
    font-size: 0.85rem;
    color: var(--text-color-secondary);
}

.product-selector__placeholder {
    color: var(--text-color-tertiary);
}

.product-selector-modal__search {
    margin-bottom: 16px;
}

.product-selector-modal__search-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-color-secondary);
}

.product-selector-modal__search-input {
    width: 100%;
    box-sizing: border-box;
}

.product-selector-modal__list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-selector-modal__list--scroll {
    max-height: min(50vh, 360px);
    overflow-y: auto;
    padding-right: 4px;
}

.product-selector-modal__row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px 12px;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--list-item-background-color-primary);
    cursor: pointer;
    font: inherit;
    color: var(--text-color-primary);
}

.product-selector-modal__row:hover {
    background: var(--button-hover-background-color);
    border-color: var(--border-color-dark);
}

.product-selector-modal__row:focus-visible {
    outline: 2px solid var(--input-focus-border-color);
    outline-offset: 2px;
}

.product-selector-modal__row-code {
    font-weight: 600;
    flex-shrink: 0;
}

.product-selector-modal__row-name {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 500;
}

.product-selector-modal__row-meta {
    flex-shrink: 0;
    font-size: 0.875rem;
    color: var(--text-color-secondary);
}

.product-selector-modal__empty-hint {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-color-tertiary);
}

.product-selector-modal__actions {
    margin-top: 16px;
}

/* Organization chart */
.organization-page__description {
    margin: 0 0 24px;
    color: var(--text-color-secondary);
}

.org-chart {
    overflow-x: auto;
    padding: 16px 0 32px;
}

.org-chart ul {
    display: flex;
    justify-content: center;
    padding-top: 20px;
    position: relative;
    margin: 0;
}

.org-chart > ul {
    padding-top: 0;
}

.org-chart li {
    display: flex;
    flex-direction: column;
    align-items: center;
    list-style-type: none;
    position: relative;
    padding: 20px 8px 0;
    text-align: center;
}

.org-chart li::before,
.org-chart li::after {
    content: '';
    position: absolute;
    top: 0;
    right: 50%;
    width: 50%;
    height: 20px;
    border-top: 1px solid var(--border-color);
}

.org-chart li::after {
    right: auto;
    left: 50%;
    border-left: 1px solid var(--border-color);
}

.org-chart li:only-child::before,
.org-chart li:only-child::after {
    display: none;
}

.org-chart li:first-child::before,
.org-chart li:last-child::after {
    border: 0 none;
}

.org-chart li:last-child::before {
    border-right: 1px solid var(--border-color);
    border-radius: 0 5px 0 0;
}

.org-chart li:first-child::after {
    border-radius: 5px 0 0 0;
}

.org-chart__children > li::before {
    border-left: 1px solid var(--border-color);
}

.org-chart__branch > .org-chart__children::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 20px;
    border-left: 1px solid var(--border-color);
}

.org-chart__branch {
    position: relative;
}

.org-chart__card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 140px;
    max-width: 220px;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background-color: var(--content-background-color);
    box-shadow: 0 1px 3px var(--shadow-color);
    position: relative;
    z-index: 1;
}

.org-chart__card--current {
    border-color: var(--nano-product-color);
    box-shadow: 0 0 0 1px var(--nano-product-color);
}

.org-chart__link,
.org-chart__label {
    color: var(--text-color-primary);
    font-weight: 600;
    text-decoration: none;
    word-break: break-word;
}

.org-chart__link:hover {
    color: var(--nano-product-color);
    text-decoration: underline;
}

.org-chart__add {
    display: inline-flex;
    flex: 0 0 auto;
    color: var(--text-color-secondary, var(--text-color-primary));
    line-height: 0;
}

.org-chart__add:hover {
    color: var(--nano-product-color);
}