/* ============================================
   Business Manager - Custom Stylesheet
   Modern, Clean, Responsive Design
   ============================================ */

:root {
    --sidebar-width: 260px;
    --sidebar-mini-width: 76px;
    --sidebar-collapsed-width: 0px;
    --topbar-height: 60px;
    --primary-color: #4f46e5;
    --primary-light: #818cf8;
    --primary-dark: #3730a3;
    --secondary-color: #7c3aed;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --sidebar-bg: #3730a3;
    --sidebar-hover: rgba(255,255,255,0.12);
    --sidebar-active: rgba(255,255,255,0.2);
    --body-bg: #f1f5f9;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
}

/* ---- Base ---- */
* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--body-bg);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

a { text-decoration: none; }

/* ---- Sidebar Mini (default collapsed view) ---- */
.sidebar-mini {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-mini-width);
    height: 100vh;
    background: linear-gradient(180deg, #4f46e5 0%, #3730a3 100%);
    color: #fff;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 0;
    transition: var(--transition);
}

.sidebar-mini-toggle {
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255,255,255,0.85);
    font-size: 1.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    transition: var(--transition);
    flex-shrink: 0;
}

.sidebar-mini-toggle:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.sidebar-mini-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 0;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sidebar-mini-nav::-webkit-scrollbar {
    display: none;
}

.mini-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.65rem 0.25rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    gap: 3px;
}

.mini-nav-item i {
    font-size: 1.15rem;
    line-height: 1;
}

.mini-nav-item span {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-align: center;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 68px;
}

.mini-nav-item:hover {
    color: #fff;
    background: rgba(255,255,255,0.12);
}

.mini-nav-item.active {
    color: #fff;
    background: rgba(255,255,255,0.2);
}

.mini-nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #fff;
    border-radius: 0 3px 3px 0;
}

.sidebar-mini-bottom {
    width: 100%;
    border-top: 1px solid rgba(255,255,255,0.15);
    flex-shrink: 0;
}

.mini-nav-item.logout-item {
    color: rgba(255,120,120,0.8);
}

.mini-nav-item.logout-item:hover {
    color: #fff;
    background: var(--danger-color);
}

/* ---- Sidebar Expanded (popup/modal overlay) ---- */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1055;
    display: none;
    backdrop-filter: blur(2px);
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    display: block;
}

.sidebar-expanded {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #4f46e5 0%, #3730a3 100%);
    color: #fff;
    z-index: 1060;
    display: none;
    flex-direction: column;
    overflow-y: auto;
    border-radius: 0;
    box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    animation: slideInMenu 0.2s ease forwards;
}

.sidebar-expanded.show {
    display: flex;
}

@keyframes slideInMenu {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.sidebar {
    /* base styles kept for the expanded */
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    min-height: 60px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}

.sidebar-logo i {
    font-size: 1.5rem;
    color: var(--primary-light);
}

.sidebar-close {
    color: rgba(255,255,255,0.7);
    font-size: 1.2rem;
    padding: 0.25rem 0.5rem;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.sidebar-close:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.7rem 1.5rem;
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.12);
    border-left-color: rgba(255,255,255,0.6);
}

.sidebar-nav .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,0.2);
    border-left-color: #fff;
}

.sidebar-nav .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.nav-section-title {
    padding: 1rem 1.5rem 0.4rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255,255,255,0.35);
    letter-spacing: 1.5px;
    list-style: none;
}

.sidebar-footer {
    padding: 0.5rem 0;
    border-top: 1px solid rgba(255,255,255,0.15);
}

.sidebar-footer .logout-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem 1.5rem;
    color: rgba(255,120,120,0.8);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
}

.sidebar-footer .logout-link:hover {
    color: #fff;
    background: var(--danger-color);
}

.sidebar-footer .logout-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

/* ---- Main Content ---- */
.main-content {
    margin-left: var(--sidebar-mini-width);
    transition: var(--transition);
    min-height: 100vh;
}

/* ---- Top Navbar ---- */
.top-navbar {
    height: var(--topbar-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: var(--shadow-sm);
}

.sidebar-toggle {
    color: var(--text-primary);
    font-size: 1.2rem;
    padding: 0.25rem 0.5rem;
}

.page-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.user-dropdown {
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.user-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}

/* ---- Content Wrapper ---- */
.content-wrapper {
    padding: 1.5rem;
}

/* ---- Cards ---- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

/* Stat Cards */
.stat-card {
    border: none;
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.5rem;
    min-height: 110px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 4px 10px rgba(0,0,0,0.08);
}

.stat-card:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.06);
}

.stat-card-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    opacity: 0.6;
    background: rgba(0,0,0,0.08);
    color: inherit;
    transition: opacity 0.2s, transform 0.2s;
}
.stat-card:hover .stat-card-icon {
    opacity: 1;
    transform: scale(1.1);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.stat-card-primary { background: linear-gradient(135deg, #eef2ff, #e0e7ff); }
.stat-card-primary .stat-icon { background: var(--primary-color); color: #fff; }
.stat-card-primary .stat-value { color: var(--primary-dark); }

.stat-card-success { background: linear-gradient(135deg, #ecfdf5, #d1fae5); }
.stat-card-success .stat-icon { background: var(--success-color); color: #fff; }
.stat-card-success .stat-value { color: #065f46; }

.stat-card-danger { background: linear-gradient(135deg, #fef2f2, #fee2e2); }
.stat-card-danger .stat-icon { background: var(--danger-color); color: #fff; }
.stat-card-danger .stat-value { color: #991b1b; }

.stat-card-warning { background: linear-gradient(135deg, #fffbeb, #fef3c7); }
.stat-card-warning .stat-icon { background: var(--warning-color); color: #fff; }
.stat-card-warning .stat-value { color: #92400e; }

.stat-card-info { background: linear-gradient(135deg, #ecfeff, #cffafe); }
.stat-card-info .stat-icon { background: var(--info-color); color: #fff; }
.stat-card-info .stat-value { color: #155e75; }

/* ---- Buttons ---- */
.btn {
    transition: all 0.2s ease;
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
}
.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-action {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

/* View button – dark blue */
.btn-act-view {
    color: #1e3a5f;
    border-color: #1e3a5f;
    background: transparent;
}
.btn-act-view:hover,
.btn-act-view:focus {
    color: #fff;
    background: #1e3a5f;
    border-color: #1e3a5f;
}

/* Edit button – green */
.btn-act-edit {
    color: #198754;
    border-color: #198754;
    background: transparent;
}
.btn-act-edit:hover,
.btn-act-edit:focus {
    color: #fff;
    background: #198754;
    border-color: #198754;
}

/* ---- Tables ---- */
.table > :not(caption) > * > * {
    padding: 0.75rem 1rem;
}

.table thead th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.table tbody td {
    vertical-align: middle;
    font-size: 0.9rem;
}

.emp-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.emp-avatar-placeholder {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-light);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

/* ---- Status Badge ---- */
.badge-status {
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ---- Forms ---- */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border-color: var(--border-color);
    padding: 0.6rem 0.9rem;
    font-size: 0.9rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

/* ---- Login Page ---- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    overflow: hidden;
    border: none;
    margin: 0 auto;
}

.login-card .card-body {
    padding: 2rem !important;
}

.login-card .btn-primary {
    transition: all 0.2s ease;
}

.login-card .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79,70,229,0.4);
}

.login-card .btn-primary:active {
    transform: translateY(0);
    box-shadow: none;
}

.login-card .input-group .btn {
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.login-card .input-group .btn:hover {
    background: #f8f9fa;
    color: var(--text-primary);
}

.login-card .input-group .btn:focus {
    box-shadow: none;
    border-color: var(--border-color);
}

@media (max-width: 576px) {
    .login-page {
        padding: 0.75rem;
        align-items: flex-start;
        padding-top: 15vh;
    }
    .login-card {
        max-width: 100%;
        border-radius: var(--radius-md);
    }
    .login-card .card-body {
        padding: 1.5rem !important;
    }
    .login-card h4 {
        font-size: 1.25rem;
    }
}

.login-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 2rem;
    text-align: center;
    color: #fff;
}

.login-header h2 {
    margin: 0;
    font-weight: 800;
}

.login-header p {
    margin: 0.5rem 0 0;
    opacity: 0.8;
}

/* ---- Filter Bar ---- */
.filter-bar {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

/* ---- Employee View Page ---- */
.employee-header {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 2rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.employee-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #e2e8f0;
}

.employee-photo-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #eef2ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    border: 4px solid #e2e8f0;
}

.info-item {
    margin-bottom: 1rem;
}

.info-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
}

.info-value {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* ---- Modal ---- */
.modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    border-radius: 0;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-lg .modal-body .employee-header {
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

/* ---- Multi-Select Checkbox ---- */
.form-check-input {
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

#employeesTable tbody tr.row-selected {
    background-color: rgba(79, 70, 229, 0.06);
}

#bulkDeleteBtn {
    animation: fadeInUp 0.3s ease;
}

/* ---- Responsive ---- */
@media (max-width: 991.98px) {
    .sidebar-mini {
        width: 60px;
    }
    .sidebar-mini-nav .mini-nav-item span {
        font-size: 0.55rem;
    }
    .main-content {
        margin-left: 60px;
    }
    .sidebar-expanded {
        left: 0;
        width: 280px;
        max-width: 80vw;
    }
}

@media (max-width: 575.98px) {
    .sidebar-mini {
        width: 52px;
    }
    .sidebar-mini-nav .mini-nav-item {
        padding: 0.55rem 0.15rem;
    }
    .sidebar-mini-nav .mini-nav-item i {
        font-size: 1rem;
    }
    .sidebar-mini-nav .mini-nav-item span {
        font-size: 0.5rem;
    }
    .main-content {
        margin-left: 52px;
    }
    .sidebar-expanded {
        left: 0;
        top: 0;
        height: 100vh;
        width: 260px;
        max-width: 85vw;
    }
}

@media (max-width: 767.98px) {
    .content-wrapper {
        padding: 0.75rem;
    }
    .stat-card {
        padding: 1rem;
    }
    .stat-card .stat-value {
        font-size: 1.35rem;
    }
    .top-navbar {
        padding: 0 0.75rem;
    }
    .page-title {
        font-size: 0.95rem;
    }
    .employee-header {
        text-align: center;
    }
    /* Page headers */
    .d-flex.flex-wrap.align-items-center.justify-content-between h4 {
        font-size: 1.15rem;
    }
    .d-flex.flex-wrap.align-items-center.justify-content-between p {
        font-size: 0.8rem;
    }
    /* Filter bar responsive */
    .filter-bar {
        padding: 0.75rem;
    }
    .filter-bar .form-label {
        font-size: 0.78rem;
        margin-bottom: 0.15rem;
    }
    .filter-bar .form-control,
    .filter-bar .form-select {
        font-size: 0.82rem;
        padding: 0.35rem 0.5rem;
    }
    /* Card footer pagination */
    .card-footer {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    .card-footer .pagination {
        flex-wrap: wrap;
    }
    .card-footer .text-muted {
        font-size: 0.75rem;
    }
    /* Modal responsive */
    .modal-dialog {
        margin: 0.5rem;
    }
    .modal-body {
        padding: 0.75rem;
    }
    .modal-header {
        padding: 0.75rem;
    }
    .modal-header h5, .modal-header h6 {
        font-size: 1rem;
    }
    .modal-footer {
        padding: 0.5rem 0.75rem;
    }
    /* Stat cards */
    .dash-stat-card {
        padding: 0.85rem;
    }
    .dash-stat-value {
        font-size: 1rem !important;
    }
    .dash-stat-label {
        font-size: 0.72rem;
    }
    .dash-stat-icon {
        width: 38px;
        height: 38px;
        font-size: 0.95rem;
    }
    /* Expandable table row (mobile) */
    .table .d-md-table-cell { display: none !important; }
    .table thead .d-md-table-cell { display: none !important; }
    .expand-toggle {
        display: inline-flex !important;
        cursor: pointer;
        background: none;
        border: 1px solid var(--border-color);
        border-radius: 50%;
        width: 26px;
        height: 26px;
        align-items: center;
        justify-content: center;
        font-size: 0.7rem;
        color: var(--primary-color);
        transition: all 0.2s ease;
        padding: 0;
    }
    .expand-toggle:hover,
    .expand-toggle.active {
        background: var(--primary-color);
        color: #fff;
        border-color: var(--primary-color);
    }
    .expand-toggle .fa-chevron-down { transition: transform 0.2s ease; }
    .expand-toggle.active .fa-chevron-down { transform: rotate(180deg); }
    .expand-row { display: none; }
    .expand-row.show { display: table-row; }
    .expand-row td {
        padding: 0 !important;
        border-top: none !important;
        background: #f8fafc;
    }
    .expand-content {
        padding: 0.6rem 0.75rem;
    }
    .expand-content .detail-item {
        display: flex;
        justify-content: space-between;
        padding: 0.3rem 0;
        border-bottom: 1px solid #f1f5f9;
        font-size: 0.82rem;
    }
    .expand-content .detail-item:last-child { border-bottom: none; }
    .expand-content .detail-label {
        color: var(--text-secondary);
        font-weight: 500;
        font-size: 0.75rem;
    }
    .expand-content .detail-value {
        font-weight: 600;
        text-align: right;
        max-width: 60%;
    }
    .expand-content .detail-actions {
        display: flex;
        gap: 0.5rem;
        justify-content: flex-end;
        padding-top: 0.5rem;
        margin-top: 0.25rem;
        border-top: 1px solid var(--border-color);
    }
    /* Hide table S.No column on mobile */
    .table th.col-sno, .table td.col-sno { display: none !important; }
    /* Table cell compact */
    .table > :not(caption) > * > * {
        padding: 0.5rem 0.4rem;
    }
    .table thead th {
        font-size: 0.7rem;
        padding: 0.5rem 0.4rem;
        letter-spacing: 0.3px;
    }
    /* Action buttons in table - hide on mobile (shown in expand) */
    .table .col-actions { display: none !important; }
    /* Per-page selector */
    #perPageSelect {
        font-size: 0.78rem;
        min-width: 100px !important;
    }
}

/* Expand toggle - hidden on desktop */
@media (min-width: 768px) {
    .expand-toggle { display: none !important; }
    .expand-row { display: none !important; }
    .col-expand { display: none !important; }
}

@media (max-width: 575.98px) {
    .btn { font-size: 0.8rem; padding: 0.35rem 0.6rem; }
    .table { font-size: 0.78rem; }
    .content-wrapper { padding: 0.5rem; }
    /* Stack page header on very small screens */
    .d-flex.flex-wrap.align-items-center.justify-content-between {
        flex-direction: column;
        align-items: flex-start !important;
    }
    .d-flex.flex-wrap.align-items-center.justify-content-between > .d-flex {
        width: 100%;
        justify-content: flex-end;
    }
    /* Dashboard welcome */
    .dash-welcome {
        padding: 1rem !important;
    }
    .dash-welcome h4 {
        font-size: 1rem;
    }
    .dash-welcome p {
        font-size: 0.78rem;
    }
    .dash-birthday-card {
        min-width: 100% !important;
    }
    .dash-birthday-body .d-flex.flex-wrap {
        flex-direction: column;
    }
    /* Charts responsive */
    .card-body canvas {
        min-height: 180px;
    }
    /* Quick actions wrap */
    .dash-quick-btn {
        font-size: 0.78rem;
        padding: 0.4rem 0.75rem;
    }
    /* Profile page tweak */
    .col-lg-6 .card-body .mb-3 .form-label {
        font-size: 0.82rem;
    }
    /* Settings tabs scroll */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    .nav-tabs .nav-item {
        flex-shrink: 0;
    }
    .nav-tabs .nav-link {
        font-size: 0.8rem;
        padding: 0.4rem 0.75rem;
    }
}

/* ---- Password toggle button border match ---- */
.pwd-toggle {
    border-color: var(--border-color) !important;
    color: #6c757d;
}
.pwd-toggle:hover,
.pwd-toggle:focus {
    border-color: #86b7fe !important;
    color: var(--primary-color);
    background: transparent;
}

/* ---- Scrollbar ---- */
.sidebar::-webkit-scrollbar {
    width: 4px;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}

/* ---- DataTables Overrides ---- */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 1rem;
}

div.dataTables_wrapper div.dataTables_filter input {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.75rem;
}

/* ---- Animations ---- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
    animation: fadeInUp 0.4s ease forwards;
}

/* ---- Select2 custom ---- */
.select2-container--bootstrap-5 .select2-selection {
    border-color: var(--border-color);
    border-radius: var(--radius-sm);
    min-height: 40px;
}

/* ---- Photo Upload ---- */
.photo-upload-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: var(--transition);
    background: #f8fafc;
}

.photo-upload-preview:hover {
    border-color: var(--primary-color);
    background: #eef2ff;
}

.photo-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---- Transaction type badges ---- */
.badge-income {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-expense {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ---- Category color dot ---- */
.category-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

/* ---- Sortable Table Headers ---- */
.sortable-th a {
    text-decoration: none !important;
    white-space: nowrap;
}
.sortable-th a:hover {
    color: var(--primary-color) !important;
}

/* ---- Employee Photo Clickable ---- */
.emp-photo-clickable {
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.emp-photo-clickable:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ---- Photo Viewer Modal ---- */
#photoViewerModal .modal-content {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
#photoViewerModal .modal-backdrop {
    background: rgba(0,0,0,0.85);
}
#photoViewerModal .modal-body img {
    border-radius: 8px;
    max-height: 80vh;
}

/* ---- View Modal Employee Photo ---- */
.employee-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e2e8f0;
}
.employee-photo-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #eef2ff;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.5rem;
}

/* ---- Pagination Overrides ---- */
.pagination .page-link {
    border-color: var(--border-color);
    color: var(--text-primary);
    font-size: 0.85rem;
    padding: 0.3rem 0.65rem;
}
.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}
.pagination .page-link:hover {
    background-color: var(--primary-light);
    color: #fff;
}

/* ---- Print Styles ---- */
/* ---- Dashboard Redesign ---- */
.dash-welcome {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #6366f1 100%);
    border-radius: var(--radius-lg);
    padding: 1.75rem 2rem;
    position: relative;
    overflow: hidden;
}
.dash-welcome::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
}
.dash-welcome::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: 30%;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
}

.dash-stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.25rem 1rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.dash-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.10);
}
.dash-stat-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}
.dash-stat-value {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-primary);
}
.dash-stat-sub {
    font-size: 0.72rem;
    font-weight: 600;
}
.dash-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.dash-stat-card:hover .dash-stat-icon {
    transform: scale(1.15) rotate(-5deg);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.dash-stat-change {
    font-size: 0.72rem;
    font-weight: 600;
}
.dash-stat-change.up { color: #10b981; }
.dash-stat-change.down { color: #ef4444; }
.dash-stat-change i { font-size: 0.6rem; margin-right: 2px; }

/* Birthday Section */
.dash-birthday-section {
    border-radius: var(--radius-lg);
    border: none;
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 40%, #faf5ff 100%);
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 20px rgba(55, 48, 163, 0.12), 0 1px 4px rgba(55, 48, 163, 0.08);
}
.dash-birthday-section::after {
    content: '\1F382';
    position: absolute;
    bottom: -10px;
    right: 20px;
    font-size: 4rem;
    opacity: 0.06;
    pointer-events: none;
}
.dash-birthday-header {
    padding: 0.85rem 1.25rem;
    background: var(--sidebar-bg);
    color: #fff;
    position: relative;
    overflow: hidden;
}
.dash-birthday-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -10%;
    width: 60px;
    height: 200%;
    background: rgba(255,255,255,0.08);
    transform: rotate(15deg);
    animation: headerShimmer 4s ease-in-out infinite;
}
@keyframes headerShimmer {
    0%, 100% { left: -10%; }
    50% { left: 110%; }
}
.dash-birthday-header .badge {
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(255,255,255,0.2) !important;
    color: #fff !important;
    backdrop-filter: blur(4px);
}
.dash-birthday-icon {
    font-size: 1.25rem;
    line-height: 1;
}
.dash-birthday-body {
    padding: 1rem 1.25rem;
}
.dash-birthday-card {
    background: #fff;
    border: 1px solid #ddd6fe;
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    position: relative;
    overflow: hidden;
    min-width: 220px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.dash-birthday-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.18);
}
.dash-birthday-card:hover .dash-bday-avatar,
.dash-birthday-card:hover .dash-bday-avatar-ph {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}
.dash-birthday-card.today {
    background: linear-gradient(135deg, #fdf2f8, #fce7f3, #faf5ff);
    box-shadow: 0 0 0 2px rgba(236, 72, 153, 0.12);
    animation: todayPulse 3s ease-in-out infinite;
}
@keyframes todayPulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(236, 72, 153, 0.12); }
    50% { box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.08), 0 4px 15px rgba(236, 72, 153, 0.12); }
}
.dash-birthday-card.today::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ec4899, #8b5cf6, #6366f1, #06b6d4);
    background-size: 200% 100%;
    animation: rainbowSlide 3s linear infinite;
}
@keyframes rainbowSlide {
    0% { background-position: 0% 0; }
    100% { background-position: 200% 0; }
}
.dash-birthday-card.past {
    opacity: 0.75;
}
.dash-birthday-card.past:hover { opacity: 1; }
.dash-birthday-card.upcoming { }
.dash-bday-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #c4b5fd;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.dash-bday-avatar-ph {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #8b5cf6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.dash-bday-hat {
    position: absolute;
    top: -6px;
    right: -4px;
    font-size: 1rem;
    animation: bdayBounce 1s ease infinite;
}
@keyframes bdayBounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-3px) rotate(10deg); }
}
.confetti-dots::before,
.confetti-dots::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: confettiFall 2s ease infinite;
}
.confetti-dots::before {
    background: #ec4899;
    top: 8px;
    right: 15px;
    animation-delay: 0s;
}
.confetti-dots::after {
    background: #6366f1;
    top: 12px;
    right: 35px;
    animation-delay: 0.5s;
}
/* Custom button colors */
.btn-purple { background: #7c3aed; border-color: #7c3aed; color: #fff; }
.btn-purple:hover, .btn-purple:focus { background: #6d28d9; border-color: #6d28d9; color: #fff; }
.btn-teal { background: #0d9488; border-color: #0d9488; color: #fff; }
.btn-teal:hover, .btn-teal:focus { background: #0f766e; border-color: #0f766e; color: #fff; }
.btn-maroon { background: #800020; border-color: #800020; color: #fff; }
.btn-maroon:hover, .btn-maroon:focus { background: #6b001a; border-color: #6b001a; color: #fff; }

/* Quick Action Buttons */
.dash-quick-btn {
    padding: 0.5rem 1.15rem;
    font-weight: 600;
    font-size: 0.88rem;
    border-radius: var(--radius-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.dash-quick-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
    filter: brightness(1.1);
}
.dash-quick-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

@keyframes confettiFall {
    0% { opacity: 1; transform: translateY(0) rotate(0deg); }
    50% { opacity: 0.7; transform: translateY(4px) rotate(180deg); }
    100% { opacity: 1; transform: translateY(0) rotate(360deg); }
}

@media print {
    .sidebar-mini, .sidebar-expanded, .sidebar-overlay, .top-navbar, .no-print { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .content-wrapper { padding: 0 !important; }
    .modal-footer, .btn-close { display: none !important; }
    .employee-header, .badge, .bg-success, .bg-danger, .bg-warning, .bg-secondary, .table th {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
