/**
 * SiteLine Pro Shared Styles
 *
 * Common styles used across multiple pages.
 * This file imports all component CSS and provides base styles.
 *
 * @version 2.0.0
 * @updated 2026-03-22
 */

@import url('/fonts/hugeicons/icons.css?v=25864ad7');
@import url('/fonts/hugeicons/icons-stroke-standard.css?v=25864ad7');
@import url('variables.css?v=25864ad7');
@import url('components/buttons.css?v=25864ad7');
@import url('components/forms.css?v=25864ad7');
@import url('v0-theme.css?v=25864ad7');
@import url('piper-brand.css?v=25864ad7');

/* ============================================
   HUGEICONS — sizing utilities
   ============================================ */

/* Default inline icon size */
[class*='hgi-'] {
    font-size: 16px;
    line-height: 1;
    vertical-align: middle;
    display: inline-block;
}

/* Size modifiers */
.hgi-sm {
    font-size: 14px;
}
.hgi-lg {
    font-size: 20px;
}
.hgi-xl {
    font-size: 24px;
}

/* ============================================
   BASE RESET
   ============================================ */

* {
    box-sizing: border-box;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--text-primary);
    background: var(--bg-secondary);
    min-height: 100vh;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    color: var(--text-primary);
}

/* Display headings use Barlow Condensed for editorial weight */
h1,
h2,
h3,
h4 {
    font-family: var(--font-family-condensed);
    font-weight: var(--font-weight-bold);
}

h1 {
    font-size: var(--font-size-3xl);
}
h2 {
    font-size: var(--font-size-2xl);
}
h3 {
    font-size: var(--font-size-xl);
}
h4 {
    font-size: var(--font-size-lg);
}
h5 {
    font-size: var(--font-size-md);
}
h6 {
    font-size: var(--font-size-base);
}

p {
    margin: 0 0 var(--space-4);
}

a {
    color: var(--text-link);
    text-decoration: none;
}

a:hover {
    color: var(--text-link-hover);
    text-decoration: underline;
}

/* ============================================
   LAYOUT
   ============================================ */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-5);
}

.container-sm {
    max-width: 800px;
}

.container-lg {
    max-width: 1600px;
}

.page-content {
    padding: var(--space-8) 0;
}

/* Flex utilities */
.flex {
    display: flex;
}

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

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

.flex-col {
    flex-direction: column;
}

.gap-1 {
    gap: var(--space-1);
}
.gap-2 {
    gap: var(--space-2);
}
.gap-3 {
    gap: var(--space-3);
}
.gap-4 {
    gap: var(--space-4);
}
.gap-5 {
    gap: var(--space-5);
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--border-light);
}

.card-body {
    padding: var(--space-6);
}

.card-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

/* ============================================
   TABLES
   ============================================ */

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.table th {
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    background: var(--bg-secondary);
}

.table tbody tr:hover {
    background: var(--bg-secondary);
}

.table-compact th,
.table-compact td {
    padding: var(--space-2) var(--space-3);
}

/* ============================================
   STATUS MESSAGES
   ============================================ */

.status {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
}

.status-success {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.status-error {
    background: var(--color-error-bg);
    color: var(--color-error);
}

.status-warning {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.status-info {
    background: var(--color-info-bg);
    color: var(--color-info);
}

/* Alternative status classes */
.status-message {
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
    font-size: var(--font-size-base);
}

.status-message.success,
.modal-status.success {
    background: var(--color-success-bg);
    color: var(--color-success-text);
}

.status-message.error,
.modal-status.error {
    background: var(--color-error-bg);
    color: var(--color-error-text);
}

/* ============================================
   LOADING STATES
   ============================================ */

.loading-spinner,
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

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

.loading-overlay {
    position: absolute;
    inset: 0;
    background: var(--bg-loading-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.loading-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.loading-state .spinner {
    margin: 0 auto 20px;
}

/* ============================================
   MODALS
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-modal-overlay);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-modal);
    width: 90%;
    max-width: var(--modal-width-md);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: transform var(--transition-base);
}

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

.modal-sm {
    max-width: var(--modal-width-sm);
}
.modal-lg {
    max-width: var(--modal-width-lg);
}

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

.modal-header h2,
.modal-header h3 {
    margin: 0;
    font-size: var(--font-size-lg);
}

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

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

.modal-body {
    padding: var(--modal-padding);
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

.modal-footer {
    padding: var(--space-4) var(--modal-padding);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    background: var(--bg-secondary);
}

/* ============================================
   HEADER
   ============================================ */

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--header-padding);
    background: var(--bg-header);
    border-bottom: var(--border-width) solid var(--border-light);
    font-family: var(--font-family-primary);
}

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

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

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-section img {
    height: 55px;
    width: auto;
    margin: -10px;
    margin-right: 0;
}

.logo-text {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-navy);
    letter-spacing: -0.5px;
}

.logo-text .tm {
    font-size: 0.4em;
    vertical-align: super;
    font-weight: 400;
    opacity: 0.5;
}

/* Dev environment logo indicator */
.dev-logo {
    width: 55px;
    height: 55px;
    background: #ff69b4;
    border-radius: 8px;
    margin: -10px;
    margin-right: 0;
}

.header-divider {
    width: 1px;
    height: 40px;
    background: var(--border-medium);
    margin-left: 10px;
}

/* User menu in header */
.user-menu {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-base);
}

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

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--color-green);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
}

/* Welcome section (dashboard header) */
.welcome-section {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.welcome-greeting {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.welcome-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
    padding: var(--space-6) var(--space-8);
    background: var(--bg-footer);
    border-top: 1px solid var(--border-light);
    text-align: center;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.site-footer a {
    color: var(--text-secondary);
    margin: 0 var(--space-3);
}

.site-footer a:hover {
    color: var(--text-primary);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Text alignment */
.text-center {
    text-align: center;
}
.text-right {
    text-align: right;
}
.text-left {
    text-align: left;
}

/* Text colors */
.text-muted {
    color: var(--text-muted);
}
.text-secondary {
    color: var(--text-secondary);
}
.text-success {
    color: var(--color-success);
}
.text-error {
    color: var(--color-error);
}
.text-warning {
    color: var(--color-warning);
}

/* Text sizes */
.text-xs {
    font-size: var(--font-size-xs);
}
.text-sm {
    font-size: var(--font-size-sm);
}
.text-base {
    font-size: var(--font-size-base);
}
.text-lg {
    font-size: var(--font-size-lg);
}
.text-xl {
    font-size: var(--font-size-xl);
}

/* Font weights */
.font-normal {
    font-weight: var(--font-weight-normal);
}
.font-medium {
    font-weight: var(--font-weight-medium);
}
.font-semibold {
    font-weight: var(--font-weight-semibold);
}
.font-bold {
    font-weight: var(--font-weight-bold);
}

/* Margin utilities */
.mt-0 {
    margin-top: 0;
}
.mt-1 {
    margin-top: var(--space-1);
}
.mt-2 {
    margin-top: var(--space-2);
}
.mt-3 {
    margin-top: var(--space-3);
}
.mt-4 {
    margin-top: var(--space-4);
}
.mt-5 {
    margin-top: var(--space-5);
}

.mb-0 {
    margin-bottom: 0;
}
.mb-1 {
    margin-bottom: var(--space-1);
}
.mb-2 {
    margin-bottom: var(--space-2);
}
.mb-3 {
    margin-bottom: var(--space-3);
}
.mb-4 {
    margin-bottom: var(--space-4);
}
.mb-5 {
    margin-bottom: var(--space-5);
}

.ml-0 {
    margin-left: 0;
}
.ml-1 {
    margin-left: var(--space-1);
}
.ml-2 {
    margin-left: var(--space-2);
}
.ml-3 {
    margin-left: var(--space-3);
}
.ml-4 {
    margin-left: var(--space-4);
}

.mr-0 {
    margin-right: 0;
}
.mr-1 {
    margin-right: var(--space-1);
}
.mr-2 {
    margin-right: var(--space-2);
}
.mr-3 {
    margin-right: var(--space-3);
}
.mr-4 {
    margin-right: var(--space-4);
}

/* Padding utilities */
.p-0 {
    padding: 0;
}
.p-1 {
    padding: var(--space-1);
}
.p-2 {
    padding: var(--space-2);
}
.p-3 {
    padding: var(--space-3);
}
.p-4 {
    padding: var(--space-4);
}
.p-5 {
    padding: var(--space-5);
}

/* Display utilities */
.hidden {
    display: none !important;
}
.invisible {
    visibility: hidden;
}
.block {
    display: block;
}
.inline {
    display: inline;
}
.inline-block {
    display: inline-block;
}

/* Width utilities */
.w-full {
    width: 100%;
}
.w-auto {
    width: auto;
}

/* ============================================
   SMART START COMPONENTS
   ============================================ */

/* Smart Start Button (AI Gold) */
.smart-import-btn {
    background: var(--color-ai-gold) !important;
    color: var(--color-navy) !important;
    border: none !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
}

.smart-import-btn:hover {
    background: var(--color-gold-dark) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(234, 188, 89, 0.4);
}

/* File Upload Zone */
.file-upload-zone {
    border: 2px dashed var(--border-medium);
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
}

.file-upload-zone:hover {
    border-color: var(--color-success);
    background: var(--color-success-bg);
}

.file-upload-zone.drag-over {
    border-color: var(--color-success);
    background: var(--color-success-bg);
}

.file-upload-content {
    pointer-events: none;
}

.file-upload-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.file-upload-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.file-upload-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

/* File Selected Info */
.file-selected-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--color-success-bg);
    border: 1px solid var(--color-success);
    border-radius: 6px;
    margin-top: 12px;
}

.file-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.file-remove-btn {
    padding: 4px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-medium);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.file-remove-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--border-dark);
}

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--border-medium);
    border-radius: 4px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-success), var(--color-green-light));
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.processing-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.progress-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-top: 12px;
}

.progress-percent {
    font-size: 24px;
    font-weight: 600;
    color: var(--color-success);
    margin-top: 8px;
}

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

/* Preview Tree */
.preview-tree {
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    padding: 20px;
    background: var(--bg-secondary);
    margin-bottom: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.preview-section {
    margin-bottom: 16px;
}

.preview-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.preview-section-header:hover {
    border-color: var(--color-success);
    background: var(--color-success-bg);
}

.preview-section-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.preview-section-name {
    flex: 1;
    font-weight: 600;
    color: var(--text-primary);
}

.preview-section-count {
    font-size: 12px;
    color: var(--text-muted);
}

.preview-subsections {
    margin-left: 40px;
    margin-top: 8px;
}

.preview-subsection {
    padding: 6px 12px;
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-subsection-checkbox {
    width: 15px;
    height: 15px;
    cursor: pointer;
    flex-shrink: 0;
}

/* Flagged item diff display */
.flagged-diff {
    margin: 8px 0;
}

.flagged-diff-line {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px;
    padding: 2px 0;
    font-size: 13px;
}

.flagged-diff-old {
    color: var(--text-muted);
    text-decoration: line-through;
}

.flagged-diff-arrow {
    color: var(--color-success);
    font-weight: 700;
    flex-shrink: 0;
}

.flagged-diff-new {
    color: var(--text-primary);
    font-weight: 500;
}

/* Preview Summary */
.preview-summary {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    padding: 16px 20px;
    display: flex;
    gap: 30px;
    align-items: center;
    margin-bottom: 20px;
}

.preview-summary-icon {
    font-size: 24px;
}

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

/* Flagged Items */
.flagged-items-section {
    margin-top: 20px;
}

.flagged-items-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--color-orange);
}

/* Revenue rows detected during import — positive/green accent, distinct
   from the warning-toned flagged-items section above. */
.revenue-items-section h3 {
    color: var(--color-success, #2e7d32);
}

.revenue-items-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin: -4px 0 12px;
}

.revenue-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--color-success-bg, #e8f5e9);
    border: 1px solid var(--color-success, #2e7d32);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 8px;
}

.revenue-item-checkbox {
    display: flex;
    align-items: center;
}

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

.revenue-item-amount {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-success-text, #2e7d32);
}

.revenue-item.is-excluded {
    background: var(--bg-hover);
    border-color: var(--border-medium);
    opacity: 0.7;
}

.revenue-item.is-excluded .revenue-item-description,
.revenue-item.is-excluded .revenue-item-amount {
    color: var(--text-muted);
    text-decoration: line-through;
}

.revenue-item-skipped-badge {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    border-radius: 3px;
    padding: 2px 8px;
}

.flagged-item-card {
    background: var(--color-orange-bg);
    border: 1px solid var(--color-orange-border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.flagged-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.flagged-item-icon {
    font-size: 20px;
    color: var(--color-orange);
}

.flagged-item-path {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.flagged-item-issue {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 8px;
}

.flagged-item-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.flagged-item-actions button {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    border: 1px solid var(--border-medium);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.flagged-item-actions button:hover {
    border-color: var(--color-success);
    background: var(--color-success-bg);
}

.flagged-item-description {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.flagged-item-details {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    background: var(--bg-hover);
    border-radius: 5px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.flagged-item-notes {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 6px;
}

.confidence-badge {
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.confidence-badge.high {
    background: var(--color-success-bg);
    color: var(--color-success-text);
}

.confidence-badge.medium {
    background: var(--color-orange-bg);
    color: var(--color-orange);
}

.confidence-badge.low {
    background: var(--color-error-bg);
    color: var(--color-error-text);
}

.flagged-item-actions button.btn-delete {
    background: var(--color-error-bg);
    border-color: var(--color-error);
    color: var(--color-error-text);
}

.flagged-item-actions button.btn-delete:hover {
    background: var(--color-error-bg);
    border-color: var(--color-error);
}

/* Flagged item inline edit form */
.flagged-edit-form {
    margin: 8px 0 12px;
}

.flagged-edit-form label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.flagged-edit-form input[type='text'],
.flagged-edit-form input[type='number'] {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--border-medium);
    border-radius: 4px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.flagged-edit-form input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px var(--color-success-bg);
}

.flagged-edit-desc {
    margin-bottom: 10px;
}

.flagged-edit-row {
    display: flex;
    gap: 10px;
}

.flagged-edit-row > div {
    flex: 1;
    min-width: 0;
}

.flagged-item-actions button.btn-save {
    background: var(--color-success);
    border-color: var(--color-success);
    color: var(--glass-text-full);
}

.flagged-item-actions button.btn-save:hover {
    background: var(--color-green-dark);
    border-color: var(--color-green-dark);
}

.flagged-item-card.is-accepted {
    border-color: var(--color-success);
    background: var(--color-success-bg);
}

.flagged-item-card.is-removed {
    opacity: 0.65;
    border-color: var(--color-error);
    background: var(--color-error-bg);
}

.flagged-item-card.is-removed .flagged-item-description {
    text-decoration: line-through;
    color: var(--text-muted);
}

.flagged-decision-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.flagged-decision-badge.accepted {
    background: var(--color-success-bg);
    color: var(--color-success-text);
}

.flagged-decision-badge.removed {
    background: var(--color-error-bg);
    color: var(--color-error-text);
}

/* POC-301: an informational flag the user acknowledged ("Got it"). Neutral/muted,
   distinct from the success-green "Accepted" decision. */
.flagged-decision-badge.dismissed {
    background: var(--color-surface-muted, #eef1f4);
    color: var(--color-text-secondary, #5a6472);
}

/* Import Progress Bar (DB line item insertion) */
#importItemProgressBar {
    margin: 15px 0;
    display: none;
}

#importItemProgressTrack {
    background: var(--border-medium);
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
}

#importItemProgressFill {
    background: linear-gradient(90deg, var(--color-success), var(--color-green-light));
    height: 8px;
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

#importItemProgressCount {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

/* Modal Sizes */
.modal-narrow {
    max-width: 500px !important;
}

.modal-wide {
    max-width: 900px !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 992px) {
    .welcome-section {
        display: none;
    }

    .header-divider {
        display: none;
    }
}

@media (max-width: 768px) {
    .site-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
    }

    .header-left {
        width: 100%;
        justify-content: center;
    }

    .header-right {
        width: 100%;
        justify-content: center;
    }

    .logo-text {
        font-size: 24px;
    }

    .container {
        padding: 0 var(--space-4);
    }
}

@media (max-width: 480px) {
    .modal {
        width: 95%;
        max-height: 95vh;
    }
}

/* ============================================
   ADDITIVE SUMMARY LEDGER (POC-189 / POC-195)
   ============================================ */
/* The single on-screen summary layout, shared by the budget editor, the client
   read-only view, and the Compare Versions modal. Theme-safe: every colour is an
   existing CSS variable. The two budget rows (Committed budget, Total budget) read
   as a matched pair at 14px — one step above the 13px increment rows. Depends on
   each page's base .summary-row (budget-edit.css / project_detail.html inline);
   the .additive-* selectors out-specify the base so source order is irrelevant. */
.summary-row.additive-row td {
    padding: 8px 5px;
}
.summary-row.additive-base {
    background: var(--bg-tertiary);
    border-top: 2px solid var(--border-dark);
}
.summary-row.additive-base td {
    color: var(--text-secondary);
}
.summary-row.additive-increment td {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}
/* Committed budget — the pre-contingency subtotal that carries the working margin.
   A divider above it closes the "committed budget" group (Line items + Tax + fee). */
.summary-row.additive-subtotal td {
    background: var(--bg-hover);
    font-weight: 700;
    font-size: 14px; /* matched pair with Total budget; one step above 13px increments */
    border-top: 1px solid var(--border-dark);
    padding-top: 9px;
    padding-bottom: 9px;
}
/* Contingency — a reserve that may not be spent, set apart from the committed budget. */
.summary-row.additive-reserve td {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-style: italic;
}
.summary-row.additive-reserve .reserve-tag {
    font-style: normal;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
    padding: 1px 6px;
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    white-space: nowrap;
}
/* POC-246: budget-health badge — shared across dashboard, editor totals and the
   Version Management modal. Markup is emitted by budget-health.js (healthBadgeHtml);
   the three state classes map to the success/warning/error background tokens. */
/* Proportions match the dashboard .stage-badge (padding/font-size/radius/line-height)
   so the status pill and health pill read as equally sized siblings. */
.health-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 10px;
    line-height: 1.4;
    white-space: nowrap;
    vertical-align: middle;
    margin-left: 6px;
}
/* Uniform weight (700) so two badges read as the same size side-by-side (POC-248);
   severity is carried by COLOR: green = on target (calm/good, soft); yellow = AT RISK
   (black on bright yellow, a warning); red = OVER TARGET (white on saturated red). */
.health-badge.health-green {
    background-color: var(--color-success-bg);
    color: var(--color-success);
}
.health-badge.health-yellow {
    background-color: #ffd21e;
    color: #1a1a1a;
}
.health-badge.health-red {
    background-color: var(--color-error);
    color: #ffffff;
}
/* POC-246: editor Target-budget variance text, keyed to the health band. Vivid +
   !important so it reads as clearly coloured thin text (the muted token colours look
   near-black at this size) and survives any broad summary-cell colour override.
   All three measure Total − Target: cut = red ("over", Total + Working both over);
   reserve = amber ("over", Total over via contingency only — Working still under);
   spare = green ("under", Total under target). */
.target-variance-cut {
    color: #e5484d !important;
    font-weight: 700;
}
.target-variance-reserve {
    color: #d97706 !important;
    font-weight: 700;
}
.target-variance-spare {
    color: #1f9d57 !important;
    font-weight: 700;
}
.target-variance-on {
    color: var(--text-secondary);
}
.summary-row.additive-total {
    background: var(--color-navy);
    color: white;
}
.summary-row.additive-total td {
    font-weight: 600;
    font-size: 14px; /* matched pair with Committed budget */
    padding: 10px 5px;
    /* Paint the navy on the cell, not only the row: the client view's
       `html[data-theme='light'] .budget-table tr` override sets a light row
       background with !important, which would otherwise hide the white text.
       A td background paints over the row's, mirroring .additive-subtotal. */
    background: var(--color-navy);
    color: white;
    border-top: 2px solid var(--color-navy);
}
/* POC-206 profit lines — the bottom-line takeaway rendered after Total budget on the
   budget editor: Working profit (our margin) always, Event profit (event P&L) when a
   revenue block is present. The value colour (success/error) is set inline; the
   background is painted on the td so a row-level background override can't hide it. A
   divider above the first profit line sets the block apart from Total budget. */
.summary-row.additive-profit td {
    background: var(--color-success-bg);
    font-weight: 700;
    font-size: 14px;
    padding-top: 9px;
    padding-bottom: 9px;
}
.summary-row.additive-profit-working td {
    border-top: 2px solid var(--border-dark);
}
/* Rounded green gross-profit card (a div after the summary table) — the client
   read-only view's P&L. Right-aligned via margin-left:auto so its values sit toward
   the OUT/Total column. 16px symmetric padding keeps the card balanced. */
.additive-profit-card {
    max-width: 360px;
    margin: 12px 0 4px auto;
    padding: 12px 16px;
    background: var(--color-success-bg);
    border: 1px solid var(--color-success);
    border-radius: 8px;
}
.additive-profit-card .apc-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 3px 0;
    font-size: 13px;
    color: var(--text-primary);
}
.additive-profit-card .apc-revenue {
    font-weight: 600;
}
.additive-profit-card .apc-cost .apc-label,
.additive-profit-card .apc-cost .apc-value {
    color: var(--text-secondary);
}
.additive-profit-card .apc-result {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid var(--color-success);
    font-weight: 700;
    font-size: 15px;
    color: var(--color-success);
}
.additive-profit-card .apc-margin {
    font-size: 12px;
    color: var(--text-secondary);
}
