/* PSG Workspace: Power and Solar Group branding, laid out like LeverAid Workspace.
   A charcoal menu on the left (bottom bar on phones), a charcoal header band behind each page title,
   rounded white tiles that overlap the band, pill buttons, flat pill tags, online rings. Arial everywhere. */

:root {
  --ink: #2E2D29;            /* logo charcoal */
  --ink-2: #4A4842;
  --muted: #77736A;
  --faint: #A9A399;
  --bg: #F1F0ED;
  --card: #FFFFFF;
  --line: #EAE5DE;
  --line-2: #DCD5CB;
  --side: #262521;
  --band: #2E2D29;
  --orange: #F4872A;         /* logo orange */
  --orange-ink: #B4570A;     /* orange that reads as text on white */
  --peach: #F8A867;
  --cream: #FAD7BA;
  --accent-soft: #FDE7D2;
  --tint: #FEF5EC;
  --green: #23935E; --green-bg: #E3F4EA;
  --blue: #2F6FCB;  --blue-bg: #E5EEFB;
  --red: #C83B2E;   --red-bg: #FBE6E3;
  --violet: #7A4FD6; --violet-bg: #EFE8FC;
  --amber: #B5651D; --amber-bg: #FDEBD8;
  --grey-bg: #F1EDE7;
  --ring-on: #2FBF71;
  --r: 20px;
  --shadow: 0 1px 0 rgba(46, 45, 41, .05), 0 10px 28px rgba(46, 45, 41, .07);
  --shadow-lg: 0 24px 60px rgba(46, 45, 41, .22);
  --side-w: 244px;
  --top-h: 56px;
  --demo-h: 0px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
body.demo { --demo-h: 38px; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 15px/1.5 Arial, Helvetica, sans-serif; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
body.modal-open { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.2px; line-height: 1.2; }
p { margin: 0; }
a { color: var(--orange-ink); }
b, strong { font-weight: 700; }
img { max-width: 100%; }
svg { flex: none; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid rgba(244, 135, 42, .55); outline-offset: 2px; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* ================= opening and sign-in ================= */
.gate { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 24px 16px calc(24px + var(--safe-b)); background: var(--bg); overflow-y: auto; transition: opacity .3s; }
.gate.leaving { opacity: 0; }
.intro { position: relative; width: 300px; height: 213px; flex: none; transition: transform .6s cubic-bezier(.2, .8, .2, 1); animation: introSlide .7s 1.35s cubic-bezier(.2, .8, .2, 1) both; }
.gate.with-card .intro { transform: scale(.78); margin: -12px 0 -24px; }
@keyframes introSlide { from { transform: translate(86px, 42px); } }
.intro .itile { position: absolute; width: 20.48%; height: 28.73%; clip-path: polygon(10.7% 0, 89.3% 0, 100% 10.7%, 100% 89.3%, 89.3% 100%, 10.7% 100%, 0 89.3%, 0 10.7%); }
.intro .t1 { left: 0; top: 0; background: var(--peach); animation: tilePop .5s .95s cubic-bezier(.3, 1.6, .5, 1) both; }
.intro .t2 { left: 22.35%; top: 0; background: var(--orange); animation: tilePop .5s 1.07s cubic-bezier(.3, 1.6, .5, 1) both; }
.intro .t3 { left: 0; top: 31.36%; background: var(--cream); animation: tilePop .5s 1.19s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes tilePop { from { transform: scale(0) rotate(-20deg); opacity: 0; } }
.intro .word { position: absolute; left: 25.32%; top: 35.18%; width: 74.94%; height: auto; animation: wordIn .75s 1.5s cubic-bezier(.4, 0, .2, 1) both; }
@keyframes wordIn { from { clip-path: inset(0 100% 0 0); opacity: .3; } to { clip-path: inset(0 0 0 0); opacity: 1; } }
.intro .orbit { position: absolute; left: 64px; top: 64px; width: 0; height: 0; animation: spin 1s linear both; }
@keyframes spin { from { transform: rotate(-80deg); } to { transform: rotate(40deg); } }
.intro .oi { position: absolute; left: -21px; top: -21px; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); background: #fff; box-shadow: 0 6px 18px rgba(46, 45, 41, .14); opacity: 0;
  transform: rotate(var(--a)) translateY(-112px) rotate(calc(-1 * var(--a))); animation: orbitIn 1.1s cubic-bezier(.5, 0, .3, 1) both; }
.intro .oi:nth-child(2) { animation-delay: .05s; } .intro .oi:nth-child(3) { animation-delay: .1s; } .intro .oi:nth-child(4) { animation-delay: .15s; } .intro .oi:nth-child(5) { animation-delay: .2s; }
@keyframes orbitIn {
  0% { opacity: 0; transform: rotate(var(--a)) translateY(-150px) rotate(calc(-1 * var(--a))) scale(.6); }
  25% { opacity: 1; transform: rotate(var(--a)) translateY(-112px) rotate(calc(-1 * var(--a))) scale(1); }
  70% { opacity: 1; transform: rotate(var(--a)) translateY(-104px) rotate(calc(-1 * var(--a))) scale(1); }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(0) rotate(calc(-1 * var(--a))) scale(.2); }
}
.intro .ring { position: absolute; left: 64px; top: 64px; width: 150px; height: 150px; margin: -75px 0 0 -75px; border-radius: 50%; border: 2px solid var(--orange); opacity: 0; animation: ring .8s 1.2s ease-out forwards; }
@keyframes ring { from { opacity: .7; transform: scale(.4); } to { opacity: 0; transform: scale(1.5); } }
.quick .intro, .quick .intro * { animation: none !important; }
.gate-card { width: min(420px, 100%); background: var(--card); border-radius: 24px; box-shadow: var(--shadow); padding: 30px 26px; text-align: center; opacity: 0; transform: translateY(18px); transition: opacity .45s .1s, transform .55s .1s cubic-bezier(.2, .8, .2, 1); }
.gate.with-card .gate-card { opacity: 1; transform: none; }
.gate-card h1 { font-size: 23px; margin-bottom: 8px; }
.gate-card > p { color: var(--muted); margin-bottom: 22px; }
.gate-wait { display: none; }
.gate-note { font-size: 13px; color: var(--muted); margin: 16px 0 0 !important; }
.gate-err { background: var(--red-bg); color: #8E2A20; border-radius: 12px; padding: 10px 14px; font-size: 14px; margin: -8px 0 16px !important; text-align: left; }
.gate-foot { font-size: 13px; color: var(--faint); opacity: 0; transition: opacity .4s .3s; }
.gate.with-card .gate-foot { opacity: 1; }
.gbtn { width: 100%; background: #fff; border: 1.5px solid var(--line-2); padding: 13px 18px; }
.gbtn:hover { border-color: var(--ink); }
.picks { display: grid; gap: 8px; text-align: left; margin-bottom: 14px; }
.pick { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 16px; background: #fff; text-align: left; }
.pick:hover { border-color: var(--orange); background: var(--tint); }
.pick > span:not(.av) { flex: 1; display: flex; flex-direction: column; } .pick small { color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .intro, .intro * { animation: none !important; } }

/* ================= shell: left menu (computer), top bar and bottom bar (phone) ================= */
#side { display: none; }
#top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 4px; height: calc(var(--top-h) + var(--safe-t)); padding: var(--safe-t) 8px 0 6px; background: var(--band); color: #fff; }
.hist-b { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: #fff; display: inline-grid; place-items: center; flex: none; padding: 0; }
.hist-b:hover { background: rgba(255, 255, 255, .1); }
.hist-b svg { width: 20px; height: 20px; }
.hb-back { order: 1; } .hb-fwd { order: 2; } #mtitle { order: 3; } .hb-reload { order: 4; } .top-r { order: 5; }
#mtitle { flex: 1; min-width: 0; margin: 0 0 0 4px; font-size: 16px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-r { display: flex; align-items: center; gap: 6px; }
.me-btn { border: 0; background: none; padding: 0; border-radius: 50%; display: flex; }
.me-btn .av { --bgc: var(--band); box-shadow: 0 0 0 2px rgba(255, 255, 255, .2); }
#main { min-height: calc(100vh - var(--top-h)); padding-bottom: calc(92px + var(--safe-b)); outline: none; }
#bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); background: #fff; border-top: 1px solid var(--line); padding: 4px 4px calc(4px + var(--safe-b)); }
.bl { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 700; }
.bl svg { width: 22px; height: 22px; }
.bl.on { color: var(--ink); }
.bl.on svg { background: var(--accent-soft); color: var(--orange-ink); border-radius: 999px; padding: 3px 14px; box-sizing: content-box; margin: -3px 0; }
.badge { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--orange); color: var(--ink); font-size: 11px; font-weight: 700; line-height: 1; }
.bl .badge { position: absolute; top: 0; left: calc(50% + 8px); box-shadow: 0 0 0 2px #fff; }
.demo-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; height: 38px; padding: 0 16px; background: #FCEFC2; color: #5A4708; font-size: 13px; overflow: hidden; }
.demo-bar button { border: 0; background: none; padding: 0; color: #5A4708; font-weight: 700; font-size: 13px; text-decoration: underline; }
@media (max-width: 899px) { .demo-bar span { display: none; } }

@media (min-width: 900px) {
  :root { --top-h: 60px; }
  #shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
  #side { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; background: var(--side); color: #fff; padding: 20px 14px 14px; z-index: 31; }
  #side .brand { display: block; padding: 4px 8px 22px; }
  #side .brand img { width: 100%; max-width: 196px; height: auto; display: block; }
  #nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; scrollbar-width: none; }
  #nav::-webkit-scrollbar { display: none; }
  .nl { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: rgba(255, 255, 255, .82); text-decoration: none; font-size: 14.5px; }
  .nl svg { width: 20px; height: 20px; color: rgba(255, 255, 255, .6); }
  .nl span { flex: 1; }
  .nl:hover { background: rgba(255, 255, 255, .07); color: #fff; }
  .nl.on { background: #fff; color: var(--ink); font-weight: 700; }
  .nl.on svg { color: var(--orange); }
  .side-foot { display: flex; align-items: center; gap: 4px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .1); }
  .side-me { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: none; color: #fff; text-align: left; padding: 6px; border-radius: 12px; }
  .side-me:hover { background: rgba(255, 255, 255, .07); }
  .side-me .av { --bgc: var(--side); }
  .side-me span { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
  .side-me b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-me small { font-size: 11.5px; color: rgba(255, 255, 255, .62); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #top { padding: 0 24px 0 16px; gap: 2px; }
  .hb-back, .hb-fwd, .hb-reload, #mtitle, .top-r { order: 0; }
  #mtitle { margin-left: 12px; font-size: 15px; color: rgba(255, 255, 255, .72); font-weight: 400; }
  .me-btn { display: none; }
  #bottom { display: none; }
  #main { padding-bottom: 48px; min-height: calc(100vh - var(--top-h)); }
  .demo-bar { padding: 0 32px; }
}

/* ================= page structure ================= */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 900px) { .wrap { padding: 0 32px; } }
.band { background: var(--band); color: #fff; padding: 18px 0 76px; }
.band-in { display: flex; align-items: flex-end; gap: 14px 24px; flex-wrap: wrap; }
.band-t { flex: 1 1 280px; min-width: 0; }
.band h1 { font-size: 26px; letter-spacing: -.5px; line-height: 1.12; }
.band p { color: rgba(255, 255, 255, .62); font-size: 14px; margin-top: 6px; }
.band-act { display: flex; gap: 10px 18px; flex-wrap: wrap; align-items: center; }
.band .btn:not(.ghost) { background: #fff; color: var(--ink); border-color: #fff; }
.band .btn:not(.ghost):hover { background: #F4F2EE; }
.band .btn.ghost { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .22); }
.band .btn.ghost:hover { background: rgba(255, 255, 255, .18); }
.band-sub { margin-top: 18px; }
@media (min-width: 900px) { .band { padding: 28px 0 84px; } .band h1 { font-size: 32px; letter-spacing: -.6px; } }
.body { position: relative; margin-top: -54px; display: flex; flex-direction: column; gap: 18px; }
@media (min-width: 900px) { .body { margin-top: -58px; } }
.cols { display: grid; gap: 18px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
@media (min-width: 1000px) { .cols { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); } .cols.even { grid-template-columns: 1fr 1fr; } }

/* tiles */
.tile { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; }
.tile-h { display: flex; align-items: center; gap: 10px; padding: 14px 20px; min-height: 56px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tile-h:last-child { border-bottom: 0; }
.tile-h h2 { flex: 1; min-width: 0; font-size: 16.5px; }
.tile-h h2 small { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.tile-h .more { font-size: 13.5px; font-weight: 700; text-decoration: underline; white-space: nowrap; }
.tile-b { padding: 16px 20px 20px; }
.tile.accent { box-shadow: var(--shadow), inset 4px 0 0 var(--orange); }
.grp-h { padding: 12px 20px 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-top: 1px solid var(--line); }
.grp-h:first-child { border-top: 0; }
.pad { padding-top: 24px; }

/* numbers */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 700px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }
.kpi { display: flex; flex-direction: column; padding: 16px 18px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); text-decoration: none; color: inherit; border: 0; text-align: left; min-width: 0; }
a.kpi:hover { box-shadow: var(--shadow), inset 0 0 0 1.5px var(--cream); }
.kpi .k-l { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.kpi .k-v { font-size: 34px; font-weight: 700; letter-spacing: -1px; line-height: 1.05; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .k-v small { font-size: 15px; color: var(--muted); letter-spacing: 0; margin-left: 2px; }
.kpi .k-s { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.kpi.warn .k-v { color: var(--amber); } .kpi.bad .k-v { color: var(--red); } .kpi.ok .k-v { color: var(--green); }
@media (max-width: 699px) { .kpi { padding: 12px 14px; border-radius: 16px; } .kpi .k-v { font-size: 26px; } }

/* ================= controls ================= */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 18px; border-radius: 999px; border: 1.5px solid var(--line-2); background: #fff; font-weight: 700; font-size: 14px; line-height: 1.2; text-decoration: none; color: var(--ink); white-space: nowrap; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { border-color: var(--ink); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn svg { width: 18px; height: 18px; }
.btn.primary, .btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover, .btn.dark:hover { background: #45433D; border-color: #45433D; }
.btn.accent { background: var(--orange); border-color: var(--orange); color: var(--ink); }
.btn.accent:hover { background: #F07A16; border-color: #F07A16; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: var(--red); }
.btn.danger.solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ok { background: var(--green); border-color: var(--green); color: #fff; }
.btn.sm { padding: 6px 13px; font-size: 13px; }
.btn.wide { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-2); flex: none; }
.icon-btn:hover { background: rgba(46, 45, 41, .06); }
.linkbtn { border: 0; background: none; padding: 4px 2px; color: var(--orange-ink); font-weight: 700; font-size: 14px; }
.linkbtn:hover { text-decoration: underline; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.fl { font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.hint { font-size: 12.5px; color: var(--muted); }
.err { font-size: 13px; color: var(--red); font-weight: 700; }
input[type=text], input[type=email], input[type=date], input[type=time], input[type=number], input[type=search], input:not([type]), select, textarea {
  width: 100%; padding: 10px 13px; border: 1.5px solid var(--line-2); border-radius: 10px; background: #fff; font-size: 16px; line-height: 1.35; min-height: 44px; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; min-height: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(244, 135, 42, .18); }
input:disabled, select:disabled, textarea:disabled { background: #F8F6F3; color: var(--muted); }
select { appearance: none; -webkit-appearance: none; padding-right: 36px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2377736A' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 14px center; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .row2 { grid-template-columns: 1fr; gap: 0; } }
.check { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-weight: 700; }
.check input { width: 20px; height: 20px; accent-color: var(--orange); }

/* segmented tabs */
.seg { display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: #F1EFEB; width: fit-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; border: 0; background: transparent; font-weight: 700; font-size: 13.5px; color: var(--ink-2); }
.seg button .n { font-size: 12px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.seg button[aria-pressed="true"] .n { color: var(--peach); }
.band .seg { background: rgba(255, 255, 255, .1); }
.band .seg button { color: rgba(255, 255, 255, .85); }
.band .seg button .n { color: rgba(255, 255, 255, .55); }
.band .seg button[aria-pressed="true"] { background: #fff; color: var(--ink); }
.band .seg button[aria-pressed="true"] .n { color: var(--orange-ink); }
.choice { display: flex; flex-wrap: wrap; gap: 8px; }
.choice label { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; }
.choice span { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 999px; border: 1.5px solid var(--line-2); background: #fff; font-weight: 700; font-size: 14px; cursor: pointer; }
.choice input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.choice input:focus-visible + span { outline: 3px solid rgba(244, 135, 42, .55); outline-offset: 2px; }

/* pill tags */
.chip { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; line-height: 1.35; white-space: nowrap; background: var(--grey-bg); color: var(--ink-2); }
.wo-pending, .st-none, .so-draft, .pr-low { background: var(--grey-bg); color: #6A655C; }
.wo-scheduled, .st-submitted, .so-ready, .pr-normal { background: var(--blue-bg); color: var(--blue); }
.wo-progress, .st-draft, .pr-high { background: var(--amber-bg); color: var(--amber); }
.wo-stock { background: var(--violet-bg); color: var(--violet); }
.wo-done, .st-approved, .so-posted { background: var(--green-bg); color: var(--green); }
.st-returned, .pr-urgent { background: var(--red-bg); color: var(--red); }

/* avatars with an online ring */
.av { --s: 36px; --bgc: #fff; position: relative; display: inline-grid; place-items: center; width: var(--s); height: var(--s); border-radius: 50%; flex: none; }
.av img, .av > span { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: #EFECE6; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: calc(var(--s) * .38); }
.av.on::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: max(10px, calc(var(--s) * .3)); height: max(10px, calc(var(--s) * .3)); border-radius: 50%; background: var(--ring-on); box-shadow: 0 0 0 2.5px var(--bgc); }

/* lists */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border: 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; background: none; width: 100%; text-align: left; }
.li:first-child { border-top: 0; }
a.li:hover, button.li:hover { background: #FBF9F6; }
.li-m { flex: 1; min-width: 0; }
.li-t { font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-s { font-size: 13.5px; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-r { display: flex; align-items: center; gap: 8px; flex: none; font-size: 13px; color: var(--muted); }
.empty { text-align: center; padding: 30px 20px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty b { color: var(--ink); font-size: 16px; }
.empty p { max-width: 360px; font-size: 14px; }
.empty-ic { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: var(--tint); color: var(--orange); margin-bottom: 4px; flex: none; }
.empty-ic svg { width: 24px; height: 24px; }
.skel { height: 60px; margin: 10px 20px; border-radius: 14px; background: linear-gradient(90deg, #F3EFEA, #FAF8F5, #F3EFEA); background-size: 200% 100%; animation: sk 1.2s infinite linear; }
@keyframes sk { to { background-position: -200% 0; } }
.alert { border-radius: 14px; padding: 12px 16px; font-size: 14.5px; }
.alert b { display: block; }
.alert.ok { background: var(--green-bg); color: #155E3C; } .alert.info { background: var(--blue-bg); color: #1F4E91; } .alert.warn { background: var(--red-bg); color: #8E2A20; } .alert.plain { background: var(--grey-bg); }

/* ================= dialogs, side panel, menu, toasts ================= */
.modal-back, .drawer-back { position: fixed; inset: 0; z-index: 60; background: rgba(30, 29, 26, .45); display: flex; align-items: flex-end; justify-content: center; animation: fadeIn .18s both; }
.modal-back.out, .drawer-back.out { animation: fadeOut .18s both; }
@keyframes fadeIn { from { opacity: 0; } } @keyframes fadeOut { to { opacity: 0; } }
.modal { width: 100%; max-height: 92vh; max-height: 92dvh; display: flex; flex-direction: column; background: #fff; border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg); animation: sheetUp .28s cubic-bezier(.2, .8, .2, 1) both; padding-bottom: var(--safe-b); }
@keyframes sheetUp { from { transform: translateY(40px); opacity: .4; } }
.modal-h { display: flex; align-items: center; gap: 8px; padding: 16px 12px 6px 22px; }
.modal-h h2 { flex: 1; font-size: 19px; }
.modal-b { padding: 8px 22px 6px; overflow-y: auto; }
.modal-f { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 22px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.modal-f .btn { flex: 1 1 auto; }
.mtext { color: var(--ink-2); margin-bottom: 12px; }
@media (min-width: 640px) {
  .modal-back { align-items: center; padding: 24px; }
  .modal { width: 480px; border-radius: 22px; max-height: 88vh; animation-name: pop; }
  .modal.wide { width: 620px; }
  .modal-f .btn { flex: 0 0 auto; }
}
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.drawer-back { align-items: stretch; justify-content: flex-end; }
.drawer { width: 100%; height: 100%; background: var(--bg); display: flex; flex-direction: column; animation: slideIn .28s cubic-bezier(.2, .8, .2, 1) both; padding-top: var(--safe-t); }
@keyframes slideIn { from { transform: translateX(40px); opacity: .3; } }
.drawer-h { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 14px; background: #fff; border-bottom: 1px solid var(--line); }
.drawer-h h2 { flex: 1; font-size: 18px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dh-act { display: flex; align-items: center; gap: 4px; }
.drawer-b { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.drawer-f { display: flex; gap: 10px; padding: 12px 16px calc(12px + var(--safe-b)); background: #fff; border-top: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
@media (min-width: 900px) { .drawer { width: 560px; box-shadow: var(--shadow-lg); } .drawer.wide { width: 780px; } }
.menu { position: fixed; z-index: 70; min-width: 230px; background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); padding: 8px; animation: pop .15s both; }
.menu-h { display: flex; gap: 12px; align-items: center; padding: 8px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-h div { display: flex; flex-direction: column; } .menu-h small { color: var(--muted); }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 10px; border: 0; background: none; text-decoration: none; color: var(--ink); text-align: left; }
.menu a:hover, .menu button:hover { background: var(--bg); }
#toasts { position: fixed; z-index: 80; left: 50%; bottom: calc(88px + var(--safe-b)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; width: max-content; max-width: calc(100% - 32px); pointer-events: none; }
@media (min-width: 900px) { #toasts { bottom: 28px; left: calc(50% + var(--side-w) / 2); } }
.toast { background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; font-size: 14.5px; box-shadow: var(--shadow-lg); animation: rise .25s both; text-align: center; }
.toast.err { background: var(--red); }
.toast.out { animation: fadeOut .25s both; }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }

/* ================= Home ================= */
.verse { display: block; width: 100%; max-width: 640px; margin-top: 16px; padding: 12px 16px; border: 0; border-left: 3px solid var(--orange); border-radius: 12px; background: rgba(255, 255, 255, .07); color: #fff; text-align: left; }
.verse:hover { background: rgba(255, 255, 255, .1); }
.verse small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--peach); }
.verse q { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-style: italic; font-size: 14.5px; line-height: 1.45; margin: 4px 0 2px; }
.verse cite { font-style: normal; font-size: 12.5px; font-weight: 700; color: rgba(255, 255, 255, .62); }
.verse-big { font-size: 19px; line-height: 1.5; font-style: italic; margin-bottom: 10px; }
.actv { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.actv .stack-av { display: flex; }
.actv .stack-av .av { --bgc: var(--band); box-shadow: 0 0 0 2.5px var(--band); margin-left: -10px; }
.actv .stack-av .av:first-child { margin-left: 0; }
.actv .more-n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .14); font-size: 12px; font-weight: 700; margin-left: -10px; box-shadow: 0 0 0 2.5px var(--band); }
.actv b { display: block; font-size: 15px; } .actv small { color: rgba(255, 255, 255, .62); font-size: 12.5px; }
/* a compact strip (Billy's shift, a technician's timesheet) */
.strip { display: flex; align-items: center; gap: 16px 24px; padding: 16px 20px; flex-wrap: wrap; }
.strip-who { display: flex; align-items: center; gap: 14px; flex: 1 1 240px; min-width: 0; }
.strip-who h3 { font-size: 17px; }
.strip-who p { font-size: 13.5px; color: var(--muted); margin-top: 3px; }
.strip-figs { display: flex; gap: 24px; flex-wrap: wrap; }
.strip-figs small { display: block; font-size: 12px; color: var(--muted); font-weight: 700; }
.strip-figs b { font-size: 17px; font-variant-numeric: tabular-nums; }
.strip-figs i { display: block; font-style: normal; font-size: 12px; color: var(--muted); }
.state { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.state.on { background: var(--green-bg); color: var(--green); }
.state.off { background: var(--grey-bg); color: #6A655C; }
.state.on::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
/* team today */
.person { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.person:first-child { border-top: 0; }
.person:hover { background: #FBF9F6; }
.person .li-m b { display: block; font-size: 14.5px; }
.person .li-m small { display: block; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .li-r { flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
/* stacked bar (work orders by status) */
.sbar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--grey-bg); gap: 2px; }
.sbar i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend b { font-variant-numeric: tabular-nums; }
.c-pending { background: #B9B2A7; } .c-scheduled { background: var(--blue); } .c-progress { background: var(--orange); } .c-stock { background: var(--violet); } .c-done { background: var(--green); }
.mini { width: 100%; border-collapse: collapse; font-size: 14px; }
.mini th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 8px 20px; border-bottom: 1px solid var(--line); }
.mini td { padding: 10px 20px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.mini tr:last-child td { border-bottom: 0; }
.mini .r { text-align: right; }
@media (max-width: 640px) { .mini th, .mini td { padding-left: 14px; padding-right: 14px; } }

/* ================= sign on / sign off ================= */
.shift-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 11px; border-radius: 999px; border: 1.5px solid var(--orange); background: var(--orange); color: var(--ink); font-weight: 700; font-size: 13.5px; white-space: nowrap; }
.shift-pill svg { width: 17px; height: 17px; }
.shift-pill.on { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .22); color: #fff; padding: 5px 5px 5px 12px; }
.shift-pill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ring-on); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(47, 191, 113, .6); } 70% { box-shadow: 0 0 0 7px rgba(47, 191, 113, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 191, 113, 0); } }
.shift-pill .sp-d { color: rgba(255, 255, 255, .65); font-weight: 400; font-variant-numeric: tabular-nums; }
.shift-pill .sp-a { padding: 4px 11px; border-radius: 999px; background: #fff; color: var(--ink); font-size: 12.5px; }
@media (max-width: 520px) { .shift-pill .sp-t, .shift-pill.on .sp-d { display: none; } .shift-pill { padding: 6px 12px; } }
.so-sum { display: flex; gap: 10px; margin-bottom: 14px; }
.so-sum div { flex: 1; background: var(--tint); border-radius: 14px; padding: 10px 14px; display: flex; flex-direction: column; }
.so-sum small { color: var(--muted); font-size: 12.5px; } .so-sum b { font-size: 18px; }

/* ================= My Day stories ================= */
.stories { display: flex; gap: 14px; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: none; margin-top: 18px; }
.stories::-webkit-scrollbar { display: none; }
.story { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: none; padding: 0; width: 74px; flex: none; color: inherit; }
.story .sr-ring { position: relative; width: 68px; height: 68px; border-radius: 50%; padding: 0; display: grid; place-items: center; border: 0; background: rgba(255, 255, 255, .18); cursor: pointer; }
.story.unseen .sr-ring { background: conic-gradient(var(--orange), var(--peach), var(--cream), var(--orange)); }
.story .sr-ring > .av { --s: 58px; box-shadow: 0 0 0 2.5px var(--band); }
.story .sr-plus { position: absolute; left: 50px; top: 48px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 0; padding: 0; background: var(--orange); color: var(--ink); box-shadow: 0 0 0 2.5px var(--band); cursor: pointer; }
.story .sr-plus svg { width: 14px; height: 14px; stroke-width: 2.6; }
.story small { font-size: 12.5px; font-weight: 700; color: rgba(255, 255, 255, .88); max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv { position: fixed; inset: 0; z-index: 90; background: #000; display: flex; align-items: center; justify-content: center; animation: fadeIn .2s both; user-select: none; -webkit-user-select: none; }
.sv-frame { position: relative; width: 100%; height: 100%; max-width: 480px; background: #111; overflow: hidden; }
@media (min-width: 640px) { .sv-frame { height: min(92vh, 860px); border-radius: 18px; } }
.sv-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.sv-bars { position: absolute; top: calc(10px + var(--safe-t)); left: 10px; right: 10px; display: flex; gap: 4px; z-index: 2; }
.sv-bars span { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .35); overflow: hidden; }
.sv-bars i { display: block; height: 100%; width: 0; background: #fff; }
.sv-top { position: absolute; top: calc(22px + var(--safe-t)); left: 12px; right: 6px; display: flex; align-items: center; gap: 10px; color: #fff; z-index: 2; }
.sv-top .av { --bgc: transparent; }
.sv-top small { opacity: .75; margin-left: 6px; }
.sv-top .icon-btn { color: #fff; margin-left: auto; }
.sv-top .icon-btn + .icon-btn { margin-left: 0; }
.sv-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 18px calc(22px + var(--safe-b)); background: linear-gradient(transparent, rgba(0, 0, 0, .7)); color: #fff; font-size: 16px; z-index: 2; }
.sv-seen { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; border: 0; background: rgba(255, 255, 255, .16); color: #fff; padding: 7px 12px; border-radius: 999px; font-size: 13.5px; }
.sv-tap { position: absolute; top: 80px; bottom: 90px; width: 40%; z-index: 1; background: transparent; border: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
.sv-tap.l { left: 0; } .sv-tap.r { right: 0; width: 60%; }

/* ================= Chat ================= */
.v-chat { padding-bottom: 0 !important; }
.v-chat .band { display: none; }
.chat { display: grid; grid-template-columns: minmax(0, 1fr); height: calc(100dvh - var(--top-h) - var(--safe-t) - var(--demo-h) - 64px - var(--safe-b)); background: #fff; }
.chat-list { display: flex; flex-direction: column; border-right: 1px solid var(--line); min-height: 0; background: #fff; }
.chat-list-h { padding: 16px 18px 4px; } .chat-list-h h1 { font-size: 22px; }
.chat-list .list { overflow-y: auto; flex: 1; }
.chat-list .li { border-top: 0; padding: 10px 18px; }
.chat-list .li.on { background: var(--tint); }
.chat-list .li-t { display: flex; justify-content: space-between; gap: 8px; }
.chat-list .li-t > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chat-list .li-t time { flex: none; font-size: 12px; color: var(--muted); font-weight: 400; }
.chat-list .unread .li-s { color: var(--ink); font-weight: 700; }
.chat-sec { padding: 14px 18px 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.chat-note { padding: 12px 18px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }
.team-av { width: 44px; height: 44px; border-radius: 50%; background: var(--ink); display: grid; place-items: center; flex: none; }
.team-av img { width: 26px; height: 26px; }
.convo { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg); }
.convo-h { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #fff; border-bottom: 1px solid var(--line); }
.convo-h h2 { font-size: 16.5px; } .convo-h small { display: block; color: var(--muted); font-size: 13px; }
.msgs { flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 3px; overscroll-behavior: contain; }
.day-sep { align-self: center; font-size: 12.5px; color: var(--muted); font-weight: 700; background: #E9E5DF; padding: 3px 12px; border-radius: 999px; margin: 12px 0 8px; }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 82%; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg .av { --s: 30px; --bgc: var(--bg); }
.msg.cont .av { visibility: hidden; }
.bub { background: #fff; padding: 9px 13px; border-radius: 18px 18px 18px 6px; box-shadow: 0 1px 1px rgba(46, 45, 41, .06); min-width: 0; overflow-wrap: anywhere; }
.msg.me .bub { background: var(--ink); color: #fff; border-radius: 18px 18px 6px 18px; }
.msg.me .bub a { color: var(--peach); }
.bub .who-n { display: block; font-size: 12.5px; font-weight: 700; color: var(--orange-ink); margin-bottom: 1px; }
.bub time { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; text-align: right; }
.msg.me .bub time { color: rgba(255, 255, 255, .6); }
.bub .att { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-top: 6px; border-radius: 12px; background: rgba(46, 45, 41, .06); text-decoration: none; color: inherit; font-size: 14px; }
.msg.me .bub .att { background: rgba(255, 255, 255, .12); }
.bub .att-img { display: block; margin-top: 6px; max-width: 240px; border-radius: 12px; overflow: hidden; background: #EEE; min-height: 80px; }
.bub .att-img img { display: block; width: 100%; }
.composer { display: flex; align-items: flex-end; gap: 6px; padding: 8px 10px; background: #fff; border-top: 1px solid var(--line); }
.composer textarea { flex: 1; min-height: 44px; max-height: 140px; resize: none; border-radius: 22px; padding: 10px 16px; }
.composer .send { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--orange); color: var(--ink); display: grid; place-items: center; flex: none; }
.composer .send:disabled { background: #EFEAE3; color: var(--faint); }
.pending-files { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 12px 0; background: #fff; }
.pending-files span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 10px; background: var(--tint); border-radius: 999px; font-size: 13px; }
.pending-files button { border: 0; background: none; padding: 0; display: grid; color: var(--muted); }
.pending-files svg { width: 16px; height: 16px; }
@media (max-width: 899px) {
  .chat.open .chat-list { display: none; }
  .chat:not(.open) .convo { display: none; }
  #shell:has(.v-chat.in-convo) #bottom { display: none; }
  .v-chat.in-convo .chat { height: calc(100dvh - var(--top-h) - var(--safe-t) - var(--demo-h)); }
}
@media (min-width: 900px) {
  .v-chat .band { display: block; }
  .chat { grid-template-columns: 320px minmax(0, 1fr); position: relative; margin: -58px auto 0; width: calc(100% - 64px); max-width: 1116px; height: calc(100dvh - var(--top-h) - var(--demo-h) - 150px); min-height: 460px; border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
  .chat-list-h { display: none; }
  [data-back] { display: none; }
}

/* ================= Timesheets ================= */
.periodbar { display: flex; align-items: center; gap: 8px; padding: 10px; }
.periodbar .p-t { flex: 1; text-align: center; } .periodbar .p-t b { display: block; } .periodbar .p-t small { color: var(--muted); }
.figs { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 10px; }
.fig { background: var(--card); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); min-width: 0; }
.fig small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 700; } .fig b { font-size: 24px; font-variant-numeric: tabular-nums; } .fig b small { display: inline; font-size: 13px; margin-left: 2px; }
.fig.total { background: var(--ink); color: #fff; } .fig.total small { color: rgba(255, 255, 255, .62); }
.dayrow { display: flex; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); }
.dayrow.today { background: var(--tint); }
.dayrow.issue { box-shadow: inset 3px 0 0 var(--red); }
.datebox { width: 46px; height: 50px; border-radius: 14px; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; }
.dayrow.has .datebox { background: var(--ink); color: #fff; }
.datebox .dow { font-size: 11px; font-weight: 700; letter-spacing: .05em; opacity: .7; } .datebox .dnum { font-size: 18px; font-weight: 700; line-height: 1.1; }
.daymain { flex: 1; min-width: 0; }
.daytop { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.daytop .dname { font-weight: 700; }
.dhrs { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.dhrs.zero { color: var(--faint); font-weight: 400; }
.day-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.day-grid .field { margin: 0; } .day-grid .fl { font-size: 12px; }
.day-grid input { min-height: 42px; padding: 8px 10px; }
@media (min-width: 640px) { .day-grid { grid-template-columns: 1fr 1fr .8fr 1.2fr; } }
.dayrow.collapsed .daymain { display: flex; align-items: center; gap: 10px; }
.day-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; font-size: 13px; }
.day-warn { color: var(--red); font-weight: 700; }
.tag-today { font-size: 11.5px; font-weight: 700; color: var(--amber); background: var(--amber-bg); padding: 2px 8px; border-radius: 999px; }
.fill-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: end; }
.fill-grid .field { margin: 0; }
@media (min-width: 640px) { .fill-grid { grid-template-columns: 1fr 1fr .8fr 1.2fr auto; } }
.savebar { position: sticky; bottom: calc(68px + var(--safe-b)); z-index: 5; display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 18px; background: #fff; border-radius: 999px; box-shadow: var(--shadow-lg); }
@media (min-width: 900px) { .savebar { bottom: 16px; } }
.savestate { flex: 1; font-size: 13.5px; color: var(--muted); } .savestate.ok { color: var(--green); } .savestate.err { color: var(--red); } .savestate.warn { color: var(--amber); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: #FBF9F6; }
.tbl-wrap { overflow-x: auto; }
.tbl.edit td { padding: 6px 8px; } .tbl.edit input { min-height: 38px; padding: 6px 8px; font-size: 16px; }
.tbl tr.wk td { background: var(--bg); font-weight: 700; font-size: 13px; color: var(--ink-2); padding: 7px 14px; }
.tbl tr.weekend td.dcell { color: var(--muted); }
.dcell span { display: block; font-size: 12px; color: var(--muted); }
.hrs-bad { color: var(--red); font-weight: 700; }
@media (max-width: 699px) {
  .tbl.rt thead { display: none; }
  .tbl.rt tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .tbl.rt tr:last-child { border-bottom: 0; }
  .tbl.rt td { padding: 0; border: 0; }
  .tbl.rt .hide-sm { display: none; }
}

/* ================= Work orders ================= */
.wo-list { display: grid; gap: 14px; }
@media (min-width: 700px) { .wo-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .wo-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.wo { display: flex; flex-direction: column; gap: 8px; padding: 16px 16px 14px 20px; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); border: 0; text-align: left; color: inherit; position: relative; overflow: hidden; min-width: 0; }
.wo::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: #D9D2C8; }
.wo.s-scheduled::before { background: var(--blue); } .wo.s-progress::before { background: var(--orange); } .wo.s-stock::before { background: var(--violet); } .wo.s-done::before { background: var(--green); }
.wo:hover { box-shadow: var(--shadow), inset 0 0 0 1.5px var(--cream); }
.wo-top { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.wo-no { font-weight: 700; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.wo-client { font-size: 17px; font-weight: 700; line-height: 1.25; }
.wo-addr { display: flex; gap: 6px; align-items: flex-start; color: var(--ink-2); font-size: 14px; }
.wo-addr svg { width: 16px; height: 16px; margin-top: 2px; color: var(--muted); }
.wo-last { font-size: 13px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 8px; display: flex; gap: 8px; align-items: center; min-width: 0; }
.wo-last .av { --s: 22px; }
.wo-last span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wo-row { display: flex; gap: 10px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.wo-row:first-child { border-top: 0; } .wo-row:hover { background: #FBF9F6; }
.timeline { position: relative; padding-left: 20px; display: flex; flex-direction: column; gap: 14px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl { position: relative; }
.tl::before { content: ""; position: absolute; left: -19px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2.5px solid var(--faint); }
.tl.wo-scheduled-b::before { border-color: var(--blue); } .tl.wo-progress-b::before { border-color: var(--orange); } .tl.wo-stock-b::before { border-color: var(--violet); } .tl.wo-done-b::before { border-color: var(--green); background: var(--green); }
.tl small { color: var(--muted); display: block; font-size: 12.5px; }
.tl p { font-size: 14.5px; margin-top: 2px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14.5px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }

/* ================= Tasks ================= */
.task { display: flex; gap: 12px; align-items: flex-start; padding: 14px 20px; border: 0; border-top: 1px solid var(--line); background: none; width: 100%; text-align: left; color: inherit; }
.list > .task:first-child { border-top: 0; }
.task:hover { background: #FBF9F6; }
.tcheck { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; flex: none; color: transparent; background: #fff; margin-top: 1px; }
.tcheck svg { width: 15px; height: 15px; stroke-width: 2.6; }
.task.s-doing .tcheck { border-color: var(--orange); background: conic-gradient(var(--orange) 50%, #fff 0); }
.task.s-done .tcheck { border-color: var(--green); background: var(--green); color: #fff; }
.task.s-done .li-t { color: var(--muted); text-decoration: line-through; }
.task .meta { display: flex; gap: 6px 10px; flex-wrap: wrap; align-items: center; margin-top: 4px; font-size: 13px; color: var(--muted); }
.task .meta svg { vertical-align: -2px; }
.task .overdue { color: var(--red); font-weight: 700; }
.new-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); display: inline-block; margin-right: 6px; vertical-align: 2px; }
.status-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.status-pick button { padding: 10px 6px; border-radius: 12px; border: 1.5px solid var(--line-2); background: #fff; font-weight: 700; font-size: 14px; }
.status-pick button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.comments { display: flex; flex-direction: column; gap: 10px; }
.cmt { display: flex; gap: 10px; } .cmt .av { --s: 30px; }
.cmt-b { background: var(--bg); border-radius: 4px 16px 16px 16px; padding: 8px 12px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cmt-b b { font-size: 13.5px; } .cmt-b time { font-size: 12px; color: var(--muted); margin-left: 6px; }
.cmt-form { display: flex; gap: 8px; align-items: flex-end; } .cmt-form textarea { flex: 1; }
.card-plain { background: #fff; border-radius: 14px; padding: 14px 16px; }
.card-plain h3 { font-size: 15px; margin-bottom: 6px; }

/* ================= Social ================= */
.week { display: grid; gap: 12px; }
@media (min-width: 640px) { .week { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); } }
@media (min-width: 1560px) { .week { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; } }
.wday { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 12px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; min-width: 0; }
.wday.today { box-shadow: var(--shadow), inset 0 0 0 2px var(--orange); }
.wday-h { display: flex; align-items: baseline; gap: 6px; }
.wday-h small { color: var(--muted); }
.wday-h .icon-btn { margin-left: auto; width: 30px; height: 30px; background: var(--bg); }
.wday-h .icon-btn svg { width: 16px; height: 16px; }
.post { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 12px; background: var(--bg); border: 0; text-align: left; color: inherit; width: 100%; min-width: 0; }
.post:hover { background: var(--tint); }
.post .pthumb { width: 100%; aspect-ratio: 4 / 3; border-radius: 10px; object-fit: cover; background: #E9E3DB; display: block; }
@media (max-width: 1559px) { .post .pthumb { aspect-ratio: 16 / 9; max-height: 200px; } }
.post p { font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pmeta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }
.plat { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #fff; border: 1px solid var(--line-2); color: var(--ink-2); }
.ok-mark { color: var(--green); font-weight: 700; display: inline-flex; align-items: center; gap: 3px; } .ok-mark svg { width: 14px; height: 14px; }
.img-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.img-pick img { width: 84px; height: 64px; object-fit: cover; border-radius: 10px; background: #EEE; }
.post-img { width: 100%; max-height: 360px; object-fit: contain; border-radius: 14px; background: #EEE; }

/* ================= Reports ================= */
.report { padding: 16px 20px; border-top: 1px solid var(--line); }
.report:first-child { border-top: 0; }
.report-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.report-h b { font-size: 16px; }
.report-h .chip { margin-left: auto; }
.report h4 { margin: 10px 0 2px; font-size: 11.5px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.reply { margin-top: 12px; background: var(--tint); border-radius: 12px; padding: 10px 14px; font-size: 14.5px; }

/* ================= People, account, more ================= */
.more-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
.more-grid a, .more-grid button { display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); text-decoration: none; color: inherit; font-weight: 700; border: 0; text-align: left; position: relative; }
.more-grid svg { color: var(--orange); width: 24px; height: 24px; }
.more-grid .badge { position: absolute; top: 14px; right: 14px; }
.prof { display: flex; align-items: center; gap: 16px; padding: 20px; }
.prof h2 { font-size: 20px; } .prof p { color: var(--muted); }
.set-row { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.set-row:first-child { border-top: 0; }
.set-row .li-m b { display: block; } .set-row .li-m small { color: var(--muted); display: block; }
.role-tag, .off-tag { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--orange-ink); white-space: nowrap; }
.role-tag.admin { background: var(--ink); color: #fff; } .role-tag.ceo { background: var(--orange); color: var(--ink); }
.off-tag { background: var(--red-bg); color: var(--red); }

/* ================= first view after signing in ================= */
body.app-intro #side { animation: slideRight .45s cubic-bezier(.2, .8, .2, 1) both; }
body.app-intro #top { animation: dropIn .4s cubic-bezier(.2, .8, .2, 1) both; }
body.app-intro #bottom { animation: rise .45s .15s both; }
body.app-intro .band-in { animation: fadeIn .5s .05s both; }
body.app-intro .body > * { animation: riseIn .55s cubic-bezier(.2, .8, .2, 1) both; animation-delay: .12s; }
body.app-intro .body > :nth-child(2) { animation-delay: .19s; } body.app-intro .body > :nth-child(3) { animation-delay: .26s; } body.app-intro .body > :nth-child(n+4) { animation-delay: .33s; }
@keyframes slideRight { from { transform: translateX(-30px); opacity: 0; } }
@keyframes dropIn { from { transform: translateY(-100%); } }
@keyframes riseIn { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { body.app-intro * { animation: none !important; } }
