/* ==========================================================================
   1. BASE & RESET
   ========================================================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-size: 13px;
    color: #1E293B;
    background: linear-gradient(to bottom, #F8FAFC, #E2E8F0) !important;
    background-attachment: fixed !important;
    min-height: 100vh;
    line-height: 1.5;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #F1F5F9;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* ==========================================================================
   2. GENERAL LAYOUTS & CARDS
   ========================================================================== */
.page-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Elevated Panels */
.panel-elevated {
    border-radius: 20px;
    border: 1px solid #E2E8F0;
    background: linear-gradient(135deg, #FFFFFF, #F8FAFC);
    box-shadow: 0 8px 30px rgba(148, 163, 184, 0.08);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.panel-elevated:hover {
    box-shadow: 0 12px 40px rgba(148, 163, 184, 0.12);
}
.panel-elevated--blue { border-top: 4px solid #4285F4; }
.panel-elevated--green { border-top: 4px solid #34A853; }
.panel-elevated--red { border-top: 4px solid #EA4335; }
.panel-elevated--amber { border-top: 4px solid #FBBC05; }

/* Data Tables Specific Card */
.data-card {
    border-radius: 20px;
    border: 1px solid #E2E8F0;
    background: linear-gradient(135deg, #FFFFFF, #F8FAFC);
    box-shadow: 0 8px 30px rgba(148, 163, 184, 0.08);
    border-top: 4px solid #4285F4;
    overflow: hidden;
}
.data-card__header {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-bottom: 1px solid #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.data-card__header-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.data-card__header-title::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4285F4;
    box-shadow: 0 0 8px rgba(66, 133, 244, 0.4);
}
.data-card__body {
    padding: 1.5rem;
}

/* ==========================================================================
   3. DESIGN UTILITIES & COMPONENT ELEMENTS
   ========================================================================== */
/* Recessed Wells */
.well-recessed {
    background-color: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    box-shadow: inset 0 2px 4px rgba(148, 163, 184, 0.05);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.well-recessed:focus-within {
    border-color: #4285F4;
    box-shadow: inset 0 2px 4px rgba(148, 163, 184, 0.05), 0 0 0 3px rgba(66, 133, 244, 0.1);
}

/* Tactile Buttons */
.btn-tactile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.5rem 1.25rem;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: #FFFFFF;
    background: linear-gradient(135deg, #4285F4, #3B78E0);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05), 0 4px 12px rgba(66,133,244,0.15);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    outline: none;
    position: relative;
    overflow: hidden;
}
.btn-tactile::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.15), transparent);
    pointer-events: none;
}
.btn-tactile:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.08), 0 6px 16px rgba(66,133,244,0.2);
}
.btn-tactile:active {
    transform: scale(0.98) translateY(1px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 2px 6px rgba(66,133,244,0.1);
}
.btn-tactile--green {
    background: linear-gradient(135deg, #34A853, #2E9648);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05), 0 4px 12px rgba(52,168,83,0.15);
}
.btn-tactile--green:hover { box-shadow: 0 4px 8px rgba(0,0,0,0.08), 0 6px 16px rgba(52,168,83,0.2); }
.btn-tactile--green:active { box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 2px 6px rgba(52,168,83,0.1); }

.btn-tactile--red {
    background: linear-gradient(135deg, #EA4335, #D33B28);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05), 0 4px 12px rgba(234,67,53,0.15);
}
.btn-tactile--red:hover { box-shadow: 0 4px 8px rgba(0,0,0,0.08), 0 6px 16px rgba(234,67,53,0.2); }
.btn-tactile--red:active { box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 2px 6px rgba(234,67,53,0.1); }

.btn-tactile--amber {
    background: linear-gradient(135deg, #FBBC05, #E5A800);
    color: #1E293B;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05), 0 4px 12px rgba(251,188,5,0.15);
}
.btn-tactile--amber:hover { box-shadow: 0 4px 8px rgba(0,0,0,0.08), 0 6px 16px rgba(251,188,5,0.2); }
.btn-tactile--amber:active { box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 2px 6px rgba(251,188,5,0.1); }

/* Glass Display */
.glass-display {
    background: linear-gradient(180deg, #F0FDFA 0%, #E0F2FE 100%);
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    box-shadow: inset 0 1px 3px rgba(255,255,255,0.8), 0 2px 8px rgba(148, 163, 184, 0.06);
    padding: 1rem;
}

/* Status Indicators */
.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}
.status-indicator--success { background: #34A853; box-shadow: 0 0 12px rgba(52,168,83,0.4); }
.status-indicator--error { background: #EA4335; box-shadow: 0 0 12px rgba(234,67,53,0.4); }
.status-indicator--warning { background: #FBBC05; box-shadow: 0 0 12px rgba(251,188,5,0.4); }
.status-indicator--info { background: #4285F4; box-shadow: 0 0 12px rgba(66,133,244,0.4); }

/* Badges */
.badge-soft {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.25rem 0.75rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 20px;
    border: 1px solid transparent;
}
.badge-soft--success { background: #F0FDF4; color: #15803D; border-color: #BBF7D0; }
.badge-soft--secondary { background: #F1F5F9; color: #64748B; border-color: #E2E8F0; }

/* ==========================================================================
   4. DATA TABLES GENERAL ADAPTATION
   ========================================================================== */
.dataTables_scroll {
    border-radius: 16px;
    border: 1px solid #E2E8F0;
    background: #FFFFFF;
    box-shadow: inset 0 2px 4px rgba(148, 163, 184, 0.05);
    overflow: hidden;
}
.dataTables_scrollHead {
    background: linear-gradient(180deg, #F8FAFC 0%, #F1F5F9 100%);
}
.dataTables_scrollBody {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
}
.dataTables_scrollBody::-webkit-scrollbar { height: 6px; }
.dataTables_scrollBody::-webkit-scrollbar-track { background: #F1F5F9; }
.dataTables_scrollBody::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 3px; }
.dataTables_scrollBody::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

table {
    width: 100% !important;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.75rem;
}
thead th {
    background: linear-gradient(180deg, #F8FAFC 0%, #F1F5F9 100%);
    font-size: 0.65rem !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #475569;
    padding: 0.85rem 1rem !important;
    white-space: nowrap;
    border-bottom: 2px solid #E2E8F0;
    border-right: 1px solid #E2E8F0;
    text-align: left;
}
thead th:last-child { border-right: none; }

thead th.sorting, thead th.sorting_asc, thead th.sorting_desc {
    cursor: pointer;
    position: relative;
    padding-right: 1.75rem !important;
}
thead th.sorting::after, thead th.sorting_asc::after, thead th.sorting_desc::after {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 0.6rem;
    color: #94A3B8;
}
thead th.sorting::after { content: "\f0dc"; }
thead th.sorting_asc::after { content: "\f0de"; color: #4285F4; }
thead th.sorting_desc::after { content: "\f0dd"; color: #4285F4; }

tbody td {
    font-size: 0.75rem !important;
    padding: 0.75rem 1rem !important;
    white-space: nowrap;
    vertical-align: middle;
    color: #334155;
    border-bottom: 1px solid #F1F5F9;
    border-right: 1px solid #F1F5F9;
    font-family: 'Inter', system-ui, sans-serif;
    transition: background-color 0.15s ease;
}
tbody td:last-child { border-right: none; }
tbody tr:hover td { background-color: #F8FAFC; }
tbody tr:last-child td { border-bottom: none; }

.mono-data {
    font-family: 'JetBrains Mono', 'Roboto Mono', monospace;
    font-size: 0.7rem;
    font-weight: 500;
    color: #1E293B;
    background: #F1F5F9;
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
    border: 1px solid #E2E8F0;
}

/* DataTables Control Sizing */
.dataTables_wrapper .row:first-child { margin-bottom: 1rem !important; align-items: center; }
.dataTables_wrapper .row:last-child { margin-top: 1rem !important; align-items: center; }

div.dataTables_wrapper div.dataTables_length label {
    margin-bottom: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
div.dataTables_wrapper div.dataTables_length select {
    min-width: 80px !important;
    display: inline-block;
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #334155;
    background-color: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    box-shadow: inset 0 2px 4px rgba(148, 163, 184, 0.05);
    outline: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
div.dataTables_wrapper div.dataTables_length select:focus {
    border-color: #4285F4;
    box-shadow: inset 0 2px 4px rgba(148, 163, 184, 0.05), 0 0 0 3px rgba(66, 133, 244, 0.1);
}

.dataTables_filter { display: flex; justify-content: flex-end; }
.dataTables_filter label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.dataTables_filter input {
    width: 260px !important;
    padding: 0.5rem 1rem !important;
    font-size: 0.75rem !important;
    font-weight: 500;
    color: #334155;
    background-color: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    box-shadow: inset 0 2px 4px rgba(148, 163, 184, 0.05);
    outline: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.dataTables_filter input:focus {
    border-color: #4285F4;
    box-shadow: inset 0 2px 4px rgba(148, 163, 184, 0.05), 0 0 0 3px rgba(66, 133, 244, 0.1);
}
.dataTables_filter input::placeholder { color: #94A3B8; }

/* DT Buttons */
.dataTables_wrapper .dt-buttons .btn-success,
.dataTables_wrapper .dt-buttons button.btn-success {
    background: linear-gradient(135deg, #34A853, #2E9648) !important;
    border: none !important;
    color: #FFFFFF !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.5rem 1rem !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05), 0 4px 12px rgba(52,168,83,0.15) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    cursor: pointer;
}
.dataTables_wrapper .dt-buttons .btn-success::before,
.dataTables_wrapper .dt-buttons button.btn-success::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.15), transparent);
    pointer-events: none;
    border-radius: 12px;
}
.dataTables_wrapper .dt-buttons .btn-success:hover,
.dataTables_wrapper .dt-buttons button.btn-success:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.08), 0 6px 16px rgba(52,168,83,0.2) !important;
    background: linear-gradient(135deg, #34A853, #2E9648) !important;
    border-color: transparent !important;
    color: #FFFFFF !important;
}

/* Pagination Control */
div.dataTables_wrapper div.dataTables_paginate { margin-top: 0; text-align: right; }
div.dataTables_wrapper div.dataTables_paginate ul.pagination { justify-content: flex-end; flex-wrap: wrap; margin-bottom: 0; gap: 4px; }
div.dataTables_wrapper div.dataTables_paginate .page-item { margin: 0; }
div.dataTables_wrapper div.dataTables_paginate .page-item .page-link {
    font-size: 0.7rem !important;
    font-weight: 600;
    padding: 0.4rem 0.75rem !important;
    color: #475569;
    background-color: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 10px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
div.dataTables_wrapper div.dataTables_paginate .page-item:not(.disabled):hover .page-link {
    background-color: #F8FAFC; border-color: #CBD5E1; color: #334155; transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
div.dataTables_wrapper div.dataTables_paginate .page-item.active .page-link {
    background: linear-gradient(135deg, #4285F4, #3B78E0) !important;
    border-color: #4285F4 !important;
    color: white !important;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.25);
}
div.dataTables_wrapper div.dataTables_paginate .page-item.disabled .page-link {
    color: #CBD5E1; background-color: #F8FAFC; border-color: #E2E8F0;
}

div.dataTables_wrapper div.dataTables_info { font-size: 0.7rem; color: #64748B; font-weight: 500; padding-top: 0.5rem; }

/* Processing Overlays */
#empTable_wrapper .dataTables_processing {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    padding: 1.5rem 2.5rem !important;
    background: linear-gradient(135deg, #FFFFFF, #F8FAFC) !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 20px !important;
    box-shadow: 0 8px 30px rgba(148, 163, 184, 0.15) !important;
    z-index: 1050 !important;
    width: auto !important;
    text-align: center !important;
    border-top: 4px solid #4285F4 !important;
}
.custom-loader-wrapper { display: flex; align-items: center; justify-content: center; gap: 0.75rem; }
.custom-loader-wrapper .spinner-border { width: 1.5rem; height: 1.5rem; border-width: 0.2em; color: #4285F4 !important; }
.custom-loader-wrapper span { font-size: 0.85rem !important; font-weight: 600 !important; color: #334155 !important; }

/* Scroll Alignment Fixes */
table.dataTable { margin-top: 0 !important; margin-bottom: 0 !important; }
.dataTables_scrollHead { margin-bottom: 0 !important; border-bottom: 0 !important; }
.dataTables_scrollBody { margin-top: 0 !important; border-top: 0 !important; }

/* ==========================================================================
   5. RESPONSIVE MEDIA QUERIES
   ========================================================================== */
@media (max-width: 768px) {
    .page-wrapper { padding: 1rem; }
    .data-card__header { flex-direction: column; text-align: center; padding: 1rem; }
    .data-card__body { padding: 1rem; }
    .dataTables_filter { justify-content: center; width: 100%; }
    .dataTables_filter input { width: 100% !important; max-width: 300px; }
    div.dataTables_wrapper div.dataTables_paginate ul.pagination { justify-content: center; }
}

@media (max-width: 576px) {
    .page-wrapper { padding: 0.75rem; }
    .data-card { border-radius: 16px; }
    .data-card__header { padding: 0.875rem 1rem; }
    .data-card__header-title { font-size: 0.8rem; }
    .data-card__body { padding: 0.75rem; }
    .dataTables_scroll { border-radius: 12px; }
    .dataTables_wrapper .row:first-child { flex-direction: column; gap: 0.75rem; }
    .dataTables_wrapper .row:first-child > div { width: 100% !important; max-width: 100% !important; flex: 0 0 100% !important; }
    div.dataTables_wrapper div.dataTables_length { text-align: center; }
    div.dataTables_wrapper div.dataTables_length label { justify-content: center; font-size: 0.8rem; }
    .dataTables_filter { justify-content: center; }
    .dataTables_filter input { width: 100% !important; max-width: 100%; padding: 0.6rem 1rem !important; font-size: 0.85rem !important; }
    div.dataTables_wrapper div.dataTables_paginate ul.pagination { justify-content: center; gap: 3px; }
    div.dataTables_wrapper div.dataTables_paginate .page-item .page-link { font-size: 0.75rem !important; padding: 0.35rem 0.65rem !important; border-radius: 8px !important; }
    div.dataTables_wrapper div.dataTables_info { text-align: center; font-size: 0.75rem; padding-top: 0.75rem; }
    .dataTables_wrapper .dt-buttons .btn-success, .dataTables_wrapper .dt-buttons button.btn-success { width: 100%; justify-content: center; padding: 0.6rem 1rem !important; font-size: 0.8rem !important; }
    #empTable_wrapper .dataTables_processing { padding: 1rem 1.5rem !important; border-radius: 16px !important; width: 90% !important; max-width: 280px; }
    thead th { padding: 0.6rem 0.75rem !important; font-size: 0.6rem !important; }
    tbody td { padding: 0.6rem 0.75rem !important; font-size: 0.7rem !important; }
    .mono-data { font-size: 0.65rem; padding: 0.1rem 0.3rem; }
    .badge-soft { padding: 0.2rem 0.5rem; font-size: 0.6rem; }
    .status-indicator { width: 8px; height: 8px; }
}

@media (max-width: 400px) {
    .dataTables_scroll { border-radius: 10px; }
    thead th { padding: 0.5rem 0.6rem !important; font-size: 0.58rem !important; }
    tbody td { padding: 0.5rem 0.6rem !important; font-size: 0.68rem !important; }
    .mono-data { font-size: 0.6rem; }
    .badge-soft { padding: 0.15rem 0.4rem; font-size: 0.55rem; gap: 4px; }
    .status-indicator { width: 7px; height: 7px; }
}