/* Sari Jehan Office Management System - Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #047857; /* Emerald Green - Swat Valley Theme */
    --primary-dark: #065f46;
    --primary-light: #ecfdf5;
    --primary-rgb: 4, 120, 87;
    
    --accent: #d97706; /* Warm Amber Gold */
    --accent-dark: #b45309;
    --accent-light: #fef3c7;
    
    --success: #16a34a;
    --warning: #ea580c;
    --danger: #dc2626;
    
    --background: #f1f5f9;
    --surface: #ffffff;
    --surface-hover: #f8fafc;
    --border: #cbd5e1;
    --border-light: #e2e8f0;
    
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-light: #94a3b8;
    
    --shadow-sm: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -4px rgba(0,0,0,0.05);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    
    --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    
    --sidebar-width: 300px;
    --header-height: 70px;
}

[data-theme="dark"] {
    --background: #0f172a;
    --surface: #1e293b;
    --surface-hover: #334155;
    --border: #334155;
    --border-light: #1e293b;
    
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --text-light: #64748b;
    
    --primary-light: rgba(4, 120, 87, 0.15);
    
    --shadow-sm: 0 1px 3px 0 rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.25);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.2);
}

/* Global Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

body {
    font-family: var(--font);
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
    transition: background-color var(--transition);
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

/* Scrollbar customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-light);
}

/* Utilities */
.text-right { text-align: right; }
.text-center { text-align: center; }
.flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: fit-content;
}
.badge-success { background-color: #dcfce7; color: #15803d; }
[data-theme="dark"] .badge-success { background-color: rgba(22, 163, 74, 0.2); color: #4ade80; }

.badge-pending { background-color: #fef3c7; color: #b45309; }
[data-theme="dark"] .badge-pending { background-color: rgba(217, 119, 6, 0.2); color: #fbbf24; }

.badge-info { background-color: #e0f2fe; color: #0369a1; }
[data-theme="dark"] .badge-info { background-color: rgba(2, 132, 199, 0.2); color: #38bdf8; }

.badge-danger { background-color: #fee2e2; color: #b91c1c; }
[data-theme="dark"] .badge-danger { background-color: rgba(220, 38, 38, 0.2); color: #f87171; }

/* App Wrapper Layout */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100vw;
}

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: transform var(--transition), background-color var(--transition), border-color var(--transition);
}

.sidebar-brand {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-light);
}

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.3);
}

.brand-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.25;
    white-space: normal;
}

.brand-subtitle {
    font-size: 9px;
    color: var(--text-light);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    font-weight: 500;
    display: block;
    margin-top: 2px;
}

.sidebar-menu {
    list-style: none;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.menu-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.menu-item a i {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.menu-item a:hover {
    background-color: var(--background);
    color: var(--primary);
}

.menu-item.active a {
    background-color: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.menu-separator {
    height: 1px;
    background-color: var(--border-light);
    margin: 12px 16px;
}

.menu-header {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    padding: 0 16px 8px;
    font-weight: 600;
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-light);
    background-color: var(--background);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.role-badge-container {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

/* Main Content Wrapper */
.main-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Header */
.top-header {
    height: var(--header-height);
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 90;
    transition: background-color var(--transition), border-color var(--transition);
}

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

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-main);
}

.header-title-group h2 {
    font-size: 18px;
    font-weight: 700;
}

.header-title-group p {
    font-size: 12px;
    color: var(--text-muted);
}

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

.control-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

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

.role-selector-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--background);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.role-selector-wrap label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
}

.role-select {
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    border: 2px solid var(--primary);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
}

.user-role {
    font-size: 10px;
    color: var(--text-light);
    text-transform: uppercase;
}

/* Page Containers */
.page-container {
    padding: 32px;
    display: none;
    animation: fadeIn 0.3s ease;
}

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

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

/* Dashboard Home Grid */
.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* KPI Panel */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}

.kpi-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kpi-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-icon.teal { background-color: var(--primary-light); color: var(--primary); }
.kpi-icon.gold { background-color: var(--accent-light); color: var(--accent-dark); }
.kpi-icon.blue { background-color: #eff6ff; color: #2563eb; }
.kpi-icon.purple { background-color: #faf5ff; color: #7c3aed; }

[data-theme="dark"] .kpi-icon.blue { background-color: rgba(37, 99, 235, 0.15); color: #60a5fa; }
[data-theme="dark"] .kpi-icon.purple { background-color: rgba(124, 58, 237, 0.15); color: #c084fc; }

.kpi-data {
    display: flex;
    flex-direction: column;
}

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

.kpi-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 4px;
}

/* Actions Bar & Quick Tools */
.quick-actions-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-actions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}
.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-accent {
    background-color: var(--accent);
    color: white;
}
.btn-accent:hover {
    background-color: var(--accent-dark);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}
.btn-outline:hover {
    background-color: var(--background);
    color: var(--text-main);
    border-color: var(--text-muted);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}
.btn-danger:hover {
    background-color: #b91c1c;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Chart Row */
.chart-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.chart-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.chart-container {
    height: 250px;
    width: 100%;
    position: relative;
    margin-top: 20px;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 16px;
    font-size: 12px;
    font-weight: 500;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* Grid & Table Components */
.table-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.table-title-group h3 {
    font-size: 20px;
    font-weight: 700;
}

.table-title-group p {
    font-size: 13px;
    color: var(--text-muted);
}

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

.search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrap i {
    position: absolute;
    left: 12px;
    color: var(--text-light);
    pointer-events: none;
    width: 16px;
    height: 16px;
}

.search-input {
    padding: 8px 12px 8px 36px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    outline: none;
    font-size: 14px;
    background-color: var(--surface);
    transition: var(--transition);
    width: 200px;
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
    width: 250px;
}

.filter-select {
    padding: 8px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background-color: var(--surface);
    font-size: 14px;
    outline: none;
    cursor: pointer;
}

.filter-select:focus {
    border-color: var(--primary);
}

/* Modern Card Data Grid (Table Replacement) */
.table-container {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.responsive-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.responsive-table th {
    background-color: var(--background);
    padding: 16px 20px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.05em;
}

.responsive-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-main);
    vertical-align: middle;
}

.responsive-table tr:last-child td {
    border-bottom: none;
}

.responsive-table tr:hover td {
    background-color: var(--surface-hover);
}

.receipt-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
}

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

/* Forms and Dialogs */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

.modal-card {
    background-color: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: var(--transition);
}

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

.modal-body {
    padding: 24px;
}

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

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

.form-group.full-width {
    grid-column: span 2;
}

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

.form-label span {
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    outline: none;
    font-size: 14px;
    background-color: var(--surface);
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

.form-control.error {
    border-color: var(--danger);
}

.form-error-text {
    font-size: 11px;
    color: var(--danger);
    margin-top: 4px;
    display: none;
}

.form-control.error + .form-error-text {
    display: block;
}

.file-upload-wrap {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    position: relative;
    cursor: pointer;
    background-color: var(--background);
    transition: var(--transition);
}

.file-upload-wrap:hover {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.file-upload-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

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

.file-upload-text i {
    width: 24px;
    height: 24px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.file-upload-preview {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    display: none;
}

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

/* Receipt Modal Preview Style */
.receipt-preview-box {
    width: 100%;
    max-height: 400px;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1e293b;
    border-radius: var(--radius-md);
    padding: 10px;
}

.receipt-preview-img {
    max-width: 100%;
    border-radius: var(--radius-sm);
    object-fit: contain;
}

/* dynamic details subfields (Utility categories details) */
.dynamic-details-box {
    background-color: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
    display: none;
}

.dynamic-details-box.active {
    display: block;
}

/* Toast Message */
.toast-msg {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: #0f172a;
    color: #f8fafc;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    z-index: 2000;
}

.toast-msg.active {
    transform: translateY(0);
    opacity: 1;
}

.toast-msg.success i { color: #22c55e; }
.toast-msg.error i { color: #ef4444; }

/* Responsive Grid layouts */
.details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.info-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.info-list {
    list-style: none;
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    border-bottom: 1px dashed var(--border-light);
    padding-bottom: 8px;
}

.info-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-label {
    color: var(--text-muted);
    font-weight: 500;
}

.info-value {
    color: var(--text-main);
    font-weight: 600;
}

/* Mobile Nav (Bottom Bar) */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 100;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    background: none;
    border: none;
    padding: 8px 0;
}

.mobile-nav-item i {
    width: 20px;
    height: 20px;
    margin-bottom: 2px;
    stroke-width: 2;
}

.mobile-nav-item.active {
    color: var(--primary);
    font-weight: 600;
}

/* Project Detail / Task list view */
.project-details-overlay {
    position: fixed;
    top: 0;
    right: 0;
    width: 480px;
    height: 100vh;
    background-color: var(--surface);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    z-index: 950;
    display: none;
    flex-direction: column;
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-details-overlay.active {
    display: flex;
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

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

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

.tasks-container {
    margin-top: 24px;
}

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

.task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background-color: var(--background);
}

.task-checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.task-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.task-name {
    font-size: 13px;
    font-weight: 500;
}

.task-item.completed .task-name {
    text-decoration: line-through;
    color: var(--text-light);
}

/* CSS SVG Custom Chart Drawing Style */
.svg-bar {
    fill: var(--primary);
    transition: var(--transition);
}
.svg-bar:hover {
    fill: var(--primary-dark);
}
.svg-bar-variable {
    fill: var(--accent);
    transition: var(--transition);
}
.svg-bar-variable:hover {
    fill: var(--accent-dark);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 1024px) {
    .chart-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
        width: 300px;
        box-shadow: var(--shadow-lg);
    }
    
    .main-wrapper {
        margin-left: 0;
        padding-bottom: 60px; /* Space for mobile bottom bar */
    }
    
    .top-header {
        padding: 0 16px;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .page-container {
        padding: 16px;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
    }
    
    .mobile-nav {
        display: flex;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-group.full-width {
        grid-column: span 1;
    }
    
    .modal-card {
        max-height: 85vh;
    }
    
    .project-details-overlay {
        width: 100%;
    }
    
    .responsive-table th, .responsive-table td {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .kpi-row {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .kpi-card {
        padding: 16px;
        gap: 12px;
    }
    
    .kpi-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .kpi-value {
        font-size: 18px;
    }
    
    .table-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .search-input {
        width: 100%;
    }
    .search-input:focus {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .kpi-row {
        grid-template-columns: 1fr;
    }
    
    .responsive-table thead {
        display: none; /* Hide headers, switch to card-like list for tiny viewports */
    }
    
    .responsive-table tr {
        display: block;
        border-bottom: 2px solid var(--border);
        padding: 10px 0;
    }
    
    .responsive-table td {
        display: flex;
        justify-content: space-between;
        padding: 6px 12px;
        border-bottom: none;
        text-align: right;
    }
    
    .responsive-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        text-align: left;
    }
    
    .responsive-table td:last-child {
        justify-content: flex-end;
        gap: 8px;
    }
}

/* Project Document Folders Styling */
.document-folders {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 12px;
}

.folder-group {
    background-color: var(--surface-hover);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.folder-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background-color: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
}

.folder-files {
    padding: 8px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.document-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px dashed var(--border-light);
}

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

.document-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 12px;
    transition: var(--transition);
}

.document-link:hover {
    color: var(--primary);
    transform: translateX(2px);
}

/* Project Diary Styling */
.diary-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.diary-log-item {
    background-color: var(--surface-hover);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 10px 14px;
}

.diary-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.diary-author {
    font-weight: 600;
    color: var(--primary);
}

.diary-text {
    font-size: 12px;
    color: var(--text-main);
    white-space: pre-line;
}

/* Spinner Animation */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(20, 184, 166, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
    vertical-align: middle;
    margin-right: 8px;
}

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

.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}


