/* ============================================
   CSS Variables — Midwest Mole Color Scheme
   Black / Red / White / Grey
   ============================================ */
:root {
    --primary-red: #df1617;
    --primary-dark: #b01214;
    --accent-red: #E31837;
    --secondary-black: #1a1a1a;
    --dark-bg: #222222;
    --white: #ffffff;
    --off-white: #f2f2f2;
    --light-gray: #f5f5f5;
    --medium-gray: #e0e0e0;
    --border-gray: #d0d0d0;
    --text-dark: #222222;
    --text-muted: #666666;
    --sidebar-bg: #2a2a2a;
    --nav-hover: #df1617;
}

body {
    font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-dark);
    background-color: var(--off-white);
    margin: 0;
    padding: 0;
    padding-top: 60px;
    padding-bottom: 40px;
}

a { color: var(--primary-red); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: none; }

/* ============================================
   Utility Helpers (carried from original)
   ============================================ */
.left { text-align: left } .right { text-align: right } .center { text-align: center }
.f-left { float: left } .f-right { float: right }
.clear { clear: both }

/* ============================================
   Top Navbar — Fixed
   ============================================ */
.header-area .navbar {
    background: linear-gradient(135deg, var(--secondary-black) 0%, #333 100%);
    border: none;
    border-bottom: 3px solid var(--primary-red);
    padding: 0;
    min-height: 56px;
    z-index: 1040;
}

.header-area .navbar .container-fluid {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    padding: 0 15px;
}

/* Brand Area */
.brand-area {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: background 0.2s;
}
.toggle:hover { background: rgba(255,255,255,0.1); }
.toggle span,
.toggle span::before,
.toggle span::after {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
    position: relative;
    transition: all 0.3s;
}
.toggle span::before,
.toggle span::after {
    content: '';
    position: absolute;
    left: 0;
    width: 22px;
}
.toggle span::before { top: -7px; }
.toggle span::after { top: 7px; }

.navbar-brand {
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: 700;
    font-size: 20px;
    color: var(--white) !important;
    padding: 0;
    margin: 0;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.navbar-brand:hover { color: var(--primary-red) !important; }

.navbar-brand-logo {
    height: 38px;
    width: auto;
    margin-right: 8px;
    vertical-align: middle;
}

/* ============================================
   Main Horizontal Nav
   ============================================ */
#main-navbar {
    flex: 1;
    overflow: visible;
}

#main-navbar > ul.nav {
    display: flex;
    flex-wrap: nowrap;
    list-style: none;
    margin: 0;
    padding: 0;
}

#main-navbar > ul.nav > li {
    position: relative;
}

#main-navbar > ul.nav > li > a {
    display: block;
    padding: 16px 14px;
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    font-weight: 600;
    transition: color 0.2s, background 0.2s;
    white-space: nowrap;
}

#main-navbar > ul.nav > li > a:hover,
#main-navbar > ul.nav > li.active > a {
    color: var(--white);
    background: var(--primary-red);
}

#main-navbar > ul.nav > li > a i {
    margin-right: 4px;
}

.hide-custom {
    /* shown on desktop, hide on small */
}

/* Dropdown Menus */
#main-navbar .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1050;
    min-width: 220px;
    background: var(--secondary-black);
    border: 1px solid #444;
    border-top: 3px solid var(--primary-red);
    border-radius: 0 0 4px 4px;
    padding: 4px 0;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    list-style: none;
    margin: 0;
}

#main-navbar li:hover > .dropdown-menu {
    display: block;
}

#main-navbar .dropdown-menu li a {
    display: block;
    padding: 8px 18px;
    color: rgba(255,255,255,0.8);
    font-size: 13px;
    transition: all 0.15s;
    white-space: nowrap;
}

#main-navbar .dropdown-menu li a:hover {
    background: var(--primary-red);
    color: var(--white);
}

#main-navbar .dropdown-menu li a i {
    width: 20px;
    text-align: center;
    margin-right: 8px;
    color: var(--primary-red);
}

#main-navbar .dropdown-menu li a:hover i {
    color: var(--white);
}

/* Sub-dropdown (nested) */
#main-navbar .dropdown-menu .dropdown-menu {
    top: 0;
    left: 100%;
    border-top: none;
    border-left: 3px solid var(--primary-red);
}

.caret {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 4px;
    vertical-align: middle;
    border-top: 4px solid;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
}

/* Right Side Nav Icons */
.navbar-right-icons {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
}

.navbar-right-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: rgba(255,255,255,0.8);
    font-size: 18px;
    border-radius: 50%;
    transition: all 0.2s;
    position: relative;
}
.navbar-right-icons a:hover {
    color: var(--white);
    background: var(--primary-red);
}

.total_unread_notifications:not(:empty) {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--primary-red);
    color: var(--white);
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 10px;
    font-weight: 700;
}

/* ============================================
   Content Area
   ============================================ */
.content-area {
    padding: 20px;
    transition: margin-left 0.3s;
}

.content-area .content {
    margin-bottom: 20px;
}

/* ============================================
   Menu Blocks / Widgets
   ============================================ */
.menus {
    background: var(--white);
    border-radius: 6px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid var(--medium-gray);
    overflow: hidden;
}

.menus-caption {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--white);
    background: linear-gradient(135deg, var(--secondary-black), #333);
    padding: 12px 18px;
    margin: 0;
    border-bottom: 3px solid var(--primary-red);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.menus-text {
    padding: 15px;
}

/* Alert Widget */
.menus.ss_alerts {
    border-color: var(--primary-red);
}
.menus.ss_alerts .menus-caption {
    background: var(--primary-red);
}
.menus.ss_alerts .menus-text {
    background: #fff5f5;
    color: #8b0000;
    font-size: 13px;
}

.alert-item {
    padding: 6px 0;
    border-bottom: 1px solid rgba(223,22,23,0.15);
}
.alert-item:last-child { border-bottom: none; }
.alert-item a { color: var(--primary-red); font-weight: 600; }
.alert-item a:hover { color: var(--primary-dark); text-decoration: underline; }

/* Dashboard buttons grid */
.menus.txt_msgr .btn-primary,
.menus.txt_msgr .btn-large {
    background: var(--primary-red) !important;
    border-color: var(--primary-dark) !important;
    color: var(--white) !important;
    font-weight: 600;
    font-size: 13px;
    border-radius: 6px;
    transition: all 0.2s;
    padding: 10px 8px;
}
.menus.txt_msgr .btn-primary:hover {
    background: var(--primary-dark) !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(223,22,23,0.3);
}

/* ============================================
   Right Sidebar (Off-Canvas Drawers)
   ============================================ */
.onoffcanvas {
    position: fixed;
    top: 59px;
    bottom: 0;
    right: -340px;
    width: 320px;
    max-width: 90vw;
    background: var(--sidebar-bg);
    color: var(--white);
    z-index: 1035;
    overflow-y: auto;
    transition: right 0.3s ease;
    box-shadow: -4px 0 20px rgba(0,0,0,0.3);
    border-left: 3px solid var(--primary-red);
}

.onoffcanvas.is-open {
    right: 0;
}

.sidebar-inner {
    padding: 15px;
}

.sidebar-inner .menus {
    background: #333;
    border-color: #444;
}

.sidebar-inner .menus-text {
    padding: 10px;
}

.sidebar-inner .row {
    margin-bottom: 10px;
}

.sidebar-inner .btn {
    width: 100%;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 15px;
    border-radius: 4px;
    text-align: center;
    display: block;
}

.sidebar-inner .btn-primary {
    background: var(--primary-red);
    border-color: var(--primary-dark);
    color: var(--white);
}
.sidebar-inner .btn-primary:hover {
    background: var(--primary-dark);
}

.sidebar-inner .btn-warning {
    background: #e67e22;
    border-color: #d35400;
    color: var(--white);
}
.sidebar-inner .btn-warning:hover {
    background: #d35400;
}

.sidebar-inner .btn-danger {
    background: #c0392b;
    border-color: #a93226;
    color: var(--white);
}
.sidebar-inner .btn-danger:hover {
    background: #a93226;
}

.sidebar-inner .btn-success {
    background: #27ae60;
    border-color: #229954;
    color: var(--white);
}

.schedule-heading {
    color: var(--white);
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    border-bottom: 2px solid var(--primary-red);
    padding-bottom: 6px;
}

.schedule .form-control {
    background: #444;
    border-color: #555;
    color: var(--white);
    margin-bottom: 10px;
    font-size: 13px;
}
.schedule .form-control::placeholder { color: #999; }

.driver_schedule-stop {
    background: #3a3a3a;
    border-radius: 4px;
    margin-bottom: 6px;
    border-left: 3px solid var(--primary-red);
}
.driver_schedule-stop a {
    display: block;
    padding: 10px 12px;
    color: rgba(255,255,255,0.9);
    transition: background 0.15s;
}
.driver_schedule-stop a:hover {
    background: rgba(223,22,23,0.15);
}
.driver_schedule-stop p { margin: 0; }

.sidebar-footer {
    padding: 10px 15px;
    border-top: 1px solid #444;
}

/* Chat sidebar */
#cfrChat iframe {
    width: 100%;
    border: none;
    border-radius: 4px;
    background: #333;
}

/* ============================================
   Vertical Side Nav (Drawer Menu)
   ============================================ */
.wrapper {
    position: fixed;
    top: 59px;
    left: -280px;
    bottom: 0;
    width: 270px;
    background: var(--secondary-black);
    z-index: 1035;
    overflow-y: auto;
    transition: left 0.3s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    border-right: 3px solid var(--primary-red);
}
.wrapper.active {
    left: 0;
}

#vertical-nav {
    padding: 10px 0;
}

#vertical-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

#vertical-nav > ul.first-nav > li > a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

#vertical-nav > ul.first-nav > li > a:hover,
#vertical-nav > ul.first-nav > li.active > a {
    background: rgba(223,22,23,0.12);
    color: var(--white);
    border-left-color: var(--primary-red);
}

#vertical-nav > ul.first-nav > li > a i {
    width: 24px;
    text-align: center;
    margin-right: 10px;
    color: var(--primary-red);
}

/* Sub-nav items */
#vertical-nav .ulsub {
    display: none;
    background: rgba(0,0,0,0.2);
}
#vertical-nav li:hover > .ulsub,
#vertical-nav li.active > .ulsub {
    display: block;
}

#vertical-nav .ulsub li a {
    display: flex;
    align-items: center;
    padding: 9px 20px 9px 42px;
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    transition: all 0.15s;
}

#vertical-nav .ulsub li a:hover {
    color: var(--white);
    background: rgba(223,22,23,0.1);
}

#vertical-nav .ulsub li a i {
    width: 20px;
    text-align: center;
    margin-right: 8px;
    color: var(--primary-red);
    font-size: 12px;
}

#vertical-nav .ulsub .ulsub li a {
    padding-left: 58px;
}

.has-arrow::after {
    content: '\f105';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    float: right;
    margin-left: auto;
    padding-left: 10px;
    transition: transform 0.2s;
}
li:hover > .has-arrow::after {
    transform: rotate(90deg);
}

/* ============================================
   Modal (BS5)
   ============================================ */
.modal-content {
    border-radius: 8px;
    overflow: hidden;
    border: none;
}
.modal-header {
    background: var(--secondary-black);
    color: var(--white);
    border-bottom: 3px solid var(--primary-red);
    padding: 14px 20px;
}
.modal-header .modal-title {
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
}
.modal-header .btn-close {
    filter: invert(1);
    opacity: 0.8;
}
.modal-header .btn-close:hover { opacity: 1; }
.modal-body { padding: 20px; }
.modal-footer {
    background: var(--light-gray);
    border-top: 1px solid var(--border-gray);
}
.modal-footer .btn-primary {
    background: var(--primary-red);
    border-color: var(--primary-dark);
}
.modal-footer .btn-primary:hover {
    background: var(--primary-dark);
}

/* ============================================
   Footer
   ============================================ */
footer.footer {
    background: linear-gradient(135deg, var(--secondary-black), #333);
    color: rgba(255,255,255,0.7);
    padding: 12px 20px;
    font-size: 13px;
    border-top: 3px solid var(--primary-red);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1030;
}
footer.footer i.fa-copyright { color: var(--primary-red); }

/* ============================================
   Notifications
   ============================================ */
.notifications { position: fixed; z-index: 10001; }
.notifications.center { top: 48%; left: 0; width: 100%; }
#uiAlert { z-index: 10001; }
#uiAlert .alert { z-index: 10000; box-shadow: 1px 4px 5px rgba(0,0,0,0.4); }

/* ============================================
   Bootstrap 5 Overrides for App Theme
   ============================================ */
.btn-primary {
    background-color: var(--primary-red);
    border-color: var(--primary-dark);
}
.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: #8c0e10;
}

.form-control:focus {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 0.2rem rgba(223, 22, 23, 0.25);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 991px) {
    #main-navbar { display: none !important; }
    .wrapper.hidden { display: block !important; visibility: visible !important; }
    .brand-area .navbar-brand { font-size: 16px; }
}

@media (min-width: 992px) {
    .wrapper { display: none !important; }
    #main-navbar { display: block !important; }
}

/* wysiwyg compat */
a.e-wysiwyg-toggle { margin-top: 5px; }
.mce-tinymce.mce-fullscreen { z-index: 1050 !important; }

/* noscript alert */
noscript .alert { margin: 20px; }

/* ============================================
   Silo / Status Widgets
   ============================================ */
.menus.ss_silolevels_menu h4,
.menus.ss_todays_upcoming_fills h4,
.menus.ss_todays_completed_fills h4 {
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: 700;
    color: var(--secondary-black);
    border-bottom: 2px solid var(--primary-red);
    padding-bottom: 8px;
}

.menus.ss_mgr_driver_status h4 a {
    color: var(--primary-red);
    font-weight: 700;
}

/* e107 compat */
.e-tip { cursor: help; }
.badge { vertical-align: middle; }

/* Print */
@media print {
    .header-area, footer.footer, .onoffcanvas, .wrapper { display: none !important; }
    body { padding: 0; }
    .content-area { margin: 0; padding: 0; }
}

/* LOGIN TEMPLATE */
#login-template {
    max-width: 1000px;
    margin-right: auto;
    margin-left: auto;
}
.card-signin#login-template {
    width: 95%;
    margin-right: auto;
    margin-left: auto;
}