/* style.css */

/* ---=== CSS Variables for Theming ===--- */
:root {
    --primary-color: #007bff;
    --primary-color-hover: #0056b3;
    --secondary-color: #6c757d;
    --background-color: #f4f7fc;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --text-color: #333333;
    --border-color: #dee2e6;
    --shadow-color: rgba(0, 0, 0, 0.05);
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
}

html.dark-mode body {
    --primary-color: #0d8eff;
    --primary-color-hover: #3a9eff;
    --secondary-color: #8c96a1;
    --background-color: #121212;
    --sidebar-bg: #1e1e1e;
    --card-bg: #1e1e1e;
    --text-color: #e0e0e0;
    --border-color: #333;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --success-color: #34c759;
    --danger-color: #ff453a;
    --warning-color: #ffcc00;
}

/* ---=== Global Styles & Reset ===--- */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background-color: var(--background-color); color: var(--text-color); display: flex; transition: background-color 0.3s, color 0.3s; }
a { text-decoration: none; color: var(--primary-color); }

/* ---=== Sidebar Navigation (Collapsible) ===--- */
.sidebar { 
    width: 78px; 
    background-color: var(--sidebar-bg); 
    padding: 10px 14px; 
    position: fixed; 
    top: 0; 
    left: 0; 
    bottom: 0; /* Stretches the sidebar to the full height */
    border-right: 1px solid var(--border-color); 
    display: flex; 
    flex-direction: column; 
    transition: width 0.3s ease; 
    overflow-x: hidden; /* Prevent horizontal scroll */
    overflow-y: auto;   /* Allow vertical scroll if needed */
    z-index: 200; 
}
.sidebar:hover { width: 260px; }
.sidebar-header { margin-bottom: 40px; min-height: 40px; display: flex; align-items: center;}
.logo-link { display: inline-block; }
.logo-img { display: block; width: auto; max-height: 40px; }

/* THIS IS THE CORRECTED CODE FOR THE ACTIVE LINK */
.sidebar-nav a { 
    display: flex; 
    align-items: center; 
    height: 50px; 
    padding: 0 10px; 
    margin-bottom: 10px; 
    border-radius: 8px; 
    color: var(--secondary-color); 
    font-weight: 500; 
    transition: background-color 0.2s, color 0.2s; 
    white-space: nowrap;
    position: relative; /* Added for positioning the active bar */
}
.sidebar-nav a:hover { 
    background-color: var(--primary-color); 
    color: #fff; 
}
.sidebar-nav a.active {
    background-color: transparent; /* Remove the full background */
    color: var(--primary-color); /* Highlight the icon and text */
}
/* New style for the vertical bar */
.sidebar-nav a.active::before {
    content: '';
    position: absolute;
    left: -14px; /* Position it outside the sidebar's padding */
    top: 50%;
    transform: translateY(-50%);
    height: 36px;
    width: 4px;
    background-color: var(--primary-color);
    border-radius: 0 4px 4px 0;
}

.sidebar-nav a i { font-size: 1.25rem; margin-right: 15px; min-width: 40px; text-align: center; }
.sidebar-nav a span { opacity: 0; pointer-events: none; transition: opacity 0.2s ease 0.1s; }
.sidebar:hover .sidebar-nav a span { opacity: 1; pointer-events: auto; }
.sidebar-footer { margin-top: auto; }
.sidebar-footer a { display: flex; align-items: center; height: 50px; padding: 0 10px; border-radius: 8px; background-color: #f8d7da; color: #721c24; font-weight: 500; white-space: nowrap; overflow: hidden; }
html.dark-mode .sidebar-footer a { background-color: #572c32; color: #f8d7da; }
.sidebar-footer a i { font-size: 1.25rem; margin-right: 15px; min-width: 40px; text-align: center; }
.sidebar-footer a span { opacity: 0; pointer-events: none; transition: opacity 0.2s ease 0.1s; }
.sidebar:hover .sidebar-footer a span { opacity: 1; pointer-events: auto; }
.sidebar-heading { padding: 15px 10px 5px; font-size: 0.75rem; color: var(--secondary-color); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; opacity: 0; transition: opacity 0.2s ease 0.1s; white-space: nowrap; }
.sidebar:hover .sidebar-heading { opacity: 1; }

/* ---=== Main Content Area (Collapsible) ===--- */
.main-content { margin-left: 78px; flex-grow: 1; padding: 30px; transition: margin-left 0.3s ease; }
.sidebar:hover ~ .main-content { margin-left: 260px; }

/* ... Other styles ... */
.page-header { margin-bottom: 30px; }
.page-header h1 { font-size: 2rem; font-weight: 600; }
.card { background-color: var(--card-bg); padding: 25px; border-radius: 12px; border: 1px solid var(--border-color); box-shadow: 0 4px 12px var(--shadow-color); margin-bottom: 20px; transition: background-color 0.3s; }
.btn { padding: 10px 20px; border: none; border-radius: 8px; font-size: 1rem; font-weight: 500; cursor: pointer; transition: background-color 0.2s; text-align: center; }
.btn-primary { background-color: var(--primary-color); color: white; }
.btn-primary:hover { background-color: var(--primary-color-hover); }
.btn-secondary { background-color: var(--secondary-color); color: white; }
.btn-danger { background-color: var(--danger-color); color: white; }
.btn-danger:hover { background-color: #c82333; }
.btn-success { background-color: var(--success-color); color: white; }
.search-container { margin-bottom: 20px; display: flex; gap: 10px; }
.search-container input { flex-grow: 1; padding: 12px; border: 1px solid var(--border-color); border-radius: 8px; background-color: var(--background-color); color: var(--text-color); font-size: 1rem; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 15px; text-align: left; border-bottom: 1px solid var(--border-color); }
.data-table th { font-weight: 600; background-color: var(--background-color); }
html.dark-mode .data-table th { background-color: #2a2a2a; }
.data-table td .action-btn { margin-right: 5px; padding: 5px 10px; font-size: 0.9rem; }
.status-badge { padding: 5px 12px; border-radius: 15px; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; color: white; }
.status-paid { background-color: var(--success-color); }
.status-due { background-color: var(--danger-color); }
.status-new { background-color: var(--secondary-color); }
.project-status-inprogress { background-color: var(--primary-color); }
.project-status-completed { background-color: var(--success-color); }
.project-status-onhold { background-color: var(--warning-color); }
.project-status-none { background-color: var(--secondary-color); }
.project-status-mixed { background-color: var(--secondary-color); }
.timeline-row { background-color: var(--background-color); }
.project-timeline { padding: 15px; }
.project-timeline h4 { margin-bottom: 10px; font-size: 0.9rem; color: var(--secondary-color); }
.project-timeline ul { list-style: none; padding-left: 15px; border-left: 2px solid var(--border-color); }
.project-timeline li { position: relative; margin-bottom: 10px; padding-left: 15px; }
.project-timeline li::before { content: ''; position: absolute; left: -24px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background-color: var(--primary-color); }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 12px; border: 1px solid var(--border-color); border-radius: 8px; background-color: var(--background-color); color: var(--text-color); font-size: 1rem; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; }
.password-container { position: relative; }
.password-container input { padding-right: 40px; }
.password-toggle-icon { position: absolute; top: 50%; right: 15px; transform: translateY(-50%); cursor: pointer; color: var(--secondary-color); }
.password-toggle-icon.fa-eye-slash { color: var(--primary-color); }
html.dark-mode input[type="date"], html.dark-mode input[type="datetime-local"] { color-scheme: dark; }
.login-container { display: flex; align-items: center; justify-content: center; width: 100vw; height: 100vh; background-color: var(--background-color); }
.login-box { width: 400px; padding: 40px; }
.login-box .logo-img { max-height: 60px; margin: 0 auto 30px auto; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.stat-card { background-color: var(--card-bg); padding: 25px; border-radius: 12px; border: 1px solid var(--border-color); }
.stat-card h3 { font-size: 1.1rem; color: var(--secondary-color); }
.stat-card .value { font-size: 2.5rem; font-weight: bold; margin-top: 10px; }
.financial-summary { display: flex; gap: 20px; margin-bottom: 30px; }
.financial-card { flex: 1; padding: 20px; border-radius: 8px; text-align: center; }
.financial-card h4 { font-size: 1rem; margin-bottom: 10px; opacity: 0.8; }
.financial-card .amount { font-size: 1.8rem; font-weight: 600; }
.financial-card.paid { background-color: var(--success-color); color: white; }
.financial-card.due { background-color: var(--danger-color); color: white; }
.financial-card.charged { background-color: var(--secondary-color); color: white; }
.profile-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; }
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.6); display: flex; justify-content: center; align-items: center; z-index: 1000; }
.modal-content { background-color: var(--card-bg); padding: 30px; border-radius: 12px; width: 90%; max-width: 450px; text-align: center; box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
.modal-content h2 { margin-bottom: 15px; }
.modal-content p { margin-bottom: 25px; color: var(--secondary-color); line-height: 1.6; }
.modal-actions { display: flex; justify-content: center; gap: 15px; }
.settings-section { margin-bottom: 30px; }
.settings-section h2 { margin-bottom: 15px; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; }
.theme-switch-wrapper { display: flex; align-items: center; gap: 10px; }
.theme-switch { display: inline-block; height: 34px; position: relative; width: 60px; }
.theme-switch input { display:none; }
.slider { background-color: #ccc; bottom: 0; cursor: pointer; left: 0; position: absolute; right: 0; top: 0; transition: .4s; border-radius: 34px; }
.slider:before { background-color: #fff; bottom: 4px; content: ""; height: 26px; left: 4px; position: absolute; transition: .4s; width: 26px; border-radius: 50%; }
input:checked + .slider { background-color: var(--primary-color); }
input:checked + .slider:before { transform: translateX(26px); }

/* ---=== Responsive Design for Tablets & Mobile ===--- */

