:root {
    --bg-body: #f3f4f6;
    --border-color: #e5e7eb;
    --text-main: #111827;
    --text-muted: #6b7280;
}

body {
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-body);
    height: 100vh;
    margin: 0;
    overflow: hidden;
}

/* Sidebar Container */
#sidebar {
    width: 240px;
    flex: 0 0 240px;
    transition: width 0.2s ease-in-out;
    background-color: var(--bg-body);
}

#sidebar.collapsed {
    width: 40px;
    flex: 0 0 40px;
}

/* Logo/Header */
.sidebar-header {
    padding: 0.5rem;
    margin-bottom: 2rem;
}
.sidebar-logo-img {
    width: 160px;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

/* Nav Section */
.nav-heading {
    font-size: 0.7rem;
    letter-spacing: 0.05rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    padding: 0 1rem;
    margin-bottom: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-item:hover, .nav-item.active {
    background-color: #dee2e9;
    color: var(--text-main);
}

/* Sidebar Footer & User Profile */
.sidebar-footer {
    position: relative;
    padding-top: 1rem;
    margin-top: auto;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: background 0.2s;
}

.user-profile:hover {
    background-color: #f3f4f6;
}

.avatar {
    width: 32px;
    height: 32px;
    background-color: #f3f4f6;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
}

.chevron {
    width: 16px;
    height: 16px;
    margin-left: auto;
    color: var(--text-muted);
}

.dropdown-menu-user {
    min-width: 240px;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    padding: 0.5rem;
    margin-bottom: 8px !important;
}

.user-info {
    line-height: 1.2;
}
.user-email {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* .main-wrapper {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    display: flex; flex-direction: column;
} */

.main-wrapper {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    display: flex; 
    flex-direction: column;
    min-width: 0; /* Table ke data ko layout todne se rokega */
}

.placeholder-pattern {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-image: repeating-linear-gradient(45deg, transparent, transparent 7px, #f3f4f6 7px, #f3f4f6 8px);
}

#sidebar.collapsed .sidebar-text,
#sidebar.collapsed .nav-heading,
#sidebar.collapsed .user-name,
#sidebar.collapsed .chevron {
    display: none;
}
#sidebar.collapsed .nav-item, 
#sidebar.collapsed .user-profile,
#sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}
#sidebar.collapsed .sidebar-logo-img {
    width: 32px;
}

#customerTable thead th {
    font-size: 11px;
    letter-spacing: 0.5px;
    padding-top: 15px;
    padding-bottom: 15px;
    background: #f8fafc;
}

#customerTable tbody td {
    font-size: 0.8rem;
    padding-top: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
    font-weight: 500;
}

#customerTable th, 
#customerTable td {
    white-space: nowrap !important;
}

#customerTable th:last-child,
#customerTable td:last-child {
    position: sticky !important;
    right: 0;
    box-shadow: -3px 0 5px rgba(0,0,0,0.04);
}

#customerTable thead th:last-child {
    background-color: #f8f9fa !important; 
    z-index: 2;
}

#customerTable tbody td:last-child {
    background-color: #ffffff !important;
    z-index: 1;
}

#customerTable.table-hover tbody tr:hover td:last-child {
    background-color: #ececec !important; 
}

.overflow-auto::-webkit-scrollbar { 
    width: 6px;
    height: 6px;
}
.overflow-auto::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 10px; }

.overflow-auto::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

.overflow-auto::-webkit-scrollbar-track {
    background: transparent;
}

.form-control:focus, .form-select:focus {
    border-color: #dee2e6 !important;
    box-shadow: none !important;
}

.paginate_button {
    padding: 5px 12px !important;
    margin-left: 4px !important;
    border-radius: 6px !important;
    border: 1px solid #dee2e6 !important;
    font-size: 13px !important;
    background: white !important;
}
.paginate_button.current {
    background: #0d6efd !important;
    color: white !important;
    border-color: #0d6efd !important;
}

#tableInfoArea {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100%;
}

#paginationContainer {
    display: flex;
    align-items: center;
}

.dataTables_wrapper .dataTables_paginate {
    margin: 0 !important;
    display: flex !important;
    gap: 4px;
}

.dataTables_paginate {
    align-items: center !important;
}

.dataTables_paginate .paginate_button {
    border: 1px solid #e2e8f0 !important;
    background: white !important;
    border-radius: 6px !important;
    padding: 4px 12px !important;
    font-size: 13px !important;
    cursor: pointer !important;
    color: #475569 !important;
    text-decoration: none;
}

.dataTables_paginate .paginate_button.current {
    background: #111827 !important;
    color: white !important;
    border-color: #111827 !important;
}

.dataTables_paginate .paginate_button.disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
}

.dataTables_paginate .paginate_button:hover:not(.current):not(.disabled) {
    background: #f1f5f9 !important;
}

.dataTables_info {
    display: none;
}

.dataTables_length select {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 3px 6px;
    font-size: 13px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    border-radius: 12px;
}

.form-control {
    font-size: 0.8rem;
    /* padding: 0.6rem 0.75rem; */
    border-color: #e5e7eb;
}

.form-control:focus {
    border-color: #111827 !important;
    box-shadow: 0 0 0 0.2rem rgba(17, 24, 39, 0.1) !important;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #111827;
}

.btn-custom-dark {
    background-color: #111827;
    color: white;
    font-weight: 500;
    padding: 0.6rem;
    border-radius: 6px;
    border: none;
}

.btn-custom-dark:hover {
    background-color: #1f2937;
    color: white;
}

.forgot-link {
    font-size: 0.85rem;
    color: #111827;
    text-decoration: underline;
    font-weight: 500;
}

.forgot-link:hover {
    color: #374151;
}

.form-check-input:checked {
    background-color: #111827 !important;
    border-color: #111827 !important;
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(17, 24, 39, 0.1) !important;
    border-color: #111827 !important;
}

.form-check-label {
    color: #111827 !important;
    font-weight: 500;
    cursor: pointer;
}

.bg-light {
    background-color: #f3f4f6 !important;
}

.text-xs {
    font-size: 0.8rem;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1rem;
    text-align: left;
}

.form-control, 
.form-select {
    height: 40px !important;
    font-size: 0.85rem !important;
    padding: 0.5rem 0.75rem !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 6px !important;
    color: #111827 !important;
    background-color: #ffffff !important;
    display: flex;
    align-items: center;
}

.form-control:focus, 
.form-select:focus {
    border-color: #111827 !important;
    box-shadow: 0 0 0 0.2rem rgba(17, 24, 39, 0.1) !important;
    outline: none !important;
}

.form-select option {
    background-color: #ffffff;
    color: #111827;
    padding: 10px;
}

.form-select {
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}

.form-check-input {
    margin-top: .15em !important;
}

.form-control.is-invalid, .was-validated .form-control:invalid {
    border-color: var(--bs-form-invalid-border-color) !important;
}

.form-select.is-invalid, .was-validated .form-select:invalid {
    border-color: var(--bs-form-invalid-border-color) !important;
}

.input-group .form-control:focus + .input-group-text {
    border-color: #111827 !important;
}

.input-group-text {
    transition: all 0.2s;
    border-color: #e5e7eb;
}

input.read[readonly],
input.read:read-only {
    background-color: #f2f2f2 !important;
    border-color: #e5e7eb !important;
    color: #000000 !important;
    cursor: default;
    pointer-events: none;
}

input.read[readonly]:focus,
input.read:read-only:focus {
    border-color: #e5e7eb !important;
    box-shadow: none !important;
}

.form-control-sm {
    height: 28px !important;
}

.select2-container--default .select2-selection--single {
    height: 28px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center !important;
    font-size: 0.85rem !important;
    background-color: #ffffff !important;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: #111827 !important;
    box-shadow: 0 0 0 0.2rem rgba(17, 24, 39, 0.1) !important;
    outline: none !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 26px !important; 
    padding-left: 0.5rem !important;
    color: #111827 !important;
    width: 100%;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 26px !important;
    right: 4px !important;
}

.select2-container--default .select2-selection--single .select2-selection__clear {
    height: 30px !important;
    line-height: 26px !important;
    margin-right: 15px;
    color: #6b7280;
}

.select2-dropdown {
    border-color: #111827 !important;
    border-radius: 6px !important;
    font-size: 0.85rem !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

.select2-results__option--highlighted[aria-selected] {
    background-color: #111827 !important;
    color: white !important;
}

.select2-container--default .select2-selection--single {
    height: 31px !important;
}

.error-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

.error-card {
    text-align: center;
    padding: 40px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    max-width: 500px;
    width: 90%;
}

.error-code {
    font-size: 8rem;
    font-weight: 800;
    color: #000000;
    line-height: 1;
    margin-bottom: 10px;
    opacity: 0.8;
}

.error-message {
    font-size: 1.5rem;
    font-weight: 600;
    color: #343a40;
    margin-bottom: 15px;
}

.error-description {
    color: #6c757d;
    margin-bottom: 30px;
}

.btn-back {
    padding: 10px 25px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.lock-icon {
    font-size: 3rem;
    color: #dc3545;
    margin-bottom: 20px;
}

/* =========================================
   1. Bootstrap Default Colors Override
========================================= */

/* Dropdown active & hover states */
.dropdown-item.active, .dropdown-item:active {
    background-color: var(--text-main) !important;
    color: #fff !important;
}

/* Pagination current button blue override */
.page-item.active .page-link, .paginate_button.current {
    background-color: var(--text-main) !important;
    border-color: var(--text-main) !important;
    color: #fff !important;
}

/* Button & Select generic focus rings */
.btn:focus, .form-select:focus, .form-control:focus, .btn-close:focus {
    box-shadow: 0 0 0 0.2rem rgba(17, 24, 39, 0.15) !important;
}

/* Checkbox specific overrides */
.form-check-input:checked {
    background-color: var(--text-main) !important;
    border-color: var(--text-main) !important;
}
.form-check-input:focus {
    border-color: var(--text-main) !important;
    box-shadow: 0 0 0 0.25rem rgba(17, 24, 39, 0.25) !important;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(17, 24, 39, 0.5);
    z-index: 1040;
    backdrop-filter: blur(2px);
}
.sidebar-overlay.show {
    display: block;
}

@media (max-width: 768px) {
    html, body {
        height: auto !important;
        overflow: visible !important;
        padding: 0 !important;
    }

    .main-wrapper {
        border-radius: 0 !important; 
        border: none !important;
        height: auto !important;
        min-height: 100vh;
        display: block !important;
        overflow: visible !important;
    }

    .main-wrapper > .bg-white {
        height: auto !important;
        display: block !important;
        overflow: visible !important; 
    }

    .main-wrapper .bg-white .overflow-auto {
        height: auto !important;
        display: block !important;
        overflow-y: visible !important;
        overflow-x: auto !important;
    }

    #sidebar {
        position: fixed;
        left: -240px;
        top: 0;
        bottom: 0;
        z-index: 1050;
        height: 100vh !important;
        box-shadow: 5px 0 15px rgba(0,0,0,0.1);
    }

    #sidebar.mobile-open {
        left: 0;
    }

    #sidebar.collapsed {
        width: 240px; 
    }

    .d-flex.gap-2.p-2 {
        flex-direction: column;
    }
    .d-flex.gap-2.p-2 > div {
        width: 100%;
    }
    
    #tableInfoArea {
        flex-direction: column !important;
        gap: 15px;
        text-align: center;
    }
}

/* @media (max-width: 768px) {
    body {
        padding: 0 !important;
    }
    
    .main-wrapper {
        border-radius: 0; 
        border: none;
        height: 100vh;
    }

    #sidebar {
        position: fixed;
        left: -240px;
        top: 0;
        bottom: 0;
        z-index: 1050;
        height: 100vh;
        box-shadow: 5px 0 15px rgba(0,0,0,0.1);
    }

    #sidebar.mobile-open {
        left: 0;
    }

    #sidebar.collapsed {
        width: 240px; 
    }

    .d-flex.gap-2.p-2 {
        flex-direction: column;
    }
    .d-flex.gap-2.p-2 > div {
        width: 100%;
    }
    
    #tableInfoArea {
        flex-direction: column !important;
        gap: 15px;
        text-align: center;
    }
} */

.settings-nav-link {
    display: block;
    padding: 0.6rem 1rem;
    color: #4b5563;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.2s;
    background: transparent;
    border: none;
    width: 100%;
}
.settings-nav-link:hover {
    color: #111827;
    background-color: #f9fafb;
}

.nav-pills .nav-link.settings-nav-link.active, 
.nav-pills .show > .nav-link.settings-nav-link {
    background-color: #f3f4f6 !important;
    color: #111827 !important;
    font-weight: 600;
}

.input-profile {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.input-profile:focus {
    border-color: #111827 !important; 
    box-shadow: 0 0 0 0.2rem rgba(17, 24, 39, 0.1) !important;
    outline: none;
}

.btn-icon:focus, 
.btn-icon:active {
    box-shadow: none !important;
    outline: none !important;
    border-color: transparent !important;
    background-color: transparent !important;
}

#archiveTable thead th {
    font-size: 11px;
    letter-spacing: 0.5px;
    padding-top: 15px;
    padding-bottom: 15px;
    background: #f8fafc;
}

#archiveTable tbody td {
    font-size: 0.8rem;
    padding-top: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
    font-weight: 500;
}

#archiveTable th, 
#archiveTable td {
    white-space: nowrap !important;
}

#archiveTable th:last-child,
#archiveTable td:last-child {
    position: sticky !important;
    right: 0;
    box-shadow: -3px 0 5px rgba(0,0,0,0.04);
}

#archiveTable thead th:last-child {
    background-color: #f8f9fa !important; 
    z-index: 2;
}

#archiveTable tbody td:last-child {
    background-color: #ffffff !important;
    z-index: 1;
}

#archiveTable.table-hover tbody tr:hover td:last-child {
    background-color: #ececec !important; 
}