/* Modern sleek design */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap');

:root {
    --bg: linear-gradient(135deg, #f8f8f8 0%, #e8e8e8 100%);
    --text: #333;
    --header-bg: rgba(255, 255, 255, 0.95);
    --nav-bg: #ffffff;
    --nav-link: #555;
    --nav-height: 56px;
    --nav-hover: rgba(85, 85, 85, 0.1);
    --section-bg: #f8f8f8;
    --section-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --forecast-bg: #ffffff;
    --closure-bg: #f8d7da;
    --alert-bg: #fff3cd;
    --link: #007bff;
    --link-visited: #6c757d;
}

.dark {
    --bg: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    --text: #ecf0f1;
    --header-bg: rgba(0, 0, 0, 0.95);
    --nav-bg: #000000;
    --nav-link: #bdc3c7;
    --nav-hover: rgba(189, 195, 199, 0.1);
    --section-bg: #1a1a1a;
    --section-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    --forecast-bg: #000000;
    --closure-bg: #8B0000;
    --alert-bg: #FFD700;
    --link: #add8e6;
    --link-visited: #add8e6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Segoe UI Emoji', 'Noto Color Emoji', 'Apple Color Emoji', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.3s, color 0.3s;
}

a {
    color: var(--link);
    text-decoration: none;
    transition: color 0.3s;
}

a:visited {
    color: var(--link-visited);
}

a:hover {
    text-decoration: underline;
}

ul {
    margin-left: 1em;
}

ul ul {
    margin-left: 2em;
}

.steps > li {
    margin-bottom: 1em;
}

header {
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    display: block; /* stack top row and nav */
}

.logout-btn {
    color: gray;
    text-decoration: none;
    font-size: 0.9rem;
    position: absolute; /* pin to left of header top row */
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.center {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center; /* center logos + title horizontally */
}

.right {
    position: absolute; /* pin to right of header top row */
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.greeting {
    color: var(--text);
    font-size: 1rem;
}

header h1 {
    font-weight: 600;
    font-size: 2rem;
    margin: 0.5rem 0;
    color: var(--text);
    position: relative;
}

header h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, rgba(0, 255, 0, 0.4), transparent);
}

header img {
    height: 60px;
    margin: 0 0.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Header bottom area: pins Home left and Admin right */
/* Make header and nav stack in normal flow (stable across pages) */
header { padding-bottom: 0; overflow: visible; position: relative; z-index: 30; }
.header-top {
    display: flex;
    align-items: center;
    justify-content: center; /* center logos/title */
    position: relative;
    padding: 0.75rem 1rem;
}
.header-top .logout-btn {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
}
.header-top .right {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}
.header-bottom {
    position: static; /* keep nav below the top row in normal flow */
    display: block;
    pointer-events: auto;
    width: 100%;
    z-index: 20;
    border-top: 1px solid rgba(0,0,0,0.03);
}

/* Make the nav visually separated from the top header */
.header-bottom nav {
    background: var(--nav-bg);
    padding: 0.35rem 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Ensure the nav is a single horizontal flex row: left home, centered nav, right admin */
.header-bottom nav {
    display: flex;
    align-items: center;
    height: var(--nav-height);
}

.header-top { padding-bottom: 0.35rem; }
.header-left, .header-right {
    padding: 6px 10px;
    text-decoration: none;
    color: var(--nav-link);
    background: transparent;
    border-radius: 6px;
    font-weight: 600;
}
.header-left:hover, .header-right:hover {
    background: var(--nav-hover);
    color: var(--text);
}

main {
    width: 100%;
    /* Keep page content positioned below the pinned nav with a small gap */
    margin: calc(var(--nav-height) + 0.5rem) auto 0;
    padding: 0 1rem;
}

/* Admin area small extra spacing to avoid overlap with admin tabs */
.admin-area main {
    margin-top: calc(var(--nav-height) + 0.5rem);
}

/* Responsive: on small screens keep nav in normal flow so it doesn't overlap content */
@media (max-width: 800px) {
    header { padding-bottom: 0; }
    .header-bottom { position: static; }
    main { margin-top: 0; }
    .nav-center { overflow-x: auto; }
}

.home-link,
.admin-link {
    display: flex;
    align-items: center;
    padding: 0 1.2rem;
    color: var(--nav-link);
    text-decoration: none;
    font-weight: 400;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    height: var(--nav-height);
}

.home-link:hover {
    color: var(--text);
    background: var(--nav-hover);
    border-bottom-color: rgba(0, 255, 0, 0.4);
    box-shadow: 0 0 0 1px rgba(0, 255, 0, 0.4);
}

.nav-center {
    max-width: 1220px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0 1rem;
    flex: 1 1 auto; /* allow center area to grow between Home and Admin */
}

.nav-arrow {
    background: var(--nav-bg);
    border: none;
    color: var(--nav-link);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    margin: 0 0.25rem;
    border-radius: 50%;
    transition: background 0.3s;
    z-index: 2;
    min-width: 32px;
    min-height: 32px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.nav-arrow:hover {
    background: var(--nav-hover);
    color: var(--text);
}

nav ul {
    list-style: none;
    display: flex;
    flex-wrap: nowrap; /* keep everything on one line */
    justify-content: center;
    gap: 2.25rem;
    margin: 0;
    padding: 0;
    overflow: hidden; /* avoid wrapping into multiple lines */
    white-space: nowrap;
}

nav ul::-webkit-scrollbar {
    height: 6px;
}

nav ul::-webkit-scrollbar-track {
    background: transparent;
}

nav ul::-webkit-scrollbar-thumb {
    background: var(--text);
    border-radius: 3px;
}

nav ul::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 0, 0.4);
}

nav li {
    margin: 0;
    flex: 0 0 auto;
}

nav li.active a {
    box-shadow: 0 4px 12px rgba(128, 128, 128, 0.6);
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), rgba(128, 128, 128, 0.2));
    border-bottom: 2px solid rgba(0, 255, 0, 0.7);
    transform: translateY(-2px);
}

.home-link { margin-right: 1rem; }
.admin-link { margin-left: auto; }

.admin-link:hover {
    color: var(--text);
    background: var(--nav-hover);
    border-bottom-color: rgba(0, 255, 0, 0.4);
    box-shadow: 0 0 0 1px rgba(0, 255, 0, 0.4);
}

/* Pinned Call Intake link removed — feature deprecated until re-added */

nav a {
    display: inline-block;
    padding: 1rem;
    color: var(--nav-link);
    text-decoration: none;
    font-weight: 400;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

nav a:hover {
    color: var(--text);
    background: none;
    border-bottom-color: rgba(0, 255, 0, 0.4);
    box-shadow: 0 0 0 1px rgba(0, 255, 0, 0.4);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 1px rgba(0, 255, 0, 0.4); }
    50% { box-shadow: 0 0 0 3px rgba(0, 255, 0, 0.2); }
    100% { box-shadow: 0 0 0 1px rgba(0, 255, 0, 0.4); }
}

.dark nav a:hover {
    color: var(--text);
    background: none;
    border-bottom-color: rgba(0, 255, 0, 0.4);
    box-shadow: 0 0 0 1px rgba(0, 255, 0, 0.4);
    animation: pulse 1s infinite;
}

main {
    width: 100%;
    /* Nav is reserved by header padding; let main follow directly under the nav */
    margin: 0 auto;
    padding: 0 1rem;
}

/* Admin area may still need slight extra top spacing for the admin tabs */
.admin-area main {
    margin-top: calc(var(--nav-height) + 0.5rem);
}

section {
    background: var(--section-bg);
    margin-bottom: 2rem;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--section-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

section:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

section h2 {
    font-weight: 600;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text);
    border-bottom: 2px solid rgba(0, 255, 0, 0.4);
    padding-bottom: 0.5rem;
}

section h2 a {
    text-decoration: none;
    color: inherit;
}

/* Payroll list spacing and readability */
.payroll-company {
    padding-top: 0.5rem;
}
.payroll-driver {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.payroll-driver h3 {
    margin-bottom: 0.35rem;
    font-size: 1.1rem;
}
.payroll-driver ul {
    margin-left: 1.25rem;
}
.payroll-driver ul li {
    margin-bottom: 0.25rem;
}

/* Briefing-style grid used by Daily Briefing and Upcoming */
.briefing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    align-items: start;
}

.brief-item {
    background: var(--forecast-bg);
    padding: 12px 14px;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    color: var(--text);
    min-height: 72px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.brief-item strong { display:block; margin-bottom:6px; font-weight:600; }

/* Active upcoming item: event includes today or today's date falls within start/end */
.brief-item.active-upcoming {
    /* full red border for active items */
    box-shadow: 0 12px 40px rgba(229,57,53,0.26) !important;
    border: 3px solid #e53935 !important;
    transform: translateY(-2px);
    /* ensure border doesn't clip rounded corners */
    border-radius: 10px !important;
}

/* Color coding by upcoming type — full-card backgrounds */
.brief-item.up-type-vacation {
    background: linear-gradient(135deg,#1e88e5,#1976d2);
    color: #fff;
    border-left-color: #1565c0;
    box-shadow: 0 8px 28px rgba(30,136,229,0.12);
}
.brief-item.up-type-leave_early {
    background: linear-gradient(135deg,#fb8c00,#f57c00);
    color: #fff;
    border-left-color: #ef6c00;
    box-shadow: 0 8px 28px rgba(251,140,0,0.12);
}
.brief-item.up-type-appointment {
    background: linear-gradient(135deg,#8e24aa,#7b1fa2);
    color: #fff;
    border-left-color: #6a1b9a;
    box-shadow: 0 8px 28px rgba(142,36,170,0.12);
}
.brief-item.up-type-day_off,
.brief-item.up-type-day-off,
.brief-item.up-type-dayoff {
    background: linear-gradient(135deg,#43a047,#388e3c);
    color: #fff;
    border-left-color: #2e7d32;
    box-shadow: 0 8px 28px rgba(67,160,71,0.12);
}
.brief-item.up-type-other {
    background: var(--forecast-bg);
    color: var(--text);
    border-left-color: #9e9e9e;
    box-shadow: 0 6px 20px rgba(0,0,0,0.04);
}

/* Absences (active upcoming items) styling — match Daily Briefing / Upcoming */
#briefing-absences-container {
    margin-top: 1rem;
}
#briefing-absences-container h3 {
    font-size: 1.05rem;
    margin: 0 0 8px 0;
    color: var(--text);
    font-weight: 700;
    position: relative;
    padding-bottom: 0.5rem;
}

/* half-length green underline matching other headers but shorter */
#briefing-absences-container h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0.15rem;
    height: 2px;
    width: 50%;
    background: rgba(0, 255, 0, 0.4);
}
#briefing-absences {
    padding: 0.5rem 0 0 0;
}
/* Absences container: left-aligned layout */
#briefing-absences {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-start; /* start at left */
    align-items: flex-start;
    width: 100%;
}

#briefing-absences .briefing-grid {
    display: grid !important;
    /* left-align: fill columns left-to-right; add more columns to the right */
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
    gap: 12px;
    align-items: start;
    justify-content: start !important; /* ensure grid content begins at left, not centered */
    width: 100%;
}

/* Company section inside Absences should stack left-aligned */
#briefing-absences .upcoming-company-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 220px;
    flex: 0 0 auto;
}

#briefing-absences .upcoming-company-section h3 {
    text-align: left;
    width: 100%;
}
#briefing-absences .brief-item {
    min-height: 72px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Ensure company headers inside Absences use the same sizing as Upcoming */
.upcoming-company-section h3 {
    font-size: 1.05rem;
    margin: 0 0 8px 0;
    color: var(--text);
}

/* small green underline under company headers in Upcoming to match Absences */
.upcoming-company-section h3 {
    position: relative;
    padding-bottom: 0.45rem;
}
.upcoming-company-section h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0.15rem;
    height: 2px;
    width: 40%;
    background: rgba(0, 255, 0, 0.4);
}

/* Ensure text and controls inside colored cards are legible */
.brief-item.up-type-vacation strong,
.brief-item.up-type-leave_early strong,
.brief-item.up-type-appointment strong,
.brief-item.up-type-day_off strong,
.brief-item.up-type-day-off strong,
.brief-item.up-type-dayoff strong {
    color: #fff;
}
.brief-item.up-type-vacation .uc-delete,
.brief-item.up-type-leave_early .uc-delete,
.brief-item.up-type-appointment .uc-delete,
.brief-item.up-type-day_off .uc-delete,
.brief-item.up-type-day-off .uc-delete,
.brief-item.up-type-dayoff .uc-delete {
    color: rgba(255,255,255,0.95);
}

/* Upcoming-specific styling to match the Daily Briefing look */
.upcoming-card {
    background: var(--forecast-bg);
    padding: 12px 14px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 72px; /* match .brief-item */
    justify-content: center;
}

/* Ensure the inner wrapper created by JS uses the same grid sizing as .briefing-grid */
#upcoming-list .upcoming-grid,
#upcoming-list.briefing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    align-items: start;
}
.upcoming-card .uc-header { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.upcoming-card .uc-type { font-weight:700; font-size:0.95rem; color:var(--text); }
.upcoming-card .uc-body { display:flex; flex-direction:column; gap:8px; }
.upcoming-card .uc-info { display:flex; gap:10px; flex-wrap:wrap; }
.upcoming-card .uc-info-item { background: transparent; padding:6px 8px; border-radius:6px; min-width:110px; }
.upcoming-empty { color:var(--text); opacity:0.7; padding:12px; }

@media (max-width: 700px) {
    .briefing-grid, #upcoming-list .upcoming-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
}


/* ... (rest of remote_style.css continues unchanged) */
/* Modern sleek design */

:root {
    --bg: linear-gradient(135deg, #f8f8f8 0%, #e8e8e8 100%);
    --text: #333;
    --header-bg: rgba(255, 255, 255, 0.95);
    --nav-bg: #ffffff;
    --nav-link: #555;
    --nav-height: 56px;
    --nav-hover: rgba(85, 85, 85, 0.1);
    --section-bg: #f8f8f8;
    --section-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --forecast-bg: #ffffff;
    --closure-bg: #f8d7da;
    --alert-bg: #fff3cd;
    --link: #007bff;
    --link-visited: #6c757d;
}

.dark {
    --bg: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    --text: #ecf0f1;
    --header-bg: rgba(0, 0, 0, 0.95);
    --nav-bg: #000000;
    --nav-link: #bdc3c7;
    --nav-hover: rgba(189, 195, 199, 0.1);
    --section-bg: #1a1a1a;
    --section-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    --forecast-bg: #000000;
    --closure-bg: #8B0000;
    --alert-bg: #FFD700;
    --link: #add8e6;
    --link-visited: #add8e6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Segoe UI Emoji', 'Noto Color Emoji', 'Apple Color Emoji', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.3s, color 0.3s;
}

a {
    color: var(--link);
    text-decoration: none;
    transition: color 0.3s;
}

a:visited {
    color: var(--link-visited);
}

a:hover {
    text-decoration: underline;
}

ul {
    margin-left: 1em;
}

ul ul {
    margin-left: 2em;
}

.steps > li {
    margin-bottom: 1em;
}

header {
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    display: block; /* stack top row and nav */
}

.logout-btn {
    color: gray;
    text-decoration: none;
    font-size: 0.9rem;
    position: absolute; /* pin to left of header top row */
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.center {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center; /* center logos + title horizontally */
}


/* The header top right area is targeted specifically by .header-top .right. Avoid a global .right rule
   because it conflicts with nav controls that also use `class="right"` */

.greeting {
    color: var(--text);
    font-size: 1rem;
}

header h1 {
    font-weight: 600;
    font-size: 2rem;
    margin: 0.5rem 0;
    color: var(--text);
    position: relative;
}

header h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, rgba(0, 255, 0, 0.4), transparent);
}

header img {
    height: 60px;
    margin: 0 0.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Header bottom area: pins Home left and Admin right */
/* Make header and nav stack in normal flow (stable across pages) */
header { padding-bottom: 0; overflow: visible; position: relative; z-index: 30; }
.header-top {
    display: flex;
    align-items: center;
    justify-content: center; /* center logos/title */
    position: relative;
    padding: 0.75rem 1rem;
}
.header-top .logout-btn {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
}
.header-top .right {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

/* Ensure nav arrows with class `right` are not pinned by header styles */
.nav-arrow.right { position: static; }
.header-bottom {
    position: static; /* keep nav below the top row in normal flow */
    display: block;
    pointer-events: auto;
    width: 100%;
    z-index: 20;
    border-top: 1px solid rgba(0,0,0,0.03);
}

/* Make the nav visually separated from the top header */
.header-bottom nav {
    background: var(--nav-bg);
    padding: 0.35rem 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: relative; /* allow absolute centering of the nav list on wide screens */
}

/* Ensure the nav is a single horizontal flex row: left home, centered nav, right admin */
.header-bottom nav {
    display: flex;
    align-items: center;
    height: var(--nav-height);
}

.header-top { padding-bottom: 0.35rem; }
.header-left, .header-right {
    padding: 6px 10px;
    text-decoration: none;
    color: var(--nav-link);
    background: transparent;
    border-radius: 6px;
    font-weight: 600;
}
.header-left:hover, .header-right:hover {
    background: var(--nav-hover);
    color: var(--text);
}

main {
    width: 100%;
    /* Keep page content positioned below the pinned nav with a small gap */
    margin: calc(var(--nav-height) + 0.5rem) auto 0;
    padding: 0 1rem;
}

/* Admin area small extra spacing to avoid overlap with admin tabs */
.admin-area main {
    margin-top: calc(var(--nav-height) + 0.5rem);
}

/* Responsive: on small screens keep nav in normal flow so it doesn't overlap content */
@media (max-width: 800px) {
    header { padding-bottom: 0; }
    .header-bottom { position: static; }
    main { margin-top: 0; }
    .nav-center { overflow-x: auto; }
}

.home-link,
.admin-link {
    display: flex;
    align-items: center;
    padding: 0 1.2rem;
    color: var(--nav-link);
    text-decoration: none;
    font-weight: 400;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    height: var(--nav-height);
}

.home-link:hover {
    color: var(--text);
    background: var(--nav-hover);
    border-bottom-color: rgba(0, 255, 0, 0.4);
    box-shadow: 0 0 0 1px rgba(0, 255, 0, 0.4);
}

.nav-center {
    max-width: 1220px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0 1rem;
    flex: 1 1 auto; /* allow center area to grow between Home and Admin */
    min-width: 0;
    position: relative;
}

/* Center header and nav across pages. Keep a centered max-width container
   so logos, title and nav align nicely on large screens while remaining
   responsive on small devices. This replaces the old admin-only absolute
   centering with a safer, site-wide centering approach. */
.header-top .center {
    width: 100%;
    max-width: 1220px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}
.header-top h1 {
    text-align: center;
    margin: 0;
}
/* Center the entire nav group in the page by absolutely positioning the
   `.nav-center` container at 50% of the nav row. This ensures the middle
   of the nav items aligns with the page center on wide screens. */
.nav-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-width: 1220px;
    width: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 2;
}
/* Nudge the whole centered nav slightly to the right on wide screens
   to visually align the nav items with the page center. Adjust px as needed. */
@media (min-width: 1100px) {
    .nav-center {
        transform: translateX(calc(-50% + 18px));
    }
}
/* Keep the arrows visually outside the nudged container so they don't
   appear shifted inward. Only on wide screens where we nudge the nav. */
@media (min-width: 1100px) {
    .nav-center .nav-arrow.left {
        left: -28px;
    }
    .nav-center .nav-arrow.right {
        right: -28px;
    }
}
/* Center the nav list exactly in the middle of the `.nav-center` container
   and place the arrows at the left/right edges of that container so they
   don't shift when the list width changes. */
.nav-center > ul {
    display: flex;
    gap: 2.25rem;
    margin: 0;
    padding: 0 1rem;
    white-space: nowrap;
}
#nav-fix-overrides {
    /* no-op placeholder to keep overrides grouped */
}

.nav-center {
    /* Keep the absolute centering rules defined earlier; only raise stacking */
    z-index: 140 !important;
}
.home-link, .admin-link {
    position: relative;
    z-index: 150;
    pointer-events: auto;
}
.nav-center .nav-arrow.left {
    position: absolute;
    left: -40px; /* place arrows just outside the centered container */
    z-index: 3;
}
.nav-center .nav-arrow.right {
    position: absolute;
    right: -40px;
    z-index: 3;
}
/* Make admin link align near the right side but not force the center to shift */
.admin-link { margin-left: 0; }

.nav-arrow {
    background: var(--nav-bg);
    border: none;
    color: var(--nav-link);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    margin: 0 0.5rem;
    border-radius: 50%;
    transition: background 0.3s;
}

.nav-arrow:hover {
    background: var(--nav-hover);
    color: var(--text);
}

nav ul {
    list-style: none;
    display: flex;
    flex-wrap: nowrap; /* keep everything on one line */
    gap: 2.25rem;
    margin: 0;
    padding: 0;
    overflow: hidden; /* avoid wrapping into multiple lines */
    white-space: nowrap;
}

/* Center the nav items horizontally in the page on larger screens. On
   small screens fall back to normal flow so nothing overlaps. */
@media (max-width: 1100px) {
    header { padding-bottom: 0; }
    .header-bottom { position: static; }
    main { margin-top: 0; }
    .nav-center { overflow-x: auto; min-width: 0; }
    .nav-arrow {
        font-size: 1rem;
        padding: 0.15rem 0.3rem;
        min-width: 24px;
        min-height: 24px;
        margin: 0 0.1rem;
    }
    .home-link, .admin-link {
        padding: 0 0.5rem;
        font-size: 0.95rem;
    }
        left: 0;
        transform: none;
        max-width: none;
        width: 100%;
        justify-content: flex-start;
        padding: 0 1rem;
    }
    .nav-center > ul {
        display: flex;
        gap: 1rem;
        overflow-x: auto;
    }
    .nav-center .nav-arrow.left,
    .nav-center .nav-arrow.right {
        position: static;
        margin: 0 0.5rem;
    }
}

nav ul::-webkit-scrollbar {
    height: 6px;
}

nav ul::-webkit-scrollbar-track {
    background: transparent;
}

nav ul::-webkit-scrollbar-thumb {
    background: var(--text);
    border-radius: 3px;
}

nav ul::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 0, 0.4);
}

nav li {
    margin: 0;
    flex: 0 0 auto;
}

nav li.active a {
    box-shadow: 0 4px 12px rgba(128, 128, 128, 0.6);
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), rgba(128, 128, 128, 0.2));
    border-bottom: 2px solid rgba(0, 255, 0, 0.7);
    transform: translateY(-2px);
}

.home-link { margin-right: 1rem; }
.admin-link { margin-left: auto; }

.admin-link:hover {
    color: var(--text);
    background: var(--nav-hover);
    border-bottom-color: rgba(0, 255, 0, 0.4);
    box-shadow: 0 0 0 1px rgba(0, 255, 0, 0.4);
}

/* Pinned Call Intake link removed — feature deprecated until re-added */

nav a {
    display: inline-block;
    padding: 1rem;
    color: var(--nav-link);
    text-decoration: none;
    font-weight: 400;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

nav a:hover {
    color: var(--text);
    background: none;
    border-bottom-color: rgba(0, 255, 0, 0.4);
    box-shadow: 0 0 0 1px rgba(0, 255, 0, 0.4);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 1px rgba(0, 255, 0, 0.4); }
    50% { box-shadow: 0 0 0 3px rgba(0, 255, 0, 0.2); }
    100% { box-shadow: 0 0 0 1px rgba(0, 255, 0, 0.4); }
}

.dark nav a:hover {
    color: var(--text);
    background: none;
    border-bottom-color: rgba(0, 255, 0, 0.4);
    box-shadow: 0 0 0 1px rgba(0, 255, 0, 0.4);
    animation: pulse 1s infinite;
}

main {
    width: 100%;
    /* Nav is reserved by header padding; let main follow directly under the nav */
    margin: 0 auto;
    padding: 0 1rem;
}

/* Admin area may still need slight extra top spacing for the admin tabs */
.admin-area main {
    margin-top: calc(var(--nav-height) + 0.5rem);
}

section {
    background: var(--section-bg);
    margin-bottom: 2rem;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--section-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

section:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

section h2 {
    font-weight: 600;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text);
    border-bottom: 2px solid rgba(0, 255, 0, 0.4);
    padding-bottom: 0.5rem;
}

section h2 a {
    text-decoration: none;
    color: inherit;
}

#daily-briefing {
    margin-top: 2rem;
}

/* Match other section headers with green underline */
#daily-briefing h2 {
    font-size: 1.5rem;
    border-bottom: 2px solid rgba(0, 255, 0, 0.4);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.briefing-grid {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 1rem;
    padding: 0.75rem 1.2rem;
    color: var(--nav-link);
    flex-wrap: wrap;
    width: 100%;
    position: relative; /* keep grid inside main content flow */
}

.brief-item {
    background: var(--forecast-bg);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    box-shadow: 0 10px 24px rgba(0,0,0,0.06);
    min-width: 220px;
    flex: 1 1 220px;
    color: var(--text);
}

.brief-item strong { font-weight: 700; margin-right: 0.25rem; }

/* Force Upcoming list to mirror the Daily Briefing grid/item sizing
   This ensures Day Off cards render identical to Vacation cards. */
#upcoming-list.briefing-grid,
#upcoming-box .briefing-grid {
    display: flex !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 1rem !important;
    padding: 0.75rem 1.2rem !important;
    flex-wrap: wrap !important;
    width: 100% !important;
}

#upcoming-list.briefing-grid .brief-item,
#upcoming-box .brief-item {
    background: var(--forecast-bg) !important;
    border-radius: 8px !important;
    padding: 0.75rem 1rem !important;
    box-shadow: 0 10px 24px rgba(0,0,0,0.06) !important;
    min-width: 220px !important;
    flex: 1 1 220px !important;
    color: var(--text) !important;
}

/* Typography normalization so all upcoming cards look identical */
#upcoming-box .brief-item,
#upcoming-list.briefing-grid .brief-item {
    font-size: 0.95rem !important;
    line-height: 1.35 !important;
    color: var(--text) !important;
}
#upcoming-box .brief-item strong,
#upcoming-list.briefing-grid .brief-item strong {
    display: block !important;
    font-size: 1.02rem !important;
    font-weight: 700 !important;
    margin-bottom: 6px !important;
}
#upcoming-box .brief-item > div > div,
#upcoming-list.briefing-grid .brief-item > div > div {
    margin-top: 6px !important;
    line-height: 1.25 !important;
}

/* Emphasize driver name on Upcoming cards */
/* Emphasize driver name on Upcoming and Absence cards */
#upcoming-box .brief-item .up-driver-name,
#upcoming-list.briefing-grid .brief-item .up-driver-name,
#briefing-absences .brief-item .up-driver-name,
#briefing-trucks .brief-item .up-driver-name {
    font-weight: 800 !important;
    font-size: 1.12rem !important;
    margin-bottom: 6px !important;
    color: inherit !important;
    line-height: 1.1 !important;
}

/* Driver card stamps */
.transport-stamp {
    display: inline-block;
    background: linear-gradient(90deg, #fff, #f0f0f0);
    border: 1px solid rgba(0,0,0,0.06);
    padding: 6px 8px;
    border-radius: 10px;
    font-weight: 700;
    color: #2b7a2b;
    margin-top: 6px;
}
.no-transport-badge {
    display: inline-block;
    background: #ffecec;
    color: #8b0000;
    border: 1px solid #ffd1d1;
    padding: 4px 6px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-left: 8px;
    margin-top: 6px;
}

/* Ensure stamps use color emoji-capable fonts so emojis render instead of ?? */
.transport-stamp, .no-transport-badge, .sick-stamp, .vacation-stamp, .down-stamp {
    font-family: 'Segoe UI Emoji', 'Noto Color Emoji', 'Apple Color Emoji', 'Twemoji Mozilla', 'Inter', sans-serif;
    /* Use a slightly larger line-height to avoid clipping of emoji glyphs */
    line-height: 1.1;
}

#weather-data {
    font-size: 1rem;
    color: #555;
}

#weather-data p {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.weather-forecasts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.weather-forecasts h2 {
    margin-bottom: 1rem;
    position: relative;
    flex: 0 0 100%;
    text-align: center;
}

.weather-forecasts h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, rgba(0, 255, 0, 0.4), transparent);
}

.weather-area {
    padding: 1rem;
    background: var(--section-bg);
    border-radius: 12px;
    box-shadow: var(--section-shadow);
    border: 1px solid #e9ecef;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    flex: 1 1 300px;
    max-width: 500px;
}

.weather-area h3 {
    margin: 0 0 1rem 0;
    color: var(--text);
    font-size: 1.4rem;
    padding-bottom: 1.5rem;
    text-align: center;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.weather-area h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, rgba(0, 255, 0, 0.4), transparent);
}

.weather-data {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.weather-data p {
    margin-bottom: 1rem;
    line-height: 1.5;
    color: var(--text);
}

.forecast-item {
    display: block;
    border-radius: 8px;
    padding: 0.5rem;
    color: #333;
    overflow-y: auto;
}

.weather-icon {
    display: block;
    text-align: center;
    font-size: 2rem;
    margin: 0.5rem 0;
}

.period-name {
    font-weight: bold;
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.forecast-details {
    line-height: 1.5;
    text-align: center;
}

/* Weather icon animations */
.weather-icon.sunny {
    animation: rotate 3s linear infinite;
}

.weather-icon.partly {
    animation: float 2s ease-in-out infinite;
}

.weather-icon.cloudy {
    animation: drift 4s ease-in-out infinite;
}

.weather-icon.rain {
    animation: bounce 1s infinite;
}

.weather-icon.heavy-rain {
    animation: shake 0.5s infinite;
}

.weather-icon.snow {
    animation: float 3s ease-in-out infinite;
}

.weather-icon.heavy-snow {
    animation: shake 0.5s infinite;
}

.weather-icon.wind {
    animation: sway 2s ease-in-out infinite;
}

.weather-icon.thunderstorm {
    animation: flash 1s infinite;
}

.weather-icon.blizzard {
    animation: spin 2s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes drift {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(5px); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

@keyframes sway {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Office Guide Styles */
.section h3 {
    cursor: pointer;
    padding: 0.5rem;
    background: var(--section-bg);
    border: 1px solid var(--text);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    transition: background 0.3s;
}

.section h3:hover {
    background: var(--nav-hover);
}

.section .content {
    margin-left: 1rem;
    padding: 1rem;
    border-left: 2px solid var(--link);
    background: var(--forecast-bg);
    border-radius: 4px;
}

.content h3 {
    cursor: pointer;
    color: var(--link);
    margin-top: 1rem;
}

.content h3:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    nav ul {
        flex-direction: column;
    }
    nav a {
        padding: 0.75rem 1rem;
    }
    section {
        padding: 1.5rem;
    }
}

section {
    overflow-x: auto;
}

.driver-board section {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    padding: 0;
}

/* Truck Capabilities Styles */
.form-container {
    max-width: 400px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: var(--section-bg);
    color: var(--text);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
    font-weight: 600;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.results-container h3 {
    margin-bottom: 1rem;
    color: var(--text);
}

.trucks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.truck-card {
    background: var(--forecast-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.truck-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.truck-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.truck-header h4 {
    margin: 0;
    color: var(--text);
    font-size: 1.2rem;
}

.truck-type {
    font-weight: bold;
    color: var(--text);
    font-size: 0.9rem;
}

.truck-details {
    margin-bottom: 1rem;
}

.truck-details p {
    margin: 0.25rem 0;
    color: var(--text);
    font-size: 0.85rem;
}

.truck-notes {
    font-style: italic;
    color: var(--text);
    font-size: 0.8rem;
    margin: 0;
}

.no-results {
    text-align: center;
    font-style: italic;
    color: #666;
    padding: 2rem;
}

/* Region sections */
.region-section {
    margin-bottom: 2rem;
}

.region-section h3 {
    margin: 0 0 1rem 0;
    color: var(--text);
    font-size: 1.4rem;
    padding-bottom: 1.5rem;
    text-align: center;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.region-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, rgba(0, 255, 0, 0.4), transparent);
}

/* Color coding for truck types */
.truck-card.wheel-lift {
    border-left: 4px solid #007bff;
}

.truck-card.flatbed {
    border-left: 4px solid #28a745;
}

.truck-card.heavy {
    border-left: 4px solid #dc3545;
}

.truck-card.service {
    border-left: 4px solid #6c757d;
}

/* Region background colors */
.truck-card.region-eugene {
    background: rgba(0, 123, 255, 0.05);
}

.truck-card.region-salem {
    background: rgba(40, 167, 69, 0.05);
}

.truck-card.region-heavy {
    background: rgba(220, 53, 69, 0.05);
}

.truck-card.region-str {
    background: rgba(255, 193, 7, 0.05);
}

/* Reset button */
#reset-btn {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin: 1rem auto;
    display: block;
    font-weight: 600;
}

#reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Account Pricing Styles */
.section h3 {
    cursor: pointer;
    padding: 0.5rem;
    background: var(--section-bg);
    border: 1px solid #ddd;
    margin-bottom: 0.5rem;
    border-radius: 4px;
}

.section .content {
    padding: 1rem;
    background: var(--forecast-bg);
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.section .content table {
    width: 100%;
    border-collapse: collapse;
}

.section .content th, .section .content td {
    border: 1px solid #ddd;
    padding: 0.5rem;
    text-align: center;
}

.company-section h2 {
    font-size: 1.8em;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text);
    padding-bottom: 0.5rem;
    position: relative;
}

.company-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, rgba(0, 255, 0, 0.4), transparent);
}

/* Driver Board Styles */
.driver-board-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.column {
    border: 1px solid var(--text);
    padding: 1rem;
    background: var(--forecast-bg);
    border-radius: 8px;
}

.column h3 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text);
}

.driver-off-box {
    margin-top: 2rem;
    border: 1px solid var(--text);
    padding: 1rem;
    background: var(--forecast-bg);
    border-radius: 8px;
}

.driver-off-box h3 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text);
}

.driver-off-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.off-column {
    border: 1px solid var(--text);
    padding: 1rem;
    background: var(--forecast-bg);
    border-radius: 8px;
}

.off-column h3 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text);
}

.up-next-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.up-next-column {
    border: 1px solid var(--text);
    padding: 1rem;
    background: var(--forecast-bg);
    border-radius: 8px;
}

.up-next-column h3 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text);
}

.driver-card {
    background: var(--section-bg);
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    min-height: 100px;
}

.driver-card p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

.truck-type {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.8em;
    font-weight: bold;
    color: var(--text);
}

.day-off {
    opacity: 0.7;
    background: rgba(169, 169, 169, 0.3); /* light gray overlay */
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 5px,
        rgba(128, 128, 128, 0.2) 5px,
        rgba(128, 128, 128, 0.2) 10px
    );
}

.fade-out {
    opacity: 0.5;
    transition: opacity 0.5s ease;
}

.shift-ending {
    border: 2px solid red;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

.duplicate-truck {
    border: 2px solid red;
    padding: 2px;
    border-radius: 3px;
}

.down-driver {
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(105, 105, 105, 0.8) 10px,
        rgba(105, 105, 105, 0.8) 20px
    );
}

.truck-type {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.8em;
    color: var(--text);
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 4px;
    border-radius: 3px;
}

.dark .truck-type {
    color: black;
}

.flatbed-card {
    background-color: rgba(255, 152, 0, 0.08);
}

.wheellift-card {
    background-color: rgba(0, 227, 0, 0.08);
}

.hd-card {
    background-color: rgba(227, 0, 227, 0.08);
}

.eta-countdown {
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 4px;
    border-radius: 3px;
    display: inline-block;
    margin-top: 5px;
}

#sort-now {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: var(--link);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 1000;
}
/* Hideable variant for fadeouts with same class used by fs-controls */
#sort-now.hidden { opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }

/* Popup styles */
.popup {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.popup-content {
    background-color: var(--section-bg);
    padding: 20px;
    border-radius: 10px;
    width: 300px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

.popup input {
    width: 50px;
    margin: 0 5px;
    padding: 5px;
    text-align: center;
}

.popup button {
    margin: 10px 5px;
    padding: 8px 16px;
    background: var(--link);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.popup button:hover {
    background: var(--link-visited);
}

#sort-now:hover {
    background: var(--link-visited);
}

body.driver-fullscreen #sort-now {
    display: none;
}

.shift-emoji {
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: 1.2rem;
}

.conflict {
    background-color: #ffcccc !important;
    border: 2px solid red !important;
}

.conflict-msg {
    color: red;
    font-weight: bold;
    font-size: 0.9rem;
    display: block;
    margin-top: 5px;
}

.wl {
    background: linear-gradient(to right, rgba(0, 255, 0, 0.7) 0%, rgba(0, 255, 0, 0.7) 25%, transparent 100%);
}

.fb {
    background: linear-gradient(to right, rgba(255, 102, 0, 0.7) 0%, rgba(255, 102, 0, 0.7) 25%, transparent 100%);
}

.hd {
    background: linear-gradient(to right, rgba(255, 0, 255, 0.7) 0%, rgba(255, 0, 255, 0.7) 25%, transparent 100%);
}

.context-menu {
    position: fixed;
    background: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 10px;
    z-index: 1000;
    min-width: 150px;
    max-height: calc(100vh - 40px);
    overflow: auto;
    font-family: Arial, sans-serif;
}

.context-menu.hidden {
    display: none;
}

.context-menu .menu-header {
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.context-menu label {
    display: block;
    margin: 5px 0;
    cursor: pointer;
}

.context-menu input[type="radio"] {
    margin-right: 8px;
}

.context-menu button {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 5px 10px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.context-menu button:hover {
    background: #0056b3;
}

.context-menu .down-options {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.context-menu .down-options button {
    width: 100%;
    padding: 5px;
    background: #f39c12;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.context-menu .down-options button:hover {
    background: #e67e22;
}

.context-menu .shift-section {
    margin-top: 10px;
}

.context-menu .shift-section label {
    display: block;
    margin: 5px 0;
}

.context-menu .shift-section input {
    width: 100%;
    padding: 2px;
    margin-top: 2px;
}

.context-menu .shift-header {
    font-weight: bold;
    margin-bottom: 5px;
}

.shift-submenu {
    position: fixed;
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08);
    padding: 15px;
    z-index: 1001;
    min-width: 200px;
    max-width: 320px;
    max-height: calc(100vh - 40px);
    overflow: auto;
    text-align: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.shift-submenu.hidden {
    display: none;
}

.shift-submenu .submenu-header {
    font-weight: 600;
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
    border-bottom: 1px solid #ecf0f1;
    padding-bottom: 10px;
}

.shift-submenu .submenu-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    gap: 10px;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    min-width: 300px;
    text-align: center;
}

.modal-content h3 {
    margin-top: 0;
}

.modal-content label {
    display: block;
    margin: 10px 0;
}

.modal-content button {
    margin: 5px;
    padding: 8px 16px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.modal-content button:hover {
    background: #0056b3;
}

.shift-submenu input[type="time"] {
    display: block;
    margin: 0 auto;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 80%;
    max-width: 150px;
}

.shift-submenu input[type="time"]:focus {
    outline: none;
    border-color: #3498db;
}

.shift-submenu input[type="number"] {
    display: block;
    margin: 0 auto;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 80%;
    max-width: 150px;
}

.shift-submenu input[type="date"] {
    display: block;
    margin: 0 auto;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 80%;
    max-width: 150px;
}

.shift-submenu label {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 5px;
    display: block;
}

.shift-submenu .repeat-options {
    margin: 15px 0;
}

.shift-submenu .repeat-options label {
    display: block;
    margin: 8px 0;
    font-size: 14px;
    color: #34495e;
    cursor: pointer;
    transition: color 0.2s ease;
}

.shift-submenu .repeat-options label:hover {
    color: #3498db;
}

.shift-submenu .repeat-options input[type="radio"] {
    margin-right: 8px;
    accent-color: #3498db;
}

.shift-submenu input[type="checkbox"] {
    margin-right: 8px;
    accent-color: #e74c3c;
}

.shift-submenu .submenu-footer label {
    font-size: 14px;
    color: #e74c3c;
    cursor: pointer;
}

.shift-submenu button {
    width: auto;
    padding: 6px 10px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 3px auto;
    display: block;
}

.shift-submenu button:hover {
    background: linear-gradient(135deg, #2980b9, #21618c);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.shift-submenu hr {
    margin: 10px 0;
    border: none;
    border-top: 1px solid #ddd;
}

.sick-stamp {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-30deg);
    font-size: 1.5em;
    color: red;
    font-weight: bold;
    z-index: 10;
    max-width: 90%;
    white-space: nowrap;
    text-overflow: ellipsis;
    border: 3px solid red;
    padding: 5px;
    /* background: rgba(255, 255, 255, 0.8); */
    border-radius: 5px;
    opacity: 1;
    mix-blend-mode: normal;
    isolation: isolate;
}

.down-stamp {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-30deg);
    font-size: 1.5em;
    color: black;
    font-weight: bold;
    z-index: 10;
    max-width: 90%;
    white-space: nowrap;
    text-overflow: ellipsis;
    border: 3px solid black;
    padding: 5px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 5px;
    opacity: 1;
    mix-blend-mode: normal;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.eta-timer {
    font-size: 0.8em;
    color: black;
    margin-top: 2px;
}

.vacation-stamp {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-30deg);
    font-size: 1.5em;
    color: #1776cc; /* blue */
    font-weight: bold;
    z-index: 10;
    max-width: 90%;
    white-space: nowrap;
    text-overflow: ellipsis;
    border: 3px solid #1776cc;
    padding: 5px;
    /* background: rgba(255, 255, 255, 0.8); */
    border-radius: 5px;
    opacity: 1;
    mix-blend-mode: normal;
    isolation: isolate;
}

/* Transport Stamp - mimics other stamps */
.transport-stamp {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-30deg);
    font-size: 1.5em;
    color: #fff;
    font-weight: bold;
    z-index: 10;
    max-width: 90%;
    white-space: nowrap;
    text-overflow: ellipsis;
    border: 3px solid #00e6ff;
    padding: 5px;
    background: rgba(0, 255, 255, 0.15);
    border-radius: 5px;
    opacity: 1;
    mix-blend-mode: normal;
    isolation: isolate;
    text-shadow: 0 0 2px #0050ff, 0 0 2px #fff;
}

/* Neon blue card for transport */
.driver-card.transport {
    background: linear-gradient(135deg, #00e6ff 0%, #0050ff 100%) !important;
    color: #fff !important;
    border: 2px solid #00e6ff !important;
}

/* Police stamp */
.police-stamp {
    position: absolute;
    top: 50%;
    left: 50%;
    /* less aggressive tilt for readability */
    transform: translate(-50%, -50%) rotate(-10deg);
    font-size: 1.15em;
    color: #fff;
    font-weight: 800;
    z-index: 12;
    max-width: 90%;
    white-space: normal;
    text-overflow: unset;
    text-align: center;
    border: 2px solid rgba(255,255,255,0.9);
    padding: 6px 8px;
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(211,47,47,0.95) 0%, rgba(11,61,145,0.95) 100%);
    box-shadow: 0 0 6px rgba(0,0,0,0.45);
    animation: police-flash 1s linear infinite;
}
.police-stamp .police-times { display:block; font-size:0.75em; margin-top:4px; font-weight:700; }
.police-emoji { margin-left:6px; }

.police-queued {
    position: static;
    display: inline-block;
    margin-left: 8px;
    font-size: 1.1em;
    background: rgba(255,255,255,0.9);
    border-radius: 6px;
    padding: 2px 6px;
    z-index: 11;
    box-shadow: 0 1px 3px rgba(0,0,0,0.18);
    vertical-align: middle;
}

/* Upcoming driver dropdown */
.driver-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--nav-bg);
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    max-height: 200px; /* shows a handful, scroll inside */
    overflow: auto;
    z-index: 4050 !important;
    border-radius: 6px;
}
.driver-dropdown.hidden { display: none; }
.driver-group-header {
    font-weight: 700;
    padding: 6px 10px;
    background: rgba(0,0,0,0.02);
    font-size: 0.9em;
    border-bottom: 1px solid rgba(0,0,0,0.02);
}
.driver-item {
    padding: 8px 10px;
    cursor: pointer;
}
.driver-item:hover { background: rgba(0,0,0,0.04); }

/* Upcoming box: restore section-style outer box so it matches Daily Briefing */
#upcoming-box {
    /* use the same visual treatment as generic sections */
    background: var(--section-bg);
    padding: 2rem;
    margin: 0 0 2rem 0;
    border-radius: 12px;
    box-shadow: var(--section-shadow);
    box-sizing: border-box;
}

/* keep the inner briefing-grid layout but do not make the section full-viewport width */
#upcoming-box .briefing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    padding: 0.5rem 0;
    color: var(--nav-link);
    width: 100%;
}

#upcoming-list {
    display: grid;
    grid-template-columns: inherit;
    gap: 12px;
    align-items: start;
}

#upcoming-box .brief-item {
    background: var(--forecast-bg);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    box-shadow: 0 10px 24px rgba(0,0,0,0.06);
    min-width: 220px;
    color: var(--text);
}

/* Make the admin upcoming modal hover over the entire page, not constrained to the section */
#upcoming-modal.modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(0,0,0,0.35) !important;
    z-index: 3000 !important;
}

#upcoming-modal.hidden { display: none !important; }

#upcoming-modal .modal {
    position: relative !important;
    width: 720px !important;
    max-width: calc(100% - 40px) !important;
    background: var(--section-bg) !important;
    border-radius: 10px !important;
    padding: 16px !important;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25) !important;
    height: auto !important;
    max-height: 80vh !important;
    overflow: auto !important;
    margin: 0 auto !important;
}

#upcoming-modal .modal .modal-body { max-height: calc(80vh - 140px); overflow:auto; }

/* Apply same modal sizing/appearance to the truck modal so it matches upcoming modal */
#truck-modal.modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(0,0,0,0.35) !important;
    z-index: 3000 !important;
}

#truck-modal.hidden { display: none !important; }

#truck-modal .modal {
    position: relative !important;
    width: 720px !important;
    max-width: calc(100% - 40px) !important;
    background: var(--section-bg) !important;
    border-radius: 10px !important;
    padding: 16px !important;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25) !important;
    height: auto !important;
    max-height: 80vh !important;
    overflow: auto !important;
    margin: 0 auto !important;
}

#truck-modal .modal .modal-body { max-height: calc(80vh - 140px); overflow:auto; }

/* Use the same modal sizing/structure as the Upcoming modal so the truck modal
   looks and behaves identically to the Add Upcoming menu. */
#truck-modal .modal {
    position: relative !important;
    width: 720px !important;
    max-width: calc(100% - 40px) !important;
    background: var(--section-bg) !important;
    border-radius: 10px !important;
    padding: 16px !important;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25) !important;
    height: auto !important;
    max-height: 80vh !important;
    overflow: auto !important;
    margin: 0 auto !important;
}

#truck-modal .modal .modal-body { max-height: calc(80vh - 140px); overflow:auto; }

/* Truck down cards: match driver-card style but red */
.brief-item.truck-down {
    /* Styled to match Absences cards but in a toned-down red */
    background: linear-gradient(135deg,#d64545,#b33a3a);
    color: #fff;
    border-left: 6px solid #8b2b2b;
    box-shadow: 0 6px 20px rgba(179,58,58,0.10);
    padding: 12px 14px;
    border-radius: 10px;
    min-height: 72px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
}

/* Layout for Truck Status to match Absences cards sizing */
#briefing-trucks {
    padding: 0.5rem 0 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-start;
    align-items: flex-start;
    width: 100%;
}

#briefing-trucks .brief-item {
    min-width: 220px;
    max-width: 340px;
    flex: 0 0 auto;
}
.brief-item.truck-down strong { color: #fff; }
.brief-item.truck-down .tc-clear { background: transparent; border: none; color: rgba(255,255,255,0.95); font-size: 1rem; cursor: pointer; }
.brief-item.truck-down .tc-clear:hover { color: #fff; }

/* Truck card internal elements for better theming */
.brief-item.truck-down .truck-name { display: block; color: #fff; font-weight: 700; }
.brief-item.truck-down .truck-region, .brief-item.truck-down .truck-reported { margin-top: 6px; line-height: 1.25; color: rgba(255,255,255,0.95); opacity: 0.95; }
.brief-item.truck-down .truck-note { font-size: 0.9rem; margin-top: 6px; color: rgba(255,255,255,0.95); opacity: 0.95; max-height: 0; overflow: hidden; transition: max-height 0.25s ease, opacity 0.25s ease; }
.brief-item.truck-down:hover .truck-note { max-height: 200px; opacity: 1; }

/* Force white text for truck-down cards to override general theme rules */
.brief-item.truck-down, .brief-item.truck-down * {
    color: #fff !important;
}
.brief-item.truck-down .tc-clear {
    color: rgba(255,255,255,0.95) !important;
}

/* Match Absences header and card typography */
#briefing-trucks-container h3 {
    font-size: 1.05rem;
    margin: 0 0 8px 0;
    color: var(--text);
    font-weight: 700;
    position: relative;
    padding-bottom: 0.45rem;
}
#briefing-trucks-container h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0.15rem;
    height: 2px;
    width: 50%;
    background: rgba(0, 255, 0, 0.4);
}

/* Ensure truck cards use same typography sizing as Absences/Upcoming */
#briefing-trucks .brief-item {
    font-size: 0.95rem;
    line-height: 1.35;
}
#briefing-trucks .brief-item strong {
    display: block;
    font-size: 1.02rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text);
}

/* Wider driver dropdown inside the modal to avoid cramped list */
#upcoming-modal .driver-dropdown {
    width: 320px !important;
    max-width: 70vw !important;
    left: 0 !important;
    right: auto !important;
    z-index: 3050 !important;
}

/* Ensure the driver input fills its parent in the modal */
#upcoming-modal #upcoming-driver { width: 100% !important; box-sizing: border-box; }

@media (max-width: 900px) {
    /* On small screens, make it full width and allow vertical resize only */
    #upcoming-box {
        width: 100%;
        min-width: unset;
        height: 420px;
        resize: vertical;
    }
}


/* Floating New Call Button */
.floating-plus {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(180deg,#28a745,#218838);
    color: white;
    font-size: 28px;
    border: none;
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
    z-index: 2000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.floating-plus:hover { transform: translateY(-2px); }

/* Make the calculator SVG inside the quote button larger */
#new-quote-btn svg { width: 28px; height: 28px; display: block; }

/* Hide floating buttons when a floating window is open */
/* (removed) don't hide floating buttons when modals open — users want them visible */

/* Responsive adjustments: avoid covering content on small screens */
@media (max-width: 900px) {
    .floating-plus { right: auto; left: 8px; bottom: 20px; width: 44px; height: 44px; font-size: 22px; }
    #new-quote-btn { bottom: 84px !important; }
    /* Slightly shrink floating windows on small screens so they don't push content */
    .floating-window { right: 12px; left: 12px; bottom: auto; top: auto; max-width: calc(100% - 24px); }
    .floating-window .modal-content { width: 100%; max-width: calc(100% - 24px); }
    .floating-window .modal-content .modal-body { max-height: calc(78vh - 72px); }
}

/* Modal overrides for New Call */
.modal {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.35);
    z-index: 1500;
}
.modal.hidden { display: none; }
.modal .modal-content {
    background: var(--section-bg);
    padding: 16px;
    border-radius: 8px;
    width: 360px;
    max-width: calc(100% - 40px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

/* Floating window variant: non-blocking panel that allows interaction with the page behind it */
.floating-window {
    position: fixed;
    right: 20px;
    bottom: 100px;
    z-index: 1600;
    pointer-events: auto;
}
.floating-window.hidden { display: none; }
.floating-window .modal-content {
    background: var(--section-bg);
    padding: 0;
    border-radius: 8px;
    width: 420px;
    max-width: 92vw;
    max-height: 84vh;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 280px;
}

/* Drag handle inside floating window */
.floating-window .float-handle {
    cursor: move;
    padding: 6px 8px;
    margin: 0 0 8px 0;
    border-radius: 6px 6px 0 0;
    background: transparent;
}
.floating-window .float-handle h3 { margin: 0; font-size: 1.02rem; }

/* Resize handle (bottom-right) */
.floating-window .modal-content { position: relative; }

.floating-window .modal-content .resize-handle {
    position: absolute;
    width: 14px;
    height: 14px;
    z-index: 1610;
    background: transparent;
}
.floating-window .modal-content .resize-handle[data-dir="se"] { right: 8px; bottom: 8px; cursor: nwse-resize; }
.floating-window .modal-content .resize-handle[data-dir="sw"] { left: 8px; bottom: 8px; cursor: nesw-resize; }
.floating-window .modal-content .resize-handle[data-dir="ne"] { right: 8px; top: 8px; cursor: nesw-resize; }
.floating-window .modal-content .resize-handle[data-dir="nw"] { left: 8px; top: 8px; cursor: nwse-resize; }
.floating-window .modal-content .resize-handle:after {
    content: '';
    display: block;
    width: 100%; height: 100%;
    border-right: 2px solid rgba(0,0,0,0.12);
    border-bottom: 2px solid rgba(0,0,0,0.12);
    border-radius: 2px;
}

.floating-window .modal-content .modal-actions {
    /* Stick actions to the bottom so they remain visible and don't overlay inputs */
    position: sticky;
    bottom: 0;
    right: 0;
    z-index: 6;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 12px 16px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.0), rgba(255,255,255,0.98));
    border-top: 1px solid rgba(0,0,0,0.06);
}

.floating-window .modal-content .modal-body {
    /* body scrolls; reserve space at bottom for sticky actions */
    flex: 1 1 auto;
    overflow: auto;
    padding: 16px;
    padding-bottom: 8px; /* small gap before sticky actions */
}

/* Make inputs and labels layout consistent inside modals */
.floating-window .modal-content .modal-body label {
    display: block;
    margin-bottom: 12px;
}
.floating-window .modal-content .modal-body label input,
.floating-window .modal-content .modal-body label select,
.floating-window .modal-content .modal-body label textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
}

/* Keep action buttons a fixed, readable size regardless of modal content scaling */
.floating-window .modal-content .modal-actions .btn {
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1;
}

/* Ensure resize handles remain fixed pixel size */
.floating-window .modal-content .resize-handle { width: 14px; height: 14px; }

/* Visual feedback classes on body during interactions */
.dragging-modal { cursor: move !important; user-select: none !important; }
.resizing-modal { cursor: nwse-resize !important; user-select: none !important; }
.modal .modal-body label { display:block; margin-bottom:8px; }
.modal .modal-body select { width:100%; padding:8px; border-radius:4px; border:1px solid #ccc; }
.modal .btn { padding:8px 12px; border-radius:4px; border:none; background:#007bff; color:white; cursor:pointer; }
.modal .btn:hover { background:#0056b3; }

@keyframes police-flash {
    0% { box-shadow: 0 0 8px rgba(211,47,47,0.9), inset 0 0 6px rgba(211,47,47,0.15); }
    25% { box-shadow: 0 0 14px rgba(11,61,145,0.9), inset 0 0 6px rgba(11,61,145,0.15); }
    50% { box-shadow: 0 0 8px rgba(211,47,47,0.9), inset 0 0 6px rgba(211,47,47,0.15); }
    75% { box-shadow: 0 0 14px rgba(11,61,145,0.9), inset 0 0 6px rgba(11,61,145,0.15); }
    100% { box-shadow: 0 0 8px rgba(211,47,47,0.9), inset 0 0 6px rgba(211,47,47,0.15); }
}

/* Police card styling (darker blue than transport, red/blue mix) */
.driver-card.police {
    background: linear-gradient(135deg, #b71c1c 0%, #0b3d91 100%) !important;
    color: #fff !important;
    border: 2px solid #b71c1c !important;
}

.vacation-stamp .vacation-dates {
    display: block;
    font-size: 0.8em;
    margin-top: 2px;
    color: #0667b1;
    font-weight: 600;
}

.vacation {
    opacity: 0.6;
    background-color: rgba(128, 128, 128, 0.2);
}

.sick {
    opacity: 0.6;
    background-color: rgba(128, 128, 128, 0.2);
}

.down {
    opacity: 0.6;
    background-color: rgba(128, 128, 128, 0.2);
}

/* Top links above the navigation bar */
.top-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 1rem;
    background: var(--nav-bg);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.top-links .home-link,
.top-links .admin-link {
    position: static;
    left: auto;
    right: auto;
    padding: 0.5rem 1rem;
    border-bottom: none;
}

/* Fullscreen driver board styles */
body.driver-fullscreen {
    overflow: hidden;
}
body.driver-fullscreen header,
body.driver-fullscreen nav,
body.driver-fullscreen .top-links,
body.driver-fullscreen .logout-btn,
body.driver-fullscreen .theme-toggle,
body.driver-fullscreen .right,
body.driver-fullscreen footer {
    display: none !important;
}

/* --- Site-wide navbar consolidation ---
   Hide legacy header-level Home/Admin anchors and refine nav layout
   so the navigation bar (the row under the header) matches the design.
*/

/* Hide old top-links Home/Admin anchors (we'll present Home/Admin in the nav row).
   Note: We must not hide the `.header-bottom` container because it now contains the main site nav. */
.top-links .home-link,
.top-links .admin-link {
    display: none !important;
}

/* Force Upcoming section to use the same boxed section appearance as Daily Briefing */
/* This uses high specificity and !important to override any accidental resets elsewhere. */
#upcoming-box {
    /* match other sections: use the same centered content width as Daily Briefing and Welcome */
    background: var(--section-bg) !important;
    padding: 2rem 1rem !important; /* same inner padding as other sections */
    margin: 0 auto 2rem !important;
    border-radius: 12px !important;
    box-shadow: var(--section-shadow) !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 1220px !important; /* center and constrain to content width */
}

#upcoming-box h2 {
    margin-top: 0 !important;
}

#upcoming-box .briefing-grid,
#upcoming-list {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
    gap: 12px !important;
}

#upcoming-box .brief-item {
    min-width: 220px !important;
    padding: 0.75rem 1rem !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 24px rgba(0,0,0,0.06) !important;
}

/* Centered, constrained nav group to match screenshot */
nav ul {
    padding: 0.6rem 0;
}

.nav-center {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

/* Arrows sit to the sides of the centered nav list */
.nav-arrow { margin: 0 1rem; }

/* Make the UL center its items and add gaps for readability */
nav ul {
    justify-content: center !important;
    gap: 2rem;
    padding: 0 1rem;
}

/* Make Home/Admin (if present in the nav) inline and subtle */
.home-link, .admin-link {
    position: static;
    padding: 0.6rem 1rem;
    color: var(--nav-link);
    font-weight: 500;
    border-bottom: 0;
}

/* Subtle hover state consistent with design */
.home-link:hover, .admin-link:hover,
nav a:hover {
    background: transparent;
    color: var(--text);
    text-decoration: none;
}

/* Keep the nav visually light and airy like the mock */
nav { border-top: 1px solid rgba(0,0,0,0.03); }

body.driver-fullscreen main {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 1rem;
    z-index: 9999;
    overflow: hidden;
    border-radius: 0;
}

/* TV-friendly styles when in driver fullscreen */
body.driver-fullscreen .driver-board-container {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.125rem;
}
body.driver-fullscreen .driver-card {
    padding: 0.9rem;
    min-height: 120px;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
}
body.driver-fullscreen .driver-card .card-header strong {
    font-size: 3rem;
}
body.driver-fullscreen .driver-card .card-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}
body.driver-fullscreen .driver-card .truck,
body.driver-fullscreen .driver-card .truck-type,
body.driver-fullscreen .driver-card p,
body.driver-fullscreen .driver-card .shift-emoji {
    font-size: 1.8rem;
}
body.driver-fullscreen .driver-card .truck { font-size: 2.2rem; }
body.driver-fullscreen .sick-stamp,
body.driver-fullscreen .vacation-stamp,
body.driver-fullscreen .down-stamp {
    font-size: 2rem;
    padding: 8px 10px;
    border-width: 4px;
}
body.driver-fullscreen .vacation-stamp .vacation-dates {
    font-size: 1.2rem;
}
body.driver-fullscreen .down-stamp .eta-timer {
    font-size: 1.5rem;
}
body.driver-fullscreen .conflict-msg {
    font-size: 1.1rem;
    font-weight: 700;
}
body.driver-fullscreen .driver-board-container .column h3 {
    font-size: 1.6rem;
}
body.driver-fullscreen .driver-card p { margin: 0.6rem 0; }
body.driver-fullscreen .driver-card .editable { font-size: 1.6rem; }
body.driver-fullscreen .driver-card .times { margin-top: auto; }

/* Hide shift info in fullscreen */
body.driver-fullscreen .shift-info {
    display: none;
}

/* Increase spacing for off/up-next containers to look more prominent */
body.driver-fullscreen .driver-off-container, body.driver-fullscreen .up-next-container {
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}
.fullscreen-btn {
    background: transparent;
    border: none;
    color: var(--nav-link);
    cursor: pointer;
    margin-left: 0.25rem;
    font-size: 0.95rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}
.fullscreen-btn:hover { background: var(--nav-hover); }

/* Position the fullscreen button alongside Driver Board header */
.driver-board-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.driver-board-header h2 {
    margin: 0;
}
.driver-board-header .fullscreen-btn {
    margin-left: 1rem;
    font-size: 1rem;
}

/* Fullscreen scroll controls */
.fs-controls {
    position: fixed;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    z-index: 10001;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: opacity 0.3s ease;
}
.fs-controls.hidden { opacity: 0; pointer-events: none; }
.fs-controls label { font-size: 1rem; display:flex; align-items:center; gap:0.5rem; }
.fs-controls input[type="checkbox"] { width:auto; }
.fs-controls input { width: 6rem; padding: 4px; border-radius: 4px; border: 1px solid rgba(255,255,255,0.3); background: rgba(255,255,255,0.05); color: #fff; }
.fs-controls .btn { background: rgba(255,255,255,0.08); color: #fff; border: none; padding: 6px 10px; border-radius: 4px; cursor: pointer; }
.fs-controls .btn:hover { background: rgba(255,255,255,0.12); }

/* Compact fullscreen: show only active & up-next drivers */
body.driver-fullscreen.compact .driver-card:not(.on):not(.up-next) {
    display: none;
}
body.driver-fullscreen #fs-loop-wrapper, body.driver-fullscreen #fs-loop-clone {
    display: block;
}
body.driver-fullscreen #fs-loop-clone { pointer-events: none; }

/* Upcoming cards */
.upcoming-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin: 8px 0 18px;
}
.upcoming-card {
    background: var(--forecast-bg);
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.uc-header { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.uc-type { font-weight:700; color:var(--text); background:linear-gradient(90deg,#eef2ff, #f3f9ff); padding:6px 8px; border-radius:6px; font-size:0.95rem; }
.uc-delete { background:transparent; border:none; color:#888; font-size:1rem; cursor:pointer; padding:6px; border-radius:6px; }
.uc-body { display:flex; flex-direction:column; gap:8px; }
.uc-title { font-size:1rem; font-weight:600; color:var(--text); }
.uc-info { display:flex; gap:8px; flex-wrap:wrap; }
.uc-info-item { background: rgba(0,0,0,0.02); padding:8px 10px; border-radius:8px; min-width:120px; flex:1 1 auto; }
.uc-info-item strong { display:block; font-size:0.8rem; color:#666; margin-bottom:6px; }
.uc-dates div, .uc-driver div { font-weight:600; }
.uc-footer { font-size:0.8rem; color:#666; }
.upcoming-empty { padding:12px; border-radius:8px; background:var(--section-bg); color:#666; }

@media (max-width: 700px) {
    .uc-info { flex-direction:column; }
}

/* Ensure the Upcoming section is centered and constrained to site content width
   (override earlier full-bleed rules that caused the panel to float right). */
#upcoming-box {
    /* match other sections: span the available content width inside `main` */
    width: 100% !important;
    box-sizing: border-box;
    padding: 2rem !important;
    background: var(--section-bg) !important;
    margin: 0 0 2rem 0 !important;
    max-width: none !important;
    position: relative !important;
}

.upcoming-grid { overflow: visible; }

/* Ensure the main layout doesn't create unexpected horizontal scrollbars */
main { overflow-x: hidden; }

/* Modal styles for admin upcoming add */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); display:flex; align-items:center; justify-content:center; z-index:10000; }
.modal-overlay.hidden { display:none; }
.modal { background: var(--forecast-bg); border-radius: 10px; width: min(920px, 96%); max-width:920px; padding: 0; box-shadow: 0 12px 40px rgba(0,0,0,0.25); border:1px solid rgba(0,0,0,0.06); }
.modal-header { display:flex; align-items:center; justify-content:space-between; padding:12px 16px; border-bottom:1px solid rgba(0,0,0,0.04); }
.modal-body { padding:12px 16px; }
.modal-actions { display:flex; gap:8px; justify-content:flex-end; padding:12px 16px; border-top:1px solid rgba(0,0,0,0.04); }
.modal-close { background:transparent; border:none; font-size:1.1rem; cursor:pointer; }
.btn { padding:8px 12px; border-radius:6px; border:1px solid rgba(0,0,0,0.06); background:transparent; cursor:pointer; }
.btn.primary { background:linear-gradient(90deg,#2b7cff,#57a2ff); color:#fff; border:none; }
.btn:hover { filter:brightness(0.98); }

/* Force upcoming card full-color overrides (placed at EOF to win specificity) */
#upcoming-list.briefing-grid .brief-item.up-type-vacation,
#upcoming-box .brief-item.up-type-vacation {
    background: linear-gradient(135deg,#1e88e5,#1976d2) !important;
    color: #fff !important;
    border-left-color: #1565c0 !important;
    box-shadow: 0 8px 28px rgba(30,136,229,0.12) !important;
}
#upcoming-list.briefing-grid .brief-item.up-type-leave_early,
#upcoming-box .brief-item.up-type-leave_early {
    background: linear-gradient(135deg,#fb8c00,#f57c00) !important;
    color: #fff !important;
    border-left-color: #ef6c00 !important;
    box-shadow: 0 8px 28px rgba(251,140,0,0.12) !important;
}
#upcoming-list.briefing-grid .brief-item.up-type-appointment,
#upcoming-box .brief-item.up-type-appointment {
    background: linear-gradient(135deg,#8e24aa,#7b1fa2) !important;
    color: #fff !important;
    border-left-color: #6a1b9a !important;
    box-shadow: 0 8px 28px rgba(142,36,170,0.12) !important;
}
#upcoming-list.briefing-grid .brief-item.up-type-day_off,
#upcoming-list.briefing-grid .brief-item.up-type-day-off,
#upcoming-box .brief-item.up-type-day_off,
#upcoming-box .brief-item.up-type-day-off,
#upcoming-list.briefing-grid .brief-item.up-type-dayoff,
#upcoming-box .brief-item.up-type-dayoff {
    background: linear-gradient(135deg,#43a047,#388e3c) !important;
    color: #fff !important;
    border-left-color: #2e7d32 !important;
    box-shadow: 0 8px 28px rgba(67,160,71,0.12) !important;
}
#upcoming-list.briefing-grid .brief-item.up-type-other,
#upcoming-box .brief-item.up-type-other {
    background: var(--forecast-bg) !important;
    color: var(--text) !important;
    border-left-color: #9e9e9e !important;
    box-shadow: 0 6px 20px rgba(0,0,0,0.04) !important;
}

/* Ensure inner text inherits forced color */
#upcoming-list.briefing-grid .brief-item.up-type-vacation *,
#upcoming-list.briefing-grid .brief-item.up-type-leave_early *,
#upcoming-list.briefing-grid .brief-item.up-type-appointment *,
#upcoming-list.briefing-grid .brief-item.up-type-day_off *,
#upcoming-list.briefing-grid .brief-item.up-type-day-off *,
#upcoming-list.briefing-grid .brief-item.up-type-dayoff *,
#upcoming-box .brief-item.up-type-vacation *,
#upcoming-box .brief-item.up-type-leave_early *,
#upcoming-box .brief-item.up-type-appointment *,
#upcoming-box .brief-item.up-type-day_off *,
#upcoming-box .brief-item.up-type-day-off *,
#upcoming-box .brief-item.up-type-dayoff * {
    color: inherit !important;
}

/* Dim inactive upcoming cards so active ones stand out */
#upcoming-list.briefing-grid .brief-item:not(.active-upcoming),
#upcoming-box .brief-item:not(.active-upcoming) {
    /* desaturate inactive cards while keeping contrast and brightness stable */
    filter: saturate(0.45) contrast(0.96) brightness(0.96);
    opacity: 0.9;
    transition: filter 180ms ease, opacity 180ms ease, transform 180ms ease;
}
#upcoming-list.briefing-grid .brief-item:not(.active-upcoming):hover,
#upcoming-box .brief-item:not(.active-upcoming):hover {
    filter: saturate(0.75) contrast(0.98) brightness(0.98);
    opacity: 0.98;
}
/* Sick Driver Styling */
.driver-card.sick {
    background-color: #ffebee;
    border: 2px solid #ef5350;
}
.sick-display-large {
    font-size: 2rem;
    color: #c62828;
    font-weight: bold;
    text-align: center;
    margin: 1rem 0;
    text-transform: uppercase;
}
.card-header {
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding-bottom: 5px;
    margin-bottom: 5px;
}

