/* Preventive maintenance pages (app/pm.py). Uses the theme colours of style.css, so it follows Light / Dark / Futuristic. */
.pm-more { display: inline-block; vertical-align: top; }
.pm-more > summary { list-style: none; cursor: pointer; display: inline-block; }
.pm-more > summary::after { content: none; }
/* the edit panel of a person opens as a panel at the top right of the window, so the table around it can never clip it */
.pm-more[open] > .pm-more-body { position: fixed; z-index: 60; right: 16px; top: 84px; width: min(380px, calc(100vw - 32px)); max-height: calc(100vh - 100px); overflow-y: auto;
  padding: 16px; display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-inner); box-shadow: var(--shadow-lift);
  text-align: left; white-space: normal; text-transform: none; letter-spacing: 0; }
.pm-more-body .form { gap: 10px; }

.pm-month { margin: 6px 0 10px; }
.pm-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-bottom: 20px; }
.pm-dow { font-size: .62rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); text-align: center; padding: 4px 0; }
.pm-day { min-height: 96px; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 10px; padding: 4px 5px 6px; display: grid; gap: 3px; align-content: start; min-width: 0; }
html.dark .pm-day { border-color: var(--border); }
.pm-day.is-other { opacity: .5; }
.pm-day.is-today { border-color: var(--btn); box-shadow: inset 0 0 0 1px var(--btn); }
.pm-day.is-picked { background: var(--hover); border-color: var(--link); }
.pm-num { font-size: .75rem; font-weight: 800; color: var(--muted); text-decoration: none; justify-self: start; }
.pm-chip { display: block; font-size: .68rem; font-weight: 700; line-height: 1.25; border-radius: 6px; padding: 3px 5px; overflow: hidden; text-decoration: none; border-left: 3px solid; overflow-wrap: anywhere; }
.pm-chip:hover { text-decoration: none; filter: brightness(.96); }
.pm-chip small { float: right; margin-left: 4px; font-weight: 800; opacity: .8; }
.pm-time { font-weight: 800; opacity: .85; }
.pm-ok { background: #dcfce7; color: #166534; border-color: #16a34a; }
.pm-part { background: #fef3c7; color: #92400e; border-color: #f59e0b; }
.pm-bad { background: #fee2e2; color: #991b1b; border-color: #dc2626; }
.pm-none { background: #e2e8f0; color: #475569; border-color: #94a3b8; }
html.dark .pm-ok { background: rgba(34, 197, 94, .18); color: #86efac; }
html.dark .pm-part { background: rgba(245, 158, 11, .2); color: #fcd34d; }
html.dark .pm-bad { background: rgba(248, 113, 113, .2); color: #fca5a5; }
html.dark .pm-none { background: rgba(148, 163, 184, .18); color: #cbd5e1; }
.card > .flash.plain, .card > .notice { margin-bottom: 16px; }

/* maintenance day: progress bar, and the checklist of form TUPC-F-OCD-OIT-014 */
.pm-bar { height: 10px; border-radius: 999px; background: var(--border-soft); overflow: hidden; margin: -6px 0 18px; }
html.dark .pm-bar { background: var(--border); }
.pm-bar span { display: block; height: 100%; background: linear-gradient(90deg, #16a34a, #22c55e); border-radius: 999px; transition: width .3s; }
.pm-group { margin-top: 18px; }
.pm-group-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 1px solid var(--border-soft); margin-bottom: 4px; }
html.dark .pm-group-head { border-bottom-color: var(--border); }
.pm-group-head h3 { margin: 0 0 4px; font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--maroon); }
html.dark .pm-group-head h3 { color: #fbbf24; }
.pm-item { display: grid; grid-template-columns: minmax(150px, 1.2fr) auto minmax(150px, 1.6fr); gap: 10px 14px; align-items: center; padding: 9px 10px; border-radius: 10px; border-left: 3px solid transparent; }
.pm-item:nth-child(even) { background: var(--surface-2); }
.pm-item.is-bad { border-left-color: #dc2626; background: rgba(220, 38, 38, .07); }
.pm-item.needs-remark .pm-remark { border-color: #dc2626; box-shadow: 0 0 0 1px #dc2626; }
.pm-label { font-weight: 700; color: var(--heading); font-size: .9rem; }
.pm-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.pm-opt { position: relative; cursor: pointer; }
.pm-opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.pm-opt span { display: block; padding: 8px 14px; font-size: .74rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: var(--surface); border-right: 1px solid var(--border); min-width: 58px; text-align: center; }
.pm-opt:last-child span { border-right: 0; }
.pm-opt input:focus-visible + span { outline: 2px solid var(--btn); outline-offset: -2px; }
.pm-opt input:checked + span { color: #fff; }
.pm-o-ok input:checked + span { background: #16a34a; }
.pm-o-bad input:checked + span { background: #dc2626; }
.pm-o-na input:checked + span { background: #64748b; }
.pm-opt input:disabled + span { cursor: not-allowed; opacity: .75; }
.pm-remark { min-width: 0; }
.pm-tag { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .68rem; font-weight: 800; color: #fff; }
.pm-t-ok { background: #16a34a; } .pm-t-bad { background: #dc2626; } .pm-t-na { background: #64748b; }
.pm-times { line-height: 1.8; }
.pm-reopen { margin-top: 14px; }
@media (max-width: 760px) { .pm-item { grid-template-columns: 1fr; } .pm-seg { justify-self: start; } .pm-opt span { padding: 10px 16px; } }
.pm-people { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
@media (max-width: 760px) {
  .pm-cal { gap: 2px; }
  .pm-day { min-height: 64px; padding: 3px; }
  .pm-chip { font-size: .6rem; }
  .pm-chip .pm-time { display: none; }
}

/* The preview of the maintenance form (a PDF shown in the page) */
.form-frame { display: block; width: 100%; height: 80vh; min-height: 540px; border: 0; border-radius: var(--radius, 12px); background: #f1f3f6; }

/* The signature pad: a white "paper" in every theme, because the signature is printed in black on the form */
.sign-layout { display: grid; gap: 1rem; max-width: 880px; }
.sign-pad { margin: .75rem 0 .25rem; }
.sign-label { margin: 0 0 .35rem; font-weight: 600; }
.sign-box { position: relative; background: #fff; border: 2px dashed var(--border); border-radius: var(--radius-inner, 10px); height: clamp(180px, 34vh, 300px); touch-action: none; overflow: hidden; }
.sign-box::after { content: ""; position: absolute; left: 6%; right: 6%; bottom: 22%; border-top: 1.5px solid #9aa4b2; pointer-events: none; }
.sign-box canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; -webkit-user-select: none; user-select: none; }
.sign-x { position: absolute; left: 3%; bottom: 22%; transform: translateY(45%); color: #9aa4b2; font-size: 1.6rem; pointer-events: none; }
.sign-pad.has-ink .sign-box { border-style: solid; border-color: var(--maroon, #800000); }
.sign-tools { display: flex; gap: .5rem; align-items: center; margin-top: .5rem; flex-wrap: wrap; }
.btn-lg { padding: .85rem 1.6rem; font-size: 1.05rem; }
.sign-image { display: block; max-width: 280px; max-height: 110px; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 6px; margin: .5rem 0; }

/* the optional signature on the owner's own page is smaller than the tablet pad */
.sign-pad[data-required="0"] .sign-box { height: clamp(130px, 22vh, 180px); }
