/* Premium Minimalist & Elegant Theme */
:root {
  /* Light Theme Variables */
  --bg-color: #fafafa;
  --surface-color: #ffffff;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --primary-color: #0f172a;
  --primary-hover: #334155;
  --accent-color: #3b82f6;
  --border-color: #e5e7eb;
  --radius: 6px;
  --font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"],
@media (prefers-color-scheme: dark) {
  :root {
    /* Dark Theme Variables */
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --primary-color: #f8fafc;
    --primary-hover: #e2e8f0;
    --accent-color: #60a5fa;
    --border-color: #334155;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  }
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-family);
  line-height: 1.6;
  transition: background-color 0.2s ease, color 0.2s ease;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Minimalist Card */
.modal-content, .document-category, .bulletin-panel, .card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
  transition: all 0.2s ease;
}

/* Unified Button Styling */
button, .btn, .primary-button {
  background: var(--primary-color);
  color: var(--bg-color); /* Contrast color */
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 10px 18px;
  font-family: var(--font-family);
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

button:hover, .btn:hover, .primary-button:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.danger-button {
  background: #ef4444;
  color: #fff;
}
.danger-button:hover {
  background: #dc2626;
}

/* Unified Input Styling */
input[type="text"],
input[type="password"],
input[type="email"],
textarea,
select {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-family: var(--font-family);
  font-size: 0.95rem;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Layout & Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  margin-top: 0;
  font-weight: 600;
}

p, label {
  color: var(--text-secondary);
}

.input-group {
  margin-bottom: 18px;
}
.input-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
/* Container: Start from left, very tight gaps */
.dashboard-summary-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start; /* Aligns everything strictly to the left */
    align-items: stretch;
    gap: 8px; /* Very tight spacing between cards */
    margin-bottom: 15px; 
}

/* Summary Items: Ultra-compact dimensions */
.summary-item {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-soft, #e2e8f0);
    border-radius: 6px; /* Slightly tighter corners */
    padding: 6px 12px; /* Drastically reduced padding */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); /* Subtler shadow */
    flex: 0 0 auto; /* Prevent stretching */
    min-width: max-content; /* Hug the content tightly */
    line-height: 1.2;
    text-align: left; /* Ensure text sits on the left */
}

/* Compact Typography for the labels */
.summary-item .label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
    margin-bottom: 2px;
    letter-spacing: 0.02em;
}

/* Compact Typography for the numbers */
.summary-item .value {
    font-size: 0.9rem !important; /* Smaller text for compactness */
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    color: var(--text-main, #1e293b);
}

/* Compress the micro-text (like "Active projects" or "Sup: 0 | Prog: 0") */
.summary-item > div[style*="font-size"] {
    font-size: 0.7rem !important; 
    margin-top: 2px;
    line-height: 1;
}

/* Styling for the hidden Options menu */
.dropdown-menu-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    z-index: 9999;
    flex-direction: column;
    padding: 6px;
}

.dropdown-menu-content.show {
    display: flex;
}

.dropdown-item {
    background: transparent;
    border: none;
    text-align: left;
    padding: 8px 12px;
    width: 100%;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    color: #334155;
    box-shadow: none; /* overrides global button shadow */
}

.dropdown-item:hover {
    background: #f1f5f9;
    transform: translateY(0); /* overrides global button hover */
    color: #0f172a;
}

.dropdown-item.primary-btn-style {
    background: #0f172a;
    color: white;
    text-align: center;
    margin-bottom: 5px;
}

.dropdown-item.primary-btn-style:hover {
    background: #334155;
}
/* Responsive */
@media (max-width: 600px) {
  .dashboard-main-content, ./* Project Editor Layout (Compact Version) */
        .project-editor-container { 
            display: flex; 
            height: calc(100vh - 46px); /* Increased height by reducing header allowance */
            position: relative; 
        }
        
        .project-editor-container .controls {
            width: 340px; /* Reduced default width from 450px */
            min-width: 250px; 
            flex-shrink: 0;
            display: flex; flex-direction: column; border-right: 1px solid rgba(0, 0, 0, 0.08);
        }
        /* ========================================================
   MAIN DASHBOARD PROJECT TABLE (Light Professional)
   ======================================================== */
.project-list-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 220px); /* Keeps the table contained within the view */
}

#project-list-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    white-space: nowrap; /* Prevents awkward column wrapping */
}

#project-list-table th {
    background: #f8fafc;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 10px 14px;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

#project-list-table td {
    padding: 8px 14px;
    font-size: 0.85rem;
    border-bottom: 1px solid #e2e8f0;
    color: var(--text-main);
    vertical-align: middle;
}

/* Subtle row hover for data tracking */
#project-list-table tbody tr {
    transition: background-color 0.1s ease;
}

#project-list-table tbody tr:hover {
    background-color: #f1f5f9;
}
/* Add this to your style.css or theme-premium-minimal.css file */

/* Scope Tab Panel Styling - Distinct Colors for Each Section */
.document-category {
    border-left: 4px solid;
    border-radius: 8px;
    margin-bottom: 20px;
    transition: box-shadow 0.2s ease;
}

.document-category:hover {
    box-shadow: var(--shadow-md);
}

/* Architectural Modification Proposal Panel - Teal/Blue */
#architectural-modification-proposal-panel {
    border-left-color: #0891b2;
    background: linear-gradient(135deg, rgba(8, 145, 178, 0.03) 0%, rgba(255, 255, 255, 0) 100%);
}

/* Scope Selection Container (Main Scope Sections) */
#scope-selection-container .document-category {
    border-left-color: #3b82f6;
}

/* Scope Sections - Different Colors by Section Type */
#scope-selection-container .document-category:nth-child(1) { border-left-color: #3b82f6; } /* Study and Design - Blue */
#scope-selection-container .document-category:nth-child(2) { border-left-color: #10b981; } /* Preliminary Design - Green */
#scope-selection-container .document-category:nth-child(3) { border-left-color: #f59e0b; } /* Final Stage - Amber */
#scope-selection-container .document-category:nth-child(4) { border-left-color: #8b5cf6; } /* Interior Design - Purple */
#scope-selection-container .document-category:nth-child(5) { border-left-color: #ef4444; } /* Tender Documents - Red */
#scope-selection-container .document-category:nth-child(6) { border-left-color: #ec4899; } /* Supervision Works - Pink */
#scope-selection-container .document-category:nth-child(7) { border-left-color: #06b6d4; } /* Consultant's Duties - Cyan */
#scope-selection-container .document-category:nth-child(8) { border-left-color: #84cc16; } /* BIM Services - Lime */
#scope-selection-container .document-category:nth-child(9) { border-left-color: #14b8a6; } /* BIM LOD - Teal */
#scope-selection-container .document-category:nth-child(10) { border-left-color: #f97316; } /* Structural Review - Orange */
#scope-selection-container .document-category:nth-child(11) { border-left-color: #6366f1; } /* Principles of Calculation - Indigo */
#scope-selection-container .document-category:nth-child(12) { border-left-color: #d946ef; } /* Owner's Obligations - Fuchsia */
#scope-selection-container .document-category:nth-child(13) { border-left-color: #eab308; } /* Amendments - Yellow */
#scope-selection-container .document-category:nth-child(14) { border-left-color: #64748b; } /* Extension - Slate */

/* Paste Scope Content Panel - Purple */
.document-category:has(#scope-pasted-text) {
    border-left-color: #8b5cf6;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.03) 0%, rgba(255, 255, 255, 0) 100%);
}

/* Sign & Stamp Settings Panel - Amber/Gold */
.document-category:has(#scope-include-signature) {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
}

/* Brief Proposal Terms & Conditions Panel - Emerald */
.document-category:has(#brief-terms-container) {
    border-left-color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.03) 0%, rgba(255, 255, 255, 0) 100%);
}

/* Manual Document Page Breaks Panel - Slate */
.document-category:has(.section-page-break[data-section-id="timeSpan"]) {
    border-left-color: #64748b;
    background: #f8fafc;
}

/* Fees Tab Panels */
#fees-tab .document-category {
    border-left-color: #8b5cf6;
}

#fees-tab .financial-summary {
    border-left-color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
}

/* Payment Cert Tab Panels */
#payment-cert-tab .document-category {
    border-left-color: #ef4444;
}

/* Schedule Tab Panels */
#schedule-tab .document-category {
    border-left-color: #f59e0b;
}

/* Letters Tab Panels */
#project-letters-tab .tool-card {
    border-left: 4px solid #3b82f6;
}

#project-letters-tab .form-section {
    border-left: 3px solid;
    padding-left: 15px;
    margin-bottom: 20px;
}

#project-letters-tab .form-section:nth-child(1) { border-left-color: #3b82f6; }
#project-letters-tab .form-section:nth-child(2) { border-left-color: #10b981; }
#project-letters-tab .form-section:nth-child(3) { border-left-color: #f59e0b; }
#project-letters-tab .form-section:nth-child(4) { border-left-color: #8b5cf6; }

/* Invoicing Tab Panels */
#invoicing-tab .document-category {
    border-left-color: #ec4899;
}

/* Invoice Table Styling */
.document-table {
    border-collapse: collapse;
    width: 100%;
}

.document-table th,
.document-table td {
    border: 1px solid #e2e8f0;
    padding: 10px;
    text-align: left;
}

.document-table th {
    background-color: #f8fafc;
    font-weight: 600;
}

/* Progress Bar Styling */
.progress-bar-container {
    background-color: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    height: 8px;
}

.progress-bar {
    background-color: #3b82f6;
    height: 100%;
    transition: width 0.3s ease;
}

/* Status Badges */
.status-pending { color: #f59e0b; font-weight: bold; }
.status-in-progress { color: #3b82f6; font-weight: bold; }
.status-under-supervision { color: #8b5cf6; font-weight: bold; }
.status-completed { color: #10b981; font-weight: bold; }
.status-on-hold { color: #ef4444; font-weight: bold; }
.status-cancelled { color: #64748b; font-weight: bold; }
.status-raised { color: #f59e0b; font-weight: bold; }
.status-paid { color: #10b981; font-weight: bold; }
.status-draft { color: #64748b; font-weight: bold; }

/* Additional styling for section headers with colored borders */
.scope-section h4 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 2px solid;
    margin-bottom: 15px;
}

.scope-section h4 span:first-child {
    font-weight: 700;
}

/* Inherit border color from parent for section headers */
.scope-section {
    border-left: 4px solid;
}

.scope-section h4 {
    border-bottom-color: inherit;
}

/* Make the border colors more vibrant on hover */
.document-category:hover,
.scope-section:hover {
    border-left-width: 5px;
    transition: border-left-width 0.1s ease;
}

/* Dark theme adjustments */
[data-theme="dark"] .document-category,
@media (prefers-color-scheme: dark) {
    .document-category {
        background: var(--surface-color);
    }
    
    .document-category:has(#scope-pasted-text),
    .document-category:has(#scope-include-signature),
    .document-category:has(#brief-terms-container) {
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0%, var(--surface-color) 100%);
    }
}

/* Print styles - preserve border colors for identification */
@media print {
    .document-category,
    .scope-section {
        border-left-width: 2px !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}
/* Remove bottom border from the last row */
#project-list-table tbody tr:last-child td {
    border-bottom: none;
}
        .project-editor-container .preview-area { flex-grow: 1; display: flex; flex-direction: column; min-width: 300px; }

        #resizer {
            width: 6px; background: #cbd5e1; cursor: col-resize; flex-shrink: 0;
            position: relative; z-index: 50; transition: background 0.15s ease, width 0.15s ease;
        }
        #resizer:hover, #resizer.dragging { background: #3b82f6; width: 8px; }
        #resizer::after { content: ''; position: absolute; top: 0; bottom: 0; left: -5px; right: -5px; cursor: col-resize; }

        body.resizing-active { user-select: none !important; -webkit-user-select: none !important; cursor: col-resize !important; }

        .tab-content-container, .preview-content-container { flex-grow: 1; overflow-y: auto; position: relative; }
        .tab-content-container { padding: 10px; } /* Reduced padding inside the controls area */

        .preview-area .preview-controls {
            display: flex; justify-content: space-between; align-items: center;
            padding: 5px 10px; /* Thinner preview toolbar */
            border-bottom: 1px solid #ddd; background-color: #f9f9f9; flex-shrink: 0;
        }
        .preview-tab-content { padding: 10px; }

        /* ===== NEW: Compact UI Overrides for Project View ===== */
        #project-view .app-header {
            padding: 6px 15px; /* Thinner top header */
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-bottom: 1px solid #e2e8f0;
            background: #fff;
        }
        
        #project-view-title { 
            font-size: 1.15rem; 
            margin: 0; 
        }
        
        #project-view .dashboard-header-controls button {
            padding: 4px 10px;
            font-size: 0.85em;
        }
        
        #project-view .dashboard-header-controls span {
            padding: 4px 8px !important;
            font-size: 0.85em;
        }
        
        /* Compress the tab buttons */
        .tabs.control-tabs .tab-button, 
        .tabs.preview-tabs .tab-button {
            padding: 5px 8px;
            font-size: 0.82em;
            margin-bottom: 2px;
        }
  .controls, .bulletin-panel {
    width: 100% !important;
  }
}
