/* Construction Operations portal. Builds on the tokens in styles.css. */
body.app { background: var(--bg-alt); min-height: 100vh; }
body.no-scroll { overflow: hidden; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.muted { color: var(--muted); font-size: 13px; }
.warn-text { color: #b4321f !important; }

/* ---------- top bar ---------- */
.app__bar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--navy); color: #fff; padding: var(--space-3) var(--gutter); min-height: 60px;
}
.app__brand { font-family: var(--display); font-size: 24px; letter-spacing: .04em; text-decoration: none; color: #fff; transition: opacity .2s; }
.app__name { font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.app__bar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.app__project select {
  font: inherit; font-size: 14px; padding: 8px 32px 8px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.08) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23fff'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: #fff; appearance: none; -webkit-appearance: none;
}
.app__project option { color: var(--ink); }
.app__user { font-size: 13px; color: rgba(255,255,255,.7); }
.app__bar .btn--outline { color: #fff; border-color: rgba(255,255,255,.3); }
.app__bar .btn--outline:hover { background: #fff; color: var(--ink); }
.app__notice { background: #fff6d6; color: #6b5500; font-size: 13px; padding: var(--space-2) var(--gutter); border-bottom: 1px solid #f0e2a8; }

/* ---------- account (set password) page ---------- */
.account { display: grid; place-items: start center; padding: 56px 16px; }
.account__card { width: min(420px, 100%); }
.account__card .form { margin-top: 4px; }

/* ---------- layout ---------- */
.app__body { display: grid; grid-template-columns: 240px minmax(0, 1fr); max-width: 1400px; margin: 0 auto; }
.app__nav { position: sticky; top: 60px; align-self: start; display: grid; gap: 2px; padding: 24px 12px; }
.app__nav a {
  text-decoration: none; font-size: 14px; font-weight: 500; padding: 10px 14px; border-radius: 10px; color: var(--ink);
}
.app__nav a:hover { background: rgba(0,0,0,.04); }
.app__nav a.is-active { background: #fff; color: var(--maroon); font-weight: 700; box-shadow: 0 1px 0 var(--line); }
.app__main { padding: var(--space-6) var(--gutter) var(--space-8); outline: none; min-width: 0; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-5); }
.page-title { font-family: var(--display); font-weight: 400; font-size: clamp(36px, 4.5vw, 52px); line-height: .95; letter-spacing: .02em; margin: 0; text-transform: uppercase; }
.page-intro { color: var(--muted); margin: 8px 0 0; max-width: 62ch; font-size: 15px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- cards & stats ---------- */
.card { min-width: 0; max-width: 100%; background: #fff; border-radius: var(--radius); padding: var(--card-pad); margin-bottom: var(--grid-gap); box-shadow: 0 1px 0 var(--line); }
.card__title { margin: 0 0 12px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.stats-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--grid-gap); margin-bottom: var(--grid-gap); }
.stat { background: #fff; border-radius: var(--radius); padding: var(--space-4) var(--space-5); box-shadow: 0 1px 0 var(--line); border-left: 4px solid var(--navy); }
.stat--warn { border-left-color: #d0533a; }
.stat--ok { border-left-color: #2f8f5b; }
.stat__label { display: block; font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .04em; }
.stat__value { display: block; font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1.1; margin-top: 4px; letter-spacing: .02em; }

.ov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--grid-gap); margin-bottom: var(--grid-gap); }
.ov-card { background: #fff; border-radius: var(--radius); padding: 18px; text-decoration: none; display: grid; gap: 6px; box-shadow: 0 1px 0 var(--line); transition: transform .15s, box-shadow .15s; }
.ov-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -14px rgba(27,36,54,.35); }
.ov-card__t { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--maroon); }
.ov-card__big { font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1; }
.ov-card__s { font-size: 13px; color: var(--muted); }

.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: grid; grid-template-columns: 90px 1fr auto; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); cursor: pointer; font-size: 14px; }
.activity li:hover .activity__what { color: var(--maroon); }
.activity__tag { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.activity__what { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- tables ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin: var(--space-2) 0 var(--space-3); }
.search { font: inherit; font-size: 14px; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; width: min(320px, 100%); }
.table-wrap { background: #fff; border-radius: var(--radius); overflow-x: auto; box-shadow: 0 1px 0 var(--line); }
table.records, table.mini { width: 100%; border-collapse: collapse; font-size: 14px; }
.records th, .mini th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.records td, .mini td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.records tbody tr { cursor: pointer; }
.records tbody tr:hover, .records tbody tr:focus { background: #faf8f4; outline: none; }
.records tbody tr:last-child td, .mini tbody tr:last-child td { border-bottom: 0; }
.records td.wide { min-width: 200px; }
.records td.strong { font-weight: 600; }
.records td.clamp { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r { text-align: right !important; white-space: nowrap; }
.scroll-x { overflow-x: auto; }
.mini { font-size: 13px; }
.mini td { padding: 9px 10px; } .mini th { padding: 9px 10px; }

.badge-s { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #eceae6; color: #3d4250; white-space: nowrap; }
.badge-s--ok { background: #dcf1e4; color: #1e6b41; }
.badge-s--mid { background: #fff1c9; color: #7a5b00; }
.badge-s--bad { background: #fbe0da; color: #a12d17; }

.empty { background: #fff; border-radius: var(--radius); padding: 44px 20px; text-align: center; display: grid; gap: 12px; justify-items: center; color: var(--muted); box-shadow: 0 1px 0 var(--line); }
.empty p { margin: 0; }

/* ---------- schedule of works ---------- */
.stats-row--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.toolbar__right { display: flex; align-items: center; gap: 12px; }

/* List / Timeline switch */
.seg { display: inline-flex; background: #e9e5de; border-radius: 999px; padding: 3px; }
.seg button { font: inherit; font-size: 13px; font-weight: 600; border: 0; background: none; padding: 6px 14px; border-radius: 999px; cursor: pointer; color: var(--muted); transition: color .2s, background-color .2s; }
.seg button.is-on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* Progress bar */
.pbar { position: relative; display: block; height: 6px; background: #ece8e1; border-radius: 999px; overflow: hidden; flex: 1; min-width: 40px; }
.pbar > span { position: absolute; inset: 0 auto 0 0; background: var(--navy); border-radius: 999px; }
.pbar--done > span { background: #2f8f5b; }
.pbar--late > span { background: #c0392b; }
.pct { font-size: 12px; font-weight: 700; color: var(--ink); min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }

/* Milestone cards */
.ms-list { display: grid; gap: 12px; }
.ms { background: #fff; border-radius: var(--radius); box-shadow: 0 1px 0 var(--line); overflow: hidden; }
.ms__head {
  list-style: none; cursor: pointer; display: grid; align-items: center; gap: 6px 16px; padding: 16px 20px;
  grid-template-columns: 16px minmax(0, 1fr) 104px 190px;
}
.ms__head > .badge-s, .task > .badge-s { justify-self: start; }
.ms__head::-webkit-details-marker { display: none; }
.ms__head:hover { background: #fcfbf8; }
.ms__chev { width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; justify-self: center; }
.ms[open] .ms__chev { transform: rotate(45deg); }
.ms__title { min-width: 0; }
.ms__title h3 { margin: 0; font-size: 16px; line-height: 1.3; }
.ms__meta { font-size: 12px; color: var(--muted); }
.ms__prog, .task__prog { display: flex; align-items: center; gap: 10px; }

.tasks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.task {
  display: grid; align-items: center; gap: 4px 16px; padding: 12px 20px 12px 52px; cursor: pointer; font-size: 14px;
  grid-template-columns: minmax(0, 1fr) 150px 104px 190px;
  border-bottom: 1px solid #f1eee9;
}
.task:hover, .task:focus-visible { background: #faf8f4; outline: none; }
.task__name { display: flex; flex-direction: column; min-width: 0; }
.task__name > span:first-child { font-weight: 500; }
.task__who { font-size: 12px; color: var(--muted); }
.task__dates { font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ms__add { display: block; width: 100%; text-align: left; background: none; border: 0; font: inherit; font-size: 13px; font-weight: 600; color: var(--maroon); padding: 12px 20px 14px 52px; cursor: pointer; }
.ms__add:hover { background: #fbf3f3; }

/* Timeline */
.tl { padding: 0; overflow: hidden; }
.tl__scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tl__inner { --label: 230px; min-width: max(100%, calc(var(--label) + var(--months) * 64px)); }
.tl__row { display: grid; grid-template-columns: var(--label) minmax(0, 1fr); align-items: center; min-height: 38px; }
.tl__row[role=button] { cursor: pointer; }
.tl__row[role=button]:hover .tl__label--task span, .tl__row[role=button]:focus-visible .tl__label--task span { color: var(--maroon); }
.tl__row:focus-visible { outline: 2px solid var(--maroon); outline-offset: -2px; }
.tl__label {
  position: sticky; left: 0; z-index: 2; background: #fff; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 14px 8px 20px; border-right: 1px solid var(--line); min-width: 0; height: 100%; font-size: 13px;
}
.tl__label > *:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl__label--task { padding-left: 34px; color: #3d4250; }
.tl__row--ms { border-top: 1px solid var(--line); background: #fcfbf8; }
.tl__row--ms .tl__label { background: #fcfbf8; }
.tl__row--head { position: sticky; top: 0; z-index: 3; border-bottom: 1px solid var(--line); min-height: 36px; background: #fff; }
.tl__track { position: relative; height: 100%; min-height: 38px; }
.tl__months span { position: absolute; top: 50%; transform: translateY(-50%); padding-left: 6px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.tl__body { position: relative; }
.tl__grid { position: absolute; top: 0; bottom: 0; left: var(--label); right: 0; pointer-events: none; z-index: 0; }
.tl__line { position: absolute; top: 0; bottom: 0; width: 1px; background: #f0ece6; }
.tl__line--year { background: #ddd6cb; }
.tl__today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--maroon); z-index: 1; }
.tl__today span { position: absolute; top: 4px; left: 5px; font-size: 10px; font-weight: 700; color: var(--maroon); text-transform: uppercase; letter-spacing: .06em; background: rgba(255,255,255,.9); padding: 0 3px; border-radius: 3px; }
.tl__bar { position: absolute; top: 50%; transform: translateY(-50%); height: 10px; background: #cdd3de; border-radius: 999px; overflow: hidden; z-index: 1; }
.tl__bar--ms { height: 14px; background: #b6bfcf; }
.tl__fill { display: block; height: 100%; background: var(--navy); }
.tl__bar--done .tl__fill { background: #2f8f5b; }
.tl__bar--late { background: #f3c3b8; }
.tl__bar--late .tl__fill { background: #c0392b; }
.tl__legend { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.tl__legend span { display: inline-flex; align-items: center; gap: 6px; }
.key { display: inline-block; width: 18px; height: 8px; border-radius: 999px; }
.key--fill { background: var(--navy); }
.key--late { background: #c0392b; }
.key--today { width: 2px; height: 12px; border-radius: 0; background: var(--maroon); }

/* Add-a-milestone input under the milestone dropdown */
.ms-pick { display: grid; gap: 8px; }
.ms-new[hidden] { display: none; }

/* ---------- drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 60; }
.drawer__backdrop { position: absolute; inset: 0; background: rgba(15,20,32,.45); opacity: 0; transition: opacity .2s; }
.drawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(640px, 100%); background: #fff; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .22s ease-out; box-shadow: -20px 0 40px -20px rgba(0,0,0,.3);
}
.drawer.is-open .drawer__backdrop { opacity: 1; }
.drawer.is-open .drawer__panel { transform: none; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--card-pad); border-bottom: 1px solid var(--line); }
.drawer__head h2 { margin: 0; font-size: 18px; line-height: 1.3; }
.drawer__x { background: none; border: 0; font-size: 30px; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; border-radius: 8px; transition: color .2s, background-color .2s; }
.drawer__body { padding: var(--space-5) var(--card-pad) var(--space-6); overflow-y: auto; flex: 1; }

/* ---------- entry form ---------- */
.entry-form { grid-template-columns: 1fr 1fr; gap: 16px 14px; }
.field { display: grid; gap: 6px; grid-column: 1 / -1; align-content: start; }
.field--half { grid-column: span 1; }
.entry-form .field__label { display: block; font-size: 13px; font-weight: 600; }
.req { color: var(--maroon); }
.req--cond { display: none; }
.field.is-required .req--cond { display: inline; }
.field__hint { margin: 0; font-size: 12px; color: var(--muted); }
.field__err { margin: 0; font-size: 12px; color: #c0392b; min-height: 0; }
.field__err:empty { display: none; }
.field.has-error input, .field.has-error select, .field.has-error textarea, .field.has-error .dropzone { border-color: #c0392b; background: #fff8f6; }
.computed { display: block; padding: 12px 14px; border-radius: 10px; background: var(--bg-alt); font-weight: 700; font-size: 15px; }
.form-foot { grid-column: 1 / -1; display: grid; gap: 10px; margin-top: 6px; padding-top: 16px; border-top: 1px solid var(--line); }
.form-foot__btns { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.form-error { margin: 0; font-size: 14px; color: #c0392b; }
.form-error:empty { display: none; }

.dropzone {
  display: grid; gap: 2px; justify-items: center; text-align: center; padding: 18px; border: 1.5px dashed #cfc9bf; border-radius: 12px;
  cursor: pointer; background: #fdfcfa; font-size: 13px; color: var(--muted); transition: border-color .15s, background .15s;
}
.dropzone strong { color: var(--maroon); font-size: 14px; }
.dropzone:hover, .dropzone.is-over { border-color: var(--maroon); background: #fbf3f3; }
input[type=file]:focus-visible + .dropzone { outline: 2px solid var(--maroon); outline-offset: 2px; }
.files { display: grid; gap: 10px; }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.thumbs:empty, .filelist:empty { display: none; }
.thumb { position: relative; margin: 0; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #eee; padding: 0; border: 0; cursor: pointer; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb__x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; }
.thumb__err { display: grid; place-items: center; height: 100%; font-size: 11px; color: var(--muted); }
a.link-btn[aria-disabled] { opacity: .5; pointer-events: none; }
.thumbs--view { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }

.filelist { display: grid; gap: 6px; }
.fileitem { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }
.fileitem__name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; font-weight: 600; color: var(--maroon); cursor: pointer; text-decoration: none; }
.link-btn:hover { text-decoration: underline; }

/* ---------- detail ---------- */
.detail { display: grid; gap: 18px; }
.detail > .badge-s { justify-self: start; }
.detail__list { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.detail__row { margin: 0; }
.detail__row--long { grid-column: 1 / -1; }
.detail__row dt { font-size: 12px; font-weight: 600; color: var(--muted); }
.detail__row dd { margin: 2px 0 0; font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail__h { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.detail__meta { margin: 0; padding-top: 12px; border-top: 1px solid var(--line); }

/* ---------- lightbox & toast ---------- */
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(10,12,18,.92); display: grid; place-items: center; padding: 24px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.lightbox .drawer__x { position: absolute; top: 12px; right: 16px; color: #fff; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 90; transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 14px; transition: opacity .25s, transform .25s; max-width: calc(100% - 32px); }
.toast.is-in { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .app__body { grid-template-columns: minmax(0, 1fr); }
  .app__nav {
    position: sticky; top: 0; z-index: 20; display: flex; overflow-x: auto; gap: 4px; padding: 10px 16px;
    background: var(--bg-alt); border-bottom: 1px solid var(--line); scrollbar-width: none;
  }
  .app__nav::-webkit-scrollbar { display: none; }
  .app__nav a { white-space: nowrap; flex: none; padding: 8px 12px; }
  .app__main { padding: var(--space-5) var(--gutter) var(--space-8); }
  .app__bar { position: static; }
  .stats-row--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ms__head { grid-template-columns: 16px minmax(0, 1fr) 104px 150px; }
  .task { grid-template-columns: minmax(0, 1fr) 130px 104px 150px; }
}
@media (max-width: 760px) {
  /* milestone header: title + status on top, progress underneath */
  .ms__head { grid-template-columns: 16px minmax(0, 1fr) auto; padding: 14px 16px; }
  .ms__prog { grid-column: 2 / -1; }
  /* task: name on top; dates, status and progress underneath */
  .task { grid-template-columns: auto auto minmax(0, 1fr); padding: 12px 16px 12px 48px; gap: 6px 12px; }
  .task__name { grid-column: 1 / -1; }
  .ms__add { padding-left: 48px; }
  .tl__inner { --label: 150px; }
  .tl__label .pct { display: none; }
  .tl__label { padding-left: 14px; }
  .tl__label--task { padding-left: 22px; }
}
@media (max-width: 700px) {
  .app__bar { gap: var(--space-2) var(--space-3); }
  .app__name { order: 3; width: 100%; font-size: 11px; }
  .app__bar-right { margin-left: auto; gap: 8px; }
  .app__user { display: none; }
  .stats-row { grid-template-columns: 1fr; }
  .stat__value { font-size: 26px; }
  .stats-row--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-row--4 .stat { padding: 12px 14px; }
  .stats-row--4 .stat__value { font-size: 22px; }
  .toolbar { flex-wrap: wrap; }
  .toolbar .search { flex: 1 1 100%; width: 100%; }
  .toolbar__right { width: 100%; justify-content: space-between; }
  .page-actions { width: 100%; }
  .page-actions .btn--primary { flex: 1; }
  .entry-form { grid-template-columns: 1fr; }
  .field--half { grid-column: 1 / -1; }
  .detail__list { grid-template-columns: 1fr; }
  .drawer__body, .drawer__head { padding-left: var(--gutter); padding-right: var(--gutter); }
  .activity li { grid-template-columns: 1fr auto; }
  .activity__tag { display: none; }

  /* table rows become cards */
  .table-wrap { background: none; box-shadow: none; overflow: visible; }
  table.records thead { display: none; }
  table.records, .records tbody, .records tr, .records td { display: block; width: 100%; }
  .records tr { background: #fff; border-radius: 12px; margin-bottom: 10px; padding: 8px 14px; box-shadow: 0 1px 0 var(--line); }
  .records td { border: 0; padding: 5px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .records td::before { content: attr(data-label); font-size: 12px; color: var(--muted); font-weight: 600; text-align: left; flex: none; }
  .records td.wide, .records td.clamp { min-width: 0; max-width: none; white-space: normal; }
  .records td.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-align: left; }
  .records td.clamp::before { display: block; }
  .r { text-align: right; }
}

.app__nav a[hidden] { display: none !important; }

/* ---------- hover polish (mouse/trackpad only) ---------- */
.ov-card, .thumb img, .app__nav a, .dropzone, .records tbody tr, .ledger tbody tr, .task, .ms__head, .chip, .unit { transition-timing-function: var(--ease); }
.ov-card { padding: var(--space-5); }
.thumb img { transition: transform .4s var(--ease); }
.app__nav a { transition: background-color .2s, color .2s; }
@media (hover: hover) {
  .app__brand:hover { opacity: .75; }
  .app__nav a:not(.is-active):hover { color: var(--maroon); }
  .seg button:not(.is-on):hover { color: var(--ink); background: rgba(255,255,255,.6); }
  .drawer__x:hover { color: var(--ink); background: rgba(0,0,0,.05); }
  .lightbox .drawer__x:hover { color: #fff; background: rgba(255,255,255,.12); }
  .thumb:hover img { transform: scale(1.06); }
  .ov-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
  .search:hover:not(:focus) { border-color: #c9c3b9; }
}
.search { transition: border-color .2s; }
.search:focus { outline: 2px solid var(--maroon); outline-offset: 1px; border-color: transparent; }

/* ---------- staff sign-in page (staff.html) ---------- */
.staff-main { display: grid; place-items: start center; padding: var(--space-8) var(--gutter); min-height: calc(100vh - 60px); }
.staff-card { width: 100%; max-width: 460px; }
.staff-title { font-family: var(--display); font-weight: 400; font-size: 44px; line-height: 1; letter-spacing: .02em; text-transform: uppercase; margin: 0 0 var(--space-2); }
.staff-field { display: grid; gap: var(--space-2); }
.staff-field__label { font-size: 13px; font-weight: 600; }
.staff-tabs { display: flex; width: 100%; }
.staff-tabs button { flex: 1; min-height: 40px; }
.staff-portal { border-top: 1px solid var(--line); padding-top: var(--space-4); margin-top: var(--space-4); }
.staff-portal__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.staff-portal__head h2 { margin: 0; font-size: 16px; }
.staff-portal .portal__links { margin: var(--space-3) 0 0; }
.staff-signout { margin-top: var(--space-5); }
.staff-card > .link-btn { margin-top: var(--space-4); }
.staff-card label[hidden] { display: none; }
@media (max-width: 480px) {
  .staff-main { padding: var(--space-6) var(--space-3); }
  .staff-tabs button { padding: 6px 8px; font-size: 12px; }
}

/* ---------- in-page confirm box (js/dialog.js) ---------- */
.ask { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: var(--space-4); background: rgba(15,20,32,.45); }
.ask__box { width: min(420px, 100%); background: #fff; border-radius: var(--radius); padding: var(--card-pad); box-shadow: 0 24px 48px -20px rgba(0,0,0,.45); display: grid; gap: var(--space-5); }
.ask__msg { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink); }
.ask__btns { display: flex; justify-content: flex-end; gap: var(--space-3); flex-wrap: wrap; }
.btn--danger { background: #b4321f; color: #fff; }
@media (hover: hover) { .btn--danger:hover { background: #932716; } }
