/* MAXIN TEAM PRO — design system for MAXIN SHOES.
   Familiar chat-app style: white surfaces, green accent, list rows with thin dividers.
   Mobile-first; >= 1024px gets a left navigation rail and two independent scrolling panes. */

/* =============================================================== 1. tokens */
:root {
  --bg: #ffffff;
  --green: #008069;       /* primary accent, buttons, selected */
  --green-dk: #075e54;    /* headings in green, pressed */
  --sel: #d9fdd3;         /* selected row / chip */
  --field: #f0f2f5;       /* search + input background, neutral chips */
  --ink: #111b21;         /* primary text */
  --muted: #667781;       /* secondary text */
  --icon: #54656f;        /* row icons */
  --hdr: #075e54;         /* primary header */
  --line: #e2e8ea;        /* borders + dividers */
  --red: #dc2626;         /* overdue / urgent only */
  --red-bg: #fdecec;
  --amber: #b45309;       /* pending warning only */
  --amber-bg: #fdf3e6;
  --ok-bg: #e7f6ee;
  --hh: 56px;             /* header height */
  --nav-h: 64px;          /* bottom navigation height */
  --rail-w: 84px;         /* desktop navigation rail width */
  --r: 12px;
  --font: Roboto, "Noto Sans Devanagari", "Segoe UI", system-ui, -apple-system, "Noto Sans", Arial, sans-serif;
}

/* =============================================================== 2. base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--hh) + 120px); scroll-padding-bottom: calc(var(--nav-h) + 40px); }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 400 14px/1.45 var(--font);
  overflow-x: hidden; overflow-anchor: none; touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0, 128, 105, .10); overscroll-behavior-y: contain;
}
a { color: var(--green); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 700; }
h1 { font-size: 21px; } h2 { font-size: 16px; } h3 { font-size: 15px; }
p { margin: .4em 0; }
b, strong { font-weight: 700; }
.muted { color: var(--muted); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.right { margin-left: auto; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.hide { display: none !important; }
.t-red { color: var(--red) !important; } .t-amber { color: var(--amber) !important; } .t-green { color: var(--green) !important; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.s { width: 18px; height: 18px; }

/* =============================================================== 3. header */
header.top {
  background: var(--hdr); color: #fff; position: sticky; top: 0; z-index: 30;
  padding-top: env(safe-area-inset-top);
}
.top-in { display: flex; align-items: center; gap: 6px; height: var(--hh); padding: 0 8px 0 16px; }
.brand { display: block; min-width: 0; flex: 0 1 auto; overflow: hidden; color: #fff; }
@media (max-width: 400px) {
  .back + .brand .app { font-size: 15.5px; letter-spacing: 0; }
  .back + .brand .demo-chip { font-size: 9px; padding: 2px 5px; }
  header.top .top-in { gap: 2px; padding: 0 4px 0 12px; }
  header.top .iconbtn { width: 38px; height: 38px; }
}
.brand .app { font-weight: 700; font-size: 18px; color: #fff; letter-spacing: .2px; white-space: nowrap; line-height: 1.15; }
.brand .co { font-size: 11px; color: rgba(255, 255, 255, .78); letter-spacing: 1.4px; font-weight: 500; }
header.top .iconbtn { color: #fff; }
header.top .iconbtn:hover, header.top .kebab[open] > summary { background: rgba(255, 255, 255, .14); }
header.top .iconbtn .count { background: #fff; color: var(--hdr); border-color: var(--hdr); }
.iconbtn {
  display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; flex: none;
  border-radius: 50%; position: relative; color: var(--icon); background: transparent; border: 0; cursor: pointer; padding: 0;
}
.iconbtn:hover { background: var(--field); }
.iconbtn .count {
  position: absolute; top: 3px; right: 2px; background: var(--green); color: #fff; font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 4px;
  border: 2px solid #fff;
}
header.top .back { margin-left: -8px; }
header.top .right { margin-left: auto; }

/* three-dot menu */
.kebab { position: relative; }
.kebab > summary { list-style: none; }
.kebab > summary::-webkit-details-marker { display: none; }
.kebab-menu {
  position: absolute; right: 4px; top: 46px; min-width: 220px; background: #fff; border-radius: 10px; padding: 6px 0; z-index: 60;
  box-shadow: 0 2px 5px rgba(11, 20, 26, .26), 0 8px 24px rgba(11, 20, 26, .12);
}
.kebab-menu a, .kebab-menu button {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 46px; padding: 0 18px; color: var(--ink);
  font: inherit; font-size: 15px; background: none; border: 0; cursor: pointer; text-align: left;
}
.kebab-menu a:hover, .kebab-menu button:hover { background: var(--field); }
.kebab-menu svg { color: var(--icon); }
.kebab-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

/* page heading (below the header, scrolls with the page) */
.page { max-width: 760px; margin: 0 auto; }
.page.narrow { max-width: 480px; }
.pagehead, .subhead { padding: 14px 16px 6px; }
.pagehead h1, .subhead h1 { font-size: 21px; }
.pagehead .sub, .subhead .muted { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* =============================================================== 4. layout */
.wrap { padding: 4px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); }
body:not(.has-nav) .wrap { padding-bottom: 32px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 12px; }
.card.flat { border: 0; padding: 0; }
.card > h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 16px; }
.card > h2 svg { color: var(--green); }
.sec-title {
  display: flex; align-items: center; gap: 8px; margin: 16px 2px 4px; font-size: 14px; font-weight: 600; color: var(--green-dk);
}
.sec-title a { font-size: 13px; font-weight: 600; }
.grid { display: grid; gap: 10px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .md-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row.wrapit { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }
.inline { display: inline; margin: 0; }

/* split view: list + details. Mobile = one column (panes dissolve so items can be re-ordered). */
.split { display: flex; flex-direction: column; }
.split > .pane { display: contents; }
.split .first-m { order: -1; }

/* =============================================================== 5. summary indicators */
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 12px; overflow: hidden; }
.summary.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { display: block; padding: 10px 6px 9px; text-align: center; color: var(--ink); min-width: 0; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
a.stat:hover { background: var(--field); }
.stat .n { font-size: 21px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 11.5px; color: var(--muted); font-weight: 500; line-height: 1.25; margin-top: 2px; }

/* =============================================================== 6. list rows */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 11px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.card > .list > li:first-child { padding-top: 2px; }
.card > .list > li:last-child { padding-bottom: 2px; }
.item-title { font-weight: 500; font-size: 15.5px; word-break: break-word; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; color: var(--muted); margin-top: 3px; align-items: center; }
.meta svg.i.s { width: 15px; height: 15px; vertical-align: -3px; }
.meta .due { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.meta .due.red { color: var(--red); }
.done .item-title, .done .lt { text-decoration: line-through; color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 22px 8px; font-size: 14px; }

/* chat-style row: avatar | title + date / secondary + count */
.lrow { display: flex; align-items: center; gap: 12px; padding: 0 2px; color: var(--ink); min-height: 64px; position: relative; }
a.lrow:hover, .lrow.sel { background: var(--field); }
.lrow.sel { background: var(--sel); }
.lrow .lbody { flex: 1; min-width: 0; align-self: stretch; display: grid; grid-template-columns: minmax(0, 1fr); align-content: center;
  padding: 8px 2px 8px 0; border-bottom: 1px solid var(--line); }
.lrows > .lrow:last-child .lbody, .lgroup:last-child > .lrow:last-child .lbody { border-bottom: 0; }
.lrows.compact .lrow { min-height: 56px; }
.lrows.compact .lrow .lbody { padding: 6px 2px 6px 0; }
.ltop, .lbot { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lbot { margin-top: 1px; }
.lt { flex: 1; min-width: 0; font-size: 15.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.lt.multi { white-space: normal; word-break: break-word; flex: 1 1 auto; }
.lt.nm { font-size: 16px; }
.ld { flex: none; font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ld.red { color: var(--red); font-weight: 600; }
.ls { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls.multi { white-space: normal; flex: 1 1 auto; }
.ls svg.i.s { width: 14px; height: 14px; vertical-align: -2px; }
.ink { color: var(--ink); } .by { color: var(--muted); font-weight: 400; }
.code { flex: none; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.kvline { display: flex; flex-wrap: wrap; gap: 2px 18px; font-size: 14px; margin-top: 2px; }
.kvline small { font-size: 12px; color: var(--muted); }
.lrow.top { align-items: flex-start; }
.lrow.top > .check, .lrow.top > .av { margin-top: 10px; }
/* large pending-days figure (left of a row) */
.pdbig { flex: none; width: 46px; min-height: 46px; margin-top: 10px; border-radius: 12px; background: var(--field); color: var(--icon);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.pdbig b { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pdbig small { font-size: 10.5px; font-weight: 600; margin-top: 2px; }
.pdbig.late { background: var(--red-bg); color: var(--red); }
.badge.pdb { font-weight: 700; font-size: 12px; }
.lrow.top > .check { min-height: 0; }
.lrow[data-href] { cursor: pointer; }
.lrow[data-href]:hover { background: var(--field); }
.lrow:target { background: var(--sel); }
label.check > .lbody { display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; }
label.check > .lbody .ltop, label.check > .lbody .lbot, label.check > .lbody .meta { display: flex; }
.lhead { font-size: 12.5px; font-weight: 700; color: var(--green-dk); text-transform: uppercase; letter-spacing: .5px; padding: 12px 2px 2px; }
.lrows { margin: 0 -2px; }

/* avatars (initials or icon) */
.av {
  flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-content: center;
  background: #dfe5e7; color: #fff; font-weight: 600; font-size: 16px; letter-spacing: .3px; text-transform: uppercase;
}
.av.sm { width: 40px; height: 40px; font-size: 14px; }
.av.ic { background: var(--field); color: var(--green); }
.av.ic.red { background: var(--red-bg); color: var(--red); }
.av.ic.amber { background: var(--amber-bg); color: var(--amber); }
.av.c0 { background: #00a884; } .av.c1 { background: #53bdeb; } .av.c2 { background: #7f66ff; } .av.c3 { background: #ff8a65; }
.av.c4 { background: #009de2; } .av.c5 { background: #25b39e; } .av.c6 { background: #a5b337; } .av.c7 { background: #e26ab6; }

/* count pills + status dots */
.cnt { flex: none; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--green); color: #fff;
  font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.cnt.red { background: var(--red); } .cnt.amber { background: var(--amber); } .cnt.grey { background: #8696a0; }
.cnt.lbl { font-size: 11.5px; font-weight: 600; padding: 0 8px; white-space: nowrap; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #8696a0; flex: none; }
.dot.ok { background: var(--green); } .dot.warn { background: var(--amber); } .dot.bad { background: var(--red); }

/* =============================================================== 7. badges, chips, tabs */
.badge { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px; white-space: nowrap; line-height: 1.5; }
.b-urgent, .b-late { background: var(--red-bg); color: var(--red); }
.b-high { background: var(--amber-bg); color: var(--amber); }
.b-normal { background: var(--field); color: var(--muted); }
.b-ok { background: var(--ok-bg); color: var(--green-dk); }
.b-info, .b-lav { background: var(--field); color: var(--green-dk); }

/* filter chips (also used by the older .tabs markup) */
.chips, .tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding: 2px 0; }
.chips::-webkit-scrollbar, .tabs::-webkit-scrollbar { display: none; }
.chips.wrapit { flex-wrap: wrap; overflow: visible; }
.tabs { margin-bottom: 10px; }
.chip, .tabs a {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 14px;
  border-radius: 18px; background: var(--field); color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap; border: 0;
}
.chip.on, .tabs a.on { background: var(--sel); color: var(--green-dk); font-weight: 600; }
.tabs a .tiny { font-size: 11px; }

.tabs a .tcnt { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #fff; color: var(--muted);
  font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.tabs a.on .tcnt { background: var(--green); color: #fff; }
.tabs a .tcnt.red { background: var(--red); color: #fff; }

.vf { flex-wrap: wrap; row-gap: 2px; margin: 4px 0 8px; }
.vf .chips { overflow: visible; }

/* fixed list toolbar (tabs / period / search / filter): stays in place while the list scrolls */
.tools { position: sticky; top: calc(var(--hh) + env(safe-area-inset-top)); z-index: 20; background: #fff; padding-top: 6px; }
.tools .tabs { margin-bottom: 6px; gap: 6px; }
.tools .tabs a { padding: 0 12px; }
.tools .search { margin: 0 0 8px; }
.toolrow { display: flex; align-items: flex-start; gap: 8px; }
.toolrow .search { flex: 1; min-width: 0; }
.toolrow > .btn { flex: none; min-height: 42px; }
.tfilter { flex: 0 1 46%; max-width: 280px; min-width: 0; display: flex; gap: 6px; }
.tfilter select { min-height: 42px; height: 42px; border-radius: 21px; padding: 0 34px 0 14px; font-size: 14px; background-position: right 12px center; }
.tfilter select.on { background-color: var(--sel); color: var(--green-dk); font-weight: 600; }
html.js .nojs { display: none !important; }

/* three-dot action menu on a list row */
.rowk { flex: none; margin: -6px -6px -6px 0; }
.iconbtn.sm { width: 40px; height: 40px; }
.rowk > summary { color: var(--icon); }
.rowk .kebab-menu { top: 40px; right: 0; min-width: 250px; max-width: calc(100vw - 32px); }
.kebab-menu.up { top: auto; bottom: 40px; }
.kebab-menu .red, .kebab-menu .red svg { color: var(--red); }
.km-form { padding: 8px 16px 10px; margin: 0; }
.km-l { display: flex; align-items: center; gap: 14px; font-size: 15px; color: var(--ink); margin-bottom: 8px; }
.km-l svg { color: var(--icon); }
.km-form input[type=date] { min-height: 40px; padding: 6px 10px; font-size: 15px; }
.kebab-menu .km-form .btn { width: auto; min-height: 40px; padding: 0 16px; background: var(--green); color: #fff; border-radius: 20px; justify-content: center; }

/* =============================================================== 8. search */
.search { position: relative; margin: 6px 0 10px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--icon); pointer-events: none; }
.search input[type=search] {
  width: 100%; height: 42px; min-height: 42px; border: 0; border-radius: 21px; background: var(--field); padding: 0 16px 0 46px;
  font: inherit; font-size: 16px; color: var(--ink); -webkit-appearance: none; appearance: none;
}
.search input[type=search]:focus { outline: 2px solid var(--green); outline-offset: -2px; background: #fff; }
.search input::placeholder { color: var(--muted); }

/* =============================================================== 9. buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 24px; padding: 0 22px;
  min-height: 46px; background: var(--green); color: #fff; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  text-align: center; white-space: nowrap;
}
.btn:hover { background: var(--green-dk); }
.btn.block { width: 100%; }
.btn.sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn.ghost { background: #fff; color: var(--green); border: 1px solid #d1d7db; }
.btn.ghost:hover { background: var(--field); }
.btn.danger { background: #fff; color: var(--red); border: 1px solid #f1c5c5; }
.btn.danger:hover { background: var(--red-bg); }
.btn.wa { background: var(--green); }
.linkbtn {
  display: inline-flex; align-items: center; gap: 5px; min-height: 40px; padding: 6px 2px; background: none; border: 0;
  color: var(--green); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.linkbtn.red { color: var(--red); }
.actions { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 4px; align-items: center; }
.actions .btn.sm { min-height: 36px; padding: 0 14px; }
.lbot .linkbtn.xs, .linkbtn.xs { min-height: 0; padding: 0 2px; font-size: 13px; }
button:disabled, .btn.busy { opacity: .6; cursor: progress; }
.fab-row { display: flex; gap: 8px; margin-bottom: 10px; }

/* =============================================================== 10. forms */
label.f { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin: 10px 0 4px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=time], input[type=tel], select, textarea {
  width: 100%; min-height: 44px; padding: 9px 14px; border: 1px solid transparent; border-radius: 10px; background: var(--field);
  color: var(--ink); font: inherit; font-size: 16px; min-width: 0; -webkit-appearance: none; appearance: none;
}
select {
  padding-right: 38px; background-repeat: no-repeat; background-position: right 14px center; background-size: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2354656f' stroke-width='2'/%3E%3C/svg%3E");
}
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); background-color: #fff; }
input::placeholder, textarea::placeholder { color: #8696a0; }
.req::after { content: " *"; color: var(--red); }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg label { flex: 1; min-width: 74px; position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: flex; align-items: center; justify-content: center; min-height: 42px; border-radius: 21px; background: var(--field);
  color: var(--muted); font-weight: 500; font-size: 14px; cursor: pointer; }
.seg input:checked + span { background: var(--sel); color: var(--green-dk); font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--green); }
.picker { border: 1px solid var(--line); border-radius: 10px; max-height: 232px; overflow-y: auto; padding: 0 12px 2px; background: #fff; overscroll-behavior: contain; }
.picker .grp { font-size: 12px; font-weight: 700; color: var(--green-dk); text-transform: uppercase; letter-spacing: .5px; margin: 8px 0 0; }
.picker label { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 4px 0; font-size: 15px; border-bottom: 1px solid var(--line); cursor: pointer; }
.picker label:last-child { border-bottom: 0; }
.picker label:has(input:checked) { color: var(--green-dk); font-weight: 600; }
.pick-n { font-weight: 400; }
/* employee lists inside forms grow with the page: no second scrollbar; the search box stays pinned while scrolling */
.pick .picker { max-height: none; overflow: visible; overscroll-behavior: auto; }
.pick-q { position: sticky; top: calc(var(--hh) + env(safe-area-inset-top)); z-index: 3; background: #fff; padding: 8px 0 4px; margin: 0; }
.pick-q svg { position: absolute; left: 12px; top: 50%; margin-top: 2px; transform: translateY(-50%); color: var(--icon); pointer-events: none; }
.pick-q input[type=search] { width: 100%; height: 38px; border: 0; border-radius: 19px; background: var(--field); padding: 0 12px 0 40px;
  font: inherit; font-size: 15px; color: var(--ink); -webkit-appearance: none; appearance: none; }
.pick-q input[type=search]:focus { outline: 2px solid var(--green); outline-offset: -2px; }
html:not(.js) .pick-q { display: none; }
.pick-sel { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.pick-sel:empty { display: none; }
.pchip { display: inline-flex; align-items: center; gap: 4px; min-height: 34px; padding: 0 6px 0 12px; border-radius: 15px; border: 0;
  background: var(--sel); color: var(--green-dk); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.pchip svg.i.s { width: 15px; height: 15px; }
/* compact forms + Save bar that stays reachable */
.cform .grid { gap: 8px; }
.formbar { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); z-index: 2; background: #fff; padding: 10px 0 4px; margin-top: 6px; }
body.kb .formbar, body:not(.has-nav) .formbar { bottom: 0; }
.formbar.two { display: flex; gap: 10px; }
.formbar.two .btn { flex: 1; }
/* departments editor (Team) */
details.deptedit > summary { list-style: none; display: inline-flex; margin: 2px 0 8px; }
details.deptedit > summary::-webkit-details-marker { display: none; }
details.deptedit[open] > summary, details.deptedit[open] ~ .dview { display: none; }
.dgrid { display: grid; grid-template-columns: minmax(0, 1fr) 84px; gap: 8px; margin-bottom: 8px; }
.dgrid.dhead-row { font-size: 12px; color: var(--muted); font-weight: 500; margin: 4px 0 4px; }
.errors { background: var(--red-bg); color: #8e1c1c; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }
.errors div + div { margin-top: 4px; }

/* collapsible "add" form and inline mini-forms */
details.add { border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 12px; background: #fff; }
details.add > summary {
  list-style: none; cursor: pointer; min-height: 52px; padding: 0 16px; font-weight: 600; color: var(--green);
  display: flex; align-items: center; gap: 10px;
}
details.add > summary::-webkit-details-marker, details.mini > summary::-webkit-details-marker, details.sect > summary::-webkit-details-marker { display: none; }
details.add > summary .av { width: 34px; height: 34px; background: var(--green); color: #fff; }
details.add[open] > summary { border-bottom: 1px solid var(--line); }
details.add > form, details.add > .in { padding: 2px 16px 16px; }
details.mini > summary { cursor: pointer; color: var(--green); font-size: 14px; font-weight: 600; list-style: none; min-height: 40px; display: inline-flex; align-items: center; }
details.mini[open] { background: var(--field); border-radius: 10px; padding: 4px 10px 10px; margin: 4px 0; flex-basis: 100%; }
details.mini[open] input, details.mini[open] select, details.mini[open] textarea { background-color: #fff; }

/* collapsible dashboard section */
details.sect { border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 10px; background: #fff; }
details.sect > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 0 14px;
  font-weight: 600; font-size: 15.5px;
}
details.sect > summary svg.i { color: var(--green); }
details.sect > summary::after {
  content: ""; width: 8px; height: 8px; border-right: 2px solid var(--icon); border-bottom: 2px solid var(--icon);
  transform: rotate(45deg); margin: -4px 4px 0 2px; flex: none;
}
details.sect[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
details.sect[open] > summary { border-bottom: 1px solid var(--line); }
details.sect > .in { padding: 4px 14px 10px; }
details.sect .more-link { display: flex; justify-content: center; padding: 10px 0 2px; font-weight: 600; font-size: 14px; border-top: 1px solid var(--line); margin-top: 4px; }

/* =============================================================== 11. checkboxes (large, no layout shift) */
.check { display: flex; align-items: center; gap: 14px; cursor: pointer; min-height: 44px; }
.check input[type=checkbox] {
  appearance: none; -webkit-appearance: none; flex: none; width: 26px; height: 26px; margin: 0; border: 2px solid #8696a0;
  border-radius: 7px; background: #fff; display: grid; place-content: center; cursor: pointer;
}
.check input[type=checkbox]::after {
  content: ""; width: 12px; height: 7px; border: 2.5px solid #fff; border-top: 0; border-right: 0;
  transform: rotate(-45deg) translate(1px, -1px); opacity: 0;
}
.check input[type=checkbox]:checked { background: var(--green); border-color: var(--green); }
.check input[type=checkbox]:checked::after { opacity: 1; }
.check input[type=checkbox]:disabled { opacity: .5; }
.check input[type=checkbox]:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.picker input[type=checkbox], .cb { width: 22px; height: 22px; accent-color: var(--green); flex: none; margin: 0; }
.saving { opacity: .6; }

/* =============================================================== 12. progress + numbers */
.bar { height: 6px; background: var(--field); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: var(--green); border-radius: 3px; }
.bar.warn > i { background: var(--amber); } .bar.bad > i { background: var(--red); }
.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; text-align: center; margin-top: 8px; }
.kv b { display: block; font-size: 17px; } .kv span { font-size: 12px; color: var(--muted); }
.perf { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; }
.perf .nums { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.nm { font-weight: 500; font-size: 16px; } .nm small { font-weight: 400; color: var(--muted); }
.bignum { font-size: 22px; font-weight: 700; }

/* =============================================================== 13. messages */
.flash { display: block; padding: 11px 14px; border-radius: 10px; margin: 8px 0 12px; font-weight: 500; font-size: 14px; }
.flash.ok { background: var(--ok-bg); color: var(--green-dk); }
.flash.err { background: var(--red-bg); color: #8e1c1c; }
.flash.warn { background: var(--amber-bg); color: #7a3b05; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #3b4a54; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px; z-index: 80; opacity: 0;
  transition: opacity .15s; pointer-events: none; max-width: 90vw; box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}
.toast.show { opacity: 1; }
.toast.err { background: var(--red); }
.netbar {
  position: sticky; top: 0; z-index: 50; background: var(--red); color: #fff; text-align: center; font-size: 13.5px; font-weight: 600;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
}

/* =============================================================== 14. bottom navigation (mobile) */
.bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-in { display: flex; max-width: 760px; margin: 0 auto; height: var(--nav-h); }
.bottom a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--icon); font-size: 12px; font-weight: 500; min-width: 0;
}
.bottom a .pill { display: flex; align-items: center; justify-content: center; width: 58px; height: 30px; border-radius: 15px; }
.bottom a.on { color: var(--ink); font-weight: 700; }
.bottom a.on .pill { background: var(--sel); color: var(--green-dk); }
body.kb .bottom { display: none; }   /* fixed bar: hiding it moves nothing else on the page */

/* =============================================================== 15. menu lists (More page) */
.menu { margin: 0 0 6px; }
.menu + .menu { border-top: 6px solid var(--field); border-radius: 3px 3px 0 0; padding-top: 2px; }
.menu form { margin: 0; }
.menu a, .menu .mi {
  display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 2px; color: var(--ink); font: inherit; font-size: 15px;
  width: 100%; background: none; border: 0; text-align: left; cursor: pointer;
}
.menu a:hover, .menu .mi:hover { background: var(--field); }
.menu a::after, .menu .mi::after {
  content: ""; flex: none; width: 7px; height: 7px; margin: 0 8px 0 4px; border-top: 2px solid #aebac1; border-right: 2px solid #aebac1; transform: rotate(45deg);
}
.menu .grow small { display: block; font-size: 12px; color: var(--muted); line-height: 1.3; }
.menu .ico { width: 36px; height: 36px; border-radius: 50%; display: grid; place-content: center; color: var(--green); background: var(--field); flex: none; }
.menu .ico svg { width: 19px; height: 19px; }
.menu .mi.red { color: var(--red); }
.menu .mi.red .ico { color: var(--red); background: var(--red-bg); }
.profile { display: flex; align-items: center; gap: 14px; padding: 8px 2px 12px; }
.profile .av { width: 52px; height: 52px; font-size: 19px; }
.profile .pname { font-size: 17px; font-weight: 600; line-height: 1.25; }
.install-row { background: var(--field); border-radius: 12px; padding: 8px 10px 8px 12px; margin-bottom: 10px; }
.install-row img { border-radius: 8px; flex: none; }

/* =============================================================== 16. login + misc */
.login-wrap { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 24px 20px; max-width: 420px; margin: 0 auto; }
.login-logo { text-align: center; margin-bottom: 22px; }
.login-logo .app { font-size: 24px; font-weight: 700; color: var(--green); }
.login-logo .co { font-size: 12px; letter-spacing: 2.4px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.login-card { border: 0; padding: 0; }
.login-card h2 { font-size: 20px; margin-bottom: 4px; }
.mark-img { width: 72px; height: 72px; border-radius: 50%; display: block; margin: 0 auto 12px; }
.pwbox { font: 700 22px/1.2 ui-monospace, Consolas, monospace; letter-spacing: 2px; background: var(--field); padding: 14px; border-radius: 10px; text-align: center; word-break: break-all; }
pre.resp { white-space: pre-wrap; font: inherit; margin: 6px 0 0; color: var(--ink); }
.demo-chip { display: inline-block; vertical-align: middle; font-size: 9.5px; font-weight: 700; letter-spacing: .6px; padding: 2px 6px; border-radius: 4px; background: #ffd34d; color: #3b2a00; }
.demo-chip.solid { font-size: 12px; padding: 4px 10px; }
/* numbered responsibilities list (employee details) */
ol.resp { list-style: none; counter-reset: r; margin: 0; padding: 0; }
ol.resp > li { counter-increment: r; display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line);
  font-size: 15px; line-height: 1.4; word-break: break-word; }
ol.resp > li:last-child { border-bottom: 0; }
ol.resp > li::before { content: counter(r); flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--sel); color: var(--green-dk);
  font-size: 12px; font-weight: 700; display: grid; place-content: center; margin-top: -1px; }

/* confirmation dialog (replaces the browser's confirm box; falls back to it when <dialog> is unsupported) */
dialog.cdlg { border: 0; border-radius: 12px; padding: 20px 20px 8px; width: calc(100% - 48px); max-width: 360px; color: var(--ink);
  box-shadow: 0 2px 5px rgba(11, 20, 26, .26), 0 12px 32px rgba(11, 20, 26, .18); }
dialog.cdlg::backdrop { background: rgba(11, 20, 26, .32); }
dialog.cdlg p { margin: 0 0 14px; font-size: 15px; line-height: 1.45; }
dialog.cdlg .dbtns { display: flex; justify-content: flex-end; gap: 4px; }
dialog.cdlg .dbtns button { min-height: 42px; padding: 0 16px; border: 0; border-radius: 21px; background: none; color: var(--green); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
dialog.cdlg .dbtns button:hover { background: var(--field); }
dialog.cdlg .dbtns button:focus-visible { outline: 2px solid var(--green); outline-offset: 0; }
.note { font-size: 12px; color: var(--muted); margin-top: 8px; }
.standalone header.top { padding-top: env(safe-area-inset-top); }

/* department / item detail panels (drill-down without leaving the dashboard) */
.dpanel { display: none; }
html:not(.js) .dpanel:target, .dpanel.open { display: block; }
html:not(.js) .side:has(.dpanel:target) .overview, .side.has-open .overview { display: none; }
.iconbtn.sq { width: 36px; height: 36px; border-radius: 8px; background: var(--field); color: var(--green-dk); font-size: 12px; }
.dhead { display: flex; align-items: center; gap: 12px; padding: 4px 0 12px; }
.dhead .av { width: 52px; height: 52px; font-size: 18px; }
.dhead h2 { font-size: 19px; }
.closebtn { margin-left: auto; }
@media (max-width: 1023px) {
  /* on phones a department opens as its own full screen (phone Back closes it) */
  html:not(.js) .dpanel:target, .dpanel.open {
    position: fixed; left: 0; right: 0; bottom: 0; top: calc(var(--hh) + env(safe-area-inset-top)); z-index: 35; background: #fff;
    overflow-y: auto; overscroll-behavior: contain; padding: 8px 16px calc(var(--nav-h) + 24px + env(safe-area-inset-bottom));
  }
  html:not(.js) .side:has(.dpanel:target) .overview, .side.has-open .overview { display: block; }
}

/* =============================================================== 17. desktop / laptop (>= 1024px) */
@media (min-width: 1024px) {
  body.has-nav { padding-left: var(--rail-w); }
  body.has-nav header.top { margin-left: calc(-1 * var(--rail-w)); padding-left: var(--rail-w); }
  .top-in { padding: 0 16px 0 20px; }
  /* bottom bar becomes a fixed left rail */
  .bottom { top: 0; right: auto; width: var(--rail-w); border-top: 0; border-right: 1px solid var(--line); padding: calc(var(--hh) + 12px) 0 12px; background: #f7f8fa; z-index: 25; }
  .bottom-in { flex-direction: column; height: auto; gap: 6px; }
  .bottom a { flex: none; height: 64px; }
  .page { max-width: 880px; }
  .page.wide { max-width: 1320px; }
  .page.narrow { max-width: 520px; }
  .wrap { padding: 4px 24px 32px; }
  .pagehead, .subhead { padding: 18px 24px 8px; }
  .toast { bottom: 24px; left: calc(50% + var(--rail-w) / 2); }
  /* two independent scrolling panes */
  .split { display: grid; grid-template-columns: minmax(380px, 440px) minmax(0, 1fr); gap: 24px; align-items: start; }
  .split.wide-l { grid-template-columns: minmax(0, 1fr) minmax(340px, 400px); }
  .split > .pane {
    display: block; position: sticky; top: calc(var(--hh) + 12px); max-height: calc(100vh - var(--hh) - 24px);
    overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding-right: 4px;
  }
  .split > .pane.side { border-left: 1px solid var(--line); padding-left: 24px; }
  .split.wide-l > .pane.side { border-left: 1px solid var(--line); }
  .split .first-m { order: 0; }
  .split > .pane { scroll-padding-top: 120px; }
  .split > .pane > .tools { top: 0; }
  .formbar { bottom: 0; }
  .split > .pane .pick-q { top: 0; }
  .side .empty-pick { color: var(--muted); text-align: center; padding: 60px 20px; }
  .kebab-menu { top: 48px; }
}
@media (max-width: 360px) {
  .wrap { padding-left: 12px; padding-right: 12px; }
  .pagehead { padding-left: 12px; padding-right: 12px; }
  .stat .n { font-size: 18px; } .stat .l { font-size: 10.5px; }
  .lt { font-size: 15.5px; }
  .bottom a .pill { width: 50px; }
}
