/* Make the body and html take up the full height of the viewport */
html, body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    height: 100%;  /* Full height of viewport */
    background-color: #f4f4f4;
    overflow-x: hidden; /* Prevent small horizontal scroll on mobile */
}

/* Ensure predictable sizing to avoid overflow from padding/borders */
*, *::before, *::after { box-sizing: border-box; }

/* The wrapper takes up at least the full height of the viewport */
.wrapper {
    min-height: 100vh;  /* Full height of viewport */
    display: flex;
    flex-direction: column;
}

/* The content grows to take up available space, pushing the footer down */
.content {
    flex: 1;  /* This allows content to grow and push footer down if necessary */
    padding: 20px;
}

/* Footer styling */
footer {
    /* Footer background updated to black per request */
    background-color: #000;
    color: #fff;
    padding: 8px 12px;
    text-align: center;
    margin-top: auto; /* stick to bottom when content is short */
}



/* Header styling */
header {
    background-color: #be2228;
    color: white;
    padding: 0 12px;
    position: sticky;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
    z-index: 2000; /* keep menu stack above forms */
}


/* Centering the logo in the header */
header .logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000; /* Ensure the logo stays on top */
}

/* Reserve space on left/right so absolute-centered title doesn't collide */
header nav { flex: 1 1 auto; }
.user-dropdown { flex: 0 0 auto; }


/* Text logo styling when an image is not used */
header .logo .site-title {
    font-weight: 800;
    color: #fff;
    display: inline-block;
    font-size: clamp(22px, 3vw + 8px, 36px);
    letter-spacing: 0.2px;
}
/* Logo image styling */
header .logo img {
    max-height: 56px;
}

/* Dropdown menu styling for desktop */
nav ul.desktop-menu {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    min-width: 150px;      /* Set a minimum width */
    max-width: 650px;      /* Set a maximum width */
}

nav ul.desktop-menu li {
    display: inline-block;
    position: relative;
}

nav ul.desktop-menu > li > a {
    color: white;
    text-decoration: none;
    padding: 10px 14px;
    line-height: 44px;
    display: block;
}

nav ul.desktop-menu li:hover {
    background-color: #a61e24;
}

nav ul.desktop-menu li ul {
    display: none;
    position: absolute;
    background-color: #be2228;
    padding: 0;
    margin: 0;
    top: 100%;
    left: 0;
    min-width: 150px;
    max-width: 950px;
    white-space: nowrap;
    width: auto;
    z-index: 2001; /* keep dropdowns above form controls */
}

nav ul.desktop-menu li:hover ul {
    display: block;
}

nav ul.desktop-menu li ul li {
    display: block;
    width: 100%;
    min-height: 34px;
}

nav ul.desktop-menu li ul li a {
    display: block;
    width: 100%;
    padding: 10px 18px; /* slight increase for better target */
    line-height: 1.5;
    white-space: nowrap;
    color: white;
    text-decoration: none; /* remove underline on child items */
    box-sizing: border-box; /* padding should not overflow */
}

/* Hide Settings from top desktop menu; it remains accessible via user dropdown and mobile menu */
nav ul.desktop-menu > li > a[href^="/settings"],
nav ul.desktop-menu > li > a[href="/settings"] {
    display: none !important;
}
nav ul.desktop-menu li ul li a:hover,
nav ul.desktop-menu li ul li:hover > a {
    background-color: #a61e24;
}

/* Styling for the username and logout link, aligned right */
header .user-info {
    text-align: right;       /* Align text to the right */
    font-size: 16px;
    margin-right: 20px;
    white-space: nowrap;     /* Prevents text wrapping */
}

header .user-info span {
    display: block;          /* Forces the username onto its own line */
}

header .user-info a {
    display: block;          /* Forces the logout link onto its own line */
    margin-top: 5px;         /* Adds a bit of space between the username and the logout link */
    text-decoration: none;   /* Removes underline from the logout link */
    color: #FFF;             /* Optional: Color for the logout link */
}

/* Mobile hamburger menu */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 1000;         /* Ensure hamburger is above the menu */
}

.hamburger div {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 4px 0;
    transition: 0.4s;
}

/* Mobile menu */
nav ul.mobile-menu {
    list-style-type: none; /* Remove the dots */
    margin: 0;             /* Remove the margin */
    padding: 0;            /* Remove padding */
    flex-direction: column;
    background-color: #be2228;
    position: fixed;
    top: 0;
    left: 0;
    min-width: 150px;      /* Set a minimum width */
    max-width: 650px;      /* Set a maximum width */
    height: 100%;
    padding-top: 80px;
    display: none;  /* Hidden by default */
    z-index: 2100;         /* Ensure it appears above other content */
}

nav ul.mobile-menu.active {
    display: flex;  /* Show the menu when active */
}

nav ul.mobile-menu li {
    list-style-type: none; /* Ensure no bullets */
    padding: 10px 15px;    /* Adjust the padding for tighter spacing */
    margin: 0;             /* Ensure no additional margin */
    border-bottom: 1px solid #fff; /* For separation between menu items */
    color: white;
    text-align: left;
    position: relative;    /* Make this container relative */
}

nav ul.mobile-menu li:hover {
    background-color: #a61e24;
}

nav ul.mobile-menu li a {
    color: white;
    text-decoration: none;
    display: block;
    width: 100%;
}

/* Submenu styling for mobile */
nav ul.mobile-menu li ul {
    display: none;
    background-color: #a61e24;
    padding: 0;
    margin: 0;
    position: absolute;
    left: 100%;
    top: 0;
    min-width: 150px;
    max-width: 250px;
    transition: left 0.3s ease;
}

nav ul.mobile-menu li:hover ul {
    display: block;
    position: absolute;
    left: 100%;
    top: 0;
}
/* Hover to show submenu */
nav ul.mobile-menu li:hover ul { display: block; position: absolute; left: 100%; top: 0; }


/* Styling for user dropdown */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-icon {
    width: 36px;
    height: 36px;
    cursor: pointer;
    border-radius: 50%;
}

.user-menu {
    display: none;
    position: absolute;
    margin: 0;
    padding: 0;
    right: 0;
    background-color: white;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    z-index: 2001;
    border-radius: 4px;
    overflow: hidden; /* Ensures the hover covers full width */
    min-width: 150px;      /* Set a minimum width */
    max-width: 450px;      /* Set a maximum width */
}

.user-menu li {
    display: block;
    padding: 8px 12px;
    text-align: left;
    width: 100%; /* Ensures hover effect covers the entire width */
}

.user-menu li a {
    display: block;
    padding: 8px 12px; /* Ensures consistent spacing */
    color: #333;
    text-decoration: none;
    width: 100%; /* Ensures hover effect covers the entire width */
    box-sizing: border-box;
}

.user-menu li:hover {
    background-color: #f1f1f1;
}

/* Show the dropdown on icon click */
.user-dropdown.show .user-menu {
    display: block;
}



/* Media query for mobile devices */
@media (max-width: 768px) {
    /* Keep title centered on mobile */
    header .logo { left: 50%; transform: translateX(-50%); }
    /* Hide desktop menu and show hamburger */
    nav ul.desktop-menu {
        display: none;
    }
    
    .hamburger {
        display: flex;
    }

    header {
        justify-content: space-between;
    }

    header .logo {
        flex-grow: 1;
    }

    header .user-info {
        font-size: 14px;
    }
    
    /* Hide the user icon on mobile devices */
    .user-dropdown {
        display: none;
    }
}

/* Welcome container */
.welcome-container {
    max-width: 1200px;
    width: 100%;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Login Page Styling */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 80vh;
    padding: 20px;
    background-color: #f7f7f7;
}

.login-form {
    background-color: #fff;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 360px;
    width: 100%;
}

/* Center primary action buttons on Register and Forgot Password pages without altering form text alignment */
.register-form .btn,
.reset-form .btn {
    display: block;
    margin: 0 auto;
}


.login-form h2 {
    margin-bottom: 16px;
    font-size: 22px;
    text-align: center;
    color: #be2228;
}

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

.login-form label { display: block; font-weight: 600; margin-bottom: 4px; color: #333; font-size: 14px; }

/* Center the Remember Me row while keeping checkbox and text on one line */
.login-form .form-group.remember-me {
    display: flex;
    justify-content: center;
    align-items: center;
}
.login-form .form-group.remember-me label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0; /* remove default bottom margin so true centering works */
}

.login-form input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
}

/* Password wrapper for eye toggle */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.password-wrapper input[type="password"],
.password-wrapper input[type="text"] {
    padding-right: 52px; /* space for eye button */
}
.password-wrapper .pw-overlay { position: absolute; left: 10px; right: 52px; top: 50%; transform: translateY(-50%); pointer-events: none; color: #333; font-size: 15px; font-family: inherit; line-height: 1; white-space: pre; opacity: 0.9; display: none; }
.password-wrapper.animating input { color: transparent; caret-color: #333; }
.password-wrapper.animating input::selection { background: rgba(190,34,40,0.2); }
.password-wrapper.animating input::-ms-reveal { display: none; }

.eye-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 36px;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
}
.eye-toggle:focus { outline: 2px solid #be2228; outline-offset: 2px; border-radius: 4px; }


/* Ensure checkbox inputs inside the login form do not expand to full width */
.login-form input[type="checkbox"] {
    width: auto;
    padding: 0;           /* remove text-input padding */
    border: none;         /* no border on native checkbox */
    margin: 0 8px 0 0;    /* space between box and text */
    display: inline-block;
    vertical-align: middle;
}
/* Align the Remember Me label content on a single line with the checkbox on the left */
.login-form .form-group label > input[type="checkbox"] {
    margin-right: 8px;
}


.login-form input:focus {
    border-color: #be2228;
    outline: none;
}

.login-form .btn {
    width: 100%;
    padding: 8px 12px;
    background-color: #be2228;
    color: white;
    font-size: 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.login-form .btn:hover {
    background-color: #a61e24;
}

.login-form p {
    margin-top: 12px;
    text-align: center;
    color: #555;
    font-size: 14px;
}

.login-form p a {
    color: #be2228;
    text-decoration: none;
}

.login-form p a:hover {
    text-decoration: underline;
}

.button-group {
    display: flex;
    gap: 10px; /* Adjust the gap as needed */
}



.button-group .btn {
    padding: 8px 12px;
    background-color: #be2228;
    color: white;
    font-size: 16px;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.button-group .btn:hover {
    background-color: #a61e24;
}

.btn-sml, .btn-sml:link, .btn-sml:visited {
    display: inline-block;
    padding: 8px 12px;
    background-color: #be2228;
    color: white;
    font-size: 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.btn-sml:hover, .btn-sml:focus  {
    background-color: #a61e24;
    text-decoration: none;
    color: white;
}

.btn-sml-blu, .btn-sml-blu:link, .btn-sml-blu:visited {
    display: inline-block;
    padding: 8px 12px;
    background-color: #0077cc;
    color: white;
    font-size: 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.btn-sml-blu:hover, .btn-sml-blu:focus  {
    background-color: #005fa3;
    text-decoration: none;
    color: white;
}

/* Base alert styling */
.alert {
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 14px;
    width: 90%;
    text-align: center;
    margin-top: auto; /* stick to bottom when content is short */
}


/* Error message */
.alert.error {
    background-color: #f8d7da; /* Light red background */
    color: #721c24;            /* Dark red text */
    border: 1px solid #f5c6cb; /* Red border */
}

/* Success message */
.alert.success {
    background-color: #d4edda; /* Light green background */
    color: #155724;            /* Dark green text */
    border: 1px solid #c3e6cb; /* Green border */
}

/* Media Query for Mobile Devices */
@media screen and (max-width: 600px) {
    .login-container {
        height: auto;
        padding: 8px 12px;
    }

    .login-form {
        padding: 20px;
        max-width: 90%;   /* Decrease the width for smaller screens */
    }

    .login-form h2 {
        font-size: 20px;   /* Reduce font size for mobile */
    }

    .login-form input {
        padding: 8px;      /* Reduce padding in input fields */
        font-size: 14px;   /* Smaller font size for inputs */
    }

    .login-form .btn {
        padding: 8px;      /* Smaller button padding */
        font-size: 14px;   /* Smaller button text */
    }

    .login-form p {
        font-size: 14px;   /* Reduce text size for mobile */
    }
}


/* Container for both registration and reset forms */
.register-container, .reset-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    padding: 20px;
    background-color: #f7f7f7;
}

/* Form container for the registration and reset forms */
.register-form, .reset-form {
    background-color: #fff;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 360px;
    width: 100%;
}

/* Center primary action buttons on Register and Forgot Password pages without altering form text alignment */
.register-form .btn,
.reset-form .btn {
    display: block;
    margin: 0 auto;
}


/* Form heading style */
.register-form h2, .reset-form h2 {
    margin-bottom: 16px;
    font-size: 22px;
    text-align: center;
    color: #be2228;
}

/* Toolbox container */
.toolbox-container {
    max-width: 1200px;
    width: 100%;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.toolbox-table, .report-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

/* Generic table styling for simple data lists (e.g., Operations -> General Announcements) */
.table { width: 100%; border-collapse: collapse; background: #fff; }
.table thead th { background: #f5f5f5; font-weight: 600; }
.table th, .table td { padding: 12px 15px; border: 1px solid #e5e5e5; text-align: left; }

.toolbox-table th, .toolbox-table td,
.report-table th, .report-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.toolbox-table th, .report-table th {
    background-color: #f5f5f5;
    font-weight: 600;
}

/* Keep action buttons from wrapping awkwardly and colliding */
.btn-group-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px; /* increase spacing between buttons */
    align-items: center;
}

.btn-group-inline form { display: inline-block; }

/* On very narrow screens, make buttons full-width within the cell */
@media (max-width: 520px) {
    .btn-group-inline { flex-direction: column; align-items: stretch; }
    .btn-group-inline .btn-sml, .btn-group-inline form .btn-sml { width: 100%; text-align: center; }
}


@media (max-width: 768px) {
    /* Keep title centered on mobile */
    header .logo { left: 50%; transform: translateX(-50%); }
    .toolbox-table, .report-table {
        font-size: 14px;
        overflow-x: auto;
        display: block;
    }

    .toolbox-table th, .toolbox-table td,
    .report-table th, .report-table td {
        padding: 8px;
    }
    /* On small screens, keep action buttons readable and stacked with spacing */
    .toolbox-table td .btn-group-inline { flex-direction: column; align-items: stretch; }
    .toolbox-table td .btn-group-inline .btn-sml { width: 100%; text-align: center; }
}

/* Inline text inputs (e.g., filters) should not overflow on small screens */
form input[type="text"] {
    padding: 6px;
    margin-right: 10px;
    width: min(250px, 100%);
    box-sizing: border-box;
}

form .btn {
    background: #be2228;
    color: #fff;
    padding: 6px 12px;
    text-decoration: none;
    border-radius: 4px;
}

.btn {
    padding: 8px 14px;
    background-color: #be2228;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    border: 0; /* remove outer border to avoid vertical lines */
}

/* Remove vertical borders; keep subtle row separators only */
.report-table th, .report-table td {
    padding: 8px 12px;
    border: none;               /* reset */
    border-bottom: 1px solid #eee;
    text-align: left;
}

.report-table th {
    background-color: #f7f7f7;
}


/* General styling for form groups */
.form-group { display: block; margin: 10px 0 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; }

/* Better inline checkbox styling for status field */
.checkbox-inline { display:flex; align-items:center; gap:8px; padding-top: 6px; white-space: nowrap; }
.checkbox-inline input[type="checkbox"] { width:auto; margin:0; }
.checkbox-inline .checkbox-label { font-weight: normal; margin:0; display:inline; white-space: nowrap; }

/* Normalize checkbox alignment across browsers and align with label baseline */
input[type="checkbox"] { position: relative; top: 0; vertical-align: middle; margin-right: 8px; }
label > input[type="checkbox"] { margin-right: 8px; }
.form-group label > input[type="checkbox"] { margin-right: 8px; }


/* Ensure form inputs stack and fill width */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="tel"],
.form-group textarea,
.form-group select { width: 100%; padding: 8px 10px; box-sizing: border-box; display: block; }

/* Label styling */
label { display: block; font-weight: bold; margin-bottom: 5px; color: #333; }

/* Grid helper for two-column form rows */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 700px) {
    .form-grid { grid-template-columns: 1fr; }
}


/* Input field styling */
input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}

/* Input field focus state */
input:focus {
    border-color: #be2228;
    outline: none;
}

/* Submit button styling */
/* Default buttons should size to content; specific forms can override */
button.btn {
    width: auto;
    padding: 8px 12px;
    background-color: #be2228;
    color: white;
    font-size: 15px; /* slightly reduced for compact look */
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

/* Submit button hover state */
button.btn:hover {
    background-color: #a61e24;
}

select {
    width: 100%;
    padding: 8px 12px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    transition: border-color 0.3s ease;
}

/* Dropdown (Select) Styles */
select {
    appearance: none; /* Removes default dropdown arrow for styling */
    background-color: #fff;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 10 10"><polygon points="0,0 5,5 10,0" fill="%23333"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 10px 10px;
    padding-right: 40px;
}

select:focus {
    border-color: #5b9bd5; /* Focus state color */
    outline: none;
}


/* Media query for mobile devices */
@media (max-width: 600px) {
    .register-form, .reset-form {
        padding: 20px;
        max-width: 100%;
    }

    h2 {
        font-size: 20px;
    }

    input {
        font-size: 14px;
        padding: 8px;
    }

    button.btn {
        padding: 8px;
        font-size: 14px;
    }
}

.breadcrumb {
    font-size: 14px;
    margin-bottom: 20px;
    color: #555;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px; /* increase spacing between buttons */
}

.breadcrumb a {
    text-decoration: none;
    color: #be2228;
    font-weight: 500;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    color: #888;
}


/* Profile Form Styling */
.profile-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    background-color: #f7f7f7;
    min-height: 80vh;
}

.profile-form {
    background-color: #fff;
    padding: 24px;
    max-width: 500px;
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.profile-form h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #be2228;
}

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

.profile-form label { display: block; font-weight: bold; margin-bottom: 5px; color: #333; }

.profile-form input {
    width: 100%;
    padding: 8px 12px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.profile-form input:focus {
    border-color: #be2228;
    outline: none;
}

.profile-form .btn {
    width: 100%;
    background-color: #be2228;
    color: #fff;
    border: none;
    padding: 12px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
}

.profile-form .btn:hover {
    background-color: #a61e24;
}

/* Settings Form Styling */
.settings-container {
    display: flex;
    gap: 20px;
    padding: 20px;
}

.settings-sidebar {
    width: 200px;
    min-width: 200px;
    flex: 0 0 200px;
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

.settings-sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.settings-sidebar li a {
    display: block;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    border-left: 4px solid transparent;
}

.settings-sidebar li a.active,
.settings-sidebar li a:hover {
    background-color: #f4f4f4;
    border-left-color: #be2228;
}


.settings-content {
    flex-grow: 1;
    background: #fff;
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

/* Provide a horizontal scrollbar for wide tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Driver Roster grid table lines */
#grid { border-collapse: collapse; width: 100%; }
#grid th, #grid td { border: 1px solid #e5e5e5; }
#grid thead th { background: #f7f7f7; }
#grid tbody th { background:#fafafa; font-weight:600; }
#grid td.slot { vertical-align: top; }

/* Keep settings forms at a sensible width on large screens */
.settings-content form {
    max-width: 900px; /* allow wider forms like Advanced User */
}


.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.4);
    overflow: auto; /* allow scrolling when content is taller than viewport */
}

.modal-content {
    position: absolute; /* allow overlay to scroll if needed */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    max-width: 960px; /* widen modals to avoid cramped dropdowns */
    width: 95%;
    max-height: 85vh; /* prevent oversizing */
    overflow: auto;   /* enable internal scroll for long content */
}

/* Make long, dynamic permission lists inside modals scroll independently */
#permsBody, #sgmBody {
    max-height: 60vh;
    overflow-y: auto;
}

/* Ensure modal header actions remain visible */
.modal-content .close { position: sticky; top: 0; float: right; }

.close {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

.btn-sml-red, .btn-sml-red:link, .btn-sml-red:visited {
    display: inline-block;
    padding: 8px 12px;
    background-color: #be2228;
    color: white;
    font-size: 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s ease;
}
.btn-sml-red:hover, .btn-sml-red:focus {
    background-color: #a61e24;
    color:#fff;
}


/* Settings responsive layout */
@media (max-width: 900px) {
    .settings-container {
        flex-direction: column;
    }
    .settings-sidebar {
        width: 100%;
    }
    .settings-content {
    }
    .settings-content { 
        width: 100%;
    }
    /* Make settings forms fill width on mobile */
    .settings-content form { max-width: 100%; }
}

/* Prevent table overflow on small devices */
@media (max-width: 768px) {
    /* Keep title centered on mobile */
    header .logo { left: 50%; transform: translateX(-50%); }
    .settings-content table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    /* Keep thead visible while scrolling horizontally */
    .settings-content table thead th { position: sticky; top: 0; background: #f7f7f7; z-index: 1; }
}

/* Toast messages */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10001;
    display:flex;
    flex-direction:column;
    align-items:flex-end;
}
.toast {
    padding: 10px 14px;
    border-radius: 6px;
    color: #222;
    background: #fff;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    margin-bottom: 10px;
    opacity: 0;
    transform: translateY(-10px);
    animation: toast-in 0.3s forwards, toast-out 0.3s 8s forwards;
}
.toast.success { border-left: 4px solid #28a745; }
.toast.error { border-left: 4px solid #be2228; }
@keyframes toast-in { to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px); } }


/* Simple upload progress bar */
.upload-progress { position: relative; background:#eee; border-radius:6px; height:12px; margin:10px 0; }
.upload-progress .progress-bar { background:#28a745; height:100%; border-radius:6px 0 0 6px; transition: width 0.2s ease; }
.upload-progress .progress-text { position:absolute; top:-22px; right:0; font-size:12px; color:#333; }

/* Responsive video wrapper for mobile-friendly playback */
.video-wrapper { position: relative; width: 100%; max-width: 960px; margin: 0 auto; }
.video-wrapper video { width: 100%; height: auto; border-radius: 6px; background: #000; }
@media (max-width: 768px) {
    /* Keep title centered on mobile */
    header .logo { left: 50%; transform: translateX(-50%); }
  .video-wrapper { padding: 0 0; }
}

/* Centered safety message under video */
.safety-warning { margin-top: 8px; color:#be2228; font-weight:600; text-align:center; }


/* Mud maps list and buttons */
.letters { display:flex; flex-wrap:wrap; gap:8px; margin:10px 0; }
.btn-small, .btn-small:link, .btn-small:visited { display:inline-block; padding:8px 12px; background:#be2228; color:#fff; border-radius:4px; text-decoration:none; font-size:14px; }
.btn-small:hover { background:#a61e24; color:#fff; }
.list { list-style:none; padding:0; margin:0; }
.list li { background:#fff; border:1px solid #eee; border-radius:6px; padding:12px; margin-bottom:10px; display:grid; grid-template-columns: 1fr auto; grid-template-areas: "title action" "address action"; align-items:start; gap:6px 12px; }
.list li:nth-child(odd){ background:#fafafa; }
.list .store-title { grid-area:title; font-weight:600; }
.list .store-address { grid-area:address; color:#444; }
.list .store-action { grid-area:action; align-self:start; }

/* Inline search form for Mud Maps */
.form-inline { display:flex; align-items:center; gap:8px; flex-wrap:nowrap; }
.form-inline input[type="text"] { flex: 1 1 auto; max-width: 260px; }
.form-inline .btn { padding: 6px 10px; }

/* Improve tap targets on mobile */
@media (max-width: 600px) {
  .letters { gap: 10px; }
  .letters .btn-small { padding: 10px 12px; font-size: 15px; }
  .list li { grid-template-columns: 1fr auto; }
  .form-inline input[type="text"] { max-width: 200px; }
}

/* Toolbox list filter form layout */
.toolbox-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.toolbox-filter input[type="text"] {
    max-width: 240px;
}
.toolbox-filter .btn-sml,
.toolbox-filter .btn-sml-blu {
    padding: 6px 10px;
}


/* Align checkbox with label text for human check */
.human-check label { display: inline-flex; align-items: center; gap:8px; }
.human-check input[type="checkbox"] { width:auto; margin:0; position: relative; top: 0; }

/* Signature pad responsive styles and layout fixes */
/* Target both class and id to cover existing markup safely */
.signature-pad, #signature-pad { width: 100%; max-width: 600px; height: 200px; border:1px solid #ccc; display:block; margin: 6px auto 10px; background:#fff; }
.signature-actions { display:flex; gap:10px; justify-content:center; align-items:center; margin: 8px 0 12px; flex-wrap: wrap; }
/* Desktop: align signature and buttons to the left, keep buttons below the canvas */
@media (min-width: 769px) {
  .signature-pad, #signature-pad { margin-left: 0; margin-right: auto; }
  .signature-actions { justify-content: flex-start; max-width: 600px; margin-left: 0; }
}
@media (max-width: 600px) {
  .signature-pad, #signature-pad { height: 280px; max-width: 100%; }
  .signature-actions { gap:8px; }
}

/* Prevent media from causing horizontal overflow */
img, video { max-width: 100%; height: auto; }

/* Add spacing above human check and center on page */
.human-check { margin-top: 12px; display:flex; justify-content:center; }


/* Align checkboxes and labels nicely inside modals (e.g., Manage Users edit modal) */
.modal .form-group label { display: inline-flex; align-items: center; gap: 8px; }


/* Simple badges for status labels in toolbox list */
.badge { display:inline-block; padding:2px 8px; border-radius:12px; font-size:12px; line-height:1.4; }
.badge-ok { background:#e1f7e9; color:#1e7e34; border:1px solid #a9e0bb; }
.badge-new { background:#fff3cd; color:#856404; border:1px solid #ffeeba; }


/* Status badges for hazard list/view */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    color: #fff;
}
.badge-orange { background-color: #f39c12; }
.badge-green { background-color: #27ae60; }

/* Small action buttons */
.btn-sml-grn {
    background: #27ae60;
    color: #fff;
    border: none;
    padding: 8px 12px; /* match .btn-sml-blu height */
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;   /* match .btn-sml-blu font-size */
    line-height: 1.2;  /* ensure consistent height */
}
.btn-sml-grn:hover { background: #1f8a4d; }

/* Overrides: improve toast visibility and contrast */
.toast.success {
  background-color: #d1e7dd; /* green background */
  color: #0f5132;            /* darker green text */
  border-left-color: #198754;/* darker green accent */
}
.toast.error {
  background-color: #f8d7da; /* red background */
  color: #842029;            /* darker red text */
  border-left-color: #be2228;/* red accent */
}

/* When rendering toolbox admin pages within Settings layout, avoid double containers */
.settings-content .toolbox-container {
    background: transparent;
    box-shadow: none;
    padding: 0;
    margin: 0;
}

/* Horizontal scroll affordance for wide data tables */
.settings-content table { border-collapse: separate; border-spacing: 0; }
.settings-content table td, .settings-content table th { white-space: nowrap; }
.settings-content table tr:nth-child(even) { background: #fafafa; }

/* Button stacking on narrow screens with spacing */
@media (max-width: 600px) {
  .btn, .btn-sml, .btn-sml-blu, .btn-sml-red, .btn-sml-grn { width: 100%; margin-bottom: 8px; }
}

/* Keep first column visible when horizontally scrolling long tables */
.settings-content table.sticky-first-col th:first-child, .settings-content table.sticky-first-col td:first-child {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 2;
}
.settings-content table.sticky-first-col tr:nth-child(even) td:first-child { background: #fafafa; }

\n/* Fuelrest page styles moved from view (2025-10-27) */
  .map-panel { background:#fff; border-radius:10px; padding:14px; box-shadow:0 2px 10px rgba(0,0,0,0.08); }
  .map-toolbar { display:flex; gap:14px; align-items:flex-start; flex-wrap:wrap; margin:10px 0 12px; }
  .map-toolbar .group { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
  /* Make filter container take more horizontal room to avoid squashed text */
  .map-toolbar .group.filters { flex: 1 1 100%; justify-content:flex-start; text-align:left; }

  /* Filter tag styling */
  .tag { display:grid; grid-template-columns: 28px 24px 20px 1fr; align-items:center; gap:10px; padding:8px 12px; border:1px solid #dadada; border-radius:10px; background:#fafafa; min-width:240px; }
  .tag .ico { font-size:18px; line-height:1; text-align:center; }
  .tag input[type="checkbox"] { margin:0; justify-self:start; width:18px; height:18px; }
  .tag .txt { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  /* Make the colour indicator more visible as a bar */
  .swatch { width:20px; height:20px; border-radius:4px; display:inline-block; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12); }
  .swatch.fuel { background:#e53935; }
  .swatch.food { background:#f9a825; }
  .swatch.showers { background:#1e88e5; }
  .swatch.truck_parking { background:#43a047; }
  .swatch.weighbridge { background:#8e24aa; }
  .legend { margin:6px 0 2px; font-size:0.9rem; color:#555; text-align:left; }
  #map { height:480px; border:1px solid #dcdcdc; border-radius:8px; }
  .radius-input { width:120px; padding:6px 8px; border:1px solid #ccc; border-radius:6px; }
  .btn.secondary { background:#f4f5f7; color:#333; border:1px solid #d0d0d0; }

  /* Results list styled like Mud Maps cards */
  .result-list { display:grid; grid-template-columns: 1fr; gap:10px; margin-top:12px; }
  .result-item { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px; border:1px solid #e5e5e5; border-radius:8px; background:#fff; }
  .result-item .meta { flex:1 1 auto; text-align:left; }
  .result-item .meta .name { font-weight:600; color:#222; margin-bottom:4px; }
  .result-item .meta .addr { color:#555; font-size:0.95rem; }
  .result-actions { flex:0 0 auto; }
  .result-actions .btn-view { background:#0077cc; color:#fff; border:none; border-radius:6px; padding:8px 12px; cursor:pointer; }
  /* Open status styling in list */
  .open-badge { margin-left:8px; font-size:0.95rem; }
  .open-badge strong { font-weight:700; }
  .open-badge .yes { color:#2e7d32; font-weight:700; }
  .open-badge .no { color:#be2228; font-weight:700; }

  /* Stack tick boxes vertically on mobile and keep left aligned */
  @media (max-width: 768px) {
    /* Keep title centered on mobile */
    header .logo { left: 50%; transform: translateX(-50%); }
    .map-toolbar .group.filters { flex-direction:column; align-items:flex-start; width:100%; }
    .tag { width:100%; min-width:0; grid-template-columns: 28px 24px 20px auto; }
  }

  @media (max-width: 640px) { #map { height: 380px; } }
\n/* Driver Return Plan styles moved from view (2025-10-27) */
    /* Make this screen use a wider container similar to Mud Maps, but fluid */
    .toolbox-container.drp-wide { max-width: 100%; padding-left: 16px; padding-right: 16px; }

    .drp-toolbar { display:flex; gap:10px; align-items:center; margin-bottom:12px; flex-wrap:nowrap; }
    .drp-toolbar label { margin-right: 4px; }
    /* Make the controls reasonable sizes */
    #drp-site { min-width: 240px; width: 260px; height: 38px; }
    /* Driver Name input: restored original text size and padding; width/height retained for layout consistency */
    #drp-name { min-width: 300px; width: 360px; max-width: 520px; height: 38px; }
    #drp-add { height: 38px; padding: 6px 12px; }
    /* Ensure at least ~12 hours are visible on common desktop widths by using 100px min size */
    .drp-grid { display:grid; grid-template-columns: repeat(24, minmax(100px,1fr)); gap:8px; overflow-x:auto; padding-bottom:14px; width: 100%; }
    .drp-col { background:#fafafa; border:1px solid #e5e5e5; border-radius:8px; min-height: 220px; position: relative; }
    .drp-col h4 { position:sticky; top:0; background:#fff; border-bottom:1px solid #eee; margin:0; padding:8px; font-size:0.92rem; text-align:center; }
    .drp-slot { padding:8px; min-height: 180px; }
    /* Driver bubbles: reduce font size a step and halve inner padding */
    .drp-card { user-select:none; cursor: move; padding:4px 5px; border-radius:10px; border:2px solid #1e7e34; color:#155724; background:#d4edda; margin-bottom:8px; font-weight:600; box-shadow:0 1px 0 rgba(0,0,0,0.05);  font-size: 0.85rem; line-height: 1.25; }
    .drp-card.amb { background:#fff3cd; border-color:#d39e00; color:#856404; }
    .drp-card.late { background:#f8d7da; border-color:#c82333; color:#721c24; }
    .drp-card.dragging { opacity:0.6; }
    .drp-trash { margin-left:auto; border: 2px dashed #999; border-radius: 10px; padding: 10px 14px; min-width: 200px; text-align:center; color:#666; background:#fff; }
    .drp-disabled .drp-card { cursor: default; }
    .autocomplete-list { position:absolute; background:#fff; border:1px solid #ccc; border-radius:6px; padding:4px; z-index: 99; max-height: 240px; overflow:auto; width: 240px; }
    .autocomplete-item { padding:6px 8px; cursor:pointer;  font-size: 0.92rem; }
    .autocomplete-item:hover { background:#f1f1f1; }

    .drp-help { margin: 8px 0 14px 0; font-size: 0.95rem; }
    .drp-legend { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-top: 8px; }
    .drp-key { display:inline-flex; align-items:center; gap:6px; padding:4px 8px; border-radius: 6px; background:#fff; border:1px solid #ddd; }
    .key-green { background:#d4edda; border-color:#1e7e34; color:#155724; }
    .key-amber { background:#fff3cd; border-color:#d39e00; color:#856404; }
    .key-red { background:#f8d7da; border-color:#c82333; color:#721c24; }

    /* Responsive: allow wrapping on smaller screens */
    @media (max-width: 900px) {
      .drp-toolbar { flex-wrap: wrap; }
      .drp-trash { margin-left: 0; width: 100%; }
    }
\n/* CKEditor editable area sizing (moved from toolbox views, 2025-10-27) */

    .ck-editor__editable_inline {

        min-height: 400px;

        resize: vertical; /* Allow vertical resizing */

    }


/* Fuelrest spinner */
.btn .spinner {
  border:2px solid #fff; border-top-color: transparent; border-radius:50%; width:16px; height:16px; vertical-align:-3px; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }



/* Roster modal overlay (fix modal appearing below footer) */
.roster-modal-backdrop {
  display: none;
  position: fixed;
  z-index: 10001;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.4);
  align-items: center;
  justify-content: center;
  overflow: auto;
}
.roster-modal {
  background: #fff;
  border-radius: 8px;
  padding: 16px 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  max-width: 760px;
  width: 95%;
  max-height: 85vh;
  overflow: auto;
  position: relative;
}
.roster-modal header { display:flex; align-items:center; justify-content:space-between; margin-bottom: 12px; }
.roster-modal header h3 { margin: 0; font-size: 1.25rem; }
.roster-modal .body { display:flex; flex-direction: column; gap: 12px; }
.roster-modal .form-row { display:flex; gap:12px; flex-wrap: wrap; }
.roster-modal label { font-weight:600; }
.roster-modal input, .roster-modal select { width: 100%; padding: 8px 10px; }
.roster-modal .checkbox-row { display:flex; gap:18px; }
.roster-modal .actions { display:flex; justify-content:flex-end; gap:10px; margin-top: 8px; }
.roster-modal #modalClose { background:none; border:none; font-size:20px; cursor:pointer; }

/* Dashboard cards and tickers (announcements, tools) */
.dashboard .dash-grid {
  display: grid;
  grid-template-columns: 2fr 1fr; /* Left column wide, right column narrow on desktop */
  gap: 16px;
  align-items: start;
}
@media (max-width: 980px) {
  .dashboard .dash-grid { grid-template-columns: 1fr; }
}

/* Card appearance */
.dashboard .card {
  background:#fff;
  border:1px solid #e5e5e5;
  border-radius:8px;
  padding:14px;
  box-shadow:0 1px 2px rgba(0,0,0,0.04);
  display:flex;
  flex-direction:column;
}
/* No card-wide behavior needed; two-column grid establishes the layout */

.ticker { position: relative; overflow: hidden; border: 1px solid #eee; border-radius: 6px; background:#fafafa; height: 280px; }
.ticker { --scroll-speed: 24s; }
.ticker__track { display: block; padding: 8px 10px; animation: ticker-vert var(--scroll-speed) linear infinite; will-change: transform; }
.ticker__item { color:#222; padding: 8px 0; }
/* Announcement container box */
.ann-box { display:flex; align-items:flex-start; gap:10px; background:#fff; border:1px solid #e5e5e5; border-radius:8px; padding:10px 12px; box-shadow:0 1px 2px rgba(0,0,0,0.04); }
@keyframes ticker-vert { from { transform: translateY(0); } to { transform: translateY(-50%); } }
.ann-item .ann-ico { display:inline-flex; width:24px; height:24px; }
.ann-item .ann-text { display:inline-block; white-space: normal; overflow-wrap: anywhere; }

/* Ensure long text in announcements doesn't overflow cards */
.dashboard .card .ann-list { list-style:none; margin:0; padding: 0 4px; }
.dashboard .card .ann-list .ann-item { display:flex; gap:10px; align-items:center; padding: 8px 0; border-bottom: 1px dashed #e8e8e8; }
.dashboard .card .ann-list .ann-item:last-child { border-bottom: 0; }

/* NHVR Rego widget: hide loading message by default */
.rego-loading { display: none; }

/* NHVR Rego grid formatting */
.rego-card form { margin-top: 16px; }
.rego-results { margin-top: 14px; }
.rego-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.rego-field { background:#fff; border:1px solid #e5e5e5; border-radius:8px; padding:10px 12px; }
.rego-label { display:block; font-size:12px; color:#666; text-transform:uppercase; letter-spacing:0.02em; margin-bottom:6px; }
.rego-value { font-weight:600; color:#222; }
.badge-status { display:inline-block; padding:6px 10px; border-radius:14px; color:#fff; font-weight:600; }
.badge-status.ok { background:#2e7d32; }
.badge-status.bad { background:#be2228; }
/* --- Overrides 2025-10-28: Announcement containers, wrapping, and wide cards --- */

/* Increase spacing between scroller items and wrap text */
.ticker__item { padding: 8px 0; }
.ann-item .ann-text { white-space: normal; overflow-wrap: anywhere; }
/* Container box for each announcement line */
.ann-box { display:flex; align-items:flex-start; gap:10px; background:#fff; border:1px solid #e5e5e5; border-radius:8px; padding:10px 12px; box-shadow:0 1px 2px rgba(0,0,0,0.04); }

/* Make non-scrolling announcement lists roomier as well */
.dashboard .card .ann-list .ann-item { padding: 8px 0; }

/* NHVR Rego grid formatting (Tools > NHVR Registration Check) */
.rego-card form { margin-top: 16px; }
.rego-results { margin-top: 14px; }
.rego-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.rego-field { background:#fff; border:1px solid #e5e5e5; border-radius:8px; padding:10px 12px; }
.rego-label { display:block; font-size:12px; color:#666; text-transform:uppercase; letter-spacing:0.02em; margin-bottom:6px; }
.rego-value { font-weight:600; color:#222; }
.badge-status { display:inline-block; padding:6px 10px; border-radius:14px; color:#fff; font-weight:600; }
.badge-status.ok { background:#2e7d32; }
.badge-status.bad { background:#be2228; }
/* --- Overrides added 2025-11-09: DRP full-width + Roster card colours --- */
/* Make Driver Return Plan container full width, edge-to-edge */
.toolbox-container.drp-wide { max-width: 100%; padding-left: 0; padding-right: 0; margin-left: 0; margin-right: 0; border-radius: 0; }
/* Restore side padding just for Operations > General Announcements */
.toolbox-container.drp-wide.ops-ann { padding-left: 16px; padding-right: 16px; }
/* Remove page-side padding on DRP page so container can truly span full width */
.content.drp-content { padding-left: 0; padding-right: 0; }
/* Keep a little breathing room for the grid inside */
.drp-grid { padding-left: 12px; padding-right: 12px; }

/* Driver Roster: coloured driver cards */
#grid .card {
  user-select: none;
  cursor: move;
  padding: 4px 6px;
  border-radius: 10px;
  border: 2px solid #1e7e34;  /* compliant (green) */
  color: #155724;
  background: #d4edda;
  margin: 4px 0;
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1.25;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}
#grid .card.warn { /* leave/sick */
  background: #fff3cd;
  border-color: #d39e00;
  color: #856404;
}
#grid .card.breach { /* breach */
  background: #f8d7da;
  border-color: #c82333;
  color: #721c24;
}
#grid .card.basic { /* optional subtle cue for Basic (BFM) scheme */
  box-shadow: inset 0 0 0 2px rgba(0,102,204,0.15);
}
#grid td.slot.dragover { outline: 2px dashed #999; outline-offset: -4px; }
/* --- End Overrides (2025-11-09) --- */

/* --- DRP padding align to roster (2025-11-10) --- */
.content.drp-content { padding-left: 20px; padding-right: 20px; }
.content.drp-content .toolbox-container.drp-wide { max-width: 100%; margin: 0; padding-left: 16px; padding-right: 16px; border-radius: 0; }
.content.drp-content .drp-grid { padding-left: 0; padding-right: 0; }
/* --- End DRP padding align --- */



/* Compact form sizing adjustments (2025-11-11) */
.register-form label, .reset-form label { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.register-form input, .reset-form input, .register-form select, .reset-form select { font-size: 15px; padding: 7px 10px; }
.register-form .btn, .reset-form .btn { background-color: #be2228; color: #fff; font-size: 15px; padding: 8px 12px; }
/* Overrides: password eye toggle size and focus style (2025-11-15) */
.password-wrapper input[type="password"],
.password-wrapper input[type="text"] { padding-right: 44px !important; }
.password-wrapper .pw-overlay { right: 44px !important; }
.eye-toggle { width: 40px !important; height: 30px !important; }
.eye-toggle:focus { outline: none !important; }
.eye-toggle:focus-visible { outline: 2px solid #666; outline-offset: 2px; border-radius: 4px; }
.eye-toggle svg { width: 100%; height: auto; display: block; }

/* Auth form override (2025-11-15): prevent generic inline filter rule from shrinking login/register inputs
   When the password input toggles to type="text", the rule `form input[type="text"]` limits width to 250px.
   Keep auth inputs full width to avoid visible resize during show/hide. */
.login-form input[type="text"],
.register-form input[type="text"],
.reset-form input[type="text"] {
  width: 100% !important;
}

/* Disaster settings: align labels and inputs in Create/Edit Store modals (2025-11-20) */
.modal-content .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.modal-content .grid label { display: flex; flex-direction: column; gap: 6px; margin: 0; font-weight: 600; color: #333; }
.modal-content .grid label > input,
.modal-content .grid label > select,
.modal-content .grid label > textarea { width: 100%; }
/** Disaster settings: align labels and inputs in Create/Edit Store modals (2025-11-20) */
.modal-content .grid {
  display: grid; /* ensure grid even if inline style missing */
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}
.modal-content .grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  font-weight: 600;
  color: #333;
}
.modal-content .grid label > input,
.modal-content .grid label > select,
.modal-content .grid label > textarea {
  width: 100%;
  padding: 8px 10px;
  box-sizing: border-box;
}
/* Single column on narrow screens for readability */
@media (max-width: 820px) {
  .modal-content .grid { grid-template-columns: 1fr !important; }
}

/* Chat widget sizing: make input fill the card width on all viewports */
.dashboard .card.card-wide #chat-form { display: block; }
.dashboard .card.card-wide #chat-input { width: 100%; max-width: 100%; box-sizing: border-box; }

/* Unify announcement list look when not scrolling */
.dashboard .card .ann-list .ann-item { /* ensure same container style as ticker items */ }

/* Ensure chat input uses full width across breakpoints */
.dashboard .card.card-wide .chat-input { width: 100%; max-width: 100%; box-sizing: border-box; }

/* Make non-scrolling announcement lists use same boxed style visually */
.dashboard .card .ann-list .ann-item { background:#fff; border:1px solid #e5e5e5; border-radius:8px; padding:10px 12px; box-shadow:0 1px 2px rgba(0,0,0,0.04); margin:8px 4px; }
/* Remove horizontal overflow from chat form now that input is 100% width */
.dashboard .card.card-wide #chat-form { overflow-x: hidden; }
/* Ensure chat input uses full width across breakpoints */
.dashboard .card.card-wide .chat-input { width: 100%; max-width: 100%; box-sizing: border-box; }


/* Chat attachments rendering */
.chat-attachments { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 4px 0 10px; }
.chat-attachments img { display: block; width: 100%; height: auto; border-radius: 6px; border: 1px solid #eee; background: #fff; }
.chat-item.pending .chat-meta::after { content: " (sending...)"; opacity: 0.7; }
  .dashboard .card { width: 100%; max-width: 100%; margin: 0 auto; }
  .dashboard .card form, .dashboard .card .text-input, .dashboard .card textarea, .dashboard .card input[type="text"], .dashboard .card button.btn { width: 100%; max-width: 100%; }
}

/* Dashboard form element sizing to maintain alignment */
.dashboard .card form,
.dashboard .card .text-input,
.dashboard .card textarea,
.dashboard .card input[type=\"text\"],
.dashboard .card button.btn {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Dashboard button padding tweaks (2025-11-22) */
#dash-btn-search { padding: 10px 14px; margin-top: 6px; }
#dash-btn-send { padding: 10px 14px; margin-top: 6px; }

/* Normalize General Chat action row button styles so label and button match */
#chat-form .btn, #chat-form label.btn {
  font-size: 15px;
  line-height: 1.2;
  padding: 8px 12px; /* match button.btn rule */
  height: 36px;      /* consistent height across all three controls */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}


/* General Chat actions row: keep Attach label on one line and let it grow; shrink Emoji and Post */
.chat-actions { margin-top: 6px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; align-items: stretch; width: 100%; }
.chat-actions .btn, .chat-actions label.btn { width: 100% !important; }
.chat-actions label[for="chat-files"] { white-space: nowrap; font-weight: normal; }
.chat-actions #emoji-btn, .chat-actions #chat-send { font-size: 14px; padding: 6px 10px; height: 36px; }


#chat-list { max-height: 280px; overflow-y: auto; padding-right: 4px; }
.chat-item { margin-bottom: 10px; }
.chat-meta { opacity: 0.6; font-size: 12px; }
.chat-text { margin-bottom: 8px; font-size: 15px; }
#chat-files { display: none; }
.emoji-menu { background:#fff; border:1px solid #ddd; border-radius:6px; box-shadow:0 6px 20px rgba(0,0,0,0.12); padding:6px; }
.emoji-menu .emoji-item { font-size:20px; margin:4px; border:none; background:transparent; cursor:pointer; }

@media (max-width: 520px) {
  .chat-actions { grid-template-columns: 1fr; }
}
