
:root{--bg:#f6f7f9;--card:#fff;--text:#111827;--muted:#667085;--line:#e5e7eb;--yellow:#e5c400;--dark:#111827;--ok:#15803d;--near:#a16207;--urgent:#c2410c;--due:#b91c1c;--info:#1d4ed8}
*{box-sizing:border-box}body{margin:0;font-family:Segoe UI,Arial,sans-serif;background:var(--bg);color:var(--text)}button,input,select,textarea{font:inherit}
header{position:sticky;top:0;z-index:30;background:var(--dark);color:#fff;border-bottom:4px solid var(--yellow)}.top{max-width:1100px;margin:auto;padding:12px 16px;display:flex;justify-content:space-between;align-items:center;gap:10px}
.brand{font-weight:800}.sync{font-size:12px;padding:6px 9px;background:#263244;border-radius:999px}main{max-width:1100px;margin:auto;padding:14px 14px 90px}
.view{display:none}.view.active{display:block}h1{font-size:24px;margin:3px 0 5px}h2{font-size:18px;margin:0 0 10px}.help,.small,.label{color:var(--muted)}
.card{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:15px}.grid{display:grid;gap:12px}.cards{grid-template-columns:repeat(4,1fr)}.metric{font-size:30px;font-weight:800}
.actions{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin-top:14px}.big{padding:18px;border:1px solid var(--line);border-radius:16px;background:white;text-align:left;font-weight:800}.big span{display:block;font-size:13px;font-weight:400;color:var(--muted);margin-top:4px}
label{display:block;font-size:13px;font-weight:700;margin:11px 0 6px}input,select,textarea{width:100%;padding:12px;border:1px solid #cfd4dc;border-radius:12px;background:white}input:focus,select:focus,textarea:focus{outline:3px solid #fff0a6;border-color:#b79c00}
.row{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}.split{display:grid;grid-template-columns:1.1fr .9fr;gap:12px}
.primary,.secondary,.danger{border:0;border-radius:12px;padding:12px 15px;font-weight:800;cursor:pointer}.primary{background:var(--yellow)}.secondary{background:#eef0f3}.danger{background:#fee2e2;color:#991b1b}
.item{background:white;border:1px solid var(--line);border-radius:14px;padding:12px;display:grid;grid-template-columns:1fr auto;gap:10px;align-items:center}.list{display:grid;gap:9px}.item-title{font-weight:800}.item-sub{font-size:13px;color:var(--muted);margin-top:3px}
.badge{padding:6px 9px;border-radius:999px;font-size:12px;font-weight:800;white-space:nowrap}.ok{background:#dcfce7;color:#166534}.near{background:#fef3c7;color:#92400e}.urgent{background:#ffedd5;color:#9a3412}.due{background:#fee2e2;color:#991b1b}.info{background:#dbeafe;color:#1e40af}
.toolbar{display:flex;gap:7px;flex-wrap:wrap;margin:12px 0}.pill{border:1px solid var(--line);border-radius:999px;background:white;padding:8px 11px}.pill.active{background:#111827;color:white}
.result{background:#f9fafb;border:1px solid var(--line);border-radius:14px;padding:14px;margin-top:12px}.result strong{font-size:21px}.empty{padding:22px;text-align:center;color:var(--muted);background:white;border:1px dashed #cbd5e1;border-radius:14px}
.notice{padding:10px 12px;border-radius:12px;background:#fff7d6;border:1px solid #f2d266;font-size:13px;margin-top:10px}
.autocomplete{position:relative}
.suggestions{position:absolute;left:0;right:0;top:100%;z-index:80;background:#fff;border:1px solid #cfd4dc;border-radius:12px;margin-top:4px;max-height:260px;overflow:auto;box-shadow:0 10px 30px rgba(0,0,0,.12)}
.suggestion{padding:10px 12px;border-bottom:1px solid #eef0f3;cursor:pointer}
.suggestion:last-child{border-bottom:0}
.suggestion:hover{background:#fff8bf}
.suggestion-title{font-weight:800}
.suggestion-sub{font-size:12px;color:#667085;margin-top:2px}
.toast{position:fixed;left:50%;bottom:82px;transform:translateX(-50%) translateY(20px);z-index:120;min-width:min(420px,calc(100vw - 28px));max-width:560px;background:#111827;color:white;border-radius:14px;padding:14px 16px;box-shadow:0 14px 40px rgba(0,0,0,.24);opacity:0;pointer-events:none;transition:.22s}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
.toast.success{border-left:6px solid #22c55e}
.toast.offline{border-left:6px solid #e5c400}
.pending{background:#fff7d6;color:#7c5b00}
.dangerbox{padding:10px 12px;border-radius:12px;background:#fee2e2;border:1px solid #fecaca;font-size:13px;margin-top:10px}
.nav{position:fixed;bottom:0;left:0;right:0;z-index:40;display:grid;grid-template-columns:repeat(4,1fr);background:white;border-top:1px solid var(--line)}.nav{padding-bottom:env(safe-area-inset-bottom)}.nav button{min-height:58px;padding:6px 4px;line-height:1.2;border:0;background:white;font-size:12px;color:#475467}.nav button.active{background:#fff8bf;color:#111827;font-weight:800}
.loginwrap{max-width:430px;margin:55px auto}.hidden{display:none!important}
@media(max-width:780px){.cards{grid-template-columns:repeat(2,1fr)}.actions,.row,.split{grid-template-columns:1fr}main{padding:12px 12px 85px}}

.info-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;width:19px;height:19px;margin-left:5px;border:1px solid #98a2b3;border-radius:50%;background:#fff;color:#475467;font-size:12px;font-weight:800;cursor:help;vertical-align:middle;padding:0}
.info-btn:hover,.info-btn:focus{outline:none;border-color:#111827;color:#111827}
.info-btn::after{content:attr(data-tip);position:absolute;left:50%;bottom:calc(100% + 8px);transform:translateX(-50%);width:max-content;max-width:min(280px,80vw);padding:9px 10px;background:#111827;color:#fff;border-radius:9px;font-size:12px;font-weight:400;line-height:1.35;box-shadow:0 8px 24px rgba(0,0,0,.2);opacity:0;pointer-events:none;transition:.15s;z-index:150;text-align:left}
.info-btn:hover::after,.info-btn:focus::after{opacity:1}
.hist-actions{display:flex;gap:6px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.mini-btn{border:1px solid var(--line);background:#fff;border-radius:9px;padding:7px 9px;font-size:12px;font-weight:700;cursor:pointer}
.mini-btn.warn{background:#fff7d6;border-color:#f2d266;color:#7c5b00}
.mini-btn.danger{background:#fee2e2;border-color:#fecaca;color:#991b1b}
.incorrect{background:#f2f4f7;color:#475467;text-decoration:none}


.control-cta{display:flex;align-items:center;gap:14px;width:100%;margin:16px 0;padding:20px;border:0;border-radius:16px;background:var(--yellow);color:var(--dark);font-weight:800;font-size:22px;text-align:left;cursor:pointer;box-shadow:0 3px 0 #baa000}
.control-cta>span:nth-child(2){flex:1}.control-cta small{display:block;font-size:14px;font-weight:400;line-height:1.4;margin-top:5px}.cta-icon{font-size:32px}.control-cta:hover{background:#f2d318}.control-cta:focus-visible{outline:3px solid var(--dark);outline-offset:3px}
.nav button[data-view="control"]{background:#fff7bf;color:#111827;font-weight:800}.nav button[data-view="control"].active{background:var(--yellow)}

.admin-access{border:1px solid #596273;border-radius:9px;background:transparent;color:white;padding:7px 10px;white-space:nowrap;font-size:12px;cursor:pointer}.top .sync{margin-left:auto}
#adminDialog,#confirmDialog{width:min(460px,calc(100vw - 28px));max-height:calc(100dvh - 32px);overflow:auto;border:1px solid var(--line);border-radius:16px;padding:20px;color:var(--text)}
#adminDialog::backdrop,#confirmDialog::backdrop{background:rgba(17,24,39,.5)}#confirmDialog h2{margin-top:0}.confirm-list{margin:0 0 10px;padding-left:20px;display:grid;gap:8px}.confirm-list.single{list-style:none;padding-left:0}.confirm-actions{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap}
.label-like{display:block;font-size:13px;font-weight:700;margin:11px 0 6px}.filter-chips{margin:0}.pill[aria-pressed="true"]{background:#111827;color:white}
.reject-note{flex-basis:100%;text-align:right;font-size:12px;color:#991b1b;font-weight:600}
.item-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}.stale-note{color:#b45309;font-weight:700}.admin-dialog-top{display:flex;align-items:center;gap:12px;justify-content:space-between}.admin-dialog-top h2{margin:0}.admin-dialog-top button{flex-shrink:0}
@media(max-width:480px){.top{flex-wrap:wrap;gap:8px}.top .sync{order:3;width:100%;font-size:11px}.admin-access{margin-left:auto}}

.metric-card{display:block;width:100%;text-align:left;cursor:pointer;font:inherit;color:inherit}.metric-card:hover{border-color:#b79c00}.metric-card:focus-visible{outline:3px solid var(--yellow)}
.cards{grid-template-columns:repeat(5,1fr)}
.form-card{max-width:760px}.preview-inline{margin-top:10px}
.subcard{margin-top:16px;padding-top:12px;border-top:1px solid var(--line)}
.service-box{margin-top:16px;padding:14px;border:2px dashed #e5c400;border-radius:14px;background:#fffdf0}.service-title{font-size:16px;font-weight:800;margin-bottom:4px}
.req{color:var(--due);font-weight:800}
.save-btn{width:100%;margin-top:16px;padding:16px;font-size:18px}
button.sync{border:0;color:#fff;cursor:pointer;font-family:inherit}
.sync[data-state=ok]{background:#166534}.sync[data-state=pend]{background:#92400e}.sync[data-state=off]{background:#475467}.sync[data-state=err]{background:#b91c1c}
@media(max-width:780px){.cards{grid-template-columns:repeat(2,1fr)}.cards .metric-card:first-child{grid-column:1/-1}}

/* Interactive affordance: pointer everywhere a tap does something; hover colors only with a mouse. */
button,select,summary,label:has(input[type=file]),input[type=file],input[type=date],input[type=month],[data-view],[data-goto-status]{cursor:pointer}
.info-btn{cursor:help}
button:disabled{cursor:not-allowed;opacity:.6}
.nav button,.big,.pill,.primary,.secondary,.danger,.mini-btn,.admin-access,button.sync{transition:background-color .15s,border-color .15s,color .15s,filter .15s}
@media(hover:hover){
.nav button:hover{background:#f2f4f7;color:#111827}
.nav button.active:hover{background:#fff1a8}
.nav button[data-view="control"]:hover{background:#ffec80}
.big:hover{border-color:#b79c00;background:#fffdf0}
.pill:hover{border-color:#667085;background:#f9fafb}.pill.active:hover{background:#1f2937;color:#fff}
.primary:hover{background:#f2d318}.secondary:hover{background:#e2e5ea}.danger:hover{background:#fecaca}
.mini-btn:hover{border-color:#98a2b3;filter:brightness(.97)}
.admin-access:hover{border-color:#fff;background:rgba(255,255,255,.08)}
button.sync:hover{filter:brightness(1.2)}
summary:hover{color:#111827;text-decoration:underline}
}
