/* ==========================================================================
   1. IMPORTS & LUXURIOUS VARIABLE DESIGN SYSTEM
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    /* --- Typography --- */
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* --- Brand Colors (Luxury Blues & Iris Accents) --- */
    --c-primary-600: #4f46e5;       /* Royal Iris */
    --c-primary-500: #6366f1;       /* Light Iris */
    --c-primary-100: #e0e7ff;       /* Soft Ice */
    --c-primary-50:  #f5f3ff;       /* Mist Purple */
    --c-white:       #ffffff;

    /* --- Neutral Scales (Mineral Slate) --- */
    --c-slate-900: #0f172a;         /* Deep Mineral */
    --c-slate-800: #1e293b;
    --c-slate-700: #334155;
    --c-slate-500: #64748b;
    --c-slate-300: #cbd5e1;
    --c-slate-200: #e2e8f0;
    --c-slate-100: #f1f5f9;
    --c-slate-50:  #f8fafc;

    /* --- Status Palette --- */
    --c-status-green-text:  #bacf48; --c-status-green-bg:  #ffffff;
    --c-status-yellow-text: #f7da42; --c-status-yellow-bg: #ffffff;
    --c-status-blue-text:   #00b3ff; --c-status-blue-bg:   #ffffff;
    --c-status-red-text:    #fe4401; --c-status-red-bg:    #ffffff;
    --c-status-gray-text:   #475569; --c-status-gray-bg:   #ffffff;
    --c-status-purple-text: #6d28d9; --c-status-purple-bg: #ffffff;

    /* --- Dimensions & Spacing --- */
    --sidebar-width: 280px;
    --spacing-1: 0.25rem;
    --spacing-2: 0.5rem;
    --spacing-3: 0.75rem;
    --spacing-4: 1rem;
    --spacing-5: 1.25rem;
    --spacing-6: 1.5rem;
    --spacing-8: 2rem;
    --radius:    10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* --- Sophisticated Transitions --- */
    --ease-lux: cubic-bezier(0.16, 1, 0.3, 1);
    --transition: all 0.4s var(--ease-lux);

    /* --- Advanced Box Shadows --- */
    --shadow-sm: 0 2px 10px -2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.02);
    --shadow:    0 8px 30px -10px rgba(15, 23, 42, 0.08), 0 1px 4px rgba(15, 23, 42, 0.02);
    --shadow-lg: 0 25px 60px -15px rgba(15, 23, 42, 0.12), 0 4px 15px rgba(15, 23, 42, 0.04);
}

/* ==========================================================================
   2. GLOBAL RESETS & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--c-slate-700);
    background-color: var(--c-slate-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.hidden {
    display: none !important;
}

/* Custom Premium Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--c-slate-300);
    border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--c-slate-500);
}

/* ==========================================================================
   3. MAIN LAYOUT STRUCTURE
   ========================================================================== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* --- Floating Luxury Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    height: calc(100vh - 32px);
    position: fixed;
    top: 16px;
    left: 16px;
    background-color: var(--c-white);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    padding: var(--spacing-6);
    z-index: 100;
}

.sidebar-header {
    padding-bottom: var(--spacing-6);
    margin-bottom: var(--spacing-6);
    border-bottom: 1px solid var(--c-slate-100);
}

.sidebar-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 var(--spacing-2) 0;
    color: var(--c-slate-900);
    letter-spacing: 1.5px;
    line-height: 1.1;
}

.sidebar-subtitle {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--c-primary-600);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-4);
    padding: 0.8rem 1.2rem;
    border-radius: var(--radius);
    color: var(--c-slate-500);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
}

.nav-link:hover {
    background-color: var(--c-primary-50);
    color: var(--c-primary-600);
}

.nav-link.active {
    background-color: var(--c-primary-600);
    color: var(--c-white);
    font-weight: 700;
    box-shadow: 0 8px 20px -6px rgba(79, 70, 229, 0.4);
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: var(--transition);
}

.nav-link.active .nav-icon {
    color: var(--c-white);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: var(--spacing-4);
    border-top: 1px solid var(--c-slate-100);
}

/* --- Main Viewport Adjustment --- */
.main-content {
    margin-left: calc(var(--sidebar-width) + 32px);
    width: calc(100% - var(--sidebar-width) - 48px);
    padding: var(--spacing-8) var(--spacing-6);
}

/* --- Header / Top Bar --- */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-8);
}

#page-title {
    font-size: 2.25rem;
    font-weight: 800;
    margin: 0;
    color: var(--c-slate-900);
    letter-spacing: -1.5px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-4);
}

/* ==========================================================================
   4. UI COMPONENTS: BUTTONS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-2);
    padding: 0.75rem 1.5rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.btn-primary {
    background-color: var(--c-primary-600);
    color: var(--c-white);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--c-primary-500);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.35);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--c-white);
    color: var(--c-slate-700);
    border-color: var(--c-slate-200);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--c-slate-50);
    border-color: var(--c-primary-600); 
    transform: translateY(-1px);
}

.btn-icon {
    background-color: var(--c-white);
    color: var(--c-slate-500);
    border-color: var(--c-slate-200);
    padding: var(--spacing-2);
}

.btn-icon:hover {
    color: var(--c-primary-600);
    background-color: var(--c-primary-50);
    border-color: var(--c-primary-100);
}

/* ==========================================================================
   5. UI COMPONENTS: CARDS & TABS
   ========================================================================== */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.6s var(--ease-lux);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to   { opacity: 1; transform: translateY(0); }
}

.card {
    background-color: var(--c-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-5) var(--spacing-6);
    border-bottom: 1px solid var(--c-slate-100);
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--c-slate-900);
    margin: 0;
}

/* ==========================================================================
   6. CONTROLS & FILTERING
   ========================================================================== */
.page-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: var(--spacing-5);
}

.filter-input {
    padding: 0.75rem 1.25rem;
    border: 1px solid var(--c-slate-200);
    border-radius: var(--radius);
    min-width: 320px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    background-color: var(--c-white);
}

.filter-input:focus {
    outline: none;
    border-color: var(--c-primary-500);
    box-shadow: 0 0 0 4px var(--c-primary-50);
}

/* ==========================================================================
   7. PROJECT LIST & CARDS (The Active Requests)
   ========================================================================== */
.project-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-5);
}

.project-card {
    background-color: var(--c-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-left: 6px solid var(--c-slate-300);
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.project-card.expanded {
    box-shadow: var(--shadow-lg);
    border-color: var(--c-slate-400);
}

/* High-End Palette Status Indicators */
.project-card.project-status--overdue { border-left-color: var(--c-status-red-text); }
.project-card.project-status--waiting-for-confirmation { border-left-color: var(--c-status-yellow-text); }
.project-card.project-status--in-progress { border-left-color: var(--c-status-blue-text); }
.project-card.project-status--new { border-left-color: var(--c-status-green-text); }
.project-card.completed-project-group { border-left-color: var(--c-slate-500); }

/* Project Header Layout */
.project-header {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: var(--spacing-6);
    padding: 1.5rem 2rem;
    cursor: pointer;
}

.project-header-main {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    font-weight: 700;
    color: var(--c-slate-900);
    font-size: 1.15rem;
    letter-spacing: -0.5px;
}

.project-header-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    color: var(--c-slate-500);
    font-size: 0.9rem;
    font-weight: 500;
}

.project-header-info svg {
    width: 16px;
    height: 16px;
}

.project-header-toggle {
    color: var(--c-slate-400);
    transition: transform 0.4s var(--ease-lux);
}

.expanded .project-header-toggle {
    transform: rotate(90deg);
    color: var(--c-primary-600);
}

/* Smooth Expandable Details Area */
.project-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s var(--ease-lux);
}

.expanded .project-details {
    max-height: 1500px;
}

/* Inner Table Styles */
.product-table {
    width: 100%;
    border-collapse: collapse;
}

.product-table th, .product-table td {
    padding: 1rem 2rem;
    text-align: left;
    border-top: 1px solid var(--c-slate-100);
}

.product-table th {
    font-weight: 700;
    color: var(--c-slate-400);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.product-table td {
    font-size: 0.95rem;
    font-weight: 500;
}

.actions-cell {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    justify-content: flex-end;
}

/* Micro-Interactive Action Buttons */
.icon-btn {
    cursor: pointer;
    color: var(--c-slate-500);
    background: none;
    border: none;
    padding: 0;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    transition: var(--transition);
}

.icon-btn:hover {
    color: var(--c-primary-600);
    background-color: var(--c-primary-50);
}

.icon-btn svg {
    width: 18px;
    height: 18px;
}

/* ==========================================================================
   8. STATUS PILLS & BADGES
   ========================================================================== */
.status-pill, .type-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.8rem;
    white-space: nowrap;
}

.status-pill::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-pill.new { background-color: var(--c-status-green-bg); color: var(--c-status-green-text); }
.status-pill.new::before { background-color: var(--c-status-green-text); }

.status-pill.in-progress { background-color: var(--c-status-blue-bg); color: var(--c-status-blue-text); }
.status-pill.in-progress::before { background-color: var(--c-status-blue-text); }

.status-pill.overdue, .status-pill.external { background-color: var(--c-status-red-bg); color: var(--c-status-red-text); }
.status-pill.overdue::before, .status-pill.external::before { background-color: var(--c-status-red-text); }

.status-pill.completed { background-color: var(--c-status-gray-bg); color: var(--c-status-gray-text); }
.status-pill.completed::before { background-color: var(--c-status-gray-text); }

.status-pill.waiting-for-confirmation { background-color: var(--c-status-yellow-bg); color: var(--c-status-yellow-text); }
.status-pill.waiting-for-confirmation::before { background-color: var(--c-status-yellow-text); }

.type-pill {
    background-color: var(--c-status-purple-bg);
    color: var(--c-status-purple-text);
}

/* ==========================================================================
   9. DASHBOARD & OVERVIEW (EXECUTIVE LAYOUT)
   ========================================================================== */
#overview-tab.active {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-5);
    height: calc(100vh - 120px); 
    overflow: hidden; 
    padding-bottom: 5px;
}

/* Metric Container */
#stat-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--spacing-5);
    flex-shrink: 0; 
}

/* Header & Controls styling */
.overview-controls {
    flex-shrink: 0; 
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    background: var(--c-white);
    padding: 12px 24px;
    border-radius: var(--radius);
    border: 1px solid var(--c-slate-200);
}

.filter-buttons {
    display: flex;
    background-color: var(--c-slate-100);
    border-radius: var(--radius);
    padding: 3px;
}

.filter-btn {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 700;
    color: var(--c-slate-500);
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn.active {
    background-color: var(--c-white);
    color: var(--c-primary-600);
    box-shadow: var(--shadow-sm);
}

.date-range-filter {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    margin-left: auto;
}

.date-range-filter label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--c-slate-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.date-range-filter input[type="date"] {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--c-slate-200);
    border-radius: var(--radius);
    font-weight: 500;
    font-family: var(--font-sans);
}

#download-all-btn {
    margin-left: var(--spacing-4);
}

/* Chart Canvas Container */
.chart-card {
    flex: 1; 
    min-height: 0; 
    width: 100%;
    background: var(--c-white);
    padding: var(--spacing-5);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: var(--shadow-sm);
    position: relative;
}

.chart-no-data-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.chart-no-data-overlay p {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--c-slate-500);
}

/* Modern Minimalist KPI Cards */
.stat-card {
    background-color: var(--c-white);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

/* Subtle, elegant indicator marker */
.stat-card::after {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--c-slate-300); 
}

.stat-card.theme-blue::after   { background: var(--c-status-blue-text); }
.stat-card.theme-green::after  { background: var(--c-status-green-text); }
.stat-card.theme-red::after    { background: var(--c-status-red-text); }
.stat-card.theme-grey::after   { background: var(--c-slate-500); }

.stat-card .label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--c-slate-500);
    margin-bottom: 0.5rem;
}

.stat-card .value {
    font-size: 2rem; 
    font-weight: 800;
    color: var(--c-slate-900);
    line-height: 1;
    letter-spacing: -0.5px;
}

/* ==========================================================================
   10. MODALS
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(15, 23, 42, 0.3);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.4s var(--ease-lux);
    backdrop-filter: blur(8px);
}

.modal-backdrop:not(.hidden) {
    opacity: 1;
}

.modal {
    position: fixed;
    top: 50%; left: 50%;
    background: var(--c-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 650px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    opacity: 0;
    transform: translate(-50%, -46%) scale(0.96);
    transition: opacity 0.5s var(--ease-lux), transform 0.5s var(--ease-lux);
}

.modal:not(.hidden) {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.modal.modal-sm { max-width: 420px; }
.modal.modal-xl { max-width: 1450px; width: 95%; }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--c-slate-100);
    flex-shrink: 0;
}

.modal-header h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--c-slate-900);
    margin: 0;
    letter-spacing: -0.5px;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    color: var(--c-slate-400);
    transition: var(--transition);
}

.modal-close-btn:hover {
    color: var(--c-slate-900);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
}

.modal-footer {
    padding: 1.25rem 2rem;
    border-top: 1px solid var(--c-slate-100);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-3);
    background-color: var(--c-slate-50);
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
    flex-shrink: 0;
}

/* ==========================================================================
   11. FORMS & INPUTS
   ========================================================================== */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-4);
}

.form-group {
    margin-bottom: var(--spacing-5);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-2);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--c-slate-700);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--c-slate-200);
    border-radius: var(--radius);
    transition: var(--transition);
    font-size: 0.95rem;
    font-family: var(--font-sans);
    background-color: var(--c-white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--c-primary-500);
    box-shadow: 0 0 0 4px var(--c-primary-50);
}

.radio-group {
    display: flex;
    gap: var(--spacing-6);
    padding: var(--spacing-2) 0;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: none;
    letter-spacing: normal;
}

/* --- Dynamic Entry Rows inside Modal --- */
#product-entries-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-3);
    margin-bottom: var(--spacing-3);
}

.product-entries-header,
.product-entry {
    display: grid;
    grid-template-columns: 3fr 1fr 2fr 40px;
    gap: var(--spacing-4);
    align-items: center;
}

.product-entries-header {
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--c-slate-400);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: var(--spacing-2) 0;
    border-bottom: 2px solid var(--c-slate-100);
    margin-bottom: var(--spacing-2);
}

.remove-product-btn {
    background: none;
    border: none;
    color: var(--c-slate-400);
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.remove-product-btn:hover {
    color: var(--c-status-red-text);
    background-color: var(--c-status-red-bg);
}

/* ==========================================================================
   12. DETAILS & CHAT PANEL (Luxurious Split View)
   ========================================================================== */
.details-layout {
    display: flex;
    gap: var(--spacing-6);
    height: 72vh;
}

.details-sidebar {
    flex: 1.1;
    border-right: 1px solid var(--c-slate-100);
    padding-right: var(--spacing-6);
    overflow-y: auto;
}

.details-chat {
    flex: 0.9;
    display: flex;
    flex-direction: column;
    background-color: var(--c-slate-50);
    border-radius: var(--radius-lg);
    border: 1px solid var(--c-slate-200);
    overflow: hidden;
}

#modal-body-content dl {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: var(--spacing-4) var(--spacing-2);
    font-size: 0.95rem;
}

#modal-body-content dt {
    font-weight: 700;
    color: var(--c-slate-500);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

#modal-body-content dd {
    margin: 0;
    color: var(--c-slate-800);
    font-weight: 500;
}

#modal-body-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#modal-actions-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-4);
    width: 100%;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-5);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-4);
}

.chat-entry {
    max-width: 85%;
    padding: 0.85rem 1.15rem;
    border-radius: var(--radius);
    font-size: 0.92rem;
    line-height: 1.5;
    font-weight: 500;
}

.chat-entry.user {
    align-self: flex-start;
    background-color: var(--c-white);
    border: 1px solid var(--c-slate-200);
    color: var(--c-slate-800);
    border-bottom-left-radius: 2px;
}

.chat-entry.admin {
    align-self: flex-end;
    background-color: var(--c-primary-50);
    border: 1px solid var(--c-primary-100);
    color: var(--c-primary-600);
    border-bottom-right-radius: 2px;
}

.chat-entry.system {
    align-self: center;
    background-color: var(--c-slate-200);
    color: var(--c-slate-500);
    font-size: 0.8rem;
    font-style: italic;
    border-radius: var(--radius-sm);
    padding: 4px 12px;
    max-width: 100%;
    border: none;
}

.chat-meta {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--c-slate-400);
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.chat-attachment {
    margin-top: var(--spacing-2);
    background: var(--c-slate-100);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--c-slate-200);
}

.chat-attachment a {
    color: var(--c-primary-600);
    text-decoration: none;
    font-weight: 600;
}

/* Chat Input Controls */
.chat-input-area {
    padding: var(--spacing-4) var(--spacing-5);
    background: var(--c-white);
    border-top: 1px solid var(--c-slate-200);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-controls {
    display: flex;
    gap: var(--spacing-3);
    align-items: center;
}

.chat-controls textarea {
    flex: 1;
    resize: none;
    height: 40px;
    padding: 10px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--c-slate-200);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: var(--transition);
}

.chat-controls textarea:focus {
    outline: none;
    border-color: var(--c-primary-500);
}

/* ==========================================================================
   13. COMPLETED REQUESTS TAB
   ========================================================================== */
#completed-requests-tab .project-list {
    margin-top: var(--spacing-4);
}

.completed-items-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
    padding: var(--spacing-2) var(--spacing-5) var(--spacing-5);
}

.completed-card {
    display: grid;
    grid-template-columns: 1fr 180px 120px;
    gap: var(--spacing-6);
    align-items: center;
    border-radius: var(--radius);
    padding: var(--spacing-3) var(--spacing-4);
    transition: var(--transition);
    border: 1px solid var(--c-slate-100);
    background-color: var(--c-white);
}

.completed-card:hover {
    background-color: var(--c-slate-50);
    transform: translateX(3px);
}

.completed-card-main {
    display: flex;
    flex-direction: column;
}

.completed-card-main .product-name { 
    font-weight: 700; 
    color: var(--c-slate-900); 
    font-size: 1.05rem; 
}
.completed-card-main .project-name { 
    color: var(--c-slate-500); 
    font-size: 0.88rem; 
    font-weight: 500;
}

.completed-card-details {
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
}

.completed-card-details .detail-pair { display: flex; flex-direction: column; }
.completed-card-details .label { font-size: 0.72rem; color: var(--c-slate-400); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; }
.completed-card-details .value { font-weight: 600; color: var(--c-slate-700); }

/* ==========================================================================
   14. FLOATING LUXURY HELP COMPONENT
   ========================================================================== */
.help-fab {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 54px;
    height: 54px;
    background-color: var(--c-slate-900);
    color: var(--c-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    z-index: 900;
    transition: var(--transition);
    text-decoration: none;
}

.help-fab svg {
    width: 24px;
    height: 24px;
}

.help-fab:hover {
    background-color: var(--c-primary-600);
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.35);
}

.help-fab::after {
    content: attr(title);
    position: absolute;
    right: 64px;
    background: var(--c-slate-800);
    color: var(--c-white);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.help-fab:hover::after {
    opacity: 1;
}

/* ==========================================================================
   15. SSO LOGIN OVERLAY
   ========================================================================== */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 10% 20%, #f8fafc 0%, #f1f5f9 100%);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-box {
    background: var(--c-white);
    padding: 3.5rem 4rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    text-align: center;
    border: 1px solid var(--c-slate-100);
    max-width: 480px;
    width: 90%;
}

.login-box h2 {
    margin-top: 0;
    color: var(--c-slate-900);
    font-size: 3.1rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 12px;
}

.login-box p {
    color: var(--c-slate-500);
    margin-bottom: 32px;
    line-height: 1.6;
    font-size: 1rem;
    font-weight: 500;
}

.sso-btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 0.9rem;
    border-radius: var(--radius);
    border: 1px solid var(--c-slate-200);
    background-color: var(--c-white);
    color: var(--c-slate-800);
    font-weight: 100;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
    cursor: pointer;
}

.sso-btn:hover {
    background-color: var(--c-slate-50);
    border-color: #6d28d9;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* ==========================================================================
   17. PREMIUM DUAL-COLUMN CREATE REQUEST FORM
   ========================================================================== */
.modal-lux-layout {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    min-height: 55vh;
}

.lux-panel-left {
    padding: var(--spacing-6) var(--spacing-8) var(--spacing-8) var(--spacing-8);
    border-right: 1px solid var(--c-slate-100);
}

.lux-panel-right {
    padding: var(--spacing-6) var(--spacing-8) var(--spacing-8) var(--spacing-8);
    background-color: var(--c-slate-50);
}

.panel-section-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--c-slate-900);
    margin: 0 0 1.5rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-left: 4px solid var(--c-primary-600);
    padding-left: 10px;
}

.panel-section-subtitle {
    font-size: 0.88rem;
    color: var(--c-slate-500);
    margin: -1rem 0 2rem 0;
    font-weight: 500;
}

/* Beautiful dynamic cards for selected products */
.product-entry {
    background-color: var(--c-white);
    padding: var(--spacing-3);
    border-radius: var(--radius);
    border: 1px solid var(--c-slate-200);
    margin-bottom: var(--spacing-3);
    box-shadow: var(--shadow-sm);
    animation: cardEntrance 0.5s var(--ease-lux);
}

@keyframes cardEntrance {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   18. ULTRA SOPHISTICATED CHAT PANEL & TIMELINE
   ========================================================================== */
.chat-messages {
    display: flex;
    flex-direction: column;
    padding: 2rem;
    background: #f8fafc;
    border-bottom: none;
    overflow-y: auto;
}

.chat-entry {
    max-width: 80%;
    margin-bottom: var(--spacing-3);
    padding: 1.15rem 1.4rem;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.6;
    font-weight: 500;
    box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.03);
    animation: messageEntrance 0.4s var(--ease-lux);
}

@keyframes messageEntrance {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-entry.user {
    align-self: flex-start;
    background-color: var(--c-white);
    border: 1px solid var(--c-slate-200);
    color: var(--c-slate-800);
    border-bottom-left-radius: 4px;
}

.chat-entry.admin {
    align-self: flex-end;
    background-color: var(--c-primary-600);
    color: var(--c-white);
    border-bottom-right-radius: 4px;
    box-shadow: 0 10px 20px -8px rgba(79, 70, 229, 0.4);
}

.chat-entry.admin .chat-meta {
    color: rgba(255, 255, 255, 0.7);
}

.chat-entry.admin .chat-meta strong {
    color: var(--c-white);
}

.chat-entry.admin .chat-attachment {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

.chat-entry.admin .chat-attachment a {
    color: var(--c-white);
    text-decoration: underline;
}

.chat-entry.system {
    align-self: center;
    background-color: var(--c-slate-200);
    color: var(--c-slate-600);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 16px;
    border-radius: 99px;
    box-shadow: none;
    border: none;
}

/* Custom interactive transition on input focus */
.chat-controls textarea {
    border-radius: 12px;
    border: 1px solid var(--c-slate-200);
    transition: var(--transition);
}

.chat-controls textarea:focus {
    border-color: var(--c-primary-500);
    box-shadow: 0 0 0 4px var(--c-primary-50);
}

/* ==========================================================================
   19. FLAT DASHBOARD CARD COMPONENT & ROW STYLES
   ========================================================================== */
.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.75rem;
    background-color: var(--c-slate-50);
    border-bottom: 1px solid var(--c-slate-100);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
}

.card-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--c-slate-400);
    display: inline-block;
}

/* Color matching dots based on card status */
.project-card.project-status--overdue .card-status-dot { background-color: var(--c-status-red-text); }
.project-card.project-status--waiting-for-confirmation .card-status-dot { background-color: var(--c-status-yellow-text); }
.project-card.project-status--in-progress .card-status-dot { background-color: var(--c-status-blue-text); }
.project-card.project-status--new .card-status-dot { background-color: var(--c-status-green-text); }
.project-card.completed-project-group .card-status-dot { background-color: var(--c-slate-500); }

.project-title-heading {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--c-slate-900);
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-5);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--c-primary-100);
    color: var(--c-primary-600);
    font-size: 0.72rem;
    font-weight: 800;
    display: grid;
    place-items: center;
    border: 1px solid rgba(79, 70, 229, 0.15);
}

.user-name-text {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--c-slate-700);
}

.date-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--c-slate-400);
}

.date-badge svg {
    width: 14px;
    height: 14px;
}

/* Transparent products grid */
.project-card-body {
    padding: 0;
}

.lux-product-list {
    display: flex;
    flex-direction: column;
}

.lux-product-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1.2fr 0.8fr;
    align-items: center;
    padding: 1.15rem 1.75rem;
    border-bottom: 1px solid var(--c-slate-100);
    transition: var(--transition);
}

.lux-product-row:last-child {
    border-bottom: none;
}

.lux-product-row:hover {
    background-color: rgba(248, 250, 252, 0.6);
}

.lux-product-row.completed-row {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
}

.product-identity {
    display: flex;
    align-items: center;
    gap: 12px;
}

.product-bullet {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--c-primary-500);
}

.product-bullet.completed {
    background-color: var(--c-slate-400);
}

.product-title-text {
    font-weight: 700;
    color: var(--c-slate-900);
    font-size: 0.95rem;
}

.product-subtitle-text {
    font-size: 0.8rem;
    color: var(--c-slate-400);
    margin-top: 2px;
}

.product-schedule-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--c-slate-500);
}

.schedule-icon {
    width: 16px;
    height: 16px;
    color: var(--c-slate-400);
}

.product-progress-col {
    display: flex;
    align-items: center;
}

/* Beautiful inline progress tracking bars */
.inline-progress-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 150px;
}

.mini-progress-bar {
    width: 100%;
    height: 6px;
    background-color: var(--c-slate-200);
    border-radius: 99px;
    overflow: hidden;
    margin-top: 4px;
}

.mini-progress-fill {
    height: 100%;
    background-color: var(--c-status-blue-text);
    border-radius: 99px;
    transition: width 0.6s var(--ease-lux);
}

.mini-progress-text {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--c-slate-500);
}

.product-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
}

/* ==========================================================================
   20. REFINED HIGH-DENSITY COMPACT TABULAR CARD STYLES
   ========================================================================== */
.lux-product-row {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1.3fr 0.70fr; /* Explicit locked column ratios */
    align-items: center;
    padding: 0.65rem 1.75rem; /* Drastically reduced vertical padding for high density */
    border-bottom: 1px solid var(--c-slate-100);
    transition: var(--transition);
}

/* Elegant, distinct tag for product quantity counts */
.product-qty-tag {
    background-color: var(--c-slate-100);
    color: var(--c-slate-700);
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 800;
    font-size: 0.78rem;
    margin-left: 8px;
    border: 1px solid var(--c-slate-200);
    display: inline-block;
}

/* Horizontal single-line progress panel */
.compact-progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.compact-progress-track {
    width: 60px;
    height: 5px;
    background-color: var(--c-slate-200);
    border-radius: 99px;
    overflow: hidden;
    flex-shrink: 0;
}

.compact-progress-fill {
    height: 100%;
    background-color: var(--c-primary-600);
    border-radius: 99px;
    transition: width 0.6s var(--ease-lux);
}

.compact-progress-text {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--c-slate-500);
    white-space: nowrap;
}

/* ==========================================================================
   21. LUXURIOUS DARK SIDEBAR OVERRIDES (When Admin Mode is Active)
   ========================================================================== */
.admin-mode-active .sidebar {
    background-color: #0f172a; /* Premium deep space black backdrop */
    border-color: #1e293b;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.35);
    transition: var(--transition);
}

.admin-mode-active .sidebar-title {
    color: var(--c-white);
}

.admin-mode-active .sidebar-header {
    border-bottom-color: #1e293b;
}

.admin-mode-active .nav-link {
    color: #94a3b8;
}

.admin-mode-active .nav-link:hover {
    color: var(--c-white);
    background-color: rgba(255, 255, 255, 0.04);
}

.admin-mode-active .nav-link.active {
    background-color: var(--c-primary-600);
    color: var(--c-white);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.4);
}

.admin-mode-active .sidebar-footer {
    border-top-color: #1e293b;
}