/* ===================================
   PM - Component Styles
   =================================== */

/* Global Users view */
.user-projects {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 320px;
}

.user-project-chip {
    display: inline-flex;
    padding: 2px 8px;
    background: var(--bg-secondary, #f1f5f9);
    border-radius: 100px;
    font-size: var(--font-size-xs);
    color: var(--text-secondary, #475569);
}

.user-actions {
    white-space: nowrap;
    display: flex;
    gap: 6px;
    align-items: center;
}

.form-check-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
    padding: 8px 0;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: var(--font-size-sm);
}

.form-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Component Badge (for individual component statuses) */
.component-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: var(--font-size-xs);
    font-weight: 500;
    border-radius: 100px;
    text-transform: capitalize;
}

.component-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.component-badge--in-progress {
    background: rgba(59, 130, 246, 0.1);
    color: var(--component-in-progress);
}

.component-badge--awaited {
    background: rgba(245, 158, 11, 0.1);
    color: var(--component-awaited);
}

.component-badge--in-approval {
    background: rgba(139, 92, 246, 0.1);
    color: var(--component-in-approval);
}

.component-badge--complete {
    background: rgba(34, 197, 94, 0.1);
    color: var(--component-complete);
}

/* Progress Badge (colored by progress level) */
.progress-badge-colored {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    border-radius: 100px;
}

.progress-badge-colored::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.progress-badge-colored--progress-none {
    background: rgba(239, 68, 68, 0.1);
    color: var(--progress-none);
}

.progress-badge-colored--progress-partial {
    background: rgba(245, 158, 11, 0.1);
    color: var(--progress-partial);
}

.progress-badge-colored--progress-most {
    background: rgba(59, 130, 246, 0.1);
    color: var(--progress-most);
}

.progress-badge-colored--progress-complete {
    background: rgba(34, 197, 94, 0.1);
    color: var(--progress-complete);
}

/* Component Grid — stack of compact cards in a CSS grid */
.component-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.component-grid__row {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    padding-right: 32px;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
    min-width: 0;
}

.component-grid__row-meta {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: 2px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

.component-grid__label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.25;
    word-break: break-word;
}

.component-grid__value {
    width: 100%;
    min-width: 0;
}

.component-grid__value select {
    width: 100%;
}

.form-select--sm {
    padding: 6px 10px;
    font-size: var(--font-size-sm);
}

/* Assignee chips & inline assign select */
.component-grid__assignees {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.assignee-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 4px 2px 2px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: var(--font-size-xs);
    color: var(--text-primary);
    line-height: 1;
}

.assignee-chip__initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    font-size: 9px;
    font-weight: 700;
    border-radius: 50%;
    letter-spacing: 0;
}

.assignee-chip__name {
    padding-right: 4px;
    font-weight: 500;
}

.assignee-chip__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
}

.assignee-chip__remove:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.form-select--inline,
.form-input--inline {
    width: auto;
    min-width: 120px;
    padding: 5px 8px;
    font-size: var(--font-size-sm);
}

/* Date input inside the component card needs a slightly larger footprint
   so the YYYY-MM-DD digits + picker icon don't get clipped. */
.component-grid__due input[type="date"].form-input--inline {
    min-width: 140px;
    font-size: var(--font-size-sm);
}

/* Due date block */
.component-grid__due {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.component-grid__due input[type="date"] {
    flex: 1;
    min-width: 0;
}

.component-grid__due-label {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.component-grid__due--overdue {
    color: var(--danger);
    font-weight: 600;
}

.component-grid__due--overdue input[type="date"] {
    border-color: var(--danger);
}

/* Filter toggles (My Work / Overdue) */
.filter-toggle {
    padding: 7px 12px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    background: var(--bg-primary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    font-family: inherit;
}

.filter-toggle:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.filter-toggle--active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

/* Overdue badge (used in list rows + dashboard) */
.overdue-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    margin-left: 6px;
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    font-size: 10px;
    font-weight: 600;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    vertical-align: middle;
}

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

/* My Tasks: complete rows fade so open work draws the eye first */
.mywork-row--complete {
    opacity: 0.55;
}
.mywork-row--complete:hover {
    opacity: 1;
}

/* Settings view */
.settings-view {
    max-width: 980px;
    margin: 0 auto;
}

.settings-card {
    margin-bottom: var(--space-lg);
}

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

.settings-inline .form-input {
    flex: 1;
    min-width: 160px;
}

.settings-view .table input.form-input--inline {
    min-width: 120px;
    font-size: var(--font-size-sm);
}

/* Project switcher (header) */
.project-switcher {
    position: relative;
    margin-left: var(--space-sm);
}

.project-switcher--static {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    padding: 4px 10px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
}

.project-switcher__button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    font-family: inherit;
    max-width: 220px;
}

.project-switcher__button:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-dark);
}

.project-switcher__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-switcher__chevron {
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1;
}

.project-switcher__menu {
    min-width: 240px;
    left: 0;
    margin-top: 6px;
}

.project-switcher__item {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.project-switcher__item--current {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

.project-switcher__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-switcher__role {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.project-switcher__create {
    color: var(--accent);
    font-weight: 500;
}

@media (max-width: 768px) {
    .project-switcher__button {
        max-width: 140px;
        font-size: var(--font-size-xs);
        padding: 4px 8px;
    }
    .project-switcher__menu {
        min-width: 200px;
    }
}

/* Tasks tab — filter row */
.tasks-filter-bar {
    gap: var(--space-md);
}

.tasks-filter-bar .filter-bar__select {
    min-width: 200px;
    max-width: 240px;
}

.tasks-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.tasks-filter-chips .filter-toggle {
    padding: 5px 10px;
    font-size: var(--font-size-xs);
}

/* Keep-style checklist */
.checklist-card {
    padding: 8px 0;
}

.checklist-section__title {
    padding: 10px 20px 6px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.checklist-section__title--done {
    border-top: 1px solid var(--border);
    margin-top: 8px;
    padding-top: 14px;
}

.checklist-section__title--awaiting {
    color: var(--color-warning, #b45309);
}

.checklist-section__title--awaiting .checklist-section__count {
    background: var(--color-warning-bg, #fef3c7);
    color: var(--color-warning, #92400e);
}

.checklist-section__hint {
    margin-left: auto;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

.checklist-item--awaiting {
    background: var(--color-warning-bg, #fffbeb);
}

.checklist-item__reopen {
    margin-left: auto;
    align-self: center;
    flex-shrink: 0;
}

.checklist-item__approvers {
    display: block;
    margin-top: 4px;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.checklist-section__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 0 6px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 100px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0;
}

.checklist {
    list-style: none;
    padding: 0;
    margin: 0;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background 0.12s ease;
}

.checklist-item:hover {
    background: var(--bg-secondary);
}

.checklist-item__checkbox {
    flex-shrink: 0;
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    border: 2px solid var(--border-dark);
    border-radius: 50%;
    background: var(--bg-primary);
    cursor: pointer;
    position: relative;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.checklist-item__checkbox:hover {
    border-color: var(--accent);
}

.checklist-item__checkbox:checked {
    border-color: var(--accent);
    background: var(--accent);
}

.checklist-item__checkbox:checked::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checklist-item__checkbox:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
}

.checklist-item__checkbox:disabled {
    opacity: 0.5;
    cursor: wait;
}

.checklist-item__content {
    flex: 1;
    min-width: 0;
}

.checklist-item__label {
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.3;
}

.checklist-item__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

.checklist-item__inst code {
    font-size: 10px;
    color: var(--text-muted);
    margin-left: 4px;
}

.checklist-item__due--overdue {
    color: var(--danger);
    font-weight: 600;
}

/* Done items: faded + struck through */
.checklist-item--done .checklist-item__label {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.checklist--done-list .checklist-item {
    opacity: 0.6;
}

.checklist--done-list .checklist-item:hover {
    opacity: 1;
}

.checklist-empty {
    padding: 32px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.checklist-empty__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0 auto 8px;
    background: var(--bg-secondary);
    color: var(--text-muted);
    border-radius: 50%;
    font-size: 22px;
    font-weight: 600;
}

.checklist-empty--small {
    padding: 12px 20px;
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    font-style: italic;
}

/* Owners cluster shown beneath the installation name in the list view */
.row-owners {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.row-owners__more {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    font-weight: 500;
    border-radius: 100px;
}

.component-grid__remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s ease, color 0.15s ease;
}

.component-grid__remove:hover {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
}

.component-grid__empty {
    grid-column: 1 / -1;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    font-style: italic;
    padding: 12px;
    text-align: center;
    border: 1px dashed var(--border);
    border-radius: var(--border-radius);
}

.component-grid__add {
    grid-column: 1 / -1;
    margin-top: 4px;
    padding: 10px 12px;
    border: 1px dashed var(--border);
    border-radius: var(--border-radius);
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.component-grid__add select {
    width: 100%;
}

.component-grid__custom {
    display: flex;
    gap: 8px;
    align-items: center;
}

.component-grid__custom input {
    flex: 1;
}

/* Priority Badge */
.priority-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: var(--font-size-xs);
    font-weight: 500;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.priority-badge--high {
    background: rgba(239, 68, 68, 0.1);
    color: var(--priority-high);
}

.priority-badge--medium {
    background: rgba(245, 158, 11, 0.1);
    color: var(--priority-medium);
}

.priority-badge--low {
    background: rgba(34, 197, 94, 0.1);
    color: var(--priority-low);
}

/* Progress Bar */
.progress-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar__fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-bar__fill--progress-none {
    background: var(--progress-none);
}

.progress-bar__fill--progress-partial {
    background: var(--progress-partial);
}

.progress-bar__fill--progress-most {
    background: var(--progress-most);
}

.progress-bar__fill--progress-complete {
    background: var(--progress-complete);
}

.progress-bar--sm {
    height: 4px;
}

.progress-bar--lg {
    height: 8px;
}

/* Progress with label */
.progress-group {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.progress-group__bar {
    flex: 1;
}

.progress-group__label {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    min-width: 36px;
    text-align: right;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.96) translateY(8px);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-overlay {
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal--lg {
    max-width: 800px;
}

.modal--sm {
    max-width: 400px;
}

.modal__header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal__title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.modal__close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal__close:hover {
    color: var(--text-primary);
}

.modal__body {
    padding: var(--space-lg);
    overflow-y: auto;
    flex: 1;
}

.modal__footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    background: var(--bg-secondary);
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

/* Sidebar Navigation */
.sidebar-section {
    margin-bottom: var(--space-lg);
}

.sidebar-section__title {
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
    padding: 0 var(--space-sm);
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav__item {
    margin-bottom: 2px;
}

.sidebar-nav__link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--text-secondary);
    border-radius: var(--border-radius);
    transition: background 0.15s ease, color 0.15s ease;
    cursor: pointer;
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.sidebar-nav__link:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    text-decoration: none;
}

.sidebar-nav__link.active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

.sidebar-nav__link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, #6366f1 0%, #4f46e5 100%);
}

.sidebar-nav__count {
    margin-left: auto;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.sidebar-nav__count--alert {
    background: var(--color-warning, #d97706);
    color: #fff;
    padding: 1px 8px;
    border-radius: 100px;
    font-weight: 600;
}

/* Stat Cards */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.stat-card {
    position: relative;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    padding: var(--space-md) var(--space-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-dark);
}

.stat-card:hover::before {
    opacity: 1;
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
}

.stat-card__value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.stat-card__label {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.stat-card--accent .stat-card__value {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-card--accent::before {
    opacity: 1;
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
}

/* Filter Bar */
.filter-bar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px var(--space-md);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
}

.filter-bar__search {
    flex: 1;
    min-width: 200px;
}

.filter-bar__select {
    min-width: 150px;
}

/* Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown__menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.15s ease;
}

.dropdown.active .dropdown__menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(4px);
}

.dropdown__item {
    display: block;
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
}

.dropdown__item:hover {
    background: var(--bg-secondary);
}

.dropdown__divider {
    height: 1px;
    background: var(--border);
    margin: var(--space-xs) 0;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: calc(var(--footer-height) + var(--space-md));
    right: var(--space-lg);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px 14px;
    background: var(--text-primary);
    color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    font-size: var(--font-size-sm);
    font-weight: 500;
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast--success {
    background: var(--success);
}

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

.toast--warning {
    background: var(--warning);
}

/* References List */
.references-list {
    list-style: none;
}

.references-list__item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border);
}

.references-list__item:last-child {
    border-bottom: none;
}

.references-list__icon {
    color: var(--text-muted);
}

.references-list__link {
    flex: 1;
    font-size: var(--font-size-sm);
}

.references-list__type {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Detail Grid */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.detail-grid__item {
    padding: var(--space-sm) 0;
}

.detail-grid__label {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-xs);
}

.detail-grid__value {
    font-size: var(--font-size-base);
    color: var(--text-primary);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--space-lg);
}

.tabs__tab {
    padding: 10px 16px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    margin-bottom: -1px;
    border-radius: 6px 6px 0 0;
}

.tabs__tab:hover {
    color: var(--text-primary);
}

.tabs__tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Action Menu (for table rows) */
.action-menu {
    display: flex;
    gap: var(--space-xs);
}

.action-menu__btn {
    padding: var(--space-xs);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: all 0.15s ease;
}

.action-menu__btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Inline Edit */
.inline-edit {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.inline-edit__value {
    cursor: pointer;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--border-radius);
    transition: background 0.15s ease;
}

.inline-edit__value:hover {
    background: var(--bg-secondary);
}

/* Image Upload Thumbnails */
.image-upload-existing,
.image-upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.image-upload-thumb {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--border);
    cursor: pointer;
}

.image-upload-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-upload-thumb__delete {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.image-upload-thumb:hover .image-upload-thumb__delete {
    display: flex;
}

/* Image Gallery (Detail View) */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.image-gallery__item {
    aspect-ratio: 1;
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.image-gallery__item:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.image-gallery__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox__close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    z-index: 2001;
    padding: 4px 12px;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.lightbox__close:hover {
    opacity: 1;
}

.lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    font-size: 48px;
    cursor: pointer;
    padding: 8px 16px;
    opacity: 0.5;
    transition: opacity 0.15s;
    z-index: 2001;
}

.lightbox__nav:hover {
    opacity: 1;
}

.lightbox__nav--prev {
    left: 8px;
}

.lightbox__nav--next {
    right: 8px;
}

.lightbox__content {
    text-align: center;
    max-width: 90vw;
    max-height: 90vh;
}

.lightbox__image {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--border-radius);
}

.lightbox__info {
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--font-size-sm);
    display: flex;
    justify-content: center;
    gap: 16px;
}

.lightbox__counter {
    font-weight: 500;
}

.lightbox__filename {
    opacity: 0.6;
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
}

/* Login Form */
.login-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-app);
    font-family: var(--font-family);
    overflow: hidden;
}

.login-wrapper::before,
.login-wrapper::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}

.login-wrapper::before {
    width: 480px;
    height: 480px;
    background: rgba(99, 102, 241, 0.18);
    top: -120px;
    left: -120px;
}

.login-wrapper::after {
    width: 420px;
    height: 420px;
    background: rgba(139, 92, 246, 0.15);
    bottom: -120px;
    right: -120px;
}

.login-form {
    position: relative;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-2xl);
    width: 100%;
    max-width: 400px;
    z-index: 1;
}

.login-form__header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.login-form__title {
    font-size: 30px;
    font-weight: 800;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: var(--space-xs);
    letter-spacing: -0.02em;
}

.login-form__subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.login-form__submit {
    width: 100%;
    margin-top: var(--space-md);
    padding: var(--space-sm) var(--space-lg);
}

.login-form__error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-md);
}

/* User Badge */
.user-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
}

.user-badge__name {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.user-badge__role {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    border-radius: 100px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

/* Gantt Chart */
.gantt {
    margin-top: var(--space-md);
    overflow: hidden;
}

.gantt__chart {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--bg-primary);
}

.gantt__labels {
    min-width: 220px;
    max-width: 220px;
    border-right: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--bg-primary);
    z-index: 2;
}

.gantt__labels-header {
    height: 52px;
    display: flex;
    align-items: center;
    padding: 0 var(--space-md);
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.gantt__zone-label {
    height: 28px;
    display: flex;
    align-items: center;
    padding: 0 var(--space-md);
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.gantt__label {
    height: 36px;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 0 var(--space-md);
    font-size: var(--font-size-sm);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.1s ease;
    overflow: hidden;
    white-space: nowrap;
}

.gantt__label:hover {
    background: var(--bg-secondary);
}

.gantt__label-id {
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    flex-shrink: 0;
}

.gantt__label-name {
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
}

.gantt__grid-wrapper {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
}

.gantt__grid {
    min-width: 100%;
}

.gantt__time-header {
    height: 52px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 1;
}

.gantt__months {
    display: flex;
    height: 26px;
    border-bottom: 1px solid var(--border);
}

.gantt__month {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-secondary);
    border-right: 1px solid var(--border);
    overflow: hidden;
    white-space: nowrap;
}

.gantt__weeks {
    display: flex;
    height: 26px;
}

.gantt__week {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--text-muted);
    border-right: 1px solid var(--border);
}

.gantt__rows {
    position: relative;
}

.gantt__zone-row {
    height: 28px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.gantt__row {
    height: 36px;
    position: relative;
    border-bottom: 1px solid var(--border);
}

.gantt__stripe {
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.015);
    pointer-events: none;
}

.gantt__bar {
    position: absolute;
    top: 6px;
    height: 24px;
    border-radius: 4px;
    opacity: 0.85;
    transition: opacity 0.15s ease;
    cursor: pointer;
    z-index: 1;
}

.gantt__bar:hover {
    opacity: 1;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.gantt__bar--actual {
    top: 11px;
    height: 14px;
    opacity: 1;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

/* Bar progress colors */
.gantt__bar--progress-none            { background: var(--progress-none); }
.gantt__bar--progress-partial         { background: var(--progress-partial); }
.gantt__bar--progress-most            { background: var(--progress-most); }
.gantt__bar--progress-complete        { background: var(--progress-complete); }

/* Today line */
.gantt__today {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--danger);
    z-index: 3;
    pointer-events: none;
}

.gantt__today::before {
    content: 'Today';
    position: absolute;
    top: -20px;
    left: -16px;
    font-size: 9px;
    font-weight: 600;
    color: var(--danger);
    white-space: nowrap;
}

/* No Dates Section */
.gantt__no-dates {
    margin-top: var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    background: var(--bg-primary);
}

.gantt__no-dates-title {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.gantt__no-dates-list {
    padding: var(--space-xs) 0;
}

.gantt__no-dates-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-md);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: background 0.1s ease;
}

.gantt__no-dates-item:hover {
    background: var(--bg-secondary);
}

/* Legend */
.gantt__legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    padding: var(--space-md);
    margin-top: var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    background: var(--bg-primary);
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

.gantt__legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.gantt__legend-swatch {
    width: 14px;
    height: 10px;
    border-radius: 2px;
}

.gantt__legend-swatch--progress-none     { background: var(--progress-none); }
.gantt__legend-swatch--progress-partial  { background: var(--progress-partial); }
.gantt__legend-swatch--progress-most     { background: var(--progress-most); }
.gantt__legend-swatch--progress-complete { background: var(--progress-complete); }

.gantt__legend-line {
    width: 14px;
    height: 2px;
    background: var(--danger);
}

/* Zoom Controls */
.gantt__zoom-controls {
    display: flex;
    gap: var(--space-xs);
}

/* Loading Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
