body {
    background-color: #1c2526;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    display: flex;
    flex-direction: row;
    min-height: 100vh;
    overflow-x: hidden; /* Prevent horizontal scroll on mobile */
}

.sidebar {
    width: 200px;
    background-color: #2c3639;
    padding: 20px;
    box-sizing: border-box;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.menu-toggle {
    display: none; /* Hidden on desktop */
    padding: 10px;
    cursor: pointer;
    color: #fff;
    font-size: 24px;
    text-align: center;
    border-bottom: 1px solid #3f4e4f; /* Match sidebar style */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #2c3639;
}

.menu-wrapper {
    overflow-y: auto;
    height: calc(100% - 40px); /* Adjust for toggle height */
    margin-top: 40px; /* Space for toggle */
}

.menu-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-items li {
    margin: 10px 0;
}

.menu-items a {
    color: #ffffff;
    text-decoration: none;
    padding: 10px;
    display: block;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.menu-items a:hover,
.menu-items a.active {
    background-color: #3f4e4f;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%); /* Hide sidebar by default on mobile */
        padding-top: 60px; /* Space for toggle */
    }

    .sidebar.active {
        transform: translateX(0); /* Show sidebar when active */
    }

    .menu-toggle {
        display: block; /* Show hamburger on mobile */
        position: fixed;
        top: 0;
        left: 0;
        width: 200px;
        z-index: 1001; /* Above sidebar */
    }

    .menu-items {
        display: none; /* Hide menu items by default on mobile */
    }

    .menu-items.active {
        display: block; /* Show menu items when toggled */
    }

    .container,
    .upload-container,
    .upload-results-container {
        margin-left: 0 !important; /* Override fixed sidebar offset */
        padding: 10px;
        width: 100% !important;
    }

    .centered-content {
        margin: 0 auto;
        max-width: 100% !important; /* Allow full width on mobile */
    }

    .upload-form-group,
    .dropdown-container {
        width: 100% !important;
        margin-bottom: 10px;
        display: block !important; /* Override inline-block */
    }

    select,
    input[type="file"],
    button {
        width: 100% !important;
        box-sizing: border-box;
    }

    /* Additional safeguard for tables and complex layouts */
    .results-table {
        width: 100% !important;
        word-wrap: break-word; /* Prevent overflow on narrow screens */
    }

    .multi-edit-container {
        flex-direction: column !important;
        gap: 10px !important;
    }

    .repair-history-stats-container {
        flex-direction: column !important;
        gap: 20px !important;
    }
}

.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    margin-left: 220px; /* Offset for sidebar */
}

.centered-content {
    width: 100%;
    max-width: 600px;
    text-align: center;
}

h1 {
    font-size: 32px;
    margin-bottom: 30px;
    font-weight: 600;
}

h2 {
    font-size: 24px;
    margin-bottom: 20px;
    font-weight: 500;
}

.dropdown-container {
    margin-bottom: 20px;
    width: 200px;
    text-align: left;
    display: inline-block;
    margin-right: 20px;
}

label {
    display: block;
    font-size: 16px;
    margin-bottom: 8px;
    color: #d1d1d1;
}

select {
    width: 100%;
    padding: 12px;
    background-color: #2c3639;
    color: #ffffff;
    border: 1px solid #3f4e4f;
    border-radius: 8px;
    font-size: 16px;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px top 50%;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: #007aff;
}

select option {
    background-color: #2c3639;
    color: #ffffff;
}

button {
    padding: 12px 20px;
    background-color: #007aff;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
}

button:hover {
    background-color: #005bb5;
}

button:focus {
    outline: none;
    border-color: #007aff;
}

input[type="text"],
input[type="password"],
input[type="email"] {
    width: 100%;
    padding: 12px;
    background-color: #2c3639;
    color: #ffffff;
    border: 1px solid #3f4e4f;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    margin-bottom: 15px;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
    outline: none;
    border-color: #007aff;
}

.form-container {
    width: 100%;
    max-width: 300px;
    text-align: left;
}

.form-group {
    margin-bottom: 20px;
}

/* Table responsiveness for mobile */
.results-container {
    width: 100%;
    overflow-x: auto; /* Enable horizontal scroll on mobile */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.results-table {
    width: 100%;
    min-width: 800px; /* Minimum width to ensure all columns are accessible */
    border-collapse: collapse;
    background-color: #2c3639;
    border-radius: 8px;
    overflow: hidden;
}

.results-table th,
.results-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #3f4e4f;
    color: #D3D3D3;
    white-space: nowrap; /* Prevent text wrapping */
    overflow: hidden;
    text-overflow: ellipsis; /* Truncate long text */
}

.results-table th {
    background-color: #3f4e4f;
    font-weight: 600;
}

.results-table tr {
    display: table-row; /* Ensure table-row behavior on all screens */
}

.results-table td {
    /* Reset before pseudo-element on desktop */
}

.results-table tr:hover {
    background-color: #354243;
}

.results-table td a {
    color: #00FFFF;
    text-decoration: none;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background-color 0.3s;
    display: inline-block;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.results-table td a:hover {
    background-color: #2a3a3f;
    color: #FFFFFF;
}

/* Card layout for very small screens */
@media (max-width: 480px) {
    .results-table {
        min-width: 0; /* Remove minimum width on small screens */
        display: block;
    }

    .results-table thead {
        display: none; /* Hide headers on small screens */
    }

    .results-table tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid #3f4e4f;
        border-radius: 8px;
        background-color: #2c3639;
    }

    .results-table td {
        display: flex;
        justify-content: space-between;
        padding: 10px;
        border-bottom: 1px solid #3f4e4f;
        white-space: normal; /* Allow wrapping */
    }

    .results-table td:last-child {
        border-bottom: none;
    }

    .results-table td:before {
        content: attr(data-label);
        font-weight: 600;
        margin-right: 10px;
        color: #00FFFF;
    }

    .results-table td[data-label] {
        width: 100%;
    }

    .checkbox-column {
        width: auto; /* Adjust checkbox column */
    }

    .button-container {
        flex-direction: column;
        gap: 10px;
    }
}

/* Add data-labels for card layout (scoped to mobile) */
@media (max-width: 480px) {
    .results-table td:nth-child(1):before { content: "Select"; }
    .results-table td:nth-child(2):before { content: "Asset Tag"; }
    .results-table td:nth-child(3):before { content: "Model"; }
    .results-table td:nth-child(4):before { content: "Room"; }
    .results-table td:nth-child(5):before { content: "Notes"; }
    .results-table td:nth-child(6):before { content: "State"; }
    .results-table td:nth-child(7):before { content: "Last Edited"; }
    .results-table td:nth-child(8):before { content: "Timestamp"; }
    .results-table td:nth-child(9):before { content: "APIP"; }
    .results-table td:nth-child(10):before { content: "Last Auth"; }
}

.back-link {
    display: inline-block;
    margin-top: 20px;
    color: #007aff;
    text-decoration: none;
    font-size: 16px;
}

.upload-back-link {
    color: #007aff;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: none;
}

p {
    font-size: 16px;
}

.success-message {
    background-color: #34c759;
    color: #ffffff;
    font-size: 16px;
    margin-bottom: 20px;
    text-align: center;
}

.error-message {
    background-color: #ff3b30;
    color: #ffffff;
    font-size: 16px;
    margin-bottom: 20px;
    text-align: center;
}

.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.success-overlay.active {
    opacity: 1;
    visibility: visible;
}

.success-overlay-content {
    background-color: #34c3639;
    padding: 20px 40px;
    border-radius: 8px;
    text-align: center;
    color: #ffffff;
    font-size: 18px;
    max-width: 400px;
}

.mismatch-error {
    display: none;
}

input.mismatch {
    border-color: error!important;
}

.password-wrapper {
    position: relative;
}

.eye-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
}

.eye-icon.show {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M12 3C5.4 3 1 12 1 12S5.4 21 12 21s11-9 11-9-5.4-9-11-9zm0 14c-2.2 0-4-1.8-4-4 0-4 4-4 4zm0 0"/><circle cx="12" cy="12" r="4"/></svg>');
}

.eye-icon.hide {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"/><line x1='1' y1='1' x2='23' y2='23'/></svg>');
}

.dropdown-container {
    display: inline-block;
    margin-right: 20px;
    vertical-align: top;
}

#results-table {
    margin-top: 20px;
}

.results-table th.asc::after {
    content: ' ↑';
    color: #00FFFF;
}

.results-table th.desc::after {
    content: ' ↓';
    color: #00FFFF;
}

.checkbox-column {
    width: 50px;
}

.move-buttons {
    margin-top: 10px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #1c2526;
    margin: 15% auto;
    padding: 20px;
    border-radius: 8px;
    width: 300px;
    color: #d3d3d3;
}

.close {
    float: right;
    cursor: pointer;
    color: #ffffff;
    font-size: 24px;
}

.close:hover {
    color: #007aff;
}

.hidden-row {
    display: none;
}

.hidden-row.show-hidden {
    display: table-row;
}

.results-table input {
    width: 100%;
    padding: 8px;
    background-color: #2c3639;
    color: #ffffff;
    border: 1px solid #3f4e4f;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.results-table input:focus {
    outline: none;
    border-color: #007aff;
}

.results-table input[readonly] {
    background-color: #354243;
    cursor: not-allowed;
}

.repair-history {
    width: 80%;
    margin: 40px auto 0;
    text-align: left;
}

.upload-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 20px;
    margin-left: 220px;
    width: 100%;
    max-width: 600px;
    box-sizing: border-box;
}

.upload-form-group {
    margin-bottom: 20px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.upload-form-group label {
    display: block;
    font-size: 16px;
    margin-bottom: 8px;
    color: #d1d1d1;
}

.upload-form-group select {
    width: 100%;
    padding: 12px;
    background-color: #2c3639;
    color: #ffffff;
    border: 1px solid #3f4e4f;
    border-radius: 8px;
    font-size: 16px;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px top 50%;
    cursor: pointer;
}

.upload-form-group select:focus {
    outline: none;
    border-color: #007aff;
}

.upload-form-group select option {
    background-color: #2c3639;
    color: #ffffff;
}

.upload-form-group input[type="file"] {
    width: 100%;
    padding: 12px;
    background-color: #2c3639;
    color: #ffffff;
    border: 1px solid #3f4e4f;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    cursor: pointer;
}

.upload-form-group input[type="file"]:focus {
    outline: none;
    border-color: #007aff;
}

.upload-form-group button {
    padding: 12px 20px;
    background-color: #007aff;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
}

.upload-form-group button:hover {
    background-color: #005bb5;
}

.upload-results-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 20px;
    margin-left: 220px;
    width: 100%;
    max-width: 600px;
    box-sizing: border-box;
}

.upload-results-wrapper {
    width: 100%;
    max-width: 600px;
    text-align: center;
}

.upload-result-row {
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 8px;
    display: flex;
    gap: 20px;
    width: 100%;
    color: #000000;
    justify-content: center;
}

.upload-result-success {
    background-color: #90ee90;
}

.upload-result-error {
    background-color: #ff6347;
}

.upload-result-updated {
    background-color: #ffff99;
}

.upload-success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.upload-success-overlay.active {
    opacity: 1;
    visibility: visible;
}

.upload-success-content {
    background-color: #1c2526;
    padding: 20px 40px;
    border-radius: 8px;
    text-align: center;
    color: #ffffff;
    font-size: 18px;
    max-width: 400px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* New styles for custom dropdown and selected repairs */
.custom-dropdown {
    position: relative;
    width: 100%;
    max-width: 300px;
}

.custom-dropdown-toggle {
    padding: 12px;
    background-color: #2c3639;
    color: #ffffff;
    border: 1px solid #3f4e4f;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
}

.custom-dropdown-toggle:hover {
    background-color: #354243;
}

.custom-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #2c3639;
    border: 1px solid #3f4e4f;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
}

.custom-dropdown-menu.active {
    display: block;
}

.custom-dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    color: #d3d3d3;
}

.custom-dropdown-item input[type="checkbox"] {
    margin-right: 8px;
}

.custom-dropdown-item:hover {
    background-color: #354243;
}

.selected-repairs {
    display: none;
    padding: 10px;
    background-color: #2c3639;
    color: #d3d3d3;
    border: 1px solid #3f4e4f;
    border-radius: 8px;
    margin-top: 5px;
    font-size: 14px;
}

.selected-repairs.active {
    display: block;
}

/* Adjusted multi-edit-container for side-by-side layout */
.multi-edit-container {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.form-container {
    width: 45%;
    text-align: left;
}

/* Existing styles remain unchanged */

/* New styles for repair_history.php layout */
.repair-history-stats-container {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
}

.repair-tally-column {
    flex: 1;
    background-color: #2c3639;
    padding: 20px;
    border: 1px solid #3f4e4f;
    border-radius: 8px;
    max-width: 300px;
}

.repair-tally-item {
    padding: 10px 0;
    font-size: 16px;
    color: #d3d3d3;
}

.repair-chart-container {
    flex: 2;
    text-align: center;
    min-width: 400px;
}

.repair-chart-container canvas {
    max-width: 100%;
    height: auto;
}

/* New styles for profile.php */
.profile-info {
    width: 100%;
    max-width: 600px;
    text-align: center;
    margin-bottom: 20px;
}

.profile-info p {
    font-size: 18px;
    margin: 10px 0;
}

.readonly-field {
    color: #d3d3d3;
    background-color: #354243;
    padding: 5px 10px;
    border-radius: 4px;
    display: inline-block;
}

.profile-edit-box {
    width: 100%;
    max-width: 400px;
    background-color: #2c3639;
    padding: 20px;
    border: 1px solid #3f4e4f;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.profile-edit-box .form-group {
    margin-bottom: 15px;
}

/* New styles for edit_user.php */
.edit-user-box {
    background-color: #2c3639;
    padding: 20px;
    border: 1px solid #3f4e4f;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    margin: 20px auto;
    text-align: center;
}

.edit-user-box .form-group {
    margin-bottom: 20px;
}

.edit-user-box .button-group {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.edit-user-box .button-group button {
    flex: 1;
    max-width: 150px;
}

.edit-user-box .button-group .cancel-btn {
    background-color: #ff3b30;
    text-align: center;
    padding: 12px;
    text-decoration: none;
    color: #ffffff;
    border-radius: 8px;
    display: inline-block;
    font-size: 16px;
    border: none;
    cursor: pointer;
}

.edit-user-box .button-group .cancel-btn:hover {
    background-color: #da190b;
}

/* New styles for login.php */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

.login-form {
    background-color: #2c3639;
    padding: 20px;
    border: 1px solid #3f4e4f;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.login-form .form-group {
    margin-bottom: 20px;
    text-align: left;
}

/* New styles specific to upload_cb.php */
.upload-instructions {
    text-align: left;
    margin-top: 20px;
    padding: 15px;
    background-color: #2c3639;
    border: 1px solid #3f4e4f;
    border-radius: 8px;
    max-width: 600px;
    color: #d3d3d3;
}

.upload-instructions h2 {
    font-size: 20px;
    margin-bottom: 10px;
    font-weight: 500;
    color: #ffffff;
}

.upload-instructions ul {
    list-style-type: disc;
    padding-left: 20px;
}

.upload-instructions li {
    font-size: 14px;
    margin-bottom: 8px;
}

.upload-instructions strong {
    font-weight: 600;
    color: #00FFFF;
}

/* Page-specific styles for upload_cb.php */
.upload-cb-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.upload-cb-content h1 {
    width: 100%;
}

.upload-cb-content .upload-instructions {
    width: 100%;
}

.upload-cb-content .upload-form-group {
    margin-bottom: 20px;
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.upload-cb-content .dropdown-container {
    display: block; /* Override inline-block */
    width: 100%;
    margin: 0; /* Remove margin-right */
    text-align: left;
}

/* Custom styling for cb_numbers.php table */
.cb-numbers-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #2c3639;
    border-radius: 8px;
    overflow: hidden;
}

.cb-numbers-table th,
.cb-numbers-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #3f4e4f;
    color: #D3D3D3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cb-numbers-table th {
    background-color: #3f4e4f;
    font-weight: 600;
    text-align: center;
}

.cb-numbers-table tr {
    display: table-row;
}

.cb-numbers-table tr:hover {
    background-color: #354243;
}

.cb-numbers-table td input {
    width: 100%;
    padding: 8px;
    background-color: #2c3639;
    color: #ffffff;
    border: 1px solid #3f4e4f;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.cb-numbers-table td input:focus {
    outline: none;
    border-color: #007aff;
}

.cb-numbers-table td input[readonly] {
    background-color: #354243;
    cursor: not-allowed;
}

/* Mobile card layout for cb_numbers.php */
@media (max-width: 480px) {
    .cb-numbers-table {
        min-width: 0;
        display: block;
    }

    .cb-numbers-table thead {
        display: none; /* Hide headers on mobile */
    }

    .cb-numbers-table tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid #3f4e4f;
        border-radius: 8px;
        background-color: #2c3639;
    }

    .cb-numbers-table td {
        display: flex;
        justify-content: space-between;
        padding: 10px;
        border-bottom: 1px solid #3f4e4f;
        white-space: normal;
    }

    .cb-numbers-table td:last-child {
        border-bottom: none;
    }

    .cb-numbers-table td:before {
        content: attr(data-label);
        font-weight: 600;
        margin-right: 10px;
        color: #00FFFF;
    }

    .cb-numbers-table td[data-label] {
        width: 100%;
    }

    .cb-numbers-table td input {
        width: 120px; /* Adjusted for better mobile input size */
        max-width: 100%;
    }
}

/* Stats-specific table styling */
.stats-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #2c3639;
    border-radius: 8px;
    overflow: hidden;
}

.stats-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #3f4e4f;
    color: #D3D3D3;
}

.stats-table tr:hover {
    background-color: #354243;
}

.stats-table td:nth-child(even) {
    font-weight: bold;
    color: #ff0000;
}

/* Stats-specific chart styling */
.charts-wrapper {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: nowrap;
    margin: 20px 0;
    width: 100%;
    min-width: 0;
}

.chart-container {
    width: 400px;
    text-align: center;
    min-height: 0;
    flex-shrink: 0;
    box-sizing: border-box;
}

.chart-container canvas {
    width: 100% !important;
    max-height: 400px;
    height: auto;
}

/* Media query for mobile table and charts */
@media (max-width: 768px) {
    .stats-table {
        min-width: 0;
        display: block;
        width: 100%;
        border: none;
        background: rgba(0, 255, 0, 0.1); /* Debug: Green tint to confirm mobile styles */
    }

    .stats-table tr {
        display: block;
        margin-bottom: 15px;
        padding: 10px;
        background-color: #2c3639;
        border-radius: 8px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    }

    .stats-table td {
        display: block;
        padding: 5px 0;
        text-align: center;
        border-bottom: none;
    }

    .stats-table td:nth-child(odd) {
        font-weight: 600;
        color: #00FFFF;
        font-size: 16px;
    }

    .stats-table td:nth-child(even) {
        font-weight: bold;
        color: #ff0000;
        font-size: 18px;
        margin-top: 5px;
    }

    .stats-table td:last-child {
        display: none;
    }

    .charts-wrapper {
        flex-direction: column;
        align-items: center;
        gap: 20px;
        min-width: 0;
    }

    .chart-container {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }

    .chart-container canvas {
        width: 100% !important;
        max-height: 400px;
        height: auto;
    }
}

/* New styles for edit_pageperms.php - added to avoid modifying pre-existing items */
.perms-wrapper {
    display: flex;
    justify-content: center;
    width: calc(100% - 200px);
    margin-left: 200px;
    min-height: calc(100vh - 40px);
}

.perms-container {
    flex: 1;
    max-width: 1000px;
    margin: 20px 0;
    padding: 20px;
    box-sizing: border-box;
    background-color: #1a2426;
    color: #ffffff;
}

.perms-header-container {
    text-align: center;
    margin-bottom: 20px;
}

.perms-form-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.perms-form-group {
    width: 400px;
    margin-bottom: 15px;
    display: block;
}

.perms-form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    color: #ffffff;
}

.perms-form-group select,
.perms-form-group input {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    border: 1px solid #3f4e4f;
    border-radius: 8px;
    background-color: #2c3639;
    color: #ffffff;
}

.perms-form-group select:focus,
.perms-form-group input:focus {
    outline: none;
    border-color: #36A2EB;
}

.perms-button {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    width: 400px; /* Match form group width */
    display: block; /* Center the button */
    margin: 0 auto; /* Center horizontally */
}

.perms-button:hover {
    background-color: #45a049;
}

.perms-results-table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    overflow-x: auto;
    background-color: #1a2426;
    margin-top: 20px;
}

.perms-results-table th,
.perms-results-table td {
    border: 1px solid #3f4e4f;
    padding: 8px;
    text-align: left;
    color: #ffffff;
}

.perms-results-table th {
    background-color: #2c3639;
    color: #ffffff;
}

.perms-results-table tr:hover {
    background-color: #3f4e4f;
}

.perms-page-col {
    width: 50%;
    min-width: 150px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.perms-role-col {
    width: 50%;
    min-width: 150px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

@media (max-width: 768px) {
    .perms-page-col,
    .perms-role-col {
        width: auto;
        min-width: 100px;
    }
    .perms-wrapper {
        margin-left: 0;
        width: 100%;
    }
    .perms-container {
        margin-left: 0;
        padding: 10px;
    }
    .perms-form-wrapper {
        display: block;
    }
    .perms-form-group {
        width: 100%;
        max-width: 100%;
    }
    .perms-button {
        width: 100%;
    }
}

.perms-message {
    margin: 10px 0;
    padding: 10px;
    background-color: #dff0d8;
    border: 1px solid #d6e9c6;
    color: #3c763d;
}

