/* ================================================================
   Inventory & Manufacturing Management System - Main Stylesheet
   Theme: Dark Sidebar + Clean White Content
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: #6366f1;
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;
    --sidebar-width: 260px;
    --header-height: 64px;
    --accent: #6366f1;
    --accent-dark: #4f46e5;
    --accent-light: #818cf8;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --bg-main: #f1f5f9;
    --card-bg: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --radius: 0.75rem;
    --radius-sm: 0.5rem;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'Inter', sans-serif; font-size: 14px; color: var(--text-primary); background: var(--bg-main); }

/* ── Layout ─────────────────────────────────────── */
.app-wrapper { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ─────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width .3s ease;
    z-index: 100;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #334155; border-radius: 2px; }

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid #1e293b;
    text-decoration: none;
}
.sidebar-logo .logo-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: white; flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99,102,241,0.4);
}
.sidebar-logo .logo-text { color: white; font-weight: 700; font-size: 13px; line-height: 1.3; }
.sidebar-logo .logo-sub { color: var(--sidebar-text); font-size: 10px; margin-top: 2px; }

.nav-section { padding: 8px 0; }
.nav-label {
    padding: 12px 20px 6px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #475569;
}
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    position: relative;
}
.nav-item:hover { background: var(--sidebar-hover); color: #e2e8f0; }
.nav-item.active { background: rgba(99,102,241,0.15); color: var(--sidebar-text-active); border-left-color: var(--accent); }
.nav-item i { width: 18px; text-align: center; font-size: 15px; flex-shrink: 0; }
.nav-item .badge-count {
    margin-left: auto; background: var(--danger);
    color: white; font-size: 10px; font-weight: 700;
    padding: 2px 7px; border-radius: 10px;
}

/* ── Main Content ─────────────────────────────────── */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ── Header ─────────────────────────────────────── */
.app-header {
    height: var(--header-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center;
    padding: 0 24px;
    flex-shrink: 0;
    box-shadow: var(--shadow);
    gap: 16px;
}
.header-logo { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.header-logo img { height: 36px; }
.header-logo .random-logo {
    width: 40px; height: 40px; border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 800; font-size: 16px;
    box-shadow: 0 4px 12px rgba(99,102,241,0.35);
}
.header-logo .brand-text { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.header-logo .brand-sub { font-size: 10px; color: var(--text-secondary); }

.header-title {
    flex: 1; text-align: center;
    font-size: 16px; font-weight: 600; color: var(--text-primary);
}

.header-actions { display: flex; align-items: center; gap: 12px; min-width: 160px; justify-content: flex-end; }
.header-user { display: flex; align-items: center; gap: 8px; }
.user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 700; font-size: 14px;
}
.user-info .user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.user-info .user-role { font-size: 11px; color: var(--text-secondary); }

/* ── Page Content ─────────────────────────────────── */
.page-content { flex: 1; overflow-y: auto; padding: 24px; }
.page-content::-webkit-scrollbar { width: 6px; }
.page-content::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ── Cards ─────────────────────────────────────── */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
}
.card-title { font-size: 15px; font-weight: 600; color: var(--text-primary); margin: 0; }
.card-body { padding: 20px; }

/* ── Stat Cards ─────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card {
    background: var(--card-bg); border-radius: var(--radius); border: 1px solid var(--border);
    padding: 20px; display: flex; align-items: center; gap: 16px;
    box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
    width: 52px; height: 52px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
}
.stat-icon.indigo { background: rgba(99,102,241,0.12); color: var(--accent); }
.stat-icon.green { background: rgba(16,185,129,0.12); color: var(--success); }
.stat-icon.orange { background: rgba(245,158,11,0.12); color: var(--warning); }
.stat-icon.red { background: rgba(239,68,68,0.12); color: var(--danger); }
.stat-icon.blue { background: rgba(59,130,246,0.12); color: var(--info); }
.stat-icon.purple { background: rgba(139,92,246,0.12); color: #8b5cf6; }
.stat-value { font-size: 24px; font-weight: 700; color: var(--text-primary); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 4px; font-weight: 500; }

/* ── Badges ─────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600;
}
.badge-verified { background: rgba(16,185,129,0.12); color: var(--success); }
.badge-unverified { background: rgba(245,158,11,0.12); color: var(--warning); }
.badge-rejected { background: rgba(239,68,68,0.12); color: var(--danger); }
.badge-active { background: rgba(16,185,129,0.12); color: var(--success); }
.badge-inactive { background: rgba(100,116,139,0.12); color: var(--text-secondary); }
.badge-raw { background: rgba(59,130,246,0.12); color: var(--info); }
.badge-finished { background: rgba(139,92,246,0.12); color: #8b5cf6; }
.badge-both { background: rgba(99,102,241,0.12); color: var(--accent); }

/* ── Buttons ─────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 37px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-dark); color: white; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99,102,241,0.35); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #d97706; color: white; }
.btn-secondary { background: #f1f5f9; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-secondary:hover { background: #e2e8f0; color: var(--text-primary); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-outline { background: transparent; border: 1.5px solid var(--accent); color: var(--accent); }
.btn-outline:hover { background: var(--accent); color: white; }
.btn-icon { width: 32px; height: 32px; padding: 0; justify-content: center; border-radius: 8px; }

/* ── Tables ─────────────────────────────────────── */
.table-container { overflow-x: auto; border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table thead th { background: #f8fafc; color: var(--text-secondary); font-weight: 600; padding: 12px 14px; text-align: left; border-bottom: 2px solid var(--border); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.table tbody tr { border-bottom: 1px solid #f1f5f9; transition: background 0.15s; }
.table tbody tr:hover { background: #f8fafc; }
.table tbody td { padding: 12px 14px; color: var(--text-primary); vertical-align: middle; }
.table tbody tr:last-child { border-bottom: none; }

/* ── Forms ─────────────────────────────────────── */
.form-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; display: block; }
.form-control { width: 100%; padding: 9px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; font-family: inherit; color: var(--text-primary); background: white; transition: border-color .2s, box-shadow .2s; }
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,0.12); }
.form-control::placeholder { color: #94a3b8; }
select.form-control { cursor: pointer; }
.form-text { font-size: 11px; color: var(--text-secondary); margin-top: 4px; }
.text-danger { color: var(--danger); font-size: 11px; margin-top: 3px; display: block; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 16px; }
.form-group { margin-bottom: 16px; }

/* ── Alerts ─────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; }
.alert-success { background: rgba(16,185,129,0.1); color: #065f46; border-left: 4px solid var(--success); }
.alert-danger { background: rgba(239,68,68,0.1); color: #7f1d1d; border-left: 4px solid var(--danger); }
.alert-warning { background: rgba(245,158,11,0.1); color: #78350f; border-left: 4px solid var(--warning); }
.alert-info { background: rgba(59,130,246,0.1); color: #1e3a5f; border-left: 4px solid var(--info); }

/* ── Detail items ─────────────────────────────── */
.detail-table td:first-child { font-weight: 600; color: var(--text-secondary); width: 200px; padding-right: 16px; white-space: nowrap; }

/* ── Sub-items table ─────────────────────────── */
.items-table-wrapper { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.items-table { width: 100%; font-size: 13px; border-collapse: collapse; }
.items-table thead th { background: #f8fafc; padding: 10px 12px; font-weight: 600; color: var(--text-secondary); border-bottom: 1px solid var(--border); font-size: 11px; text-transform: uppercase; }
.items-table tbody td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; }
.items-table tbody tr:last-child td { border-bottom: none; }
.items-table tfoot td { padding: 10px 12px; background: #f8fafc; font-weight: 700; border-top: 2px solid var(--border); }

/* ── Page header ─────────────────────────────── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-header h1 { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.page-header p { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

/* ── Filter bar ─────────────────────────────── */
.filter-bar { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 20px; box-shadow: var(--shadow); }
.filter-bar form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filter-bar .form-group { margin-bottom: 0; min-width: 160px; }

/* ── Action buttons col ─────────────────────── */
.actions-col { display: flex; gap: 6px; align-items: center; white-space: nowrap; }

/* ── Login page ─────────────────────────────── */
.login-page {
    min-height: 100vh; background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.login-card {
    background: white; border-radius: 20px; padding: 40px; width: 100%; max-width: 420px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.4);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .logo-circle {
    width: 64px; height: 64px; border-radius: 18px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 12px; color: white; font-size: 28px;
    box-shadow: 0 8px 24px rgba(99,102,241,0.4);
}
.login-logo h1 { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.login-logo p { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* ── Responsive Controls & Overlay ──────────── */
.sidebar-logo-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    border-bottom: 1px solid #1e293b;
}

.sidebar-logo-container .sidebar-logo {
    border-bottom: none !important;
    flex-grow: 1;
    padding-right: 0 !important;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: #f1f5f9;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    font-size: 18px;
    color: var(--sidebar-text);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.sidebar-close:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
}

/* ── Responsive Media Queries ─────────────────── */
@media (max-width: 768px) {
    /* Overlay visible when active */
    .sidebar-overlay.active {
        display: block;
    }

    /* Modern slide-out transition for Sidebar */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        height: 100vh;
        width: var(--sidebar-width) !important;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        z-index: 1000 !important;
        box-shadow: none;
    }
    
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(15, 23, 42, 0.2);
    }

    .sidebar-close {
        display: inline-flex;
    }

    .sidebar-toggle {
        display: inline-flex;
    }

    /* App layout when sidebar is hidden */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    /* Fix header layout and overlap issues */
    .app-header {
        padding: 0 12px !important;
        gap: 8px !important;
        justify-content: space-between;
    }

    .header-logo {
        display: none !important; /* Hide logo in mobile view since it's already in sidebar */
    }

    .header-title {
        text-align: left !important;
        font-size: 14px !important;
        margin-left: 4px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex: 1;
    }

    .header-actions {
        min-width: auto !important;
        gap: 8px !important;
        flex-shrink: 0;
    }

    .header-user {
        gap: 4px !important;
    }

    .header-user .user-info {
        display: none !important; /* Hide name/role to save horizontal space and prevent overlap */
    }

    /* Stylize Logout Button for mobile */
    .header-actions form button {
        padding: 6px 8px !important;
        font-size: 0 !important; /* Hide text */
    }

    .header-actions form button i {
        font-size: 15px !important;
        margin-right: 0 !important;
    }

    /* Grids & Cards responsiveness */
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .page-content {
        padding: 16px !important;
    }

    /* Responsive filter bar adjustments */
    .filter-bar {
        padding: 12px !important;
    }

    .filter-bar form {
        flex-direction: column;
        align-items: stretch !important;
        gap: 8px !important;
    }

    .filter-bar .form-group {
        width: 100% !important;
        margin-bottom: 4px !important;
    }

    .filter-bar .form-group select,
    .filter-bar .form-group input {
        min-width: 100% !important;
        width: 100% !important;
    }

    .filter-bar button[type="submit"] {
        width: 100% !important;
        justify-content: center;
        padding: 10px !important;
        margin-top: 8px;
    }
}

@media (max-width: 480px) {
    .header-title {
        font-size: 13px !important;
    }
}

/* ── Utility ─────────────────────────────────── */
.text-right { text-align: right; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-secondary); }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.d-flex { display: flex; } .align-center { align-items: center; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.flex-wrap { flex-wrap: wrap; }
.w-100 { width: 100%; }
.me-auto { margin-right: auto; }

/* ── Dynamic row items ─────────────────────── */
.item-row { display: grid; gap: 8px; align-items: center; padding: 10px; background: #f8fafc; border-radius: var(--radius-sm); border: 1px solid var(--border); margin-bottom: 8px; }
.item-row.cols-5 { grid-template-columns: 2fr 1fr 1fr 1fr auto; }
.item-row.cols-4 { grid-template-columns: 2fr 1fr 1fr auto; }
.remove-btn { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 18px; padding: 2px 6px; border-radius: 4px; transition: background .2s; }
.remove-btn:hover { background: rgba(239,68,68,0.1); }

/* ── Totals row ─────────────────────────────── */
.totals-row { background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(139,92,246,0.06)); border: 1px solid rgba(99,102,241,0.2); border-radius: var(--radius-sm); padding: 14px 16px; display: flex; justify-content: flex-end; align-items: center; gap: 20px; margin-top: 12px; }
.totals-row .total-label { font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.totals-row .total-value { font-size: 18px; font-weight: 700; color: var(--accent); }

/* ── SweetAlert overrides ─────────────────── */
.swal2-popup { font-family: 'Inter', sans-serif !important; border-radius: 16px !important; }

/* ── DataTables override ─────────────────── */
.dataTables_wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 4px;
}

/* Align and space the top header row (length and filter) */
.dataTables_wrapper > .row:first-child {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 16px !important;
    margin-bottom: 8px !important;
}

.dataTables_wrapper > .row:first-child > div {
    width: auto !important;
    flex: 0 0 auto !important;
    max-width: 100% !important;
    padding: 0 !important;
}

/* Align and space the bottom footer row (info and pagination) */
.dataTables_wrapper > .row:last-child {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 16px !important;
    margin-top: 12px !important;
    padding-top: 12px !important;
    border-top: 1px solid var(--border) !important;
}

.dataTables_wrapper > .row:last-child > div {
    width: auto !important;
    flex: 0 0 auto !important;
    max-width: 100% !important;
    padding: 0 !important;
}

/* Remove default row margin issues */
.dataTables_wrapper .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Length menu styling */
.dataTables_length {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.dataTables_length label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-weight: 500;
}

.dataTables_length select {
    padding: 6px 32px 6px 12px !important;
    border: 1.5px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    font-size: 13px !important;
    color: var(--text-primary) !important;
    background-color: #fff !important;
    outline: none !important;
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.dataTables_length select:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Filter/Search styling */
.dataTables_filter {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    font-size: 13px;
}

.dataTables_filter label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 500;
    color: var(--text-secondary);
}

.dataTables_filter input {
    width: 220px !important;
    padding: 7px 12px !important;
    border: 1.5px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    font-size: 13px !important;
    color: var(--text-primary) !important;
    background-color: #fff !important;
    outline: none !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
}

.dataTables_filter input:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Table element spacing */
.dataTables_wrapper .dataTable {
    margin: 12px 0 !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
}

/* Info element styling */
.dataTables_info {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    padding-top: 0 !important;
}

/* Pagination container and buttons */
.dataTables_paginate {
    display: flex;
    justify-content: flex-end;
    padding-top: 0 !important;
}

.dataTables_paginate .pagination {
    display: inline-flex;
    padding-left: 0;
    list-style: none;
    border-radius: var(--radius-sm);
    gap: 4px;
    margin: 0;
}

.dataTables_paginate .page-item .page-link {
    position: relative;
    display: block;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    background-color: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm) !important;
    transition: all 0.2s;
    cursor: pointer;
}

.dataTables_paginate .page-item:hover .page-link {
    color: var(--text-primary);
    background-color: #e2e8f0;
    border-color: #cbd5e1;
}

.dataTables_paginate .page-item.active .page-link {
    z-index: 3;
    color: #fff !important;
    background-color: var(--accent) !important;
    border-color: var(--accent) !important;
    box-shadow: 0 2px 6px rgba(99,102,241,0.3) !important;
}

.dataTables_paginate .page-item.disabled .page-link {
    color: #cbd5e1 !important;
    pointer-events: none;
    background-color: #f8fafc;
    border-color: #e2e8f0;
    opacity: 0.6;
}

table.dataTable tbody tr:hover {
    background: #f8fafc !important;
}

/* ================================================================
   Select2 Global Responsive and Height Alignments
   ================================================================ */
.select2-container {
    width: 100% !important;
    max-width: 100% !important;
}

.select2-container--default .select2-selection--single {
    height: 38px !important;
    padding: 5px 12px !important;
    border: 1.5px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    background-color: #fff !important;
    transition: border-color .2s, box-shadow .2s;
    display: flex;
    align-items: center;
}

.select2-container--default .select2-selection--single:focus,
.select2-container--default.select2-container--focus .select2-selection--single {
    outline: none !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-primary) !important;
    font-size: 13px !important;
    font-family: inherit !important;
    padding-left: 0 !important;
    padding-right: 20px !important;
    line-height: normal !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px !important;
    right: 8px !important;
    width: 20px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--text-secondary) transparent transparent transparent !important;
    border-width: 5px 4px 0 4px !important;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent var(--text-secondary) transparent !important;
    border-width: 0 4px 5px 4px !important;
}

/* Select2 Dropdown list styling */
.select2-dropdown {
    border: 1.5px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: var(--shadow-md) !important;
    z-index: 9999 !important;
}

.select2-container--default .select2-results__option {
    padding: 8px 12px !important;
    font-size: 13px !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--accent) !important;
    color: #fff !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1.5px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    padding: 6px 10px !important;
    outline: none !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: var(--accent) !important;
}