body {
    background-color: #f8f9fa;
    /* light orange background for page */
}

.css-text {
    color: black;
}

.sidefooter {
    text-align: center;
}

/* Sidebar */
.sidebar {
    background: linear-gradient(180deg, #f88d2b, #f46d1d);
    min-height: 100vh;
    color: white;
    padding: 0;
}

.sidebar .nav-link {
    color: white;
    font-weight: 500;
    padding: 12px 20px;
    display: block;
    transition: background 0.3s;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    text-decoration: none;
}

/* --- Logo Alignment and Sizing (matches customer layout) --- */
.sidebar .brand-logo {
    max-width: 160px;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: inline-block;
    margin: 0 auto;
    transition: opacity 0.3s ease;
}

/* Ensure consistent alignment */
.sidebar .text-center {
    text-align: center;
}

/* Adjust in dark mode */
body.dark-mode .sidebar .brand-logo {
    filter: brightness(0.9);
}

/* Optional: reduce extra padding on small screens */
@media (max-width: 768px) {
    .sidebar .brand-logo {
        max-width: 100px;
        max-height: 60px;
    }
}

.logo {
    text-align: center;
    padding: 10px 0;
}

.logout button {
    border-color: white;
    color: white;
}

.logout button:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Table */
.table-container {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.1);
}

.table-orange {
    background: #f57c20 !important;
}

.theme-box {
    display: inline-block;
    width: 30px;
    height: 15px;
    border-radius: 4px;
}

/* Custom Table (light mode) */
.table-custom {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    color: #212529;
}

.table-custom th,
.table-custom td {
    padding: 12px;
    border: 1px solid #dee2e6;
    vertical-align: middle;
    background: #fff;
    color: #212529;
}

/* === Status Labels === */
.table-custom .text-success {
    color: #28a745 !important;
    font-weight: 600;
}

.table-custom .text-danger {
    color: #dc3545 !important;
    font-weight: 600;
}

/* === Action Buttons inside table === */
.table-custom .btn {
    padding: 4px 8px;
    font-size: 13px;
    border-radius: 5px;
}

.table-custom .btn i {
    font-size: 14px;
}

/* Table Header */
.table-custom thead th {
    background: #fff !important;
    color: black !important;
}

/* Table Hover */
.table-custom tbody tr:hover {
    background-color: #fdf5ee;
}

/* Topbar */
.topbar {
    height: 60px;
}

/* Pagination */
.pagination .page-item.active .page-link {
    background-color: #f57c20;
    border-color: #f57c20;
    color: #fff;
}

.pagination .page-link {
    color: #f57c20;
}

.pagination .page-link:hover {
    background-color: #fdf5ee;
}

/* Limit logo size */
.logo-img {
    max-width: 120px;
    /* adjust as needed */
    max-height: 50px;
    /* adjust as needed */
    width: auto;
    height: auto;
    object-fit: contain;
    /* ensures logo aspect ratio stays intact */
}

/* === Dark Mode Overrides === */
body.dark-mode {
    background-color: #1e1e1e !important;
    color: #e4e4e4 !important;
}

body.dark-mode .sidebar {
    background: linear-gradient(180deg, #2a2a2a, #1f1f1f);
}

body.dark-mode .sidebar .nav-link {
    color: #ccc;
}

body.dark-mode .sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .table-container {
    background: #2a2a2a;
    border: 1px solid #444;
}

body.dark-mode .table-container th,
body.dark-mode .table-container td {
    color: #e4e4e4;
    border-color: #555;
}

body.dark-mode footer {
    color: #aaa;
}

body.dark-mode .sidefooter {
    text-align: center;
}

/* === Dark Mode Custom Table === */
body.dark-mode .table-custom {
    background: #1e1e1e;
    color: #e4e4e4;
}

body.dark-mode .table-custom th,
body.dark-mode .table-custom td {
    background: #1e1e1e;
    border: 1px solid #444;
    color: #e4e4e4;
}

body.dark-mode .table-custom thead th {
    background: #333 !important;
    color: #fff !important;
}

body.dark-mode .table-custom tbody tr:hover {
    background-color: #2a2a2a;
}

/* Dark mode labels */
body.dark-mode .table-custom .text-success {
    color: #5bd877 !important;
}

body.dark-mode .table-custom .text-danger {
    color: #ff6b6b !important;
}

body.dark-mode .css-text {
    color: white;
}

/* Topbar */
body.dark-mode .topbar {
    background-color: #222 !important;
}

/* Customer profile text */
body.dark-mode .topbar strong {
    color: #fff !important;
}

/* Buttons, inputs, pagination */
body.dark-mode .btn,
body.dark-mode .form-control,
body.dark-mode .page-link {
    background-color: #2c2c2c !important;
    color: #e4e4e4 !important;
    border: 1px solid #444 !important;
}

body.dark-mode .form-control::placeholder {
    color: #e4e4e4;
}

.logo {
    max-width: 100px;
    height: auto;
}

.brand-logo {
    max-width: 100px;
    height: 100px;
    transition: opacity 0.3s ease;
}

.theme-toggle button {
    border-radius: 20px;
    padding: 6px 14px;
    transition: all 0.3s ease;
    background-color: #222;
    color: #fff;
}

/* Ensure form adapts in dark mode */
.form-container {
    background: #fff;
    transition: background 0.3s ease, color 0.3s ease;
}

body.dark-mode .form-container {
    background: #2a2a2a !important;
    color: #e4e4e4 !important;
}

body.dark-mode .form-label {
    color: #e4e4e4 !important;
}

.logo-preview {
    display: block;
    max-height: 60px;
    object-fit: contain;
}

.dark-bg-secondary {
    background-color: #2a2a2a !important;
}

.css-text {
    color: #555;
}

body.dark-mode .css-text {
    color: #ccc;
}

/* ============================================================
   DARK MODE ENHANCEMENTS FOR USER TABLE & USER MODAL
   ============================================================ */

/* --- Fix table header (orange header) in dark mode --- */
body.dark-mode .table-orange {
    background: #333 !important;
    color: #fff !important;
}

/* --- Dark mode table hover --- */
body.dark-mode table.table tbody tr:hover {
    background: #2b2b2b !important;
}

/* ============================================================
   USER MODAL – DARK MODE SUPPORT
   ============================================================ */

/* Modal background */
body.dark-mode .modal-content {
    background-color: #2a2a2a !important;
    color: #e4e4e4 !important;
    border: 1px solid #444 !important;
}

/* Modal header */
body.dark-mode .modal-header {
    background-color: #222 !important;
    border-bottom: 1px solid #444 !important;
}

body.dark-mode .modal-title {
    color: #fff !important;
}

/* Modal footer */
body.dark-mode .modal-footer {
    background-color: #222 !important;
    border-top: 1px solid #444 !important;
}

/* Close button */
body.dark-mode .btn-close {
    filter: invert(1);
}

/* Inputs, Select, Password fields */
body.dark-mode .modal-content .form-control,
body.dark-mode .modal-content .form-select {
    background-color: #2c2c2c !important;
    color: #e4e4e4 !important;
    border: 1px solid #555 !important;
}

body.dark-mode .modal-content .form-control::placeholder {
    color: #bbb !important;
}

/* Form labels */
body.dark-mode .modal-content .form-label {
    color: #e4e4e4 !important;
}

/* Error messages */
body.dark-mode .modal-content .invalid-feedback {
    color: #ffb3b3 !important;
}

/* Password hint text */
body.dark-mode #passwordHint {
    color: #ccc !important;
}

/* Buttons inside modal */
body.dark-mode #saveUserBtn {
    background-color: #444 !important;
    border-color: #555 !important;
    color: white !important;
}

body.dark-mode .btn-secondary {
    background-color: #333 !important;
    border-color: #555 !important;
    color: #fff !important;
}

/* Select dropdown arrow visibility fix */
body.dark-mode select.form-select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23ccc' class='bi bi-caret-down-fill' viewBox='0 0 16 16'%3e%3cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592c.859 0 1.319 1.013.753 1.658l-4.796 5.482a1 1 0 0 1-1.506 0z'/%3e%3c/svg%3e");
}

/* Force user list table rows & cells to switch in dark mode */
body.dark-mode .table.table-bordered td,
body.dark-mode .table.table-bordered th,
body.dark-mode table.table td,
body.dark-mode table.table th {
    background-color: #1e1e1e !important;
    color: #e4e4e4 !important;
    border-color: #444 !important;
}

/* Hover row in dark mode */
body.dark-mode table.table tbody tr:hover {
    background-color: #2a2a2a !important;
}

.new-custom-sidebar {
    width: 240px;
}

/* Fullscreen loader */
#pageLoader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

/* Spinner animation */
#pageLoader .spinner {
    width: 45px;
    height: 45px;
    border: 5px solid #ccc;
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Hide loader after fadeout */
#pageLoader.hidden {
    opacity: 0;
    pointer-events: none;
}
