/* Troop Scheduler - simplified ALADTEC-inspired theme */
:root {
    --sched-navy: #1a3a5c;
    --sched-blue: #2c5f8d;
    --sched-light: #e8f1f8;
    --sched-border: #c5d4e3;
}

body {
    background: linear-gradient(180deg, #f0f6fc 0%, #ffffff 120px);
}

.navbar-scheduler {
    background: var(--sched-blue) !important;
}

.navbar-scheduler .navbar-brand-logo {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.navbar-scheduler .navbar-logo {
    display: block;
    height: 152px;
    width: auto;
    max-width: min(280px, 55vw);
    object-fit: contain;
    /* Logo art has a black plate; screen blend hides it on the dark nav */
    mix-blend-mode: screen;
}

.navbar-scheduler .nav-link {
    color: #fff !important;
    text-decoration: none;
}

.navbar-scheduler .nav-link-icon {
    font-size: 1.15rem;
    line-height: 1;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}

/* Notices: outlined bell with a red unread count flag at the 1-o'clock shoulder (hidden when zero). */
.navbar-scheduler .nav-notices {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    overflow: visible;
}

.navbar-scheduler .nav-notices-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
    line-height: 0;
    flex-shrink: 0;
    overflow: visible;
}

.navbar-scheduler .nav-notices-bell svg {
    display: block;
    width: 1.15rem;
    height: 1.15rem;
    fill: currentColor;
    overflow: visible;
}

.navbar-scheduler .nav-unread-badge {
    position: absolute;
    top: -0.32rem;
    right: -0.42rem;
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.2rem;
    border-radius: 999px;
    background: #e11d2e;
    color: #fff !important;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1rem;
    text-align: center;
    letter-spacing: 0;
    box-sizing: border-box;
    box-shadow: 0 0 0 2px var(--sched-blue);
}

.navbar-scheduler .nav-link.active {
    font-weight: 600;
    text-decoration: none;
}

/* Calendar, Reports, and Admin parents with nested children (hover/caret on desktop; stacked in the hamburger). */
.navbar-scheduler .nav-flyout-head {
    display: flex;
    align-items: center;
}

.navbar-scheduler .nav-flyout-caret {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0.4rem 0.55rem 0.4rem 0.15rem;
    line-height: 1;
}

.navbar-scheduler .nav-flyout-caret::after {
    content: "";
    display: inline-block;
    vertical-align: middle;
    border-top: 0.35em solid currentColor;
    border-right: 0.3em solid transparent;
    border-left: 0.3em solid transparent;
}

.navbar-scheduler .nav-flyout-sub {
    list-style: none;
    margin: 0;
    padding: 0 0 0.4rem 0.9rem;
}

.navbar-scheduler .nav-flyout-child {
    color: rgba(255, 255, 255, 0.92) !important;
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 0.4rem 0.75rem;
    text-decoration: none;
    text-transform: uppercase;
}

.navbar-scheduler .nav-flyout-child:hover,
.navbar-scheduler .nav-flyout-child.active {
    color: #fff !important;
}

@media (min-width: 992px) {
    .navbar-scheduler .nav-flyout {
        position: relative;
    }

    .navbar-scheduler .nav-flyout-sub {
        background: #1a3a5c;
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.22);
        display: none;
        left: 0;
        margin: 0;
        min-width: 16rem;
        padding: 0.4rem 0;
        position: absolute;
        top: 100%;
        z-index: 1050;
    }

    .navbar-scheduler .nav-flyout:hover .nav-flyout-sub,
    .navbar-scheduler .nav-flyout:focus-within .nav-flyout-sub,
    .navbar-scheduler .nav-flyout.is-open .nav-flyout-sub {
        display: block;
    }

    .navbar-scheduler .nav-flyout-child {
        padding: 0.5rem 1rem;
    }

    .navbar-scheduler .nav-flyout-child:hover,
    .navbar-scheduler .nav-flyout-child.active {
        background: #2c5f8d;
    }
}

@media (max-width: 991.98px) {
    .navbar-scheduler .nav-flyout-caret {
        display: none;
    }
}

.header-identity {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
    margin-left: 1rem;
}

.header-identity-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.header-identity-field {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.header-identity-field label {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    margin: 0;
    text-transform: uppercase;
}

.header-identity .form-select {
    min-width: 8.5rem;
    max-width: 14rem;
}

.header-identity-name {
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: right;
    white-space: nowrap;
    text-decoration: none;
}

a.header-identity-name:hover,
a.header-identity-name:focus {
    color: #fff;
    text-decoration: underline;
}

.header-troop-heading {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.2;
    text-align: right;
    white-space: nowrap;
}

@media (max-width: 1199.98px) {
    .header-troop-heading {
        white-space: normal;
        max-width: 16rem;
    }
}

.header-logout {
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 0.8rem;
    text-decoration: underline;
}

.header-logout:hover {
    color: #fff !important;
}

.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(180deg, #1a3a5c 0%, #2c5f8d 55%, #e8f1f8 55%);
}

.auth-card {
    box-sizing: border-box;
    flex: 0 0 auto;
    width: 22rem;
    max-width: calc(100vw - 2rem);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(26, 58, 92, 0.25);
    padding: 1.15rem 1.25rem 1.35rem;
}

.auth-card input[type="text"],
.auth-card input[type="password"],
.auth-card .form-control,
.auth-card .form-control-sm,
.auth-card .btn {
    max-width: 100%;
    box-sizing: border-box;
}

.auth-card h1 {
    color: var(--sched-navy);
    font-size: 1.2rem;
    margin: 0.35rem 0 0.25rem;
}

.auth-card .text-muted {
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}

.auth-card .form-label {
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
}

.auth-card .mb-3 {
    margin-bottom: 0.65rem !important;
}

.auth-card .form-control,
.auth-card .form-control-sm {
    min-height: calc(1.5em + 0.4rem + 2px);
    padding: 0.2rem 0.45rem;
    font-size: 0.8125rem;
}

.auth-card .form-check-label {
    font-size: 0.8rem;
}

.auth-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.25rem;
}

.auth-card .btn,
.auth-card .btn-sm {
    padding: 0.22rem 0.7rem;
    font-size: 0.8125rem;
    line-height: 1.3;
    width: auto;
}

.auth-card .btn-link {
    padding-left: 0.15rem;
}

.auth-logo {
    display: block;
    height: 48px;
    width: auto;
    margin: 0 auto 0.35rem;
}

.page-header-scheduler {
    border-bottom: 2px solid var(--sched-blue);
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
}

.page-header-scheduler h1 {
    color: var(--sched-navy);
    font-size: 1.75rem;
    margin: 0;
}

.toolbar-scheduler {
    background: #fff;
    border: 1px solid var(--sched-border);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.legend-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 4px;
    vertical-align: middle;
}

.calendar-legend {
    background: #fff;
    border: 1px solid var(--sched-border);
    border-radius: 6px;
    padding: 0.65rem 0.85rem;
    margin-bottom: 1rem;
    font-size: 0.82rem;
}

/* Period heading directly above a calendar grid: "October 2026", "October 4–10, 2026", etc. */
.calendar-period-heading {
    color: var(--sched-navy);
    font-size: 1.9rem;
    font-weight: 700;
    text-align: center;
    margin: 0 0 0.6rem;
}

.calendar-legend-khsc {
    margin-top: 1rem;
}

.calendar-legend-khsc-intro {
    margin-bottom: 0.45rem;
}

.calendar-legend-title {
    font-weight: 700;
    color: var(--sched-navy);
    margin-bottom: 0.45rem;
}

.calendar-legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.15rem;
    align-items: center;
}

.calendar-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #334;
}

.legend-swatch {
    display: inline-block;
    width: 1.15rem;
    height: 0.85rem;
    border: 1px solid var(--sched-border);
    border-radius: 2px;
    flex-shrink: 0;
}

.legend-swatch-today { background: #d6e6f5; }
.legend-swatch-past { background: #b8d4f0; opacity: 0.5; }
.legend-swatch-holiday { background: #ffe9a8; }

.calendar-legend .staff-alert {
    font-size: 1.05rem;
    line-height: 1;
}

.calendar-legend-star {
    color: var(--sched-navy);
    font-size: 1.05rem;
    line-height: 1;
}

.calendar-legend .legend-dot {
    margin-right: 0;
    flex-shrink: 0;
}

.entry-scheduled { background: #b8d4f0; border-left: 3px solid #2c5f8d; }
.entry-extra { background: #d0d0d0; border-left: 3px solid #666; }
.entry-timeoff { background: #e8c4a0; border-left: 3px solid #a65e2e; }
.entry-trade { background: #b8e0b8; border-left: 3px solid #2d6b2d; }
.entry-open { background: #d4c4e8; border-left: 3px solid #5c3d8f; }
.entry-event { background: #c4a090; border-left: 3px solid #5c3a2d; }
.entry-availability { background: #f0e8a0; border-left: 3px solid #8a7a2d; }
.entry-special { background: #a0c8e0; border-left: 3px solid #1a5c7a; }

/* Rank overrides on scheduled blocks (white text on navy). */
.shift-block.rank-capt,
.entry-scheduled.rank-capt {
    background: #023D72;
    border-left-color: #012444;
    color: #fff;
}
.shift-block.rank-lt,
.entry-scheduled.rank-lt {
    background: #187777;
    border-left-color: #0d2d4a;
    color: #fff;
}

.shift-block {
    font-size: 0.72rem;
    line-height: 1.2;
    padding: 2px 4px;
    margin-bottom: 2px;
    border-radius: 2px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 4px;
}

.shift-block-text {
    flex: 1 1 auto;
    min-width: 0;
}

.prop-pills,
.person-tip-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
}

.prop-pill {
    display: inline-block;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.25;
    padding: 0 0.32rem;
    border-radius: 999px;
    color: #fff;
    white-space: nowrap;
}

.prop-pill-0 { background: #2c5f8d; }
.prop-pill-1 { background: #1e6b34; }
.prop-pill-2 { background: #0d7377; }
.prop-pill-3 { background: #c9a227; color: #1a1a1a; }
.prop-pill-4 { background: #c45c26; }
.prop-pill-5 { background: #2b2b2b; }
.prop-pill-6 { background: #5a6a7a; }
.prop-pill-7 { background: #8a1f1f; }
.prop-pill-more { background: #8aa0b5; color: #1a3a5c; }

/* Hover card for a calendar assignment (photo + roster fields). */
.shift-block.person-tip {
    cursor: help;
}

.person-tip-card {
    position: fixed;
    z-index: 1080;
    display: none;
    width: 16.5rem;
    max-width: calc(100vw - 1rem);
    padding: 0.65rem 0.75rem 0.7rem;
    background: #fff;
    color: #1a3a5c;
    border: 1px solid #c5d4e8;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(26, 58, 92, 0.22);
    pointer-events: auto;
}

.person-tip-card.is-open {
    display: block;
}

.person-tip-head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.55rem;
}

.person-tip-photo-wrap {
    position: relative;
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    border-radius: 6px;
    overflow: hidden;
    background: #1a3a5c;
}

.person-tip-photo {
    display: none;
    width: 56px;
    height: 56px;
    object-fit: cover;
}

.person-tip-card.has-photo-url:not(.photo-failed) .person-tip-photo {
    display: block;
}

.person-tip-initials {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.04em;
}

.person-tip-card.photo-failed .person-tip-initials,
.person-tip-card:not(.has-photo-url) .person-tip-initials,
.person-tip-card.photo-pending .person-tip-initials {
    display: flex;
}

.person-tip-identity {
    min-width: 0;
}

.person-tip-name {
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.25;
    color: #1a3a5c;
}

.person-tip-full-name {
    font-size: 0.8rem;
    color: #4a6785;
    margin-top: 0.1rem;
}

.person-tip-fields {
    margin: 0;
}

.person-tip-row {
    display: grid;
    grid-template-columns: 3.4rem 1fr;
    gap: 0.35rem 0.5rem;
    font-size: 0.78rem;
    line-height: 1.3;
    margin: 0 0 0.2rem;
}

.person-tip-row dt {
    margin: 0;
    color: #6a8299;
    font-weight: 600;
}

.person-tip-row dd {
    margin: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.person-tip-props-wrap {
    margin-top: 0.45rem;
    padding-top: 0.4rem;
    border-top: 1px solid #e4edf5;
}

.person-tip-props-wrap[hidden] {
    display: none;
}

.person-tip-props-label {
    margin: 0 0 0.2rem;
    color: #6a8299;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    line-height: 1.2;
}

.person-tip-props {
    margin: 0.25rem 0 0;
    padding: 0 0 0 1.1rem;
    font-size: 0.78rem;
    line-height: 1.35;
    max-height: 7.5rem;
    overflow-y: auto;
}

.person-tip-props li {
    margin: 0 0 0.12rem;
}

.calendar-view-switch .btn-group {
    flex-wrap: wrap;
}

.month-grid,
.week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--sched-border);
    border: 1px solid var(--sched-border);
}

.month-grid .dow,
.week-grid .dow {
    background: var(--sched-navy);
    color: #fff;
    text-align: center;
    font-size: 0.8rem;
    padding: 6px;
}

.leave-type-swatch {
    display: inline-block;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.25);
    vertical-align: middle;
}

.leave-type-color {
    width: 3rem;
    height: 2rem;
    padding: 0.15rem;
}

.leave-cal-chip {
    margin-top: 2px;
    padding: 1px 4px;
    border-radius: 3px;
    line-height: 1.2;
    color: #1a1a1a;
}

.leave-cal-chip span {
    display: block;
    font-size: 0.65rem;
    opacity: 0.85;
}

.leave-cal-chip.is-request {
    background: #f3e2b8;
    border: 1px dashed #8a6a2f;
}

.leave-cal-num {
    font-weight: 600;
}

.month-cell,
.week-cell {
    background: #fff;
    min-height: 110px;
    padding: 4px;
    vertical-align: top;
    font-size: 0.7rem;
}

.week-cell {
    min-height: 240px;
}

.month-cell .day-num,
.week-cell .day-num {
    font-weight: 700;
    color: var(--sched-navy);
}

.month-cell.today,
.week-cell.today {
    background: #d6e6f5;
}

/* Mute the entire past day (blocks, alerts, holiday gold) at 50% alpha. */
.month-cell.past,
.week-cell.past,
.weekly-day.past {
    opacity: 0.5;
}

.month-cell.today .day-num,
.week-cell.today .day-num {
    color: #14324f;
}

.month-cell.has-holiday,
.week-cell.has-holiday {
    background: #ffe9a8;
}

.month-cell.today.has-holiday,
.week-cell.today.has-holiday {
    background: #e8dc9a;
}

a.month-cell-hit,
a.week-cell-hit {
    display: block;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
}

a.month-cell-hit:visited,
a.week-cell-hit:visited {
    color: inherit;
}

a.month-cell-hit:hover,
a.month-cell-hit:focus,
a.week-cell-hit:hover,
a.week-cell-hit:focus {
    color: inherit;
    box-shadow: inset 0 0 0 2px var(--sched-blue);
    outline: none;
}

.month-cell.day-open,
.week-cell.day-open {
    box-shadow: inset 0 0 0 2px var(--sched-navy);
}

.day-detail-panel .day-detail-shift {
    font-size: 0.95rem;
    padding: 0.45rem 0.55rem;
    margin-bottom: 0.4rem;
}

#day-detail {
    scroll-margin-top: 0.75rem;
}

.holiday-banner {
    background: #ffd24d;
    border-left: 3px solid #c48a00;
    border-radius: 2px;
    color: #5a3e00;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 3px;
    padding: 3px 5px;
}

.weekly-day.has-holiday {
    background: #ffe9a8;
}

.weekly-day.today.has-holiday {
    background: #e8dc9a;
}

.weekly-day.has-holiday h3 {
    background: #ffd24d;
}

.weekly-day h3 .holiday-name {
    color: #5a3e00;
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    margin-left: 0.6rem;
}

.toolbar-scheduler .fa-calendar-day {
    color: var(--sched-blue);
}

.unit-header {
    font-weight: 600;
    text-decoration: underline;
    margin-top: 4px;
    color: var(--sched-blue);
}

.staff-alert {
    color: #c00;
    font-weight: bold;
}

.personal-sidebar {
    background: #fff;
    border: 1px solid var(--sched-border);
    border-radius: 6px;
    padding: 1rem;
}

.personal-sidebar a {
    display: block;
    padding: 0.35rem 0;
}

.personal-sidebar a.sidebar-download,
.personal-sidebar button.sidebar-download {
    display: block;
    width: 100%;
    margin: 0 0 0.45rem;
    padding: 0.35rem 0.65rem;
    text-align: center;
}

.weekly-day {
    border: 1px solid var(--sched-border);
    margin-bottom: 1rem;
    background: #fff;
}

.weekly-day.today {
    background: #d6e6f5;
}

.weekly-day.today h3 {
    background: #c5d9ec;
}

.weekly-day h3 {
    font-size: 0.95rem;
    background: var(--sched-light);
    padding: 0.5rem;
    margin: 0;
    color: var(--sched-navy);
}

.weekly-row {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    font-size: 0.75rem;
}

.weekly-row-label {
    width: 140px;
    flex-shrink: 0;
    font-weight: 600;
}

.weekly-timeline {
    display: flex;
    flex: 1;
    gap: 1px;
}

.hour-cell {
    flex: 1;
    height: 18px;
    background: #f8f8f8;
    border: 1px solid #eee;
}

.hour-cell.filled-extra,
.legend-dot.filled-extra { background: #d0d0d0; }
.hour-cell.filled-pending,
.legend-dot.filled-pending { background: #d4c4e8; }
.hour-cell.filled-trade,
.legend-dot.filled-trade { background: #b8e0b8; }
.hour-cell.filled-timeoff,
.legend-dot.filled-timeoff { background: #e8c4a0; }
.hour-cell.filled-event,
.legend-dot.filled-event { background: #c4a090; }

.day-view .holiday-banner {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.day-hour-strip {
    display: flex;
    overflow-x: auto;
    gap: 1px;
    background: var(--sched-border);
    border: 1px solid var(--sched-border);
    margin-bottom: 1rem;
}

.day-hour-col {
    flex: 1 0 3.1rem;
    background: #fff;
    min-height: 4.5rem;
    padding: 4px;
}

.day-hour-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--sched-navy);
    margin-bottom: 4px;
}

.day-hour-name {
    font-size: 0.62rem;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Day view: SuperUser/Manager fill palette when the day still has staffing gaps. */
.day-assign-layout {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.day-assign-main {
    flex: 1 1 auto;
    min-width: 0;
}

/* Copy To…: compact month picker anchored next to the day heading. */
.day-copy {
    position: relative;
    display: inline-flex;
}

.day-copy-pop {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    z-index: 50;
    width: 16.5rem;
    padding: 0.7rem 0.75rem 0.8rem;
    background: #fff;
    border: 1px solid var(--sched-border);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(26, 58, 92, 0.22);
}

.day-copy-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    margin-bottom: 0.45rem;
}

.day-copy-month {
    font-weight: 700;
    color: var(--sched-navy);
    font-size: 0.9rem;
}

.day-copy-prev,
.day-copy-next {
    border: 1px solid var(--sched-border);
    background: #fff;
    color: var(--sched-navy);
    border-radius: 4px;
    width: 1.7rem;
    height: 1.7rem;
    line-height: 1;
    cursor: pointer;
}

.day-copy-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.15rem;
}

.day-copy-dow {
    text-align: center;
    font-size: 0.68rem;
    color: #6a7d90;
    font-weight: 600;
}

.day-copy-cell {
    border: 0;
    background: transparent;
    min-height: 1.7rem;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--sched-navy);
    cursor: pointer;
}

.day-copy-cell.is-pad {
    cursor: default;
}

.day-copy-cell:not(.is-pad):hover {
    background: var(--sched-light);
}

.day-copy-cell.is-from {
    background: var(--sched-blue);
    color: #fff;
    font-weight: 700;
}

.day-trooper-rail {
    flex: 0 0 16rem;
    max-width: 16rem;
    background: #fff;
    border: 1px solid var(--sched-border);
    border-radius: 6px;
    padding: 0.75rem 0.85rem;
    position: sticky;
    top: 0.75rem;
    max-height: calc(100vh - 8rem);
    overflow: auto;
}

.day-trooper-chip {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    width: 100%;
    margin-bottom: 0.35rem;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--sched-border);
    border-left: 4px solid #2c5f8d;
    border-radius: 4px;
    background: #f7fafc;
    cursor: grab;
    text-align: left;
}

.day-trooper-chip.is-selected,
.day-trooper-chip.is-dragging {
    background: #d6e4f0;
    border-color: #1a3a5c;
}

.day-trooper-name {
    font-weight: 600;
    color: #1a3a5c;
    font-size: 0.85rem;
}

.day-gap-list {
    list-style: none;
    margin: 0 0 0.5rem;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.day-gap-chip {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: #fde8e8;
    color: #8a1f1f;
    border-radius: 4px;
    font-size: 0.8rem;
}

.day-view[data-day-drop],
.day-gap-chip[data-day-drop],
.unit-header[data-day-drop],
.day-detail[data-day-drop] {
    outline: 1px dashed transparent;
    outline-offset: 2px;
}

.day-view.is-drop-target,
.day-gap-chip.is-drop-target,
.unit-header.is-drop-target,
.day-detail.is-drop-target {
    outline-color: #2c5f8d;
    background-color: rgba(44, 95, 141, 0.08);
}

@media (max-width: 900px) {
    .day-assign-layout {
        flex-direction: column;
    }

    .day-trooper-rail {
        flex: 1 1 auto;
        max-width: none;
        width: 100%;
        position: static;
        max-height: 14rem;
    }
}

/* Dashboard KPI tiles — hover: navy wash + pressed depth */
.kpi-card {
    border-left: 4px solid var(--sched-blue);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 2px 6px rgba(26, 58, 92, 0.1);
}

a.kpi-card-link {
    display: flex;
    flex-direction: column;
    color: inherit;
}

a.kpi-card-link:hover {
    text-decoration: none;
}

.kpi-card:hover {
    background-color: rgba(26, 58, 92, 0.5);
    transform: translateY(3px) scale(0.985);
    box-shadow: inset 0 4px 10px rgba(26, 58, 92, 0.35), 0 1px 2px rgba(0, 0, 0, 0.06);
    border-left-color: #fff;
}

.kpi-card:hover,
.kpi-card:hover .card-body,
.kpi-card:hover h6,
.kpi-card:hover .text-muted,
.kpi-card:hover p,
.kpi-card:hover .display-6 {
    color: #fff !important;
}

@media (prefers-reduced-motion: reduce) {
    .kpi-card {
        transition: background-color 0.2s ease, border-color 0.2s ease;
    }

    .kpi-card:hover {
        transform: none;
    }
}

.architecture-panel {
    background: #fff;
    border: 1px solid var(--sched-border);
    border-radius: 6px;
    padding: 1.25rem;
}

/* Home: last six registrations and last six distinct sign-ins for the selected troop. */
.home-pulse {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 1.5rem;
}

.home-pulse h3 {
    margin: 0 0 0.45rem;
    color: var(--sched-navy);
}

.home-pulse-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.home-pulse-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--sched-border);
}

.home-pulse-name {
    font-weight: 600;
    color: #1a3a5c;
    min-width: 0;
}

.home-pulse-when {
    color: #5a7390;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* Home: selected-troop counties from MAP_ENTRY, zoomed to that geography. */
.home-troop-map-card .troop-map {
    height: min(42vh, 340px);
}

.troop-map .leaflet-overlay-pane path,
.troop-map .leaflet-overlay-pane canvas {
    transform: translateZ(0);
}

.troop-map {
    width: 100%;
    min-height: 240px;
    border: 1px solid #c5d4e8;
    border-radius: 6px;
    background: #e8f1f8;
}

/* Compact zone preview on Admin → Set Schedule template editor. */
.set-schedule-map {
    min-height: 180px;
    max-height: 220px;
}

.set-schedule-map.is-empty {
    opacity: 0.55;
}

.set-schedule-extra-list {
    font-size: 0.9rem;
}

.set-schedule-editor .troop-picker-scroll {
    max-height: 180px;
}

/* Small "?" next to Set Schedule (and similar) field labels; opens appSwal.help. */
.field-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.05rem;
    height: 1.05rem;
    margin-left: 0.25rem;
    padding: 0;
    border: 1px solid #2c5f8d;
    border-radius: 50%;
    background: #fff;
    color: #2c5f8d;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    vertical-align: text-top;
    cursor: pointer;
}

.field-help:hover,
.field-help:focus {
    background: #e8f1f8;
    outline: 2px solid #2c5f8d;
    outline-offset: 1px;
}

/* Pencil / trash icon buttons on Set Schedule and Grant/ Funding Sources grids. */
/* In-form editors (Set Schedule, Grant/ Funding Sources, Templates) only show inside the appSwal overlay. */
.app-swal-panel-slot:not(.is-open) {
    display: none;
}

.grid-row-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0.2rem;
    color: #2c5f8d;
    text-decoration: none;
    border-radius: 4px;
    vertical-align: middle;
}

.grid-row-action svg {
    width: 1rem;
    height: 1rem;
    display: block;
}

.grid-row-action:hover,
.grid-row-action:focus {
    color: #1a3a5c;
    background: #e8f1f8;
    outline: 2px solid #2c5f8d;
    outline-offset: 1px;
}

.grid-row-action-danger {
    color: #8a1f1f;
}

.grid-row-action-danger:hover,
.grid-row-action-danger:focus {
    color: #8a1f1f;
    background: #f8e8e8;
    outline-color: #8a1f1f;
}

.grid-row-action-add {
    color: #1e6b34;
}

.grid-row-action-add:hover,
.grid-row-action-add:focus {
    color: #1e6b34;
    background: #e6f4ea;
    outline-color: #1e6b34;
}

/* Funding source balance badges (Grant/ Funding Sources grid). */
.funding-status {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.funding-status-ok {
    color: #1e6b34;
    background: #e6f4ea;
}

.funding-status-low {
    color: #7a4d00;
    background: #fff3cd;
}

.funding-status-exhausted {
    color: #8a1f1f;
    background: #f8e8e8;
}

.troop-map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.85rem;
    margin-top: 0.65rem;
}

.troop-map-swatch {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    color: #1a3a5c;
}

.troop-map-swatch i {
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 2px;
    border: 1px solid rgba(26, 58, 92, 0.35);
}

@media (max-width: 640px) {
    .home-pulse {
        grid-template-columns: 1fr;
    }
}

/* Home: 12-week grouped bars (need vs coverage). */
.coverage-chart-card {
    overflow-x: auto;
}

.coverage-chart-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.coverage-chart-legend {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: #5a7390;
    white-space: nowrap;
}

.coverage-chart-swatch {
    display: inline-block;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 2px;
    vertical-align: -0.05rem;
    margin-right: 0.3rem;
}

.coverage-chart-swatch.need { background: var(--sched-navy); }
.coverage-chart-swatch.cover { background: #5ba3d0; }
.coverage-chart-swatch.timeoff { background: #a65e2e; }

.coverage-chart {
    display: flex;
    align-items: stretch;
    gap: 0.4rem;
    height: 220px;
    min-width: 36rem;
    padding-top: 0.35rem;
    border-bottom: 1px solid var(--sched-border);
}

a.coverage-chart-week {
    flex: 1 1 0;
    min-width: 2.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

a.coverage-chart-week:hover .coverage-chart-bar {
    filter: brightness(1.12);
}

a.coverage-chart-week:hover .coverage-chart-label {
    color: var(--sched-navy);
    font-weight: 600;
}

.coverage-chart-pair {
    flex: 1 1 auto;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    min-height: 0;
}

.coverage-chart-bar {
    width: 42%;
    max-width: 16px;
    border-radius: 3px 3px 0 0;
}

.coverage-chart-bar.need { background: var(--sched-navy); }
.coverage-chart-bar.cover { background: #5ba3d0; }
.coverage-chart-bar.timeoff { background: #a65e2e; }
.coverage-chart-bar.solo { width: 55%; max-width: 18px; }

.coverage-chart-dense {
    min-width: 48rem;
}

.coverage-chart-dense .coverage-chart-week {
    min-width: 1.15rem;
}

.coverage-chart-dense .coverage-chart-label {
    font-size: 0.58rem;
}

.coverage-chart-label {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.7rem;
    color: #5a7390;
    white-space: nowrap;
}

/* Leave-type troop picker: scrollable list with tappable rows (Admin add + grid edit). */
.troop-picker-scroll {
    max-height: min(40vh, 14rem);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    border: 1px solid var(--sched-border);
    border-radius: 6px;
    background: #f8fbfe;
    padding: 0.25rem 0.5rem;
    margin-top: 0.35rem;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.troop-picker-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.troop-picker-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0.15rem 0.2rem;
    border-bottom: 1px solid #e4edf5;
}

.troop-picker-list li:last-child {
    border-bottom: none;
}

.troop-picker-list li:hover {
    background: #d6e4f0;
}

.troop-picker-list input[type="checkbox"] {
    flex: 0 0 auto;
    width: 1.1rem;
    height: 1.1rem;
    margin: 0;
}

.troop-picker-list label {
    flex: 1 1 auto;
    margin: 0;
    padding: 0.35rem 0;
    line-height: 1.25;
    font-size: 0.875rem;
}

@media (min-width: 768px) {
    .troop-picker-scroll {
        max-height: 16rem;
    }

    .troop-picker-list {
        grid-template-columns: 1fr 1fr;
        column-gap: 0.75rem;
    }
}

@media (min-width: 1100px) {
    .troop-picker-list {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

.week-grid-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.week-grid-scroll .week-grid {
    min-width: 36rem;
}

@media (max-width: 639.98px) {
    .week-grid-scroll {
        overflow-x: visible;
    }

    .week-grid.personal-week {
        display: flex;
        flex-direction: column;
        min-width: 0;
        gap: 1px;
    }

    .week-grid.personal-week .dow {
        display: none;
    }

    .week-grid.personal-week .week-cell {
        min-height: 0;
    }
}

@media (max-width: 768px) {
    .month-cell { min-height: 80px; }
    .shift-block { font-size: 0.65rem; }

    .troop-picker-scroll {
        max-height: min(50vh, 12rem);
    }
}

/* Notices inbox: empty state centered in the remaining viewport. */
.notice-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: calc(100vh - 14rem);
    padding: 1.5rem 1rem 3rem;
}

.notice-empty img {
    width: 300px;
    max-width: 100%;
    height: auto;
    display: block;
}

.notice-empty small {
    display: block;
    margin-top: 0.75rem;
    color: #5a7390;
}

/* My Schedule: empty overlay sits on the month/week grid when the person has no assignments. */
.calendar-empty-wrap {
    position: relative;
}

.calendar-empty-overlay {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    background: rgba(240, 246, 252, 0.82);
    pointer-events: none;
}

.calendar-empty-overlay img {
    width: 300px;
    max-width: 90%;
    height: auto;
    display: block;
}

.calendar-empty-overlay small {
    display: block;
    margin-top: 0.75rem;
    color: #5a7390;
}

/* Notices inbox: two columns when the content area is wide enough; one column on phones. */
.notice-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    align-items: stretch;
    margin-bottom: 1rem;
}

@media (min-width: 640px) {
    .notice-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.notice-grid .notice-item {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    margin-bottom: 0;
}

.notice-grid .notice-actions {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.notice-expand {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 1px solid #c5d4e3;
    border-radius: 4px;
    background: #fff;
    color: #5a7390;
    line-height: 1;
    cursor: pointer;
}

.notice-expand[hidden] {
    display: none !important;
}

.notice-expand-icon {
    display: block;
    font-size: 1rem;
    line-height: 1;
    transition: transform 0.15s ease;
}

/* Overflowing body: chevron points down. Open notice: filled and flipped. */
.notice-expand.is-overflow {
    color: #1a3a5c;
    border-color: #2c5f8d;
}

.notice-expand.is-open {
    background: #1a3a5c;
    border-color: #1a3a5c;
    color: #fff;
}

.notice-expand.is-open .notice-expand-icon {
    transform: rotate(180deg);
}

/* Notices inbox: unread stays full-contrast; read keeps the text but recedes. */
.notice-item .notice-body {
    white-space: pre-wrap;
    font-family: inherit;
    overflow-wrap: anywhere;
    word-break: break-word;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
}

.notice-item.is-expanded .notice-body {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
}

.notice-item.is-unread {
    background: #f0f6fc;
}

.notice-item.is-unread .notice-title {
    color: #1a3a5c;
}

.notice-item.is-unread .notice-body {
    color: #1a3a5c;
}

.notice-item.is-read {
    background: #fff;
}

.notice-item.is-read .notice-title,
.notice-item.is-read .notice-meta,
.notice-item.is-read .notice-body {
    color: #8a9bb0;
    font-weight: 500;
}

.notice-item.is-read .notice-title {
    font-weight: 600;
}

.field-map {
    height: min(70vh, 560px);
    width: 100%;
    border: 1px solid #c5d4e8;
    border-radius: 6px;
    background: #e8f1f8;
}

.field-map-legend {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    color: #fff;
    font-weight: 600;
}

.field-map-legend.web { background: #2c5f8d; }
.field-map-legend.mobile { background: #2e7d32; }
.field-map-legend.desktop { background: #e65100; }

.error-log-table td {
    vertical-align: top;
}

.error-log-when {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.error-log-stack {
    max-height: 220px;
    overflow: auto;
    font-size: 0.75rem;
    background: #f4f7fb;
    padding: 0.5rem;
    border-radius: 4px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Collapsible Admin sections (same chevron pattern as the field-app AdminCard). */
.admin-collapse-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    color: inherit;
    cursor: pointer;
    text-align: left;
}

.admin-collapse-toggle:focus-visible {
    outline: 2px solid #2c5f8d;
    outline-offset: 2px;
}

.admin-collapse-toggle .h6,
.admin-collapse-toggle .h5 {
    margin: 0;
}

.admin-collapse-chevron {
    flex: 0 0 auto;
    color: #5a7390;
    font-size: 0.95rem;
    line-height: 1;
}

.home-page-section-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.home-page-section-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem 0.75rem;
    margin: 0;
    padding: 0.45rem 0.55rem;
    border: 1px solid var(--sched-border);
    border-radius: 6px;
    background: #fff;
    transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.home-page-section-row > * {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

.home-page-section-row.is-dragging {
    background: #d6e4f0;
    border-color: #1a3a5c;
    box-shadow: inset 0 0 0 1px #1a3a5c;
}

.home-page-section-row.is-placeholder {
    opacity: 0.45;
    background: #e8eef4;
    border-style: dashed;
    box-shadow: none;
}

.home-page-section-ghost {
    position: fixed;
    z-index: 20000;
    pointer-events: none;
    margin: 0;
    opacity: 0.96;
    background: #d6e4f0;
    border-color: #1a3a5c;
    box-shadow: 0 10px 24px rgba(26, 58, 92, 0.3);
    transform: rotate(1.25deg);
}

body.is-home-page-dragging,
body.is-home-page-dragging .home-page-drag {
    cursor: grabbing;
    user-select: none;
}

.home-page-drag {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: #5a7390;
    cursor: grab;
    font-size: 1rem;
    line-height: 1;
    letter-spacing: -0.15em;
    padding: 0.15rem 0.25rem;
    touch-action: none;
    user-select: none;
}

.home-page-drag:active {
    cursor: grabbing;
}

.home-page-section-row .home-page-audience,
.home-page-section-row select.form-select {
    display: inline-block;
    width: max-content;
    min-width: 10rem;
    flex: 0 0 auto;
}

.home-page-section-on {
    display: inline-flex;
    align-items: center;
    width: auto;
    max-width: fit-content;
    margin: 0;
}

.home-page-section-on input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.home-page-section-name {
    flex: 0 0 auto;
    min-width: min-content;
    white-space: nowrap;
    font-weight: 600;
    color: #1a3a5c;
}

.home-widget-stack {
    display: flex;
    flex-direction: column;
}

.home-widget {
    width: 100%;
}

.home-week-staffing-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.home-week-grid.week-grid .week-cell {
    min-height: 240px;
}

.channel-tip {
    cursor: help;
}

.home-notice-audience label,
.home-notice-audience input {
    display: inline-block;
    width: auto;
    margin: 0 0.75rem 0 0.15rem;
    font-weight: 500;
}

.home-notice-picks {
    max-height: 12rem;
    overflow-y: auto;
    border: 1px solid var(--sched-border, #c5d4e3);
    border-radius: 4px;
    padding: 0.4rem 0.6rem;
    background: #fff;
}

.home-notice-checklist td,
.home-notice-checklist label {
    font-weight: 500;
    font-size: 0.85rem;
}

/* Communications: troop and message on the left, audience on the right, actions on the bottom row. */
.comm-send-to {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    min-height: 3.6rem;
}

.comm-notice-message,
.comm-notice-picks.home-notice-picks {
    min-height: 11.5rem;
    max-height: 11.5rem;
}

.admin-collapse.is-closed {
    padding-bottom: 0.75rem;
}

.admin-collapse.is-closed .admin-collapse-body {
    display: none;
}

.admin-collapse-body {
    margin-top: 0.55rem;
}

.admin-collapse-body .admin-role-row {
    margin-bottom: 0;
}

/* Assign-role form left, Manager/Approver list right (web Admin and field app). */
.admin-role-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
    gap: 1rem;
    align-items: start;
    margin-bottom: 1.5rem;
}

.admin-role-row > .card,
.admin-role-form {
    overflow: visible;
}

.admin-role-list {
    overflow-x: auto;
}

/* Security Assign role: type a name instead of scrolling a long Person dropdown. */
.person-typeahead {
    position: relative;
}

.person-typeahead-list {
    position: absolute;
    z-index: 30;
    left: 0;
    right: 0;
    max-height: 14rem;
    overflow-y: auto;
    margin: 0.15rem 0 0;
    padding: 0;
    list-style: none;
    background: #fff;
    border: 1px solid #8aa0b8;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(26, 58, 92, 0.15);
}

.person-typeahead-list li {
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    font-weight: 500;
}

.person-typeahead-list li.is-active,
.person-typeahead-list li:hover {
    background: #d6e4f0;
}

.person-typeahead-list li.person-typeahead-empty {
    cursor: default;
    color: #5a6e82;
    font-weight: 500;
}

/* Assign Managers: narrow search column, label/value trooper facts, KHSC, and the add-manager box. */
.assign-managers-find {
    max-width: 32rem;
}

.assign-managers-khsc {
    margin: 0.5rem 0 0.85rem;
}

.assign-managers-khsc .person-tip-props {
    margin: 0.35rem 0 0;
}

.person-tip.person-tip-link {
    display: inline;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    cursor: help;
}

.person-tip.person-tip-link .link-button {
    font-weight: 600;
}

.assign-managers-facts {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 0.25rem 1rem;
    margin-bottom: 0;
}

.assign-managers-facts dt {
    font-weight: 600;
    color: #5a6e82;
}

.assign-managers-facts dd {
    margin: 0;
}

.assign-managers-add {
    max-width: 32rem;
}

/* Pressed color on mouse/touch down; stays navy while .is-busy / :disabled during a slow postback. */
button.btn,
input.btn,
input[type="submit"].btn,
input[type="button"].btn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background-color 0.08s ease, border-color 0.08s ease, color 0.08s ease;
}

button.btn:active,
button.btn.is-busy,
input.btn:active,
input.btn.is-busy,
input[type="submit"].btn:active,
input[type="submit"].btn.is-busy,
input[type="button"].btn:active,
input[type="button"].btn.is-busy,
.btn-primary:active,
.btn-primary.is-busy,
.btn-success:active,
.btn-success.is-busy,
.btn-outline-danger:active,
.btn-outline-danger.is-busy,
.btn-outline-secondary:active,
.btn-outline-secondary.is-busy,
.btn-sm:active,
.btn-sm.is-busy {
    background-color: var(--sched-navy) !important;
    border-color: #14324f !important;
    color: #fff !important;
    cursor: wait;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.22);
}

/* Registrants report – sortable GridView headers match the site navbar */
.registrants-grid thead th,
.registrants-grid th {
    background-color: var(--sched-blue) !important;
    color: #fff !important;
    border-color: var(--sched-navy) !important;
    white-space: nowrap;
    vertical-align: middle;
}
.registrants-grid th a {
    color: #fff !important;
    text-decoration: none;
    display: block;
}
.registrants-grid th a:hover {
    text-decoration: underline;
    color: #fff !important;
    opacity: 0.9;
}

/* Typical law-enforcement shift cards on New template. */
.template-preset-card {
    display: block;
    width: 100%;
    text-align: left;
    text-decoration: none !important;
    color: inherit;
    background: #f7fbfe;
    border: 1px solid var(--sched-border);
    border-radius: 8px;
    padding: 0.65rem 0.8rem;
    margin: 0 0 0.45rem;
}
.template-preset-card:hover,
.template-preset-card:focus {
    background: var(--sched-light);
    border-color: var(--sched-blue);
    color: inherit;
}
.template-preset-name {
    display: block;
    font-weight: 600;
    color: var(--sched-navy);
}
.template-preset-summary {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.85rem;
    color: #5b6f82;
    font-weight: 400;
}

/* Data-grid rows highlight on mouseover (Admin, leave, templates, reports, field map, server logs). Header cells stay unshaded. */
@media (hover: hover) and (pointer: fine) {
    .table tr:hover > td {
        --bs-table-accent-bg: rgba(44, 95, 141, 0.22);
        background-color: #d6e4f0;
        box-shadow: inset 0 0 0 9999px rgba(44, 95, 141, 0.22);
    }
}

/* Staffing Gap Report: day links and print layout */
.staffing-gap-day-link {
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 0.12em;
}

.staffing-report-actions {
    flex-shrink: 0;
}

.staffing-report-page .print-only {
    display: none;
}

@media print {
    .print-only {
        display: block !important;
    }

    .no-print,
    .navbar,
    .footer,
    .body-content > hr,
    #app-swal-host,
    .splash-overlay {
        display: none !important;
    }

    body.staffing-report-printing,
    body.staffing-report-printing .body-content {
        padding: 0 !important;
        margin: 0 !important;
        background: #fff !important;
    }

    body.staffing-report-printing .staffing-report-page {
        padding: 0;
    }

    body.staffing-report-printing .page-header-scheduler {
        border-bottom: 1px solid #333;
        margin-bottom: 0.5rem;
    }

    body.staffing-report-printing .page-header-scheduler h1 {
        font-size: 1.35rem;
    }

    body.staffing-report-printing .page-header-scheduler .text-muted {
        color: #333 !important;
    }

    body.staffing-report-printing .staffing-report-print-meta {
        font-size: 0.85rem;
        margin-bottom: 0.75rem;
        color: #333;
    }

    body.staffing-report-printing .staffing-gap-table {
        width: 100%;
        border-collapse: collapse;
    }

    body.staffing-report-printing .staffing-gap-table th,
    body.staffing-report-printing .staffing-gap-table td {
        border: 1px solid #999 !important;
        padding: 0.25rem 0.4rem !important;
        color: #000 !important;
        background: #fff !important;
        box-shadow: none !important;
    }

    body.staffing-report-printing .staffing-gap-day-link {
        color: #000 !important;
        text-decoration: none;
        font-weight: 600;
    }

    body.staffing-report-printing .staffing-gap-table thead {
        display: table-header-group;
    }

    body.staffing-report-printing .staffing-gap-table tr {
        page-break-inside: avoid;
    }
}

/* SQL page (SuperUser query console) */
.sql-editor {
    font-family: Consolas, "Cascadia Mono", "Courier New", monospace;
    font-size: 0.9rem;
    min-height: 18rem;
    resize: vertical;
    tab-size: 4;
}

.sql-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin: 0.75rem 0 1rem;
}

.sql-messages {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    font-size: 0.82rem;
    white-space: pre-wrap;
}

.sql-result-head {
    margin: 1rem 0 0.35rem;
    font-weight: 600;
    color: #1a3a5c;
}

.sql-result-scroll {
    max-height: 32rem;
    overflow: auto;
    border: 1px solid #dee2e6;
}

.sql-results-table {
    margin-bottom: 0;
    font-size: 0.82rem;
}

.sql-results-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f4f7fb;
    white-space: nowrap;
}

.sql-results-table td {
    max-width: 32rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    vertical-align: top;
}

.sql-results-table .sql-rownum {
    color: #6c757d;
    text-align: right;
}

.sql-null {
    color: #6c757d;
    font-style: italic;
}
