/* =====================================================================
   EOD CorpBoard - Modern Enterprise Admin Stylesheet
   Refined tables, glassmorphic cards, skeleton loaders, and status pills
   ===================================================================== */

:root, [data-theme="dark"], .dark {
    --admin-card-bg: rgba(22, 27, 34, 0.85);
    --admin-card-border: rgba(255, 255, 255, 0.08);
    --admin-card-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04);
    --admin-th-bg: #0f172a;
    --admin-th-color: #94a3b8;
    --admin-border-subtle: rgba(255, 255, 255, 0.06);
    --admin-row-hover: rgba(56, 189, 248, 0.04);
    --admin-text-main: #f8fafc;
    --admin-text-muted: #94a3b8;
    --admin-code-bg: rgba(255, 255, 255, 0.06);
    --admin-code-border: rgba(255, 255, 255, 0.1);
    --admin-code-color: #cbd5e1;
    --admin-role-bg: rgba(56, 189, 248, 0.08);
    --admin-role-border: rgba(56, 189, 248, 0.2);
    --admin-role-color: #38bdf8;
    --admin-btn-sec-bg: rgba(255, 255, 255, 0.05);
    --admin-btn-sec-border: rgba(255, 255, 255, 0.12);
    --admin-btn-sec-color: #f1f5f9;
}

[data-theme="light"], .light {
    --admin-card-bg: #ffffff;
    --admin-card-border: #e2e8f0;
    --admin-card-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    --admin-th-bg: #f8fafc;
    --admin-th-color: #475569;
    --admin-border-subtle: #f1f5f9;
    --admin-row-hover: rgba(14, 165, 233, 0.05);
    --admin-text-main: #0f172a;
    --admin-text-muted: #64748b;
    --admin-code-bg: #f1f5f9;
    --admin-code-border: #e2e8f0;
    --admin-code-color: #475569;
    --admin-role-bg: #f0f9ff;
    --admin-role-border: #bae6fd;
    --admin-role-color: #0369a1;
    --admin-btn-sec-bg: #ffffff;
    --admin-btn-sec-border: #cbd5e1;
    --admin-btn-sec-color: #334155;
}

/* =========================
   Admin Page Layout & Titles
   ========================= */
.admin-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 14px;
}

.admin-page-title {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: var(--admin-text-main) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin: 0 !important;
    letter-spacing: -0.015em !important;
}

.admin-page-title i {
    color: #0284c7 !important;
    font-size: 20px !important;
}

[data-theme="dark"] .admin-page-title i,
.dark .admin-page-title i {
    color: #38bdf8 !important;
}

/* =========================
   Modern Glassmorphic Card
   ========================= */
.card.dark-card {
    background: var(--admin-card-bg) !important;
    border: 1px solid var(--admin-card-border) !important;
    box-shadow: var(--admin-card-shadow) !important;
    border-radius: 14px !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 22px;
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

/* =========================
   Action Toolbars & Buttons
   ========================= */
.admin-action-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-primary-action {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
    border: 1px solid rgba(56, 189, 248, 0.4) !important;
    color: #ffffff !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer !important;
    text-decoration: none !important;
    outline: none !important;
}

.btn-primary-action:hover {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.45) !important;
    color: #ffffff !important;
}

.btn-secondary-action {
    background: var(--admin-btn-sec-bg) !important;
    border: 1px solid var(--admin-btn-sec-border) !important;
    color: var(--admin-btn-sec-color) !important;
    padding: 8px 14px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
    text-decoration: none !important;
    outline: none !important;
}

.btn-secondary-action:hover {
    background: rgba(56, 189, 248, 0.08) !important;
    color: #0284c7 !important;
    border-color: rgba(56, 189, 248, 0.4) !important;
    transform: translateY(-1px) !important;
}

[data-theme="dark"] .btn-secondary-action:hover,
.dark .btn-secondary-action:hover {
    color: #38bdf8 !important;
}

/* =========================
   Generic Admin Table
   ========================= */
.table-wrapper {
    width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 10px !important;
    border: 1px solid var(--admin-border-subtle) !important;
    background: transparent !important;
}

.table-wrapper table {
    width: 100% !important;
    min-width: 650px;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    margin-bottom: 0 !important;
}

.table-wrapper thead th,
.light .table-wrapper thead th,
[data-theme="light"] .table-wrapper thead th,
.dark .table-wrapper thead th,
[data-theme="dark"] .table-wrapper thead th {
    background: var(--admin-th-bg) !important;
    color: var(--admin-th-color) !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.07em !important;
    padding: 13px 16px !important;
    border-bottom: 1px solid var(--admin-border-subtle) !important;
    border-top: none !important;
    user-select: none !important;
    vertical-align: middle !important;
}

.table-wrapper thead th i {
    opacity: 0.8 !important;
    font-size: 11.5px !important;
}

.table-wrapper thead th.sortable,
.table-wrapper thead th[style*="cursor:pointer"] {
    cursor: pointer !important;
    transition: color 0.15s ease !important;
}

.table-wrapper thead th.sortable:hover,
.table-wrapper thead th[style*="cursor:pointer"]:hover {
    color: #38bdf8 !important;
}

.table-wrapper tbody tr,
.light .table-wrapper tbody tr,
[data-theme="light"] .table-wrapper tbody tr,
.dark .table-wrapper tbody tr,
[data-theme="dark"] .table-wrapper tbody tr {
    transition: background 0.18s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border-bottom: 1px solid var(--admin-border-subtle) !important;
    background: transparent !important;
}

.table-wrapper tbody tr:last-child {
    border-bottom: none !important;
}

.table-wrapper tbody tr:hover,
.light .table-wrapper tbody tr:hover,
[data-theme="light"] .table-wrapper tbody tr:hover,
.dark .table-wrapper tbody tr:hover,
[data-theme="dark"] .table-wrapper tbody tr:hover {
    background: var(--admin-row-hover) !important;
}

.table-wrapper td,
.light .table-wrapper td,
[data-theme="light"] .table-wrapper td,
.dark .table-wrapper td,
[data-theme="dark"] .table-wrapper td {
    max-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    padding: 12px 16px !important;
    vertical-align: middle !important;
    color: var(--admin-text-main) !important;
    font-size: 13.5px !important;
    border: none !important;
}

/* =========================
   Logs Table — no truncation
   ========================= */
.table-wrapper.logs-table-wrapper {
    overflow-y: auto !important;
}

.table-wrapper.logs-table-wrapper table {
    table-layout: auto !important;
}

.table-wrapper.logs-table-wrapper th,
.table-wrapper.logs-table-wrapper td,
.light .table-wrapper.logs-table-wrapper th,
.light .table-wrapper.logs-table-wrapper td,
[data-theme="light"] .table-wrapper.logs-table-wrapper th,
[data-theme="light"] .table-wrapper.logs-table-wrapper td,
.dark .table-wrapper.logs-table-wrapper th,
.dark .table-wrapper.logs-table-wrapper td,
[data-theme="dark"] .table-wrapper.logs-table-wrapper th,
[data-theme="dark"] .table-wrapper.logs-table-wrapper td {
    max-width: none !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
}

/* Column helpers */
.table-wrapper .col-actions,
.table-wrapper td.col-actions,
.table-wrapper th.col-actions,
.light .table-wrapper td.col-actions,
.light .table-wrapper th.col-actions,
[data-theme="light"] .table-wrapper td.col-actions,
[data-theme="light"] .table-wrapper th.col-actions,
.dark .table-wrapper td.col-actions,
.dark .table-wrapper th.col-actions,
[data-theme="dark"] .table-wrapper td.col-actions,
[data-theme="dark"] .table-wrapper th.col-actions {
    min-width: 130px !important;
    max-width: none !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    text-align: center !important;
}

.table-wrapper .col-status {
    width: 105px !important;
    min-width: 105px !important;
    text-align: center !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

/* =========================
   Employee Cell Typography
   ========================= */
.emp-avatar-circle {
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 2px solid rgba(56, 189, 248, 0.25) !important;
    flex-shrink: 0 !important;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: auto;
    transform: translateZ(0);
}

.emp-details-wrap {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    min-width: 0 !important;
}

.emp-name-text {
    font-weight: 600 !important;
    color: var(--admin-text-main) !important;
    font-size: 13.5px !important;
    line-height: 1.25 !important;
}

.emp-code-pill {
    display: inline-block !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    color: var(--admin-code-color) !important;
    background: var(--admin-code-bg) !important;
    border: 1px solid var(--admin-code-border) !important;
    padding: 1px 6px !important;
    border-radius: 4px !important;
    margin-top: 2px !important;
    width: fit-content !important;
}

.emp-email-text {
    color: var(--admin-text-muted) !important;
    font-size: 13px !important;
}

.emp-role-pill {
    display: inline-block !important;
    padding: 3px 10px !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    background: var(--admin-role-bg) !important;
    border: 1px solid var(--admin-role-border) !important;
    color: var(--admin-role-color) !important;
    white-space: nowrap !important;
}

/* =========================
   Status Pills & Glow Badges
   ========================= */
.status-pill {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 4px 11px !important;
    border-radius: 9999px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em !important;
    line-height: 1 !important;
}

.status-pill.active {
    background: rgba(16, 185, 129, 0.12) !important;
    color: #10b981 !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

[data-theme="dark"] .status-pill.active,
.dark .status-pill.active {
    color: #34d399 !important;
}

.status-pill.inactive {
    background: rgba(244, 63, 94, 0.12) !important;
    color: #e11d48 !important;
    border: 1px solid rgba(244, 63, 94, 0.3) !important;
}

[data-theme="dark"] .status-pill.inactive,
.dark .status-pill.inactive {
    color: #fb7185 !important;
}

.status-dot {
    width: 6px !important;
    height: 6px !important;
    border-radius: 50% !important;
    background-color: currentColor !important;
    box-shadow: 0 0 8px currentColor !important;
    display: inline-block !important;
    flex-shrink: 0 !important;
}

/* =========================
   Micro Action Buttons
   ========================= */
.actions-group {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    justify-content: center !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
}

.btn-action-edit,
.btn-action-delete,
.btn-action-info {
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    border-radius: 7px !important;
    font-size: 13px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1) !important;
    outline: none !important;
}

.btn-action-edit {
    background: rgba(2, 132, 199, 0.08) !important;
    border: 1px solid rgba(2, 132, 199, 0.25) !important;
    color: #0284c7 !important;
}

[data-theme="dark"] .btn-action-edit,
.dark .btn-action-edit {
    background: rgba(56, 189, 248, 0.1) !important;
    border-color: rgba(56, 189, 248, 0.3) !important;
    color: #38bdf8 !important;
}

.btn-action-edit:hover {
    background: #0284c7 !important;
    color: #ffffff !important;
    border-color: #0284c7 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35) !important;
}

.btn-action-delete {
    background: rgba(225, 29, 72, 0.08) !important;
    border: 1px solid rgba(225, 29, 72, 0.25) !important;
    color: #e11d48 !important;
}

[data-theme="dark"] .btn-action-delete,
.dark .btn-action-delete {
    background: rgba(244, 63, 94, 0.1) !important;
    border-color: rgba(244, 63, 94, 0.3) !important;
    color: #fb7185 !important;
}

.btn-action-delete:hover {
    background: #e11d48 !important;
    color: #ffffff !important;
    border-color: #e11d48 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.35) !important;
}

.btn-action-info {
    background: rgba(147, 51, 234, 0.08) !important;
    border: 1px solid rgba(147, 51, 234, 0.25) !important;
    color: #9333ea !important;
}

[data-theme="dark"] .btn-action-info,
.dark .btn-action-info {
    background: rgba(168, 85, 247, 0.1) !important;
    border-color: rgba(168, 85, 247, 0.3) !important;
    color: #c084fc !important;
}

.btn-action-info:hover {
    background: #9333ea !important;
    color: #ffffff !important;
    border-color: #9333ea !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.35) !important;
}

/* =========================
   Skeleton Shimmer Engine
   ========================= */
@keyframes skeleton-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-bone {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.03) 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 6px;
    display: inline-block;
}

[data-theme="light"] .skeleton-bone,
.light .skeleton-bone {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.04) 0%, rgba(0, 0, 0, 0.09) 50%, rgba(0, 0, 0, 0.04) 100%);
    background-size: 200% 100%;
}

.skeleton-cell {
    padding: 12px 14px !important;
    vertical-align: middle !important;
}

.skeleton-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50% !important;
    flex-shrink: 0;
}

.skeleton-text {
    height: 14px;
    margin: 4px 0;
    border-radius: 4px;
    display: block;
}

.skeleton-w-50 { width: 50%; }
.skeleton-w-60 { width: 60%; }
.skeleton-w-75 { width: 75%; }
.skeleton-w-85 { width: 85%; }

.skeleton-badge {
    width: 68px;
    height: 22px;
    border-radius: 20px;
    display: inline-block;
}

.skeleton-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-block;
}

.skeleton-avatar-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.skeleton-actions-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* =========================
   Modern Empty State Card
   ========================= */
.modern-empty-state {
    padding: 44px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.modern-empty-state .empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #64748b;
    margin-bottom: 4px;
}

.modern-empty-state .empty-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--admin-text-main);
    margin: 0;
}

.modern-empty-state .empty-subtitle {
    font-size: 13px;
    color: var(--admin-text-muted);
    max-width: 320px;
    margin: 0;
    line-height: 1.5;
}

/* =========================
   Modern Pagination Controls
   ========================= */
.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.pagination button {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--admin-card-border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--admin-text-muted);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.18s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pagination button:hover:not(:disabled) {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.35);
}

.pagination button.active-page,
.pagination button.btn-success {
    background: #0284c7 !important;
    color: #ffffff !important;
    border-color: #0284c7 !important;
    font-weight: 600;
    box-shadow: 0 0 12px rgba(2, 132, 199, 0.4);
}

.pagination button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.pagination-ellipsis {
    min-width: 34px;
    height: 34px;
    padding: 0 6px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--admin-text-muted, #94a3b8);
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.18s ease;
}

.pagination-ellipsis:hover:not(:disabled) {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.35);
}

.pagination-ellipsis:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* =========================
   Filter Bar & Inputs
   ========================= */
.form-control-dark,
.form-select-dark {
    background-color: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f8fafc;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13.5px;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
    width: 100%;
}

.form-control-dark::placeholder,
.form-select-dark::placeholder {
    color: #64748b !important;
    opacity: 0.85;
}

.form-control-dark:focus,
.form-select-dark:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.22);
    background-color: rgba(15, 23, 42, 0.9);
}

[data-theme="light"] .form-control-dark,
[data-theme="light"] .form-select-dark,
.light .form-control-dark,
.light .form-select-dark {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

[data-theme="light"] .form-control-dark::placeholder,
[data-theme="light"] .form-select-dark::placeholder,
.light .form-control-dark::placeholder,
.light .form-select-dark::placeholder {
    color: #94a3b8 !important;
}

[data-theme="light"] .form-control-dark:focus,
[data-theme="light"] .form-select-dark:focus,
.light .form-control-dark:focus,
.light .form-select-dark:focus {
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.18) !important;
}

/* =====================================================================
   Enterprise Select2 Dropdown Styling (Dark & Light Theme)
   ===================================================================== */
.select2-container {
    width: 100% !important;
}

.select2-container--default .select2-selection--single {
    background-color: rgba(15, 23, 42, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 8px !important;
    height: 38px !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 8px !important;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s !important;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.22) !important;
    background-color: rgba(15, 23, 42, 0.9) !important;
    outline: none !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #f8fafc !important;
    font-size: 13.5px !important;
    line-height: 36px !important;
    padding-left: 4px !important;
    padding-right: 24px !important;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #64748b !important;
}

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

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #94a3b8 transparent transparent transparent !important;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #38bdf8 transparent !important;
}

.select2-container--default .select2-selection--single .select2-selection__clear {
    color: #94a3b8 !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    margin-right: 18px !important;
    line-height: 36px !important;
}

.select2-container--default .select2-selection--single .select2-selection__clear:hover {
    color: #ef4444 !important;
}

.select2-container--default.select2-container--disabled .select2-selection--single {
    background-color: rgba(15, 23, 42, 0.35) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
    opacity: 0.55 !important;
    cursor: not-allowed !important;
}

/* Select2 Dropdown Menu */
.select2-dropdown {
    background-color: #0f172a !important;
    border: 1px solid rgba(56, 189, 248, 0.3) !important;
    border-radius: 8px !important;
    box-shadow: 0 14px 35px -5px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
    z-index: 1065 !important;
    overflow: hidden !important;
}

.select2-search--dropdown {
    padding: 8px !important;
    background-color: rgba(15, 23, 42, 0.95) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.select2-search--dropdown .select2-search__field {
    background-color: rgba(30, 41, 59, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #f8fafc !important;
    border-radius: 6px !important;
    padding: 6px 10px !important;
    font-size: 13px !important;
    width: 100% !important;
    outline: none !important;
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25) !important;
}

.select2-results__options {
    max-height: 220px !important;
    padding: 4px 0 !important;
}

.select2-results__option {
    padding: 8px 14px !important;
    font-size: 13px !important;
    color: #cbd5e1 !important;
    transition: background-color 0.15s ease, color 0.15s ease !important;
}

.select2-results__option--highlighted[aria-selected] {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
    color: #ffffff !important;
}

.select2-results__option[aria-selected="true"] {
    background-color: rgba(56, 189, 248, 0.12) !important;
    color: #38bdf8 !important;
    font-weight: 600 !important;
}

.select2-results__message {
    color: #94a3b8 !important;
    font-size: 12.5px !important;
    padding: 10px 14px !important;
}

/* Light Theme Select2 Overrides */
[data-theme="light"] .select2-container--default .select2-selection--single,
.light .select2-container--default .select2-selection--single {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
}

[data-theme="light"] .select2-container--default .select2-selection--single .select2-selection__rendered,
.light .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #0f172a !important;
}

[data-theme="light"] .select2-container--default .select2-selection--single .select2-selection__placeholder,
.light .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #94a3b8 !important;
}

[data-theme="light"] .select2-dropdown,
.light .select2-dropdown {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.12) !important;
}

[data-theme="light"] .select2-search--dropdown,
.light .select2-search--dropdown {
    background-color: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .select2-search--dropdown .select2-search__field,
.light .select2-search--dropdown .select2-search__field {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

[data-theme="light"] .select2-results__option,
.light .select2-results__option {
    color: #334155 !important;
}

[data-theme="light"] .select2-results__option[aria-selected="true"],
.light .select2-results__option[aria-selected="true"] {
    background-color: #f0f9ff !important;
    color: #0284c7 !important;
}

/* Select2 portal wrapper */
.s2-outer-wrapper {
    box-sizing: border-box !important;
}

/* =====================================================================
   Production-Grade Enterprise Modal System
   ===================================================================== */
.custom-modal-overlay {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0, 0, 0, 0.72) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 1050 !important;
    padding: 1rem !important;
    overflow-y: auto !important;
}

.custom-modal-animation {
    animation: modalSpringIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@keyframes modalSpringIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(-8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.custom-modal-overlay .modal-dialog {
    max-height: calc(100vh - 2rem) !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    margin: auto !important;
}

.custom-modal-overlay .modal-content {
    background: #161b22 !important;
    color: #f8fafc !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 12px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
    display: flex !important;
    flex-direction: column !important;
    max-height: calc(100vh - 2.5rem) !important;
    overflow: hidden !important;
}

.custom-modal-overlay .modal-header {
    background: rgba(255, 255, 255, 0.03) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 16px 22px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-shrink: 0 !important;
}

.custom-modal-overlay .modal-header .modal-title {
    font-size: 17px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin: 0 !important;
}

.custom-modal-overlay .modal-body {
    padding: 22px !important;
    overflow-y: auto !important;
    max-height: calc(85vh - 130px) !important;
    -webkit-overflow-scrolling: touch !important;
}

.custom-modal-overlay .modal-footer {
    background: rgba(255, 255, 255, 0.02) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 14px 22px !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 10px !important;
    flex-shrink: 0 !important;
}

/* ── Shared Admin Management Modal Sizing (Matches Employee Management) ── */
.custom-modal-overlay .modal-dialog.employee-modal-dialog,
.employee-modal-dialog {
    max-width: 1280px !important;
    width: 95% !important;
    max-height: 94vh !important;
    margin: auto !important;
}

.custom-modal-overlay .modal-content.employee-modal-content,
.employee-modal-content {
    max-height: 94vh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.custom-modal-overlay .modal-body.employee-modal-body,
.employee-modal-body {
    padding: 20px 24px !important;
    overflow-y: auto !important;
    max-height: calc(94vh - 75px) !important;
    flex: 1 1 auto !important;
    -webkit-overflow-scrolling: touch !important;
}

/* Light Theme Modal Overrides */
[data-theme="light"] .custom-modal-overlay .modal-content,
.light .custom-modal-overlay .modal-content {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15) !important;
}

[data-theme="light"] .custom-modal-overlay .modal-header,
.light .custom-modal-overlay .modal-header {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .custom-modal-overlay .modal-header .modal-title,
.light .custom-modal-overlay .modal-header .modal-title {
    color: #0f172a !important;
}

[data-theme="light"] .custom-modal-overlay .modal-footer,
.light .custom-modal-overlay .modal-footer {
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
}

/* Close button polish */
.custom-modal-overlay .btn-close-white,
.btn-close-custom {
    opacity: 0.75 !important;
    transition: opacity 0.15s ease, transform 0.15s ease !important;
    cursor: pointer !important;
}

.custom-modal-overlay .btn-close-white:hover,
.btn-close-custom:hover {
    opacity: 1 !important;
    transform: scale(1.1) !important;
}

/* Form Groups inside Modals */
.custom-modal-overlay .form-label,
.custom-modal-overlay label {
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #cbd5e1 !important;
    margin-bottom: 6px !important;
    display: block !important;
}

[data-theme="light"] .custom-modal-overlay .form-label,
[data-theme="light"] .custom-modal-overlay label,
.light .custom-modal-overlay .form-label,
.light .custom-modal-overlay label {
    color: #334155 !important;
}

/* Form actions inside modals */
.form-actions {
    display: flex !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    margin-top: 20px !important;
}

.btn-save {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border: 1px solid rgba(16, 185, 129, 0.4) !important;
    color: #ffffff !important;
    padding: 8px 18px !important;
    border-radius: 8px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-save:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35) !important;
}

.btn-save:disabled {
    opacity: 0.55 !important;
    cursor: not-allowed !important;
}

.btn-cancel {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    border: 1px solid rgba(239, 68, 68, 0.4) !important;
    color: #ffffff !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-cancel:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35) !important;
}

/* Delete confirmation button */
.btn-delete {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    border: 1px solid rgba(239, 68, 68, 0.4) !important;
    color: #ffffff !important;
    padding: 7px 16px !important;
    border-radius: 7px !important;
    font-weight: 600 !important;
    font-size: 13.5px !important;
    cursor: pointer !important;
    transition: all 0.18s ease !important;
}

.btn-delete:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35) !important;
}

/* =========================
   Label/Value Info Table
   ========================= */
.label-cell {
    background-color: #1e293b;
    color: #e2e8f0;
    font-weight: 600;
    width: 40%;
    white-space: nowrap;
}

.value-cell {
    background-color: #0f172a;
    color: #f8fafc;
    word-break: break-word;
}

.custom-info-table .label-cell {
    background-color: #1e293b;
    color: #e2e8f0;
    font-weight: 600;
    width: 40%;
    white-space: nowrap;
}

.custom-info-table .value-cell {
    background-color: #0f172a;
    color: #f8fafc;
    word-break: break-word;
}

/* =========================
   Avatar Styling
   ========================= */
.avatar-wrapper {
    position: relative;
    width: 130px;
    height: 130px;
}

.avatar-img {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #444;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: auto;
    transform: translateZ(0);
}

.avatar-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

span.emp-img {
    padding-right: 5px;
}

.searchBox {
    width: unset;
}

/* =========================
   Responsive Admin Layout
   ========================= */
@media (max-width: 768px) {
    .card.dark-card {
        padding: 14px !important;
        border-radius: 10px !important;
    }

    .admin-page-header {
        margin-bottom: 14px;
        gap: 10px;
    }

    .admin-page-title {
        font-size: 18px !important;
    }

    .admin-action-toolbar {
        width: 100%;
        gap: 8px;
    }

    .admin-action-toolbar .btn-primary-action,
    .admin-action-toolbar .btn-secondary-action {
        padding: 6px 12px !important;
        font-size: 12px !important;
    }

    .pagination {
        justify-content: center !important;
    }
}

@media (max-width: 576px) {
    .admin-page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-action-toolbar {
        display: flex;
        flex-wrap: wrap;
        width: 100%;
    }
}
