@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&family=Tajawal:wght@300;400;500;700;800;900&family=Amiri:ital,wght@0,400;0,700;1,400;1,700&display=swap');

:root {
    --primary: #0f766e; /* Deep Teal */
    --primary-hover: #0d9488;
    --primary-gradient: linear-gradient(135deg, #0d9488, #0f766e);
    --secondary-gradient: linear-gradient(135deg, #6366f1, #4f46e5);
    --danger-gradient: linear-gradient(135deg, #f43f5e, #be123c);
    --success-gradient: linear-gradient(135deg, #10b981, #047857);
    --info-gradient: linear-gradient(135deg, #06b6d4, #0891b2);
    --warning-gradient: linear-gradient(135deg, #f59e0b, #b45309);
    
    --bg-light: #f8fafc;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --border-radius: 14px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
    height: 100vh;
    overflow: hidden;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

body.font-cairo {
    font-family: 'Cairo', sans-serif;
}
body.font-tajawal {
    font-family: 'Tajawal', sans-serif;
}
body.font-arial {
    font-family: Arial, Helvetica, sans-serif;
}
body.font-amiri {
    font-family: 'Amiri', serif;
}

/* Navbar */
.navbar {
    position: relative;
    z-index: 1030 !important;
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 0.8rem 0;
}

.navbar-brand {
    font-weight: 800;
    color: #fff !important;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-brand i {
    color: #0d9488;
    filter: drop-shadow(0 0 6px rgba(13, 148, 136, 0.6));
}

.nav-link {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.75) !important;
    margin: 0 3px;
    border-radius: 8px;
    padding: 8px 14px !important;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.nav-link:hover {
    color: #fff !important;
    background-color: rgba(255, 255, 255, 0.08);
}

.nav-link.active {
    color: #fff !important;
    background: rgba(13, 148, 136, 0.2) !important;
    border-bottom: 2px solid #0d9488;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* Dropdown Menu */
.dropdown-menu {
    border: none;
    box-shadow: 0 15px 30px rgba(0,0,0,0.12);
    border-radius: 12px;
    padding: 8px;
    margin-top: 10px;
    background: #fff;
    z-index: 1050 !important;
}

.dropdown-item {
    border-radius: 8px;
    padding: 8px 16px;
    transition: var(--transition);
    text-align: right;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.dropdown-item:hover {
    background-color: #f1f5f9;
    color: var(--primary);
}

.dropdown-divider {
    border-color: #e2e8f0;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    overflow: hidden;
    background: #fff;
}

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

/* Stats Cards */
.stat-card {
    position: relative;
    color: #fff;
    z-index: 1;
    border: none;
}

.stat-card.sales {
    background: var(--primary-gradient);
}

.stat-card.products {
    background: var(--secondary-gradient);
}

.stat-card.debts {
    background: var(--danger-gradient);
}

.stat-card.expenses {
    background: var(--warning-gradient);
}

.stat-card.profit {
    background: var(--success-gradient);
}

.stat-card.info {
    background: var(--info-gradient);
}

.stat-card .card-title {
    opacity: 0.9;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.stat-card .display-6 {
    font-weight: 800;
    font-size: 1.8rem;
    margin: 0;
}

.stat-card .card-icon {
    position: absolute;
    left: 20px;
    bottom: 15px;
    font-size: 3.5rem;
    opacity: 0.15;
    transition: var(--transition);
}

.stat-card:hover .card-icon {
    transform: scale(1.1) rotate(-5deg);
    opacity: 0.25;
}

/* Tables */
.table-container {
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 1.25rem;
    margin-bottom: 2rem;
    border: 1px solid #f1f5f9;
}

.table {
    margin: 0;
    vertical-align: middle;
}

.table th {
    background-color: #f8fafc !important;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0;
    padding: 14px 16px;
    font-size: 0.9rem;
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.95rem;
    color: #334155;
}

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

.table-hover tbody tr:hover {
    background-color: rgba(15, 118, 110, 0.02) !important;
}

/* Badges */
.badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.badge.bg-primary {
    background-color: rgba(13, 148, 136, 0.1) !important;
    color: #0f766e !important;
}

.badge.bg-success {
    background-color: rgba(16, 185, 129, 0.1) !important;
    color: #047857 !important;
}

.badge.bg-danger {
    background-color: rgba(239, 68, 68, 0.1) !important;
    color: #b91c1c !important;
}

/* Buttons */
.btn {
    border-radius: 10px;
    padding: 8px 18px;
    font-weight: 600;
    transition: var(--transition);
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.2);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-gradient);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(13, 148, 136, 0.3);
    color: #fff;
}

.btn-outline-primary {
    color: var(--primary);
    border: 1.5px solid var(--primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-gradient);
    border-color: transparent;
    color: #fff;
}

/* Inputs & Form Elements */
.form-control, .form-select {
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    padding: 10px 14px;
    transition: var(--transition);
    font-size: 0.95rem;
}

.form-select {
    background-position: left 1rem center;
    padding-left: 2.5rem;
    padding-right: 14px;
}

.form-control:focus, .form-select:focus {
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
    outline: none;
}

/* Modals */
.modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
    padding: 1.25rem 1.5rem;
}

.modal-title {
    font-weight: 700;
    color: var(--text-dark);
}

.modal-body {
    padding: 1.5rem;
}

/* Heading Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--text-dark);
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

body.dark-mode ::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background: #334155;
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Modern scrollbar for the main content (on the left side) */
.main-content > .container-fluid::-webkit-scrollbar {
    width: 8px;
}

.main-content > .container-fluid::-webkit-scrollbar-track {
    background: transparent;
}

.main-content > .container-fluid::-webkit-scrollbar-thumb {
    background: rgba(15, 118, 110, 0.2); /* Semi-transparent primary teal */
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
    transition: all 0.3s;
}

.main-content > .container-fluid::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 118, 110, 0.5);
    border: 2px solid transparent;
    background-clip: padding-box;
}

body.dark-mode .main-content > .container-fluid::-webkit-scrollbar-thumb {
    background: rgba(13, 148, 136, 0.2); /* Teal accent in dark mode */
    border: 2px solid transparent;
    background-clip: padding-box;
}

body.dark-mode .main-content > .container-fluid::-webkit-scrollbar-thumb:hover {
    background: rgba(13, 148, 136, 0.5);
    border: 2px solid transparent;
    background-clip: padding-box;
}

/* Modern thin scrollbar for sidebar menu */
.sidebar-menu::-webkit-scrollbar {
    width: 4px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Login Page Custom styles */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.login-card {
    border: none;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
    border-radius: 16px;
}

/* Sidebar Layout */
.wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
}

.sidebar {
    width: 260px;
    height: 100vh;
    position: fixed;
    top: 0;
    right: 0;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: rgba(255, 255, 255, 0.85);
    z-index: 1040;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: width, transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand-icon {
    font-size: 1.6rem;
    color: #0d9488;
    filter: drop-shadow(0 0 6px rgba(13, 148, 136, 0.6));
}

.sidebar-brand-name {
    font-weight: 800;
    font-size: 1.1rem;
    color: #fff;
    margin: 0;
    line-height: 1.2;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.2s;
    opacity: 1;
    visibility: visible;
    max-width: 180px;
    overflow: hidden;
    display: block;
}

.sidebar-menu {
    padding: 20px 10px;
    flex-grow: 1;
    list-style: none;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}

.sidebar-menu-item {
    margin: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.7) !important;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-link span {
    display: inline-block;
    vertical-align: middle;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.2s;
    opacity: 1;
    visibility: visible;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff !important;
}

.sidebar-link.active {
    background: var(--primary-gradient);
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
    font-weight: 600;
}

.sidebar-link i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    transition: transform 0.2s ease;
}

.sidebar-link.active i {
    transform: scale(1.15);
}

.main-content {
    margin-right: 260px;
    width: calc(100% - 260px);
    height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-right 0.25s cubic-bezier(0.4, 0, 0.2, 1), width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: margin-right, width;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow: hidden;
}

.main-content > .container-fluid {
    flex: 1 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(15, 118, 110, 0.2) transparent;
}

body.dark-mode .main-content > .container-fluid {
    scrollbar-color: rgba(13, 148, 136, 0.2) transparent;
}

.main-header {
    background: linear-gradient(90deg, #334155 0%, #1e293b 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 12px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.main-header .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

.toggle-sidebar-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    transition: var(--transition);
}

.toggle-sidebar-btn:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

/* User Profile Nav dropdown overrides inside main-header */
.main-header .dropdown-menu {
    margin-top: 5px;
}

.main-header .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 600;
}

.main-header .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

@media (max-width: 991.98px) {
    .sidebar {
        right: 0 !important;
        transform: translateX(100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-right: 0;
        width: 100%;
    }
    .toggle-sidebar-btn {
        display: flex;
    }
    
    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.4);
        backdrop-filter: blur(4px);
        z-index: 1030;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s ease, visibility 0.25s ease;
    }
    .sidebar-backdrop.show {
        opacity: 1;
        visibility: visible;
    }
}

/* Tablets (portrait) and mobile responsive styling overrides */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    .card-body {
        padding: 1.25rem !important;
    }
    .stat-card .display-6 {
        font-size: 1.6rem !important;
    }
    .main-header {
        padding: 10px 15px !important;
    }
}

/* Small mobile devices */
@media (max-width: 575.98px) {
    .stat-card .display-6 {
        font-size: 1.4rem !important;
    }
    .card-title {
        font-size: 0.85rem !important;
    }
    h2 {
        font-size: 1.4rem !important;
    }
}

/* User Dropdown Position Helper */
.user-dropdown-container {
    margin-right: auto !important;
}

/* Dark Mode Styles */
body.dark-mode {
    --bg-light: #0f172a; /* Slate 900 */
    --text-dark: #f8fafc; /* Slate 50 */
    --text-muted: #94a3b8; /* Slate 400 */
    --bs-border-color: rgba(255, 255, 255, 0.05);
    background-color: var(--bg-light) !important;
    color: var(--text-dark) !important;
}

body.dark-mode.login-body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
}

body.dark-mode input:-webkit-autofill,
body.dark-mode input:-webkit-autofill:hover, 
body.dark-mode input:-webkit-autofill:focus, 
body.dark-mode input:-webkit-autofill:active{
    -webkit-box-shadow: 0 0 0 30px #0f172a inset !important;
    -webkit-text-fill-color: #f8fafc !important;
    transition: background-color 5000s ease-in-out 0s;
}

body.dark-mode .card {
    background-color: #1e293b !important; /* Slate 800 */
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    color: #f8fafc !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3) !important;
}

body.dark-mode .card-header {
    background-color: #1e293b !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

body.dark-mode .nav-pills .nav-link {
    color: var(--text-muted) !important;
}
body.dark-mode .nav-pills .nav-link.active {
    background-color: #3b82f6 !important;
    color: #fff !important;
}
body.dark-mode .nav-pills .nav-link:not(.active):hover {
    background-color: rgba(255,255,255,0.05) !important;
    color: var(--text-dark) !important;
}

body.dark-mode .text-muted {
    color: var(--text-muted) !important;
}

body.dark-mode .text-dark {
    color: var(--text-dark) !important;
}

body.dark-mode .table-container {
    background-color: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3) !important;
}

body.dark-mode .table th {
    background-color: #0f172a !important;
    color: #94a3b8 !important;
    border-bottom-color: #334155 !important;
}

body.dark-mode .table td {
    border-bottom-color: #334155 !important;
    color: #cbd5e1 !important;
    background-color: transparent !important;
}

body.dark-mode .table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

body.dark-mode .main-header {
    background-color: #1e293b !important;
    border-bottom-color: #334155 !important;
    box-shadow: 0 1px 3px 0 rgba(0,0,0,0.3) !important;
}

body.dark-mode .main-header .nav-link {
    color: #f8fafc !important;
}

body.dark-mode .main-header .nav-link:hover {
    background-color: #334155 !important;
}

body.dark-mode .dropdown-menu {
    background-color: #1e293b !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
}

body.dark-mode .dropdown-item {
    color: #cbd5e1 !important;
}

body.dark-mode .dropdown-item:hover {
    background-color: #334155 !important;
    color: #fff !important;
}

body.dark-mode .list-group-item {
    background-color: transparent !important;
    border-bottom-color: #334155 !important;
    color: #f8fafc !important;
}

body.dark-mode .form-control, body.dark-mode .form-select {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

body.dark-mode .form-control:focus, body.dark-mode .form-select:focus {
    border-color: #0d9488 !important;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.25) !important;
}

body.dark-mode .form-control::placeholder {
    color: #475569 !important;
}

body.dark-mode .modal-content {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

body.dark-mode .modal-header, body.dark-mode .modal-footer {
    background-color: #0f172a !important;
    border-color: #334155 !important;
}

body.dark-mode .btn-close {
    filter: invert(1) grayscale(1) brightness(2);
}

body.dark-mode .badge.bg-light {
    background-color: #334155 !important;
    color: #cbd5e1 !important;
    border-color: #475569 !important;
}

body.dark-mode .bg-light {
    background-color: #0f172a !important; /* Slate 900 */
}

body.dark-mode .bg-white {
    background-color: #1e293b !important; /* Slate 800 */
}

body.dark-mode .input-group-text {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #94a3b8 !important;
}

body.dark-mode .sidebar {
    border-left: 1px solid rgba(0, 0, 0, 0.4) !important;
}
/* Sidebar Collapse on Desktop */
.toggle-collapse-btn {
    position: absolute;
    top: 24px;
    left: -18px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: #fff;
    border: 3px solid var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    z-index: 1050;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.toggle-collapse-btn:hover {
    transform: scale(1.1);
    color: #fff;
}

.toggle-collapse-btn i {
    transition: transform 0.25s ease;
}

body.dark-mode .toggle-collapse-btn {
    border-color: #0f172a;
}

/* When sidebar is collapsed */
@media (min-width: 992px) {
    .wrapper.sidebar-collapsed .sidebar {
        width: 70px !important;
        right: 0 !important;
    }

    .wrapper.sidebar-collapsed .main-content {
        margin-right: 70px !important;
        width: calc(100% - 70px) !important;
    }

    .wrapper.sidebar-collapsed .sidebar .sidebar-brand-name,
    .wrapper.sidebar-collapsed .sidebar .sidebar-link span {
        opacity: 0;
        visibility: hidden;
        max-width: 0;
        padding: 0;
        margin: 0;
        white-space: nowrap; /* Prevent vertical wrapping during transition */
    }

    .wrapper.sidebar-collapsed .sidebar .sidebar-header {
        padding: 24px 0;
        justify-content: center;
        gap: 0;
    }

    .wrapper.sidebar-collapsed .sidebar .sidebar-link {
        justify-content: center;
        padding: 12px 0;
        gap: 0 !important; /* Remove gap to perfectly center the icon when collapsed */
    }

    .wrapper.sidebar-collapsed .sidebar .sidebar-menu {
        padding: 20px 5px;
    }

    .wrapper.sidebar-collapsed .sidebar .mt-auto {
        padding: 10px 5px !important;
    }
}

.wrapper.sidebar-collapsed .toggle-collapse-btn i {
    transform: rotate(180deg);
}

@media (max-width: 991.98px) {
    .toggle-collapse-btn {
        display: none !important;
    }
}

/* Red color override for logout links */
.sidebar-link.text-danger {
    color: #f43f5e !important; /* Premium Rose Red */
}
.sidebar-link.text-danger:hover {
    background: rgba(244, 63, 94, 0.1) !important;
    color: #fda4af !important;
}
.dropdown-item.text-danger {
    color: #f43f5e !important;
}
.dropdown-item.text-danger:hover {
    background-color: rgba(244, 63, 94, 0.1) !important;
    color: #fff !important;
}

/* Printing styling & Report layout styles */
@media print {
    html, body {
        height: auto !important;
        overflow: visible !important;
    }
    .no-print { display: none !important; }
    .card { border: none !important; box-shadow: none !important; }
    .container-fluid { width: 100% !important; max-width: none !important; }
    .main-content {
        margin-right: 0 !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
    }
    .main-content > .container-fluid {
        height: auto !important;
        overflow: visible !important;
        min-height: auto !important;
    }
    body { background-color: #fff !important; }
}
.report-header { text-align: center; margin-bottom: 30px; }
.report-header h1 { font-size: 26px; font-weight: 800; margin-bottom: 10px; color: var(--primary); }
.report-period { font-size: 16px; color: #64748b; margin-bottom: 20px; }

/* Responsive Data Table as Cards */
@media (max-width: 767.98px) {
    .table-mobile-cards thead {
        display: none;
    }
    .table-mobile-cards tbody, .table-mobile-cards tr, .table-mobile-cards td {
        display: block;
        width: 100%;
    }
    .table-mobile-cards tr {
        margin-bottom: 1.25rem;
        background-color: #fff;
        border: 1px solid #e2e8f0;
        border-radius: var(--border-radius);
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
        overflow: hidden;
    }
    body.dark-mode .table-mobile-cards tr {
        background-color: #1e293b;
        border-color: #334155;
    }
    .table-mobile-cards td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 1.25rem !important;
        border-bottom: 1px solid #f1f5f9;
        text-align: left;
    }
    body.dark-mode .table-mobile-cards td {
        border-bottom-color: rgba(255, 255, 255, 0.05);
        background-color: transparent !important;
    }
    .table-mobile-cards td:last-child {
        border-bottom: 0;
        background-color: rgba(15, 118, 110, 0.03);
        justify-content: center;
        padding: 1rem !important;
    }
    body.dark-mode .table-mobile-cards td:last-child {
        background-color: rgba(0, 0, 0, 0.15);
    }
    .table-mobile-cards td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-muted);
        margin-left: 1rem;
        text-align: right;
    }
    .table-mobile-cards td:last-child::before {
        display: none;
    }
}

/* Time Filter Button Group */
.time-filter-group {
    display: flex;
    align-items: center;
    gap: 0;
    background: #fff;
    border-radius: 12px;
    padding: 4px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

.time-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
}

.time-filter-btn:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.time-filter-btn.active {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 3px 10px rgba(13, 148, 136, 0.25);
}

.time-filter-btn.active i {
    animation: filterPulse 0.3s ease;
}

@keyframes filterPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.25); }
    100% { transform: scale(1); }
}

.time-filter-btn i {
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

/* Dark mode */
body.dark-mode .time-filter-group {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

body.dark-mode .time-filter-btn {
    color: #94a3b8;
}

body.dark-mode .time-filter-btn:hover {
    background: #334155;
    color: #e2e8f0;
}

body.dark-mode .time-filter-btn.active {
    background: var(--primary-gradient);
    color: #fff;
}

/* Responsive */
@media (max-width: 575.98px) {
    .time-filter-group {
        border-radius: 10px;
        padding: 3px;
    }
    .time-filter-btn {
        padding: 6px 10px;
        font-size: 0.78rem;
        gap: 4px;
    }
    .time-filter-btn i {
        font-size: 0.7rem;
    }
}

/* Settings & Profile Navigation (SPA Friendly) */
.settings-nav .nav-link, .profile-nav .nav-link {
    color: #475569 !important;
    font-weight: 600;
    padding: 14px 16px;
    border: 1px solid transparent;
    background-color: transparent !important;
    box-shadow: none !important;
}
.settings-nav .nav-link:hover, .profile-nav .nav-link:hover {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}
.settings-nav .nav-link.active, .profile-nav .nav-link.active {
    background-color: #10b981 !important;
    color: #fff !important;
    border-color: #10b981 !important;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3) !important;
}

body.dark-mode .settings-nav .nav-link, body.dark-mode .profile-nav .nav-link {
    color: #94a3b8 !important;
}
body.dark-mode .settings-nav .nav-link:hover, body.dark-mode .profile-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #f8fafc !important;
}

/* Hide sync indicator on phones and tablets */
@media (max-width: 991.98px) {
    #sync-indicator {
        display: none !important;
    }
}

/* Stat card help icon */
.stat-help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 0.8rem;
    color: rgba(0,0,0,.3);
    cursor: pointer;
    transition: color .2s ease;
    flex-shrink: 0;
}
.stat-help-icon:hover,
.stat-help-icon:focus {
    color: var(--primary, #0f766e);
}
.dark-mode .stat-help-icon {
    color: rgba(255,255,255,.35);
}
.dark-mode .stat-help-icon:hover,
.dark-mode .stat-help-icon:focus {
    color: #5eead4;
}
