/*
 * Merged CSS file for MIDAS application
 *
 * UPDATED: Icon-Only Sidebar (Mini Sidebar) Layout
 */

/* ========================================================================= */
/* Global Variables and Body Styling                                         */
/* ========================================================================= */
:root {
    --primary-color: #5d5dff;
    --secondary-color: #3b3b3b;
    --background-color: #212121;
    --text-color: #e0e0e0;
    --card-border-radius: 12px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    
    --hover-bg-projects: rgba(93, 93, 255, 0.1);
    --hover-bg-workers: rgba(255, 193, 7, 0.1);
    --hover-bg-task: rgba(93, 93, 255, 0.1);
    
    /* SIDEBAR VARIABLES */
    --sidebar-width-collapsed: 70px;  /* Icon only width */
    --sidebar-width-expanded: 250px;  /* Full width on hover */
    --sidebar-bg: #1a1a1a;
    --sidebar-hover: #333333;
    --header-height: 57px;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: all 0.3s ease;
    overflow-y: auto; 
    
    /* Layout Adjustments */
    min-height: 100vh;
    position: relative;
    padding-top: var(--header-height);
    /* Set body padding to the COLLAPSED width so content stays put */
    padding-left: var(--sidebar-width-collapsed); 
}

body.dark-mode {
    background-color: #1a1a1a;
    color: var(--text-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

h2, h4, h5, h6 {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 600;
    color: #ffffff;
}
h4 { font-size: 1.5rem; }
.small, .form-label.small, .table-sm th, .table-sm td, .badge { font-size: 0.8rem; }
.table-dark tbody td .badge {
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
}

/* ========================================================================= */
/* ADMIN LTE SPECIFIC WIDGETS (Add to bottom of style.css)                   */
/* ========================================================================= */

/* --- 1. Small Box Widget --- */
.small-box {
    border-radius: 0.25rem;
    box-shadow: 0 0 1px rgba(0,0,0,.125), 0 1px 3px rgba(0,0,0,.2);
    display: block;
    margin-bottom: 20px;
    position: relative;
    color: #fff !important;
    overflow: hidden; /* Keeps the icon clipped */
}

.small-box > .inner {
    padding: 10px;
}

.small-box h3 {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 0 10px;
    padding: 0;
    white-space: nowrap;
}

.small-box p {
    font-size: 1rem;
    margin-bottom: 0; 
}

.small-box .icon {
    color: rgba(0,0,0,.15);
    z-index: 0;
}

.small-box .icon > i {
    font-size: 90px;
    position: absolute;
    right: 15px;
    top: 15px;
    transition: transform .3s linear;
}

.small-box:hover .icon > i {
    transform: scale(1.1);
}

.small-box > .small-box-footer {
    background-color: rgba(0,0,0,.1);
    color: rgba(255,255,255,.8);
    display: block;
    padding: 3px 0;
    position: relative;
    text-align: center;
    text-decoration: none;
    z-index: 10;
    transition: color 0.1s ease;
}

.small-box > .small-box-footer:hover {
    color: #fff;
    background-color: rgba(0,0,0,.15);
}

/* Background Colors for Small Boxes */
.bg-info { background-color: #17a2b8 !important; }
.bg-success { background-color: #28a745 !important; }
.bg-warning { background-color: #ffc107 !important; color: #1f2d3d !important; }
.bg-danger { background-color: #dc3545 !important; }
.bg-primary { background-color: #007bff !important; }

/* --- 2. Application Buttons (Quick Actions) --- */
.btn-app {
    border-radius: 3px;
    background-color: #343a40; /* Dark theme bg */
    border: 1px solid #6c757d;
    color: #fff;
    font-size: 12px;
    height: 60px;
    margin: 0 0 10px 10px;
    min-width: 80px;
    padding: 15px 5px;
    position: relative;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

.btn-app > .fas, .btn-app > .far {
    display: block;
    font-size: 20px;
    margin-bottom: 5px; 
}

.btn-app:hover {
    background-color: #3f474e;
    color: #fff;
    border-color: #aaaaaa;
}

/* --- 3. Card Styles (AdminLTE Style) --- */
.card-primary.card-outline { border-top: 3px solid #007bff; }
.card-success.card-outline { border-top: 3px solid #28a745; }
.card-warning.card-outline { border-top: 3px solid #ffc107; }
.card-danger.card-outline { border-top: 3px solid #dc3545; }

/* --- 4. Products List (Service Alerts) --- */
.products-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.products-list .product-img {
    float: left;
}
.products-list .product-img img {
    height: 50px;
    width: 50px;
    object-fit: contain;
}
.products-list .product-info {
    margin-left: 60px;
}
.products-list .product-title {
    font-weight: 600;
    color: #fff;
    display: block;
}
.products-list .product-description {
    display: block;
    color: #ced4da;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 0.9rem;
}
.products-list > .item {
    border-bottom: 1px solid #444;
    padding: 10px 0;
}
.products-list > .item:last-of-type {
    border-bottom: none;
}

/* ========================================================================= */
/* ADMIN LTE SIDEBAR & TOPBAR STYLES                                         */
/* ========================================================================= */

/* 1. Top Navigation Bar */
.main-header {
    background-color: #2c2c2e;
    border-bottom: 1px solid #444;
    height: var(--header-height);
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar-width-collapsed); 
    z-index: 1030;
    padding: 0 15px;
    display: flex;
    align-items: center;
    transition: left 0.3s ease-in-out;
}

.main-header .nav-link {
    color: rgba(255,255,255,0.7) !important;
    padding: 0 1rem;
    cursor: pointer;
    background: transparent !important;
    border: none;
}
.main-header .nav-link:hover {
    color: #fff !important;
}

/* 2. Sidebar Container */
.sidebar-container {
    background-color: var(--sidebar-bg);
    width: var(--sidebar-width-collapsed); 
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
    overflow-x: hidden; /* Vital for hiding text when collapsed */
    overflow-y: auto;
    transition: width 0.3s ease-in-out; 
    border-right: 1px solid #333;
    scrollbar-width: none; 
    white-space: nowrap; /* Prevents text wrapping during transition */
}
.sidebar-container::-webkit-scrollbar { 
    display: none; 
}

/* EXPAND ON HOVER */
.sidebar-container:hover {
    width: var(--sidebar-width-expanded);
}

/* Sidebar Logo Area */
.sidebar-header {
    padding: 0;
    border-bottom: 1px solid #333;
    background-color: var(--sidebar-bg);
    display: flex;
    align-items: center;
    height: var(--header-height);
    overflow: hidden;
    transition: all 0.3s ease-in-out;
}

.brand-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #fff;
    width: 100%;
    padding-left: 18px; /* Fixed padding keeps logo stable */
    transition: all 0.3s ease-in-out;
}

.brand-image {
    height: 35px;
    width: 35px; /* Fixed width to prevent squashing */
    min-width: 35px; /* Ensures logo never shrinks */
    margin-right: 10px;
    opacity: .9;
    object-fit: contain;
}

/* Text Hiding Logic - The Fix for the Glitch */
.brand-text, 
.nav-link p {
    opacity: 0;
    visibility: hidden;
    max-width: 0; /* Shrink width to 0 when collapsed */
    display: inline-block;
    transition: all 0.3s ease-in-out; /* Animate width and opacity */
}

/* Show Text on Hover */
.sidebar-container:hover .brand-text,
.sidebar-container:hover .nav-link p {
    opacity: 1;
    visibility: visible;
    max-width: 200px; /* Expand to fit text */
    margin-left: 10px; /* Restore margin */
}

/* Sidebar Menu Alignment */
.sidebar-menu {
    padding: 10px 0; 
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-header {
    color: #6c757d;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 15px 20px 5px;
    letter-spacing: 1px;
    text-transform: uppercase;
    
    /* Hide Header Text smoothly */
    opacity: 0;
    height: 0;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
    white-space: nowrap;
}

/* Show Header on Hover */
.sidebar-container:hover .nav-header {
    opacity: 1;
    height: auto; /* Let it grow naturally */
    padding: 15px 20px 5px;
}

/* Navigation Links */
.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 0;
    padding-left: 20px; /* Keep icons aligned left always */
    color: #c2c7d0;
    text-decoration: none;
    border-radius: 0;
    margin-bottom: 0;
    transition: background-color 0.2s, color 0.2s;
    height: 50px; /* Fixed height for consistency */
}

.nav-link p {
    margin: 0;
    font-size: 0.95rem;
    /* Margin left is handled in the hover state transition above */
    margin-left: 0; 
}

.nav-icon {
    width: 30px; /* Fixed width for icon container */
    min-width: 30px;
    text-align: center;
    font-size: 1.2rem;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

/* Active/Hover States */
.sidebar-menu .nav-link:hover {
    background-color: var(--sidebar-hover);
    color: #fff;
}

.sidebar-menu .nav-link.active {
    background-color: var(--primary-color);
    color: #fff;
}

/* Logout link specific */
.logout-link:hover {
    background-color: #dc3545;
    color: white;
}

/* 3. Mobile Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 1035;
}

.profile-icon-link {
    color: #f7941e;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: color 0.3s ease;
}

.profile-icon-link:hover {
    color: var(--primary-color);
}

/* ========================================================================= */
/* Settings Hub & Profile Page Styles                                        */
/* ========================================================================= */
.settings-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 25px;
    min-height: 80vh;
}

.settings-nav {
    background: #252526;
    border-radius: 12px;
    padding: 15px;
    height: fit-content;
    border: 1px solid #333;
}

.settings-nav .nav-link {
    color: #aaa;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    border: none;
    width: 100%;
    text-align: left;
    background: transparent;
}

.settings-nav .nav-link i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

.settings-nav .nav-link:hover {
    background: #333;
    color: #fff;
}

.settings-nav .nav-link.active {
    background: var(--primary-color) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(93, 93, 255, 0.3);
}

.settings-content-card {
    background: #252526;
    border-radius: 12px;
    padding: 30px;
    border: 1px solid #333;
    box-shadow: var(--box-shadow);
}

.settings-header {
    border-bottom: 1px solid #333;
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.settings-header h4 { margin: 0; font-weight: 600; color: #fff; }
.settings-header p { color: #888; margin: 5px 0 0; font-size: 0.9rem; }

.settings-toggle-item {
    padding: 15px;
    background: #2a2a2b;
    border-radius: 8px;
    border: 1px solid #3a3a3b;
    margin-bottom: 15px;
}

@media (max-width: 992px) {
    .settings-grid { grid-template-columns: 1fr; }
}

/* ========================================================================= */
/* Login Page Specific Styles                                                */
/* ========================================================================= */
body.login-body {
    display: flex;
    height: 100vh;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding-left: 0; /* Reset sidebar padding for login */
    padding-top: 0;
}

.login-container {
    background: var(--secondary-color);
    padding: 40px;
    border-radius: var(--card-border-radius);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    width: 100%;
    max-width: 400px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
}

.login-container img {
    max-width: 150px;
    margin-bottom: 25px;
    background-color: rgba(255, 254, 254, 0.863);
    padding: 10px;
    border-radius: 12px;
}

.login-container h2 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: #ffffff;
    font-weight: 600;
}

.input-group {
    display: flex;
    align-items: center;
    background-color: #333;
    border: 1px solid #444;
    border-radius: 8px;
    margin: 15px 0;
    padding: 10px 15px;
    transition: all 0.3s ease;
}

.input-group:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(93, 93, 255, 0.2);
}

.input-group i {
    color: #888;
    margin-right: 15px;
    font-size: 1.1rem;
}

.login-container input[type="text"],
.login-container input[type="password"] {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-color);
    font-size: 1rem;
    padding: 5px 0;
}

.login-container input::placeholder {
    color: #888;
}

/* Fix for browser autofill white background */
.login-container input:-webkit-autofill,
.login-container input:-webkit-autofill:hover,
.login-container input:-webkit-autofill:focus,
.login-container input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #333 inset !important;
    -webkit-text-fill-color: #e0e0e0 !important;
}

.login-container button[type="submit"] {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 20px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.login-container button[type="submit"]:hover {
    background-color: #4c4cc0;
    transform: translateY(-2px);
}

.login-container .error {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 0.9rem;
    border: 1px solid #dc3545;
}

@media (max-width: 500px) {
    .login-container {
        padding: 30px 20px;
        margin: 20px;
    }
}
/* ========================================================================= */
/* Containers and Cards                                                      */
/* ========================================================================= */
.container.custom-width {
    max-width: 100%; /* Flexible width to fit remaining space */
    margin: 0 auto;
    padding: 28px 15px;
}

.main-content {
    padding-top: 0px;
}

.d-flex.flex-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    width: 100%;
    align-items: flex-start;
}
.d-flex.flex-wrap.gap-4 {
    flex-wrap: wrap;
    gap: 1.5rem;
}

.card {
    background-color: var(--secondary-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--card-border-radius);
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.card.outsource-card {
    background-color: #2c2c2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card.outsource-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

/* ========================================================================= */
/* Dashboard Specific Layout Styles                                          */
/* ========================================================================= */
.dashboard-container {
    padding-top: 1.5rem !important;
}

.company-logo-row {
    margin-top: 50px;
    margin-bottom: 1.5rem !important; 
}

.dashboard-card .card-body {
    padding: 2rem;
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.card-title {
    font-weight: 400;
    color: #ffffff;
}

.card-text {
    font-weight: 700;
    font-size: 2.5rem;
    color: #ffffff;
}

/* Specific card backgrounds for the tracker page */
.tracker-card-1 {
    background: #17469e;
    color: white;
    border-color: #17469e;
}
.tracker-card-2 {
    background: #640381;
    color: white;
    border-color: #640381;
}
.tracker-card-3 {
    background: #09868f;
    color: rgb(27, 26, 26);
    border-color: #09868f;
}
.tracker-card-4 {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}
.tracker-card-5 {
    background: #06b130;
    color: white;
    border-color: #06b130;
}

.hover-lift {
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }
        .hover-lift:hover {
            transform: translateY(-3px);
            box-shadow: 0 4px 10px rgba(0,0,0,0.3);
            background-color: #3b3b3b !important;
        }
        .account-card {
            background: linear-gradient(145deg, #2c2c2e, #1c1c1e);
        }   

/* Accounts Balances Card Styles */
.balance-cards {
    margin-bottom: 20px;
}
.balance-cards .card {
    border: 1px solid #495057;
    color: white;
}
.balance-cards .card-body h6 {
    color: #e0e0e0;
    font-weight: normal;
}
.balance-cards .card p {
    font-size: 1.5rem;
    font-weight: bold;
}
.balance-cards .balance-card-1 {
    background-color: #5d5dff ; /* Blue */
    border-color: #5d5dff ;
}
.balance-cards .balance-card-2 {
    background-color: #28a745; /* Green */
    border-color: #28a745;
}
.balance-cards .balance-card-3 {
    background-color: #6f42c1; /* Indigo */
    border-color: #6f42c1;
}

/* Client Details page styles */
.client-header {
    background: linear-gradient(145deg, #2c2c2e, #1c1c1e);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
}
.client-header h2 {
    font-weight: 600;
    color: #ffffff;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}
.client-header .text-muted {
    font-size: 1.1rem;
    color: #b0b0b0 !important;
}
.contact-info {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 1.2rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid #444;
    height: 100%;
}
.contact-info h5 {
    color: #5d5dff ;
    border-bottom: 1px solid #5d5dff ;
    padding-bottom: 8px;
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 1.2rem;
}
.contact-info p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}
.contact-info i {
    color: #5d5dff ;
    margin-right: 10px;
    width: 20px;
    text-align: center;
}
.right-column-summaries {
    height: 100%;
    display: flex;
    flex-direction: column;
}
.tab-section {
    background-color: #2c2c2e;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    flex-grow: 1;
}
.nav-tabs {
    border-bottom: none;
}
.nav-tabs .nav-link {
    background-color: transparent;
    border: none;
    color: #ccc;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}
.nav-tabs .nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #5d5dff , #e83e8c);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease-out;
    border-radius: 1.5px;
}
.nav-tabs .nav-link.active::before {
    transform: scaleX(1);
    transform-origin: bottom left;
}
.nav-tabs .nav-link:hover {
    background-color: #3b3b3b;
    color: #fff;
}
.nav-tabs .nav-link.active {
    background-color: #3b3b3b;
    border-radius: 4px;
    color: #fff;
}
.tab-content {
    padding-top: 1rem;
}
.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background-color: #333;
    border-radius: 8px;
    padding: 0.75rem;
    min-height: 70px;
    height: 100%;
}
.stat-card-link {
    text-decoration: none;
}
.stat-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #5d5dff ;
}
.stat-label {
    font-size: 0.8rem;
    color: #aaa;
}
.document-card {
    background-color: #242426;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    border: 1px solid #333;
}
.document-card-header {
    border-bottom: 1px solid #444;
    background-color: #2c2c2e;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #333;
}
.document-card-header h5 {
    color: #f8f9fa;
    font-weight: 600;
    font-size: 1.4rem;
}
.document-card-header .btn-sm {
    background-color: transparent;
    border: 1px solid #28a745;
    color: #28a745;
    transition: all 0.3s ease;
}
.document-card-header .btn-sm:hover {
    background-color: #28a745;
    color: white;
}
.document-type-icon {
    margin-right: 8px;
}

/* Enquiry page styles */
.enquiry-row,
.notes-row {
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid transparent;
}
.enquiry-row:hover,
.notes-row.hovered {
    background-color: rgba(60, 60, 60, 0.7) !important;
}

.enquiry-row:hover + .notes-row {
    background-color: rgba(60, 60, 60, 0.7) !important;
}

.enquiry-gap-row td {
    height: 20px;
    padding: 0 !important;
    background-color: transparent !important;
}
.enquiry-bg-1 td { background-color: #2a2a2a !important; }
.enquiry-bg-2 td { background-color: #212121 !important; }

/* Client Form Styles */
.client-form-container {
    flex: 0 0 350px;
    max-width: 350px;
    background-color: #2c2c2e;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
    transition: all 0.4s ease;
    height: fit-content;
}
.client-form-container:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
}
.client-form-container .form-label,
.client-form-container .form-control::placeholder {
    color: var(--text-color);
    font-size: 0.8rem;
}
.file-upload-container {
    margin-top: 1rem;
}
.file-input-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #f8f9fa;
    font-size: 0.9rem;
}
.file-input-hint {
    font-size: 0.8rem;
    color: #6c757d;
    display: block;
    margin-top: 0.25rem;
}
.uploaded-file-info {
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
}
.file-link {
    color: #5d5dff ;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.8rem;
}
.file-link:hover {
    color: #0b5ed7;
    text-decoration: underline;
}
.delete-file-btn {
    color: #dc3545;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.3s ease;
}
.delete-file-btn:hover {
    color: #c82333;
}
.renewal-alert {
    background-color: rgba(255, 193, 7, 0.1) !important;
    border-left: 5px solid #ffc107 !important;
    transition: all 0.5s ease-in-out;
}
.renewal-alert:hover {
    background-color: rgba(255, 193, 7, 0.2) !important;
}

.renewal-info-text {
    font-size: 0.9rem;
    font-weight: normal;
    color: #fff !important; /* Forces the text to be black */
}

.badge-renewal {
    background-color: #ffc107 !important; /* Yellow background */
    color: #000000 !important; /* Black text */
    padding: 0.4em 0.8em;
    border-radius: 0.25rem;
}

.renewal-info-text .badge {
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
.notes-row {
    background-color: rgba(255, 255, 255, 0.08) !important;
}
.notes-cell {
    white-space: pre-wrap;
    word-wrap: break-word;
    border-top: none;
    font-style: italic;
    color: #ced4da;
    padding-left: 20px;
    font-size: 0.8rem;
}
.notes-container {
    display: flex;
    align-items: flex-start;
    padding: 0;
    margin: 0;
}
.notes-label {
    font-weight: bold;
    color: #5d5dff ;
    margin-right: 8px;
    padding: 0;
    line-height: 1.1;
    font-size: 0.9rem;
}
.notes-content {
    padding: 0;
    line-height: 1.4;
    font-size: 0.8rem;
}
.client-name-cell strong {
    font-weight: normal;
    color: var(--text-color);
}
.text-muted {
    color: #d3d0d0 !important;
    font-weight: normal;
}
.client-list {
    flex: 1;
    min-width: 0;
}
.client-list table thead {
    position: sticky;
    top: 0; 
    z-index: 10;
    background-color: #2c2c2e; 
}
.task-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* ========================================================================= */
/* Forms and Inputs                                                          */
/* ========================================================================= */
.upload-form {
    flex: 0 0 350px;
    max-width: 350px;
    padding: 20px;
    background-color: #2c2c2e;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: fit-content;
}

.upload-form:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.form-label.small {
    font-size: 0.8rem;
    color: #e0e0e0;
}

.form-control, .form-select {
    background-color: #343a40;
    border-color: #495057;
    color: #ffffff !important;
    font-size: 0.9rem;
}

.form-control:focus, .form-select:focus {
    background-color: #495057;
    border-color: #5d5dff ;
    box-shadow: 0 0 0 0.25rem rgba(13, 202, 240, 0.25);
    color: #ffffff !important;
}

.transfer-note {
    font-size: 0.75rem;
    color: #a0a0a0;
    margin-top: 5px;
}

/* Currency radio group for bills.php */
.currency-radio-group .form-check-label {
    color: white;
}

.currency-radio-group .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.currency-radio-group {
    display: flex;
    gap: 15px;
    margin-top: 5px;
}

/* VAT Calculation section */
.vat-calculation {
    background-color: rgba(255, 193, 7, 0.1);
    border-radius: 5px;
    padding: 10px;
    margin-top: 10px;
    border-left: 4px solid #ffc107;
}

.vat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.vat-total {
    font-weight: bold;
    border-top: 1px solid #666;
    padding-top: 5px;
    margin-top: 5px;
}

/* Filter row layout */
.filter-section {
    background-color: #2c2c2e;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #333;
}
.filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 15px;
    margin-bottom: 20px;
}
.filter-section .filter-row {
    margin-bottom: 0;
}
.filter-row .d-flex {
    flex-grow: 1;
    gap: 15px;
}
.filter-row .search-input-container {
    flex-grow: 1;
    min-width: 200px;
}

.filter-row .form-group {
    flex: 1;
}

.row-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.filter-row .form-control.form-control-sm::placeholder {
    color: #fff;
    opacity: 0.5;
}

/* ========================================================================= */
/* Tables and Lists */
/* ========================================================================= */
.document-list {
    flex: 1;
    min-width: 0;
    padding: 20px;
    background-color: #242426;
    border-radius: 12px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
    border: 1px solid #333;
}
.client-list {
    flex: 1;
    min-width: 0;
}


.table-responsive {
    overflow-x: auto;
    border-radius: 8px;
}

/* General table styling for all pages */
.table.table-dark {
    --bs-table-bg: #212121;
    --bs-table-striped-bg: #2a2a2a;
    --bs-table-hover-bg: #444444;
    --bs-table-border-color: #444444;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: #2a2a2a;
}
.table-striped > tbody > tr:nth-of-type(even) > * {
    background-color: #212121;
}

.table th, .table td {
    vertical-align: middle;
    color: #ffffff;
    border-color: #444444;
    font-size: 0.8rem;
    padding: 12px 15px;
    /* This adds the vertical line to all cells */
    border-right: 1px solid rgba(255, 255, 255, 0.1); 
}
/* This removes the right border from the last cell in each row */
.table th:last-child,
.table td:last-child {
    border-right: none;
}
/* Style for vertical table lines on client_details.php tables */
.document-table th, .document-table td {
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}
.document-table th:last-child, .document-table td:last-child {
    border-right: none;
}
/* Doc Tracker Page Table Styles */
.invoice-table th, .invoice-table td,
.quotation-table th, .quotation-table td {
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.8rem;
}
.invoice-table thead, .quotation-table thead {
    background-color: #2c2c2e;
    color: var(--text-color);
    font-weight: 600;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

/* Bills Page Table Styles */
.bills-table th, .bills-table td {
    font-size: 0.8rem;
}
.bills-table th.description-cell, .bills-table td.description-cell {
    max-width: 400px;
    white-space: pre-wrap;
    word-wrap: break-word;
}
/* Bills.php Table Individual Column Widths */
.bills-table .bills-col-date { width: 5%; min-width: 90px; }
.bills-table .bills-col-day { width: 6%; min-width: 90px; }
.bills-table .bills-col-description { width: 36%; min-width: 250px; }
.bills-table .bills-col-category { width: 8%; min-width: 100px; }
.bills-table .bills-col-client { width: 8%; min-width: 100px; }
.bills-table .bills-col-supplier { width: 15%; min-width: 100px; }
.bills-table .bills-col-amount { width: 6%; min-width: 60px; }
.bills-table .bills-col-vat { width: 6%; min-width: 60px; }
.bills-table .bills-col-total { width: 8%; min-width: 80px; }
.bills-table .bills-col-file { width: 5%; min-width: 50px; text-align: center; }
.bills-table .bills-col-actions { width: 10%; min-width: 120px; }

/* docs.php Table Individual Column Widths */
.docs-table .docs-col-date { width: 4%; min-width: 50px; }
.docs-table .docs-col-number { width: 9%; min-width: 90px; }
.docs-table .docs-col-client { width: 9%; min-width: 90px; }
.docs-table .docs-col-type { width: 2%; min-width: 20px; }
.docs-table .docs-col-amount { width: 5%; min-width: 80px; }
.docs-table .docs-col-description { width: 38%; min-width: 100px; }
.docs-table .docs-col-file { width: 8%; min-width: 80px; }
.docs-table .docs-col-actions { width: 8%; min-width: 100px; }

/* tracker.php Table invoice Individual Column Widths */
.invoice-table .invoice-col-date { width: 1%; min-width: 50px; }
.invoice-table .invoice-col-number { width: 7%; min-width: 70px; }
.invoice-table .invoice-col-client { width: 8%; min-width: 100px; }
.invoice-table .invoice-col-contact { width: 15%; min-width: 100px; }
.invoice-table .invoice-col-amount { width: 2%; min-width: 90px; }
.invoice-table .invoice-col-vat { width: 5%; min-width: 50px; }
.invoice-table .invoice-col-total { width: 2%; min-width: 50px; }
.invoice-table .invoice-col-description { width: 28%; min-width: 80px; }
.invoice-table .invoice-col-expiry { width: 5%; min-width: 50px; }
.invoice-table .invoice-col-actions { width: 15%; min-width: 60px; }

/* tracker.php Table quotation Individual Column Widths */
.quotation-table .quote-col-date { width: 2%; min-width: 80px; }
.quotation-table .quote-col-number { width: 5%; min-width: 50px; }
.quotation-table .quote-col-client { width: 6%; min-width: 60px; }
.quotation-table .quote-col-contact { width: 9%; min-width: 60px; }
.quotation-table .quote-col-amount { width: 4%; min-width: 50px; }
.quotation-table .quote-col-description { width: 25%; min-width: 150px; }
.quotation-table .quote-col-expiry { width: 4%; min-width: 40px; }
.quotation-table .quote-col-actions { width: 14%; min-width: 90px; }

/* accounts.php Table Individual Column Widths */
.accounts-table .accounts-col-date { width: 5%; min-width: 50px; }
.accounts-table .accounts-col-day { width: 6%; min-width: 60px; }
.accounts-table .accounts-col-desc { width: 34%; min-width: 100px; }
.accounts-table .accounts-col-source { width: 5%; min-width: 80px; }
.accounts-table .accounts-col-cat { width: 5%; min-width: 90px; }
.accounts-table .accounts-col-income { width: 5%; min-width: 50px; }
.accounts-table .accounts-col-expense { width: 5%; min-width: 50px; }
.accounts-table .accounts-col-balance { width: 5%; min-width: 50px; }
.accounts-table .accounts-col-actions { width: 8%; min-width: 60px; }

/* clients.php Table Individual Column Widths */
.clients-table .clients-col-name { width: 20%; min-width: 100px; }
.clients-table .clients-col-code { width: 5%; min-width: 50px; }
.clients-table .clients-col-contact { width: 20%; min-width: 100px; }
.clients-table .clients-col-website { width: 15%; min-width: 75px; }
.clients-table .clients-col-vat { width: 10%; min-width: 80px; }
.clients-table .clients-col-renewal { width: 9%; min-width: 90px; }
.clients-table .clients-col-actions { width: 9%; min-width: 90px; }

/* suppliers.php Table Individual Column Widths */
.suppliers-table .suppliers-col-name { width: 20%; min-width: 100px; }
.suppliers-table .suppliers-col-contact { width: 15%; min-width: 100px; }
.suppliers-table .suppliers-col-legal { width: 10%; min-width: 75px; }
.suppliers-table .suppliers-col-expiry { width: 10%; min-width: 80px; }
.suppliers-table .suppliers-col-actions { width: 9%; min-width: 60px; }

/* Clients Page Table Styles */
.client-list table th, .client-list table td {
    vertical-align: middle;
    color: #c0c0c0;
    border-color: #444444;
    font-size: 0.8rem;
}
.client-list table th {
    font-size: 0.8rem;
    font-weight: bold;
    color: white;
}
.client-name-cell strong {
    font-weight: normal;
    color: var(--text-color);
}

/* Client Details Page Table Styles */
.document-table th, .document-table td {
    /* Updated border style for client details tables */
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}
.document-table th:last-child, .document-table td:last-child {
    border-right: none;
}
.document-table th {
    background-color: #343a40;
    color: #f8f9fa;
    border-bottom: 2px solid #5d5dff ;
    font-weight: 600;
    vertical-align: middle;
}
.document-table tbody tr {
    transition: background-color 0.2s ease;
}
.document-table tbody tr:hover {
    background-color: #3c3c3e;
}
.document-table td {
    vertical-align: middle;
    font-size: 0.8rem;
    color: #c0c0c0;
}

/* Profile Page Table Styles */
#profile-table th, #profile-table td {
    font-size: 0.9rem;
}


.action-column {
    min-width: 140px;
    text-align: center;
}
.description-cell {
    white-space: pre-wrap;
    word-wrap: break-word;
    max-width: 400px;
}

/* Recent activity for dashboard */
.recent-activity-item {
    border-radius: 8px;
    background-color: #2a2a2a;
    padding: 15px;
    margin-bottom: 8px;
    border-left: 5px solid transparent;
    transition: all 0.3s ease;
}

.recent-activity-item:hover {
    background-color: #3b3b3b;
    border-left-color: var(--primary-color);
}

.activity-icon {
    font-size: 1.2rem;
    margin-right: 15px;
}

.recent-activity-item .flex-grow-1 small {
    color: #ffffff !important;
}

/* Enquiry table-specific styles */
.enquiry-table th, .enquiry-table td {
    vertical-align: middle;
    font-size: 0.8rem;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 15px;
}
.enquiry-table th:last-child,
.enquiry-table td:last-child {
  border-right: none;
}
.enquiry-table thead th {
    background-color: #2c2c2e;
    color: var(--text-color);
    font-weight: 600;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}
.enquiry-bg-1 td { background-color: #2a2a2a !important; }
.enquiry-bg-2 td { background-color: #212121 !important; }

/* ========================================================================= */
/* Buttons and Links                                                         */
/* ========================================================================= */
.action-buttons {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Base button style for the new effect */
.action-buttons .btn {
    white-space: nowrap;
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: color 0.4s ease-in-out;
}

.action-buttons .btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--btn-hover-bg);
    z-index: -1;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s ease-in-out;
}

.action-buttons .btn:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Specific button colors with new hover background */
.btn-info {
    --btn-hover-bg: #ee8397; /* Darker blue */
    background-color: #ff1f48 !important;
    border-color: #ff1f48 !important;
    color: white !important;
}

.btn-warning {
    --btn-hover-bg: #e6b300; /* Darker yellow */
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
    color: black !important;
}

.btn-danger {
    --btn-hover-bg: #bb2d3b; /* Darker red */
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: white !important;
}

.btn-primary {
    --btn-hover-bg: #4c4cc0; /* Darker primary */
    background-color: #5d5dff !important;
    border-color: #5d5dff !important;
    color: white !important;
}

.btn-success {
    --btn-hover-bg: #198754;
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    color: white !important;
}

.btn-outline-primary {
    --btn-hover-bg: #5d5dff;
    color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    background-color: transparent !important;
}
.btn-outline-primary:hover {
    color: white !important;
}

.btn-outline-info {
    --btn-hover-bg: #17a2b8;
    color: #17a2b8 !important;
    border-color: #17a2b8 !important;
    background-color: transparent !important;
}
.btn-outline-info:hover {
    color: white !important;
}

.btn-outline-warning {
    --btn-hover-bg: #ffc107;
    color: #ffc107 !important;
    border-color: #ffc107 !important;
    background-color: transparent !important;
}
.btn-outline-warning:hover {
    color: white !important;
}

.btn-outline-danger {
    --btn-hover-bg: #dc3545;
    color: #dc3545 !important;
    border-color: #dc3545 !important;
    background-color: transparent !important;
}
.btn-outline-danger:hover {
    color: white;
}

.btn-outline-secondary {
    color: white !important;
    border-color: white !important;
    background-color: transparent !important;
}
.btn-outline-secondary:hover {
    background-color: white !important;
    color: #212529 !important;
}

/* Custom button styles for document icons */
.btn-pdf {
    background-color: #dc3545 !important; /* Red background */
    border-color: #dc3545 !important; /* Red border */
    color: white !important; /* White icon */
    --btn-hover-bg: #bb2d3b; /* Darker red on hover */
}

.btn-docx {
    background-color: #007bff !important; /* Blue background */
    border-color: #007bff !important; /* Blue border */
    color: white !important; /* White icon */
    --btn-hover-bg: #0069d9; /* Darker blue on hover */
}

/* Custom View button for clients.php */
.btn-view {
    background-color: #28a745 !important; /* Green background */
    border-color: #28a745 !important;     /* Green border */
    color: white !important;            /* White text/icon */
    --btn-hover-bg: #198754;              /* Darker green on hover */
}

a.client-link, a.supplier-link {
    color: #f7941e !important;
    text-decoration: none !important;
}

a.client-link:hover, a.supplier-link:hover {
    text-decoration: underline !important;
    color: #ffffff !important;
}

.whatsapp-link {
    color: #25D366;
    text-decoration: none;
    font-weight: normal;
}

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

.email-link {
    color: #0078D4;
    text-decoration: none;
}
.email-link:hover {
    text-decoration: underline;
}

/* Client Details Page Buttons */
.contact-info .btn-outline-info {
    --btn-hover-bg: white;
    color: white !important;
    border-color: white !important;
    background-color: transparent;
    transition: all 0.3s ease;
}
.contact-info .btn-outline-info:hover {
    background-color: white;
    color: #212121 !important;
}

.view-btn {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white !important;
    --btn-hover-bg: #5a6268;
}
.view-btn:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

.document-card-header .btn-sm {
    --btn-hover-bg: #28a745;
    background-color: transparent;
    border: 1px solid #28a745;
    color: #28a745;
    transition: all 0.3s ease;
}
.document-card-header .btn-sm:hover {
    background-color: #28a745;
    color: white;
}
.document-table .btn-outline-danger {
    --btn-hover-bg: #bb2d3b;
    color: #dc3545;
    border-color: #dc3545;
    background-color: transparent;
}
.document-table .btn-outline-danger:hover {
    background-color: #dc3545;
    color: white;
}
.document-table .btn-outline-primary {
    --btn-hover-bg: #4c4cc0;
    color: #5d5dff ;
    border-color: #5d5dff ;
    background-color: transparent;
}
.document-table .btn-outline-primary:hover {
    background-color: #5d5dff ;
    color: white;
}
.alert-info .btn-primary {
    --btn-hover-bg: #4c4cc0;
    background-color: #5d5dff !important;
    border: 1px solid #5d5dff !important;
    color: white !important;
}
.alert-info .btn-success {
    --btn-hover-bg: #198754;
    background-color: #28a745 !important;
    border: 1px solid #28a745 !important;
    color: white !important;
}
.alert-info .btn-info {
    --btn-hover-bg: #0d6efd;
    background-color: #17a2b8 !important;
    border: 1px solid #17a2b8 !important;
    color: white !important;
}
.alert-info .btn-warning {
    --btn-hover-bg: #e6b300;
    background-color: #ffc107 !important;
    border: 1px solid #ffc107 !important;
    color: #212529 !important;
}
.document-list .d-flex.justify-content-between.align-items-center.mb-3 {
    align-items: baseline !important;
    gap: 15px;
}

/* New CSS rule for clients.php action column buttons */
.client-list .action-column .btn {
    white-space: nowrap;
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: color 0.4s ease-in-out;
}

.client-list .action-column .btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--btn-hover-bg);
    z-index: -1;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s ease-in-out;
}

.client-list .action-column .btn:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* ========================================================================= */
/* Specific Component Styles                                                 */
/* ========================================================================= */
/* Document Type Tags */
.type-cell {
    font-weight: bold;
    border-radius: 4px;
    padding: 2px 6px;
    display: inline-block;
}

.type-invoice-paid {
    background-color: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.type-invoice-not-paid {
    background-color: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.type-quotation-accepted {
    background-color: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.type-quotation-rejected {
    background-color: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.type-quotation-under-review {
    background-color: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

/* Status Dropdowns for tracker.php */
.status-dropdown {
    min-width: 85px;
    color: white !important;
    border: none !important;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    flex-grow: 1;
}

.status-dropdown.status-paid {
    background-color: #28a745;
}

.status-dropdown.status-not-paid {
    background-color: #dc3545;
}

.status-dropdown.status-accepted {
    background-color: #28a745;
}

.status-dropdown.status-under-review {
    background-color: #ffc107;
    color: #212529 !important;
}

.status-dropdown.status-rejected {
    background-color: #dc3545;
}

/* Expiry Status for tracker.php and client_details.php */
.expired {
    color: #dc3545;
    font-weight: normal;
    background-color: rgba(220, 53, 69, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.expiring-soon {
    color: #ffc107;
    font-weight: normal;
}

.expiry-normal {
    color: #28a745;
    font-weight: normal;
}

/* Chart.js Specific Styles for dashboard.php */
.chart-container {
    position: relative;
    height: 350px;
    width: 100%;
}

.chartjs-tooltip {
    background-color: #2a2a2a;
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.8rem;
    opacity: 1;
    pointer-events: none;
    transition: opacity 0.15s ease;
    box-shadow: var(--box-shadow);
}

/* New style for white separator line */
.white-separator {
    border: 0;
    height: 1px;
    background-color: #f8f9fa; /* White color */
    margin: 30px 0;
    opacity: 0.3; /* Optional: for a softer look */
}

/* Quick Actions for dashboard.php */
.quick-actions .btn {
    background-color: var(--background-color);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 12px 20px;
    margin: 8px;
    transition: all 0.3s ease;
}

.quick-actions .btn:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.05);
}

/* Module Cards for dashboard.php */
.module-card {
    border-radius: 12px;
    transition: all 0.3s ease;
}

.module-card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.module-card.bg-primary { background-color: #5d5dff !important; }
.module-card.bg-success { background-color: #28a745 !important; }
.module-card.bg-info { background-color: #17a2b8 !important; }
.module-card.bg-warning { background-color: #ffc107 !important; }
.module-card.bg-danger { background-color: #dc3545 !important; }
.module-card.bg-secondary { background-color: #6c757d !important; }

/* VAT Summary for dashboard.php */
.vat-summary .progress-bar {
    border-radius: 0px;
}

.vat-summary .fw-bold,
.vat-summary .d-flex span,
.vat-summary .card-header h5 {
    color: white !important;
}

/* Accounts page specific styles */
.category-report .table {
    border: 1px solid #444;
}
.category-report .total-row {
    font-weight: bold;
    background-color: #333 !important;
}

/* Custom class for expense column color */
.text-expense {
    color: #ffc107 !important;
}

.text-income {
    color: #29ca23 !important;
}

/* Enquiry page status badges */
.status-badge {
    color: white;
    font-weight: 600;
    border: none;
}
.bg-new { background-color: #5d5dff !important; }
.bg-contacted { background-color: #ffc107 !important; color: #000 !important; }
.bg-converted { background-color: #198754 !important; }
.bg-lost { background-color: #dc3545 !important; }
.files-column .file-icon {
    font-size: 1.2rem;
    color: var(--primary-color);
    transition: color 0.2s;
}
.files-column .file-icon:hover {
    color: #ffffff;
}

/* Client Details Page Badges */
.badge-paid { background-color: #28a745 !important; }
.badge-not-paid { background-color: #dc3545 !important; }
.badge-accepted { background-color: #28a745 !important; }
.badge-rejected { background-color: #dc3545 !important; }
.badge-under-review { background-color: #ffc107 !important; color: #212529; }
.badge-bank { background-color: #17a2b8 !important; }
.badge-hand { background-color: #6f42c1 !important; }
.badge-card { background-color: #e83e8c !important; }
.badge-lpo { background-color: #6f42c1 !important; }
.badge-agreement { background-color: #fd7e14 !important; }
.badge-do { background-color: #17a2b8 !important; }
.badge-other { background-color: #6c757d !important; }

/* ========================================================================= */
/* Todo Page Styles                                                          */
/* ========================================================================= */
.main-content {
    margin-top: -30px;
}

/* Page Layout for Todo */
.form-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.filter-row .filter-item {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.filter-section .form-control,
.filter-section .form-select {
    font-size: 0.8rem;
    padding: 0.5rem;
    height: 38px; /* Standard height */
}

.task-list-section {
    flex: 1;
}

.date-header {
    background-color: #3a3a3a;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    margin: 20px 0 10px;
    font-weight: bold;
    font-size: 1rem;
}

.list-group-item {
    background-color: #2c2c2e;
    border: 1px solid #9c9797;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.list-group-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px #e2e0784d;
    background-color: var(--hover-bg-task); /* Added background color change */
}

.list-group-item.completed-task {
    opacity: 0.7;
    background-color: #97b8da;
}

.description-text {
    color: white !important;
}

.task-card-wrapper {
    position: relative;
    padding-left: 10px;
}

/* Change "Due:" text color to white */
.list-group-item small {
    color: white; 
}

/* VAT Page Specific Styles */
.vat-card-1 {
    background-color: #5d5dff; /* Blue */
    border-color: #5d5dff;
    color: white;
}
.vat-card-2 {
    background-color: #dc3545; /* Red */
    border-color: #dc3545;
    color: white;
}
.vat-card-3 {
    background-color: #28a745; /* Green */
    border-color: #28a745;
    color: white;
}

.vat-card-1 .card-title, .vat-card-2 .card-title, .vat-card-3 .card-title {
    color: white !important;
    font-weight: bold;
}
.vat-card-1 .card-text, .vat-card-2 .card-text, .vat-card-3 .card-text {
    font-weight: bold;
    color: white;
}
.vat-card-1 small, .vat-card-2 small, .vat-card-3 small {
    color: white !important;
}

.document-list > .card {
    border: 1px solid rgb(54, 53, 53);
    background-color: transparent;
}

.card-header {
    background-color: #3a3a3a !important;
    color: #fff;
    border-bottom: 1px solid #444; /* Darker border */
    font-weight: bold;
}

.modal-content {
    background-color: #2c2c2e;
    color: white;
    border: 1px solid #444;
    border-radius: 12px;
}
.modal-header {
    border-bottom: 1px solid #444;
}
.modal-footer {
    border-top: 1px solid #444;
}

/* Scroll to Top button */
#scrollTopBtn {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99;
    border: none;
    outline: none;
    background-color: #5d5dff ;
    color: white;
    cursor: pointer;
    padding: 15px;
    border-radius: 50%;
    font-size: 18px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s, opacity 0.3s;
    width: 45px;
    height: 45px;
    text-align: center;
    line-height: 1.5; /* Adjust vertical alignment for icon */
}

#scrollTopBtn:hover {
    background-color: #0b5ed7;
}

/* Auto-hide alert */
.alert-auto-hide {
    animation: fadeOut 5s forwards;
    opacity: 1;
}
@keyframes fadeOut {
    0% { opacity: 1; }
    90% { opacity: 1; }
    100% { opacity: 0; display: none; }
}

/* Profile Page Styles */
.profile-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.profile-form-wrapper {
    background: linear-gradient(145deg, #2c2c2e, #1c1c1e);
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-form-title {
    color: white;
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.8rem;
    font-weight: 600;
}

.horizontal-form {
    display: flex;
    gap: 40px;
    width: 100%;
}

.form-section {
    flex: 1;
    min-width: 300px;
    background-color: #2C2C2C;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.form-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.form-section h5 {
    color: #5d5dff ;
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
}

.form-label {
    color: #ddd !important;
    font-weight: 500;
}


/* ========================================================================= */
/* Outsource Page Specific Styles                                            */
/* ========================================================================= */
.project-details {
    border-left: 3px solid var(--primary-color);
    padding-left: 15px;
}

/* Accordion styles */
.accordion-item {
    background-color: #3b3b3b;
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s ease;
}

.projects-accordion .accordion-item:hover {
    background-color: var(--hover-bg-projects);
}

.worker-listing-accordion .accordion-item:hover {
    background-color: var(--hover-bg-workers);
}

.accordion-button {
    background-color: #2a2a2a;
    color: #e0e0e0;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.accordion-button:focus {
    box-shadow: none;
    border-color: var(--primary-color);
}

.payment-history th, .payment-history td {
    font-size: 0.9rem;
}

/* Form control and button overrides for consistency */
.form-label.small, .h4-white, .table-responsive .text-white, .form-check-label {
    color: white !important;
}

.form-control::placeholder { /* For modern browsers */
    color: #ffffff !important;
    opacity: 1; /* Override default opacity */
}

.form-control:-ms-input-placeholder { /* For Internet Explorer 10-11 */
    color: #ffffff !important;
}

.form-control::-ms-input-placeholder { /* For Microsoft Edge */
    color: #ffffff !important;
}

/* Checkbox list for workers */
.worker-checkbox-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #495057;
    border-radius: 8px;
    padding: 10px;
    background-color: #343a40;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.worker-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-basis: 100%;
}

.worker-item .form-check {
    flex-grow: 1;
}

/* Adjustments for form fields as per user request */
.worker-item .worker-cost-input {
    width: 190px; /* Increased width for amount */
    color: white !important; /* Force text color to be white */
}

.worker-item select {
    width: 80px; /* Reduced width */
}

.project-workers-cost-breakdown {
    border: 1px solid #495057;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    background-color: #343a40;
}

/* Accordion colors */
.projects-accordion .accordion-button.collapsed:hover {
    background-color: var(--hover-bg-projects);
}

.worker-listing-accordion .accordion-button.collapsed:hover {
    background-color: var(--hover-bg-workers);
}

/* New styles for green worker name and fully paid badge */
.worker-name-green {
    color: #28a745 !important;
}

.badge-fully-paid {
    background-color: #5d5dff !important; /* A shade of blue-purple */
    color: #fff;
}

.badge-no-dues {
    background-color: #28a745 !important; /* A shade of green */
    color: #fff;
}

/* Timeline Specific Styles */
.timeline {
    position: relative;
    padding-left: 20px;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #495057; /* Dark gray for the line */
}
.timeline-item {
    position: relative;
    margin-bottom: 20px;
    padding-left: 20px;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #20c997; /* Bootstrap Success color */
    border: 2px solid #fff;
    z-index: 1;
}
.timeline-item-date {
    font-size: 0.9em;
    color: #ccc;
}
.timeline-actions {
    font-size: 0.8em;
    margin-top: 5px;
}
.timeline-actions .btn {
    padding: 0 5px;
    line-height: 1;
    font-size: 0.75rem;
}

/* Table Header Highlight for Tracker Page */
.invoice-table thead, .quotation-table thead {
    background-color: #3a3a3a;
}
.invoice-table th, .quotation-table th {
    font-weight: bold;
    color: white;
}

/* ========================================================================= */
/* Media Queries (Responsive Design)                                         */
/* ========================================================================= */
@media (max-width: 1200px) {
    /* * NOTE: Max-width constraint removed for custom-width container 
     * to adapt to sidebar, but flex behavior maintained.
     */
    .container.custom-width.main-content {
        flex-direction: column;
        gap: 20px;
    }

    .upload-form, .document-list {
        flex: 1 1 100%;
        max-width: 100%;
    }
    .client-form-container,
    .client-list {
        max-width: 100%;
        min-width: unset;
    }

    .filter-row {
        flex-wrap: wrap;
        gap: 10px;
    }

    .filter-row .form-group {
        flex-basis: calc(50% - 5px);
    }

    .d-flex.flex-wrap.justify-content-between {
        flex-direction: column;
        gap: 20px;
    }
}
@media (max-width: 992px) {
    .client-header .row > div {
        margin-bottom: 1.5rem;
    }
    /* Adjusted header behavior for mobile is handled in sidebar section below */
    .buttons {
        margin-top: 10px;
        flex-wrap: wrap;
        justify-content: center;
    }
    .horizontal-form {
        flex-direction: column;
        gap: 30px;
    }
    .profile-form-wrapper {
        min-width: unset;
        width: 100%;
    }
    .form-section {
        min-width: unset;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .filter-section {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-row .form-group, .row-selector {
        width: 100%;
    }

    .table-responsive {
        overflow-x: auto;
    }

    .table {
        font-size: 0.8rem;
    }

    .action-buttons {
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
    }

    .action-buttons .btn {
        width: 100%;
    }
    .client-header {
        padding: 1.5rem;
    }
    .client-header h2 {
        font-size: 2rem;
    }
    .right-column-summaries .summary-grid {
        grid-template-columns: 1fr;
    }
    .document-table td, .document-table th {
        font-size: 0.8rem;
    }
    .document-table .btn {
        padding: 0.1rem 0.3rem;
        font-size: 0.7rem;
    }
}

/* Sidebar Responsive Logic */
@media (max-width: 991.98px) {
    body {
        padding-left: 0; /* No padding on mobile */
    }

    .main-header {
        left: 0; /* Header spans full width */
    }

    .sidebar-container {
        /* Default state on mobile is hidden off-canvas */
        transform: translateX(-100%); 
        /* When visible on mobile, it should be FULL width, not icon-only */
        width: var(--sidebar-width-expanded) !important;
    }

    /* When sidebar is OPEN on mobile (via toggle JS) */
    body.sidebar-collapse {
        overflow: hidden; /* Prevent body scroll */
    }
    
    body.sidebar-collapse .sidebar-container {
        transform: translateX(0); /* Slide in */
    }

    body.sidebar-collapse .sidebar-overlay {
        display: block; /* Show overlay */
    }

    /* Force text to show on mobile when menu is open */
    .sidebar-container .brand-text,
    .sidebar-container .nav-link p,
    .sidebar-container .nav-header {
        display: block !important;
        opacity: 1 !important;
    }

    .sidebar-container .nav-link {
        justify-content: flex-start;
        padding-left: 20px;
    }
    
    .sidebar-container .nav-icon {
        margin-right: 10px;
    }
    
    .sidebar-container .brand-link {
        justify-content: flex-start;
        padding-left: 20px;
    }
    .sidebar-container .brand-image {
        margin-right: 10px;
    }
}

/* Desktop View Collapse (Optional: sidebar toggle behavior on desktop) */
@media (min-width: 992px) {
    body.sidebar-collapse {
        padding-left: 0;
    }
    
    body.sidebar-collapse .sidebar-container {
        transform: translateX(-100%);
    }
    
    body.sidebar-collapse .main-header {
        left: 0;
    }
}

/* Styles for the Password field in the credentials section */
.password-hidden {
    position: relative;
    display: flex;
    align-items: center;
    gap: 5px;
}

.password-hidden .btn-show-password {
    background: none;
    border: none;
    color: #fff;
    font-size: 0.8rem;
    padding: 2px 5px;
    border: 1px solid #6c757d;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.password-hidden .btn-show-password:hover {
    background-color: #6c757d;
    color: #fff;
}

/* ========================================================================= */
/* Invoice Page Specific Styles (for generate_invoice.php)                   */
/* ========================================================================= */
.paid-invoice-container {
    max-width: 800px;
    margin: auto;
    background: #fff;
    padding: 40px;
    box-shadow: none;
    border-radius: 8px;
    color: #000000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.paid-invoice-container .invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #343a40;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.paid-invoice-container .invoice-header h1 {
    color: #000000;
    font-weight: bold;
}

.paid-invoice-container .invoice-header img {
    height: 60px;
}

/* Ensure all relevant headings and labels are black */
.paid-invoice-container h5,
.paid-invoice-container .invoice-details p strong,
.paid-invoice-container .invoice-details p,
.paid-invoice-container .invoice-items h5,
.paid-invoice-container .invoice-summary h4,
.paid-invoice-container .invoice-summary p,
.paid-invoice-container .company-info-block p,
.paid-invoice-container .invoice-footer p,
.paid-invoice-container strong,
.paid-invoice-container .mb-0 {
    color: #000000 !important;
}

/* Ensure the payment history heading text is black for the invoice printout */
.paid-invoice-container .payment-history-list h6.smallhistory {
    color: #000000 !important;
}

.paid-invoice-container .payment-history-list li {
    color: #000000;
}

.paid-invoice-container .invoice-details th, .paid-invoice-container .invoice-details td {
    padding: 8px 0;
    text-align: left;
}

.paid-invoice-container .invoice-details th {
    width: 30%;
    color: #6c757d;
}

.paid-invoice-container .invoice-items table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.paid-invoice-container .invoice-items th, .paid-invoice-container .invoice-items td {
    border: none;
    padding: 12px;
    text-align: left;
}

    .paid-invoice-container .invoice-items th {
        background-color: #a7bfd8 !important;
        color: #31363a;
        border-bottom: 1px solid #dee2e6;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

.paid-invoice-container .invoice-items tr:not(:last-child) td {
    border-bottom: 1px solid #dee2e6;
}

/* Ensure table body text is black */
.paid-invoice-container .invoice-items tbody td {
    color: #000000;
}

.paid-invoice-container .payment-history-list {
    list-style: none;
    padding: 0;
    margin-top: 10px;
}

/* Ensure payment history list items and their strong tags are black */
.paid-invoice-container .payment-history-list li,
.paid-invoice-container .payment-history-list li strong {
    color: #000000 !important;
}

.paid-invoice-container .invoice-summary {
    text-align: right;
    border-top: 2px solid #343a40;
    padding-top: 20px;
}

.paid-invoice-container .invoice-summary h4 {
    font-weight: bold;
    color: #000000;
}

.paid-invoice-container .invoice-summary p {
    font-size: 1.1rem;
}

.paid-invoice-container .company-info-block {
    margin-top: 20px;
    color: #000000;
    display: flex;
    align-items: flex-end;
    gap: 20px;
}

.paid-invoice-container .company-info-block p {
    margin: 0;
    font-size: 0.9rem;
}

.paid-invoice-container .invoice-footer {
    margin-top: 40px;
    text-align: center;
    font-size: 0.9rem;
    color: #000000;
}

.paid-invoice-container .company-stamp {
    max-width: 200px;
    max-height: 150px;
    vertical-align: bottom;
}

.paid-invoice-container .stamp-container.stamp-position-right {
    order: 2;
}

.paid-invoice-container .stamp-container.stamp-position-left {
    order: -1;
}

.paid-invoice-container .contact-text {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* Print-specific styles for the invoice */
@media print {
    .paid-invoice-container {
        max-width: 100% !important;
        width: 100% !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .paid-invoice-container .invoice-header,
    .paid-invoice-container .invoice-summary {
        border-bottom: 2px solid #343a40 !important;
    }
    .paid-invoice-container .invoice-items th, .paid-invoice-container .invoice-items td {
        border: none !important;
    }
    .paid-invoice-container .invoice-items th {
        border-bottom: 1px solid #dee2e6 !important;
    }
    .paid-invoice-container .invoice-items tr:not(:last-child) td {
        border-bottom: 1px solid #dee2e6 !important;
    }
    .paid-invoice-container .no-print {
        display: none !important;
    }
    .paid-invoice-container .row > .col-6:nth-child(2) {
        float: right !important;
        text-align: right !important;
    }
}

/* ========================================================================= */
/* Balance Sheet / Reconciliation Page Styles                                */
/* ========================================================================= */

/* Tally Cards (Financial Summary Widgets) */
.tally-card {
    background-color: #2c3034;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 20px;
    height: 100%;
    display: flex; 
    flex-direction: column; 
    justify-content: space-between;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tally-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.tally-header { 
    font-size: 0.9rem; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    color: #aaa; 
    margin-bottom: 15px; 
    border-bottom: 1px solid #444; 
    padding-bottom: 8px;
}

.diff-row { 
    border-top: 1px dashed #555; 
    margin-top: 10px; 
    padding-top: 10px; 
}

/* Status Colors */
.diff-good { color: #28a745; }
.diff-warn { color: #ffc107; }
.diff-bad { color: #dc3545; }

/* Typography & Inputs */
.formula-hint { 
    font-size: 0.75rem; 
    color: #6c757d; 
    font-family: monospace; 
}

.section-title { 
    border-left: 4px solid #0d6efd; 
    padding-left: 10px; 
    margin: 30px 0 15px 0; 
    color: #fff; 
}

.note-input { 
    background: #222; 
    border: 1px solid #444; 
    color: #fff !important; 
    font-size: 0.8rem; 
}

.note-input:focus { 
    background: #2b2b2b; 
    color: #fff !important; 
    border-color: #666; 
    box-shadow: none; 
}

.note-label { 
    font-size: 0.7rem; 
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
}

/* Balance Sheet Table Styling */
.balance-table {
    font-size: 0.9rem;
}

.balance-table thead {
    background-color: #2c2c2e; /* Matches main app headers */
    color: #ffffff;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.balance-table th {
    font-weight: 600;
    vertical-align: middle;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.balance-table th:last-child {
    border-right: none;
}

/* ========================================================================= */
/* Custom Financial Chart Filters                                            */
/* ========================================================================= */

.financial-filter select {
    min-width: 100px;
    cursor: pointer;
    background-color: #2c2c2e; /* Match header background */
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    transition: all 0.3s ease;
}

.financial-filter select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(93, 93, 255, 0.25);
    outline: none;
}

.financial-filter select option {
    background-color: #343a40; /* Darker background for dropdown list items */
    color: #ffffff;
}

@media (max-width: 576px) {
    .financial-filter {
        width: 100%;
        justify-content: space-between;
    }
    
    .financial-filter select {
        flex: 1;
    }
}

/* Activity Log Custom Scrollbar */
.activity-scroll-container::-webkit-scrollbar {
    width: 6px;
}
.activity-scroll-container::-webkit-scrollbar-track {
    background: #2c2c2e;
}
.activity-scroll-container::-webkit-scrollbar-thumb {
    background-color: #555;
    border-radius: 10px;
}
.activity-scroll-container::-webkit-scrollbar-thumb:hover {
    background-color: #777;
}

/* ========================================================================= */
/* Dashboard Target Tracker Filters                                          */
/* ========================================================================= */

.target-filter-group {
    width: auto;
    max-width: 270px; /* Increased to comfortably fit year + month + button */
    flex-wrap: nowrap; /* Prevents inputs from stacking on very small screens */
}

#targetYearSelect {
    min-width: 119px; /* Guarantees enough space for '2026' + dropdown arrow */
}

#targetMonthSelect {
    min-width: 85px; /* Guarantees enough space for month text + dropdown arrow */
}

#targetYearToggle {
    min-width: 70px; /* Ensures the toggle button doesn't get squished */
}

/* ========================================================================= */
/* Dashboard Top Section Layout (75% / 25%)                                  */
/* ========================================================================= */
.top-dashboard-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 1.5rem; /* Restores the space below the entire block */
    align-items: stretch;
}

.top-dashboard-kpi {
    flex: 0 0 calc(75% - 10px);
    max-width: calc(75% - 10px);
}

.top-dashboard-search {
    flex: 0 0 calc(25% - 10px);
    max-width: calc(25% - 10px);
    background-color: var(--secondary-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--card-border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
    justify-content: center; /* Vertically centers the search elements */
}

/* Style the search bar to look a bit more prominent in its new dedicated space */
.top-dashboard-search h5 {
    color: #a0a0a0;
    margin-bottom: 15px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.top-dashboard-search .input-group-text, 
.top-dashboard-search .form-control {
    padding: 12px 15px;
    font-size: 1rem;
}

/* Responsive adjustment for tablets and smaller screens */
@media (max-width: 1200px) {
    .top-dashboard-kpi, .top-dashboard-search {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Specific adjustment for dashboard sidebar toggles */
.recent-activity-item .form-switch .form-check-input {
    background-color: #444;
    border-color: #666;
}

.recent-activity-item .form-switch .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Ensure the label under the toggle stays centered */
.recent-activity-item .form-check-label {
    text-align: center;
    width: 100%;
}

/* =========================================
   CUSTOM DATE PICKER (NATIVE OVERRIDE)
   ========================================= */
.date-input-wrapper { 
    position: relative; 
    width: 100%; 
    display: block; 
}

/* Visible Input: Shows d/m/Y */
.date-display-input { 
    cursor: pointer; 
    width: 100%; 
}

/* Hidden Input: Actual Date Picker (Y-m-d) */
.date-native-input { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    opacity: 0; 
    z-index: 10; 
    cursor: pointer; 
}

/* Expands the calendar trigger to fill the entire input */
.date-native-input::-webkit-calendar-picker-indicator { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    margin: 0; 
    padding: 0; 
    cursor: pointer; 
}

/* =========================================
   DOCUMENT TRACKER (STATUS DROPDOWNS & LINKS)
   ========================================= */
.status-dropdown {
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.75rem;
    cursor: pointer;
    padding-right: 2rem !important;
    border: none;
}

.status-not-paid { 
    background-color: #dc3545 !important; 
    color: white !important; 
}

.status-under-review { 
    background-color: #ffc107 !important; 
    color: black !important; 
}

.whatsapp-link { 
    color: #25D366; 
    text-decoration: none; 
    font-size: 0.8rem; 
}

.email-link { 
    color: #0dcaf0; 
    text-decoration: none; 
    font-size: 0.8rem; 
}

/* --- Document Status Badges --- */
.status-badge {
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    text-align: center;
    letter-spacing: 0.3px;
}

/* GREEN: Approved Quotations & Fully Paid Invoices */
.status-badge.status-approved,
.status-badge.status-invoice {
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.5);
    background-color: rgba(40, 167, 69, 0.1);
}

/* RED: Under Review, Not Accepted, or Rejected */
.status-badge.status-review,
.status-badge.status-rejected {
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.5);
    background-color: rgba(220, 53, 69, 0.1);
}

/* YELLOW: Partially Paid Invoices or Pending */
.status-badge.status-partial {
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.5);
    background-color: rgba(255, 193, 7, 0.1);
}

/* GRAY: Default / Other / Drafts */
.status-badge.status-default {
    color: #adb5bd;
    border: 1px solid rgba(173, 181, 189, 0.5);
    background-color: rgba(173, 181, 189, 0.1);
}

/* --- Category Report Styles --- */
.category-report-table {
    font-size: 0.85rem;
}
.category-report-table th, 
.category-report-table td {
    border-color: #333 !important;
    padding: 12px 16px;
}
.text-income {
    color: #28a745 !important; /* Green */
}
.text-expense {
    color: #ffc107 !important; /* Yellow */
}
.text-net-negative {
    color: #ffc107 !important; /* Yellow */
}
.text-net-positive {
    color: #28a745 !important; /* Green */
}

/* --- Client Contact Icons --- */
.contact-icon {
    width: 16px;
    text-align: center;
    display: inline-block;
}

/* Ensure the select dropdown looks clean */
.table td form select.form-select {
    min-width: 120px;
    width: auto;
    display: inline-block;
    cursor: pointer;
}

/* Fix for inline forms inside tables */
.table td form {
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

/* Force hidden inputs to stay hidden */
.table td form input[type="hidden"] {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    visibility: hidden !important;
}

/* Dropdown alignment */
.table td form select.form-select {
    min-width: 130px;
    width: auto;
    display: inline-block;
    cursor: pointer;
}

/* Custom Table Border Colors (Uniform Horizontal & Vertical) */
.table-custom-borders thead tr,
.table-custom-borders tbody tr {
    border-bottom: 1px solid #444c54 !important;
}

.table-custom-borders thead th {
    border-right: 1px solid #444c54 !important;
    border-bottom: none !important; /* Prevent double bottom borders */
}

/* Remove the vertical line from the very last column */
.table-custom-borders thead th:last-child {
    border-right: none !important;
}

/* --- Custom Table Border & Header Styling --- */

/* 1. Distinct Background Color for the Header */
.table-custom-borders thead {
    background-color: #23272b !important; /* A distinct, solid dark shade */
}

/* 2. Unique Horizontal Line under the Header (Accent Color) */
.table-custom-borders thead tr {
    border-bottom: 2px solid #17469e !important; /* Theme purple accent line */
}

/* 3. Standard Horizontal Lines for the Body Rows */
.table-custom-borders tbody tr {
    border-bottom: 1px solid #444c54 !important;
}

/* 4. Vertical Separator Lines inside the Header */
.table-custom-borders thead th {
    border-right: 1px solid #444c54 !important;
    border-bottom: none !important; 
}

/* 5. Remove the vertical line from the very last column */
.table-custom-borders thead th:last-child {
    border-right: none !important;
}

/* Automatically apply the Bills.php subtle row divider to the data table component */
.table-dark tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

/* Remove the border from the very last row so it fits flush with the card bottom */
.table-dark tbody tr:last-child {
    border-bottom: none !important;
}

/* Document Status Badges */
.status-badge {
    padding: 0.5em 0.8em;
    border-radius: 4px;
    font-weight: 600;
    display: inline-block;
    min-width: 90px;
    text-align: center;
}

/* Green: Accepted Quotations & Paid Invoices */
.status-bg-green {
    background-color: #198754 !important;
    color: #ffffff !important;
}

/* Yellow: Under Review Quotations & Waiting/Partial Invoices */
.status-bg-yellow {
    background-color: #ffc107 !important;
    color: #000000 !important;
}

/* Red: Rejected or Not Accepted */
.status-bg-red {
    background-color: #dc3545 !important;
    color: #ffffff !important;
}

/* Default/Other */
.status-bg-default {
    background-color: #6c757d !important;
    color: #ffffff !important;
}

/* ========================================================================= */
/* DataTables Dark Theme Overrides (For Tracker page & Components)                */
/* ========================================================================= */
.dataTables_wrapper .dataTables_length select { background-color: #212529; color: #fff; border-color: #495057; }
.dataTables_wrapper .dataTables_info { color: #adb5bd !important; font-size: 0.85rem; padding-top: 15px; }
.dataTables_wrapper .dataTables_length { color: #adb5bd !important; font-size: 0.85rem; padding-bottom: 10px;}
.dataTables_wrapper .dataTables_paginate { padding-top: 10px; }
.dataTables_wrapper .dataTables_paginate .page-link { background-color: #212529; color: #fff; border-color: #495057; }
.dataTables_wrapper .dataTables_paginate .page-item.disabled .page-link { background-color: #1c1c1c; color: #6c757d; border-color: #333; }
.dataTables_wrapper .dataTables_paginate .page-item.active .page-link { background-color: #7b61ff; border-color: #7b61ff; color: #fff; }
table.dataTable thead th { border-bottom: none !important; }

/* Mobile full-width login container */
@media (max-width: 768px) {
    .login-body {
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .login-container {
        width: 80% !important;
        max-width: 80% !important;
        min-height: 80vh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        display: flex;
        flex-direction: column;
        justify-content: center;
        box-sizing: border-box;
    }
}

/* ========================================================================= */
/* MVC Document Generator Layout                                             */
/* ========================================================================= */
.doc-gen-wrapper {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 24px;
    backdrop-filter: blur(10px);
}

.doc-gen-card-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.doc-gen-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #8a8a8a;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

/* Custom Table for Generator */
.table-gen {
    border-collapse: separate;
    border-spacing: 0 8px;
}

.table-gen thead th {
    background: transparent;
    border: none;
    color: #adb5bd;
    font-size: 0.8rem;
    padding: 10px;
}

.table-gen tbody tr {
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.3s ease;
}

.table-gen tbody td {
    border: none;
    padding: 12px 10px;
}

.table-gen tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Ensure the new header strip looks like the old one */
    .main-header {
        background-color: #1a1d20 !important; /* Adjust to match your preferred dark gray/black */
        border-bottom: 1px solid #333;
    }

    /* Sidebar Collapse Logic - Hides text labels */
    .sidebar-collapse .sidebar-container {
        width: 70px; /* Slim width when collapsed */
    }
    
    .sidebar-collapse .sidebar-container p,
    .sidebar-collapse .sidebar-container .brand-text {
        display: none !important;
    }

    .sidebar-collapse .main-content {
        margin-left: 70px; /* Adjust main content to match slim sidebar */
    }

    /* Clean UI: Remove scrollbars from the sidebar */
    .sidebar-container::-webkit-scrollbar {
        display: none;
    }
    .sidebar-container {
        -ms-overflow-style: none;  /* IE and Edge */
        scrollbar-width: none;  /* Firefox */
    }