/* ========================================
   Modern Payroll System UI - Arabic RTL
   Clean Blue & White Admin Theme
======================================== */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800&display=swap');

:root {
    /* Primary Blue Palette */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --primary-lighter: #60a5fa;
    --primary-bg: #eff6ff;

    /* Secondary Colors */
    --secondary: #0891b2;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;

    /* Light Theme Neutrals */
    --bg-body: #f8fafc;
    --bg-white: #ffffff;
    --bg-light: #f1f5f9;
    --bg-hover: #e2e8f0;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;

    /* Text Colors */
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-light: #64748b;

    /* Sidebar */
    --sidebar-bg: #1e3a5f;
    --sidebar-text: #e2e8f0;
    --sidebar-hover: rgba(255, 255, 255, 0.1);
    --sidebar-active: rgba(59, 130, 246, 0.3);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    direction: rtl;
    font-family: 'Tajawal', sans-serif;
    background: var(--bg-body);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ========================================
   Sidebar Navigation
======================================== */
.sidebar {
    position: fixed;
    right: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, #0f2744 100%);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    z-index: 100;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem 0.5rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
}

.sidebar-brand .logo {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.sidebar-brand h1 {
    font-size: 1.15rem;
    font-weight: 700;
    color: white;
}

.sidebar-brand span {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

.sidebar-nav {
    list-style: none;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sidebar-nav li {
    margin-bottom: 4px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
}

.sidebar-nav a::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--primary-light);
    border-radius: 3px;
    transition: height var(--transition-fast);
}

.sidebar-nav a:hover {
    background: var(--sidebar-hover);
    color: white;
}

.sidebar-nav a.active {
    background: var(--sidebar-active);
    color: white;
}

.sidebar-nav a.active::before {
    height: 55%;
}

.sidebar-nav .nav-icon {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    opacity: 0.85;
}

/* ========================================
   Main Content Area
======================================== */
.main-content {
    margin-right: 260px;
    padding: 2rem 2.5rem;
    min-height: 100vh;
    height: 100vh;
    overflow-y: auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 2px solid var(--border-color);
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-header h2 i {
    color: var(--primary);
    font-size: 1.25rem;
}

/* ========================================
   Cards
======================================== */
.card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: box-shadow var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-light);
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h3 i {
    color: var(--primary);
}

/* ========================================
   Buttons
======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: var(--text-primary);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.btn-info:hover {
    box-shadow: 0 6px 16px rgba(14, 165, 233, 0.4);
}

.btn-outline-danger {
    background: transparent;
    color: #ef4444;
    border: 1px solid #ef4444;
}

.btn-outline-danger:hover {
    background: #fef2f2;
    color: #dc2626;
    border-color: #dc2626;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    gap: 4px;
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.btn-sm {
    padding: 7px 14px;
    font-size: 0.8rem;
}

/* ========================================
   Tables
======================================== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

thead {
    background: var(--primary-bg);
}

th {
    padding: 14px 18px;
    text-align: right;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--primary-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--primary-light);
}

th:first-child {
    border-radius: 0 var(--radius-md) 0 0;
}

th:last-child {
    border-radius: var(--radius-md) 0 0 0;
}

td {
    padding: 14px 18px;
    text-align: right;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-white);
}

tbody tr {
    transition: all var(--transition-fast);
}

tbody tr:hover td {
    background: var(--primary-bg);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* ========================================
   Form Elements
======================================== */
.form-group {
    margin-bottom: 1.15rem;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 14px center;
    padding-left: 36px;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* ========================================
   Modals
======================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: fadeIn var(--transition-fast);
    overflow-y: auto;
    padding: 2rem 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    margin: 0 auto;
    padding: 1.75rem;
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 520px;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp var(--transition-normal);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-bg);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-content h3 i {
    color: var(--primary);
}

.modal-actions {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-light);
}

/* ========================================
   Alerts
======================================== */
.alert {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-weight: 500;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-xl);
    transition: transform var(--transition-normal);
    min-width: 280px;
}

.alert.show {
    transform: translateX(-50%) translateY(0);
}

.alert-success {
    background: var(--success);
    color: white;
}

.alert-danger {
    background: var(--danger);
    color: white;
}

/* ========================================
   Section Visibility
======================================== */
.section {
    display: none;
    animation: fadeInSection var(--transition-normal);
}

.section.active {
    display: block;
}

@keyframes fadeInSection {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Status Badges
======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.badge-primary {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

/* ========================================
   Payroll Controls
======================================== */
.payroll-controls {
    background: linear-gradient(135deg, var(--primary-bg) 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.payroll-controls h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========================================
   Scrollbar Styling
======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* ========================================
   Responsive Design
======================================== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(100%);
        transition: transform var(--transition-normal);
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-right: 0;
        padding: 1.5rem;
        padding-top: 5rem;
        /* Space for mobile header */
    }

    /* Mobile Header */
    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: var(--bg-white);
        padding: 0 1.5rem;
        z-index: 90;
        box-shadow: var(--shadow-sm);
        border-bottom: 1px solid var(--border-color);
    }

    .mobile-logo {
        font-weight: 700;
        font-size: 1.1rem;
        color: var(--primary-dark);
    }

    .btn-menu {
        background: transparent;
        border: none;
        font-size: 1.25rem;
        color: var(--text-primary);
        cursor: pointer;
        padding: 8px;
        border-radius: var(--radius-sm);
    }

    .btn-menu:hover {
        background: var(--bg-light);
    }

    /* Sidebar Overlay */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 95;
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-normal);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
    }

    .sidebar-overlay.open {
        opacity: 1;
        visibility: visible;
    }
}

/* ========================================
   Dashboard
======================================== */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.dash-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-lg);
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.dash-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.dash-card-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.dash-card-blue .dash-card-icon {
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
}

.dash-card-green .dash-card-icon {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.dash-card-amber .dash-card-icon {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.dash-card-red .dash-card-icon {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.dash-card-info {
    display: flex;
    flex-direction: column;
}

.dash-card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.dash-card-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 4px;
}

.dashboard-charts {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 1.25rem;
}

.chart-card {
    display: flex;
    flex-direction: column;
}

.chart-container {
    position: relative;
    height: 300px;
    flex: 1;
}

/* ========================================
   Reports
======================================== */
.report-output {
    padding: 1.5rem;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.report-output table {
    margin-top: 1rem;
}

.report-summary-row td {
    font-weight: 700 !important;
    background: var(--primary-bg) !important;
    color: var(--primary-dark) !important;
    border-top: 2px solid var(--primary) !important;
}

/* ========================================
   Pay Slip
======================================== */
.payslip {
    padding: 2rem;
    max-width: 700px;
    margin: 0 auto;
    font-family: 'Tajawal', sans-serif;
    direction: rtl;
}

.payslip-header {
    text-align: center;
    border-bottom: 3px double var(--primary);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.payslip-header h2 {
    color: var(--primary-dark);
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
}

.payslip-header p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.payslip-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
}

.payslip-info div {
    font-size: 0.9rem;
}

.payslip-info strong {
    color: var(--text-primary);
}

.payslip-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.payslip-table th,
.payslip-table td {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    text-align: right;
}

.payslip-table th {
    background: var(--primary-bg);
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.85rem;
}

.payslip-total {
    text-align: center;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--radius-md);
    font-size: 1.3rem;
    font-weight: 700;
}

.payslip-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px dashed var(--text-muted);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ========================================
   Print Styles
======================================== */
@media print {
    body * {
        visibility: hidden;
    }

    .print-area,
    .print-area * {
        visibility: visible;
    }

    .print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }

    .no-print {
        display: none !important;
    }
}

@media (max-width: 1024px) {
    .dashboard-charts {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1025px) {
    .mobile-header {
        display: none;
    }

    .sidebar-overlay {
        display: none;
    }
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .form-row .form-group {
        width: 100%;
        margin-bottom: 1rem;
    }

    .modal-content {
        width: 95%;
        margin: 1rem auto;
        padding: 1.25rem;
        max-height: calc(100vh - 2rem);
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .page-header .btn {
        width: 100%;
        justify-content: center;
    }

    /* Make tables responsive */
    .table-container {
        border: 1px solid var(--border-light);
    }
}

/* ========================================
   Working Days Calculator
======================================== */
.calc-result {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding: 1.25rem;
    background: var(--primary-bg);
    border-radius: var(--radius-md);
    border: 1px solid #bfdbfe;
}

.result-item {
    text-align: center;
    padding: 1rem;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.result-item.highlight {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.result-item .result-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    opacity: 0.85;
}

.result-item .result-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
}

.result-item.highlight .result-label,
.result-item.highlight .result-value {
    color: white;
}

.badge-secondary {
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
}

/* ========================================
   Pagination
======================================== */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    margin-top: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.pagination-buttons .btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 0.8rem;
}

.pagination-buttons .btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.pagination-buttons .btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-ellipsis {
    padding: 0 8px;
    color: var(--text-muted);
    font-weight: 600;
}

/* Pagination container for tables */
.pagination-container {
    margin-top: 0;
}

@media (max-width: 768px) {
    .pagination {
        flex-direction: column;
        text-align: center;
    }

    .pagination-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Select2 RTL Styling */
.select2-container {
    width: 100% !important;
}

.select2-container--default .select2-selection--single {
    height: 42px;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    direction: rtl;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 28px;
    padding-right: 0;
    padding-left: 20px;
    color: var(--text-primary);
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
    left: 8px;
    right: auto;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--text-muted);
}

.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.select2-dropdown {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    direction: rtl;
}

.select2-search--dropdown .select2-search__field {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    direction: rtl;
}

.select2-search--dropdown .select2-search__field:focus {
    outline: none;
    border-color: var(--primary);
}

.select2-results__option {
    padding: 10px 12px;
    color: var(--text-primary);
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--primary);
    color: white;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background: var(--bg-secondary);
}

/* Fix Select2 in modals */
.modal .select2-container {
    z-index: 10001;
}

.modal .select2-dropdown {
    z-index: 10002;
}

/* ========================================
   Bulk Payment Button Hover Effects
======================================== */
.btn[onclick*="openBulkPayModal"]:hover {
    transform: translateY(-2px) scale(1.02);
    filter: brightness(1.1);
}

.btn[onclick*="openBulkPayModal"]:active {
    transform: translateY(0) scale(0.98);
}

/* Success Button Hover (Green Gradient) */
button[onclick*="confirmBulkPay"].btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
}

/* Modal Content Animation */
.modal-content {
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Bulk Payment Modal Icon Pulse */
#bulkPayModal .modal-content>div:first-child>div:first-child {
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {

    0%,
    100% {
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    }

    50% {
        box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
    }
}