* { box-sizing: border-box; }
body { font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; margin: 0; color: #1c2430; background: #f5f6f8; }
a { color: #2f6fed; }
main { max-width: 1400px; margin: 0 auto; padding: 10px 16px 16px; }
main.narrow { max-width: 560px; }
.topbar { display: flex; justify-content: space-between; align-items: center; background: #17365d; color: #fff; padding: 7px 16px; }
.topbar .brand { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.brandlogo { height: 40px; width: auto; display: block; }
.logowrap { text-align: center; margin: 20px 0 4px; }
.logowrap .patch { background: #17365d; border-radius: 16px; padding: 12px 18px; display: inline-block; }
.logowrap img { height: 120px; width: auto; display: block; }
.topbar .brand span { font-weight: 400; opacity: .8; }
.topbar a { color: #cfe0ff; }
.mainnav { display: flex; flex-wrap: wrap; gap: 2px; background: #22497c; padding: 6px 10px; }
.mainnav a { color: #e6eeff; text-decoration: none; padding: 6px 10px; border-radius: 4px; font-size: 14px; }
.mainnav a.on, .mainnav a:hover { background: #2f6fed; color: #fff; }
h1 { font-size: 22px; } h2 { font-size: 18px; margin-top: 26px; } h3 { font-size: 15px; }
.muted { color: #667; font-size: 13px; }
.small { font-size: 12px; }
.right { float: right; }
.card { background: #fff; border: 1px solid #dde2ea; border-radius: 8px; padding: 14px; margin: 10px 0; }
.card label, form.card label { display: block; margin: 8px 0; }
input, select, textarea { padding: 7px 9px; border: 1px solid #b9c2d0; border-radius: 5px; font-size: 14px; max-width: 100%; }
input[readonly] { background: #f0f2f6; width: min(560px, 100%); }
textarea { width: min(560px, 100%); }
label.check { display: inline-flex; align-items: center; gap: 6px; margin-right: 14px; }
.btn { display: inline-block; background: #eef1f6; border: 1px solid #b9c2d0; color: #1c2430; padding: 7px 12px; border-radius: 6px; cursor: pointer; text-decoration: none; font-size: 14px; }
.btn.primary { background: #2f6fed; border-color: #2f6fed; color: #fff; }
.btn.danger { background: #fdecec; border-color: #d66; color: #922; }
.btn.small { padding: 4px 8px; font-size: 13px; }
.flash { background: #e6f4ea; border: 1px solid #7bc48a; padding: 10px 12px; border-radius: 6px; margin: 10px 0; }
.error { background: #fdecec; border: 1px solid #d66; padding: 10px 12px; border-radius: 6px; margin: 10px 0; }
.notice { background: #fff8d6; border: 1px solid #e0cd6a; padding: 10px 12px; border-radius: 6px; margin: 10px 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 12px 0; }
.tile { background: #fff; border: 1px solid #dde2ea; border-radius: 8px; padding: 14px; text-decoration: none; color: #1c2430; display: flex; flex-direction: column; gap: 6px; }
.tile span { color: #667; font-size: 13px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; position: sticky; top: 0; z-index: 5; background: #f5f6f8; padding: 6px 0; }
.viewbar { margin: 6px 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0; }
details.card { padding: 8px 12px; margin: 6px 0; }
details.card summary { font-weight: 600; cursor: pointer; }
.daybar.slim { padding: 8px 12px; margin: 6px 0; }
form.inline { display: inline; }
.weekstrip { display: flex; gap: 14px; align-items: center; justify-content: space-between; background: #fff; border: 1px solid #dde2ea; border-radius: 6px; padding: 6px 12px; margin: 6px 0; }
.wklabel { font-weight: 700; }
.gridwrap { overflow-x: auto; background: #fff; border: 1px solid #dde2ea; border-radius: 8px; }
table.grid { border-collapse: collapse; width: 100%; min-width: 900px; }
table.grid th, table.grid td { border: 1px solid #dde2ea; padding: 6px; vertical-align: top; font-size: 13px; }
table.grid th { background: #eef1f6; }
table.grid .rowhead { min-width: 150px; text-align: left; }
tr.unassigned-row td, tr.unassigned-row th { background: #fffacd; }
.shift { border-left: 5px solid #2f6fed; background: #eef3ff; border-radius: 4px; padding: 5px 7px; margin: 4px 0; cursor: pointer; }
.shift.draft { opacity: .65; border-left-style: dashed; }
.shift .stime { font-weight: 700; }
.shift .spos { font-weight: 600; }
.off { color: #99a; text-align: center; padding: 6px; }
.timeoff { background: #ffe6e6; border-radius: 4px; padding: 4px 6px; margin: 4px 0; font-size: 12px; }
.mshift { border-top: 1px solid #e3e7ee; padding: 4px 2px; font-size: 12px; cursor: pointer; }
.datenum { font-weight: 700; text-decoration: none; font-size: 13px; color: #3a4658; }
.datenum:hover { color: #2f6fed; }
td.othermonth { opacity: .4; }
table.grid.month td { min-height: 58px; width: 14.28%; padding: 4px; }
.shiftgrid th, .shiftgrid td { padding: 5px 8px; }
.shiftgrid td:not(:first-child), .shiftgrid th:not(:first-child) { text-align: center; }
.shiftgrid input[type="checkbox"] { width: 18px; height: 18px; }
.shiftgrid tr:hover td { background: #f4f7ff; }
.presetrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.rdolegend { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.rdochip { padding: 5px 12px; border-radius: 4px; font-weight: 700; border: 1px solid #00000022; }
.rdochip.hol { background: #fff; }
.holring { display: inline-block; border: 2.5px solid #111; border-radius: 50%; min-width: 21px; line-height: 19px; padding: 1px 2px; text-align: center; font-weight: 700; }
.rdogrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.rdomonth { background: #fff; border: 1px solid #dde2ea; border-radius: 6px; overflow: hidden; }
.rdomonthname { background: #3b5b7e; color: #fff; font-weight: 700; text-align: center; padding: 5px; font-size: 15px; }
table.rdotable { border-collapse: collapse; width: 100%; }
table.rdotable th { font-size: 11px; color: #456; padding: 3px 0; background: #dbe4f2; text-align: center; }
table.rdotable td { text-align: center; font-size: 12.5px; padding: 4px 0; width: 14.28%; }
.rdocell.dim { opacity: .3; }
.rdocell.today { outline: 3px solid #17365d; outline-offset: -3px; font-weight: 700; }
table.shiftgrid tr.rdrow td.cbcell { opacity: .35; }
.mloc { display: block; font-size: .85em; color: #555; }
.nmshort { display: none; }
.unshort { display: none; }
.dropwrap { position: relative; display: inline-block; }
.droppanel { position: absolute; top: calc(100% + 4px); left: 0; z-index: 40; background: #fff; border: 1px solid #c6cede; border-radius: 8px; box-shadow: 0 10px 28px rgba(10, 25, 60, .22); padding: 12px; min-width: 292px; }
.droppanel.hidden { display: none; }
.droppanel label { display: block; margin: 6px 0; }
.droppanel .exportpick label { display: inline-flex; margin: 0; }
.droppanel .filters input, .droppanel .filters select { width: 100%; margin: 4px 0; }
.panelsep { border: 0; border-top: 1px solid #dde3ee; margin: 10px 0; }
.mainnav .portalnav { margin-left: auto; display: flex; align-items: center; }
.mainnav .portalnav button { background: #fff; color: #17365d; border: 0; border-radius: 4px; padding: 5px 10px; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.exportpick { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.exportpick input { padding: 4px 6px; }
.mymobilelist { display: none; }
.myshift { display: flex; gap: 12px; background: #fff; border: 1px solid #dde2ea; border-radius: 8px; padding: 10px 12px; margin: 8px 0; cursor: pointer; }
.myshift .mydate { font-weight: 700; color: #17365d; min-width: 118px; }
.myshift .myinfo { flex: 1; }
.month .mshift { display: flex; gap: 6px; align-items: flex-start; }
.month .mtime { flex: 0 0 auto; white-space: nowrap; }
.month .mrest { flex: 1 1 auto; min-width: 0; }
.editgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 10px 0; }
.editgrid label { display: flex; flex-direction: column; gap: 3px; font-size: .9em; }
.editgrid label.check { flex-direction: row; align-items: center; gap: 6px; }
.assignlist { margin: 6px 0; }
.assignrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid #edf0f4; }
.assignany { margin-top: 10px; }
.viewasbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; background: #fff3cd; border: 1px solid #e0cd6a; border-radius: 6px; padding: 8px 12px; margin: 6px 0 10px; }
.unablecard { border-left: 6px solid #b03a2e; background: #fdecea; }
.unableh { margin-top: 0; color: #8c2b20; font-size: 22px; }
.posband { text-align: center; font-weight: 700; color: #20306e; padding: 2px 3px; border-radius: 3px; margin: 5px 0 2px; font-size: 12px; }
.month .mshift { border-top: none; padding: 2px 1px 3px; cursor: pointer; font-size: 12.5px; line-height: 1.35; }
.month .mtime { font-size: 11.5px; color: #667; }
.month .mdesc { color: #667; }
.hl { background: #ffef62; padding: 0 2px; border-radius: 2px; }
td.daysel { background: #ffe9a8 !important; box-shadow: inset 0 0 0 2px #d9a400; }
th.dayhead { cursor: pointer; }
th.daysel { background: #ffe9a8 !important; box-shadow: inset 0 0 0 2px #d9a400; }
.ctxmenu { position: fixed; z-index: 80; width: 230px; background: #fff; border: 1px solid #c6cede; border-radius: 8px; box-shadow: 0 10px 28px rgba(10, 25, 60, .28); padding: 6px; }
.ctxmenu.hidden { display: none; }
.ctxmenu .ctxhead { font-weight: 700; color: #17365d; padding: 4px 10px 6px; }
.ctxmenu button { display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 5px; padding: 8px 10px; font-size: 14px; cursor: pointer; }
.ctxmenu button:hover { background: #e8eefc; }
.ctxmenu .ctxnote { font-size: 12px; color: #667; padding: 6px 10px 4px; line-height: 1.35; }
.ctxtoast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 90; background: #17365d; color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: 0 8px 22px rgba(10, 25, 60, .35); max-width: 92vw; font-size: 14px; }
.daybar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.posband.editable { cursor: pointer; }
.posband.editable:hover { outline: 2px solid #20306e; }
table.list { border-collapse: collapse; width: 100%; background: #fff; }
table.list th, table.list td { border: 1px solid #dde2ea; padding: 7px 9px; font-size: 14px; text-align: left; vertical-align: top; }
table.list th { background: #eef1f6; }
table.grid.chart td.weekend, table.grid th.weekend { background: #f3e9ff; }
.timeline { position: relative; height: 34px; background: repeating-linear-gradient(to right, #fff 0, #fff calc(100%/24 - 1px), #dde2ea calc(100%/24 - 1px), #dde2ea calc(100%/24)); border: 1px solid #dde2ea; border-radius: 6px; margin: 6px 0 14px; }
.timeline .bar { position: absolute; top: 5px; height: 24px; background: #2f6fed; color: #fff; border-radius: 4px; font-size: 12px; padding: 4px 6px; overflow: hidden; white-space: nowrap; }
table.grid.prefs td { text-align: center; }
.prefcell { width: 100%; min-height: 30px; border: 1px solid #b9c2d0; border-radius: 4px; background: #fff; cursor: pointer; font-size: 12px; }
.prefcell.lvl-prefer { background: #bfe8c6; }
.prefcell.lvl-dislike { background: #ffd9a8; }
.prefcell.lvl-cannot { background: #f6b3b3; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: #fff; border: 1px solid #dde2ea; border-radius: 6px; padding: 6px 8px; }
.cov { text-align: center; }
.cov-p { background: #bfe8c6; } .cov-d { background: #ffd9a8; } .cov-x { background: #f6b3b3; } .cov-to { background: #ffe6e6; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: middle; }
.badge { background: #2f6fed; color: #fff; border-radius: 8px; padding: 1px 7px; font-size: 12px; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-start; justify-content: center; padding-top: 60px; z-index: 50; }
.modal.hidden { display: none; }
.modalbox { background: #fff; border-radius: 10px; padding: 18px; width: min(560px, 92vw); max-height: 80vh; overflow: auto; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
/* Phones: the top bar wraps instead of running off the edge, the nav
   becomes one swipeable row, and form fields use 16px text so iOS does
   not auto-zoom on tap. */
@media (max-width: 680px) {
  html, body { overflow-x: hidden; }
  .topbar { flex-wrap: wrap; gap: 2px 10px; padding: 7px 10px; }
  .topbar .brand { font-size: 15px; white-space: normal; }
  .topbar .brand span { display: none; }
  .brandlogo { height: 32px; }
  .topbar .who { flex-basis: 100%; text-align: left; font-size: 13px; margin-left: 40px; }
  .mainnav a.navhide { display: none; }
  .mainnav a.navhome { order: -2; }
  .mainnav a.navmy { order: -1; }
  .mainnav { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .mainnav::-webkit-scrollbar { display: none; }
  .mainnav a { white-space: nowrap; padding: 6px 8px; font-size: 13.5px; }
  main { padding: 8px 10px 14px; }
  input, select, textarea { font-size: 16px; }
  table.list { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .modal { padding-top: 22px; }
  .modalbox { width: 94vw; padding: 14px; }
  .editgrid { grid-template-columns: 1fr; }
  h1 { font-size: 22px; }
  h2 { font-size: 18px; }
  /* The Calendar fits the phone: seven equal day columns instead of
     the 900px desktop table, with the time stacked over the name. */
  table.grid.month { min-width: 0; table-layout: fixed; }
  /* Weekends off the phone calendar (Alex, Oct 31, 2026): the unit
     works Mon-Fri, so when nothing is scheduled on a weekend the
     Sunday and Saturday columns hide on mobile and the five workdays
     take the full width. A month carrying any weekend shift keeps all
     seven columns (the table only gets .noweekend when it is empty).
     Desktop always keeps all seven. */
  table.grid.month.noweekend th:nth-child(1), table.grid.month.noweekend td:nth-child(1),
  table.grid.month.noweekend th:nth-child(7), table.grid.month.noweekend td:nth-child(7) { display: none; }
  table.grid.month.noweekend td { width: 20%; }
  .month .mshift { flex-direction: column; gap: 0; }
  .month .mtime { white-space: normal; }
  .month .mrest { overflow-wrap: anywhere; }
  .posband { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* Button rows wrap onto more lines instead of scrolling sideways
     (Alex, Oct 31, 2026, on the Download button row). */
  .viewbar { display: flex; flex-wrap: wrap; overflow-x: visible; gap: 6px; }
  .viewbar .btn { white-space: normal; flex: 1 1 auto; text-align: center; }
  .filters > * { flex: 1 1 100%; }
  /* My Schedule is a list on phones: the week/month grids and their
     view tabs hide, the upcoming list shows. */
  .mydesktop { display: none; }
  .mymobilelist { display: block; }
  .viewbar .viewtab { display: none; }
  .myshift { flex-direction: column; gap: 2px; }
  .myshift .mydate { min-width: 0; }
  /* Calendar names shrink to first initial + last name, and the
     admin portal toggle is a desktop control. */
  .month .nmfull { display: none; }
  .month .nmshort { display: inline; }
  .portalwrap { display: none; }
  /* Names must fit their day column whole (Alex, Oct 31, 2026:
     "Betancourt" was splitting mid-word). The short name gets its own
     line at a slightly smaller size and clips with an ellipsis in
     the worst case instead of breaking inside the word;
     (Unassigned) becomes (Open) at this width. */
  .month .mrest { overflow-wrap: normal; }
  .month .nmshort { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; letter-spacing: -.2px; }
  .month .unfull { display: none; }
  .month .unshort { display: inline; }
  table.grid.month td { padding: 3px; }
}
@media print { .topbar, .mainnav, .toolbar, .viewbar, .filters, details { display: none; } main { max-width: none; } }
@media (max-width: 700px) { table.grid { min-width: 760px; } }
.nagbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #fff2b8; color: #4a3800; border-bottom: 1px solid #e0c94f; padding: 10px 14px; font-size: 14.5px; margin-bottom: 12px; }
.weekpager { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fff; border: 1px solid #d7dde6; border-radius: 8px; padding: 9px 14px; margin: 10px 0 14px; font-size: 15px; }
.weekpager a { text-decoration: none; }
