/* ============================================================================
   Technaus Service Portal

   Built on the same design system as the WA Installation Planner, so the two
   internal tools read as one product: identical tokens, the navy sidebar
   shell, 18px cards, a right-hand drawer, and centred modals.

   The token block below is copied verbatim from the planner's styles.css.
   If that palette changes, change it here too.
   ========================================================================= */

:root{
  --navy:#10233e; --navy2:#183b65; --blue:#2563eb; --sky:#eaf2ff;
  --green:#18a06b; --greenbg:#eafaf3;
  --amber:#d97706; --amberbg:#fff7e8;
  --red:#dc2626;   --redbg:#fff0f0;
  --purple:#7c3aed;--purplebg:#f4efff;
  --ink:#142033; --muted:#68778d; --line:#dfe7f1; --bg:#f4f7fb; --card:#fff;
  --shadow:0 12px 35px rgba(19,44,79,.08);
}

*{box-sizing:border-box}
body{
  margin:0; background:var(--bg); color:var(--ink);
  font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
}
button,input,select,textarea{font:inherit}
button{cursor:pointer}
.hidden{display:none!important}
a{color:#1d4ed8}

/* ------------------------------------------------------------------ shell --- */
.app-shell{min-height:100vh;display:grid;grid-template-columns:232px 1fr}
.sidebar{
  position:fixed; inset:0 auto 0 0; width:232px; height:100dvh;
  background:linear-gradient(180deg,#0d2039 0%,#122f50 100%);
  padding:22px 14px; color:#fff; display:flex; flex-direction:column; z-index:20;
  overflow:hidden;
}
.brand{display:flex;flex-direction:column;align-items:flex-start;gap:7px;padding:3px 8px 22px;flex:0 0 auto}
.brand-logo{
  display:block; width:178px; height:auto; object-fit:contain;
  background:#fff; border-radius:10px; padding:7px 8px;
  box-shadow:0 8px 22px rgba(3,18,35,.18);
}
.brand span{color:#bad0e4;font-size:9px;font-weight:800;letter-spacing:.55px;text-transform:uppercase}

.sidebar nav{display:flex;flex-direction:column;gap:5px;flex:1 1 auto;min-height:0;overflow-y:auto}
.sidebar nav a{
  border:0; background:transparent; color:#b9cade; text-decoration:none;
  padding:11px 12px; border-radius:12px; display:flex; align-items:center; gap:10px;
  font-weight:600; font-size:14px;
}
.sidebar nav a span{font-size:17px;width:20px;text-align:center}
.sidebar nav a:hover,.sidebar nav a.active{color:#fff;background:rgba(255,255,255,.10)}
.sidebar nav a em{
  margin-left:auto; background:#ef4444; color:#fff; border-radius:20px;
  padding:1px 7px; font-style:normal; font-size:11px; font-weight:800;
}
.sidebar-foot{margin-top:auto;padding:12px 8px;flex:0 0 auto}
.free-chip{font-size:11px;color:#8ce2bb;margin-bottom:13px}
.user-chip{font-size:11px;color:#aec0d5;line-height:1.45;word-break:break-all}

main{grid-column:2;padding:0 26px 40px}
.topbar{height:92px;display:flex;align-items:center;justify-content:space-between;gap:16px}
.topbar h1{font-size:24px;margin:0;color:var(--navy)}
.topbar p{margin:5px 0 0;color:var(--muted);font-size:13px}
.top-actions{display:flex;align-items:center;gap:10px}
.scope-pill{
  background:#ecfdf5;color:#047857;border:1px solid #a7f3d0;padding:6px 10px;
  border-radius:20px;font-size:11px;font-weight:800;letter-spacing:.4px;
}
.scope-pill.demo{background:#fff7e8;color:#a45b06;border-color:#f4d3a0}

/* ---------------------------------------------------------------- buttons --- */
.primary,.secondary,.ghost,.danger,.success,.purple{border:0;border-radius:10px;padding:9px 13px;font-weight:700}
.primary{background:var(--blue);color:#fff;box-shadow:0 6px 16px rgba(37,99,235,.2)}
.secondary{background:#eaf0f7;color:var(--navy)}
.ghost{background:#fff;border:1px solid var(--line);color:#435269}
.danger{background:var(--redbg);color:var(--red)}
.success{background:var(--greenbg);color:#08734d}
.purple{background:var(--purplebg);color:var(--purple)}
button:disabled{opacity:.45;cursor:not-allowed}
.icon-btn{border:1px solid var(--line);background:#fff;border-radius:9px;padding:7px 10px}
.icon-btn.spin{animation:spin .7s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.icon-btn.spin{animation:none;opacity:.5}}

/* ------------------------------------------------------------------ stats --- */
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:12px;margin-bottom:18px}
.stat{
  background:#fff;border:1px solid var(--line);border-radius:16px;padding:14px 15px;
  box-shadow:0 5px 18px rgba(20,48,82,.04); text-align:left; width:100%;
}
.stat strong{display:block;font-size:23px;color:var(--navy);margin-bottom:3px}
.stat span{font-size:11px;color:var(--muted);font-weight:700}
.stat.attn{border-color:#fed7aa;background:#fffdfa}
.stat.attn strong{color:#b45309}
.stat.bad{border-color:#fecaca;background:#fffafa}
.stat.bad strong{color:var(--red)}
.stat.on{border-color:#8ab7ff;background:#f3f8ff;box-shadow:inset 0 0 0 1px #c9ddff}

/* ---------------------------------------------------------------- toolbar --- */
.toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px;flex-wrap:wrap}
.toolbar-left,.toolbar-right{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.toolbar input[type=search],.toolbar select,.toolbar input[type=date]{
  background:#fff;border:1px solid var(--line);padding:8px 11px;border-radius:10px;color:var(--navy);
}
.toolbar input[type=search]{min-width:280px}
.toolbar input:focus,.toolbar select:focus{outline:none;border-color:#8ab7ff;box-shadow:0 0 0 3px rgba(37,99,235,.12)}

.queue-tabs{display:flex;gap:5px;overflow:auto;margin:0}
.queue-tabs button{
  white-space:nowrap;border:1px solid var(--line);background:#fff;
  padding:7px 11px;border-radius:9px;font-size:11px;font-weight:800;color:#607188;
}
.queue-tabs button.active{background:var(--navy);color:#fff;border-color:var(--navy)}

/* ------------------------------------------------------------------ cards --- */
.card{background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow)}
.section-card{padding:18px;margin-bottom:16px}
.section-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px;gap:12px}
.section-head h3{margin:0;color:var(--navy);font-size:15px}
.section-head p{margin:4px 0 0;color:var(--muted);font-size:12px}
.empty{text-align:center;color:#8a98aa;padding:40px 15px}
.grid2{display:grid;grid-template-columns:repeat(2,1fr);gap:13px}
.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:13px}
.subtle{font-size:11px;color:var(--muted)}

/* -------------------------------------------------------------- job cards --- */
.group{margin-bottom:20px}
.group-head{
  display:flex;align-items:center;gap:9px;margin:0 0 10px;
  font-size:11px;font-weight:900;color:var(--muted);
  text-transform:uppercase;letter-spacing:.5px;
}
.group-head em{
  font-style:normal;letter-spacing:0;background:#eef3f8;color:#4d6076;
  border-radius:20px;padding:2px 8px;font-size:10px;
}
.group-head.hot{color:var(--red)}
.group-head.hot em{background:var(--redbg);color:var(--red)}
.group-head.now{color:var(--blue)}
.group-head.now em{background:var(--sky);color:var(--blue)}

.joblist{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:11px}

.job-card{
  border:1px solid var(--line);border-left:4px solid #91a5bd;border-radius:13px;
  padding:12px 13px;background:#fff;transition:.15s;
  display:flex;flex-direction:column;gap:6px;
}
.job-card:hover{transform:translateY(-1px);box-shadow:0 8px 18px rgba(20,48,82,.08)}
.job-card.p-Urgent{border-left-color:var(--red)}
.job-card.p-High{border-left-color:var(--amber)}
.job-card.p-Medium{border-left-color:#91a5bd}
.job-card.p-Low{border-left-color:#cfd9e5}
.job-card.done{opacity:.6}
.job-card.saving{opacity:.45;pointer-events:none}

.job-top{display:flex;align-items:baseline;justify-content:space-between;gap:10px}
.job-name{margin:0;font-size:14px;color:var(--navy);font-weight:800;line-height:1.25;background:none;border:0;padding:0;text-align:left}
.job-name:hover{color:var(--blue)}
.job-ref{font-size:10px;font-weight:900;color:#8a98aa;flex:0 0 auto}
.job-meta{font-size:11px;color:var(--muted);line-height:1.4}
.job-issue{font-size:12px;color:#3f5164;line-height:1.45}

.chips{display:flex;gap:5px;flex-wrap:wrap;margin-top:2px}
.chip{
  font-size:10px;font-weight:800;border-radius:20px;padding:4px 9px;
  background:#eef3f8;color:#4d6076;border:0;
}
button.chip{cursor:pointer}
button.chip:disabled{cursor:default;opacity:.7}
.chip.green{background:var(--greenbg);color:#08734d}
.chip.amber{background:var(--amberbg);color:#a45b06}
.chip.purple{background:var(--purplebg);color:var(--purple)}
.chip.red{background:var(--redbg);color:var(--red)}
.chip.blue{background:var(--sky);color:#1d4ed8}

.card-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px}
.card-actions .mini{
  flex:1 1 auto;min-height:36px;display:inline-flex;align-items:center;justify-content:center;
  border:1px solid var(--line);background:#fff;border-radius:9px;
  font-size:11px;font-weight:800;color:var(--navy);text-decoration:none;
}
.card-actions .mini:hover{background:#f5f9fd}
.card-actions .mini.call{background:var(--greenbg);border-color:#bce7d3;color:#08734d}
.card-actions .mini.text{background:var(--sky);border-color:#cfe1ff;color:#1d4ed8}

/* ----------------------------------------------------------------- drawer --- */
.drawer-backdrop{position:fixed;inset:0;background:rgba(11,25,43,.22);z-index:80;border:0}
.drawer{
  position:fixed;top:0;right:0;width:min(610px,94vw);height:100vh;background:#fff;
  z-index:81;box-shadow:-20px 0 50px rgba(13,32,57,.18);overflow:auto;
}
.drawer-head{
  position:sticky;top:0;background:rgba(255,255,255,.96);backdrop-filter:blur(10px);
  padding:19px 22px;border-bottom:1px solid var(--line);
  display:flex;justify-content:space-between;align-items:flex-start;gap:12px;z-index:2;
}
.drawer-head h2{margin:0;font-size:20px;color:var(--navy)}
.drawer-head p{margin:4px 0 0;color:var(--muted);font-size:12px}
.drawer-body{padding:20px 22px 40px}
.detail-block{border:1px solid var(--line);border-radius:14px;padding:13px;margin-bottom:12px}
/* Sentence case rather than tracked-out capitals. Capitals read slower,
   take more width, and are the commonest look of a generated interface. */
.detail-block h4{margin:0 0 9px;color:var(--navy);font-size:13px;font-weight:650}
.kv{display:grid;grid-template-columns:130px 1fr;gap:7px;font-size:12px;margin-bottom:6px}
.kv span:first-child{color:var(--muted)}
.spec-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(115px,1fr));gap:8px}
.spec-grid>div{background:#f8fafc;border:1px solid #edf2f7;border-radius:10px;padding:9px}
.spec-grid span{display:block;font-size:11px;color:#8290a1;font-weight:500}
.spec-grid b{display:block;font-size:11px;margin-top:3px;color:#26394f}

.trail{list-style:none;margin:0;padding:0}
.trail li{border-left:2px solid var(--line);padding:0 0 15px 15px;position:relative;font-size:12px}
.trail li:last-child{padding-bottom:0}
.trail li::before{content:"";position:absolute;left:-5px;top:5px;width:8px;height:8px;border-radius:50%;background:var(--blue)}
.trail li.t-sms::before,.trail li.t-email::before{background:var(--green)}
.trail li.t-created::before{background:var(--amber)}
.trail-meta{font-size:10px;color:#8290a2;font-weight:800}
.trail-what{margin-top:2px;color:#4b5f76;word-break:break-word}

/* ------------------------------------------------------------------ modal --- */
.modal-backdrop{position:fixed;inset:0;background:rgba(10,25,44,.42);z-index:100;display:grid;place-items:center;padding:24px}
.modal{width:min(620px,96vw);max-height:92vh;overflow:auto;background:#fff;border-radius:19px;box-shadow:0 25px 70px rgba(9,26,48,.28)}
.modal.narrow{width:min(430px,96vw)}
.modal-head{padding:18px 20px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;gap:12px}
.modal-head h3{margin:0;color:var(--navy);font-size:16px}
.modal-body{padding:18px 20px}
.modal-foot{padding:14px 20px;border-top:1px solid var(--line);display:flex;justify-content:flex-end;gap:8px}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.form-group{margin-bottom:12px}
.form-group label{display:block;font-size:12px;font-weight:600;color:#3d4f63;margin:0 0 5px}
.form-group input,.form-group select,.form-group textarea{
  width:100%;border:1px solid #ccd8e5;border-radius:9px;padding:10px;background:#fff;color:var(--ink);
}
.form-group textarea{min-height:78px;resize:vertical}
.form-group input:focus,.form-group select:focus,.form-group textarea:focus{
  outline:none;border-color:#8ab7ff;box-shadow:0 0 0 3px rgba(37,99,235,.12);
}
.full{grid-column:1/-1}
.pickrow{display:flex;gap:6px;flex-wrap:wrap}
.pick{
  flex:1 1 auto;border:1px solid var(--line);background:#fff;border-radius:9px;
  padding:9px 12px;font-size:12px;font-weight:800;color:#607188;
}
.pick.on{background:var(--sky);border-color:#8ab7ff;color:#1d4ed8}
.optlist{display:grid;gap:7px}
.optrow{
  width:100%;text-align:left;border:1px solid var(--line);background:#fff;
  border-radius:11px;padding:12px 14px;font-size:14px;font-weight:700;color:var(--ink);
}
.optrow small{display:block;font-size:11px;font-weight:500;color:var(--muted);margin-top:2px}
.optrow.on{border-color:#8ab7ff;background:var(--sky);color:#1d4ed8}
.error-text{color:var(--red);font-size:12px;margin-top:10px}
.close-x{border:1px solid var(--line);background:#fff;border-radius:9px;width:32px;height:32px;flex:0 0 auto;font-size:15px;line-height:1}

/* --------------------------------------------------------- CRM type-ahead --- */
.lookup{position:relative}
.lookup-results{
  position:absolute;left:0;right:0;top:calc(100% + 4px);z-index:5;background:#fff;
  border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow);
  max-height:270px;overflow:auto;
}
.lookup-hit{display:block;width:100%;text-align:left;padding:11px 13px;border:0;border-bottom:1px solid var(--line);background:#fff}
.lookup-hit:last-child{border-bottom:0}
.lookup-hit:hover{background:#f7fbff}
.lookup-hit b{display:block;font-size:13px;color:var(--navy)}
.lookup-hit span{display:block;font-size:11px;color:var(--muted);margin-top:2px}
.lookup-hit em{display:inline-block;margin-top:5px;font-style:normal;font-size:9px;font-weight:900;background:#eef3f8;color:#4d6076;border-radius:8px;padding:2px 7px}
.lookup-note{padding:12px 13px;font-size:12px;color:var(--muted)}

.linked{margin-top:12px;border:1px solid #cfe2ff;background:#f7fbff;border-radius:13px;padding:13px}
.linked-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.linked-head b{font-size:13px;color:var(--navy)}
.linked-sub{font-size:11px;color:var(--muted);margin-top:2px}
.linked-note{font-size:11px;color:var(--muted);margin-top:8px}
.linked-sales{display:grid;gap:7px;margin-top:10px}
.sale-pick{text-align:left;border:1px solid var(--line);background:#fff;border-radius:11px;padding:10px 11px}
.sale-pick.on{border-color:#8ab7ff;box-shadow:0 0 0 2px rgba(37,99,235,.15)}
.sale-pick b{display:block;font-size:12px;color:var(--navy)}
.sale-pick span{display:block;font-size:11px;color:var(--muted);margin-top:2px}
.sale-pick .sale-date{font-weight:900;color:var(--blue)}
.sale-pick em{display:block;font-style:normal;font-size:10px;color:var(--muted);margin-top:3px}

/* --------------------------------------------------------------- schedule --- */
.planner-layout{display:grid;grid-template-columns:300px minmax(650px,1fr);gap:16px;align-items:start}
/* The tray holds every job without a date — 70-odd of them — so it has to
   scroll on its own rather than running off the bottom of the page. */
.queue{
  padding:14px;
  max-height:calc(100vh - 190px);
  overflow-y:auto;
  overflow-x:hidden;
  position:sticky;
  top:16px;
}
.queue h3{margin:0;color:var(--navy);font-size:14px}
.queue-count{font-size:11px;color:var(--muted);margin:3px 0 12px}
.queue-list{display:flex;flex-direction:column;gap:8px;min-height:70px;border-radius:10px}

.calendar-wrap{overflow:auto;border-radius:18px}
.calendar{min-width:900px}
.cal-head,.cal-row{display:grid;grid-template-columns:repeat(7,minmax(128px,1fr))}
.cal-head>div{background:#f9fbfd;padding:11px;border-bottom:1px solid var(--line);font-size:11px;color:var(--muted);font-weight:800;text-align:center}
.cal-head>div.today{color:var(--blue)}
.cal-head>div em{font-style:normal;display:block;font-size:9px;margin-top:2px;color:#8a98aa}
.cal-row>div{min-height:170px;border-bottom:1px solid var(--line);border-right:1px solid var(--line);padding:8px;background:#fff}
.cal-row>div:last-child{border-right:0}
.cal-row>div.past{background:#fbfcfd}
.cal-row>div.today{background:#fbfdff;box-shadow:inset 0 3px 0 var(--blue)}
.cal-row>div.dragover{background:#edf7ff;outline:2px dashed #60a5fa;outline-offset:-4px}

.booking{
  border-radius:10px;background:#eff6ff;border:1px solid #cfe1ff;padding:8px;
  margin-bottom:6px;font-size:10px;cursor:grab;
}
.booking:active{cursor:grabbing}
.booking.dragging{opacity:.4}
.booking.p-Urgent{border-color:#f5aaaa;background:#fff5f5}
.booking.p-High{border-color:#f4d3a0;background:#fffaf0}
.booking.late{border-color:#f5aaaa;background:#fff0f0}
.booking b{display:block;font-size:11px;color:var(--navy);line-height:1.3}
.booking .b-meta{color:var(--muted);margin-top:2px;line-height:1.35}
.booking .b-tech{display:inline-block;margin-top:4px;background:#eef3f8;color:#4d6076;border-radius:7px;padding:2px 6px;font-weight:800;font-size:9px}
.booking-actions{display:flex;gap:4px;margin-top:6px}
.booking-actions button,.booking-actions a{
  flex:1;border:1px solid var(--line);background:#fff;border-radius:7px;
  padding:6px;font-size:9px;font-weight:800;color:var(--navy);text-decoration:none;text-align:center;
}

/* ------------------------------------------------------------------ table --- */
table.list{width:100%;border-collapse:collapse}
table.list th{
  background:#f8fafc;color:#53657a;text-transform:uppercase;font-size:9px;
  letter-spacing:.3px;text-align:left;padding:10px;border-bottom:1px solid var(--line);
}
table.list td{font-size:12px;padding:11px 10px;border-bottom:1px solid #edf1f5;vertical-align:top}
table.list tr:last-child td{border-bottom:0}
table.list td.n,table.list th.n{text-align:right;width:88px}
table.list td.n.hot{color:var(--red);font-weight:900}
table.list td.strong{font-weight:800;color:var(--navy)}

/* ------------------------------------------------------------------ login --- */
.login-screen{
  min-height:100vh;display:grid;place-items:center;padding:24px;
  background:radial-gradient(circle at 20% 10%,#d9edff,transparent 40%),linear-gradient(135deg,#eef5fc,#f9fbfe);
}
.login-card{
  width:380px;max-width:100%;background:#fff;border:1px solid var(--line);border-top:4px solid #1488d4;
  border-radius:22px;padding:34px;text-align:center;box-shadow:0 25px 70px rgba(30,64,100,.12);
}
.login-logo{display:block;width:min(310px,82%);height:auto;margin:0 auto 18px}
.login-card h1{margin:6px 0 4px;color:var(--navy);font-size:22px}
.login-card p{color:var(--muted);margin:0 0 22px;font-size:13px}
.login-card .form-group{text-align:left}
.login-card .primary{width:100%;padding:12px}
.hint{font-size:11px;color:var(--muted);line-height:1.5;margin:12px 0 0}

/* ------------------------------------------------------------------ toast --- */
#toast{position:fixed;top:18px;right:24px;z-index:200}
.toast{background:#10233e;color:#fff;padding:11px 14px;border-radius:11px;box-shadow:var(--shadow);font-size:12px;margin-bottom:8px;font-weight:700}
.toast.error{background:#991b1b}
.toast.success{background:#067647}

.skeleton{
  height:120px;border-radius:13px;background:#fff;border:1px solid var(--line);
  background-image:linear-gradient(100deg,transparent 30%,rgba(37,99,235,.06) 50%,transparent 70%);
  background-size:220% 100%;animation:shimmer 1.2s linear infinite;
}
@keyframes shimmer{to{background-position:-220% 0}}
@media(prefers-reduced-motion:reduce){.skeleton{animation:none}}

.role-badge{display:inline-block;border-radius:20px;padding:3px 8px;font-size:10px;font-weight:800;background:#edf2f7;color:#46586e}
.role-badge.manager{background:var(--purplebg);color:var(--purple)}
.role-badge.admin{background:#e9f6ff;color:#0369a1}

/* ------------------------------------------------------------- responsive --- */
@media(max-width:1050px){
  .planner-layout{grid-template-columns:260px 1fr}
  .grid3{grid-template-columns:1fr 1fr}
}
@media(max-width:780px){
  .app-shell{display:block}
  .sidebar{position:static;width:auto;height:auto;overflow:visible;padding:14px}
  .brand{flex-direction:row;align-items:center;padding-bottom:12px}
  .brand-logo{width:135px}
  .sidebar nav{display:grid;grid-template-columns:repeat(3,1fr);gap:4px;overflow:visible}
  .sidebar nav a{padding:10px 8px;font-size:12px;justify-content:center}
  .sidebar nav a span{display:none}
  .sidebar-foot{display:none}
  main{grid-column:1;padding:0 14px 40px}
  .topbar{height:auto;padding:16px 0;flex-direction:column;align-items:flex-start;gap:12px}
  .top-actions{width:100%}
  .planner-layout{grid-template-columns:1fr}
  .queue{max-height:none}
  .stats{grid-template-columns:repeat(2,1fr)}
  .grid3,.grid2,.form-grid{grid-template-columns:1fr}
  .full{grid-column:auto}
  .joblist{grid-template-columns:1fr}
  .toolbar input[type=search]{min-width:0;width:100%}
  .drawer{width:100%}
  /* Full-width touch targets on a phone. */
  .card-actions .mini{min-height:44px;font-size:12px}
  .optrow{min-height:50px}
  #toast{top:auto;bottom:16px;right:12px;left:12px}
}

/* ------------------------------------------------- customer / fault flow --- */
/* Each sale is selectable — a customer with two installs needs the operator to
   say which one the fault is on before anything else makes sense. */
.sale-block { cursor: pointer; transition: .15s; }
.sale-block:hover { border-color: #b8d0f0; }
.sale-block.on { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(37,99,235,.14); background: #fbfdff; }
.modal.wide { width: min(880px, 96vw); }

/* Imported spreadsheet records sit below the CRM matches and are marked, so
   nobody promises a warranty on a job that has no live sale behind it. */
.lookup-divider{
  padding:9px 13px;background:#fff7e8;border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);font-size:10px;font-weight:900;
  color:#a45b06;text-transform:uppercase;letter-spacing:.4px;
}
.lookup-hit.legacy{background:#fffdf8}
.lookup-hit.legacy:hover{background:#fff7e8}
.lookup-hit em.st{background:var(--amberbg);color:#a45b06;margin-left:5px}

/* ============================================================================
   CUSTOMER-FACING PAGES
   Seen by homeowners on a phone, often standing outside next to an inverter.
   Larger type, generous targets, and no portal chrome — this is the only part
   of the system a customer ever sees.
   ========================================================================= */
.cust-page{background:var(--bg)}
.cust-wrap{max-width:640px;margin:0 auto;padding:28px 16px 60px}
.cust-logo{display:block;width:min(240px,60%);height:auto;margin:0 auto 24px}
.cust-ref{font-size:11px;font-weight:900;letter-spacing:.5px;text-transform:uppercase;
  color:var(--muted);margin:0 0 6px}
.cust-page h1{font-size:24px;color:var(--navy);margin:0 0 10px}
.cust-page h2{font-size:17px;color:var(--navy);margin:0 0 8px}
.cust-lead{font-size:15px;line-height:1.6;color:var(--ink);margin:0}

.cust-safety{background:var(--amberbg);border:1px solid #f4d3a0;border-radius:13px;
  padding:14px 16px;margin:18px 0 0}
.cust-safety b{display:block;color:#8a5208;margin-bottom:5px;font-size:14px}
.cust-safety p{margin:0;font-size:14px;line-height:1.55;color:#8a5208}

.cust-issue{background:#f8fafc;border:1px solid var(--line);border-radius:12px;
  padding:13px 15px;margin-top:14px;font-size:14px;line-height:1.5}
.cust-issue span{display:block;font-size:10px;font-weight:900;letter-spacing:.4px;
  text-transform:uppercase;color:var(--muted);margin-bottom:5px}

.cust-list{margin:14px 0 20px;padding-left:0;list-style:none}
.cust-list li{position:relative;padding:9px 0 9px 28px;font-size:15px;line-height:1.5;
  border-bottom:1px solid #eef2f6}
.cust-list li:last-child{border-bottom:0}
.cust-list li::before{content:"";position:absolute;left:6px;top:16px;width:8px;height:8px;
  border-radius:50%;background:var(--blue)}

/* A big obvious target — this is the one thing they came here to do. */
.cust-drop{display:block;border:2px dashed #b8d0f0;background:#f7fbff;border-radius:15px;
  padding:26px 18px;text-align:center;cursor:pointer}
.cust-drop:hover{border-color:var(--blue);background:#f0f7ff}
.cust-drop b{display:block;font-size:17px;color:var(--blue);margin-bottom:5px}
.cust-drop span{font-size:13px;color:var(--muted)}
.cust-drop input{display:none}
.cust-send{width:100%;min-height:52px;font-size:16px}
.cust-send:disabled{opacity:.45}

.cust-done{background:var(--greenbg);border:1px solid #bce7d3;border-radius:13px;
  padding:18px;margin-top:6px}
.cust-done b{display:block;font-size:16px;color:#08734d;margin-bottom:6px}
.cust-done p{margin:0;font-size:14px;line-height:1.55;color:#0b5d38}
.cust-error{background:var(--redbg);border:1px solid #f5aaaa;border-radius:11px;
  padding:12px 14px;color:var(--red);font-size:14px;margin-top:12px}
.cust-foot{text-align:center;font-size:12px;color:var(--muted);margin-top:24px}

@media(max-width:600px){
  .cust-wrap{padding:20px 12px 44px}
  .cust-page h1{font-size:21px}
  .cust-list li{font-size:15px;padding-left:26px}
}

/* ------------------------------------------------------- triage in-portal --- */
.triage-bar{display:flex;gap:8px;flex-wrap:wrap;align-items:center;
  background:var(--sky);border:1px solid #cfe1ff;border-radius:13px;padding:12px 14px;
  margin-bottom:14px}
.triage-bar b{font-size:12px;color:#1d4ed8;margin-right:4px}
.chip.triage{background:#fff;border:1px solid #cfe1ff;color:#1d4ed8}

/* ------------------------------------------------------------ the bell --- */
.bell-wrap{position:relative}
.bell{position:relative;font-size:15px;line-height:1}
.bell em{
  position:absolute;top:-6px;right:-6px;background:#ef4444;color:#fff;
  border-radius:20px;padding:1px 6px;font-style:normal;font-size:10px;font-weight:900;
  min-width:17px;text-align:center;
}
.bell-panel{
  position:absolute;right:0;top:calc(100% + 8px);width:min(400px,88vw);z-index:60;
  background:#fff;border:1px solid var(--line);border-radius:15px;box-shadow:var(--shadow);
  overflow:hidden;
}
.bell-head{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:12px 14px;border-bottom:1px solid var(--line);background:#f9fbfd;
}
.bell-head b{font-size:13px;color:var(--navy)}
#bellList{max-height:400px;overflow:auto}
.bell-item{
  display:flex;gap:11px;padding:12px 14px;border-bottom:1px solid #eef2f6;
  text-decoration:none;color:var(--ink);font-size:13px;line-height:1.45;
}
.bell-item:last-child{border-bottom:0}
.bell-item:hover{background:#f7fbff}
.bell-item.unread{background:#f3f8ff}
.bell-item.unread b{color:var(--blue)}
.bell-icon{color:var(--blue);font-size:13px;flex:0 0 auto;padding-top:1px}
.bell-item em{display:block;font-style:normal;font-size:11px;color:var(--muted);margin-top:3px}
.bell-empty{padding:28px 14px;text-align:center;color:var(--muted);font-size:13px}
@media(max-width:780px){
  .bell-panel{position:fixed;left:12px;right:12px;top:auto;bottom:12px;width:auto}
}

/* Selected files, listed so the customer can see what they've added and
   remove a mis-tap. Without this a phone camera silently replaced each
   previous photo with no sign anything had gone. */
.cust-picked{list-style:none;margin:14px 0;padding:0}
.cust-picked li{
  display:flex;align-items:center;gap:10px;padding:11px 12px;
  background:#f8fafc;border:1px solid var(--line);border-radius:11px;margin-bottom:7px;
}
.cust-picked .pk-name{
  flex:1;font-size:14px;color:var(--ink);overflow:hidden;
  text-overflow:ellipsis;white-space:nowrap;
}
.cust-picked .pk-size{font-size:12px;color:var(--muted);flex:0 0 auto}
.cust-picked .pk-x{
  flex:0 0 auto;width:34px;height:34px;border:1px solid var(--line);background:#fff;
  border-radius:9px;font-size:17px;line-height:1;color:var(--muted);
}
.cust-picked .pk-x:hover{background:var(--redbg);border-color:#f5aaaa;color:var(--red)}

/* Uploaded photos in the job drawer. Thumbnails rather than filenames — the
   operator is looking for an error code on a screen, not a list of names. */
.photo-strip{margin:12px 0 4px}
.photo-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(84px,1fr));gap:7px}
.photo-tile{display:block;aspect-ratio:1;border:1px solid var(--line);border-radius:10px;
  overflow:hidden;background:#f4f7fb;padding:0;cursor:zoom-in;position:relative;
  width:100%;font:inherit}
.photo-tile img{width:100%;height:100%;object-fit:cover;display:block}
.photo-tile:hover{border-color:var(--blue);box-shadow:0 0 0 2px rgba(37,99,235,.15)}
.photo-tile:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
/* A PDF or a video among the photos — Drive's thumbnail for those is a
   generic page icon, so say which one it is rather than leaving the operator
   to click and find out. */
.photo-kind{position:absolute;left:5px;bottom:5px;background:rgba(16,35,62,.82);
  color:#fff;font-size:9px;font-weight:800;letter-spacing:.06em;
  padding:2px 5px;border-radius:5px}

/* ---------------------------------------------------------------------------
   The photo viewer.

   Opening a photo used to mean a new Drive tab, which loses your place and
   gives you no way to the next one. Six photos of a switchboard are a
   sequence, so this reads them as one: arrows, keyboard, swipe on a phone,
   and the Drive link still there underneath for when the full file is wanted.
   ------------------------------------------------------------------------ */
/* Above the drawer (81), the modals (100) and the expand sheet (120), since a
   photo is always opened from on top of one of those. Toasts stay above it. */
.lightbox{position:fixed;inset:0;z-index:150;display:flex;align-items:center;
  justify-content:center}
.lightbox.hidden{display:none}
body.lb-open{overflow:hidden}
.lb-backdrop{position:absolute;inset:0;background:rgba(9,18,32,.93);
  backdrop-filter:blur(3px)}
.lb-stage{position:relative;margin:0;max-width:min(1200px,92vw);max-height:80vh;
  display:flex;align-items:center;justify-content:center;overflow:hidden;
  border-radius:10px;touch-action:none}
.lb-stage img{max-width:min(1200px,92vw);max-height:80vh;display:block;
  border-radius:10px;box-shadow:0 24px 70px rgba(0,0,0,.5);background:#0b1626;
  transform-origin:center center;will-change:transform;cursor:zoom-in;
  /* Only eased when it isn't being dragged, or panning lags behind the
     finger by the length of the transition and feels broken. */
  transition:transform .14s ease-out}
.lb-stage img.hidden{display:none}
.lightbox.zoomed .lb-stage img{cursor:grab}
.lightbox.grabbing .lb-stage img{cursor:grabbing;transition:none}

/* Zoom controls, in the bar with everything else. */
.lb-zoom{display:inline-flex;align-items:center;gap:2px;
  border:1px solid rgba(255,255,255,.18);border-radius:8px;overflow:hidden}
.lb-zoom.hidden{display:none}
.lb-zoom button{border:0;background:rgba(255,255,255,.07);color:#dce6f4;
  font:inherit;font-weight:700;font-size:12.5px;line-height:1;
  padding:7px 10px;cursor:pointer;min-width:34px}
#lbPct{min-width:56px;font-variant-numeric:tabular-nums}
.lb-zoom button:hover{background:rgba(37,99,235,.85);color:#fff}
.lb-zoom button:focus-visible{outline:2px solid #8fb8ff;outline-offset:-2px}
.lb-spinner{display:flex;flex-direction:column;align-items:center;gap:12px;
  color:#c8d6ea;font-size:13px;font-weight:600}
.lb-spinner.hidden{display:none}
.lb-spinner span{width:30px;height:30px;border-radius:50%;
  border:3px solid rgba(255,255,255,.22);border-top-color:#fff;
  animation:lbspin .8s linear infinite}
@keyframes lbspin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.lb-spinner span{animation-duration:2.4s}}
.lb-other{position:relative;max-width:380px;text-align:center;color:#dce6f4;
  background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.14);
  border-radius:12px;padding:26px 24px;font-size:13px;line-height:1.55}
.lb-other.hidden{display:none}
.lb-other p{margin:0 0 6px}
.lb-other p:last-child{margin:0;color:#9fb3cd}

.lb-nav{position:absolute;top:50%;transform:translateY(-50%);z-index:2;
  width:46px;height:46px;border-radius:50%;border:1px solid rgba(255,255,255,.2);
  background:rgba(14,28,48,.72);color:#fff;font-size:26px;line-height:1;
  cursor:pointer;display:flex;align-items:center;justify-content:center}
.lb-nav:hover{background:rgba(37,99,235,.9);border-color:transparent}
.lb-nav.prev{left:18px}
.lb-nav.next{right:18px}
.lb-nav.hidden{display:none}
.lb-x{position:absolute;top:16px;right:18px;z-index:2;width:38px;height:38px;
  border-radius:50%;border:1px solid rgba(255,255,255,.2);
  background:rgba(14,28,48,.72);color:#fff;font-size:22px;line-height:1;
  cursor:pointer}
.lb-x:hover{background:rgba(220,38,38,.9);border-color:transparent}

.lb-bar{position:absolute;left:0;right:0;bottom:0;z-index:2;
  display:flex;align-items:center;gap:14px;flex-wrap:wrap;
  padding:14px 22px;color:#dce6f4;font-size:12.5px;
  background:linear-gradient(to top,rgba(8,16,28,.92),rgba(8,16,28,0))}
.lb-name{font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  max-width:50vw}
.lb-count{color:#9fb3cd;font-variant-numeric:tabular-nums}
.lb-link{margin-left:auto;color:#8fb8ff;font-weight:700;text-decoration:none}
.lb-link:hover{text-decoration:underline}
.lb-link.hidden{display:none}

@media (max-width:640px){
  .lb-stage,.lb-stage img{max-width:96vw;max-height:72vh}
  .lb-nav{width:40px;height:40px;font-size:22px}
  .lb-nav.prev{left:8px}
  .lb-nav.next{right:8px}
  .lb-name{max-width:100%}
  .lb-link{margin-left:0}
}

/* Result of a test send, under the settings form. */
.test-result{margin-top:12px}
.test-result .cust-done{margin-top:0}

/* Build stamp. Small and quiet, but it answers "is the update actually
   running?" without a terminal. */
.build-chip{
  margin-top:10px;padding-top:9px;border-top:1px solid rgba(255,255,255,.09);
  font-size:10px;color:#7f93ab;letter-spacing:.2px;font-variant-numeric:tabular-nums;
}
@media(max-width:780px){ .build-chip{display:none} }

/* Copy-to-clipboard rows on the manual SMS panel. */
.copy-row{display:flex;gap:8px}
.copy-row input{flex:1;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:13px}

/* The system on site, on the board card. Quiet enough not to compete with the
   fault description, present enough to answer "what have they got?". */
.job-system{
  font-size:11px;color:var(--muted);margin:2px 0 6px;line-height:1.45;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.job-system b{color:var(--navy);font-weight:700;margin-right:6px}
.job-system .from-old{
  font-style:normal;background:var(--amberbg);color:#a45b06;
  padding:1px 6px;border-radius:5px;font-size:10px;font-weight:700;
}

/* Column mapping and import preview. */
.map-row{display:flex;align-items:center;gap:14px;padding:8px 0;
  border-bottom:1px solid var(--line)}
.map-row label{flex:0 0 190px;margin:0;font-size:13px;color:var(--ink);font-weight:600}
.map-row select{flex:1}
.map-row .req{font-size:10px;color:var(--red);font-weight:700;margin-left:4px}
table.preview{width:100%;border-collapse:collapse;font-size:13px;margin-top:6px}
table.preview th{text-align:left;padding:7px 9px;background:#f4f7fb;
  border-bottom:1px solid var(--line);font-size:11px;text-transform:uppercase;
  letter-spacing:.4px;color:var(--muted)}
table.preview td{padding:7px 9px;border-bottom:1px solid var(--line);vertical-align:top}
table.preview tr.warn{background:var(--amberbg)}
table.preview .warnnote{color:#8a5208;font-size:12px}

/* Import progress. Named stages while reading (no honest percentage exists
   for a single request), a real bar while importing (the count is rows
   actually written). */
.stage-list{margin:14px 0 4px}
.stage{font-size:13px;color:var(--muted);padding:5px 0 5px 24px;position:relative}
.stage::before{content:"";position:absolute;left:4px;top:10px;width:8px;height:8px;
  border-radius:50%;background:var(--line)}
.stage.on{color:var(--ink);font-weight:600}
.stage.on::before{background:var(--blue);box-shadow:0 0 0 3px rgba(37,99,235,.18)}
.stage.did{color:var(--muted)}
.stage.did::before{background:var(--green)}
.bar-wrap{margin-top:14px}
.bar{height:9px;background:#e8eef7;border-radius:99px;overflow:hidden}
.bar span{display:block;height:100%;width:0;background:var(--blue);
  border-radius:99px;transition:width .4s ease}

/* A job with no customer behind it — worth spotting on the board, since the
   technician would arrive knowing nothing about the system. */
.job-system .unlinked{
  font-style:normal;background:var(--amberbg);color:#a45b06;
  padding:1px 6px;border-radius:5px;font-size:10px;font-weight:700;
}

/* Choosing a customer for a job that arrived without one. */
.link-list{display:flex;flex-direction:column;gap:6px;margin-top:10px}
.link-hit{display:flex;flex-direction:column;align-items:flex-start;gap:2px;
  padding:9px 11px;border:1px solid var(--line);border-radius:10px;
  background:#fff;text-align:left;width:100%}
.link-hit:hover{border-color:var(--blue);background:#f7faff}
.link-hit b{font-size:13px;color:var(--ink)}
.link-hit span{font-size:11px;color:var(--muted)}

/* The sheet's own colour key, shown so a wrong reading can be corrected
   before finished jobs land on the board as live work. */
.legend-list{display:flex;flex-direction:column;gap:5px}
.legend-row{display:flex;align-items:center;gap:9px;font-size:13px}
.legend-row .swatch{width:15px;height:15px;border-radius:4px;
  border:1px solid rgba(0,0,0,.14);flex:0 0 auto}
.legend-row b{color:var(--ink);font-weight:600}
.legend-row .arrow{color:var(--muted)}
.inline-check{display:flex;align-items:center;gap:7px;font-size:13px;color:var(--ink)}

/* ---------------------------------------------------------- the board ---
   Two changes, both about scanning rather than decoration.

   The four stat boxes held four numbers in a lot of space. The strip below
   shows the same counts plus the shape of the queue — where work is piling
   up — in the same room.

   And job cards used to run from three lines to thirty, because a note can
   be a paragraph. Clamping the note keeps every card the same height, which
   is what lets someone run their eye down a column. */

.workload{
  background:#fff;border:1px solid var(--line);border-radius:14px;
  padding:16px 18px;margin-bottom:14px;
}
.workload-top{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}
.workload .big{font-size:30px;font-weight:700;color:var(--navy);line-height:1}
.workload .unit{font-size:14px;color:var(--muted)}
.workload .flags{margin-left:auto;display:flex;gap:7px;flex-wrap:wrap}
.workload .flag{
  font-size:12px;font-weight:600;padding:4px 10px;border-radius:99px;
  border:1px solid var(--line);background:#fff;color:var(--muted);
}
.workload .flag:hover{border-color:var(--blue);color:var(--blue)}
.workload .flag.bad{background:var(--redbg);border-color:#f5c2c2;color:var(--red)}
.workload .flag.attn{background:var(--amberbg);border-color:#f2d7a8;color:#a45b06}

.workload .bar{display:flex;gap:2px;height:9px;margin:14px 0 9px}
.workload .bar .seg{border-radius:2px;min-width:4px}
.workload .key{display:flex;gap:14px;flex-wrap:wrap;font-size:12px;color:var(--muted)}
.workload .key .k{display:flex;align-items:center;gap:6px}
.workload .key i{width:9px;height:9px;border-radius:2px;display:inline-block}
.workload .key b{color:var(--ink);font-weight:600}

/* One colour per state, distinguishable at a glance and at 9px. */
.s-open{background:#2563eb}
.s-awaiting-photos{background:#7c3aed}
.s-scheduled{background:#0891b2}
.s-awaiting-parts{background:#d97706}
.s-awaiting-customer{background:#db2777}
.s-on-hold{background:#64748b}

/* Scope is not a filter: it decides which jobs exist for this view, where
   the chips beside it narrow whatever that leaves. Giving them the same
   shape made "Show closed" behave unlike its neighbours. */
.scope{display:inline-flex;background:#eef2f8;border-radius:10px;padding:3px;gap:2px}
.scope button{
  font-size:13px;font-weight:600;padding:6px 13px;border-radius:8px;
  border:0;background:transparent;color:var(--muted);
}
.scope button.active{background:#fff;color:var(--navy);box-shadow:0 1px 2px rgba(16,35,62,.10)}
.scope button:hover:not(.active){color:var(--ink)}

.job-issue{
  display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;
  overflow:hidden;
}

/* A status the board doesn't recognise still gets a segment and a key entry,
   in grey — so the total is always the truth even when the data isn't. */
.workload .bar .seg:not([class*=" s-"]),
.workload .key i:not([class*=" s-"]){background:#94a3b8}

/* Linking jobs that arrived with no customer. One row per job, its
   candidates beside it — the eye compares names in one place rather than
   opening 139 drawers. */
.unlink-row{
  display:grid;grid-template-columns:230px 1fr;gap:16px;
  padding:12px 0;border-bottom:1px solid var(--line);align-items:start;
}
.unlink-job b{display:block;font-size:13px;color:var(--ink)}
.unlink-job span{display:block;font-size:11px;color:var(--muted);margin-top:2px}
.unlink-picks{display:flex;flex-direction:column;gap:5px}
.suggest{
  display:flex;align-items:baseline;gap:8px;padding:7px 10px;
  border:1px solid var(--line);border-radius:9px;font-size:13px;cursor:pointer;
}
.suggest:hover{border-color:var(--blue);background:#f7faff}
.suggest.on{border-color:var(--blue);background:#eef4ff}
.suggest b{font-weight:600;color:var(--ink)}
.suggest span{font-size:11px;color:var(--muted)}
.suggest.skip{color:var(--muted);font-size:12px;border-style:dashed}

/* The install date beside a candidate. Several records for the same person
   is normal in this CRM, and the date is the only thing that says which is
   the current one. */
.suggest .when{font-style:normal;color:var(--navy);font-weight:600}

/* Bulk actions. The bar only exists while something is selected, so it costs
   nothing the rest of the time. */
.job-card .pick{
  float:right;margin:-2px 0 0 8px;cursor:pointer;
}
.job-card .pick input{width:15px;height:15px;cursor:pointer;accent-color:var(--blue)}
.bulk-bar{
  position:fixed;left:50%;bottom:22px;transform:translateX(-50%);z-index:60;
  display:flex;align-items:center;gap:10px;
  background:var(--navy);color:#fff;padding:10px 14px;border-radius:12px;
  box-shadow:0 10px 30px rgba(16,35,62,.28);font-size:13px;
}
.bulk-bar select{
  font-size:13px;padding:6px 9px;border-radius:8px;border:1px solid #33506f;
  background:#20385a;color:#fff;
}
.bulk-bar .primary{padding:6px 14px;font-size:13px}
.bulk-bar .ghost{padding:6px 12px;font-size:13px;background:transparent;
  border:1px solid #3c5a7d;color:#c8d6e8}
.bulk-bar .ghost:hover{background:#20385a}

/* ------------------------------------------------------------ list view ---
   The board is for glancing at today's work. This is for operating on a lot
   of rows at once: everything on one line, sortable, select-all, shift-click
   for a run. Dense on purpose — the point is fitting sixty jobs on a screen,
   not decoration. */
.viewpick{display:inline-flex;background:#eef2f8;border-radius:10px;padding:3px;gap:2px;margin-right:10px}
.viewpick button{
  font-size:13px;font-weight:600;padding:6px 13px;border-radius:8px;
  border:0;background:transparent;color:var(--muted);
}
.viewpick button.active{background:#fff;color:var(--navy);box-shadow:0 1px 2px rgba(16,35,62,.10)}

.list-card{padding:0;overflow:hidden}
/* .jobtable, not .joblist — that class is the card grid (display:grid), and
   sharing it turned every cell of this table into a grid item. */
table.jobtable{width:100%;border-collapse:collapse;font-size:13px;table-layout:fixed}
table.jobtable th{
  text-align:left;padding:10px 12px;background:#f6f9fc;color:var(--muted);
  font-size:12px;font-weight:600;border-bottom:1px solid var(--line);
  white-space:nowrap;position:sticky;top:0;z-index:2;
}
table.jobtable th.sortable{cursor:pointer;user-select:none}
table.jobtable th.sortable:hover{color:var(--navy)}
table.jobtable th.on{color:var(--navy)}
table.jobtable td{
  padding:0 12px;height:40px;border-bottom:1px solid #eef2f7;
  vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
table.jobtable tr:hover td{background:#f9fbfe}
table.jobtable tr.picked td{background:#eef4ff}
table.jobtable .tick{width:38px;text-align:center}
table.jobtable .tick input{width:15px;height:15px;cursor:pointer;accent-color:var(--blue)}
table.jobtable .reflink{
  font-weight:600;color:var(--blue);background:none;border:0;padding:0;
  font-size:13px;cursor:pointer;
}
table.jobtable .reflink:hover{text-decoration:underline}
table.jobtable td.od{color:var(--red);font-weight:600}
table.jobtable .tiny-warn{
  font-style:normal;font-size:10px;font-weight:700;color:#a45b06;
  background:var(--amberbg);padding:1px 5px;border-radius:4px;margin-left:4px;
}

/* One pill style, tinted per value, so a column of statuses reads as a
   column rather than as a wall of identical grey chips. */
table.jobtable .pill{
  display:inline-block;padding:2px 9px;border-radius:99px;font-size:11px;
  font-weight:600;white-space:nowrap;background:#eef2f7;color:#41556c;
}
.st-open{background:#e5edff;color:#1e40af}
.st-scheduled{background:#dcf2f7;color:#0e6f85}
.st-awaiting-parts{background:#fdefd9;color:#9a5b04}
.st-awaiting-customer{background:#fce7f0;color:#9d1f5f}
.st-awaiting-photos{background:#efe6fd;color:#5b21b6}
.st-on-hold{background:#eef1f5;color:#4a5a6d}
.st-resolved,.st-closed{background:#e3f4e8;color:#1c6b36}
.pr-urgent{background:#fde3e3;color:#a81c1c}
.pr-high{background:#fdeede;color:#a3520a}
.pr-medium{background:#eef2f7;color:#41556c}
.pr-low{background:#f2f5f8;color:#7488a0}

/* A column repeating the same word sixty times is noise, so the region is
   abbreviated and the owner shown as a name rather than an address. The
   "no customer" flag is a dot, because as a badge it pushed names onto a
   second line and broke the row rhythm. */
table.jobtable .reg{
  font-size:11px;font-weight:600;color:#5a6b80;background:#f1f5f9;
  padding:2px 7px;border-radius:5px;
}
table.jobtable .who{font-size:12px;color:#41556c;text-transform:capitalize}
table.jobtable .who.none{color:#9aa8b8;font-style:italic;text-transform:none}
table.jobtable .dot-warn{
  display:inline-block;width:6px;height:6px;border-radius:50%;
  background:#e8a33d;margin-right:7px;vertical-align:middle;
}
table.jobtable thead th:first-child,
table.jobtable tbody td:first-child{padding-left:14px}

/* ------------------------------------------------------- board cards ---
   The card had eight blocks all shouting at once. Four zones now, with a
   clear order of attention: who, what's wrong, the four things you change,
   and actions that only appear when the pointer is on the card. */
.job-card{position:relative;padding:13px 14px 12px;display:flex;flex-direction:column}
.job-top{display:flex;align-items:baseline;gap:8px;margin-bottom:3px}
.job-card .pick{
  order:-1;flex:0 0 auto;display:flex;align-items:center;
  height:16px;cursor:pointer;
}
.job-card .pick input{width:15px;height:15px;cursor:pointer;accent-color:var(--blue);margin:0}
.job-card .job-name{
  flex:1;min-width:0;text-align:left;font-size:13.5px;font-weight:650;
  color:var(--ink);background:none;border:0;padding:0;cursor:pointer;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.job-card .job-name:hover{color:var(--blue)}
.job-card .job-ref{flex:0 0 auto;font-size:11px;color:#9aa8b8;font-variant-numeric:tabular-nums}
.job-card.picked{border-color:var(--blue);box-shadow:0 0 0 2px rgba(37,99,235,.12)}

.job-meta{
  font-size:11.5px;color:var(--muted);margin:0 0 8px 23px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.job-meta .sysdot{color:#c3ced9}

.job-issue{
  font-size:12.5px;line-height:1.5;color:#3f5266;margin:0 0 10px 23px;
  display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;
}

.job-card .chips{display:flex;flex-wrap:wrap;gap:5px;margin-left:23px}
.job-card .chip{
  font-size:11px;font-weight:600;padding:3px 9px;border-radius:99px;
  border:1px solid transparent;background:#f1f5f9;color:#43576e;cursor:pointer;
}
.job-card .chip:hover{border-color:#c9d6e5}
.job-card .chip.owner{background:transparent;color:#8b9aab;border:1px dashed #d6dfe9}

/* Actions on hover. They were taking a permanent row on every card for
   something used now and then. */
.job-card .card-actions{
  display:flex;gap:6px;margin:10px 0 0 23px;
  max-height:0;opacity:0;overflow:hidden;
  transition:max-height .16s ease,opacity .16s ease,margin .16s ease;
}
.job-card:hover .card-actions,
.job-card:focus-within .card-actions{max-height:40px;opacity:1}
.job-card .dot-warn{
  display:inline-block;width:6px;height:6px;border-radius:50%;
  background:#e8a33d;margin-right:6px;vertical-align:middle;
}

/* ----------------------------------------------------------- the queue ---
   Eighty-three bordered tiles in a grid is tiring: every one the same shape,
   the same shadow, repeating "Medium" and an owner name that never changes.
   The eye has nothing to hold on to.

   A queue instead. No box per job — hairline rules and rhythm do the
   separating. One thing is dark and confident (the name); everything else
   recedes. Colour appears only where something is actually unusual, so when
   you do see red it means something. */
.jobqueue{
  background:#fff;border:1px solid var(--line);border-radius:12px;
  overflow:hidden;
}
.qrow{
  display:grid;
  grid-template-columns:34px minmax(190px,1.15fr) minmax(0,1.6fr) auto 74px 56px;
  align-items:center;gap:14px;
  padding:0 14px 0 6px;min-height:52px;
  border-bottom:1px solid #f0f4f8;
  position:relative;
}
.qrow:last-child{border-bottom:0}
.qrow:hover{background:#fafcff}
.qrow.picked{background:#eff5ff}
/* A hairline on the left, not a filled chip, for the ones running late. */
.qrow.late::before{
  content:"";position:absolute;left:0;top:8px;bottom:8px;width:2px;
  border-radius:0 2px 2px 0;background:var(--red);
}

.qrow .pick{display:flex;justify-content:center;align-items:center;cursor:pointer}
.qrow .pick input{
  width:15px;height:15px;cursor:pointer;accent-color:var(--blue);margin:0;
  opacity:.28;transition:opacity .12s ease;
}
.qrow:hover .pick input,
.qrow .pick input:checked{opacity:1}

.qmain{
  display:flex;flex-direction:column;gap:2px;min-width:0;
  background:none;border:0;padding:8px 0;text-align:left;cursor:pointer;
}
.qname{
  font-size:14px;font-weight:600;color:var(--ink);letter-spacing:-.01em;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.qmain:hover .qname{color:var(--blue)}
.qsub{
  font-size:11.5px;color:#8b9aab;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.qissue{
  font-size:12.5px;color:#5c6f85;line-height:1.45;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}

/* Only what differs from the default. Most jobs are Medium and Open, so
   showing those on every row would be eighty-three repetitions of nothing. */
.qmarks{display:flex;gap:5px;justify-content:flex-end;white-space:nowrap}
.mark{font-size:10.5px;font-weight:600;padding:2px 8px;border-radius:99px}
.mark.pr{background:#fdeae4;color:#a3410a}
.mark.st{background:#eef2f7;color:#4a5c72}
.mark.st.st-scheduled{background:#e2f1f6;color:#0e6f85}
.mark.st.st-awaiting-parts{background:#fbeed8;color:#8c5504}
.mark.st.st-awaiting-customer{background:#fbe6ef;color:#8f1d57}
.mark.st.st-on-hold{background:#eef1f5;color:#53637a}
.mark.warn{
  background:var(--amberbg);color:#a45b06;width:17px;padding:2px 0;
  text-align:center;border-radius:50%;
}

.qdate{
  font-size:12px;color:#7d8c9d;text-align:right;
  font-variant-numeric:tabular-nums;white-space:nowrap;
}
.qrow.late .qdate{color:var(--red);font-weight:600}

/* Actions stay out of the way until the pointer is on the row. */
.qact{display:flex;gap:2px;justify-content:flex-end;opacity:0;transition:opacity .13s ease}
.qrow:hover .qact,.qrow:focus-within .qact{opacity:1}
.qa{
  width:25px;height:25px;border-radius:7px;border:0;background:transparent;
  color:#8b9aab;font-size:15px;line-height:1;cursor:pointer;
  display:flex;align-items:center;justify-content:center;text-decoration:none;
}
.qa:hover{background:#eef2f7;color:var(--navy)}

/* Group headings as quiet type, not chips. */
.group-head{
  font-size:11.5px;font-weight:600;color:#9aa8b8;letter-spacing:.06em;
  text-transform:uppercase;margin:22px 0 8px;display:flex;align-items:center;gap:8px;
}
.group:first-child .group-head{margin-top:4px}
.group-head em{font-style:normal;color:#b8c4d1;font-weight:500;letter-spacing:0}
.group-head.hot{color:var(--red)}
.group-head.hot em{color:#e08d8d}

@media (max-width:1180px){
  .qrow{grid-template-columns:34px minmax(150px,1.2fr) auto 70px 50px}
  .qissue{display:none}
}

/* Lodged by the customer themselves, rather than logged by someone here.
   Worth seeing at a glance: nobody has spoken to them yet. */
.mark.web{background:#e8f0fe;color:#1a56c4}

/* The four things you change on a job. They were unlabelled chips — you
   couldn't tell which was the status and which was the owner, or that they
   did anything at all. A label each, and an affordance saying so. */
.setgrid{display:grid;grid-template-columns:76px 1fr;gap:7px 12px;align-items:center}
.setgrid label{font-size:12px;color:var(--muted);font-weight:500}
.setval{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  width:100%;padding:8px 11px;border:1px solid var(--line);border-radius:9px;
  background:#fff;color:var(--ink);font-size:13px;font-weight:600;
  cursor:pointer;text-align:left;
}
.setval:hover:not(:disabled){border-color:var(--blue);background:#f7faff}
.setval i{font-style:normal;font-size:11px;color:#9aa8b8;font-weight:500}
.setval:hover:not(:disabled) i{color:var(--blue)}
.setval:disabled{background:#f7f9fc;color:#8b9aab;cursor:default}
.setval.late{border-color:#f1c9c9;background:#fdf6f6}
.setval.late,.setval.late i{color:var(--red)}

/* The job's controls, across the top of its own page. These were five
   read-only cards with the edit form collapsed at the foot of the page — so
   the page you open to work a job was the one place you couldn't change it. */
.jobbar{
  display:grid;grid-template-columns:repeat(5,1fr) auto;gap:14px;
  align-items:end;padding:16px 18px;margin-bottom:16px;
}
.jobbar-field label{
  display:block;font-size:12px;color:var(--muted);font-weight:500;margin-bottom:5px;
}
.jobbar-field input,.jobbar-field select{
  width:100%;font:inherit;font-size:13.5px;font-weight:600;color:var(--ink);
  padding:8px 10px;border:1px solid var(--line);border-radius:9px;background:#fff;
}
.jobbar-field input:hover,.jobbar-field select:hover{border-color:#c6d4e4}
.jobbar-field input:focus,.jobbar-field select:focus{
  outline:0;border-color:var(--blue);box-shadow:0 0 0 3px rgba(37,99,235,.12);
}
.jobbar-field select:disabled{background:#f7f9fc;color:#8b9aab}
.jobbar-save .primary{padding:9px 20px;font-size:13.5px}
@media (max-width:1100px){
  .jobbar{grid-template-columns:repeat(2,1fr);gap:12px}
  .jobbar-save{grid-column:1/-1}
  .jobbar-save .primary{width:100%}
}

/* The working log's attach control. */
.logrow{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.filepick{cursor:pointer}
table.jobtable a.reflink{text-decoration:none}

/* Sharing an update with the customer. Off by default — the trail carries
   internal remarks that would read badly to the person waiting. */
.shareline{display:flex;align-items:center;gap:8px;margin:2px 0 12px;cursor:pointer;font-size:13px;color:#42556b}
.shareline input{width:15px;height:15px;accent-color:var(--blue);cursor:pointer}
.shared-tag{
  margin-left:7px;font-size:10px;font-weight:600;color:#1c6b36;
  background:#e3f4e8;padding:1px 7px;border-radius:99px;
}

/* The customer's message box on their own link. */
#msgBox{width:100%;font:inherit;font-size:16px;padding:12px 13px;
  border:1px solid #d6e0ec;border-radius:10px;margin-bottom:12px;resize:vertical}
#msgBox:focus{outline:0;border-color:var(--blue);box-shadow:0 0 0 3px rgba(37,99,235,.13)}
.cust-send{font:inherit;font-size:15px;font-weight:600;padding:12px 22px;
  background:var(--blue);color:#fff;border:0;border-radius:10px;cursor:pointer}
.cust-send:hover{background:#1d4fd8}
.cust-send:disabled{background:#9db7e8;cursor:default}
.sent-ok{margin-top:12px;padding:11px 13px;border-radius:10px;font-size:14px;
  background:#e9f6ee;border:1px solid #c6e6d2;color:#155f30}
.status-card{border-left:3px solid var(--blue)}
.status-card.done{border-left-color:#1c6b36}
.stage{font-size:17px;font-weight:700;color:var(--navy);margin-bottom:4px}
.status-card.done .stage{color:#1c6b36}
.stage-note{margin:0;color:var(--muted);font-size:14.5px;line-height:1.55}
.updates{list-style:none;margin:0;padding:0}
.updates li{padding:12px 0;border-bottom:1px solid var(--line)}
.updates li:last-child{border-bottom:0}
.u-when{font-size:12px;color:var(--muted);margin-bottom:3px}
.updates li.from-you{padding-left:12px;border-left:2px solid #d7e3f2}
.u-what{font-size:14.5px;line-height:1.6;white-space:pre-wrap}

/* ------------------------------------------------------------ job history ---
   A job that runs for weeks builds up dozens of entries, and a pasted
   supplier email is a wall of text on its own. So: the list scrolls rather
   than pushing the page down forever, and long entries are clamped until
   somebody asks to see them. */
.trail-short{max-height:430px;overflow-y:auto;padding-right:6px}
.trail-short::-webkit-scrollbar{width:8px}
.trail-short::-webkit-scrollbar-thumb{background:#d6e0ea;border-radius:4px}
.trail-what.long{
  display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;
  overflow:hidden;
}
.trail-what.long.open{-webkit-line-clamp:unset;overflow:visible}
.trail-more{
  margin-top:4px;background:none;border:0;padding:0;cursor:pointer;
  font-size:11.5px;font-weight:600;color:var(--blue);
}
.trail-more:hover{text-decoration:underline}

.mini.ok{background:#e3f4e8;border-color:#bfe3cb;color:#1c6b36}

/* ------------------------------------------------------- links for a job ---
   A fallback rather than daily work: you come here when a text didn't arrive
   or a link looks wrong. So it sits closed, reads quietly, and only the two
   actions carry any weight. */
.quiet-panel{padding:0;overflow:hidden}
.quiet-panel>summary{
  cursor:pointer;list-style:none;padding:15px 18px;
  display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;
}
.quiet-panel>summary::-webkit-details-marker{display:none}
.quiet-panel>summary::after{
  content:"";margin-left:auto;width:8px;height:8px;flex:0 0 auto;
  border-right:2px solid #9aa8b8;border-bottom:2px solid #9aa8b8;
  transform:rotate(45deg);transition:transform .18s ease;
}
.quiet-panel[open]>summary::after{transform:rotate(-135deg)}
.quiet-panel>summary:hover{background:#fafcff}
.qp-title{font-size:14px;font-weight:650;color:var(--navy)}
.qp-hint{font-size:12px;color:var(--muted)}
.qp-body{padding:2px 18px 16px}

.linkrow{
  display:flex;align-items:flex-start;gap:16px;
  padding:13px 0;border-top:1px solid #eef2f7;
}
.linkrow .lr-main{min-width:0;flex:1}
.lr-what{font-size:13px;font-weight:650;color:var(--ink)}
.lr-note{font-size:11.5px;color:var(--muted);margin-top:2px}
.lr-url{
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:11.5px;color:#5c7fae;margin-top:5px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  background:#f6f9fc;border:1px solid #eaf0f6;border-radius:7px;
  padding:5px 9px;
}
.linkrow.internal .lr-url{color:#6b7c92}
.linkrow.sent{opacity:.85}
.lr-acts{display:flex;gap:6px;flex:0 0 auto;padding-top:2px}
.lr-sent-head{
  margin-top:16px;font-size:11px;font-weight:600;color:#9aa8b8;
  text-transform:uppercase;letter-spacing:.07em;
}

.linkbtn{
  font:inherit;font-size:12.5px;font-weight:600;padding:7px 15px;
  border-radius:8px;border:1px solid var(--blue);background:var(--blue);
  color:#fff;cursor:pointer;text-decoration:none;white-space:nowrap;
  display:inline-flex;align-items:center;transition:background .14s,border-color .14s;
}
.linkbtn:hover{background:#1d4fd8;border-color:#1d4fd8}
.linkbtn.ghost{background:#fff;color:var(--blue)}
.linkbtn.ghost:hover{background:#f2f7ff}
.linkbtn.ok{background:#1c6b36;border-color:#1c6b36;color:#fff}

/* The history's "show all" control. It was a default-looking button floating
   on its own; this makes it read as part of the heading. */
#trailToggle{
  font-size:12px;font-weight:600;color:var(--blue);background:none;
  border:0;padding:4px 2px;cursor:pointer;align-self:center;
}
#trailToggle:hover{text-decoration:underline}

/* ------------------------------------------------- long groups on the board ---
   A group with sixty jobs used to push everything below it off the screen, so
   reaching the next heading meant scrolling past the lot. Long groups scroll
   inside themselves; Expand opens the full list over the page. */
.jobqueue.capped{max-height:440px;overflow-y:auto}
.jobqueue.capped::-webkit-scrollbar{width:9px}
.jobqueue.capped::-webkit-scrollbar-thumb{background:#d6e0ea;border-radius:5px}
.jobqueue.capped::-webkit-scrollbar-track{background:#f6f9fc}

.group-expand{
  margin-left:auto;font:inherit;font-size:11.5px;font-weight:600;
  color:var(--blue);background:#eef4ff;border:1px solid #dbe7fb;
  border-radius:7px;padding:4px 11px;cursor:pointer;letter-spacing:0;
  text-transform:none;
}
.group-expand:hover{background:#e2ecff;border-color:#c6daf8}

.sheet-wrap{
  position:fixed;inset:0;z-index:120;background:rgba(16,35,62,.45);
  display:flex;align-items:center;justify-content:center;padding:34px 20px;
  animation:sheetIn .14s ease;
}
@keyframes sheetIn{from{opacity:0}to{opacity:1}}
.sheet{
  background:#fff;border-radius:16px;width:min(1180px,100%);
  max-height:100%;display:flex;flex-direction:column;overflow:hidden;
  box-shadow:0 26px 70px rgba(16,35,62,.34);
}
.sheet-head{
  display:flex;align-items:center;gap:12px;padding:16px 20px;
  background:var(--navy);color:#fff;
}
.sheet-head b{font-size:15px}
.sheet-count{font-size:12.5px;color:#9db4d2}
.sheet-close{
  margin-left:auto;width:30px;height:30px;border-radius:8px;border:0;
  background:rgba(255,255,255,.14);color:#fff;font-size:19px;line-height:1;
  cursor:pointer;
}
.sheet-close:hover{background:rgba(255,255,255,.26)}
.sheet-body{overflow-y:auto;padding:14px 18px 20px;background:#f7fafd}
.sheet-body .jobqueue{max-height:none}
