/* Ivory Computers Service Desk
   Palette borrows from process ink: cyan, magenta, yellow and key (black). */
:root {
  --bg: #eef1f4;
  --paper: #ffffff;
  --ink: #16191d;
  --ink-2: #4a525c;
  --ink-3: #737c87;
  --line: #d6dce2;
  --line-2: #e7ebef;
  --cyan: #0083b5;
  --cyan-tint: #e2f3fa;
  --magenta: #b0166c;
  --magenta-tint: #fbe7f2;
  --yellow: #e2ac00;
  --yellow-ink: #6e5200;
  --yellow-tint: #fff5d1;
  --green: #1b7f47;
  --green-tint: #e3f4ea;
  --red: #c0262d;
  --red-tint: #fde8e8;
  --radius: 6px;
  --side: #16191d;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.5 var(--font);
  font-variant-numeric: tabular-nums;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-stretch: 85%; line-height: 1.15; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; font-weight: 750; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 .75rem; }
code { background: var(--line-2); padding: .1em .35em; border-radius: 3px; font-size: .9em; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.ic { width: 20px; height: 20px; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--ink-3); }
.small { font-size: .85rem; }
.mono { font-stretch: 78%; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.nowrap { white-space: nowrap; }

/* ---------- Registration mark brand ---------- */
.brand { display: flex; align-items: center; gap: .7rem; color: inherit; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand strong { display: block; font-stretch: 80%; font-weight: 800; font-size: 1.1rem; letter-spacing: .01em; }
.brand small { display: block; font-size: .78rem; opacity: .65; }
.reg { display: grid; grid-template-columns: 9px 9px; gap: 2px; flex: none; }
.reg i { width: 9px; height: 9px; display: block; }
.reg .c { background: #00a3db; } .reg .m { background: #d6197f; }
.reg .y { background: #ffd200; } .reg .k { background: #fff; }
.bare .reg .k, .topbar .reg .k { background: var(--ink); }
.brand.big strong { font-size: 1.35rem; }
.brand.big .reg { grid-template-columns: 12px 12px; } .brand.big .reg i { width: 12px; height: 12px; }

/* ---------- Shell ---------- */
.shell { min-height: 100vh; }
.side {
  position: fixed; inset: 0 auto 0 0; width: 252px; z-index: 30;
  background: var(--side); color: #e9edf1;
  display: flex; flex-direction: column; padding: 20px 14px;
  transform: translateX(-100%); transition: transform .2s ease;
}
.side.open { transform: none; }
.side .brand { padding: 2px 8px 18px; border-bottom: 1px solid #2b3036; margin-bottom: 14px; }
.mainnav { display: flex; flex-direction: column; gap: 2px; }
.mainnav a {
  display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: var(--radius);
  color: #c4cbd3; font-weight: 500;
}
.mainnav a:hover { background: #22272d; color: #fff; text-decoration: none; }
.mainnav a.on { background: #fff; color: var(--ink); font-weight: 650; }
.quick { margin-top: 18px; display: grid; gap: 8px; }
.quick .btn:not(.primary) { background: transparent; color: #e9edf1; border-color: #3a4048; }
.quick .btn:not(.primary):hover { background: #22272d; }
.me { margin-top: auto; display: flex; align-items: center; gap: 6px; border-top: 1px solid #2b3036; padding-top: 14px; }
.me > a { flex: 1; display: flex; gap: .6rem; align-items: center; color: inherit; padding: 4px; border-radius: var(--radius); min-width: 0; }
.me > a:hover { background: #22272d; text-decoration: none; }
.me strong { display: block; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me small { display: block; font-size: .76rem; color: #98a1ab; }
.me .linklike { color: #98a1ab; padding: 8px; }
.me .linklike:hover { color: #fff; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #2b3036; display: grid; place-items: center; font-weight: 700; flex: none; }
.scrim { display: none; }
.scrim.on { display: block; position: fixed; inset: 0; background: rgba(10, 12, 15, .45); z-index: 25; }

.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  background: var(--paper); border-bottom: 1px solid var(--line); padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top));
}
.iconbtn { background: none; border: 0; color: var(--ink); padding: 8px; display: grid; place-items: center; border-radius: var(--radius); cursor: pointer; }
.iconbtn:hover { background: var(--line-2); }
.main { padding: 18px 14px 110px; max-width: 1280px; margin: 0 auto; }

.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: var(--paper); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav > a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .7rem; color: var(--ink-2); padding: 8px 0; }
.bottomnav > a:hover { text-decoration: none; color: var(--ink); }
.fab { position: relative; justify-self: center; }
.fab summary { list-style: none; width: 50px; height: 50px; margin-top: -18px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 0 0 4px var(--paper); }
.fab summary::-webkit-details-marker { display: none; }
.fab[open] summary { background: var(--cyan); }
.fabmenu { position: absolute; bottom: 64px; left: 50%; transform: translateX(-50%); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 6px; width: 220px; box-shadow: 0 10px 30px rgba(22, 25, 29, .18); }
.fabmenu a { display: flex; gap: .6rem; align-items: center; padding: .65rem .7rem; color: var(--ink); border-radius: var(--radius); font-weight: 550; }
.fabmenu a:hover { background: var(--line-2); text-decoration: none; }

@media (min-width: 960px) {
  .side { transform: none; }
  .shell { padding-left: 252px; }
  .topbar, .bottomnav, .scrim.on { display: none; }
  .main { padding: 28px 32px 60px; }
}

/* ---------- Page head ---------- */
.pagehead { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.pagehead h1 { margin: 0; }
.pagehead p { margin: .2rem 0 0; }
.pagehead .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.crumb { font-size: .85rem; color: var(--ink-3); margin-bottom: 4px; display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font: inherit; font-weight: 600; font-size: .92rem; line-height: 1;
  padding: .7rem 1rem; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--paper); color: var(--ink); cursor: pointer; text-decoration: none; min-height: 42px;
}
.btn:hover { text-decoration: none; border-color: var(--ink-3); }
.btn .ic { width: 18px; height: 18px; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #2b3036; }
.btn.cyan { background: var(--cyan); border-color: var(--cyan); color: #fff; }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.danger { color: var(--red); border-color: #efc2c4; }
.btn.small { min-height: 34px; padding: .45rem .7rem; font-size: .85rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: progress; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--cyan); cursor: pointer; display: inline-flex; align-items: center; }
.linklike.danger { color: var(--red); }
.linklike.small { font-size: .8rem; }
form.inline { display: inline; }

/* ---------- Panels ---------- */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 18px; margin-bottom: 16px; }
.panel > h2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush > h2 { padding: 16px 18px 0; }
.cols { display: grid; gap: 16px; }
@media (max-width: 1079px) { .cols > .actiongrid { order: -1; } }
@media (min-width: 1080px) { .cols { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; } }

/* ---------- Badges: a small ink swatch plus label ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap;
  font-size: .78rem; font-weight: 600; line-height: 1; padding: .32rem .5rem; border-radius: 4px;
  background: var(--line-2); color: var(--ink-2);
}
.badge::before { content: ""; width: 7px; height: 7px; background: currentColor; flex: none; }
.tone-cyan { background: var(--cyan-tint); color: #00597c; }
.tone-cyan::before { background: var(--cyan); }
.tone-magenta { background: var(--magenta-tint); color: #8a0f54; }
.tone-magenta::before { background: var(--magenta); }
.tone-yellow { background: var(--yellow-tint); color: var(--yellow-ink); }
.tone-yellow::before { background: var(--yellow); }
.tone-green { background: var(--green-tint); color: #145e35; }
.tone-green::before { background: var(--green); }
.tone-red { background: var(--red-tint); color: #8f1b20; }
.tone-red::before { background: var(--red); }
.tone-key { background: #e4e7eb; color: var(--ink); }
.tone-key::before { background: var(--ink); }
.tone-muted { background: transparent; color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--line); }
.tone-muted::before { background: var(--line); }

/* ---------- Flash ---------- */
.flash { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 14px; background: var(--green-tint); color: #145e35; border-left: 4px solid var(--green); }
.flash.error { background: var(--red-tint); color: #8f1b20; border-left-color: var(--red); }
.flash.warn { background: var(--yellow-tint); color: var(--yellow-ink); border-left-color: var(--yellow); }

/* ---------- Ink-level counters (dashboard) ---------- */
.levels { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
@media (min-width: 720px) { .levels { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .levels { grid-template-columns: repeat(6, 1fr); } }
.level {
  position: relative; display: block; background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
  padding: 14px 14px 12px 20px; color: var(--ink); overflow: hidden;
}
.level:hover { text-decoration: none; border-color: var(--ink-3); }
.level::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--tone, var(--ink)); }
.level b { display: block; font-size: 2.1rem; font-weight: 750; font-stretch: 80%; line-height: 1; }
.level span { display: block; font-size: .85rem; color: var(--ink-2); margin-top: 6px; line-height: 1.3; }
.level.c { --tone: var(--cyan); } .level.m { --tone: var(--magenta); } .level.y { --tone: var(--yellow); }
.level.k { --tone: var(--ink); } .level.g { --tone: var(--green); } .level.r { --tone: var(--red); }
.level.zero b { color: var(--ink-3); }

/* ---------- Tables ---------- */
.tablewrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th { text-align: left; font-weight: 600; color: var(--ink-3); font-size: .8rem; padding: .6rem .75rem; border-bottom: 1px solid var(--line); white-space: nowrap; background: #f8f9fa; }
table.data td { padding: .7rem .75rem; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #f8fafb; }
table.data .sub { display: block; color: var(--ink-3); font-size: .8rem; }
tr.mine td:first-child { box-shadow: inset 4px 0 0 var(--cyan); }
.you { font-size: .7rem; font-weight: 700; color: var(--cyan); background: var(--cyan-tint); padding: .1rem .35rem; border-radius: 3px; margin-left: .3rem; }
.stale { color: var(--red); font-weight: 600; }

/* On phones, rows become stacked cards */
@media (max-width: 760px) {
  table.data.stack thead { display: none; }
  table.data.stack, table.data.stack tbody, table.data.stack tr, table.data.stack td { display: block; width: 100%; }
  table.data.stack tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  table.data.stack td { padding: 2px 0; border: 0; }
  table.data.stack td[data-label]::before { content: attr(data-label) ": "; color: var(--ink-3); font-size: .8rem; }
  table.data.stack td.hide-sm { display: none; }
  tr.mine td:first-child { box-shadow: none; }
  tr.mine { box-shadow: inset 4px 0 0 var(--cyan); }
}

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-bottom: 14px; }
.filters input, .filters select { min-width: 0; }
.filters .grow { flex: 1 1 240px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chips a { padding: .38rem .7rem; border: 1px solid var(--line); border-radius: 999px; font-size: .85rem; color: var(--ink-2); background: var(--paper); }
.chips a:hover { text-decoration: none; border-color: var(--ink-3); }
.chips a.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chips a em { font-style: normal; opacity: .65; margin-left: .25rem; }
@media (max-width: 760px) {
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px 12px; padding: 0 14px 4px; scrollbar-width: none; }
  .chips a { white-space: nowrap; }
  .filters select { flex: 1 1 40%; }
  .pagehead .actions { width: 100%; }
  .pagehead .actions .btn { flex: 1; }
}

/* ---------- Forms ---------- */
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .6rem .7rem; width: 100%; min-height: 42px;
}
textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--cyan); outline-offset: 0; border-color: var(--cyan); }
input[type=file] { padding: .45rem; background: #f8f9fa; }
.form label { display: block; font-weight: 600; font-size: .88rem; color: var(--ink-2); margin-bottom: 12px; }
.form label > input, .form label > select, .form label > textarea { margin-top: 5px; font-weight: 400; }
.form label small { display: block; font-weight: 400; color: var(--ink-3); margin-top: 3px; }
.form fieldset { border: 0; padding: 0; margin: 0 0 18px; }
.form legend { font-weight: 700; font-stretch: 85%; font-size: 1.05rem; padding: 0; margin-bottom: 10px; }
.grid2, .grid3 { display: grid; gap: 0 14px; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .grid3 { grid-template-columns: 1fr 1fr 1fr; } }
.span2 { grid-column: 1 / -1; }
.formbar { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 6px; }
.req::after { content: " *"; color: var(--red); }
.hint { font-size: .85rem; color: var(--ink-3); }
.pick { display: flex; gap: 8px; align-items: flex-end; }
.pick select { flex: 1; }
.dropzone { border: 1.5px dashed var(--line); border-radius: 8px; padding: 12px; background: #fafbfc; margin-bottom: 10px; }
.dropzone .btn { margin-top: 8px; }
.dropzone .status { font-size: .85rem; color: var(--ink-3); margin-top: 6px; min-height: 1.2em; }

/* ---------- Details / facts ---------- */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px 20px; margin: 0; }
.facts div { min-width: 0; }
.facts dt { font-size: .8rem; color: var(--ink-3); }
.facts dd { margin: 2px 0 0; font-weight: 550; overflow-wrap: anywhere; }
.facts .wide { grid-column: 1 / -1; }
.facts dd.text { font-weight: 400; white-space: normal; }
.serial { font-stretch: 80%; font-weight: 750; font-size: 1.05rem; letter-spacing: .04em; }

/* ---------- Job progress strip ---------- */
.strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; margin: 4px 0 18px; }
.strip li { list-style: none; position: relative; padding-top: 12px; font-size: .78rem; color: var(--ink-3); line-height: 1.25; }
.strip li::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 6px; background: var(--line); border-radius: 1px; }
.strip li.done { color: var(--ink); }
.strip li.done::before { background: var(--tone); }
.strip li.now { color: var(--ink); font-weight: 700; }
.strip li.now::before { background: var(--tone); }
.strip li:nth-child(1) { --tone: var(--ink); } .strip li:nth-child(2) { --tone: var(--cyan); }
.strip li:nth-child(3) { --tone: var(--magenta); } .strip li:nth-child(4) { --tone: var(--yellow); }
.strip li:nth-child(5) { --tone: var(--green); }
.strip small { display: block; font-weight: 400; color: var(--ink-3); }
.strip { padding: 0; }

.statusline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 10px 0 10px 16px; border-left: 2px solid var(--line); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 15px; width: 8px; height: 8px; background: var(--ink); }
.timeline .when { font-size: .78rem; color: var(--ink-3); }
.timeline .what p { margin: 4px 0 0; color: var(--ink-2); font-size: .9rem; white-space: normal; }

/* ---------- Files ---------- */
.files { list-style: none; padding: 0; margin: 0 0 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.files li { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fafbfc; display: flex; flex-direction: column; }
.files .thumb { display: block; aspect-ratio: 4 / 3; background: #e9ecef; }
.files .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.files .doc { aspect-ratio: 4 / 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--magenta); font-weight: 700; font-size: .8rem; }
.files .doc .ic { width: 34px; height: 34px; }
.files .meta { padding: 6px 8px; font-size: .8rem; line-height: 1.3; }
.files .meta a { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); font-weight: 600; }
.files .meta small { display: block; color: var(--ink-3); }

/* ---------- Lists ---------- */
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--line-2); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.list li:last-child { border-bottom: 0; }
.list li > a { color: var(--ink); font-weight: 550; }
.list li .right { margin-left: auto; }

.empty { text-align: center; padding: 36px 16px; color: var(--ink-2); }
.empty p { margin-bottom: 14px; }

.pager { display: flex; gap: 14px; justify-content: center; align-items: center; padding: 14px; font-size: .9rem; color: var(--ink-3); }

/* ---------- Auth / setup ---------- */
.bare { display: grid; place-items: start center; padding: 8vh 16px; min-height: 100vh; }
.authbox { width: 100%; max-width: 400px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 28px; }
.authbox.wide { max-width: 720px; }
.authbox .brand { margin-bottom: 22px; }
.authbox h1 { font-size: 1.4rem; }
textarea.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .82rem; }

/* ---------- Quick tabs inside panels ---------- */
.actiongrid { display: grid; gap: 10px; }
details.act { border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
details.act > summary { cursor: pointer; padding: 12px 14px; font-weight: 650; display: flex; align-items: center; gap: .55rem; list-style: none; }
details.act > summary::-webkit-details-marker { display: none; }
details.act > summary::after { content: "+"; margin-left: auto; font-size: 1.2rem; color: var(--ink-3); }
details.act[open] > summary::after { content: "\2212"; }
details.act > .body { padding: 0 14px 14px; }
details.act > summary .ic { color: var(--ink-3); }

/* ---------- Print: job card ---------- */
.printcard { max-width: 800px; margin: 0 auto; background: #fff; padding: 32px; }
.printcard table { width: 100%; border-collapse: collapse; margin-bottom: 14px; font-size: .9rem; }
.printcard th, .printcard td { border: 1px solid #bbb; padding: 6px 8px; text-align: left; vertical-align: top; }
.printcard th { width: 30%; background: #f3f4f6; font-weight: 600; }
.printcard .sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 46px; }
.printcard .sign div { border-top: 1px solid #333; padding-top: 6px; font-size: .85rem; }
.printhead { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 3px solid var(--ink); padding-bottom: 12px; margin-bottom: 18px; }
.noprint { margin: 16px auto; max-width: 800px; display: flex; gap: 8px; }
@media print {
  body { background: #fff; }
  .noprint { display: none; }
  .printcard { padding: 0; }
  .bare { display: block; padding: 0; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Customer type switch and checkboxes ---------- */
.segmented { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 8px; padding: 3px; gap: 3px; margin-bottom: 14px; background: var(--paper); }
.segmented label { display: flex; align-items: center; gap: .45rem; margin: 0; padding: .5rem .85rem; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.segmented input { width: auto; min-height: 0; margin: 0; accent-color: var(--ink); }
.segmented label:has(input:checked) { background: var(--ink); color: var(--on-ink, #fff); }
.form label.check { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: start; font-weight: 600; }
.form label.check input { width: 18px; height: 18px; min-height: 0; margin: 2px 0 0; accent-color: var(--ink); }
.form label.check small { grid-column: 2; }
@media (max-width: 719px) { .level:last-child:nth-child(odd) { grid-column: 1 / -1; } }
@media (min-width: 720px) and (max-width: 1199px) { .levels { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1200px) { .levels { grid-template-columns: repeat(7, 1fr); } }
[hidden] { display: none !important; }
/* Keep the required-field asterisk beside the label text */
.form label.req { display: grid; grid-template-columns: max-content 1fr; column-gap: 3px; }
.form label.req > input, .form label.req > select, .form label.req > textarea, .form label.req > small { grid-column: 1 / -1; }
.form label.req::after { grid-row: 1; grid-column: 2; }

/* =====================================================================
   Ivory Computers brand layer
   Ivory Blue (#05AFE9) from the logo oval, black from its rim, and the
   off-white paper the logo is designed to sit on. Bold italic echoes the
   logo lettering; condensed heavy type for headings and job numbers.
   ===================================================================== */
:root {
  --ivory-blue: #05AFE9;    /* sampled from the Ivory logo file */
  --blue-hover: #36C0EE;
  --blue-ink: #0A6E9C;      /* Ivory Blue darkened for readable text and links */
  --blue-tint: #E2F4FC;
  --bg: #F7F4EC;            /* paper */
  --paper: #FFFFFF;
  --ink: #231F20;           /* the logo's black */
  --ink-2: #3D3A3B;
  --ink-3: #6A707A;
  --line: #DCD7CB;
  --line-2: #EDE9E0;
  --cyan: #1C9BD3;
  --cyan-tint: var(--blue-tint);
  --side: #FFFFFF;
}
a { color: var(--blue-ink); }
:focus-visible { outline-color: var(--ivory-blue); }
h1 { font-stretch: 75%; font-weight: 800; letter-spacing: -.005em; }
h2 { font-stretch: 80%; font-weight: 750; }
input:focus, select:focus, textarea:focus { outline-color: var(--ivory-blue); border-color: var(--ivory-blue); }

/* Logo lockup: oval logo + bold italic "Service Desk" */
.lockup { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.lockup .logo { height: 42px; width: auto; display: block; flex: none; }
.lockup .wordmark strong { display: block; font-weight: 800; font-style: italic; font-stretch: 88%; font-size: 1.12rem; letter-spacing: -.01em; line-height: 1.1; }
.lockup .wordmark small { display: block; font-size: .74rem; color: var(--ink-3); margin-top: 1px; }
.lockup-small .logo { height: 28px; }
.lockup-small .wordmark strong { font-size: 1rem; }
.lockup-big .logo { height: 62px; }
.lockup-big .wordmark strong { font-size: 1.55rem; }
.lockup-big .wordmark small { font-size: .85rem; }
.brand { padding: 0; }

/* Light sidebar so the logo sits on white, as the brand intends */
.side { background: var(--paper); color: var(--ink); border-right: 1px solid var(--line); }
.side .brand { padding: 2px 6px 18px; border-bottom: 1px solid var(--line); }
.mainnav a { color: var(--ink-2); }
.mainnav a:hover { background: var(--line-2); color: var(--ink); }
.mainnav a.on { background: var(--blue-tint); color: var(--ink); font-weight: 700; }
.mainnav a.on .ic { color: var(--blue-ink); }
.quick .btn:not(.primary) { background: var(--paper); color: var(--ink); border-color: var(--line); }
.quick .btn:not(.primary):hover { background: var(--line-2); }
.me { border-top: 1px solid var(--line); }
.me > a:hover { background: var(--line-2); }
.me small { color: var(--ink-3); }
.me .linklike { color: var(--ink-3); }
.me .linklike:hover { color: var(--ink); }
.avatar { background: var(--ivory-blue); color: #FFFFFF; font-style: italic; border: 1.5px solid var(--ink); }

/* Buttons take the logo's shape: an oval pill with a black rim */
.btn { border-radius: 999px; padding: .7rem 1.15rem; }
.btn.small { padding: .45rem .85rem; }
.btn.primary { background: var(--ivory-blue); border: 1.5px solid var(--ink); color: var(--ink); font-weight: 700; }
.btn.primary:hover { background: var(--blue-hover); border-color: var(--ink); }
.btn.green { border: 1.5px solid var(--ink); }
.fab summary { background: var(--ivory-blue); color: var(--ink); border: 2px solid var(--ink); box-shadow: 0 0 0 4px var(--paper); }
.fab[open] summary { background: var(--ink); color: #FFFFFF; }

/* Status colours: Ivory Blue for work in progress */
.tone-cyan { background: var(--blue-tint); color: var(--blue-ink); }
.tone-cyan::before { background: var(--ivory-blue); }
.level.c { --tone: var(--ivory-blue); }
.strip li:nth-child(2) { --tone: var(--ivory-blue); }
tr.mine td:first-child { box-shadow: inset 4px 0 0 var(--ivory-blue); }
@media (max-width: 760px) { tr.mine { box-shadow: inset 4px 0 0 var(--ivory-blue); } }
.you { color: var(--blue-ink); background: var(--blue-tint); }
.timeline li::before { background: var(--ivory-blue); outline: 1.5px solid var(--ink); }
.segmented label:has(input:checked) { background: var(--ivory-blue); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.segmented input, .form label.check input { accent-color: var(--blue-ink); }

/* Sign-in page */
.bare { background: var(--bg); }
.authbox { border-color: var(--line); }
.authfoot { text-align: center; color: var(--ink-3); font-size: .82rem; margin-top: 22px; max-width: 420px; }
.authfoot p { margin: 0 0 4px; }
.authfoot .tagline { font-style: italic; font-weight: 800; font-stretch: 88%; color: var(--ink); font-size: 1.05rem; margin-bottom: 8px; }

/* Job card header */
.printhead { border-bottom: 4px solid var(--ivory-blue); }
.printbrand { display: flex; gap: 14px; align-items: center; }
.printbrand .logo { height: 64px; width: auto; }
.printbrand strong { display: block; font-size: 1.15rem; font-stretch: 85%; font-weight: 800; }
.printbrand em { display: block; font-weight: 700; font-size: .88rem; }
.printbrand small { display: block; font-size: .78rem; color: var(--ink-3); margin-top: 3px; }
.lockup .wordmark strong, .lockup .wordmark small { white-space: nowrap; }
.lockup-side .logo { height: 40px; }
.lockup-side .wordmark strong { font-size: 1.05rem; }
.authfoot .nb { white-space: nowrap; }

/* Filters sit in one row on wide screens */
.filters input.grow { width: auto; flex: 1 1 260px; }
.filters select { width: auto; flex: 0 1 210px; }
@media (max-width: 760px) { .filters select { flex: 1 1 40%; } }

/* Real logo is a tilted oval: give it room and stack the wordmark under it */
.lockup-side, .lockup-big { flex-direction: column; align-items: flex-start; gap: 6px; }
.lockup-side .logo { height: 64px; margin-left: -4px; }
.lockup-big .logo { height: 86px; margin-left: -6px; }
.lockup-small .logo { height: 36px; }
.side .brand { padding-bottom: 14px; }

/* Badges in any colour chosen under Settings > Lists */
.badge.hex { background: color-mix(in srgb, var(--c) 13%, #FFFFFF); color: color-mix(in srgb, var(--c) 72%, #000000); }
.badge.hex::before { background: var(--c); }
/* WhatsApp chat link next to mobile numbers */
a.wa { display: inline-flex; vertical-align: -3px; color: #128C3E; margin-left: 2px; }
a.wa .ic { width: 17px; height: 17px; }
a.wa:hover { color: #075E2B; }

/* ---------- Settings ---------- */
.cardgrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.setcard { display: flex; gap: 14px; align-items: flex-start; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 16px; color: var(--ink); }
.setcard:hover { text-decoration: none; border-color: var(--ink); }
.setcard strong { display: block; font-size: 1rem; }
.setcard small { display: block; color: var(--ink-3); margin-top: 2px; line-height: 1.35; }
.setcard em { display: block; font-style: normal; font-size: .8rem; color: var(--blue-ink); font-weight: 600; margin-top: 6px; }
.seticon { width: 40px; height: 40px; border-radius: 50%; background: var(--blue-tint); display: grid; place-items: center; flex: none; color: var(--blue-ink); }
.permgrid { display: grid; gap: 4px 20px; margin-top: 10px; }
@media (min-width: 760px) { .permgrid { grid-template-columns: 1fr 1fr; } }
.colorpick { display: inline-flex; align-items: center; gap: 8px; }
.colorpick input[type=color] { width: 40px; min-height: 34px; padding: 2px; }
.list.padded li { padding-left: 18px; padding-right: 18px; }
.list li.off { opacity: .6; }
.rowactions { display: inline-flex; gap: 12px; align-items: center; font-size: .85rem; }
.pickmap { height: 280px; border-radius: 8px; border: 1px solid var(--line); margin-bottom: 12px; z-index: 0; }
fieldset.days { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px; }
fieldset.days legend { font-weight: 600; color: var(--ink-2); margin-bottom: 6px; width: 100%; }
.daychip { display: inline-flex !important; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: .35rem .7rem; margin: 0 !important; cursor: pointer; font-weight: 600; }
.daychip input { width: auto; min-height: 0; accent-color: var(--blue-ink); }
.daychip:has(input:checked) { background: var(--blue-tint); border-color: var(--ivory-blue); }
.lockrow { display: inline-flex; align-items: center; gap: 5px; }
.lockrow .ic { width: 15px; height: 15px; color: var(--ink-3); }
.staffnote { background: #FFF8E1; border: 1px dashed #E2C46A; border-radius: 6px; padding: 8px 10px; }
.varchips { display: flex; flex-direction: column; gap: 6px; margin: -4px 0 14px; }
.varchips span { display: flex; flex-wrap: wrap; gap: 6px; }
.chipbtn { font: inherit; font-size: .78rem; font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--blue-tint); color: var(--blue-ink); border: 1px solid #BFE4F5; border-radius: 999px; padding: .25rem .55rem; cursor: pointer; }
.chipbtn:hover { border-color: var(--blue-ink); }

/* ---------- Attendance ---------- */
.attcard { border-left: 5px solid var(--ivory-blue); }
.atthead { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.atthead h2 { margin: 0; }
.atthead p { margin: 2px 0 0; }
.atthead .right { margin-left: auto; }
.atticon { width: 40px; height: 40px; border-radius: 50%; background: var(--blue-tint); color: var(--blue-ink); display: grid; place-items: center; flex: none; }
.attform { margin-top: 12px; }
.attform > input { margin-bottom: 10px; }
.attbtns { display: flex; flex-wrap: wrap; gap: 8px; }
.attbtns .btn { flex: 1 1 140px; }
.attstatus { margin: 8px 0 0; }
.small-levels { margin-bottom: 14px; }
@media (min-width: 1200px) { .small-levels { grid-template-columns: repeat(5, 1fr); } }
.filters label.small { font-weight: 600; color: var(--ink-3); display: flex; flex-direction: column; gap: 3px; }
.filters label.small input { width: auto; }

/* Printing reports and lists from the main app */
@media print {
  .side, .topbar, .bottomnav, .filters, .chips, .pagehead .actions, .attcard, .flash, .pager { display: none !important; }
  .shell { padding-left: 0 !important; }
  .main { padding: 0 !important; max-width: none; }
  .panel { border: 0; padding: 0; }
  table.data.stack thead { display: table-header-group !important; }
  table.data.stack, table.data.stack tbody { display: table !important; width: 100%; }
  table.data.stack tr { display: table-row !important; }
  table.data.stack td { display: table-cell !important; }
  table.data.stack td[data-label]::before { content: none !important; }
  a { color: inherit; text-decoration: none; }
}

/* ---------- Live location ---------- */
.livegrid { display: grid; gap: 14px; }
@media (min-width: 960px) { .livegrid { grid-template-columns: 340px 1fr; align-items: start; } }
.livelist { max-height: 70vh; overflow: auto; }
.livelist li { cursor: pointer; }
.livelist li.focus { background: var(--blue-tint); }
.livemap { height: 70vh; min-height: 380px; z-index: 0; border-radius: 8px; }
.pin { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font: 700 12px/1 Archivo, Arial, sans-serif; color: #FFFFFF; border: 2px solid #231F20; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.pin.on { background: #05AFE9; color: #231F20; }
.pin.off { background: #8A8F98; }

/* ---------- Overview: sections, stats and charts ---------- */
.levels { grid-template-columns: repeat(2, 1fr) !important; }
@media (min-width: 720px) { .levels { grid-template-columns: repeat(4, 1fr) !important; } }
.small-levels { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important; }
.level.v { --tone: #7A4FD0; }
.sectionhead { font-size: 1rem; color: var(--ink-2); margin: 6px 0 10px; }
.sectionhead .ic { width: 18px; height: 18px; }
.panel > h2 .ic { width: 18px; height: 18px; color: var(--blue-ink); vertical-align: -3px; }
.periodhead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 10px; }
.periodhead .chips { margin-bottom: 10px; }
.statrow { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
@media (min-width: 720px) { .statrow { grid-template-columns: repeat(auto-fit, minmax(124px, 1fr)); } }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.stat b { display: block; font-size: 1.7rem; font-weight: 800; font-stretch: 78%; line-height: 1.05; }
.stat span { display: block; font-size: .82rem; color: var(--ink-3); margin-top: 4px; line-height: 1.3; }

.chartwrap { position: relative; }
.colchart { width: 100%; height: 220px; display: block; overflow: visible; }
.colchart .grid { stroke: var(--line-2); stroke-width: 1; }
.colchart .axis { stroke: var(--line); stroke-width: 1; }
.colchart .tick { fill: var(--ink-3); font-size: 11px; font-family: var(--font); }
.colchart .bar { fill: var(--ivory-blue); }
.colchart .hit { fill: transparent; cursor: default; }
.colchart .hit:hover { fill: rgba(5, 175, 233, .08); }
.charttip { position: absolute; pointer-events: none; background: var(--ink); color: #FFFFFF; font-size: .8rem; padding: 5px 8px; border-radius: 5px; white-space: nowrap; transform: translate(-50%, -110%); z-index: 2; }

.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.hbars li { display: grid; grid-template-columns: minmax(110px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: .9rem; }
.hbars .hb-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbars .hb-label a { color: var(--ink); }
.hb-track { height: 10px; background: var(--line-2); border-radius: 5px; overflow: hidden; }
.hb-fill { display: block; height: 100%; background: var(--c); border-radius: 0 5px 5px 0; }
.hb-val { font-weight: 700; font-size: .85rem; text-align: right; white-space: nowrap; }

/* ---------- Team setup ---------- */
.teamsetup td { vertical-align: top; }
.teamsetup input:not([type=checkbox]), .teamsetup select { min-width: 150px; }
.teamsetup input[type=checkbox] { width: 20px; height: 20px; min-height: 0; accent-color: var(--blue-ink); }

/* ---------- Sidebar fits any screen height or zoom level ---------- */
.side { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.side > * { flex-shrink: 0; }
@media (max-height: 820px) {
  .side { padding-top: 14px; padding-bottom: 12px; }
  .side .brand { padding-bottom: 10px; margin-bottom: 8px; }
  .lockup-side .logo { height: 52px; }
  .mainnav a { padding-top: .42rem; padding-bottom: .42rem; }
  .quick { margin-top: 12px; gap: 6px; }
  .me { padding-top: 10px; }
}
@media (max-height: 640px) {
  .lockup-side .logo { height: 40px; }
  .lockup-side .wordmark small { display: none; }
  .mainnav a { padding-top: .32rem; padding-bottom: .32rem; font-size: .92rem; }
  .quick .btn { padding-top: .4rem; padding-bottom: .4rem; }
}
