/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-red: #ef5350;
    --primary-red-hover: #e53935;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f1f3f5;
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --border-hover: #cbd5e0;
    --sidebar-width: 240px;
    --header-height: 148px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
}

/* ===== HEADER ===== */
.top-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: opacity 0.2s;
}

.logo-container:hover {
    opacity: 0.8;
}

.logo-badge {
    background: transparent;
    width: 140px;
    height: 140px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    overflow: hidden;
}

.logo-text {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.home-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.home-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.icon-btn {
    background: transparent;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    color: var(--text-secondary);
}

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

.next-level-btn {
    background: var(--primary-red);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.next-level-btn:hover {
    background: var(--primary-red-hover);
}

/* ===== LAYOUT ===== */
.app-layout {
    display: flex;
    height: calc(100vh - var(--header-height));
}

/* ===== SIDEBAR NAVIGATION ===== */
.sidebar-nav {
    width: var(--sidebar-width);
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    padding: 16px 0;
    overflow-y: auto;
}

.nav-menu {
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    font-weight: 500;
}

.nav-item svg {
    flex-shrink: 0;
}

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

.nav-item.active {
    background: #fff5f5;
    color: var(--primary-red);
    border-left-color: var(--primary-red);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-secondary);
}

.view-container {
    display: none;
    padding: 24px;
}

.view-container.active {
    display: block;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.view-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-left: auto;
}

.view-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.create-btn {
    background: linear-gradient(180deg, #ef5350 0%, #e53935 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 6px rgba(229, 57, 53, 0.28);
    transition: filter 0.15s, transform 0.1s, box-shadow 0.15s;
}

.create-btn:hover {
    filter: brightness(1.06);
    box-shadow: 0 4px 12px rgba(229, 57, 53, 0.35);
}

.create-btn:active {
    transform: translateY(1px);
}

.create-btn--nonfacade {
    background: #1a6b3a;
}
.create-btn--nonfacade:hover {
    background: #145530;
}

/* ===== TABS ===== */
.tabs-container {
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
}

.tabs {
    display: flex;
    gap: 32px;
}

.tab {
    background: none;
    border: none;
    padding: 12px 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

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

.tab.active {
    color: var(--primary-red);
    border-bottom-color: var(--primary-red);
}

/* ===== PROJECTS GRID ===== */
.projects-grid {
    display: block;
    width: 100%;
}

.project-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.project-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
}

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.project-number {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.project-menu-btn {
    background: none;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

.project-menu-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.project-image {
    width: 100%;
    aspect-ratio: 1;
    margin-bottom: 16px;
    border-radius: 8px;
    overflow: hidden;
    background: #1a3a5c;
}

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

.project-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.project-job-no {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.project-workflow {
    display: inline-block;
    padding: 4px 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.projects-table-wrap {
    overflow-x: auto;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.projects-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1000px;
}

.projects-table th,
.projects-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    vertical-align: top;
    font-size: 13px;
}

.projects-table th {
    background: #f8fafc;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: 700;
}

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

.project-row-actions .btn-compact {
    border-radius: 7px;
    font-weight: 700;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.projects-table tbody tr:hover {
    background: #fafbfc;
}

.projects-table .btn-primary.btn-compact {
    background: linear-gradient(180deg, #ef5350 0%, #e53935 100%);
}

.projects-table .btn-secondary.btn-compact:hover {
    border-color: #ef5350;
    color: #c62828;
}

.project-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
}

.project-status-msg {
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.35;
}

.status-ok {
    background: #ecfdf3;
    color: #15803d;
    border-color: #bbf7d0;
}

.status-missing {
    background: #fff7ed;
    color: #c2410c;
    border-color: #fed7aa;
}

.status-mismatch {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.status-outdated {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.dashboard-package-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.project-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.project-card-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, transform 0.2s;
}

.project-card-item:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.10);
    transform: translateY(-2px);
}

.project-card-banner {
    position: relative;
    width: 100%;
    height: 210px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.project-card-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.project-card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
}

.project-card-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.project-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.project-card-sub {
    font-size: 13px;
    color: var(--text-secondary);
}

.project-card-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.project-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.dashboard-package-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dashboard-package-banner {
    width: 100%;
    height: 160px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.dashboard-package-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dashboard-package-main {
    padding: 16px;
    flex: 1;
    min-width: 0;
}

.dashboard-package-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.dashboard-package-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.dashboard-package-sub {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

.dashboard-package-stats {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-secondary);
}

.dashboard-package-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

.project-validation-notice {
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.project-validation-text {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ===== LOAD PROJECT WORKSPACE MODAL ===== */
.load-project-modal.active {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
}

.modal-dialog.modal-workspace {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    margin: 0;
}

.load-project-modal .modal-header {
    padding: 14px 20px;
    flex-shrink: 0;
}

.load-project-modal .modal-body.lpw-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 14px 18px;
}

.load-project-modal .modal-footer {
    flex-shrink: 0;
}

.lpw-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8fafc;
}

.lpw-main-tabs {
    display: flex;
    gap: 6px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 6px;
    flex-shrink: 0;
}

.lpw-main-tab {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
}

.lpw-main-tab:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.lpw-main-tab.active {
    background: #ef5350;
    color: #fff;
}

.lpw-panel {
    flex: 1;
    min-height: 0;
    display: none;
    flex-direction: column;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
}

.lpw-panel.active {
    display: flex;
}

.lpw-panel[hidden] {
    display: none !important;
}

.lpw-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 12px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.lpw-toolbar-actions .btn-compact {
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.lpw-sample-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
}

.lpw-sample-link:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1e40af;
}

.lpw-sub-tabs {
    display: flex;
    gap: 6px;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 4px;
}

.lpw-sub-tab {
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
}

.lpw-sub-tab.active {
    background: #fff;
    color: #ef5350;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.lpw-toolbar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.lpw-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.lpw-muted {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 12px;
}

.lpw-table-wrap {
    flex: 1;
    min-height: 0;
    overflow: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.lpw-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.lpw-table th,
.lpw-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    font-size: 13px;
}

.lpw-table th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    z-index: 1;
}

.lpw-table input.form-input {
    padding: 6px 8px;
    font-size: 12px;
}

.lpw-hint {
    font-size: 12px;
    color: var(--text-muted);
}

.lpw-empty {
    padding: 24px;
}

.lpw-footer {
    justify-content: flex-end;
}

.lpw-table-wide {
    min-width: 1400px;
}

/* ===== Payment Report ===== */
.lpw-report-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: auto;
}

.lpw-report-title {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--text-color, #1f2937);
}

.lpw-report-table th,
.lpw-report-table td {
    text-align: center;
    white-space: nowrap;
}

.lpw-report-table .lpw-cell-left {
    text-align: left;
}

.lpw-report-table tfoot td,
.lpw-report-total td {
    font-weight: 700;
    background: #f1f5f9;
}

.lpw-report-cert {
    min-width: 520px;
}

.lpw-report-cert td,
.lpw-report-cert th {
    padding: 8px 12px;
}

/* BOQ revision-tracking columns: hidden on the Original view */
#lpwBoqTable.boq-hide-rev .lpw-rev-col {
    display: none;
}

/* BOQ mark-for-delete checkbox column */
#lpwBoqTable .lpw-mark-col {
    width: 34px;
    text-align: center;
    padding-left: 4px;
    padding-right: 4px;
}
#lpwBoqTable .lpw-mark-col input[type="checkbox"] {
    cursor: pointer;
}
#lpwBoqTable.boq-hide-mark .lpw-mark-col {
    display: none;
}

/* Serial-number (S/N) column shared by the workspace tables */
.lpw-table .lpw-sn-col {
    width: 40px;
    text-align: center;
    color: #6b7280;
    font-weight: 600;
    white-space: nowrap;
}

.boq-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

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

.lpw-meta-card {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 10px;
}

.lpw-meta-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.lpw-meta-value {
    margin-top: 2px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.project-progress {
    margin-top: 12px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s;
}

/* ===== WORKFLOWS LIST ===== */
.workflows-list {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.workflow-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}

.workflow-item:last-child {
    border-bottom: none;
}

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

.workflow-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.workflow-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
}

.workflow-item-actions {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

/* ===== DIRECTORY TABLE ===== */
.directory-table {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.directory-header {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1fr 0.8fr 1.4fr;
    gap: 16px;
    padding: 12px 20px;
    background: var(--bg-tertiary);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.directory-row {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1fr 0.8fr 1.4fr;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
}

.directory-header--with-actions,
.directory-row--with-actions {
    grid-template-columns: 2fr 1.2fr 1fr 0.8fr 1.4fr 1.1fr;
}

.directory-row:last-child {
    border-bottom: none;
}

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

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-email {
    font-size: 14px;
    color: var(--text-primary);
}

.user-name {
    font-size: 14px;
    color: var(--text-primary);
}

.user-role {
    font-size: 14px;
    color: var(--text-secondary);
}

.user-status {
    font-size: 14px;
    color: #10b981;
}

/* ===== ROLES TABLE ===== */
.roles-table {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.roles-header {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 16px;
    padding: 12px 20px;
    background: var(--bg-tertiary);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-row {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 16px;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    align-items: start;
}

.roles-header--with-actions,
.role-row--with-actions {
    grid-template-columns: 1fr 2.4fr 1fr;
}

.role-row:last-child {
    border-bottom: none;
}

.role-name-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.role-icon {
    width: 32px;
    height: 32px;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.role-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.role-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== MODALS ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.update-progress-modal.active {
    align-items: stretch;
    justify-content: flex-start;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal-dialog {
    position: relative;
    background: var(--bg-primary);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

.modal-dialog.modal-lg {
    max-width: 700px;
}

.update-progress-drawer {
    width: min(440px, 94vw);
    max-width: min(440px, 94vw);
    height: 100vh;
    max-height: 100vh;
    border-radius: 0 16px 16px 0;
    box-shadow: 16px 0 36px rgba(15, 23, 42, 0.22);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    cursor: move;
    user-select: none;
}

.modal-header.is-dragging {
    cursor: grabbing;
}

.modal-header .modal-close {
    cursor: pointer;
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    line-height: 1;
}
.btn-sm svg { display: block; }

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

.modal-close {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.update-progress-modal .modal-header {
    padding: 18px 20px;
}

.update-progress-modal .modal-body {
    padding: 18px 20px;
    background: #f8fafc;
}

.update-progress-modal .modal-footer {
    padding: 14px 20px 18px;
    background: #fff;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(239, 83, 80, 0.1);
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

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

.form-checkbox span {
    font-size: 14px;
    color: var(--text-primary);
}

/* ===== BUTTONS ===== */
.btn-primary {
    background: var(--primary-red);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--primary-red-hover);
}

.btn-primary:disabled,
.btn-warning:disabled,
.btn-secondary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-warning {
    background: #ff9800;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-warning:hover {
    background: #f57c00;
}

.btn-danger {
    background: #e53935;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-danger:hover {
    background: #c62828;
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-compact {
    padding: 8px 12px;
    font-size: 12px;
}

.btn-success {
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(22, 163, 74, 0.35);
    transition: filter 0.15s, transform 0.1s;
}

.btn-success:hover {
    filter: brightness(1.05);
}

.btn-success:active {
    transform: translateY(1px);
}

.btn-xs {
    padding: 5px 10px;
    font-size: 11px;
    border-radius: 5px;
    font-weight: 600;
    line-height: 1.2;
}

.btn-primary,
.btn-secondary,
.btn-warning,
.btn-danger,
.btn-success {
    letter-spacing: 0.2px;
}

.btn-primary {
    background: linear-gradient(180deg, #ef5350 0%, #e53935 100%);
    box-shadow: 0 1px 2px rgba(229, 57, 53, 0.35);
}

.btn-warning {
    background: linear-gradient(180deg, #ffb74d 0%, #fb8c00 100%);
    box-shadow: 0 1px 2px rgba(251, 140, 0, 0.3);
}

.btn-danger {
    background: linear-gradient(180deg, #ef5350 0%, #c62828 100%);
    box-shadow: 0 1px 2px rgba(198, 40, 40, 0.3);
}

.lpw-row-actions {
    white-space: nowrap;
    min-width: 120px;
}

.lpw-row-actions .btn-xs {
    margin-right: 4px;
}

.lpw-toolbar-actions .btn-success,
.lpw-toolbar-actions .btn-primary,
.lpw-toolbar-actions .btn-secondary,
.lpw-toolbar-actions .btn-warning {
    min-height: 34px;
}

.lpw-table input.form-input[readonly] {
    background: #f8fafc;
    color: #64748b;
    cursor: default;
    border-color: #e2e8f0;
}

.lpw-table input.form-input:not([readonly]):focus {
    outline: none;
    border-color: #ef5350;
    box-shadow: 0 0 0 2px rgba(239, 83, 80, 0.15);
}

.lpw-save-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #166534;
    color: #fff;
    padding: 10px 22px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 100000;
    box-shadow: 0 8px 24px rgba(22, 101, 52, 0.35);
}

.lpw-save-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.lpw-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.directory-actions-cell,
.role-actions-cell {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.crud-bar {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

/* ===== WORKFLOW EDITOR ===== */
.workflow-editor {
    width: 100%;
}

.stages-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.stage-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
}

.stage-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.stage-name {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
}

.stage-remove {
    background: none;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

.stage-remove:hover {
    background: var(--bg-primary);
    color: var(--primary-red);
}

/* ===== EMPTY STATES ===== */
.empty-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 16px;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    padding: 20px;
}

.pagination-info {
    font-size: 13px;
    color: var(--text-muted);
}

.pagination-btn {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--bg-secondary);
    border-color: var(--border-hover);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== PROJECT DETAIL / ELEVATION VIEW ===== */
.back-btn {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
    padding: 8px 12px;
    border-radius: 6px;
}

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

.elevation-toolbar {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.toolbar-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.zoom-indicator {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 50px;
    text-align: center;
}

.item-count {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Elevation Tabs */
.elevation-tabs-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.elevation-tabs-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tabs-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 80px;
    flex-shrink: 0;
}

.elevation-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px;
    flex-wrap: wrap;
}

.elevation-tab {
    background: transparent;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    position: relative;
}

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

.elevation-tab.active {
    background: var(--primary-red);
    color: white;
}

.elevation-tab .floor-remove {
    display: none;
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #f44336;
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    cursor: pointer;
    border: none;
    padding: 0;
}

.elevation-tab:hover .floor-remove {
    display: block;
}

.add-floor-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px dashed var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.add-floor-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-red);
    color: var(--primary-red);
}

.elevation-canvas-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 40px;
    min-height: 800px;
    max-height: calc(100vh - 400px);
    position: relative;
    overflow: auto;
}

.elevation-selection-panel {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 30;
    width: min(300px, calc(100% - 24px));
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
    padding: 14px;
    display: none;
    flex-direction: column;
    gap: 10px;
    pointer-events: auto;
}

.elevation-selection-panel.is-open {
    display: flex;
    animation: selPanelIn 0.14s ease;
}

@keyframes selPanelIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.elevation-selection-panel.is-hidden {
    display: none;
}

.selection-panel-close {
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.selection-panel-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* Toolbar toggle button active state */
.selection-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.selection-toggle-btn.is-active {
    background: #1a6b3a;
    border-color: #1a6b3a;
    color: #fff;
}

/* Box (rectangle) selection tool toggle */
.box-select-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.box-select-toggle:hover {
    color: #0f172a;
    border-color: #94a3b8;
}

.box-select-toggle.is-active {
    color: #fff;
    background: #ef5350;
    border-color: #ef5350;
    border-style: solid;
}

/* Marquee rectangle drawn while box-selecting in the 3D view */
.geo3d-marquee {
    position: absolute;
    z-index: 40;
    border: 1.5px dashed #ef5350;
    background: rgba(239, 83, 80, 0.12);
    pointer-events: none;
}

.selection-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.selection-panel-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}

.selection-panel-count {
    font-size: 12px;
    font-weight: 600;
    color: #ef5350;
    background: #fff1f1;
    border: 1px solid #fecaca;
    border-radius: 999px;
    padding: 3px 10px;
    white-space: nowrap;
}

.selection-panel-filter {
    padding: 8px 10px;
    font-size: 13px;
}

.selection-mode-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 4px;
    background: #f1f5f9;
    border-radius: 10px;
}

.selection-mode-btn {
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.selection-mode-btn:hover {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.7);
}

.selection-mode-btn.active {
    background: #fff;
    color: #ef5350;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

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

.selection-panel-actions .btn-primary {
    margin-left: auto;
}

.selection-unit-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
    margin-top: 2px;
}

.elevation-canvas-container:has(.elevation-canvas.is-3d) .elevation-selection-panel {
    top: 10px;
    right: 10px;
}

.elevation-canvas {
    width: 100%;
    min-width: 3000px;
    min-height: 2000px;
    position: relative;
    background-image: 
        linear-gradient(var(--border-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
    background-size: 100px 100px;
    background-position: -1px -1px;
}

/* ===== 3D CANVAS MODE ===== */
/* When the 3D engine is active the canvas fills the container fully with
   no scroll — navigation is entirely by mouse (orbit / zoom / pan). */
.elevation-canvas-container:has(.elevation-canvas.is-3d) {
    padding: 0;
    overflow: hidden;
}
.elevation-canvas.is-3d {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    position: absolute;
    inset: 0;
    background: none;
    transform: none !important;
    cursor: grab;
}
.elevation-canvas.is-3d:active {
    cursor: grabbing;
}
.elevation-canvas.is-3d canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}
.view-hint {
    font-size: 11px;
    color: var(--text-muted, #8a94a3);
    margin-right: 12px;
    white-space: nowrap;
}

/* ===== 3D VIEW BUTTONS ===== */
.toolbar-divider {
    display: inline-block;
    width: 1px;
    height: 22px;
    background: var(--border-color, #d8e0e8);
    margin: 0 8px;
    vertical-align: middle;
}
.view-btn-group {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}
.view-btn {
    border: 1px solid var(--border-color, #d8e0e8);
    background: var(--bg-primary, #fff);
    color: var(--text-secondary, #5a6472);
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1;
}
.view-btn:hover {
    background: var(--bg-secondary, #f1f4f7);
    color: var(--text-primary, #1f2933);
}
.view-btn.active {
    background: #1a6b3a;
    border-color: #1a6b3a;
    color: #fff;
}
.building-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.building-view-btn svg { display: block; }
.building-view-btn.is-active {
    background: #1a6b3a;
    border-color: #1a6b3a;
    color: #fff;
}
.building-dims {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border: 1px solid var(--border-color, #d8e0e8);
    border-radius: 6px;
    background: var(--bg-primary, #fff);
}
.building-dims[hidden] { display: none; }
.building-dim-field {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary, #5a6472);
}
.building-dim-field input {
    width: 52px;
    padding: 3px 5px;
    font-size: 12px;
    border: 1px solid var(--border-color, #d8e0e8);
    border-radius: 4px;
    background: var(--bg-primary, #fff);
    color: var(--text-primary, #1f2933);
}
.building-dim-x,
.building-dim-unit {
    font-size: 12px;
    color: var(--text-secondary, #5a6472);
}

/* ===== UNIT FILTER PANEL ===== */
.filter-wrap {
    position: relative;
    display: inline-flex;
}
.filter-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.filter-toggle-btn svg { display: block; }
.filter-toggle-btn.is-active {
    background: #1a6b3a;
    border-color: #1a6b3a;
    color: #fff;
}
.filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #e74c3c;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}
.filter-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 300px;
    max-height: 460px;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-color, #d8e0e8);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(20, 28, 40, 0.18);
    z-index: 50;
}
.filter-panel[hidden] { display: none; }
.filter-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color, #e6eaef);
}
.filter-panel-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary, #1f2933);
}
.filter-clear-btn {
    border: none;
    background: none;
    color: #1a6b3a;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 4px;
}
.filter-clear-btn:hover { text-decoration: underline; }
.filter-panel-body {
    overflow-y: auto;
    padding: 8px 14px;
}
.filter-group { margin-bottom: 12px; }
.filter-group-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-secondary, #5a6472);
    margin-bottom: 6px;
}
.filter-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-primary, #1f2933);
    cursor: pointer;
    padding: 2px 0;
}
.filter-option input { width: 15px; height: 15px; cursor: pointer; }
.filter-empty {
    font-size: 12px;
    color: var(--text-muted, #9aa7b5);
}
.filter-panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-top: 1px solid var(--border-color, #e6eaef);
}
.filter-result-count {
    font-size: 12px;
    color: var(--text-secondary, #5a6472);
}

/* ===== ELEVATION DETAIL LAYOUT ===== */
.elevation-detail-layout {
    display: flex;
    gap: 0;
    min-height: 800px;
    max-height: calc(100vh - 400px);
}

.elevation-main-area {
    flex: 1;
    min-width: 0;
}

.elevation-main-area .elevation-canvas-container {
    border-radius: 8px 0 0 8px;
    height: 100%;
}

/* ===== ELEVATION STAGE SIDEBAR ===== */
.elevation-stage-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-left: none;
    border-radius: 0 8px 8px 0;
    overflow-y: auto;
    transition: width 0.18s ease;
}

.elevation-stage-sidebar.is-collapsed {
    width: 44px;
    overflow: hidden;
}

.elevation-stage-sidebar.is-collapsed .stage-sidebar-tabs,
.elevation-stage-sidebar.is-collapsed .stage-sidebar-list {
    display: none;
}

.stage-sidebar-topbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 6px 8px;
    border-bottom: 1px solid var(--border-color);
}

.elevation-stage-sidebar.is-collapsed .stage-sidebar-topbar {
    justify-content: center;
    border-bottom: none;
}

.stage-sidebar-collapse {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-color, #d8e0e8);
    background: var(--bg-primary, #fff);
    color: var(--text-secondary, #5a6472);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.stage-sidebar-collapse:hover {
    background: var(--bg-secondary, #f1f4f7);
    color: var(--text-primary, #1f2933);
}

.elevation-stage-sidebar.is-collapsed .stage-sidebar-collapse svg {
    transform: rotate(180deg);
}

.stage-sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    padding: 0;
}

.stage-sidebar-tab {
    flex: 1;
    padding: 12px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.stage-sidebar-tab:hover {
    color: var(--text-primary);
}

.stage-sidebar-tab.active {
    color: var(--primary-red);
    border-bottom-color: var(--primary-red);
}

.stage-sidebar-list {
    padding: 8px 0;
}

.stage-sidebar-item {
    display: grid;
    grid-template-columns: 14px 1fr auto;
    grid-template-rows: auto auto;
    gap: 4px 10px;
    padding: 10px 16px;
    align-items: center;
    transition: background 0.2s;
}

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

.stage-sidebar-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    grid-row: 1;
    grid-column: 1;
}

.stage-sidebar-info {
    grid-row: 1;
    grid-column: 2;
    min-width: 0;
}

.stage-sidebar-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.stage-sidebar-stats {
    grid-row: 1;
    grid-column: 3;
    text-align: right;
    white-space: nowrap;
}

.stage-sidebar-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-right: 6px;
}

.stage-sidebar-pct {
    font-size: 12px;
    color: var(--text-muted);
}

.stage-sidebar-bar-track {
    grid-row: 2;
    grid-column: 1 / -1;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.stage-sidebar-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* ===== ELEVATION ITEM PROGRESS BARS (hidden) ===== */
.elevation-progress-bars {
    display: none;
}

.elevation-item-name {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px 8px 0 0;
    padding: 4px 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.elevation-item-sub {
    background: var(--bg-secondary, #f5f5f5);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    padding: 1px 8px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary, #888);
    letter-spacing: 0.02em;
}

.elevation-item-svg {
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 6px 6px;
    overflow: visible;
    line-height: 0;
}

/* SVG Interactive Component Parts */
.svg-part {
    cursor: pointer;
    transition: filter 0.15s ease, opacity 0.15s ease;
}

.svg-part:hover {
    filter: brightness(1.2);
}

.svg-part.selected {
    filter: drop-shadow(0 0 5px var(--primary-red)) brightness(1.15);
}

/* SVG Part Tooltip */
.svg-part-tooltip {
    position: fixed;
    z-index: 10000;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px 18px;
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    animation: tooltipFadeIn 0.15s ease;
}

@keyframes tooltipFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.svg-part-tooltip .tooltip-header {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.svg-part-tooltip .tooltip-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.svg-part-tooltip .tooltip-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.svg-part-tooltip .tooltip-progress-fill {
    height: 100%;
    background: var(--primary-red);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.svg-part-tooltip .tooltip-progress-text {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.svg-part-tooltip .tooltip-update-btn {
    width: 100%;
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 6px;
}

.empty-elevation {
    text-align: center;
    color: var(--text-muted);
}

.empty-elevation svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-elevation p {
    font-size: 16px;
    margin-bottom: 20px;
}

.elevation-item {
    position: absolute;
    cursor: move;
    transition: transform 0.1s;
    -webkit-user-select: none;
    user-select: none;
}

.elevation-item:hover {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.elevation-item.is-selected {
    outline: 3px solid #ef5350;
    outline-offset: 4px;
    filter: drop-shadow(0 0 10px rgba(239, 83, 80, 0.45));
}

.elevation-item.dragging {
    opacity: 0.8;
    cursor: grabbing;
}

.elevation-item-actions {
    display: flex;
    gap: 4px;
    justify-content: center;
    padding: 4px 0;
    opacity: 0;
    transition: opacity 0.2s;
}

.elevation-item:hover .elevation-item-actions {
    opacity: 1;
}

.item-action-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    color: var(--text-primary);
}

.item-action-btn:hover {
    background: var(--primary-red);
    color: white;
    border-color: var(--primary-red);
}

.item-action-btn.danger:hover {
    background: #e53935;
    border-color: #e53935;
}

.sidebar-toolbar {
    position: fixed;
    left: var(--sidebar-width);
    bottom: 24px;
    z-index: 50;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    font-style: italic;
    line-height: 1.5;
}

.form-hint code {
    background: var(--bg-secondary);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 11px;
    font-style: normal;
    color: var(--text-primary);
}

/* Context Menu for elevation items */
.context-menu {
    position: fixed;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    padding: 8px 0;
    z-index: 1001;
    min-width: 180px;
}

.context-menu-item {
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s;
}

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

.context-menu-item.danger {
    color: var(--primary-red);
}

.context-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

/* Import Windows List */
.import-windows-list {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 16px;
}

.import-window-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.import-window-item:hover {
    background: var(--bg-secondary);
    border-color: var(--border-hover);
}

.import-window-item.selected {
    background: #fff5f5;
    border-color: var(--primary-red);
}

.import-window-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.import-window-preview {
    width: 80px;
    height: 60px;
    flex-shrink: 0;
    background: var(--bg-tertiary);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.import-window-preview svg {
    max-width: 100%;
    max-height: 100%;
}

.import-window-info {
    flex: 1;
}

.import-window-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.import-window-details {
    font-size: 12px;
    color: var(--text-muted);
}

.import-window-elevation {
    margin-left: auto;
}

.import-window-elevation select {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-primary);
    cursor: pointer;
}

/* ===== COMPONENT GRID (Progress Update) ===== */
.component-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.update-drawer-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.update-drawer-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.update-drawer-toolbar {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.update-drawer-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.update-drawer-caption {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

.update-drawer-selection {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.update-drawer-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
}

.update-drawer-value {
    margin-top: 4px;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
}

.component-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
    max-height: 34vh;
    overflow-y: auto;
}

.unit-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
    max-height: 24vh;
    overflow-y: auto;
}

.unit-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.unit-row:hover {
    border-color: #f59e9e;
    background: #fff8f8;
}

.unit-row.is-selected {
    border-color: #ef5350;
    background: #fff1f1;
    box-shadow: inset 0 0 0 1px rgba(239, 83, 80, 0.18);
}

.unit-row-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #ef5350;
    flex: 0 0 auto;
}

.unit-row-swatch {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #ef5350;
    box-shadow: 0 0 0 3px rgba(239, 83, 80, 0.12);
    flex: 0 0 auto;
}

.unit-row-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.unit-row-name {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    word-break: break-word;
}

.unit-row-meta {
    margin-top: 2px;
    font-size: 12px;
    color: #64748b;
}

.component-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.component-row:hover {
    border-color: #f59e9e;
    background: #fff8f8;
}

.component-row.is-selected {
    border-color: #ef5350;
    background: #fff1f1;
    box-shadow: inset 0 0 0 1px rgba(239, 83, 80, 0.18);
}

.component-row-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #ef5350;
    flex: 0 0 auto;
}

.component-row-tick,
.stage-check {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    flex: 0 0 auto;
    position: relative;
}

.component-row-tick::after,
.stage-check::after {
    content: "";
    width: 6px;
    height: 10px;
    border-right: 2px solid transparent;
    border-bottom: 2px solid transparent;
    transform: rotate(45deg);
    margin-top: -1px;
}

.component-row-tick.is-complete,
.stage-check.is-complete {
    background: #22c55e;
    border-color: #22c55e;
}

.component-row-tick.is-complete::after,
.stage-check.is-complete::after {
    border-color: #fff;
}

.component-row-tick.is-partial {
    border-color: #f59e0b;
    background: #fffaf0;
}

.component-row-tick.is-partial::after {
    width: 10px;
    height: 0;
    border-right: 0;
    border-bottom: 2px solid #f59e0b;
    transform: none;
    margin-top: 0;
}

.component-row-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.component-row-name {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    word-break: break-word;
}

.component-row-progress {
    margin-top: 2px;
    font-size: 12px;
    color: #64748b;
}

.component-card {
    padding: 24px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.component-card:hover {
    border-color: var(--primary-red);
    background: #fff5f5;
}

.component-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.component-progress {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 8px;
}

.component-info {
    margin-top: 24px;
    padding: 16px;
    background: #dbeafe;
    border-left: 4px solid #3b82f6;
    border-radius: 4px;
}

.component-info p {
    font-size: 14px;
    color: #1e40af;
}

/* ===== STAGE OPTIONS (Progress Update) ===== */
.stage-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stage-option {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.stage-option.disabled {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    opacity: 0.6;
    cursor: not-allowed;
}

.stage-option:not(.disabled):hover {
    background: #fff5f5;
    border-color: var(--primary-red);
}

.stage-option input[type="radio"] {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #ef5350;
}

.stage-option.disabled input[type="radio"] {
    cursor: not-allowed;
}

.stage-option-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stage-option-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stage-indicator {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.stage-option-name {
    font-weight: 500;
}

.stage-state-pill {
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.next-badge {
    font-size: 12px;
    background: var(--primary-red);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}

/* ===== SLIDING CONFIG ===== */
#slidingConfig.hidden {
    display: none;
}

/* Per-panel type dropdown list in the Add Window/Door modal */
.panel-type-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
    margin-top: 8px;
    max-height: 220px;
    overflow-y: auto;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.panel-type-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-type-label {
    flex: 0 0 64px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.panel-type-row .panel-type-select {
    flex: 1;
}

.hidden {
    display: none !important;
}

.selected-component-title {
    font-size: 18px;
    font-weight: 600;
    margin: 16px 0;
    color: var(--text-primary);
}

/* Optional Components Grid */
.optional-components-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.optional-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1.5px solid var(--border-color);
    background: var(--bg-primary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.15s ease;
    user-select: none;
}

.optional-chip:hover {
    border-color: var(--primary-red);
    color: var(--primary-red);
}

.optional-chip input[type="checkbox"] {
    accent-color: var(--primary-red);
    width: 14px;
    height: 14px;
    margin: 0;
    cursor: pointer;
}

.optional-chip:has(input:checked) {
    background: #fef2f2;
    border-color: var(--primary-red);
    color: var(--primary-red);
}

.optional-chip-add {
    border-style: dashed;
    color: var(--primary-red);
    font-weight: 600;
}

.optional-chip-add:hover {
    background: #fef2f2;
}

/* ===== PROJECT CARD MENU ===== */
.project-menu-wrapper {
    position: relative;
}

.project-menu-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px;
    min-width: 190px;
    z-index: 100;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
    margin-top: 4px;
}

.project-menu-dropdown.show {
    display: block;
}

.project-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: none;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    border-radius: 8px;
    text-align: left;
    white-space: nowrap;
}

.project-menu-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.project-menu-item.danger {
    color: #ef5350;
}

.project-menu-item.danger:hover {
    background: rgba(244, 67, 54, 0.1);
}

.project-menu-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 8px;
}

/* ===== REPORTS VIEW (Professional Light Theme) ===== */
.report-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

#reportsView .view-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
}

#reportsView {
    background: #fff;
    color: #333;
    border-radius: 12px;
}

#reportsView .tabs-container {
    border-bottom: 1px solid #e5e7eb;
}

#reportsView .tab {
    color: #666;
    border-bottom: 2px solid transparent;
    background: none;
}

#reportsView .tab.active {
    color: #e74c3c;
    border-bottom-color: #e74c3c;
    background: none;
}

#reportsView .tab:hover:not(.active) {
    color: #333;
}

.report-filters {
    display: flex;
    gap: 12px;
    padding: 16px 0 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.report-filter {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 160px;
    flex: 1;
}

.report-filter .filter-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #e74c3c;
    font-weight: 700;
}

.report-filter .form-input {
    font-size: 13px;
    padding: 8px 12px;
    background: #fff;
    color: #333;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.report-filter .form-input:focus {
    border-color: #e74c3c;
    outline: none;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.15);
}

.report-summary {
    display: flex;
    gap: 14px;
    padding: 12px 0;
    flex-wrap: wrap;
}

.report-summary-card {
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 20px;
    min-width: 140px;
    flex: 1;
    text-align: center;
}

.report-summary-card .summary-value {
    font-size: 28px;
    font-weight: 800;
    color: #1a1a2e;
}

.report-summary-card .summary-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
    font-weight: 600;
}

.report-table-wrapper {
    margin-top: 8px;
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    max-height: 600px;
    overflow-y: auto;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 1200px;
}

.report-table thead th {
    background: #f3f4f6;
    color: #555;
    padding: 11px 14px;
    text-align: left;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 2;
    white-space: nowrap;
}

.report-table thead th.col-stage {
    text-align: center;
    min-width: 110px;
}

.report-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
}

.report-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.report-table tbody tr:nth-child(odd) {
    background: #fff;
}

.report-table tbody tr:hover {
    background: #eef2ff;
}

.report-table tbody td {
    padding: 10px 14px;
    color: #333;
    white-space: nowrap;
    font-size: 12.5px;
}

.report-table tbody td.col-stage {
    text-align: center;
}

.report-cell-progress {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
    min-width: 80px;
    text-align: center;
}

.report-cell-progress.completed {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.report-cell-progress.partial {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffe0b2;
}

.report-cell-progress.none {
    background: #f5f5f5;
    color: #999;
    border: 1px solid #e8e8e8;
}

/* Report Tabs */
[data-report-tab] {
    cursor: pointer;
}

/* Export Dropdown */
.export-dropdown {
    position: relative;
}

.export-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 6px;
    min-width: 200px;
    z-index: 100;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    margin-top: 4px;
}

.export-dropdown-menu.show {
    display: block;
}

.export-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: none;
    color: #333;
    font-size: 13px;
    cursor: pointer;
    border-radius: 8px;
    text-align: left;
}

.export-option:hover {
    background: #f3f4f6;
}

.report-info-bar {
    padding: 10px 14px;
    color: #888;
    font-size: 13px;
    font-style: italic;
}

/* Status Feed Tab */
.status-feed-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 0;
}

.status-feed-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.status-feed-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-feed-info {
    flex: 1;
}

.status-feed-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.status-feed-meta {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 2px;
}

/* Assets Tab */
.assets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 16px 0;
}

.asset-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

.asset-card-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.asset-card-detail {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.asset-card-detail:last-child {
    border-bottom: none;
}

.asset-card-detail span:last-child {
    color: var(--text-primary);
    font-weight: 500;
}

/* ===== PROJECT REPORT (quick report) ===== */
.project-report-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.project-report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.project-report-card {
    background: var(--bg-secondary, #fff);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 10px;
    padding: 16px 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.prc-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.prc-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary, #222);
}

.prc-sub {
    font-size: 12px;
    color: var(--text-secondary, #777);
    margin-top: 2px;
}

.prc-pct {
    font-size: 22px;
    font-weight: 800;
    white-space: nowrap;
}

.prc-progress-bar {
    height: 8px;
    border-radius: 6px;
    background: var(--bg-tertiary, #eceff1);
    margin: 12px 0 14px;
    overflow: hidden;
}

.prc-progress-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #42a5f5, #1a73e8);
    border-radius: 6px;
}

.prc-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.prc-grid-fin {
    margin-top: 6px;
}

.prc-cell {
    background: var(--bg-tertiary, #f6f8fa);
    border-radius: 8px;
    padding: 8px 6px;
    text-align: center;
}

.prc-cell-val {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary, #222);
}

.prc-cell-lbl {
    font-size: 11px;
    color: var(--text-secondary, #777);
    margin-top: 2px;
}

.prc-fin-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-secondary, #777);
    margin: 14px 0 8px;
}

@media print {
    .no-print {
        display: none !important;
    }
}

