/* ============================================================
   Firehouse247 – Modernized UI (V1 Refresh)
   Brand: Burnt Scarlet #bf1d2d | Dark Sidebar #1a2535
   Font: Inter (Google Fonts)
   v1.0.1 – Fix header logo size
   v1.0.2 – Menu rounding, fade, footer spacing, leave book col width
   v1.0.3 – Login page layout fix; CSS tidy (dead rules, duplicates)
   v1.0.4 – CSS custom properties for brand colors; cache-bust version query
   v1.0.5 – Remove broad div padding rule; make padding explicit per class
   v1.0.6 – Calendar dashboard; chevron SVG buttons; cell border fix
   v1.0.7 – Runcard width: fit-content (grid stretch fix); compact print layout
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Brand Tokens ─────────────────────────────────────────── */
:root {
  --color-brand:        #bf1d2d;
  --color-brand-dk:     #9b1624;
  --color-brand-08:     rgba(191,29,45,0.08);
  --color-brand-12:     rgba(191,29,45,0.12);
  --color-brand-20:     rgba(191,29,45,0.2);
  --color-brand-30:     rgba(191,29,45,0.3);
  --color-brand-50:     rgba(191,29,45,0.5);
  --color-brand-75:     rgba(191,29,45,0.75);
  --color-sidebar:      #1a2535;
  --color-dark-bg:      #0f1720;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 15px; }

body {
  font-family: 'Inter', Arial, Helvetica, sans-serif;
  background: #f0f2f5;
  color: #1e2a38;
  min-width: 30em;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

/* ── Typography ───────────────────────────────────────────── */
p, td, th, h1, h2, h3, h4, h5, h6, input, select, textarea, button {
  font-family: 'Inter', Arial, Helvetica, sans-serif;
}

h1, h2, h3, h4, h5, h6 { margin: 0.6em 0; font-weight: 600; color: #1e2a38; line-height: 1.3; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1.05rem; }

h1.small_margin, h2.small_margin, h3.small_margin,
h4.small_margin, h5.small_margin, h6.small_margin { margin: 0.15em 0; }
h1.inline, h2.inline, h3.inline { display: inline-block; }
h1.full_margin, h2.full_margin, h3.full_margin { margin: 0.5em; }

.label { font-size: 0.8em; vertical-align: text-top; color: #64748b; }

/* ── Layout ───────────────────────────────────────────────── */
#wrapper {
  display: grid;
  grid-template-columns: 200px 1fr;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  padding: 0;
  border: none;
}
#wrapper:not(:has(#menu)) { grid-template-columns: 1fr; }

/* ── Header ───────────────────────────────────────────────── */
#header {
  grid-column: 1 / -1;
  background: var(--color-brand);
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  position: sticky;
  top: 0;
  z-index: 100;
  border: none;
  overflow: visible;
}

#header img,
#header a img,
#header a img.header {
  height: 42px !important;
  width: auto !important;
  max-height: 42px !important;
  margin: 0;
}

td[style*="background"], td.stitle, td.bc_title_1,
td.sub_title, td.bc_title_2, tr.title td, tr.large_title td {
  color: #ffffff;
}

/* ── Sidebar Menu ─────────────────────────────────────────── */
#menu {
  width: 200px;
  min-width: 200px;
  background: var(--color-sidebar);
  padding: 0.75rem 0;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  align-self: start;
  border: none;
  background-image: none;
}

p.menu { margin: 0; padding: 0; }

p.menu a.level1, p.menu a {
  display: block;
  padding: 0.55rem 1.25rem;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s, padding-left 0.15s;
  border-left: 3px solid transparent;
}

p.menu a.level1:hover, p.menu a:hover {
  background: rgba(255,255,255,0.07);
  color: #cbd5e1;
  border-left-color: var(--color-brand);
  padding-left: 1.5rem;
  text-decoration: none;
}

p.menu:last-child a {
  margin-top: 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  color: #94a3b8;
}
p.menu:last-child a:hover { color: #fca5a5; border-left-color: #fca5a5; }

/* ── Sidebar Submenu ─────────────────────────────────────── */
a.menu-parent { cursor: pointer; display: flex !important; align-items: center; justify-content: space-between; }
.menu-chevron { font-size: 0.65rem; transition: transform 0.2s; margin-left: 0.5rem; }
a.menu-parent-open .menu-chevron { transform: rotate(90deg); }

.menu-submenu { display: none; }
.menu-submenu-open { display: block; }

p.menu a.level2 {
  display: block;
  padding: 0.4rem 1.25rem 0.4rem 2rem;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 400;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}

p.menu a.level2:hover {
  background: rgba(255,255,255,0.05);
  color: #cbd5e1;
  border-left-color: var(--color-brand);
  text-decoration: none;
}

/* ── Calendar Dashboard ───────────────────────────────────── */
#cal_dashboard { display: flex; align-items: flex-start; gap: 0.75rem; background: var(--color-sidebar); color: #e2e8f0; padding: 0.75rem 1.25rem; border-radius: 0.5rem; margin: 1rem; font-size: 0.875rem; line-height: 1.6; }
#cal_dashboard_icon { color: #94a3b8; flex-shrink: 0; padding-top: 0.15rem; }
#cal_dashboard_text { flex: 1; max-width: 860px; }
#cal_dashboard_meta { display: flex; flex-direction: column; align-items: flex-end; gap: 0.4rem; flex-shrink: 0; color: #64748b; font-size: 0.75rem; white-space: nowrap; }
#cal_dashboard_refresh { background: transparent !important; border: 0.0625rem solid #475569 !important; color: #94a3b8; width: 1.5rem; height: 1.5rem; padding: 0; border-radius: 0.25rem; display: inline-flex !important; align-items: center; justify-content: center; cursor: pointer; box-shadow: none !important; margin: 0 !important; }
#cal_dashboard_refresh:hover { background: #1e3a5f !important; color: #e2e8f0; }

/* ── Content ──────────────────────────────────────────────── */
div.content {
  padding: 1.5rem;
  background: #f0f2f5;
  overflow: auto;
}

div.inner_content { display: inline-block; width: 100%; padding: 0.5rem; }
div.scroll { overflow: auto; height: 80em; padding: 0.5rem; }
div.runcard_content { display: inline-block; width: fit-content; padding: 1.5rem; }
div.options { padding: 0; margin-bottom: 0.75rem; }
div.header_block { display: inline-block; padding: 0.4rem; margin: 0; }
div.select_assignment { display: inline-block; padding: 0.15rem; margin: 0; }
div.header_div { display: flex; padding: 0; margin: 0; min-height: 4rem; align-items: center; }
div.chart { margin: 0.75rem; padding: 0.5rem; }
div.chart_double_wide { width: 40%; display: inline-block; padding: 0.5rem; }
div.dn_content { min-width: 40%; display: inline-block; vertical-align: top; padding: 0.4rem; }
div.dn_runcard_content { padding: 0.4rem; }

/* ── Login Page Layout ────────────────────────────────────── */
div#wrapper > div:has(#content div.login) { width: 100%; }

#content:has(div.login) {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  min-height: calc(100vh - 60px - 48px);
  background: #f0f2f5;
}

div.login {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10), 0 0 0 1px rgba(0,0,0,0.06);
  padding: 3rem 4rem;
  min-width: 420px;
  font-size: 1.05rem;
}

div.login input[type="text"],
div.login input[type="password"] {
  background: #f8fafc;
  border: 1px solid #d1d5db;
  color: #1e2a38;
  width: 100%;
  font-size: 1rem;
  padding: 0.55rem 0.75rem;
}

div.login input[type="text"]:focus,
div.login input[type="password"]:focus {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px var(--color-brand-12);
}

div.login input[type="submit"].login {
  width: 100%;
  height: 3em;
  margin-top: 0.75rem;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

div.login td.login { color: #64748b; font-size: 0.9rem; }
.login_dept_display { font-size: 1.5rem; padding: 0.5rem 0 1.25rem 0; color: #1e2a38; font-weight: 600; }
a.login_change_dept { font-size: 0.72rem; color: #64748b; text-decoration: none; font-weight: 400; }
a.login_change_dept:hover { color: var(--color-brand); text-decoration: underline; }
div.splash { width: 100%; padding: 0.5rem; }
div.border { border: 1px solid #e2e8f0; border-radius: 8px; padding: 0.5rem; }
div.inline { display: inline-block; vertical-align: top; padding: 0; padding-right: 1.5rem; }
div.inner_div { padding: 0.35rem; }

/* ── Footer ───────────────────────────────────────────────── */
#footer {
  grid-column: 2 / -1;
  background: var(--color-sidebar);
  padding: 0.6rem 1.5rem;
  min-height: 48px;
  border: none;
}
#wrapper:not(:has(#menu)) #footer { grid-column: 1 / -1; }

#footer img.header { height: auto; width: auto; margin: 0; display: inline-block; vertical-align: middle; }
#footer p.text_on_red { color: #94a3b8; font-size: 0.8rem; margin: 0; padding: 0; margin-bottom: 1rem; }

/* ── Links ────────────────────────────────────────────────── */
a:link, a:visited { color: var(--color-brand); }
a:hover { color: var(--color-brand-dk); text-decoration: underline; }
a:active { color: var(--color-brand-dk); }
a.footer { text-decoration: none; font-weight: 600; color: #94a3b8; }
a.level1 { text-decoration: none; }

/* ── Buttons ──────────────────────────────────────────────── */
input[type="submit"], input[type="button"], button {
  background: var(--color-brand);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 0.45rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 0.75rem;
  transition: background 0.15s, box-shadow 0.15s;
  font-family: 'Inter', Arial, sans-serif;
}
input[type="submit"]:hover, input[type="button"]:hover, button:hover {
  background: var(--color-brand-dk);
  box-shadow: 0 2px 6px var(--color-brand-30);
}

button.accordion {
  background: var(--color-brand); color: #ffffff; padding: 0.6rem 0.75rem; width: 100%;
  text-align: left; border: none; border-radius: 6px; outline: none;
  transition: background 0.2s; font-size: 1rem; margin: 0.75rem 0; font-weight: 600; cursor: pointer;
}

button.active, button.accordion:hover { background: var(--color-brand-dk); }

button.cal_nav { width: 2.2rem; height: 2.2rem; margin: 0 0.4rem !important; margin-bottom: 0 !important; padding: 0; background: transparent !important; color: #1e2a38; border: 0.125rem solid #94a3b8 !important; border-radius: 0.375rem; display: inline-flex !important; align-items: center; justify-content: center; vertical-align: middle !important; cursor: pointer; box-shadow: none !important; }
button.cal_nav:hover { background: #e2e8f0 !important; border-color: #64748b; box-shadow: none !important; }

.tab-button { background: transparent; color: #3d5068; font-weight: 600; border: none; margin-bottom: 0; box-shadow: none; }
.tab-button:hover { background: #e2e8f0; color: #1e2a38; box-shadow: none; }
.tab-button.active { background: var(--color-brand); color: #ffffff; }

th.selectable { cursor: pointer; transition: color 0.12s ease; }
th.selectable:hover { color: #cbd5e1; }
tr.selectable:hover, tr.viewable:hover { background-color: #d0dceb; }
td.selectable:hover { background-color: #d0dceb; }

input[type="submit"].bottom_page { margin: 0.4rem; }
input[type="submit"].space_before_after, input[type="button"].space_before_after, button.space_before_after { margin: 0.75rem 0.15rem; }
input[type="submit"].half_space_after, input[type="button"].half_space_after, button.half_space_after { margin: 0.4rem 0.15rem; }
input[type="submit"].vertical_align { margin: 0.4rem; }
input[type="submit"].nospace, input[type="button"].nospace, button.nospace { margin-bottom: 0; }
input[type="submit"].space_inline, input[type="button"].space_inline, button.space_inline { margin-left: 0.75rem; margin-right: 0; margin-top: 0.4rem; margin-bottom: 0.4rem; }
input[type="submit"].double_space_inline, input[type="button"].double_space_inline, button.double_space_inline { margin-left: 1.5rem; margin-right: 0; margin-top: 0.4rem; margin-bottom: 0.4rem; }

/* ── Form Inputs ──────────────────────────────────────────── */
input[type="text"], input[type="password"], input[type="email"],
input[type="number"], input[type="time"], input[type="date"],
select, textarea {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  font-size: 0.875rem;
  font-family: 'Inter', Arial, sans-serif;
  color: #1e2a38;
  background: #ffffff;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus,
input[type="number"]:focus, input[type="time"]:focus, input[type="date"]:focus,
select:focus, textarea:focus {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px var(--color-brand-12);
}

input[type="number"] { width: 4.5em; }
input[type="time"] { min-width: 8em; }
input[type="radio"], input[type="checkbox"] { margin: 0 0.4rem 0.4rem 0; vertical-align: middle; accent-color: var(--color-brand); }
input[type="radio"] { margin: 0; margin-left: 0.4rem; margin-right: 0.4rem; vertical-align: middle; }
input[type="radio"].first_in_group { margin-left: 1.5rem; }
input[type="radio"].next_in_group { margin-left: 0.75rem; }
input[type="radio"].space_inline, input[type="checkbox"].space_inline { margin-left: 1.5rem; }
select.wide { min-width: 12em; }
.header_select { font-size: 1.1rem; font-weight: 500; margin: 0.4rem; }

/* ── Tables ───────────────────────────────────────────────── */
table {
  border-collapse: collapse;
  page-break-inside: auto;
}
th, td {
  text-align: left;
  padding: 0.5rem 0.65rem;
  white-space: nowrap;
  font-size: 0.875rem;
  border-bottom: 1px solid #f1f5f9;
}
th {
  background: #e8ecf1;
  color: #2d3748;
  font-weight: 600;
  font-size: 0.875rem;
}
#reports th { background: transparent; }
#add_time_off_form th { background: transparent; }
#add_time_off_form tbody tr:hover, #add_time_off_form tr:hover { background: transparent; }
#existing_overrides tbody tr:hover, #existing_overrides tr:hover { background: transparent; }
#edit_pto_form th { background: transparent; }
#edit_pto_form tbody tr:hover, #edit_pto_form tr:hover { background: transparent; }
div.header_div tbody tr:not(.selectable):not(.viewable):hover { background: transparent; }
tbody tr.nosort:not(.selectable):not(.viewable):hover { background: transparent; }
.runcard_buttons tbody tr:hover, .runcard_buttons tr:hover { background: transparent; }
/* App-wide: rows holding action buttons get no row-hover highlight. Data rows (.selectable/.viewable) are excluded and keep their hover. */
tbody tr:not(.selectable):not(.viewable):has(button):hover,
tbody tr:not(.selectable):not(.viewable):has(input[type="submit"]):hover,
tbody tr:not(.selectable):not(.viewable):has(input[type="button"]):hover { background: transparent; }
tr.nosort th { background: transparent; }
th h3 { font-size: 0.95rem; margin: 0.15em 0; }
a.report_back, a.report_back:link, a.report_back:visited { display: inline-block; margin-bottom: 0.5em; color: #475569; text-decoration: none; font-size: 0.875rem; }
a.report_back:hover { color: var(--color-brand); }

tbody tr:hover { background: #f8fafc; }
td.today:hover { background: #f8fafc !important; border: 4px solid var(--color-brand-dk) !important; border-radius: 6px; cursor: pointer; box-sizing: border-box; }
td.not_today:hover { background: #f8fafc !important; border: 4px solid #94a3b8 !important; border-radius: 6px; cursor: pointer; box-sizing: border-box; }

tbody tr:last-child td { border-bottom: none; }
tbody, tr { page-break-inside: avoid; page-break-after: auto; }
tr.viewable, tr.selectable, tr.selected { height: 2.4em; }
tr.selectable td { padding-top: 0.1rem; padding-bottom: 0.1rem; }

tr.tr_chf, tr.tr_dep, tr.tr_dc, tr.tr_bc, tr.tr_ac, tr.tr_sc { background: #dbeafe; }
tr.tr_cpt, tr.tr_cpt_oog { background: #e0ecf8; }
tr.tr_lt, tr.tr_lt_oog { background: #eaf1fb; }
tr.title th, tr.title td, tr.large_title th, tr.large_title td { background: var(--color-brand); color: #ffffff; }
tr.title { font-size: 1rem; }
tr.large_title { font-size: 1.15rem; }
tr.subtotal { font-size: 0.875rem; }
tr.highlight { background: #dbeafe; }
tr.spaced_row { height: 2.5em; }

th.main_menu { color: #ffffff; padding: 0 1em; text-align: center; font-size: 1.3rem; }
th.no_padding { padding: 0; }
table.dn_content { width: 100%; }
th.title_dn { font-size: 1rem; background: var(--color-brand); color: #ffffff; min-width: 20em; text-align: center; }
th.title12 { min-width: 12em; padding: 0.35em; }
th.title8 { min-width: 8em; padding: 0.35em; }
th.lefttitle { font-size: 1rem; background: var(--color-brand); color: #ffffff; }
th.cal_title { text-align: center; padding: 0.75em; border: 0; background: #f1f5f9; color: #1e2a38; border-radius: 8px 8px 0 0; }
th.cal { text-align: center; min-width: 8em; padding: 0.6em; background: var(--color-brand); color: #ffffff; }
th.cal_title select, th.cal_title input[type="submit"] { margin: 0 0.4rem; vertical-align: middle; }
th.cal_title select { position: relative; top: 1px; }
table.print_center { border-collapse: separate; border-spacing: 3px; border-radius: 8px; }
th.span { text-align: center; padding: 0 3em; white-space: nowrap; }
th.debug, td.debug { padding: 0.2em; font-size: 0.85rem; }
th.debug2, td.debug2 { padding: 0.2em 0.4em; font-size: 0.78rem; }
td.spaceright { padding-right: 4em; }
td.small_spaceright { padding-right: 1.5em; }
td.table_container { padding: 0.15em; }
td.indent, th.indent { padding-left: 1em; }
td.empty_leave_book_spot { background-color: #e2e8f0; padding: 0; min-width: 10em; }
td.today { padding: 0.4em; background: #ffffff; min-height: 5em; min-width: 8em; border: 4px solid var(--color-brand) !important; border-radius: 6px; vertical-align: top; box-sizing: border-box; }
td.not_today { padding: 0.4em; background: #ffffff; min-height: 5em; min-width: 8em; border: 4px solid #e2e8f0 !important; border-radius: 6px; vertical-align: top; box-sizing: border-box; }
td.available { color: #16a34a; text-align: center; }
td.unavailable { color: #dc2626; text-align: center; }
td.no_record { color: #ea580c; text-align: center; }

td.open_shift, td.paged_shift, td.requested_shift, td.reassigned_shift,
td.payback_shift, td.swapped_shift, td.override_shift, td.denied_shift,
td.filled_shift, td.scheduled_shift, td.unscheduled_shift, td.donotfill_shift,
td.pending_cancellation_shift, td.counter, td.counter_pause, td.counter_warning,
td.accepted, td.call { border: none; padding: 0.15em; }

td.open_shift, td.paged_shift, td.counter_pause, td.call { color: var(--color-brand); }
td.requested_shift, td.counter_warning, td.do_not_count { color: #ea580c; }
td.reassigned_shift, td.swapped_shift, td.override_shift, td.denied_shift { color: #2563eb; }
td.filled_shift, td.counter, td.accepted, td.active { color: #16a34a; }
td.scheduled_shift, td.donotfill_shift { color: #1e2a38; }
td.unscheduled_shift { background-color: #f8fafc; }
td.payback_shift { color: #7c3aed; }
td.pending_cancellation_shift { color: #92400e; }
td.skip_active { color: var(--color-brand); }
td.grenga_warning { background-color: #fef3c7; }
td.input_radio { font-size: 0.78rem; }

/* ── Leave Book ───────────────────────────────────────────── */
td.leave_book_member_col { min-width: 10em; }

/* ── Section Headers ─────────────────────────────────────── */
.stitle, .bc_title_1 {
  background: var(--color-brand); color: #ffffff; padding: 0.4rem 0.65rem; border-radius: 5px; font-weight: 600;
}
tr.stitle th { background: #ced6e0; }
.runcard_content tr.stitle th { padding-top: 0.75em; }
.runcard_content tr.large_title th, .runcard_content th.title_dn { background: #b8c2cc; color: #1e2a38; }
.runcard_content .dn_content td { padding-left: 3em; }
.runcard_content .dn_content td:first-child { padding-left: 2em; }
.runcard_content table.dn_content { margin-top: 0.8em; }
.sub_title, .bc_title_2 {
  background: var(--color-brand-75); color: #ffffff; font-size: 1.1rem; padding: 0.3rem 0.65rem; border-radius: 4px;
}
tbody.hide_section { display: none; }
tr.viewable > td:first-child, tr.selectable > td:first-child { padding-left: 1em; }

/* ── Calendar ────────────────────────────────────────────── */
.flex-item-left, .flex-item-right { margin-top: 1.5rem; padding: 0 1rem; }
h2.cal_title { vertical-align: middle; display: inline-block; min-width: 8em; margin: 0.4em; }
p.cal { text-align: center; font-size: 1.3rem; margin: 0; font-weight: 600; color: #1e2a38; }
p.cal_filled { text-align: left; font-size: 0.8rem; margin: 0; color: #16a34a; }
p.cal_open { text-align: left; font-size: 0.8rem; margin: 0; color: #dc2626; }
p.cal_group { text-align: left; margin: 0.5em 0 0.5em 0.8em; }
p.cal_req { text-align: left; font-size: 0.8rem; margin: 0; color: #ea580c; }
p.cal_scheduled { text-align: left; font-size: 0.8rem; margin: 0; color: #1e2a38; }
p.event { text-align: center; margin: 0.05em; background: #fce7ea; font-size: 0.78rem; border-radius: 3px; }
p.no_event { text-align: center; margin: 0.05em; font-size: 0.78rem; }
img.cal_print { height: 2.5em; }

/* ── Login ─────────────────────────────────────────────────── */
.login { padding: 0; font-weight: 600; }
.login_sans { font-size: 0.82rem; padding: 0; }
.login_sans_space { font-size: 0.82rem; padding: 0 0 1.25rem 0; }
.login_invalid { padding: 0 0 0.75rem 0; color: var(--color-brand); font-weight: 500; }
img.login { height: 6em; padding-bottom: 1.5em; }
img.wip { width: 40%; margin-left: 30%; }
img.splash { width: 60%; padding: 1.5em; }

/* ── Utility ─────────────────────────────────────────────── */
.system_message { margin: 4em; }
.subtext { font-size: 0.875rem; color: #64748b; white-space: pre; }
.pay_code { font-size: 0.875rem; color: #64748b; }
.display_notes { color: #64748b; white-space: pre; }
p.text_on_red { color: #e2e8f0; }
p.level1 { color: #1e2a38; margin: 0.6em 0; font-size: 0.875rem; }
p.options { text-decoration: underline; cursor: pointer; color: var(--color-brand); }
.option_unchanged { color: #cbd5e1; }
.disabled { background-color: #fee2e2; }
.highlight { background: #fef9c3; }
.below_minimum { color: #dc2626; font-weight: 600; }
.at_minimum { color: #16a34a; font-weight: 600; }
.list_below_min { background: #fef9c3; }
.small_font { font-size: 0.82rem; }
.very_large_text { font-size: 1.4rem; }
.large_text { font-size: 1.15rem; }
.checkbox_text { font-size: 0.82rem; vertical-align: text-top; margin-left: 0.4rem; }
.data { padding: 0; }
.no_wrap { white-space: nowrap; }
.pointer { cursor: pointer; }
.left { text-align: left; }
.center { text-align: center; }
.right { text-align: right; min-width: 6em; }
.time { min-width: 8em; }
.wide10em { min-width: 10em; }
.wide { min-width: 25em; }
.xwide { min-width: 50em; }
.spacebefore { margin-top: 1.25em; }
.spaceafter { margin-bottom: 1.25em; }
.spaceright { margin-right: 1.5em; }
.space_tb { margin-top: 0.5em; margin-bottom: 0.5em; }
.space_before { margin-top: 0.75em; }
.spacer_row { height: 0.75em; }
.half_spacer_row { height: 0.4em; }
.header { margin-top: 0.4em; margin-bottom: 0.4em; }
img.header { margin-right: 0.75em; vertical-align: middle; }
img.header_right_icon { vertical-align: middle; margin: 0.75em; float: right; height: 2em; }
.cell { margin: 0.15em; }
.pad_checkbox { padding-left: 0.6em; padding-right: 0.6em; height: 2em; }
.space_inline { margin-left: 1.5em; margin-right: 0; }
.first_in_group { margin-left: 1.5em; }
.next_in_group { margin-left: 0.75em; }
legend { font-size: 1rem; }
hr { margin-bottom: 0.75em; border: none; border-top: 1px solid #e2e8f0; }
embed.pdf { height: 16em; }
.nopagebreak { page-break-inside: avoid; }
.col1 { position: absolute; left: 14em; }
.col2 { position: absolute; left: 24em; }
.col3 { position: absolute; left: 32em; }

/* ── Loader ──────────────────────────────────────────────── */
.loader {
  width: 14px; height: 14px; border: 2px solid #e2e8f0; border-radius: 50%;
  display: inline-block; position: relative; box-sizing: border-box;
  animation: rotation 0.9s linear infinite;
}
.loader::after {
  content: ''; box-sizing: border-box; position: absolute;
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent;
  border-bottom-color: var(--color-brand);
}
@keyframes rotation { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* ── Print ───────────────────────────────────────────────── */
@media print {
  .noprint, th.title_dn, tr.large_title { display: none; }
  .runcard_content tr.large_title { display: table-row; }
  .runcard_content th.title_dn { display: table-cell; }
  div.content { display: inline-block; width: 100%; }
  fieldset { border: none; padding: 0; margin: 0; }
  .print_center { margin: 0 auto; }
  .print_center_text { text-align: center; margin: 0.2em 0; }
  #wrapper { display: block; min-height: 0; padding: 0; }
  #menu, #header, #footer { display: none; }
  body { background: #ffffff; margin: 0; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  h2 { font-size: 1.1rem; margin: 0.25em 0; }
  th, td { padding: 0.2rem 0.4rem; font-size: 0.75rem; border: none; }
  table { box-shadow: none; border: none; }
  div.dn_runcard_content { padding: 0.15rem; }
  tr.selectable { height: auto; }
  div.runcard_content { display: inline-block; padding: 0; }
  .runcard_print_header { display: flex; align-items: center; padding: 0 0 0.3rem 0; margin-bottom: 0.4rem; border-bottom: 1px solid #ccc; }
  .runcard_print_header img { height: 2rem; width: auto; }
  .runcard_print_header span { flex: 1; text-align: center; font-size: 1.2rem; font-weight: 600; }

  /* V1-JC-040 — Modern reports: print only the content area */
  .report-tab-bar, .report-tabs, .modern-reports-sidebar { display: none !important; }
  .modern-reports { display: block; height: auto; min-height: 0; border: none; border-radius: 0; }
  .modern-reports-main { overflow: visible; }
  .modern-reports-results { padding: 0; }
  .modern-report-wrap { padding: 0; }
  .modern-report-tabs { display: none !important; }
  .modern-report-titlebar button { display: none !important; }
  #modern-report-tab-data { display: block !important; }
  #modern-report-tab-charts { display: none !important; }
}
@media screen { .noscreen { display: none; } }

/* ── Responsive — Phone (≤768px) ─────────────────────────── */
/* Hamburger button: hidden on desktop, shown on mobile */
#mobile_menu_btn {
  display: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.35);
  color: #fff;
  font-size: 1.3rem;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  cursor: pointer;
  margin: 0 0.5rem 0 0;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}
#mobile_menu_btn:hover { background: rgba(255,255,255,0.12); }

/* Zoom toggle: hidden on desktop, shown on mobile */
#view_toggle_btn {
  display: none;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.75);
  font-size: 0.7rem;
  font-weight: 500;
  height: 28px;
  padding: 0 0.6rem;
  border-radius: 5px;
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
  letter-spacing: 0.02em;
  align-self: center;
}
#view_toggle_btn:hover { background: rgba(255,255,255,0.22); }

/* Overlay for off-canvas menu */
#mobile_menu_overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 149;
}
#mobile_menu_overlay.overlay-visible { display: block; }

@media (max-width: 768px) {

  /* ── Body / Layout ── */
  body { min-width: 0; }

  #wrapper {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto 1fr auto;
  }

  /* ── Header ── */
  #header { padding: 0 0.75rem; gap: 0; grid-column: 1 / -1; }
  #mobile_menu_btn { display: inline-flex; align-items: center; justify-content: center; }
  #view_toggle_btn { display: inline-flex; align-items: center; justify-content: center; }

  /* ── Sidebar — off-canvas drawer ── */
  #menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    min-width: 260px;
    height: 100vh;
    z-index: 150;
    transform: translateX(-100%);
    transition: transform 0.2s cubic-bezier(0.2,0.8,0.2,1);
    padding-top: 1rem;
    display: none;
  }
  #menu.menu-open { display: block; transform: translateX(0); }

  /* Larger tap targets for sidebar links */
  p.menu a.level1, p.menu a {
    font-size: 0.9rem;
    padding: 0.7rem 1.25rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* Submenu tap targets */
  p.menu a.level2 {
    font-size: 0.85rem;
    padding: 0.6rem 1.25rem 0.6rem 2.25rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* ── Content area ── */
  div.content { padding: 0.75rem; overflow-x: auto; }
  div.inner_content { padding: 0.25rem; }

  /* ── Tables — horizontal scroll ── */
  div.scroll, div.inner_content, div.content, div.runcard_content {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Relax min-widths that force tables wider than the screen */
  th.cal, td.today, td.not_today { min-width: 3em; }
  th.title_dn { min-width: 0; }
  th.title12 { min-width: 0; }
  th.title8 { min-width: 0; }
  td.empty_leave_book_spot, td.leave_book_member_col { min-width: 0; }
  .wide { min-width: 0; }
  .xwide { min-width: 0; }
  .wide10em { min-width: 0; }
  .time { min-width: 0; }
  .right { min-width: 0; }

  /* Table headers stay on one line; data cells can wrap for long content */
  th { white-space: nowrap; }
  td { white-space: normal; word-break: normal; }

  /* ── Calendar ── */
  th.cal { font-size: 0.7rem; padding: 0.4em; }
  p.cal { font-size: 1rem; }
  p.cal_filled, p.cal_open, p.cal_req, p.cal_scheduled { font-size: 0.7rem; }
  h2.cal_title { min-width: 0; font-size: 1.1rem; margin: 0.25em; }
  th.cal_title { padding: 0.5em; }
  td.today, td.not_today { padding: 0.25em; min-height: 3em; border-width: 3px !important; }
  button.cal_nav { margin: 0 0.2rem !important; }

  /* ── Calendar Dashboard ── */
  #cal_dashboard { flex-direction: column; align-items: stretch; margin: 0.5rem; padding: 0.6rem 0.9rem; font-size: 0.8rem; }
  #cal_dashboard_meta { flex-direction: row; align-items: center; gap: 0.6rem; }

  /* ── Forms ── */
  div.header_block { display: block; padding: 0.25rem 0; }
  div.header_div { flex-wrap: wrap; min-height: auto; }
  div.select_assignment { display: block; padding: 0.15rem 0; }
  select, input[type="text"], input[type="date"], input[type="time"], input[type="number"] {
    max-width: 100%;
  }
  input[type="time"] { min-width: 0; }
  .header_select { margin: 0.25rem; }
  div.options { margin-bottom: 0.5rem; }
  div.inline { display: block; padding-right: 0; padding-bottom: 0.5rem; }

  /* ── Buttons — larger tap targets ── */
  input[type="submit"], input[type="button"], button {
    min-height: 40px;
    padding: 0.5rem 1rem;
  }

  /* ── Login ── */
  div.login { min-width: 0; width: 100%; padding: 1.5rem; font-size: 0.95rem; }
  img.login { height: 4.5em; }

  /* ── Day/Night layout ── */
  div.dn_content { min-width: 100%; display: block; }
  div.chart_double_wide { width: 100%; display: block; }

  /* ── Utility — tighten spacing ── */
  .spaceright { margin-right: 0.5em; }
  .space_inline { margin-left: 0.5em; }
  .first_in_group { margin-left: 0.5em; }
  .col1, .col2, .col3 { position: static; }

  /* ── Footer ── */
  #footer { padding: 0.5rem 0.75rem; grid-column: 1 / -1; }
  #footer p.text_on_red { font-size: 0.72rem; margin-bottom: 0.5rem; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   V1-JC-040 — Modern Reports (Odyssey Style)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Tab Bar ── */
.report-tab-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.report-tab-bar h2 { margin: 0; }
.report-tabs { display: flex; gap: 0.35rem; }
.report-tab-content { min-height: 300px; }

/* ── Sidebar + Main layout ── */
.modern-reports { display: flex; height: calc(100vh - 12rem); min-height: 420px; border: 1px solid #dce1e8; border-radius: 10px; overflow: hidden; background: #ffffff; }

.modern-reports-sidebar { width: 250px; flex-shrink: 0; border-right: 1px solid #dce1e8; background: #f8f9fb; overflow-y: auto; padding: 10px 8px; }

/* ── Collapsible Categories ── */
.modern-reports-category { margin-bottom: 6px; }
.modern-reports-category-header { display: flex; align-items: center; gap: 6px; padding: 6px 8px; margin-bottom: 2px; width: 100%; border: none; background: transparent; cursor: pointer; font-family: inherit; border-radius: 5px; }
.modern-reports-category-header:hover { background: #ebeef3; }
.modern-reports-category-icon { font-size: 13px; }
.modern-reports-category-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; flex: 1; text-align: left; }
.modern-reports-category-arrow { font-size: 10px; color: #8896a7; transition: transform 0.2s; transform: rotate(-90deg); }
.modern-reports-category-arrow.expanded { transform: rotate(0deg); }
.modern-reports-category-items { padding-left: 2px; overflow: hidden; max-height: 0; transition: max-height 0.5s ease; }
.modern-reports-category-items.expanded { max-height: 500px; }

.modern-reports-item { width: 100%; text-align: left; padding: 8px 12px; border-radius: 7px; border: none; cursor: pointer; background: transparent; margin-bottom: 2px; display: block; transition: background 0.12s; font-family: inherit; }
.modern-reports-item:hover { background: #ebeef3; }
.modern-reports-item.active { background: #e2e6ed; }
.modern-reports-item-label { font-size: 13px; font-weight: 500; color: #1e2a38; }
.modern-reports-item.active .modern-reports-item-label { font-weight: 700; }
.modern-reports-item-desc { font-size: 11px; color: #8896a7; margin-top: 2px; line-height: 1.4; }

/* ── Main Content Area ── */
.modern-reports-main { flex: 1; min-width: 0; overflow-y: auto; }

.modern-reports-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; gap: 8px; color: #8896a7; font-size: 13px; }
.modern-reports-empty-icon { font-size: 32px; }

.modern-reports-options { padding: 24px; }
.modern-reports-results { padding: 24px; }

/* ── Report Header ── */
.modern-reports-header { margin-bottom: 24px; }
.modern-reports-header-title { font-size: 16px; font-weight: 800; color: #1e2a38; }
.modern-reports-header-subtitle { font-size: 12px; color: #8896a7; margin-top: 3px; }
.modern-reports-back-link { font-size: 12px; color: var(--color-brand); text-decoration: none; }
.modern-reports-back-link:hover { text-decoration: underline; }

/* ── Filter Controls ── */
.modern-reports-filters { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 24px; }

.modern-reports-filter-group { display: flex; flex-direction: column; gap: 5px; }
.modern-reports-filter-label { font-size: 10px; font-weight: 700; color: #8896a7; text-transform: uppercase; letter-spacing: 0.06em; }

.modern-reports-select { padding: 7px 10px; border-radius: 7px; border: 1px solid #dce1e8; font-size: 13px; color: #1e2a38; background: #ffffff; outline: none; min-width: 160px; font-family: inherit; }
.modern-reports-select:focus { border-color: var(--color-brand); box-shadow: 0 0 0 3px var(--color-brand-12); }
.modern-reports-select-multi { min-height: 120px; }

.modern-reports-input { padding: 7px 10px; border-radius: 7px; border: 1px solid #dce1e8; font-size: 13px; color: #1e2a38; outline: none; font-family: inherit; }
.modern-reports-input:focus { border-color: var(--color-brand); box-shadow: 0 0 0 3px var(--color-brand-12); }

.modern-reports-date-range { display: flex; align-items: center; gap: 8px; }
.modern-reports-date-sep { font-size: 12px; color: #8896a7; }

.modern-reports-radio-group { display: flex; gap: 14px; padding-top: 2px; }
.modern-reports-radio { font-size: 13px; color: #1e2a38; cursor: pointer; display: flex; align-items: center; gap: 4px; }

/* ── Submit Button ── */
.modern-reports-submit { padding-top: 8px; }
.modern-reports-btn { padding: 10px 28px; border-radius: 8px; border: none; background: var(--color-brand); color: #ffffff; font-size: 14px; font-weight: 700; cursor: pointer; transition: background 0.15s, box-shadow 0.15s; font-family: inherit; }
.modern-reports-btn:hover { background: var(--color-brand-dk); box-shadow: 0 2px 8px var(--color-brand-30); }

/* ── Modern Report Results Wrapper ── */
.modern-report-wrap { }
.modern-report-wrap table { border-radius: 10px; overflow: hidden; }
.modern-report-wrap tr.title th, .modern-report-wrap tr.stitle th { background: #f4f6f8; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: #5a6a7d; border-bottom: 2px solid #dce1e8; }
.modern-report-wrap tr:nth-child(even) td { background: #f9fafb; }
.modern-report-wrap tr.viewable td { padding: 8px 12px; border-bottom: 1px solid #eceef1; font-size: 13px; }

/* Title row: h1 left, CSV button right */
.modern-report-titlebar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.25rem; }
.modern-report-titlebar h1 { margin: 0; }
.modern-report-titlebar form { margin: 0; }
.modern-report-titlebar button { padding: 7px 18px; border-radius: 7px; border: 1px solid #dce1e8; background: #ffffff; color: #1e2a38; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; transition: background 0.12s; }
.modern-report-titlebar button:hover { background: #f1f3f7; }

/* Data / Charts tabs */
.modern-report-tabs { display: flex; gap: 0; margin: 1rem 0 0; border-bottom: 2px solid #dce1e8; }
.modern-report-tab { background: transparent !important; color: #5a6a7d !important; font-weight: 600; border: none; padding: 0.6rem 1.25rem; cursor: pointer; font-size: 14px; font-family: inherit; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: color 0.15s, border-color 0.15s; box-shadow: none !important; border-radius: 0; }
.modern-report-tab:hover { background: #f1f3f7 !important; color: #1e2a38 !important; box-shadow: none !important; }
.modern-report-tab.active { color: var(--color-brand) !important; border-bottom-color: var(--color-brand); background: transparent !important; }
.modern-report-tab-content { display: none; padding-top: 1rem; }
.modern-report-tab-content.active { display: block; }
.modern-report-charts-empty { padding: 3rem; text-align: center; color: #8896a7; font-size: 14px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .modern-reports { flex-direction: column; height: auto; min-height: auto; }
  .modern-reports-sidebar { width: 100%; border-right: none; border-bottom: 1px solid #dce1e8; max-height: 260px; }
  .modern-reports-filters { flex-direction: column; }
  .report-tab-bar { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
}


/* ── V1-JC-048 — Modern report output (V5 Odyssey style) ─────────────────── */
/* Reusable report-output kit, used by the PTO report's modern branch and      */
/* intended for subsequent report rebuilds (swaps, availability, bids, …).      */

.rpt-v5-stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 18px; }
.rpt-v5-stat { background: #ffffff; border: 1px solid #d9dce1; border-radius: 10px; padding: 14px 18px; min-width: 104px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.rpt-v5-stat-val { font-size: 26px; font-weight: 800; color: #1f1f1f; line-height: 1; font-variant-numeric: tabular-nums; }
.rpt-v5-stat-label { font-size: 10px; font-weight: 700; color: #8896a7; text-transform: uppercase; letter-spacing: 0.07em; margin-top: 6px; }

.rpt-v5-subhead { font-size: 11px !important; font-weight: 700 !important; color: #8896a7 !important; text-transform: uppercase; letter-spacing: 0.05em; margin: 0 !important; }
.rpt-v5-subhead span { font-weight: 600; color: #5a6a7d; text-transform: none; letter-spacing: 0; }

.rpt-v5-section { background: #ffffff; border: 1px solid #d9dce1; border-radius: 10px; overflow: hidden; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.rpt-v5-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #e7eaee; background: #fbfcfd; }
.rpt-v5-section-title { font-size: 14px; font-weight: 700; color: #1f2a38; }
.rpt-v5-section-count { font-size: 11px; font-weight: 600; color: #8896a7; font-variant-numeric: tabular-nums; white-space: nowrap; }

.rpt-v5-thead { display: grid; gap: 12px; padding: 9px 16px; background: #f4f6f8; border-bottom: 1px solid #e7eaee; }
.rpt-v5-thead span { font-size: 10px; font-weight: 700; color: #8896a7; text-transform: uppercase; letter-spacing: 0.06em; }
.rpt-v5-row { display: grid; gap: 12px; padding: 9px 16px; align-items: center; border-bottom: 1px solid #f0f2f5; font-size: 13px; color: #1f2a38; }
.rpt-v5-row:nth-child(even) { background: #fafbfc; }
.rpt-v5-primary { font-weight: 500; }
.rpt-v5-shift { color: #5a6a7d; font-variant-numeric: tabular-nums; }
.rpt-v5-half { font-size: 11px; color: #8896a7; }

.rpt-v5-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.rpt-v5-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; display: inline-block; }

.rpt-v5-foot { display: flex; flex-wrap: wrap; gap: 8px; padding: 11px 16px; background: #fbfcfd; border-top: 1px solid #e7eaee; }
.rpt-v5-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 99px; background: #ffffff; border: 1px solid #e2e6ea; font-size: 12px; color: #4a4a4a; }
.rpt-v5-chip strong { color: #1f1f1f; font-variant-numeric: tabular-nums; }

.rpt-v5-empty { padding: 40px 16px; text-align: center; color: #8896a7; font-size: 13px; background: #ffffff; border: 1px solid #d9dce1; border-radius: 10px; }

/* Chart card — pairs with the existing .chart_double_wide layout (40% desktop, 100% mobile). */
/* `div.` prefix matches the specificity of div.chart_double_wide so the padding override wins. */
.rpt-v5-chartcard { background: #ffffff; border: 1px solid #d9dce1; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); margin: 0 1.5% 16px 0; vertical-align: top; }
div.rpt-v5-chartcard { padding: 18px; }
