:root {
    --color-bg-page: #f9fafb;
    --color-bg-surface: #ffffff;
    --color-bg-muted: #fafafa;
    --color-bg-subtle: #f3f4f6;
    --color-border: #e5e7eb;
    --color-border-strong: #d1d5db;
    --color-text-primary: #111827;
    --color-text-body: #374151;
    --color-text-muted: #6b7280;
    --color-brand: #7c3aed;
    --color-brand-gradient: linear-gradient(135deg, #9333ea 0%, #7c3aed 100%);
    --sidebar-width: 256px;
    --app-header-height: 72px;
    --radius-card: 12px;
    --radius-control: 8px;

    /* Chart palette — matches design.md + brand purple */
    --chart-brand-fill: rgba(147, 51, 234, 0.88);
    --chart-brand-stroke: #9333ea;
    --chart-brand-deep-fill: rgba(124, 58, 237, 0.88);
    --chart-brand-deep-stroke: #7c3aed;
    --chart-brand-light-fill: rgba(196, 181, 253, 0.85);
    --chart-brand-light-stroke: #c4b5fd;
    --chart-success-fill: rgba(16, 185, 129, 0.88);
    --chart-success-stroke: #10b981;
    --chart-danger-fill: rgba(239, 68, 68, 0.88);
    --chart-danger-stroke: #ef4444;
    --chart-warning-fill: rgba(245, 158, 11, 0.88);
    --chart-warning-stroke: #f59e0b;
    --chart-muted-fill: rgba(107, 114, 128, 0.7);
    --chart-muted-stroke: #9ca3af;
    --chart-grid: #f3f4f6;
    --chart-tick: #6b7280;
    --chart-axis: #e5e7eb;
    --chart-area-bg: #fafafa;
    --chart-tooltip-bg: rgba(17, 24, 39, 0.92);
    --chart-tooltip-text: #ffffff;

    /* Milestone doughnut — purple CRM shades (on track → behind → at risk → other) */
    --chart-milestone-on-track-fill: #9333ea;
    --chart-milestone-on-track-stroke: #7c3aed;
    --chart-milestone-behind-fill: #6d28d9;
    --chart-milestone-behind-stroke: #5b21b6;
    --chart-milestone-at-risk-fill: #c4b5fd;
    --chart-milestone-at-risk-stroke: #a78bfa;
    --chart-milestone-other-fill: #e5e7eb;
    --chart-milestone-other-stroke: #9ca3af;

    /* Performance bar chart — purple scale by % vs plan */
    --chart-performance-excellent-fill: #9333ea;
    --chart-performance-excellent-stroke: #7c3aed;
    --chart-performance-good-fill: #8b5cf6;
    --chart-performance-good-stroke: #7c3aed;
    --chart-performance-fair-fill: #a78bfa;
    --chart-performance-fair-stroke: #8b5cf6;
    --chart-performance-low-fill: #7c3aed;
    --chart-performance-low-stroke: #6d28d9;
    --chart-performance-critical-fill: #6d28d9;
    --chart-performance-critical-stroke: #5b21b6;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text-body);
    background: var(--color-bg-page);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--color-brand); text-decoration: none; }
a:hover { color: #6d28d9; }

.app-container { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--color-bg-surface);
    border-right: 1px solid var(--color-border);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    height: var(--app-header-height);
    min-height: var(--app-header-height);
    max-height: var(--app-header-height);
    padding: 0 16px;
    border-bottom: 1px solid var(--color-border);
    background: white;
    box-sizing: border-box;
}

.sidebar-brand-link {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    line-height: 0;
    text-decoration: none;
}

.sidebar-brand-logo {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 40px;
    object-fit: contain;
    object-position: left center;
}

.sidebar-nav { padding: 16px 12px; flex: 1; min-height: 0; overflow-y: auto; }

.nav-section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    padding: 8px 16px 4px;
}

.nav-item {
    display: block;
    padding: 12px 16px;
    border-radius: var(--radius-control);
    color: var(--color-text-body);
    font-weight: 500;
    margin-bottom: 2px;
    transition: background 0.15s, color 0.15s;
}

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

.nav-item.is-active {
    background: #f3e8ff;
    color: var(--color-brand);
    font-weight: 600;
}

.nav-item-content { display: flex; align-items: center; gap: 10px; }
.nav-item-icon { width: 20px; height: 20px; flex-shrink: 0; }

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--color-border);
    position: relative;
    z-index: 110;
}

.sidebar-user-menu {
    position: relative;
}

.sidebar-user-details {
    position: relative;
}

.sidebar-user-details[open] {
    z-index: 120;
}

.sidebar-user-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: var(--radius-control);
    background: transparent;
    cursor: pointer;
    list-style: none;
    text-align: left;
    transition: background 0.15s, border-color 0.15s;
    font-family: inherit;
}

.sidebar-user-trigger::-webkit-details-marker,
.sidebar-user-trigger::marker {
    display: none;
    content: '';
}

.sidebar-user-trigger:hover,
.sidebar-user-details[open] .sidebar-user-trigger {
    background: var(--color-bg-page);
    border-color: var(--color-border);
}

.sidebar-user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-brand-gradient);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.28);
    object-fit: cover;
}

.sidebar-user-avatar--photo {
    background: none;
    padding: 0;
    color: transparent;
}

.sidebar-user-avatar--large {
    width: 56px;
    height: 56px;
    font-size: 18px;
}

.sidebar-user-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-email {
    font-size: 12px;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 12px;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-chevron {
    flex-shrink: 0;
    color: var(--color-text-muted);
    transition: transform 0.15s;
}

.sidebar-user-details[open] .sidebar-user-chevron {
    transform: rotate(180deg);
    color: var(--color-brand);
}

.sidebar-user-details > .sidebar-user-dropdown {
    display: none;
}

.sidebar-user-details[open] > .sidebar-user-dropdown {
    display: block;
}

.sidebar-user-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 8px);
    z-index: 130;
    padding: 6px;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-control);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}

.sidebar-user-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--color-text-body);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.sidebar-user-item:hover,
.sidebar-user-item.is-active {
    background: #f3e8ff;
    color: var(--color-brand);
}

.sidebar-user-item--danger {
    color: #dc2626;
}

.sidebar-user-item--danger:hover {
    background: #fef2f2;
    color: #b91c1c;
}

.sidebar-user-form {
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--color-bg-subtle);
    margin-top: 4px;
    padding-top: 4px;
}

.profile-settings-page {
    width: 100%;
    max-width: none;
}

.content--profile {
    padding: 24px 32px 48px;
    width: 100%;
}

.profile-hero-card {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 28px 32px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #faf5ff 0%, #f5f3ff 55%, #ffffff 100%);
    border: 1px solid #ede9fe;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.profile-hero-content {
    min-width: 0;
}

.profile-hero-name {
    margin: 0 0 6px;
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text-primary);
    letter-spacing: -0.02em;
}

.profile-hero-subtitle {
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--color-text-muted);
}

.profile-email-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 9999px;
    background: #f3e8ff;
    border: 1px solid #ddd6fe;
    color: #6d28d9;
    font-size: 13px;
    font-weight: 500;
}

.profile-settings-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    width: 100%;
}

.profile-settings-nav {
    position: sticky;
    top: calc(var(--app-header-height) + 24px);
    padding: 24px;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    min-height: 320px;
}

.profile-settings-nav-label {
    margin: 0 0 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.profile-settings-nav-label--roles {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}

.profile-settings-nav-link {
    display: block;
    padding: 8px 10px;
    margin-bottom: 2px;
    border-radius: 8px;
    color: var(--color-text-body);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.profile-settings-nav-link:hover {
    background: var(--color-bg-page);
    color: var(--color-brand);
}

.profile-role-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 9999px;
    background: #f3e8ff;
    border: 1px solid #ddd6fe;
    color: #7c3aed;
    font-size: 12px;
    font-weight: 600;
}

.profile-role-badge--large {
    font-size: 13px;
    padding: 8px 14px;
}

.profile-settings-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-settings-panel {
    scroll-margin-top: calc(var(--app-header-height) + 24px);
    padding: 28px 32px;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    width: 100%;
}

.profile-settings-panel-header h3 {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.profile-settings-panel-header p {
    margin: 0 0 20px;
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.5;
}

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

.profile-settings-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}

.profile-settings-form-actions .crm-filter-btn {
    height: 40px;
    padding: 0 18px;
    font-size: 14px;
}

.profile-roles-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.profile-settings-text {
    margin: 0;
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.5;
}

.profile-settings-panel--danger .profile-settings-panel-header h3 {
    color: #dc2626;
}

.sidebar-user-avatar--profile {
    width: 80px;
    height: 80px;
    font-size: 24px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.24);
}

.profile-avatar-uploader {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    padding: 18px 20px;
    background: #fafafa;
    border: 1px solid var(--color-border);
    border-radius: 14px;
}

.profile-avatar-uploader-meta {
    min-width: 0;
}

.profile-avatar-uploader-title {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.profile-avatar-uploader-hint {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--color-text-muted);
}

.profile-avatar-uploader-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.profile-avatar-choose {
    height: 34px;
    padding: 0 14px;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.profile-avatar-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.profile-avatar-remove {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #b91c1c;
    cursor: pointer;
}

.profile-avatar-filename {
    margin: 10px 0 0;
    font-size: 13px;
    color: #059669;
    font-weight: 500;
}

@media (max-width: 640px) {
    .profile-avatar-uploader {
        flex-direction: column;
        align-items: flex-start;
    }
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
    position: relative;
}

.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--color-bg-surface);
    border-bottom: 1px solid var(--color-border);
    height: var(--app-header-height);
    min-height: var(--app-header-height);
    max-height: var(--app-header-height);
    display: flex;
    align-items: center;
    overflow: visible;
    box-sizing: border-box;
}

.header-content {
    padding: 0 24px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    overflow: visible;
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    overflow: visible;
}

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

.header-search {
    position: relative;
    width: min(320px, 36vw);
}

.header-search-label {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    color: #9ca3af;
    pointer-events: none;
}

.header-search-input {
    width: 100%;
    height: 38px;
    padding: 0 12px 0 36px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-control);
    font-size: 13px;
    font-family: inherit;
    color: var(--color-text-primary);
    background: #f9fafb;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.header-search-input::placeholder {
    color: #9ca3af;
}

.header-search-input:focus {
    outline: none;
    border-color: #c4b5fd;
    background: white;
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.12);
}

.header-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 80;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
    overflow: hidden;
}

.header-search-empty {
    margin: 0;
    padding: 14px 16px;
    font-size: 13px;
    color: var(--color-text-muted);
}

.header-search-list {
    list-style: none;
    margin: 0;
    padding: 6px;
    max-height: 320px;
    overflow-y: auto;
}

.header-search-result {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
}

.header-search-result:hover {
    background: #f5f3ff;
}

.header-search-result-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.header-search-result-meta {
    font-size: 12px;
    color: var(--color-text-muted);
}

.header-notifications {
    position: relative;
}

.header-notifications-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-control);
    background: #f9fafb;
    color: #4b5563;
    cursor: pointer;
    list-style: none;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.header-notifications-trigger::-webkit-details-marker,
.header-notifications-trigger::marker {
    display: none;
}

.header-notifications-trigger:hover,
.header-notifications[open] .header-notifications-trigger {
    border-color: #c4b5fd;
    background: #f5f3ff;
    color: var(--color-brand);
}

.header-notifications-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #dc2626;
    color: white;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    transition: transform 0.2s ease;
}

.header-notifications-badge.is-live {
    animation: notification-badge-pulse 0.45s ease;
}

@keyframes notification-badge-pulse {
    0% { transform: scale(1); }
    35% { transform: scale(1.18); }
    100% { transform: scale(1); }
}

.header-notifications-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(360px, calc(100vw - 32px));
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
    overflow: hidden;
    z-index: 120;
    pointer-events: auto;
}

.header-notifications[open] > .header-notifications-panel {
    display: block;
}

.header-notifications > .header-notifications-panel {
    display: none;
}

.header-notifications-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border);
}

.header-notifications-header h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.header-notifications-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-brand);
}

.header-notifications-empty {
    margin: 0;
    padding: 20px 16px;
    font-size: 13px;
    color: var(--color-text-muted);
    line-height: 1.5;
}

.header-notifications-list {
    list-style: none;
    margin: 0;
    padding: 6px;
    max-height: 320px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.header-notification-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-left: 3px solid transparent;
    border-radius: 8px;
    background: transparent;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    font: inherit;
}

.header-notification-item:hover {
    background: #f9fafb;
}

.header-notification-item--warning {
    border-left-color: #f59e0b;
}

.header-notification-item--danger {
    border-left-color: #dc2626;
}

.header-notification-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.header-notification-message {
    font-size: 12px;
    color: var(--color-text-muted);
    line-height: 1.45;
}

.header-notification-detail {
    padding: 8px 10px 12px;
}

.header-notification-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--color-brand);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.header-notification-back:hover {
    color: #6d28d9;
}

.header-notification-detail-hero {
    padding: 12px;
    margin-bottom: 14px;
    border-radius: 10px;
    border: 1px solid var(--color-border);
    border-left-width: 3px;
    background: #f9fafb;
}

.header-notification-detail-hero--warning {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.header-notification-detail-hero--danger {
    border-left-color: #dc2626;
    background: #fef2f2;
}

.header-notification-detail-title {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.header-notification-detail-message {
    margin: 0;
    font-size: 13px;
    color: var(--color-text-body);
    line-height: 1.5;
}

.header-notification-detail-grid {
    display: grid;
    grid-template-columns: minmax(110px, 38%) 1fr;
    gap: 8px 12px;
    margin: 0 0 16px;
    padding: 0 2px;
}

.header-notification-detail-grid dt {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
}

.header-notification-detail-grid dd {
    margin: 0;
    font-size: 12px;
    color: var(--color-text-primary);
    line-height: 1.45;
    word-break: break-word;
}

.header-notification-detail-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 38px;
    text-decoration: none;
}

.header-notifications-footer {
    display: block;
    padding: 12px 16px;
    border-top: 1px solid var(--color-border);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-brand);
    text-decoration: none;
    text-align: center;
}

.header-notifications-footer:hover {
    background: #faf5ff;
}

.page-heading {
    margin-bottom: 24px;
}

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

.page-heading-subtitle {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--color-text-muted);
    font-weight: 500;
}

.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 1.2; }
.breadcrumb a { color: var(--color-text-muted); font-weight: 500; }
.breadcrumb a:hover { color: var(--color-brand); }
.breadcrumb-sep { color: #9ca3af; }
.breadcrumb-current { color: var(--color-text-muted); font-weight: 500; font-size: 13px; }

.content { padding: 24px; }

.crm-section-header { margin-bottom: 20px; }
.kpi-section-title, .section-title {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.section-subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--color-text-muted);
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.kpi-grid--dashboard {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    width: 100%;
}

.kpi-grid--summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
}

.report-summary-strip {
    margin-bottom: 28px;
}

.report-overview {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.report-overview-details {
    margin-bottom: 0;
}

.report-overview-boq-note {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--color-text-muted);
}

.report-overview-boq-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.report-overview-boq-filter .form-label {
    margin: 0;
    white-space: nowrap;
}

.report-overview-boq-filter .form-input {
    width: 220px;
    height: 38px;
}

.report-overview-boq-pct {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
    .report-overview-boq .table-toolbar {
        align-items: stretch;
    }

    .report-overview-boq-filter {
        width: 100%;
        margin-left: 0;
    }

    .report-overview-boq-filter .form-input {
        width: 100%;
    }
}

.report-overview-sections-header h3 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.report-overview-sections-header p {
    margin: 0 0 16px;
    font-size: 14px;
    color: var(--color-text-muted);
}

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

.report-section-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 18px;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.report-section-card:hover {
    border-color: #ddd6fe;
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.1);
    transform: translateY(-1px);
}

.report-section-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.report-section-card-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.report-section-card-count {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-brand);
    background: #f3e8ff;
    padding: 4px 8px;
    border-radius: 9999px;
}

.report-section-card-desc {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--color-text-muted);
}

.report-summary-strip .kpi-grid--summary {
    margin-bottom: 16px;
}

.kpi-grid--summary .kpi-value {
    font-size: 24px;
}

.kpi-grid--summary .kpi-label {
    font-size: 12px;
    line-height: 1.3;
}

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

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

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

    .kpi-grid--summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.kpi-card {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.kpi-card:hover {
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.12);
    border-color: #ddd6fe;
}

.kpi-card-body { padding: 20px; }

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

.kpi-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-muted);
}

.kpi-icon {
    width: 44px; height: 44px;
    background: var(--color-brand-gradient);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: white;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.32);
    flex-shrink: 0;
}

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

.kpi-unit {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-muted);
    margin-top: 4px;
}

.kpi-footer {
    background: var(--color-bg-muted);
    border-top: 1px solid var(--color-bg-subtle);
    padding: 10px 20px;
}

.kpi-footer-text { font-size: 13px; font-weight: 500; }
.kpi-footer-text--positive { color: #10b981; }
.kpi-footer-text--negative { color: #ef4444; }
.kpi-footer-text--neutral { color: var(--color-text-muted); }

.trade-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.trade-status-grid--full {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: 100%;
}

.trade-status-grid--summary {
    margin-top: 0;
    margin-bottom: 0;
}

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

@media (max-width: 768px) {
    .trade-status-grid--full {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.trade-card {
    display: flex;
    flex-direction: column;
}

.trade-card .kpi-card-body {
    flex: 1;
    padding-bottom: 16px;
}

.trade-card-stats {
    margin-top: 12px;
}

.trade-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.trade-card-footer .kpi-footer-text {
    margin-left: auto;
    text-align: right;
}

.trade-stat-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    margin-bottom: 6px;
}

.trade-stat-row:last-child {
    margin-bottom: 0;
}

.trade-stat-row span:first-child { color: var(--color-text-muted); }
.trade-stat-row span:last-child { font-weight: 600; color: var(--color-text-primary); }

.trade-progress {
    height: 6px;
    background: var(--color-bg-subtle);
    border-radius: 9999px;
    margin: 12px 0 10px;
    overflow: hidden;
}

.trade-progress-bar {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.3s ease;
}

.trade-progress-bar--success {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.trade-progress-bar--danger {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.trade-progress-bar--warning {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.table-container {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    overflow: visible;
    margin-bottom: 24px;
}

.table-title {
    padding: 16px 20px;
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-primary);
    border-bottom: 1px solid var(--color-border);
    margin: 0;
}

.table-note {
    padding: 12px 20px;
    font-size: 13px;
    color: var(--color-text-muted);
    background: var(--color-bg-muted);
    border-top: 1px solid var(--color-border);
    margin: 0;
}

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

.data-table th {
    background: var(--color-bg-muted);
    padding: 10px 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-bg-subtle);
    color: var(--color-text-body);
}

.data-table tbody tr:hover { background: var(--color-bg-page); }

.yard-boq-num { text-align: right; font-variant-numeric: tabular-nums; }

.yard-boq-section td {
    font-weight: 700;
    color: var(--color-text-body);
    letter-spacing: 0.01em;
}

.yard-boq-list tbody tr[data-href] {
    cursor: pointer;
}

.yard-boq-row-link {
    color: inherit;
    font-weight: 600;
    text-decoration: none;
}

.yard-boq-row-link:hover {
    color: var(--color-brand);
}

.yard-boq-form-table .form-input {
    height: 36px;
    min-width: 88px;
}

.yard-boq-form-table td.yard-boq-num .form-input {
    text-align: right;
}
.data-table tbody tr:last-child td { border-bottom: none; }

.timesheet-table-wrap {
    overflow-x: auto;
    overflow-anchor: none;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.data-table--timesheet {
    min-width: 1100px;
}

.data-table--timesheet th,
.data-table--timesheet td {
    white-space: nowrap;
    font-size: 12px;
    padding: 8px 10px;
}

.data-table--timesheet td:nth-child(n+3) {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-table th:has(.col-filter) {
    vertical-align: middle;
}

.col-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    vertical-align: middle;
}

.col-filter-label {
    line-height: 1.2;
    letter-spacing: 0.01em;
}

.col-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin: 0;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 0;
}

.col-filter-btn svg {
    display: block;
    width: 13px;
    height: 13px;
}

.col-filter-btn:hover,
.col-filter-btn[aria-expanded="true"] {
    background: #f5f3ff;
    border-color: #ddd6fe;
    color: var(--color-brand);
}

.col-filter-btn.is-active {
    background: #ede9fe;
    border-color: #ddd6fe;
    color: var(--color-brand);
}

.col-filter-panel {
    position: fixed;
    z-index: 80;
    width: 260px;
    padding: 10px;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

.col-filter-search-wrap {
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
}

.col-filter-search {
    width: 100%;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--color-border-strong);
    border-radius: 8px;
    font: inherit;
    font-size: 13px;
    color: var(--color-text-primary);
    background: #f9fafb;
}

.col-filter-search::placeholder {
    color: #9ca3af;
}

.col-filter-search:focus {
    outline: none;
    border-color: #c4b5fd;
    background: white;
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.12);
}

.col-filter-list {
    max-height: 260px;
    margin-top: 6px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.col-filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 1px 0;
    padding: 7px 8px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    color: var(--color-text-body);
    cursor: pointer;
}

.col-filter-option:hover {
    background: #f5f3ff;
}

.col-filter-option--all {
    margin-bottom: 4px;
    color: var(--color-text-primary);
    font-weight: 600;
}

.col-filter-option input {
    width: 15px;
    height: 15px;
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--color-brand);
}

.col-filter-option span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.col-filter-empty {
    margin: 10px 8px;
    font-size: 13px;
    color: var(--color-text-muted);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid;
    white-space: nowrap;
}

.status-approved { background: #d1fae5; color: #10b981; border-color: #a7f3d0; }
.status-rejected { background: #fee2e2; color: #dc2626; border-color: #fecaca; }
.status-budget { background: #fef3c7; color: #f59e0b; border-color: #fde68a; }
.status-prospect { background: #dbeafe; color: #3b82f6; border-color: #bfdbfe; }
.status-draft { background: #f3f4f6; color: #6b7280; border-color: #e5e7eb; }

.crm-filter-btn, .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 18px;
    background: var(--color-brand-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-control);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
}

.crm-filter-btn:hover, .btn-primary:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: white;
}

.guest-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-page);
    padding: 24px;
}

.guest-card {
    width: 100%;
    max-width: 420px;
    padding: 32px;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.guest-card-header {
    margin-bottom: 24px;
}

.guest-brand-logo {
    display: block;
    width: auto;
    max-width: 200px;
    height: auto;
    max-height: 52px;
    margin: 0 auto 16px;
    object-fit: contain;
}

.guest-card h1 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 600;
    color: var(--color-text-primary);
    text-align: center;
}

.guest-card .guest-subtitle {
    text-align: center;
    color: var(--color-text-muted);
    margin: 0;
    font-size: 14px;
}

.form-group { margin-bottom: 16px; }

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-control);
    font-size: 14px;
    font-family: inherit;
    color: var(--color-text-primary);
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: #c4b5fd;
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.12);
}

.form-checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--color-text-body);
}

.form-checkbox-row input { accent-color: var(--color-brand); }

.form-options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.form-options-row .form-checkbox-row {
    margin-bottom: 0;
}

.guest-auth-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-brand);
    text-decoration: none;
}

.guest-auth-link:hover {
    color: #6d28d9;
    text-decoration: underline;
}

.guest-auth-footer {
    margin: 20px 0 0;
    text-align: center;
    font-size: 14px;
}

.guest-auth-footer a {
    color: var(--color-brand);
    font-weight: 500;
    text-decoration: none;
}

.guest-auth-footer a:hover {
    text-decoration: underline;
}

.form-error {
    color: #dc2626;
    font-size: 13px;
    margin-top: 6px;
}

.btn-full { width: 100%; }

.report-cover {
    background: var(--color-brand-gradient);
    border-radius: 16px;
    padding: 48px 40px;
    color: white;
    margin-bottom: 32px;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.32);
}

.report-cover h2 {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.report-cover h1 {
    margin: 0 0 32px;
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.report-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.report-meta-item label {
    display: block;
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 4px;
}

.report-meta-item span {
    font-size: 16px;
    font-weight: 600;
}

.trade-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
}

.trade-tag {
    padding: 6px 14px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
}

.milestone-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.milestone-grid--schedule {
    margin-bottom: 0;
}

@media (min-width: 1100px) {
    .milestone-grid--schedule {
        grid-template-columns: repeat(4, 1fr);
    }
}

.schedule-section {
    margin-bottom: 24px;
}

.schedule-section-body {
    padding: 20px;
}

.schedule-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 48px 24px;
    text-align: center;
}

.schedule-empty-state p {
    margin: 0;
    font-size: 14px;
    color: var(--color-text-muted);
}

.schedule-empty-btn {
    height: 34px;
    padding: 0 14px;
    font-size: 13px;
}

.milestone-card {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    padding: 20px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    min-height: 160px;
    position: relative;
    overflow: visible;
}

.milestone-card:has(.table-row-menu[open]) {
    z-index: 12;
}

.milestone-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.milestone-tag {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text-primary);
}

.milestone-card h4 {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.milestone-card p {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--color-text-muted);
}

.milestone-dates {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: auto;
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.action-item {
    display: flex;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-bg-subtle);
    align-items: center;
    position: relative;
}

.action-item .status-badge {
    flex-shrink: 0;
}

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

.action-item p {
    margin: 0;
    font-size: 14px;
    color: var(--color-text-body);
    line-height: 1.5;
    flex: 1;
}

.report-end-card {
    margin-top: 8px;
    padding: 32px 24px;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    text-align: center;
}

.report-end-title {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-muted);
}

.report-end-text {
    margin: 0 0 4px;
    font-size: 13px;
    color: #9ca3af;
}

.report-end-meta {
    margin: 0;
    font-size: 12px;
    color: #9ca3af;
}

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

.report-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.report-list-item:hover {
    border-color: #ddd6fe;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.1);
}

.report-list-item h3 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.report-list-item p {
    margin: 0;
    font-size: 13px;
    color: var(--color-text-muted);
}

.variance-positive { color: #10b981; font-weight: 600; }
.variance-negative { color: #ef4444; font-weight: 600; }

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: var(--radius-control);
    margin-bottom: 16px;
    font-size: 14px;
}

.flag-indicator { color: #ef4444; font-weight: 700; font-size: 11px; }

.dashboard-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.crm-filter-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 18px;
    background: white;
    color: var(--color-text-body);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-control);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

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

.chart-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.stat-card {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.stat-card--compact {
    grid-column: span 1;
}

.stat-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg-surface);
}

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

.stat-card-subtitle {
    margin: 0;
    font-size: 13px;
    color: var(--color-text-muted);
    line-height: 1.45;
}

.stat-card-body {
    padding: 20px;
    background: var(--chart-area-bg);
    flex: 1;
}

.stat-card-body--list {
    background: var(--color-bg-surface);
}

.crm-chart-wrap {
    position: relative;
    height: 360px;
}

.crm-chart-wrap--compact {
    height: 280px;
}

.dashboard-report-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dashboard-report-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-control);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s, border-color 0.15s;
}

.dashboard-report-item:hover {
    background: var(--color-bg-page);
    border-color: #ddd6fe;
}

.dashboard-report-item strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 2px;
}

.dashboard-report-item span {
    font-size: 12px;
    color: var(--color-text-muted);
}

.dashboard-chart-empty {
    margin: 0;
    padding: 28px 12px;
    text-align: center;
    font-size: 13px;
    line-height: 1.5;
    color: var(--color-text-muted);
}

/* Report section navigation */
.report-section-nav {
    margin-bottom: 24px;
}

.customer-tab-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 6px;
    background: var(--color-bg-page);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    margin-bottom: 16px;
}

.report-section-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: thin;
}

.customer-tab-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: var(--radius-control);
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-muted);
    border: 1px solid transparent;
    background: transparent;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.customer-tab-btn:hover {
    color: var(--color-text-primary);
    background: white;
}

.customer-tab-btn.is-active {
    background: var(--color-brand-gradient);
    color: white;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.28);
}

.report-section-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.report-section-actions.overview-actions {
    justify-content: flex-start;
    margin-top: 8px;
}

.report-section-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.section-button-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.section-button-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.section-button-card:hover {
    border-color: #ddd6fe;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.1);
}

.section-button-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    background: var(--color-brand-gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.32);
}

.section-button-body {
    flex: 1;
    min-width: 0;
}

.section-button-body h3 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.section-button-body p {
    margin: 0;
    font-size: 13px;
    color: var(--color-text-muted);
    line-height: 1.4;
}

.section-button-open {
    height: 34px;
    padding: 0 14px;
    font-size: 13px;
    flex-shrink: 0;
}

/* Forms & add entry */
.crm-filters {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px 20px;
    align-items: end;
}

.add-entry-form .crm-filter-actions {
    grid-column: 1 / -1;
}

.crm-filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.crm-filter-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
}

.crm-filter-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.form-textarea {
    height: auto;
    min-height: 88px;
    padding: 10px 12px;
    resize: vertical;
}

.form-input select,
select.form-input {
    appearance: auto;
}

.alert-success {
    background: #d1fae5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    padding: 12px 16px;
    border-radius: var(--radius-control);
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

.add-entry-panel {
    margin-bottom: 20px;
}

.add-entry-details {
    border: none;
}

.add-entry-summary {
    list-style: none;
    cursor: pointer;
    display: inline-block;
}

.add-entry-summary::-webkit-details-marker { display: none; }

.add-entry-form-card {
    margin-top: 16px;
    padding: 20px;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.add-entry-form-title {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.entry-create-card {
    padding: 24px;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

/* Create page — CRM-style form layout */
.create-page {
    width: 100%;
}

.create-page-hint {
    margin: 0 0 14px;
    font-size: 13px;
    color: var(--color-text-muted);
}

.create-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-muted);
    text-decoration: none;
}

.create-back-link:hover {
    color: var(--color-brand);
}

.create-form-card {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    padding: 28px 32px;
}

.create-form-section {
    margin-bottom: 28px;
}

.create-form-section:last-of-type {
    margin-bottom: 0;
}

.create-form-section-title {
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-primary);
}

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

.yard-boq-heading-fields {
    margin-bottom: 8px;
}

.create-form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.create-form-field--full {
    grid-column: 1 / -1;
}

.create-form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-body);
}

.create-form-required {
    color: #ef4444;
    margin-left: 2px;
}

.create-form-input {
    height: 42px;
}

.create-form-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    font-size: 14px;
    color: var(--color-text-body);
    cursor: pointer;
}

.create-form-checkbox input {
    width: 16px;
    height: 16px;
    accent-color: var(--color-brand);
}

.create-form-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
}

.create-form-note {
    margin-top: 20px;
    padding: 14px 16px;
    background: #f3e8ff;
    border: 1px solid #ddd6fe;
    border-radius: var(--radius-control);
    font-size: 13px;
    line-height: 1.5;
    color: var(--color-text-muted);
}

.entry-create-actions {
    margin-bottom: 20px;
}

.crm-page-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
    flex-wrap: wrap;
}

.table-toolbar .table-title {
    padding: 0;
    border: none;
    margin: 0;
}

.table-toolbar-end {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-left: auto;
}

.table-bulk-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-bulk-count {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.table-bulk-delete-btn {
    background: #dc2626;
    border-color: #dc2626;
}

.table-bulk-delete-btn:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

.table-select-col,
.table-select-cell {
    width: 44px;
    text-align: center;
    vertical-align: middle;
    padding-left: 16px;
    padding-right: 8px;
}

.table-select-col input,
.table-select-cell input {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.data-table tbody tr.is-selected {
    background: rgba(124, 58, 237, 0.06);
}

.data-table tbody tr.is-selected:hover {
    background: rgba(124, 58, 237, 0.1);
}

/* Table row actions menu */
.table-actions-col {
    width: 72px;
    text-align: right;
}

.table-actions-cell {
    width: 72px;
    text-align: right;
    vertical-align: middle;
    position: relative;
}

.data-table tbody tr:has(.table-row-menu[open]) {
    position: relative;
    z-index: 12;
}

.table-row-menu {
    position: relative;
    display: inline-block;
}

.table-row-menu[open] {
    z-index: 20;
}

.table-row-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-control);
    background: var(--color-bg-surface);
    color: var(--color-text-muted);
    cursor: pointer;
    list-style: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.table-row-menu-btn::-webkit-details-marker,
.table-row-menu-btn::marker {
    display: none;
    content: '';
}

.table-row-menu-btn:hover,
.table-row-menu[open] .table-row-menu-btn {
    background: #f3e8ff;
    border-color: #c4b5fd;
    color: var(--color-brand);
}

.table-row-menu > .table-row-menu-dropdown {
    display: none;
}

.table-row-menu[open] > .table-row-menu-dropdown {
    display: block;
}

.table-row-menu-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 30;
    min-width: 132px;
    max-height: min(280px, calc(100vh - 24px));
    padding: 4px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-control);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}

.table-row-menu-dropdown--fixed {
    z-index: 1200;
}

.table-row-menu-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--color-text-body);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    line-height: 1.4;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.table-row-menu-item:hover {
    background: var(--color-bg-page);
    color: var(--color-text-primary);
}

.table-row-menu-item--danger {
    color: #dc2626;
}

.table-row-menu-item--danger:hover {
    background: #fef2f2;
    color: #b91c1c;
}

.table-row-menu-form {
    margin: 0;
    padding: 0;
}

.entry-card-menu {
    flex-shrink: 0;
    margin-left: auto;
    position: relative;
}

.milestone-card-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.action-item .entry-card-menu {
    margin-left: 0;
    margin-top: 0;
}

.action-item:has(.table-row-menu[open]) {
    z-index: 12;
}

/* Entry detail (view) page */
.entry-detail-card {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    padding: 24px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.entry-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
}

.entry-detail-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.entry-detail-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.entry-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px 32px;
    margin: 0;
}

.entry-detail-item {
    margin: 0;
}

.entry-detail-item dt {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.entry-detail-item dd {
    margin: 0;
    font-size: 14px;
    color: var(--color-text-body);
    line-height: 1.5;
}

.entry-detail-note {
    font-size: 12px;
    color: var(--color-text-muted);
    font-weight: 400;
}

.report-edit-lead {
    margin: 0 0 24px;
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.6;
}

.status-text {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
}

.status-text-pass {
    color: #059669;
}

.status-text-danger {
    color: #dc2626;
}

.status-text-warning {
    color: #d97706;
}

.status-text-info {
    color: #2563eb;
}

.status-text-muted {
    color: #6b7280;
}

.data-table .status-text {
    white-space: nowrap;
}

/* Page loader */
body.is-loading {
    overflow: hidden;
}

.page-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-page);
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.page-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.page-loader-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px;
}

.page-loader-logo {
    display: block;
    width: min(220px, 70vw);
    height: auto;
    max-height: 56px;
    object-fit: contain;
}

.page-loader-spinner {
    width: 40px;
    height: 40px;
    margin-top: 28px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-brand);
    border-radius: 50%;
    animation: page-loader-spin 0.75s linear infinite;
}

.page-loader-text {
    margin: 16px 0 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-muted);
}

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

/* In-page content loader (app navigation) */
.content-loader {
    position: absolute;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 120px;
    background: rgba(249, 250, 251, 0.82);
    backdrop-filter: blur(2px);
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.content-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.content-loader-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 28px;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.content-loader-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-brand);
    border-radius: 50%;
    animation: page-loader-spin 0.75s linear infinite;
}

.content-loader-text {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-muted);
}

/* Confirm dialog */
body.confirm-dialog-open {
    overflow: hidden;
}

.confirm-dialog {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.confirm-dialog.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.confirm-dialog-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.45);
    backdrop-filter: blur(4px);
}

.confirm-dialog-panel {
    position: relative;
    width: min(420px, 100%);
    padding: 28px 28px 24px;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.16);
    text-align: center;
    transform: translateY(12px) scale(0.98);
    transition: transform 0.2s ease;
}

.confirm-dialog.is-open .confirm-dialog-panel {
    transform: translateY(0) scale(1);
}

.confirm-dialog-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin: 0 auto 16px;
    border-radius: 14px;
    background: rgba(124, 58, 237, 0.1);
    color: var(--color-brand);
}

.confirm-dialog--danger .confirm-dialog-icon {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.confirm-dialog-title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-primary);
    line-height: 1.35;
}

.confirm-dialog-message {
    margin: 0 0 24px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--color-text-muted);
}

.confirm-dialog-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.confirm-dialog-btn {
    min-width: 108px;
    padding: 10px 18px;
}

.confirm-dialog--danger .confirm-dialog-btn--confirm {
    background: #dc2626;
    border-color: #dc2626;
}

.confirm-dialog--danger .confirm-dialog-btn--confirm:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

.sidebar-user-avatar--table {
    width: 32px;
    height: 32px;
    font-size: 12px;
    border-radius: 8px;
}

.users-table-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bulk-import-page {
    width: 100%;
    max-width: 100%;
}

.bulk-import-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.bulk-import-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0 0 6px;
}

.bulk-import-header p {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 14px;
    line-height: 1.6;
    max-width: 640px;
}

.bulk-import-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.bulk-import-header-actions .crm-filter-btn-secondary {
    height: 34px;
    padding: 0 14px;
    font-size: 13px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.bulk-import-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.bulk-import-step {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    font-size: 13px;
    color: var(--color-text-muted);
}

.bulk-import-step.is-active {
    border-color: #c4b5fd;
    background: #faf5ff;
    color: #6d28d9;
    font-weight: 600;
}

.bulk-import-step.is-done {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #15803d;
}

.bulk-import-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #374151;
    font-size: 12px;
    font-weight: 700;
}

.bulk-import-step.is-active .bulk-import-step-num {
    background: #9333ea;
    color: #ffffff;
}

.bulk-import-step.is-done .bulk-import-step-num {
    background: #22c55e;
    color: #ffffff;
}

.bulk-import-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1fr);
    gap: 20px;
    align-items: start;
}

.bulk-import-card {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(17, 24, 39, 0.05);
    padding: 24px 28px;
}

.bulk-import-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0 0 6px;
}

.bulk-import-card-desc {
    font-size: 13px;
    color: var(--color-text-muted);
    margin: 0 0 20px;
    line-height: 1.5;
}

.bulk-import-template-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    margin-bottom: 24px;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: 10px;
}

.bulk-import-template-meta {
    min-width: 0;
}

.bulk-import-template-meta strong {
    display: block;
    font-size: 14px;
    color: var(--color-text-primary);
    margin-bottom: 4px;
}

.bulk-import-template-meta span {
    font-size: 12px;
    color: var(--color-text-muted);
}

.bulk-import-upload-zone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 32px 20px;
    margin-bottom: 20px;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    background: #fafafa;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.bulk-import-upload-zone:hover,
.bulk-import-upload-zone.is-dragover {
    border-color: #a78bfa;
    background: #faf5ff;
}

.bulk-import-upload-zone svg {
    color: #9333ea;
}

.bulk-import-upload-zone p {
    margin: 0;
    font-size: 14px;
    color: var(--color-text-body);
    font-weight: 500;
}

.bulk-import-upload-zone > span:not(.bulk-import-file-label):not(.bulk-import-selected-file) {
    font-size: 12px;
    color: var(--color-text-muted);
}

.bulk-import-upload-zone input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.bulk-import-file-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
}

.bulk-import-file-label:hover {
    border-color: #9333ea;
    color: #7c3aed;
}

.bulk-import-selected-file {
    margin-top: 10px;
    font-size: 13px;
    color: #059669;
    font-weight: 500;
}

.bulk-import-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.bulk-import-form-error {
    margin: 0 0 16px;
}

.bulk-import-notes-list {
    margin: 0;
    padding-left: 18px;
    font-size: 14px;
    color: var(--color-text-body);
    line-height: 1.7;
}

.bulk-import-notes-list li + li {
    margin-top: 6px;
}

.bulk-import-summary {
    padding: 16px 18px;
    margin-bottom: 20px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    font-size: 14px;
}

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

.bulk-import-summary-stat {
    padding: 12px;
    background: #ffffff;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    text-align: center;
}

.bulk-import-summary-stat strong {
    display: block;
    font-size: 20px;
    color: var(--color-text-primary);
    line-height: 1.2;
}

.bulk-import-summary-stat span {
    font-size: 12px;
    color: var(--color-text-muted);
}

.bulk-import-summary-errors {
    margin: 12px 0 0;
    padding-left: 18px;
    color: #b91c1c;
    font-size: 13px;
}

.bulk-import-full-card {
    margin-bottom: 28px;
}

.bulk-import-map-list {
    margin: 10px 0 0;
    padding-left: 18px;
    font-size: 13px;
    color: var(--color-text-muted);
    line-height: 1.7;
}

.bulk-import-destination {
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--color-text-body);
}

.bulk-import-destination-tag {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f3e8ff;
    color: #6d28d9;
    font-size: 11px;
    font-weight: 600;
}

.bulk-import-hub-section-tag {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: #7c3aed;
}

.bulk-import-full-preview-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bulk-import-full-preview-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 12px;
}

.bulk-import-card .timesheet-table-wrap {
    margin: 0 -4px;
}

.bulk-import-columns-preview {
    margin: 0 0 18px;
    max-height: 280px;
    overflow: auto;
}

.bulk-import-card .table-note {
    border-top: none;
    background: transparent;
    padding: 10px 0 0;
}

.bulk-import-summary-stat .form-link {
    display: inline-block;
    margin-top: 6px;
    font-size: 12px;
}

.bulk-import-hub-card {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 22px 24px;
    box-shadow: 0 1px 3px rgba(17, 24, 39, 0.05);
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 180px;
}

.bulk-import-hub-card h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.bulk-import-hub-card p {
    margin: 0;
    flex: 1;
    font-size: 13px;
    color: var(--color-text-muted);
    line-height: 1.6;
}

.bulk-import-hub-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.bulk-import-hub-actions .crm-filter-btn,
.bulk-import-hub-actions .crm-filter-btn-secondary {
    height: 34px;
    padding: 0 14px;
    font-size: 13px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.bulk-import-preview-panel .bulk-import-preview-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--color-border);
}

.bulk-import-preview-panel .table-wrapper {
    overflow-x: auto;
}

.bulk-import-preview-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    padding: 16px 24px;
    border-top: 1px solid var(--color-border);
}

.bulk-import-preview-empty {
    text-align: center;
    padding: 24px;
    color: var(--color-text-muted);
}

.bulk-import-confirm-btn {
    background: #059669;
    border-color: #059669;
}

.bulk-import-confirm-btn:hover {
    background: #047857;
    border-color: #047857;
}

.table-bulk-upload-btn {
    height: 34px;
    padding: 0 14px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.data-table tbody tr.is-error-row td {
    background: #fef2f2;
    color: #b91c1c;
}

.form-link {
    color: var(--color-brand);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.form-link:hover {
    text-decoration: underline;
}

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

    .bulk-import-template-box {
        flex-direction: column;
        align-items: flex-start;
    }

    .bulk-import-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
