:root {
    /* Primary Colors - Refined Indigo & Violet */
    --primary: #6467f2;
    --primary-dark: #4F46E5;
    --secondary: #A855F7;

    /* Status Colors - Vibrant for Dark Theme */
    --success: #22C55E;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;

    /* Backgrounds & Text - Deep Midnight Palette */
    --bg-dark: #0B0F1A;
    --bg-card: #161B2D;
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --border-color: #2D3748;

    /* Glassmorphism - Refined Translucency */
    --glass-bg: rgba(22, 27, 45, 0.8);
    --glass-border: rgba(255, 255, 255, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    --overlay-bg: radial-gradient(circle at center, rgba(11, 15, 26, 0.98), #0B0F1A);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Cairo', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
}

/* Utility */
.hidden {
    display: none !important;
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
}

/* Login Screen - Modern Split Card Design */
.login-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #1A1F35 0%, #0B0F1A 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 2rem;
}

.login-split-card {
    display: flex;
    background: var(--bg-card);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    width: 100%;
    max-width: 900px;
    min-height: 500px;
    position: relative;
    border: 1px solid var(--border-color);
}

/* Welcome Section (Indigo/Violet) */
.login-welcome-section {
    flex: 1;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-welcome-section::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    top: -100px;
    left: -100px;
}

.login-welcome-section::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
    bottom: -80px;
    right: -80px;
}

.welcome-content {
    position: relative;
    z-index: 2;
    color: white;
    text-align: right;
}

.welcome-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    color: white !important;
    opacity: 1;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.3));
}

.welcome-icon i {
    color: white !important;
}

.welcome-logo-img {
    max-width: 90px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
}

.welcome-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    line-height: 1.3;
}

.welcome-description {
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    opacity: 0.92;
    max-width: 450px;
}

.welcome-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    opacity: 0.9;
}

.feature-item i {
    font-size: 1.1rem;
    opacity: 0.95;
}

/* Signin Section (Dark Card) */
.login-signin-section {
    flex: 0 0 400px;
    background: var(--bg-card);
    padding: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--border-color);
}

.signin-content {
    width: 100%;
    max-width: 340px;
}

.signin-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
}

.signin-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 2px;
    box-shadow: 0 0 10px var(--primary);
}

.signin-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.signin-form .form-group {
    margin: 0;
}

.signin-form input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    color: var(--text-main);
    background: rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
}

.signin-form input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.signin-form input::placeholder {
    color: var(--text-muted);
}

.signin-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    padding: 1rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    width: 100%;
    margin-top: 0.5rem;
}

.signin-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary) 100%);
    transform: translateY(-1px);
}

.signin-btn:active {
    transform: scale(0.98);
}

.login-error {
    color: var(--danger);
    font-size: 0.9rem;
    text-align: center;
    display: none;
    margin: -0.5rem 0 0 0;
}

/* Login Footer */
.login-footer {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    opacity: 0.7;
    width: 100%;
    padding: 0 1rem;
}

.login-footer strong {
    color: var(--primary);
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-container {
        padding: 1rem;
        display: block;
        /* Use block for natural scrolling on small devices */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background: var(--bg-dark);
        /* Solid background for mobile to save energy/improve perf */
    }

    .login-split-card {
        flex-direction: column;
        max-width: 480px;
        /* Limit width on tablets */
        margin: 2rem auto 5rem;
        min-height: auto;
        border-radius: 20px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
        animation: cardAppearMobile 0.6s cubic-bezier(0.22, 1, 0.36, 1);
        border: 1px solid rgba(255, 255, 255, 0.05);
    }

    @keyframes cardAppearMobile {
        from {
            opacity: 0;
            transform: translateY(20px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .login-welcome-section {
        padding: 2.5rem 1.5rem;
        min-height: auto;
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    }

    .welcome-content {
        text-align: center;
        width: 100%;
    }

    .login-welcome-section::before,
    .login-welcome-section::after {
        opacity: 0.1;
        /* Subtler patterns on mobile */
    }

    .welcome-icon {
        font-size: 2.5rem;
        margin-bottom: 0.75rem;
        background: rgba(255, 255, 255, 0.1);
        width: 70px;
        height: 70px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 18px;
        margin: 0 auto 1rem;
        backdrop-filter: blur(5px);
    }



    .welcome-logo-img {
        width: 45px;
        height: 45px;
        object-fit: contain;
    }

    .welcome-title {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
        letter-spacing: -0.5px;
    }

    .welcome-description,
    .welcome-features {
        display: none;
        /* Keep hidden to save space */
    }

    .login-signin-section {
        flex: 1;
        padding: 2.5rem 1.5rem;
        border-right: none;
        background: var(--bg-card);
    }

    .signin-content {
        max-width: 100%;
    }

    .signin-title {
        font-size: 1.4rem;
        margin-bottom: 2rem;
    }

    .signin-form {
        gap: 1.25rem;
    }

    .signin-form input {
        padding: 1.1rem 1.25rem;
        /* Larger touch target */
        font-size: 1rem;
        background: rgba(0, 0, 0, 0.3);
    }

    .signin-btn {
        padding: 1.1rem;
        font-size: 1.1rem;
        box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    }

    .login-footer {
        position: relative;
        bottom: 0;
        left: 0;
        transform: none;
        margin: 1rem 0 3rem;
        padding: 1rem;
        opacity: 0.6;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 0.75rem;
    }

    .login-split-card {
        border-radius: 20px;
        margin-top: 1rem;
    }

    .login-welcome-section {
        padding: 2rem 1rem;
    }

    .welcome-title {
        font-size: 1.25rem;
    }

    .login-signin-section {
        padding: 2rem 1.25rem;
    }

    .signin-title {
        font-size: 1.25rem;
    }

    .signin-form input {
        padding: 1rem;
    }
}

/* Sidebar */
/* Sidebar */
/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-card);
    border-left: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 100;
}

.sidebar.collapsed {
    width: 80px;
    padding: 1.5rem 0.5rem;
}

.sidebar.collapsed .logo-container h1,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .user-info,
.sidebar.collapsed .logout-btn {
    display: none;
}

.sidebar.collapsed .logo-container {
    justify-content: center;
    margin-bottom: 2.5rem;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 0.8rem 0;
}

.sidebar.collapsed .nav-item i {
    font-size: 1.3rem;
    margin: 0;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
    padding: 0 1rem;
    color: var(--text-main);
}

.logo-icon {
    font-size: 1.8rem;
    color: var(--primary);
    filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.3));
}

.logo-container h1 {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* Nav Menu */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    /* Unified spacing */
    flex: 1;
    overflow-y: auto;
    padding-left: 0.5rem;
}

.nav-menu::-webkit-scrollbar {
    width: 3px;
}

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

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}


.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.65rem 1.2rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    text-align: right;
}

.nav-item i {
    width: 24px;
    font-size: 1.1rem;
    opacity: 0.7;
    color: inherit;
    transition: all 0.3s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    padding-right: 1.5rem;
}

.nav-item:hover i {
    opacity: 1;
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.15) 0%, transparent 100%);
    color: var(--primary);
    font-weight: 600;
}

.nav-item.active i {
    opacity: 1;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 20%;
    height: 60%;
    width: 4px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 12px var(--primary);
}

/* User Profile & Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--glass-border);
}

.user-profile {
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.user-profile:hover {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-actions {
    display: flex;
    gap: 0.5rem;
}

.sidebar-action-btn {
    flex: 1;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
}

.sidebar-action-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.sidebar-action-btn.logout-btn:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.sidebar.collapsed .sidebar-actions {
    flex-direction: column;
}

.sidebar.collapsed .sidebar-footer {
    padding: 1rem 0;
}

.avatar {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    color: white;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-info .name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-info .role {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: block;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at top right, #161B2D 0%, #0B0F1A 100%);
    overflow: hidden;
    position: relative;
}

/* Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 10;
}

.top-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

/* Control Bar & Filtering */
.control-bar {
    display: flex;
    gap: 1rem;
    align-items: center;
}

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

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.icon-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

.icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

/* Global Semantic Icon Colors */
.icon-btn[title="تعديل"] {
    color: #60A5FA !important;
    /* Blue */
    border-color: rgba(96, 165, 250, 0.2);
}

.icon-btn[title="حذف"],
.delete-btn {
    color: #EF4444 !important;
    /* Red */
    border-color: rgba(239, 68, 68, 0.2);
}

.icon-btn[title="تعديل"]:hover {
    background: rgba(96, 165, 250, 0.1);
}

.icon-btn[title="حذف"]:hover,
.delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Views */
.view-container {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.icon-box {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
}

.icon-box.blue {
    background: rgba(59, 130, 246, 0.2);
    color: #60A5FA;
}

.icon-box.green {
    background: rgba(16, 185, 129, 0.2);
    color: #34D399;
}

.icon-box.orange {
    background: rgba(245, 158, 11, 0.2);
    color: #FBBF24;
}

.icon-box.purple {
    background: rgba(139, 92, 246, 0.2);
    color: #A78BFA;
}

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.stat-info .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Recent Activity */
.recent-activity-section h3 {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table-container {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 1rem 1.5rem;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background-color: rgba(0, 0, 0, 0.2);
    font-weight: 600;
    color: var(--text-muted);
}

.data-table tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

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

/* Employee Grid */
.grid-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.employee-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.employee-info h4 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.employee-info span {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.avatar-small {
    width: 40px;
    height: 40px;
    background: var(--glass-border);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
}

.card-stats {
    display: flex;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.c-stat h5 {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

.c-stat p {
    font-weight: 600;
}

.balance-positive {
    color: var(--success);
}

.balance-negative {
    color: var(--danger);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--bg-card);
    width: 100%;
    max-width: 500px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-header h3 {
    font-size: 1.25rem;
}

form {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    /* Allow flex growth if parent is flex */
    min-width: 0;
    /* Allow shrinking below content size */
}

.form-row {
    display: flex;
    gap: 1rem;
    width: 100%;
}

.form-group label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    color: var(--text-main);
    font-size: 1rem;
    width: 100%;
    /* Fix overflow */
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
}

/* Radio Cards */
.radio-group {
    display: flex;
    gap: 1.25rem;
    margin-top: 0.5rem;
}

.radio-card {
    flex: 1;
    position: relative;
    cursor: pointer;
}

.radio-card input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.25rem;
    border: 1.5px solid var(--border-color);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100px;
    text-align: center;
}

.card-content i {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.radio-card:hover .card-content {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-muted);
}

.radio-card input:checked+.card-content {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
    color: var(--text-main);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
}

.radio-card input:checked+.card-content i {
    transform: scale(1.2);
}

/* View Header */
/* View Header */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.control-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: transparent;
    /* Removed solid background */
    padding: 0;
    border: none;
    flex: 1;
    flex-wrap: wrap;
}

.glass-select {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 0.75rem 2rem 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.95rem;
    cursor: pointer;
    min-width: 180px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 1rem center;
    background-size: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.glass-select:hover {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.glass-select:focus {
    outline: none;
    border-color: var(--primary);
    background-color: rgba(30, 41, 59, 0.8);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3);
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-box i {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-main);
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.search-box input:hover {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.2);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    background-color: rgba(30, 41, 59, 0.8);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-start;
}

/* Badges */
.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge.salary {
    background-color: rgba(16, 185, 129, 0.2);
    color: #10B981;
}

.badge.payment {
    background-color: rgba(245, 158, 11, 0.2);
    color: #F59E0B;
}

.badge.expense {
    background-color: rgba(239, 68, 68, 0.2);
    color: #EF4444;
}

.badge.blue {
    background-color: rgba(59, 130, 246, 0.2);
    color: #3B82F6;
}

.badge.gray {
    background-color: rgba(148, 163, 184, 0.2);
    color: #94A3B8;
}

/* Large Modal */
.modal-content.large-modal {
    max-width: 800px;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: 70vh;
}

/* Mini Stats in Modal */
.stats-grid.mini-stats {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.mini-stats .stat-card {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.mini-stats .stat-value {
    font-size: 1.25rem;
}

.mt-4 {
    margin-top: 1rem;
}

.text-green {
    color: var(--success);
}

.text-orange {
    color: var(--warning);
}

.text-red {
    color: var(--danger);
}

/* Report View Controls */
.view-header .filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-header .filter-group label {
    font-weight: 600;
    color: var(--text-muted);
}

/* Report Controls Panel */
.report-controls-panel {
    background: transparent;
    backdrop-filter: none;
    border: none;
    padding: 2rem 0;
    border-radius: 0;
    margin-bottom: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    box-shadow: none;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-item label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-item select,
.filter-item input {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.875rem 1rem;
    border-radius: 12px;
    color: white;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.filter-item select:focus,
.filter-item input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.filter-actions {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.filter-actions button {
    height: 46px;
    /* Match input height roughly */
}

/* Responsive adjustments for report panel */
@media (max-width: 900px) {
    .report-controls-panel {
        grid-template-columns: 1fr 1fr;
    }

    .filter-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}

@media (max-width: 600px) {
    .report-controls-panel {
        grid-template-columns: 1fr;
    }
}

/* Transactions View Responsive */
@media (max-width: 768px) {
    #transactionsView .control-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    #transactionsView .search-box,
    #transactionsView .glass-select,
    #transactionsView .btn-primary {
        width: 100% !important;
        max-width: none !important;
    }

    .date-filter-group {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .date-filter-group span {
        display: none;
        /* Hide the dash separator */
    }

    .date-filter-group input {
        flex: 1;
        width: 100% !important;
    }

    #transactionsView .stats-grid {
        grid-template-columns: 1fr;
        /* Stack stats cards */
        gap: 1rem;
    }
}

/* Global Table Scroll Fix */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* Smooth scrolling on iOS */
}

/* Report Layout */
.printable-area {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.report-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.report-header h2 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

/* Print Styles */
@media print {
    @page {
        size: A4;
        margin: 1cm;
    }

    /* Universal Print Reset: Hide Everything by Default */
    body {
        visibility: hidden !important;
        background: white !important;
        height: auto;
        width: 100%;
        overflow: visible;
    }

    /* Make the Report and its Children Visible */
    #printableReport,
    #printableReport * {
        visibility: visible !important;
        color: black !important;
    }

    /* Position the Report at the top of the page */
    #printableReport {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
        z-index: 9999;
        background: white !important;
        display: block !important;
    }

    /* Explicitly hide interface elements to prevent spacing issues */
    .sidebar,
    .top-header,
    .control-bar,
    .filter-actions,
    .no-print,
    .view-header {
        display: none !important;
    }

    label {
        color: black !important;
    }

    .view:not(#reportsView) {
        display: none !important;
    }

    /* --- Print Header (Matches Image) --- */
    .print-header-only {
        display: block !important;
        margin-bottom: 1rem;
    }

    .print-top-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1rem;
    }

    .print-logo {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-size: 1.2rem;
        font-weight: bold;
        color: black;
    }

    .print-company-title {
        font-weight: bold;
        font-size: 1.2rem;
    }

    .print-info-grid {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        font-size: 0.9rem;
    }

    .info-row {
        display: flex;
        justify-content: space-between;
    }

    .info-right,
    .info-left {
        width: 48%;
    }

    .print-separator {
        height: 2px;
        background: black;
        margin-top: 1rem;
        margin-bottom: 1rem;
    }

    /* --- Report Table (Print) --- */
    .report-table th,
    .report-table td {
        border-bottom: 1px solid #ccc;
        padding: 0.5rem;
        text-align: right;
        color: black;
        font-size: 0.9rem;
    }

    .report-table th {
        background-color: #f0f0f0;
        font-weight: bold;
    }

    .highlight-row {
        background-color: #f9f9f9;
        font-weight: bold;
    }

    .text-red {
        color: red !important;
    }

    .stats-grid.mini-stats {
        display: none;
        /* Hide cards in print, using header summary instead if preferred, or custom print */
    }

    /* --- Print Footer --- */
    .print-footer-only {
        display: block !important;
        margin-top: 2rem;
    }

    .print-footer-line {
        height: 1px;
        background: black;
        margin-bottom: 0.5rem;
    }

    .print-footer-content {
        display: flex;
        justify-content: space-between;
        font-size: 0.8rem;
    }
}

.print-header-only,
.print-footer-only {
    display: none;
}

/* ==========================================================================
   ENHANCED LIGHT THEME - Modern, Clean & Professional
   ========================================================================== */

[data-theme="light"] {
    --bg-dark: #F1F5F9;
    --bg-card: #FFFFFF;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --overlay-bg: rgba(241, 245, 249, 0.95);
}

[data-theme="light"] body {
    background: radial-gradient(circle at top right, #F8FAFC 0%, #E2E8F0 100%);
    color: var(--text-main);
}

/* Sidebar Light Mode */
[data-theme="light"] .sidebar {
    background-color: #FFFFFF;
    border-left: 1px solid var(--border-color);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .logo-container {
    color: var(--text-main);
}

[data-theme="light"] .nav-item {
    color: #475569;
}

[data-theme="light"] .nav-item:hover {
    background-color: #F8FAFC;
    color: var(--primary);
}

[data-theme="light"] .nav-item.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

[data-theme="light"] .user-profile {
    border-top: 1px solid var(--border-color);
}

/* Main Content & Header Light Mode */
[data-theme="light"] .main-content {
    background: #F8FAFC;
}

[data-theme="light"] .top-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

/* Components Light Mode */
[data-theme="light"] .stat-card,
[data-theme="light"] .table-container,
[data-theme="light"] .employee-card,
[data-theme="light"] .settings-section,
[data-theme="light"] .modal-content {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

[data-theme="light"] .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .data-table th {
    background-color: #F8FAFC;
    color: #64748B;
    border-bottom: 2px solid #F1F5F9;
}

[data-theme="light"] .data-table td {
    border-bottom: 1px solid #F1F5F9;
    color: #334155;
}

[data-theme="light"] .welcome-icon {
    color: var(--primary);
    opacity: 1;
}

[data-theme="light"] .data-table tr:hover {
    background-color: #FAFAFA;
}

/* Forms Light Mode */
[data-theme="light"] .form-group label {
    color: #475569;
}

[data-theme="light"] .form-group input,
[data-theme="light"] .form-group select,
[data-theme="light"] .form-group textarea,
[data-theme="light"] .glass-select,
[data-theme="light"] .search-box input {
    background: #FFFFFF;
    border: 1px solid #D1D5DB;
    color: #1F2937;
}

[data-theme="light"] .form-group input:focus,
[data-theme="light"] .form-group select:focus,
[data-theme="light"] .form-group textarea:focus,
[data-theme="light"] .search-box input:focus,
[data-theme="light"] .glass-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.05);
    background: #FFFFFF;
}

[data-theme="light"] .card-content {
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
}

[data-theme="light"] .radio-card input:checked+.card-content {
    background: rgba(79, 70, 229, 0.05);
    border-color: var(--primary);
}

/* Settings Specific */
[data-theme="light"] .setting-item {
    background: #FAFAFA;
    border: 1px solid #F3F4F6;
}

[data-theme="light"] .toggle-slider {
    background: #D1D5DB;
    border-color: #E5E7EB;
}



/* Buttons Light Mode */
[data-theme="light"] .btn-secondary,
[data-theme="light"] .icon-btn {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    color: #475569;
}

[data-theme="light"] .btn-secondary:hover,
[data-theme="light"] .icon-btn:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
    color: var(--text-main);
}

[data-theme="light"] .logout-btn {
    color: #64748B;
}

[data-theme="light"] .logout-btn:hover {
    background: rgba(239, 68, 68, 0.05);
}

/* Remove colors from action icons and buttons in light mode */
[data-theme="light"] .icon-btn[title="تعديل"],
[data-theme="light"] .icon-btn[title="حذف"],
[data-theme="light"] .delete-btn {
    color: #475569 !important;
    border-color: #E2E8F0 !important;
}

[data-theme="light"] .icon-btn[title="تعديل"]:hover,
[data-theme="light"] .icon-btn[title="حذف"]:hover {
    background: #F1F5F9 !important;
    color: #0F172A !important;
}


[data-theme="light"] #salesView .data-table td:last-child .icon-btn[title="تعديل"],
[data-theme="light"] #salesView .data-table td:last-child .icon-btn[title="حذف"],
[data-theme="light"] #salesView .data-table td:last-child .icon-btn[title="طباعة"] {
    color: #475569 !important;
    border-color: #E2E8F0 !important;
}

/* --- Professional Report Styles (Global) --- */
/* Base Report Container */
.printable-report {
    font-family: 'Cairo', 'Inter', sans-serif;
    color: #1e293b;
    line-height: 1.6;
}

/* Header Design */
.report-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 3px solid #0f172a;
    padding-bottom: 25px;
    margin-bottom: 30px;
}

.company-branding {
    display: flex;
    align-items: center;
    gap: 20px;
}

.c-logo {
    font-size: 3rem;
    color: #0f172a;
    width: 60px;
    height: 60px;
    background: #f1f5f9;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.c-info {
    text-align: right;
}

.c-info h1 {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0 0 5px 0;
    color: #0f172a;
}

.c-info p {
    font-size: 0.9rem;
    color: #64748b;
    margin: 2px 0;
}

.report-title-box {
    text-align: left;
}

.report-title-box h2 {
    background: #0f172a;
    color: white;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 1.2rem;
    margin: 0 0 10px 0;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.report-title-box p {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0;
}

/* Meta Data Grid */
.report-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
}

.meta-item {
    display: flex;
    flex-direction: row;
    /* Horizontal layout */
    align-items: center;
    gap: 10px;
}

.meta-item .label {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 0;
    /* Remove bottom margin since it's side-by-side */
}

.meta-item .value {
    font-size: 1.0rem;
    font-weight: 700;
    color: #0f172a;
}

/* Summary Cards */
.report-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.summary-box {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.summary-box.highlight {
    background: #0f172a;
    border-color: #0f172a;
    color: white;
}

.summary-box.highlight .value,
.summary-box.highlight span {
    color: white !important;
}

.summary-box span {
    font-size: 0.9rem;
    color: #64748b;
}

.summary-box strong {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
}

/* --- Innovative Table Design --- */
.report-body {
    margin-bottom: 40px;
}

.print-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.82rem;
    /* Reduced font size (was 0.95rem) */
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    /* Rounded corners for the whole table */
    overflow: hidden;
}

.print-table th {
    background: #f1f5f9;
    color: #334155;
    font-weight: 700;
    padding: 16px;
    text-align: right;
    border-bottom: 2px solid #cbd5e1;
}

.print-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
}

/* Vertical lines for separation (Optional - clean look usually avoids them, but financial might prefer) */
/* .print-table td + td, .print-table th + th { border-right: 1px solid #f0f0f0; } */

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

.print-table tr:nth-child(even) {
    background-color: #f8fafc;
    /* Subtle zebra stripe */
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.print-table tr:hover {
    background-color: #fffbeb;
    /* Light yellow highlight on hover (screen only really) */
}

/* Table Totals Row */
.print-table tr.highlight-row {
    background-color: #f1f5f9 !important;
    font-weight: bold;
    border-top: 2px solid #cbd5e1;
}

.print-table tr.highlight-row td {
    color: #0f172a;
}

/* Footer Section */
.report-footer {
    margin-top: 50px;
    padding-top: 20px;
    border-top: 2px solid #e2e8f0;
}

.footer-notes {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 40px;
    background: #fffcf0;
    padding: 15px;
    border-radius: 8px;
    border: 1px dashed #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-sign {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

.sign-box {
    width: 200px;
    border-top: 1px solid #94a3b8;
    text-align: center;
    padding-top: 10px;
    color: #475569;
    font-weight: 600;
}

.page-number {
    text-align: center;
    font-size: 0.8rem;
    color: #cbd5e1;
}


/* --- Print Media Query (Layout & Hiding) --- */
@media print {
    @page {
        size: A4;
        margin: 10mm;
    }

    /* Global Reset */
    *,
    *::before,
    *::after {
        box-sizing: border-box;
    }

    body {
        margin: 0;
        padding: 0;
        background-color: white !important;
        color: black !important;
        height: auto !important;
        overflow: visible !important;
    }

    /* Hide UI Elements */
    .sidebar,
    .top-header,
    .login-container,
    .control-bar,
    .filter-actions,
    .btn-primary,
    .btn-secondary,
    .nav-menu,
    .user-profile,
    .settings-container,
    .modal,
    .search-box,
    #quickAddBtn,
    .view-header,
    .no-print {
        display: none !important;
    }

    /* Reset Layout Containers to render full page */
    /* 
    .app-container,
    .main-content,
    .view-container,
    .view,
    #reportsView {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
        position: static !important;
        background: white !important;
        flex: none !important;
    }
    */

    /* Ensure the report itself is visible and styled */
    #printableReport {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        visibility: visible !important;
        position: relative !important;
        box-shadow: none !important;
        background: white !important;
    }

    /* Force Table Styling for Print */
    .print-table {
        width: 100% !important;
        border: 1px solid #ddd !important;
    }

    .print-table th {
        background-color: #f1f5f9 !important;
        color: black !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .print-table td {
        color: black !important;
    }

    .print-table tr:nth-child(even) {
        background-color: #f8fafc !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* --- Screen Preview Styling --- */
@media screen {

    /* Styles for the "Paper Preview" on screen */
    #printableReport {
        display: none;
        /* JS toggles this to block */
        background: white;
        width: 210mm;
        /* A4 width */
        min-height: 297mm;
        /* A4 height */
        margin: 40px auto;
        padding: 20mm;
        box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.15);
        /* Nice floating shadow */
        border-radius: 4px;
        box-sizing: border-box;
    }

}

/* --- Mobile Responsiveness --- */
@media screen and (max-width: 768px) {

    /* Sidebar - Off-canvas behavior */
    .sidebar {
        position: fixed;
        right: 0;
        top: 0;
        height: 100vh;
        width: 260px;
        z-index: 1000;
        transform: translateX(100%);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sidebar:not(.collapsed) {
        transform: translateX(0);
        width: 260px !important;
    }

    .sidebar.collapsed {
        transform: translateX(100%);
        width: 260px !important;
        padding: 1.5rem;
    }

    .sidebar.collapsed .logo-container h1,
    .sidebar.collapsed .nav-item span,
    .sidebar.collapsed .user-info,
    .sidebar.collapsed .logout-btn {
        display: block;
    }

    /* Overlay for mobile when sidebar is open */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }

    .sidebar:not(.collapsed)+.sidebar-overlay {
        display: block;
    }

    /* Layout */
    .app-container {
        flex-direction: column;
    }

    .main-content {
        margin-right: 0 !important;
        width: 100%;
    }

    /* Header */
    .top-header {
        padding: 0.75rem 1rem;
    }

    .top-header h2 {
        font-size: 1.1rem;
    }

    /* Login Screen */
    .login-card {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }

    .login-logo {
        font-size: 2.5rem;
    }

    .login-title {
        font-size: 1.3rem;
    }

    /* Stats Grid */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-card {
        padding: 1.25rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    /* Tables */
    .table-container {
        overflow: visible;
        position: relative;
    }

    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    /* Forms & Inputs */
    .form-row {
        flex-direction: column;
        gap: 1rem;
    }

    .glass-select,
    .search-box input {
        min-width: 100%;
        width: 100%;
    }

    .control-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .view-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .view-header .btn-primary {
        width: 100%;
        justify-content: center;
    }

    /* Modals */
    .modal-content {
        width: 95%;
        margin: 1rem auto;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-body {
        max-height: 60vh;
        overflow-y: auto;
    }

    .modal-footer {
        position: sticky;
        bottom: 0;
        background: var(--bg-card);
        padding: 1rem 1.5rem;
        border-top: 1px solid var(--border-color);
    }

    /* Report Preview - Critical Mobile Fix */
    #printableReport {
        width: 100% !important;
        min-width: unset !important;
        margin: 1rem auto !important;
        padding: 10px !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    #reportsView .filter-actions .btn-secondary {
        display: none !important;
    }

    /* Hide report preview from screen on mobile, but it will be shown by @media print */
    #printableReport {
        display: none !important;
    }

    .report-header h2 {
        font-size: 1.1rem;
    }

    .report-table {
        font-size: 0.75rem;
    }

    .report-table th,
    .report-table td {
        padding: 0.5rem 0.25rem;
    }

    /* Bottom Navigation Styles */
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: var(--bg-card);
        border-top: 1px solid var(--border-color);
        padding: 0.5rem 0.25rem;
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0));
        justify-content: space-around;
        align-items: center;
        z-index: 900;
        backdrop-filter: blur(12px);
        box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.3);
    }

    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        background: none;
        border: none;
        color: var(--text-muted);
        font-size: 0.75rem;
        cursor: pointer;
        padding: 0.5rem;
        transition: all 0.3s ease;
        flex: 1;
    }

    .bottom-nav-item i {
        font-size: 1.25rem;
    }

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

    /* Floating Action Button */


    /* Adjust Layout for Bottom Nav */
    .view-container {
        padding-bottom: 6rem !important;
    }

    /* Compact Top Header for Mobile */
    .top-header {
        padding: 0.75rem 1rem !important;
        background: var(--bg-card);
    }

    .top-header #sidebarToggle {
        display: flex !important;
        /* Allow sidebar access on mobile */
    }



    /* Form Ergonomics for Mobile */
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.85rem !important;
        /* Larger touch area */
        font-size: 16px !important;
        /* Prevent iOS zoom */
    }

    .btn-primary,
    .btn-secondary {
        padding: 0.85rem 1.5rem !important;
        font-size: 1rem !important;
    }
}

/* Base styles for bottom-nav and fab (hidden on desktop) */
.bottom-nav,
.mobile-fab {
    display: none;
}

/* --- Premium Loading Overlay --- */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(1.05);
}

.loader-content {
    background: var(--glass-bg);
    padding: 3.5rem;
    border-radius: 2.5rem;
    border: 1px solid var(--glass-border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
    max-width: 420px;
    width: 90%;
    backdrop-filter: blur(20px);
}

.loader-visual {
    position: relative;
    width: 90px;
    height: 90px;
    margin: 0 auto 2.5rem;
}

.spinner {
    width: 100%;
    height: 100%;
    border: 3px solid rgba(99, 102, 241, 0.1);
    border-top: 3px solid var(--primary);
    border-right: 3px solid var(--primary);
    border-radius: 50%;
    animation: rotation 1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.loader-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: var(--primary);
    animation: loader-pulse 2s infinite ease-in-out;
}

.loader-title {
    color: var(--text-main);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    margin-bottom: 0.75rem;
    background: linear-gradient(45deg, var(--text-main), var(--text-muted));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.loading-overlay p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2.5rem;
}

.loader-progress-container {
    width: 100%;
    height: 5px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.loader-progress-bar {
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    border-radius: 10px;
    animation: progress-shimmer 1.5s infinite ease-in-out;
}

@keyframes rotation {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes loader-pulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.15);
        opacity: 1;
    }
}

@keyframes progress-shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(250%);
    }
}


[data-theme="light"] .loader-content {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .loader-title {
    background: linear-gradient(45deg, #0F172A, #334155);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Login Screen Light Mode */
[data-theme="light"] .login-container {
    background: radial-gradient(circle at center, #F8FAFC 0%, #E2E8F0 100%);
}

[data-theme="light"] .login-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .login-logo {
    color: var(--primary);
}

[data-theme="light"] .login-title {
    color: #1F2937;
}

[data-theme="light"] .login-subtitle {
    color: #6B7280;
}

/* --- Refined Customers & Sales Styles --- */
.view-header {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.view-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.search-bar {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-icon {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-bar input {
    width: 100%;
    padding: 0.85rem 3rem 0.85rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.search-bar input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    outline: none;
}

/* Receipt Style Table for Invoices */
.receipt-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.receipt-table th {
    padding: 0.75rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--border-color);
}

.receipt-table td {
    background: var(--bg-dark);
    padding: 1rem 0.75rem;
}

.receipt-table td:first-child {
    border-radius: 10px 0 0 10px;
}

.receipt-table td:last-child {
    border-radius: 0 10px 10px 0;
}

.receipt-table input {
    background: transparent !important;
    border: 1px solid transparent !important;
    color: var(--text-main) !important;
    padding: 0.5rem !important;
    width: 100%;
}

.receipt-table input:focus {
    background: var(--bg-card) !important;
    border-color: var(--primary) !important;
}

.invoice-summary {
    background: var(--bg-dark);
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px dashed var(--border-color);
}

.invoice-total-label {
    font-size: 1.1rem;
    font-weight: 600;
}

.invoice-total-amount {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

/* Stats Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.salary {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}

.badge.payment {
    background: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
}

/* Dashboard Refinements */
.welcome-banner {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.15) 100%);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    position: relative;
    overflow: hidden;
}

.welcome-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.welcome-text h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(to left, var(--text-main), var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-text p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.welcome-icon {
    font-size: 3.5rem;
    color: var(--primary);
    opacity: 0.8;
    animation: welcome-float 3s ease-in-out infinite;
}

@keyframes welcome-float {

    0%,
    100% {
        transform: translateY(0) rotate(0);
    }

    50% {
        transform: translateY(-10px) rotate(5deg);
    }
}

.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-main);
}

.section-title i {
    color: var(--secondary);
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.action-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.3);
    background: rgba(99, 102, 241, 0.05);
}

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
}

.action-icon.blue {
    background: rgba(59, 130, 246, 0.15);
    color: #3B82F6;
}

.action-icon.green {
    background: rgba(16, 185, 129, 0.15);
    color: #10B981;
}

.action-icon.orange {
    background: rgba(245, 158, 11, 0.15);
    color: #F59E0B;
}

.action-icon.purple {
    background: rgba(168, 85, 247, 0.15);
    color: #A855F7;
}

.action-card span {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}

@media (max-width: 768px) {
    .welcome-banner {
        padding: 1.5rem;
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .welcome-text h2 {
        font-size: 1.5rem;
    }

    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Transaction Modal Refinements */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.amount-group .input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}


.amount-group .input-with-icon input {
    padding-right: 0.75rem;
    font-size: 1.2rem;
    font-weight: 700;

    /* Print Styles */
    @media print {
        @page {
            size: A4;
            margin: 0;
            /* We handle margins in the body/container */
        }

        body {
            background: white;
            height: auto;
            width: 100%;
            margin: 0;
            padding: 0;
            overflow: visible;
        }

        .app-container,
        .modal,
        .loading-overlay {
            display: none !important;
        }

        #printableInvoice {
            display: block !important;
            visibility: visible !important;
            position: absolute;
            top: 0;
            left: 0;
            margin: 0;
            /* A4 Width is ~210mm. We use 100% to fill the print area defined by driver, 
               but max-width ensures it doesn't blow out */
            width: 100%;
            max-width: 210mm;
            min-height: 297mm;
            /* A4 Height */
            background: white;
            color: black;
            padding: 15mm;
            /* Standard document margin */
            z-index: 9999;
            box-sizing: border-box;
            font-size: 12pt;
            /* Readable print size */
        }

        .no-print {
            display: none !important;
        }
    }

    /* Screen styles for invoice (hidden by default) */
    .printable-invoice {
        display: none;
    }
}

/* Ensure Printable Invoice uses the Report Design Language */
.printable-invoice {
    font-family: 'Cairo', 'Inter', sans-serif;
    color: #1e293b;
    line-height: 1.6;
}

/* We can reuse .report-header, .company-branding, .print-table classes within the invoice HTML wrapper */
/* See index.html changes for structure updates */

/* Specific Invoice Footer tweaks if needed */
.invoice-footer-section {
    margin-top: 3rem;
    display: flex;
    justify-content: flex-end;
}

.invoice-total-card {
    background: #0f172a;
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    min-width: 300px;
}

.invoice-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #cbd5e1;
}

.invoice-total-row.final {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 1.25rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0;
}


.icon-payment {
    color: var(--warning);
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* --- Mobile Invoice Cards Transformation --- */
@media (max-width: 768px) {
    #salesView .data-table thead {
        display: none;
    }

    /* Remove Wrapper Container Styling on Mobile */
    #salesView .table-container {
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
        /* Remove padding to gain width */
    }

    #salesView .data-table tr {
        display: block;
        margin-bottom: 1rem;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        box-shadow: var(--shadow-sm);
        position: relative;
        padding-bottom: 0.5rem;
    }

    /* Clean Card Content */
    #salesView .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.03);
        text-align: left;
    }

    /* Invoice Number - Simple Bold Header */
    #salesView .data-table td:first-child {
        font-weight: 700;
        font-size: 1rem;
        color: var(--text-main);
        padding-top: 1rem;
        background: transparent;
    }

    /* Total Amount Highlight */
    #salesView .data-table td[data-label="الإجمالي"] {
        color: var(--success);
        font-weight: 600;
        font-size: 1rem;
    }

    /* Actions Footer - Standard & Aligned Right */
    #salesView .data-table td:last-child {
        border-bottom: none;
        justify-content: flex-start;
        /* Right in RTL */
        gap: 0.75rem;
        background: transparent;
        padding: 0.75rem 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        margin-top: 0.25rem;
    }

    /* Reset Action Buttons to match Global Theme (Bordered) but Smaller */
    #salesView .data-table td:last-child .icon-btn {
        width: 32px;
        height: 32px;
        border-radius: 6px;
        font-size: 0.95rem;
        /* Slightly smaller font for 32px */

        border: 1px solid var(--border-color);
        background: transparent;
        color: var(--text-muted);
        box-shadow: none;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #salesView .data-table td:last-child .icon-btn:active {
        background: rgba(255, 255, 255, 0.05);
    }

    /* Semantic Icon Colors */
    #salesView .data-table td:last-child .icon-btn[title="تعديل"] {
        color: #60A5FA;
        /* Blue */
        border-color: rgba(96, 165, 250, 0.3);
    }

    #salesView .data-table td:last-child .icon-btn[title="حذف"] {
        color: #EF4444;
        /* Red */
        border-color: rgba(239, 68, 68, 0.3);
    }

    #salesView .data-table td:last-child .icon-btn[title="طباعة"] {
        color: var(--text-muted);
    }

    #salesView .data-table td::before {
        content: attr(data-label);
        font-weight: 500;
        font-size: 0.85rem;
        color: var(--text-muted);
    }

    #salesView .data-table td:first-child::before,
    #salesView .data-table td:last-child::before {
        display: none;
    }

    /* --- Customer Details Modal (Mobile Cards) --- */
    #customerDetailsModal .data-table thead {
        display: none;
    }

    /* Remove Wrapper */
    #customerDetailsModal .table-container {
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
    }

    /* Card Style */
    #customerDetailsModal .data-table tr {
        display: block;
        margin-bottom: 1rem;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        box-shadow: var(--shadow-sm);
        padding: 0.5rem 0;
    }

    #customerDetailsModal .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.03);
        text-align: left;
    }

    #customerDetailsModal .data-table td:last-child {
        border-bottom: none;
    }

    #customerDetailsModal .data-table td::before {
        content: attr(data-label);
        font-weight: 500;
        font-size: 0.85rem;
        color: var(--text-muted);
    }
}

/* --- Premium Notification System (Toasts) --- */
.toast-container {
    position: fixed;
    top: 2rem;
    left: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 300px;
    max-width: 450px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: toastSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    pointer-events: auto;
    border-right: 5px solid var(--primary);
}

.toast.success {
    border-right-color: var(--success);
}

.toast.error {
    border-right-color: var(--danger);
}

.toast.warning {
    border-right-color: var(--warning);
}

.toast.info {
    border-right-color: var(--info);
}

.toast i {
    font-size: 1.25rem;
}

.toast.success i {
    color: var(--success);
}

.toast.error i {
    color: var(--danger);
}

.toast.warning i {
    color: var(--warning);
}

.toast.info i {
    color: var(--info);
}

.toast-content {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
}

.toast.hiding {
    animation: toastSlideOut 0.4s cubic-bezier(0.6, -0.28, 0.735, 0.045) forwards;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

/* --- Custom Confirm Enhancement --- */
#confirmModal .modal-content {
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: var(--bg-card);
    box-shadow: var(--shadow-lg);
}

#confirmModal h3 {
    color: var(--text-main);
}

#confirmIcon i {
    filter: drop-shadow(0 0 15px rgba(245, 158, 11, 0.3));
}

@media print {
    #printableReport {
        display: block !important;
        visibility: visible !important;
        position: static !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 10mm !important;
        background: white !important;
        color: black !important;
    }
}

/* --- Modern Settings Redesign --- */
.settings-container-modern {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
}

.settings-header-modern {
    margin-bottom: 30px;
    text-align: right;
}

.settings-header-modern h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 5px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.settings-header-modern p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Grid Layout */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.full-span {
    grid-column: 1 / -1;
}

/* Cards */
.settings-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    /* Glass border */
    border-radius: 24px;
    padding: 25px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
}

.settings-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.3);
}

/* Card Header with Glowing Icons */
.card-icon-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.4rem;
    color: white;
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.3);
}

.gradient-purple {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
}

.gradient-green {
    background: linear-gradient(135deg, #10B981, #059669);
}

.gradient-blue {
    background: linear-gradient(135deg, #3B82F6, #2563EB);
}

.card-icon-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.card-body {
    flex: 1;
}

.setting-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

/* Theme Switcher */
.theme-switcher {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.theme-option {
    cursor: pointer;
    position: relative;
    width: 100%;
}

.theme-option input {
    display: none;
}

.theme-slider {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50px;
    height: 50px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: relative;
    padding: 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}

.theme-slider i {
    z-index: 2;
    font-size: 1.2rem;
    color: var(--text-muted);
    transition: color 0.3s;
}

.slider-knob {
    position: absolute;
    top: 5px;
    left: 5px;
    width: calc(50% - 5px);
    height: 40px;
    background: var(--primary);
    border-radius: 40px;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    z-index: 1;
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
}

.theme-option input:not(:checked)+.theme-slider .slider-knob {
    transform: translateX(0);
    /* Left : Sun */
}

/* Resetting for simpler toggle logic: */
.slider-knob {
    left: 5px;
}

.theme-option input:checked+.theme-slider .slider-knob {
    transform: translateX(100%);
    /* Moves to right side */
}

.theme-option input:not(:checked)+.theme-slider .sun-icon {
    color: white;
}

.theme-option input:checked+.theme-slider .moon-icon {
    color: white;
}


/* Profit Input Modern */
.profit-input-modern {
    display: flex;
    gap: 10px;
    align-items: center;
}

.modern-input-group {
    position: relative;
    flex: 1;
}

.input-modern {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 12px 15px;
    padding-left: 35px;
    /* Space for unit */
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    transition: all 0.3s;
}

.input-modern:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.unit {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-weight: bold;
}

.btn-modern-save {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 20px;
    height: 48px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-modern-save:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

/* Modern Form */
.modern-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row-modern {
    display: flex;
    gap: 20px;
}

.input-group-modern {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group-modern.full {
    width: 100%;
}

.input-group-modern label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
}

.input-group-modern label i {
    color: var(--primary);
    margin-left: 5px;
}

.input-group-modern input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 15px;
    color: white;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.input-group-modern input:focus {
    outline: none;
    border-color: var(--secondary);
    background: rgba(0, 0, 0, 0.3);
}

/* Logo Upload Modern */
.logo-upload-modern {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 25px;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    transition: all 0.3s;
}

.logo-upload-modern:hover {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.3);
}

.logo-preview-container {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

.logo-preview-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.placeholder-icon {
    font-size: 1.8rem;
    color: var(--text-muted);
    opacity: 0.5;
}

.upload-actions h4 {
    margin-bottom: 5px;
}

.upload-actions p {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.btn-upload-modern {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    padding: 10px 20px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-upload-modern:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.3);
}

/* Prominent Variants */
.btn-variant-success {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-variant-success:hover {
    background: linear-gradient(135deg, #34D399 0%, #059669 100%);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
}

.btn-variant-warning {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-variant-warning:hover {
    background: linear-gradient(135deg, #FBBF24 0%, #D97706 100%);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.5);
}

.btn-variant-danger {
    background: linear-gradient(135deg, #EF4444 0%, #B91C1C 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-variant-danger:hover {
    background: linear-gradient(135deg, #F87171 0%, #B91C1C 100%);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.5);
}

.form-footer-modern {
    margin-top: 10px;
    text-align: left;
    /* Align button to left/end */
    direction: ltr;
    /* Force LTR for button alignment if needed, or flex-end */
    display: flex;
    /* Better */
    justify-content: flex-start;
    /* Since it's RTL, flex-start is Right. We want Left usually? Or full width? */
    /* Let's make it full width save button */
}

.btn-save-all-modern {
    width: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.4);
    transition: all 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-save-all-modern:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px -5px rgba(99, 102, 241, 0.5);
}


/* Responsive Refinements */
@media (max-width: 1024px) {
    .settings-grid {
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .settings-glass-container {
        padding: 0 0.5rem;
    }

    .settings-container-modern {
        padding: 15px;
    }

    .settings-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .company-card {
        grid-row: span 1;
    }

    .settings-card {
        padding: 20px;
        border-radius: 20px;
    }

    .form-row-modern {
        flex-direction: column;
        gap: 15px;
    }

    .settings-header-modern h2 {
        font-size: 1.5rem;
    }

    .logo-upload-modern {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        padding: 15px;
    }

    .logo-preview-container {
        width: 100px;
        height: 100px;
        margin: 0 auto;
    }

    .upload-actions {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .btn-upload-modern {
        width: 100%;
        justify-content: center;
    }

    .profit-input-modern {
        flex-direction: column;
        width: 100%;
    }

    .btn-modern-save {
        width: 100%;
        justify-content: center;
    }
}

/* Professional Settings Page Styles - Glassmorphism & Modern UI */
.settings-glass-container {
    max-width: 1100px;
    margin: 1.5rem auto;
    /* Reduced from 3rem */
    padding: 0 1.5rem;
    /* Reduced from 2rem */
    animation: settingsAppear 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes settingsAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.settings-hero-section {
    text-align: center;
    margin-bottom: 3rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    /* Reduced from 1.5rem */
}

.settings-grid .full-span {
    grid-column: span 2;
}

/* --- Modern Company Card & Logo Styles --- */
.company-card {
    grid-row: span 2;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    padding: 1.25rem !important;
    /* Reduced padding */
    gap: 0.5rem;
    /* Further reduced from 0.75rem */
}

.logo-section-modern {
    display: flex;
    flex-direction: row;
    /* Horizontal on desktop for better balance */
    align-items: center;
    gap: 1.25rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    width: 100%;
}

.logo-section-modern:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--primary);
}

.logo-preview-wrap {
    width: 90px;
    /* Smaller preview */
    height: 90px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}

.logo-preview-wrap img {
    max-width: 85%;
    max-height: 85%;
    object-fit: contain;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3));
}

.logo-actions {
    text-align: right;
    flex-grow: 1;
}

.logo-actions h4 {
    color: var(--text-main);
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.logo-actions p {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-bottom: 0.6rem;
}

.form-row {
    width: 100%;
    margin-bottom: 0.75rem;
}

#companyInfoForm {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.input-group-modern {
    width: 100%;
}

/* Enhancing input groups in settings */
.company-card .input-group-modern label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
}

.company-card .input-group-modern:focus-within label {
    color: var(--primary);
}

.company-card .input-group-modern input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-main);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
    /* Crucial for width: 100% with padding */
}

.company-card .input-group-modern input:focus {
    background: rgba(0, 0, 0, 0.3);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    outline: none;
}

/* Mobile specific fixes for company-card */
@media (max-width: 768px) {
    .settings-glass-container {
        padding: 0 1rem;
        margin: 1.5rem auto;
    }

    .company-card {
        padding: 1rem !important;
    }

    .logo-section-modern {
        flex-direction: column;
        /* Vertical on mobile */
        text-align: center;
        padding: 1rem;
    }

    .logo-actions {
        text-align: center;
    }

    .logo-preview-wrap {
        width: 100px;
        height: 100px;
    }
}


/* Company Card Specific Overrides to ensure full width */
.company-card #companyInfoForm,
.company-card .form-row,
.company-card .input-group-modern {
    width: 100% !important;
    max-width: none !important;
}

.company-card .input-group-modern label {
    width: 100%;
    justify-content: flex-start;
    text-align: right;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.company-card .input-group-modern input {
    width: 100% !important;
    max-width: none !important;
    text-align: right !important;
    display: block !important;
    box-sizing: border-box !important;
}

.company-card .form-footer {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 1rem;
}

.financial-card .card-header-modern {
    margin-bottom: 1rem;
}

.financial-card .card-icon {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
}

.financial-card .header-text h3 {
    font-size: 1.1rem;
}

.system-card {
    padding: 1.25rem !important;
}

.card-header-modern {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.card-header-modern .header-text h3 {
    font-size: 1.25rem;
    color: var(--text-main);
    margin-bottom: 2px;
}

.card-header-modern .header-text p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.card-icon.blue {
    background: rgba(59, 130, 246, 0.1);
    color: #60A5FA;
}

.card-icon.green {
    background: rgba(34, 197, 94, 0.1);
    color: #4ADE80;
}

.card-icon.purple {
    background: rgba(168, 85, 247, 0.1);
    color: #C084FC;
}

/* Modern Form Elements */
.modern-grid-form .form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.input-group-modern {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.input-group-modern label {
    font-size: 0.95rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-group-modern label i {
    color: var(--primary);
    width: 20px;
}

.input-group-modern input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-size: 0.95rem;
    transition: all 0.3s;
    font-family: inherit;
}

.input-group-modern input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    outline: none;
}

/* Logo Section */
.logo-section-modern {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    border: 1px dashed var(--glass-border);
    margin: 1.5rem 0;
}

.logo-preview-wrap {
    width: 90px;
    height: 90px;
    background: var(--bg-card);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-border);
    overflow: hidden;
    position: relative;
}

.logo-preview-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
}

.placeholder-icon {
    font-size: 2.5rem;
    color: var(--text-muted);
    opacity: 0.5;
}

.logo-actions h4 {
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.logo-actions p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
}

/* Premium Buttons */
.btn-premium {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    font-family: inherit;
}

.btn-premium.primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.4);
}

.btn-premium.secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}

.btn-premium:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 15px 25px -5px rgba(0, 0, 0, 0.3);
}

/* Financial Card Specifics */
.input-with-action {
    display: flex;
    gap: 0.5rem;
}

.input-with-action input {
    flex: 1;
}

.btn-icon-save {
    width: 48px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.3s;
    font-size: 1.1rem;
}

.btn-icon-save:hover {
    filter: brightness(1.1);
    transform: scale(1.05);
}

/* System Actions */
.system-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.action-btn-modern {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-main);
    font-weight: 500;
}

.action-btn-modern i {
    font-size: 1.5rem;
}

.action-btn-modern.success:hover {
    background: rgba(34, 197, 94, 0.1);
    border-color: #22c55e;
    color: #4ade80;
}

.action-btn-modern.warning:hover {
    background: rgba(245, 158, 11, 0.1);
    border-color: #f59e0b;
    color: #fbbf24;
}

.action-btn-modern.danger {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.action-btn-modern.danger.full {
    width: 100%;
    flex-direction: row;
    justify-content: center;
}

.action-btn-modern.danger:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.danger-zone-divider {
    text-align: center;
    position: relative;
    margin: 2rem 0 1.5rem;
}

.danger-zone-divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
    z-index: 1;
}

.danger-zone-divider span {
    position: relative;
    z-index: 2;
    background: var(--bg-main);
    padding: 0 1rem;
    font-size: 0.8rem;
    color: #f87171;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Light Mode Support */
[data-theme="light"] .settings-glass-container {
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .input-group-modern input {
    background: white;
    color: #1e293b;
}

[data-theme="light"] .action-btn-modern {
    background: white;
}

[data-theme="light"] .logo-section-modern {
    background: #f8fafc;
}

[data-theme="light"] .danger-zone-divider span {
    background: #f1f5f9;
}

/* Responsive fixes */
@media (max-width: 992px) {
    .settings-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .settings-grid .full-span {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .settings-glass-container {
        padding: 0 0.5rem;
    }

    .settings-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    .company-card {
        grid-row: span 1 !important;
    }

    .glass-card {
        padding: 1.5rem;
        border-radius: 18px;
    }

    .modern-grid-form .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .logo-section-modern {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
        padding: 1.5rem;
    }

    .system-actions-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .action-btn-modern {
        padding: 1.25rem;
        border-radius: 16px;
    }
}

/* Professional About Page Styles - Glassmorphism & Modern UI */
.about-glass-container {
    max-width: 1100px;
    margin: 3rem auto;
    padding: 0 2rem;
    animation: aboutAppear 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes aboutAppear {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.about-hero-section {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
}

.floating-logo-wrap {
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
    background: var(--bg-card);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    animation: float 4s ease-in-out infinite;
    position: relative;
}

.floating-logo-wrap::after {
    content: '';
    position: absolute;
    inset: -10px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 35px;
    z-index: -1;
    opacity: 0.2;
    filter: blur(15px);
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

.about-main-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.gradient-text {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 30%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.version-tag {
    display: inline-block;
    padding: 0.4rem 1.2rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: var(--primary);
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Features Grid */
.about-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    transform: translateY(-10px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}

.glass-card:hover .card-glow {
    opacity: 1;
}

.card-icon {
    width: 60px;
    height: 60px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    transition: all 0.3s;
}

.glass-card:hover .card-icon {
    background: var(--primary);
    color: white;
    transform: rotateY(180deg);
}

.card-icon.red {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.glass-card:hover .card-icon.red {
    background: var(--danger);
}

.glass-card h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.glass-card p {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* Feature Lists & Pills */
.modern-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.modern-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-main);
}

.modern-list li i {
    color: var(--success);
    font-size: 1.1rem;
}

.tech-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.pill {
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.pill:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.developer-badge {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.developer-badge i {
    font-size: 1.5rem;
    color: var(--primary);
}

/* Support Actions */
.action-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: 18px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.contact-action.phone {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    box-shadow: 0 10px 20px -5px rgba(59, 130, 246, 0.4);
}

.contact-action.whatsapp {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    box-shadow: 0 10px 20px -5px rgba(34, 197, 94, 0.4);
}

.contact-action:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.3);
}

.contact-action::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.contact-action:hover::before {
    left: 100%;
}

/* Footer */
.about-footer {
    text-align: center;
    padding-top: 3rem;
    border-top: 1px solid var(--glass-border);
    margin-top: 2rem;
}

.copyright {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

/* Light Mode Support */
[data-theme="light"] .about-glass-container {
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .gradient-text {
    background: linear-gradient(135deg, #1e1b4b 30%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

[data-theme="light"] .floating-logo-wrap {
    background: white;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .glass-card {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
}

/* Responsive fixes */
@media (max-width: 768px) {
    .gradient-text {
        font-size: 2.5rem;
    }

    .about-glass-container {
        padding: 0 1rem;
        margin-top: 1rem;
    }

    .about-hero-section {
        margin-bottom: 2rem;
    }

    .glass-card {
        padding: 1.5rem;
    }

    .about-features-grid {
        gap: 1rem;
    }
}

/* Global Logo Styles */
.logo-img {
    height: 48px;
    width: auto;
    object-fit: contain;
    transition: all 0.3s ease;
}

[data-theme="light"] .logo-img {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* --- Employee Details Modal Tabs --- */
.modal-tabs-header {
    display: flex;
    gap: 1.5rem;
    padding: 0 1.5rem;
    margin-top: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-tab-btn {
    padding: 0.75rem 0;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-weight: 500;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-tab-btn:hover {
    color: var(--text-main);
}

.modal-tab-btn.active {
    border-bottom-color: var(--primary);
    color: var(--text-main);
    font-weight: 600;
}

/* --- Cards Grid --- */
.cards-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    padding-top: 0.5rem;
}

.glass-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.2s, background 0.2s;
}

.glass-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
}

.card-number-display {
    font-family: 'Roboto Mono', monospace;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    margin: 0.75rem 0;
    letter-spacing: 1.5px;
    font-size: 1rem;
    color: var(--text-main);
    text-align: center;
}

/* Mobile Adjustments for Tabs */
@media (max-width: 768px) {
    .modal-tabs-header {
        padding: 0 1rem;
        gap: 1rem;
        justify-content: space-around;
    }

    .modal-tab-btn {
        font-size: 0.9rem;
        flex: 1;
        justify-content: center;
    }
}

/* --- Toggle Switch Styles --- */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 2px;
    background-color: var(--text-muted);
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--primary);
    border-color: var(--primary);
}

input:checked+.slider:before {
    transform: translateX(24px);
    background-color: white;
}

.settings-toggle-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    margin-top: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.toggle-info h4 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-main);
}

.toggle-info p {
    margin: 0.3rem 0 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --- Profile Tabs (Standard Style) --- */
.profile-tabs-header {
    display: flex;
    gap: 1.5rem;
    padding: 0 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.profile-tab-btn {
    padding: 0.75rem 0;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-tab-btn:hover {
    color: var(--text-main);
}

.profile-tab-btn.active {
    color: var(--text-main);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.profile-tab-btn i {
    font-size: 1.1rem;
}

/* Mobile responsive tabs */
@media (max-width: 600px) {
    .profile-tabs-header {
        padding: 0 1rem;
        gap: 1rem;
    }

    .profile-tab-btn {
        font-size: 0.9rem;
    }
}