/* ZABSI Sales & Marketing Flow – styles.css
 * Brand colours are the --brand variables at the top. */

:root {
  --brand: #0daad7;
  --brand-d: #0a87ad;
  --brand-bg: #e7f6fc;
  --brand-red: #c1202f;
  --ink: #0b2540;
  --text: #1f2a3c;
  --muted: #667085;
  --line: #e4e9f0;
  --bg: #f4f7fa;
  --card: #ffffff;
  --green: #15803d;
  --greenbg: #dcfce7;
  --amber: #b45309;
  --amberbg: #fef3c7;
  --red: #dc2626;
  --redbg: #fee2e2;
  --grey: #4b5563;
  --greybg: #eef1f5;
  --blue: #1d4ed8;
  --bluebg: #dbeafe;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.14);
  --r: 14px;
  --sb: 250px;
  --soft: #f8fafc;
  --line2: #d0d5dd;
  --text2: #344054;
  --muted2: #98a2b3;
  --infotext: #075e78;
  --warntext: #7c3d06;
  --badtext: #991b1b;
  --redline: #fecaca;
  --topbg: rgba(244, 247, 250, 0.88);
  --glow: none;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
}
body {
  font-family:
    'Segoe UI',
    system-ui,
    -apple-system,
    Roboto,
    Arial,
    sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button {
  font: inherit;
}
a {
  color: var(--brand-d);
}
svg.i {
  flex: 0 0 auto;
  display: block;
}
/* ---------- sidebar ---------- */
.sb {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sb);
  background: var(--card);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 60;
  transition: transform 0.25s;
}
.sb .logo {
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--line);
}
.sb .logo img {
  width: 150px;
  display: block;
}
.sb .logo small {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-weight: 600;
}
.sb nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
}
.sb .grp {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 14px 10px 6px;
}
.sb .nv {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: none;
  padding: 9px 10px;
  border-radius: 10px;
  color: var(--text2);
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
}
.sb .nv:hover {
  background: var(--bg);
}
.sb .nv.on {
  background: var(--brand-bg);
  color: var(--brand-d);
}
.sb .nv.on svg {
  color: var(--brand);
}
.sb .nv .bd {
  margin-left: auto;
  background: var(--amber);
  color: #fff;
  border-radius: 10px;
  font-size: 11px;
  padding: 0 7px;
  line-height: 18px;
}
.sb .me {
  border-top: 1px solid var(--line);
  padding: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  cursor: pointer;
}
.sb .me:hover {
  background: var(--bg);
}
.av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  flex: 0 0 36px;
}
.me .nm {
  font-weight: 700;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.2;
}
.me .rl {
  font-size: 12px;
  color: var(--muted);
}
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(11, 37, 64, 0.4);
  z-index: 55;
  display: none;
}
.scrim.open {
  display: block;
}
/* ---------- main ---------- */
.main {
  margin-left: var(--sb);
  min-height: 100vh;
  padding-bottom: 30px;
}
.top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--topbg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.top .ham {
  display: none;
}
.top h1 {
  margin: 0;
  font-size: 20px;
  color: var(--ink);
  letter-spacing: -0.2px;
}
.top .sub {
  font-size: 12px;
  color: var(--muted);
}
.top .tt {
  margin-right: auto;
  min-width: 0;
}
.iconbtn {
  position: relative;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.iconbtn:hover {
  background: var(--bg);
}
.iconbtn .cnt {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--brand-red);
  color: #fff;
  border-radius: 10px;
  font-size: 11px;
  padding: 0 6px;
  line-height: 18px;
  font-weight: 700;
}
.scope {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 10px;
  padding: 0 10px;
  height: 40px;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  max-width: 230px;
}
.cochip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--greybg);
  color: var(--ink);
  white-space: nowrap;
}
.cochip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.content {
  padding: 20px 24px;
  max-width: 1600px;
}
/* ---------- buttons/forms ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  padding: 9px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}
.btn:hover {
  background: var(--bg);
}
.btn.pri {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn.pri:hover {
  background: var(--brand-d);
}
.btn.ok {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.btn.no {
  color: var(--red);
  border-color: var(--redline);
}
.btn.no:hover {
  background: var(--redbg);
}
.btn.sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 8px;
}
label {
  display: block;
  font-size: 12px;
  color: var(--text2);
  font-weight: 600;
}
input,
select,
textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line2);
  border-radius: 10px;
  font: inherit;
  margin-top: 4px;
  background: var(--card);
  color: var(--text);
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(13, 170, 215, 0.18);
}
input:disabled,
select:disabled {
  background: var(--bg);
  color: var(--muted);
}
textarea {
  min-height: 64px;
  resize: vertical;
}
.req::after {
  content: ' *';
  color: var(--red);
}
.f2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.f2 .full {
  grid-column: 1/-1;
}
.hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.hint.ok {
  color: var(--green);
  font-weight: 600;
}
.err {
  background: var(--redbg);
  color: var(--badtext);
  padding: 9px 12px;
  border-radius: 10px;
  margin: 10px 0 0;
  font-size: 13px;
}
.err:empty {
  display: none;
}
.note {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  margin: 8px 0;
}
.note.info {
  background: var(--brand-bg);
  color: var(--infotext);
}
.note.warn {
  background: var(--amberbg);
  color: var(--warntext);
}
.note.bad {
  background: var(--redbg);
  color: var(--badtext);
}
.note.good {
  background: var(--greybg);
  color: var(--ink);
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
/* ---------- cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}
.card h3 {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card h3 .r {
  margin-left: auto;
  font-weight: 500;
}
.g2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.g2 > .card {
  margin-bottom: 0;
}
.g32 {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 16px;
}
.g32 > .card {
  margin-bottom: 0;
}
.stack {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 12px;
  align-items: center;
}
.kpi .ic {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--brand-bg);
  color: var(--brand-d);
  flex: 0 0 42px;
}
.kpi.warn .ic {
  background: var(--amberbg);
  color: var(--amber);
}
.kpi.good .ic {
  background: var(--greenbg);
  color: var(--green);
}
.kpi.red .ic {
  background: var(--redbg);
  color: var(--brand-red);
}
.kpi .l {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.kpi .v {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.3px;
  white-space: nowrap;
}
.welcome {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(120deg, var(--card) 0%, var(--card) 55%, var(--brand-bg) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}
.welcome h2 {
  margin: 0;
  font-size: 18px;
  color: var(--ink);
}
.welcome p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.welcome img {
  height: 46px;
  margin-left: auto;
  opacity: 0.95;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.p-green {
  background: var(--greenbg);
  color: var(--green);
}
.p-amber {
  background: var(--amberbg);
  color: var(--amber);
}
.p-red {
  background: var(--redbg);
  color: var(--red);
}
.p-grey {
  background: var(--greybg);
  color: var(--grey);
}
.p-brand {
  background: var(--brand-bg);
  color: var(--brand-d);
}
.p-blue {
  background: var(--bluebg);
  color: var(--blue);
}
.t-red {
  color: var(--red);
  font-weight: 700;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
/* ---------- tables ---------- */
.tw {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 12px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--card);
}
th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
  vertical-align: top;
}
th {
  background: var(--soft);
  font-size: 12px;
  color: var(--text2);
  font-weight: 700;
  position: sticky;
  top: 0;
}
tbody tr:last-child td {
  border-bottom: 0;
}
td.num,
th.num {
  text-align: right;
}
td.wrap {
  white-space: normal;
  min-width: 200px;
  max-width: 340px;
}
tr.click {
  cursor: pointer;
}
tr.click:hover td {
  background: var(--soft);
}
tfoot td {
  background: var(--soft);
  font-weight: 700;
  border-top: 1px solid var(--line);
}
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 12px;
}
.filters > div {
  min-width: 130px;
}
.filters input,
.filters select {
  margin-top: 3px;
}
.filters .grow {
  flex: 1;
  min-width: 220px;
}
.sbox {
  position: relative;
}
.sbox svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-35%);
  color: var(--muted2);
}
.sbox input {
  padding-left: 34px;
}
.tabsum {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.tabsum .s {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  min-width: 150px;
}
.tabsum .s b {
  display: block;
  font-size: 17px;
  color: var(--ink);
}
.tabsum .s span {
  font-size: 12px;
  color: var(--muted);
}
/* ---------- kanban ---------- */
.board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.col {
  flex: 0 0 260px;
  background: var(--soft);
  border-radius: var(--r);
  padding: 10px;
  max-height: calc(100vh - 210px);
  overflow-y: auto;
  scroll-snap-align: start;
}
.col h4 {
  margin: 2px 4px 10px;
  font-size: 13px;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  gap: 6px;
}
.col h4 small {
  display: block;
  color: var(--muted);
  font-weight: 500;
  font-size: 11px;
}
.col h4 .n {
  background: var(--card);
  color: var(--ink);
  border-radius: 10px;
  padding: 0 8px;
  height: 20px;
  font-size: 12px;
  line-height: 20px;
  border: 1px solid var(--line);
}
.jc {
  background: var(--card);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  box-shadow: var(--shadow);
  border: 1px solid transparent;
  border-top: 3px solid var(--brand);
  font-size: 13px;
  transition:
    transform 0.12s,
    box-shadow 0.12s;
}
.jc:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}
.jc.pending {
  border-top-color: var(--amber);
}
.jc.won {
  border-top-color: var(--green);
}
.jc.lost {
  border-top-color: var(--red);
}
.jc.draft {
  border-top-color: var(--muted2);
}
.jc.aged {
  border-color: var(--redline);
  background: var(--soft);
}
.jc .r1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.jc .id {
  font-weight: 700;
  font-size: 12px;
  color: var(--muted);
}
.jc .cl {
  font-weight: 700;
  color: var(--ink);
  margin-top: 6px;
}
.jc .ds {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.jc .r2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
}
.jc .val {
  font-weight: 800;
  color: var(--ink);
}
.jc .cta {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-d);
  display: flex;
  align-items: center;
  gap: 4px;
}
.mini {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--greybg);
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
}
/* ---------- stepper ---------- */
.stepper {
  display: flex;
  align-items: flex-start;
  overflow-x: auto;
  padding: 4px 0;
}
.step {
  flex: 1;
  min-width: 70px;
  text-align: center;
  position: relative;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.step .dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  margin: 0 auto 5px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
  background: var(--greybg);
  color: var(--muted2);
  position: relative;
  z-index: 1;
  border: 2px solid var(--card);
}
.step::before {
  content: '';
  position: absolute;
  top: 13px;
  left: -50%;
  width: 100%;
  height: 3px;
  background: var(--greybg);
}
.step:first-child::before {
  display: none;
}
.step.done .dot {
  background: var(--green);
  color: #fff;
}
.step.done::before {
  background: var(--green);
}
.step.cur .dot {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 0 0 4px var(--brand-bg);
}
.step.cur::before {
  background: var(--green);
}
.step.cur {
  color: var(--brand-d);
}
.step.rej .dot {
  background: var(--red);
  color: #fff;
}
.step.rej::before {
  background: var(--green);
}
.step.rej {
  color: var(--red);
}
.step.skip .dot {
  background: var(--soft);
  color: var(--line2);
}
.step.skip {
  color: var(--line2);
}
.loop {
  display: block;
  font-size: 10px;
  color: var(--red);
  font-weight: 700;
  margin-top: 2px;
}
.trow {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.trow:last-child {
  border-bottom: 0;
}
.trow .h {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
/* ---------- funnel/bars ---------- */
.fun {
  display: grid;
  grid-template-columns: 140px 1fr 130px;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
}
.fun .bar {
  height: 30px;
  background: var(--bg);
  border-radius: 8px;
  overflow: hidden;
}
.fun .bar i {
  display: flex;
  align-items: center;
  height: 100%;
  background: linear-gradient(90deg, var(--brand-d), var(--brand));
  color: #fff;
  font-style: normal;
  font-weight: 800;
  padding-left: 10px;
  font-size: 12px;
  min-width: 30px;
  border-radius: 8px;
}
.fun .drop {
  font-size: 12px;
}
.list-mini .it {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.list-mini .it:last-child {
  border-bottom: 0;
}
.list-mini .it:hover .t {
  color: var(--brand-d);
}
.list-mini .t {
  font-weight: 700;
  color: var(--ink);
  font-size: 13px;
}
.list-mini .s {
  font-size: 12px;
  color: var(--muted);
}
.list-mini .rt {
  margin-left: auto;
  text-align: right;
  font-size: 12px;
}
.dotc {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 10px;
}
.empty {
  color: var(--muted);
  text-align: center;
  padding: 22px;
  font-size: 13px;
}
.legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  align-items: center;
}
.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.toolbar .sp {
  margin-left: auto;
}
/* ---------- drawer ---------- */
.dbg {
  position: fixed;
  inset: 0;
  background: rgba(11, 37, 64, 0.4);
  z-index: 80;
  display: none;
}
.dbg.open {
  display: block;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(800px, 100%);
  background: var(--bg);
  z-index: 90;
  transform: translateX(105%);
  transition: transform 0.25s;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.drawer.open {
  transform: none;
}
.dh {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.dh img {
  height: 30px;
  margin-top: 2px;
}
.dh h2 {
  margin: 0;
  font-size: 17px;
  color: var(--ink);
}
.dh .sub {
  color: var(--muted);
  font-size: 12px;
}
.dh .x {
  margin-left: auto;
}
.db {
  padding: 16px 18px;
}
.db .card {
  padding: 16px;
}
.actcard {
  border: 2px solid var(--brand) !important;
}
dl.kv {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 7px 12px;
  margin: 0;
  font-size: 13px;
}
dl.kv dt {
  color: var(--muted);
  font-weight: 600;
}
dl.kv dd {
  margin: 0;
  word-break: break-word;
}
.log td {
  white-space: normal;
  font-size: 12px;
}
/* ---------- popovers / modal / toast ---------- */
.pop {
  position: fixed;
  top: 64px;
  right: 16px;
  width: min(400px, calc(100% - 24px));
  max-height: 76vh;
  overflow-y: auto;
  background: var(--card);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  z-index: 70;
  display: none;
}
.pop.open {
  display: block;
}
.pop .ph {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
}
.ni {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  gap: 10px;
}
.ni:hover {
  background: var(--bg);
}
.ni.unread {
  background: var(--soft);
}
.ni .d {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex: 0 0 8px;
}
.ni.unread .d {
  background: var(--brand);
}
.ni.due .d {
  background: var(--amber);
}
.ni small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}
.uopt {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 9px 16px;
  cursor: pointer;
}
.uopt:hover {
  background: var(--bg);
}
.uopt.on {
  background: var(--brand-bg);
}
.uopt .av {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  font-size: 11px;
}
.ugh {
  padding: 8px 16px 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(11, 37, 64, 0.45);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal.open {
  display: flex;
}
.mbox {
  background: var(--card);
  border-radius: 16px;
  width: min(660px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  padding: 22px;
  box-shadow: var(--shadow-lg);
}
.mbox .mh {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.mbox .mh img {
  height: 34px;
}
.mbox h3 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
}
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--ink);
  color: #fff;
  padding: 11px 18px;
  border-radius: 12px;
  z-index: 120;
  font-size: 13px;
  opacity: 0;
  transition: 0.2s;
  pointer-events: none;
  max-width: 90%;
  box-shadow: var(--shadow-lg);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%);
}
.bnav {
  display: none;
}
.print-head {
  display: none;
}
/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .g32,
  .g2 {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 900px) {
  .sb {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .sb.open {
    transform: none;
  }
  .main {
    margin-left: 0;
    padding-bottom: 84px;
  }
  .top {
    padding: 10px 14px;
  }
  .top .ham {
    display: grid;
  }
  .top h1 {
    font-size: 17px;
  }
  .top .sub {
    display: none;
  }
  .content {
    padding: 14px;
  }
  .scope {
    max-width: 140px;
    font-size: 12px;
  }
  .newbtn span {
    display: none;
  }
  .bnav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--card);
    border-top: 1px solid var(--line);
    z-index: 50;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bnav button {
    flex: 1;
    border: 0;
    background: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--muted);
    padding: 4px 0;
    cursor: pointer;
    position: relative;
  }
  .bnav button.on {
    color: var(--brand-d);
  }
  .bnav .bd {
    position: absolute;
    top: 0;
    right: calc(50% - 20px);
    background: var(--amber);
    color: #fff;
    border-radius: 8px;
    font-size: 10px;
    padding: 0 5px;
    line-height: 15px;
  }
  .welcome img {
    display: none;
  }
  .toast {
    bottom: 90px;
  }
}
@media (max-width: 600px) {
  .f2 {
    grid-template-columns: 1fr;
  }
  dl.kv {
    grid-template-columns: 1fr;
  }
  dl.kv dd {
    margin-bottom: 6px;
  }
  .fun {
    grid-template-columns: 1fr;
    gap: 3px;
  }
  .fun .drop {
    margin-bottom: 8px;
  }
  .kpis {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .kpi {
    padding: 12px;
    gap: 10px;
  }
  .kpi .ic {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    border-radius: 10px;
  }
  .kpi .v {
    font-size: 16px;
  }
  .filters > div {
    min-width: calc(50% - 4px);
    flex: 1;
  }
  .col {
    flex-basis: 84vw;
  }
}
@media print {
  .sb,
  .top,
  .bnav,
  .filters,
  .toolbar,
  .drawer,
  .dbg,
  .pop,
  .noprint {
    display: none !important;
  }
  .main {
    margin: 0;
  }
  .content {
    padding: 0;
  }
  body {
    background: var(--card);
  }
  .print-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    border-bottom: 2px solid var(--brand);
    padding-bottom: 10px;
  }
  .print-head img {
    height: 50px;
  }
  .card,
  .tw {
    box-shadow: none;
    border: 0;
  }
  th {
    position: static;
  }
}

/* ---------- Log in / sign up ---------- */
body.locked .sb,
body.locked .main,
body.locked .bnav,
body.locked .scrim,
body.locked .pop,
body.locked .drawer,
body.locked .dbg {
  display: none !important;
}
#auth:empty {
  display: none;
}
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(360px, 520px);
  background: var(--bg);
}
.auth-brand {
  background: linear-gradient(160deg, var(--card) 0%, var(--card) 45%, var(--brand-bg) 100%);
  border-right: 1px solid var(--line);
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.auth-brand::after {
  content: '';
  position: absolute;
  right: -120px;
  bottom: -120px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  border: 36px solid rgba(13, 170, 215, 0.12);
}
.auth-brand img {
  width: 260px;
  max-width: 80%;
}
.auth-brand h1 {
  margin: 26px 0 4px;
  color: var(--ink);
  font-size: 28px;
  letter-spacing: -0.4px;
}
.auth-brand p {
  margin: 0 0 22px;
  color: var(--muted);
}
.auth-brand ul {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  display: grid;
  gap: 12px;
}
.auth-brand li {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--text2);
  font-weight: 600;
}
.auth-brand li svg {
  color: var(--brand);
}
.auth-brand small {
  color: var(--muted);
}
.auth-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px;
}
.auth-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 28px;
}
.auth-card h2 {
  margin: 4px 0 2px;
  color: var(--ink);
  font-size: 22px;
}
.auth-card form {
  margin-top: 14px;
}
.auth-card .note {
  margin: 12px 0 0;
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 18px;
}
.auth-tabs button {
  border: 0;
  background: none;
  padding: 9px;
  border-radius: 9px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}
.auth-tabs button.on {
  background: var(--card);
  color: var(--brand-d);
  box-shadow: var(--shadow);
}
.btn.wide {
  width: 100%;
  justify-content: center;
  padding: 12px;
  font-size: 15px;
  margin-top: 16px;
}
.auth-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.chk {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--text2);
}
.chk input {
  width: auto;
  margin: 0;
}
.pwbox {
  position: relative;
}
.pwbox input {
  padding-right: 64px;
}
.pwtog {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-38%);
  border: 0;
  background: none;
  color: var(--brand-d);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  padding: 6px;
}
.center {
  text-align: center;
  margin-top: 16px;
}
.auth-foot {
  text-align: center;
  margin-top: 14px;
}
.auth-done {
  text-align: center;
}
.auth-done .okc {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--greenbg);
  color: var(--green);
  display: grid;
  place-items: center;
  margin: 4px auto 12px;
}
details.demo {
  margin-top: 16px;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
}
details.demo summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--muted);
  font-size: 13px;
}
.demo-acc {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 10px;
  padding: 8px 10px;
  margin-top: 6px;
  cursor: pointer;
  font-size: 12px;
  text-align: left;
}
.demo-acc:hover {
  background: var(--brand-bg);
}
.demo-acc span {
  color: var(--muted);
}
code.temp {
  font-size: 16px;
  font-weight: 800;
  background: var(--brand-bg);
  color: var(--ink);
  padding: 4px 10px;
  border-radius: 8px;
  letter-spacing: 1px;
}
@media (max-width: 900px) {
  .auth-wrap {
    grid-template-columns: 1fr;
  }
  .auth-brand {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 22px 20px;
    align-items: center;
    text-align: center;
  }
  .auth-brand::after,
  .auth-brand ul,
  .auth-brand small {
    display: none;
  }
  .auth-brand img {
    width: 170px;
  }
  .auth-brand h1 {
    font-size: 20px;
    margin-top: 12px;
  }
  .auth-brand p {
    margin: 0;
    font-size: 13px;
  }
  .auth-side {
    padding: 16px;
    justify-content: flex-start;
  }
  .auth-card {
    padding: 20px;
  }
  .demo-acc {
    flex-direction: column;
  }
}

/* ---------- PO lines / handover (v3) ---------- */
.lineho {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  background: var(--soft);
}
optgroup {
  font-weight: 700;
}

/* ---------- v3.1: progress, claims, attachments ---------- */
.step {
  min-width: 58px;
}
.inl {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 6px;
}
.inl input,
.inl select {
  width: auto;
  margin: 0;
  padding: 6px 8px;
}
.pbar {
  position: relative;
  height: 16px;
  min-width: 110px;
  background: var(--greybg);
  border-radius: 8px;
  overflow: hidden;
  margin: 4px 0;
}
.pbar i {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--brand-d), var(--brand));
  border-radius: 8px;
}
.pbar span {
  position: relative;
  font-size: 11px;
  font-weight: 800;
  color: var(--ink);
  padding-left: 6px;
  line-height: 16px;
}
.card h3 .r .pbar {
  width: 140px;
  margin: 0;
}
.mslist {
  display: grid;
  gap: 6px;
}
.flist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 4px;
}
.flist li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
details.done-box {
  margin-top: 10px;
  border-top: 1px dashed var(--line);
  padding-top: 8px;
}
details.done-box summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--brand-d);
  font-size: 13px;
}

/* ---------- v3.3 calendar ---------- */
.calbar { padding: 12px 16px; }
.calnav { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.calnav h3 { margin: 0 0 0 6px; font-size: 18px; }
.calopts { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.calopts label { margin: 0; }
.calopts select { min-width: 170px; }
.calopts .sp { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: var(--card); padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text); }
.seg button.on { background: var(--brand); color: #fff; font-weight: 600; }
.callegend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; color: var(--muted); }
.callegend i, .dots i, .dotc.task, .dotc.reminder, .dotc.event, .dotc.sys { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.hol { --c: var(--red); }
.task { --c: var(--amber); }
.reminder { --c: var(--brand); }
.event { --c: var(--blue); }
.sys { --c: var(--grey); }
.callegend i, .dots i, .dotc.task, .dotc.reminder, .dotc.event, .dotc.sys { background: var(--c); }
.calwrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.calcard { padding: 8px; }
.calgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.calgrid .dh { font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; padding: 4px 0; }
.cd { min-height: 96px; border: 1px solid var(--line); border-radius: 10px; padding: 4px; cursor: pointer; background: var(--card); overflow: hidden; }
.cd:hover { border-color: var(--brand); }
.cd.other { background: var(--bg); opacity: 0.6; }
.cd.we { background: var(--soft); }
.cd.hol { background: var(--redbg); }
.cd.today .dn { background: var(--brand); color: #fff; }
.cd.sel { outline: 2px solid var(--brand); outline-offset: -1px; }
.cd .dn { display: inline-block; min-width: 24px; height: 24px; line-height: 24px; text-align: center; border-radius: 12px; font-size: 13px; font-weight: 700; }
.ce { font-size: 11px; line-height: 1.3; padding: 2px 5px; border-radius: 5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: color-mix(in srgb, var(--c, var(--grey)) 14%, var(--card)); color: var(--c, var(--grey)); border-left: 3px solid var(--c, var(--grey)); }
.ce.hol { font-weight: 600; }
.ce small { font-weight: 400; opacity: 0.8; }
.ce.more { background: none; border: 0; color: var(--muted); }
.ce.done { text-decoration: line-through; opacity: 0.6; }
.dots { display: none; }
.calday h3, #calAgenda h3 { margin-top: 0; }
.cal-it { border: 1px solid var(--line); border-left: 4px solid var(--c, var(--grey)); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; }
.cal-it.done { opacity: 0.65; }
.cal-it.click { cursor: pointer; }
.cal-it.click:hover { background: var(--bg); }
.cal-it .btn { margin-top: 6px; }
.agday { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.agd { flex: 0 0 52px; text-align: center; display: flex; flex-direction: column; line-height: 1.2; }
.agd b { font-size: 22px; }
.agd span, .agd small { color: var(--muted); font-size: 12px; }
.agl { flex: 1; min-width: 0; }
.picker { border: 1px solid var(--line); border-radius: 10px; padding: 8px; max-height: 220px; overflow: auto; margin-top: 6px; }
.picker.dis { opacity: 0.4; pointer-events: none; }
.picker input#ci_q { margin-bottom: 6px; }
.picker .pg { margin-bottom: 6px; }
.picker .pg > b { display: block; font-size: 12px; color: var(--muted); margin: 4px 0; }
.picker .chk { display: flex; padding: 3px 0; }
@media (max-width: 1100px) {
  .calwrap { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .cd { min-height: 54px; padding: 3px; }
  .ce { display: none; }
  .dots { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 2px; }
  .dots i { width: 7px; height: 7px; margin: 0; }
  .calopts .sp { display: none; }
  .calopts > button { width: 100%; }
  .calopts select { min-width: 0; width: 100%; }
  .calopts > div:first-child { flex: 1 1 100%; }
}
@media print {
  .calopts, .calnav button, .calday .actions { display: none; }
}

/* ---------- v3.4 reports & targets ---------- */
.repbar { padding: 12px 16px; }
.reptabs { display: flex; flex-wrap: wrap; gap: 6px; }
.reptabs button { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text); }
.reptabs button.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.rep-sheet h3 { margin-bottom: 6px; }
.rep-bt { margin: 16px 0 6px; font-size: 14px; color: var(--ink); }
.rep-tw { max-height: 70vh; }
table.rep { font-size: 12px; }
table.rep th { white-space: normal; min-width: 70px; text-align: center; vertical-align: middle; }
table.rep th.grp { background: var(--brand-bg); color: var(--ink); }
table.rep td { white-space: nowrap; }
table.rep td.wrap { white-space: normal; min-width: 220px; }
table.rep tr.subtot td { background: var(--brand-bg); }
table.rep tfoot td { font-weight: 700; background: var(--greybg); }
@media print {
  .repbar .reptabs, .repbar .filters, .repbar .toolbar button { display: none; }
  .rep-tw { max-height: none; overflow: visible; }
  table.rep { font-size: 9px; }
}

/* ---------- v3.5 previous-year job form & historical data ---------- */
.mbox.wide { width: min(980px, 100%); }
table.hist input { width: 110px; text-align: right; padding: 6px 8px; }
table.hist td { padding: 3px 4px; }
.seg { flex-wrap: wrap; max-width: 100%; }
@media (max-width: 600px) {
  .seg button { padding: 7px 9px; font-size: 12px; }
}

/* v4.0 online: save status, loading spinner */
.sync {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  background: var(--greybg);
  color: var(--grey);
}
.sync:empty {
  display: none;
}
.sync i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.sync.ok {
  background: var(--greenbg);
  color: var(--green);
}
.sync.busy {
  background: var(--bluebg);
  color: var(--blue);
}
.sync.busy i {
  animation: syncp 1s infinite alternate;
}
.sync.warn {
  background: var(--amberbg);
  color: var(--amber);
}
.sync.bad {
  background: var(--redbg);
  color: var(--red);
}
@keyframes syncp {
  to {
    opacity: 0.2;
  }
}
.spin {
  width: 34px;
  height: 34px;
  margin: 10px auto 14px;
  border: 3px solid var(--brand-bg);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (max-width: 640px) {
  .sync {
    padding: 4px 8px;
    font-size: 0;
    gap: 0;
  }
  .sync i {
    width: 10px;
    height: 10px;
  }
}

/* ===== v4.2 Dark (navy) theme – html[data-theme='dark']; light theme = the :root values above ===== */
:root[data-theme='dark'] {
  --brand: #19b6e3;
  --brand-d: #0daad7;
  --brand-bg: rgba(13, 170, 215, 0.16);
  --ink: #eaf2fb;
  --text: #cfdbea;
  --text2: #b7c6d9;
  --muted: #8ea0b8;
  --muted2: #6f829c;
  --line: #1e3556;
  --line2: #2b4770;
  --bg: #071325;
  --card: #0e1e36;
  --soft: #12284a;
  --green: #4ade80;
  --greenbg: rgba(74, 222, 128, 0.14);
  --amber: #fbbf24;
  --amberbg: rgba(251, 191, 36, 0.14);
  --red: #f87171;
  --redbg: rgba(248, 113, 113, 0.15);
  --redline: rgba(248, 113, 113, 0.4);
  --grey: #a3b1c4;
  --greybg: rgba(148, 163, 184, 0.14);
  --blue: #60a5fa;
  --bluebg: rgba(96, 165, 250, 0.15);
  --infotext: #7dd3fc;
  --warntext: #fcd34d;
  --badtext: #fca5a5;
  --topbg: rgba(7, 19, 37, 0.86);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);
  --glow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 8px 24px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}
:root[data-theme='dark'] body {
  background: radial-gradient(1200px 600px at 80% -10%, rgba(13, 170, 215, 0.12), transparent 60%), radial-gradient(900px 500px at -10% 110%, rgba(124, 58, 237, 0.1), transparent 60%), var(--bg);
  background-attachment: fixed;
}
:root[data-theme='dark'] .card,
:root[data-theme='dark'] .kpi {
  border-color: var(--line);
  box-shadow: var(--glow);
}
:root[data-theme='dark'] .logo img,
:root[data-theme='dark'] .auth-brand > img,
:root[data-theme='dark'] .print-head img,
:root[data-theme='dark'] .mh img {
  background: #fff;
  border-radius: 8px;
  padding: 4px 8px;
}
:root[data-theme='dark'] input,
:root[data-theme='dark'] select,
:root[data-theme='dark'] textarea {
  background: var(--soft);
  color: var(--ink);
}
:root[data-theme='dark'] .pill.p-brand {
  color: var(--brand);
}
.themebtn svg {
  width: 19px;
  height: 19px;
}
@media print {
  :root[data-theme='dark'] {
    --ink: #0b2540; --text: #1f2a3c; --text2: #344054; --muted: #667085; --muted2: #98a2b3; --line: #e4e9f0; --line2: #d0d5dd;
    --bg: #fff; --card: #fff; --soft: #f8fafc; --brand-bg: #e7f6fc; --green: #15803d; --greenbg: #dcfce7; --amber: #b45309; --amberbg: #fef3c7;
    --red: #dc2626; --redbg: #fee2e2; --grey: #4b5563; --greybg: #eef1f5; --blue: #1d4ed8; --bluebg: #dbeafe; --infotext: #075e78; --warntext: #7c3d06; --badtext: #991b1b;
    color-scheme: light;
  }
  :root[data-theme='dark'] body { background: #fff; }
}

/* ===== v4.2 Dashboard ===== */
.t-green { color: var(--green); font-weight: 700; }
.t-amber { color: var(--amber); font-weight: 700; }
.dbanner { position: relative; border-radius: calc(var(--r) + 4px); margin-bottom: 16px; overflow: hidden; color: #fff;
  background: radial-gradient(600px 220px at 85% 0%, rgba(25, 182, 227, 0.55), transparent 70%), linear-gradient(120deg, #06213f 0%, #0b3a63 55%, #0a6c8f 100%); box-shadow: var(--shadow); }
.dbanner.img { background: linear-gradient(100deg, rgba(5, 20, 40, 0.92) 0%, rgba(5, 20, 40, 0.7) 45%, rgba(5, 20, 40, 0.15) 100%), var(--bimg) center / cover no-repeat; }
.dbanner::after { content: ''; position: absolute; inset: auto -60px -80px auto; width: 260px; height: 260px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.08); pointer-events: none; }
.dbanner .welcome { background: none; border: 0; box-shadow: none; margin: 0; padding: 22px 24px; min-height: 132px; align-items: stretch; }
.dbanner .welcome h2 { color: #fff; font-size: 22px; margin-top: 6px; }
.dbanner .welcome p { color: rgba(255, 255, 255, 0.82); max-width: 720px; }
.dbanner .welcome a { color: #8be3fb; }
.dbanner .bt { flex: 1; min-width: 0; }
.bdate { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, 0.85); background: rgba(255, 255, 255, 0.12); padding: 4px 10px; border-radius: 999px; }
.bslogan { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 8px; text-align: right; }
.bslogan img { height: 40px; background: #fff; border-radius: 8px; padding: 4px 8px; margin: 0 !important; }
.bslogan span { font-size: 11px; color: rgba(255, 255, 255, 0.75); letter-spacing: 0.02em; }
.kpis2 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpis2.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi2 { position: relative; overflow: hidden; border-radius: var(--r); padding: 14px 14px 10px; border: 1px solid color-mix(in srgb, var(--kc) 35%, var(--line));
  background: linear-gradient(160deg, color-mix(in srgb, var(--kc) 16%, var(--card)) 0%, var(--card) 70%); box-shadow: var(--shadow); min-height: 128px; }
:root[data-theme='dark'] .kpi2 { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03), 0 10px 28px color-mix(in srgb, var(--kc) 18%, transparent); }
.kpi2 .kt { display: flex; align-items: center; gap: 8px; }
.kpi2 .ki { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--kc); box-shadow: 0 0 14px color-mix(in srgb, var(--kc) 55%, transparent); }
.kpi2 .kl { font-size: 12px; color: var(--muted); font-weight: 600; line-height: 1.25; }
.kpi2 .kv { font-size: 22px; font-weight: 800; color: var(--ink); margin: 8px 0 2px; letter-spacing: -0.01em; }
.kpi2 .kb { font-size: 11px; display: flex; gap: 6px; flex-wrap: wrap; position: relative; z-index: 1; color: var(--muted); }
.kpi2 .kd { font-weight: 700; color: var(--muted); }
.kpi2 .kd.up { color: var(--green); }
.kpi2 .kd.dn { color: var(--red); }
.kpi2 .spark { position: absolute; right: 8px; bottom: 6px; width: 46%; height: 34px; opacity: 0.95; }
.dgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.dgrid > .card { margin: 0; min-width: 0; }
.dgrid > .span2 { grid-column: span 2; }
.dgrid > .span3 { grid-column: 1 / -1; }
.lchart { width: 100%; height: auto; display: block; }
.lchart .gl { stroke: var(--line); stroke-width: 1; }
.lchart .ax, .gauge .ax { fill: var(--muted); font-size: 11px; }
.legend { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.legend.row { flex-direction: row; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; }
.legend .lg { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text); min-width: 0; }
.legend .lg i { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 10px; }
.legend .lg span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.legend .lg b { color: var(--ink); font-size: 12px; }
.legend .lg em { font-style: normal; color: var(--muted); width: 34px; text-align: right; }
.legend.row .lg span { flex: none; }
.donutbox { display: flex; align-items: center; gap: 16px; }
.donut { width: 150px; flex: 0 0 150px; }
.donut .dc1 { fill: var(--ink); font-size: 15px; font-weight: 800; }
.donut .dc2 { fill: var(--muted); font-size: 10px; }
.donutbox .legend { flex: 1; }
.hbars { display: flex; flex-direction: column; gap: 9px; }
.hb { display: grid; grid-template-columns: 140px minmax(0, 1fr) 130px; gap: 10px; align-items: center; font-size: 12px; }
.hb .hl { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb .ht { position: relative; height: 12px; background: var(--soft); border-radius: 6px; }
.hb .ht i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; }
.hb .ht b { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1px; border-radius: 2px; background: var(--ink); opacity: 0.75; }
.hb .hv { text-align: right; font-weight: 700; color: var(--ink); white-space: nowrap; }
.gauge { width: 100%; max-width: 260px; display: block; margin: 0 auto; }
.gauge .gv { fill: var(--ink); font-size: 26px; font-weight: 800; }
.gstat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; text-align: center; }
.gpair { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.gpair .gstat { grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); }
.gstat div { display: flex; flex-direction: column; gap: 2px; }
.gstat b { color: var(--ink); }
.insights .ins { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 10px; font-size: 13px; color: var(--text); margin-bottom: 6px; background: var(--soft); border-left: 3px solid var(--muted2); }
.insights .ins.click { cursor: pointer; }
.insights .ins.click:hover { filter: brightness(1.06); }
.insights .ins b { color: var(--ink); }
.insights .ii { flex: 0 0 auto; display: grid; place-items: center; margin-top: 1px; }
.insights .ins.good { border-left-color: var(--green); } .insights .ins.good .ii { color: var(--green); }
.insights .ins.info { border-left-color: var(--brand); } .insights .ins.info .ii { color: var(--brand); }
.insights .ins.warn { border-left-color: var(--amber); } .insights .ins.warn .ii { color: var(--amber); }
.insights .ins.bad { border-left-color: var(--red); } .insights .ins.bad .ii { color: var(--red); }
.qa { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.qab { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--soft); color: var(--text); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; text-align: center; }
.qab:hover { border-color: var(--kc); }
.qab span { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--kc); box-shadow: 0 0 16px color-mix(in srgb, var(--kc) 50%, transparent); }
@media (max-width: 1350px) {
  .kpis2 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .dgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dgrid > .span2, .dgrid > .span3 { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .kpis2, .kpis2.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi2 { min-height: 112px; padding: 12px 12px 8px; }
  .kpi2 .kv { font-size: 18px; }
  .kpi2 .spark { width: 40%; height: 26px; }
  .dgrid { grid-template-columns: minmax(0, 1fr); }
  .dbanner .welcome { padding: 16px; min-height: 0; }
  .dbanner .welcome h2 { font-size: 18px; }
  .bslogan { display: none; }
  .donutbox { flex-direction: column; align-items: stretch; }
  .donut { margin: 0 auto; }
  .hb { grid-template-columns: 96px minmax(0, 1fr) 92px; font-size: 11px; }
  .qa { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media print {
  .dbanner { color: #000; background: none !important; border: 1px solid #ccc; }
  .dbanner .welcome h2, .dbanner .welcome p { color: #000; }
  .qa, .themebtn { display: none; }
}
.bprev { height: 120px; border-radius: 10px; background: center / cover no-repeat; border: 1px solid var(--line); margin-bottom: 6px; }

/* ===== v4.3 Login (two panels) ===== */
.auth-wrap2 { display: flex; align-items: center; justify-content: center; padding: 28px; grid-template-columns: none;
  background: radial-gradient(900px 500px at 15% 10%, rgba(13, 170, 215, 0.18), transparent 60%), radial-gradient(800px 500px at 100% 100%, rgba(124, 58, 237, 0.12), transparent 60%), var(--bg); }
.auth-shell { width: min(1120px, 100%); min-height: min(680px, calc(100vh - 56px)); display: grid; grid-template-columns: 1.1fr 1fr; background: var(--card); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow-lg); overflow: hidden; }
.auth-wrap2 .auth-brand.auth-hero { margin: 12px; border-radius: 22px; border: 0; padding: 26px 30px; display: flex; flex-direction: column; justify-content: space-between; text-align: left; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(520px 320px at 80% 15%, rgba(25, 182, 227, 0.45), transparent 70%), radial-gradient(420px 300px at 0% 100%, rgba(124, 58, 237, 0.35), transparent 70%), linear-gradient(150deg, #051a33 0%, #0a3358 55%, #0a5f80 100%); }
.auth-wrap2 .auth-hero.img { background: linear-gradient(180deg, rgba(4, 16, 32, 0.55) 0%, rgba(4, 16, 32, 0.35) 40%, rgba(4, 16, 32, 0.85) 100%), var(--limg) center / cover no-repeat; }
.auth-wrap2 .auth-hero::after { content: ''; position: absolute; right: -90px; top: -90px; width: 300px; height: 300px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.1); box-shadow: 0 0 0 40px rgba(255, 255, 255, 0.03), 0 0 0 90px rgba(255, 255, 255, 0.02); pointer-events: none; }
.ah-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, 0.9); position: relative; z-index: 1; }
.ah-top a { color: #fff; border: 1px solid rgba(255, 255, 255, 0.45); padding: 6px 14px; border-radius: 999px; text-decoration: none; font-size: 12px; }
.ah-top a:hover { background: rgba(255, 255, 255, 0.12); }
.ah-mid { text-align: center; position: relative; z-index: 1; padding: 20px 0; }
.auth-wrap2 .ah-mid img { width: 240px; max-width: 75%; background: #fff; border-radius: 14px; padding: 10px 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }
.auth-wrap2 .ah-mid h1 { color: #fff; font-size: 30px; margin: 20px 0 6px; letter-spacing: -0.4px; }
.auth-wrap2 .ah-mid p { color: rgba(255, 255, 255, 0.82); margin: 0; font-size: 14px; }
.ah-slide { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; position: relative; z-index: 1; }
.ah-sl { display: flex; flex-direction: column; gap: 4px; max-width: 360px; min-height: 64px; }
.ah-sl b { font-size: 16px; color: #fff; }
.ah-sl span { font-size: 13px; color: rgba(255, 255, 255, 0.8); line-height: 1.45; }
.ah-sl.in { animation: ahin 0.45s ease; }
@keyframes ahin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ah-nav { display: flex; align-items: center; gap: 8px; }
.ah-nav button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.5); background: rgba(255, 255, 255, 0.06); color: #fff; display: grid; place-items: center; cursor: pointer; }
.ah-nav button:hover { background: rgba(255, 255, 255, 0.18); }
.ah-dots { display: flex; gap: 5px; margin-right: 6px; }
.ah-dots i { width: 7px; height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.4); transition: width 0.3s; }
.ah-dots i.on { width: 20px; background: #fff; }
.auth-wrap2 .auth-hero small { position: absolute; right: 30px; bottom: 6px; color: rgba(255, 255, 255, 0.45); font-size: 10px; z-index: 1; }
.auth-wrap2 .auth-side { padding: 28px 40px; justify-content: center; }
.auth-wrap2 .auth-card { background: none; border: 0; box-shadow: none; padding: 0; max-width: 400px; width: 100%; margin: 0 auto; }
.auth-wrap2 .auth-card .alogo { height: 44px; display: block; margin: 0 auto 18px; }
:root[data-theme='dark'] .auth-wrap2 .auth-card .alogo { background: #fff; border-radius: 10px; padding: 5px 10px; }
.auth-wrap2 .auth-card h2 { text-align: center; font-size: 30px; margin-top: 0; }
.auth-wrap2 .auth-card h2 + p { text-align: center; }
.auth-wrap2 .auth-card input { padding: 12px 14px; border-radius: 12px; }
.auth-wrap2 .auth-card .btn.pri.wide { padding: 13px; border-radius: 999px; font-size: 15px; box-shadow: 0 8px 22px rgba(13, 170, 215, 0.35); }
.auth-links { display: flex; justify-content: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.auth-links:empty { display: none; }
.auth-links a { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--text2); background: var(--soft); border: 1px solid var(--line); transition: transform 0.15s, color 0.15s; }
.auth-links a:hover { color: var(--brand); transform: translateY(-2px); }
@media (max-width: 900px) {
  .auth-wrap2 { padding: 0; align-items: stretch; }
  .auth-shell { grid-template-columns: 1fr; border-radius: 0; border: 0; min-height: 100vh; }
  .auth-wrap2 .auth-brand.auth-hero { margin: 10px 10px 0; padding: 16px 18px; border-radius: 18px; min-height: 0; }
  .auth-wrap2 .ah-mid { padding: 10px 0; }
  .auth-wrap2 .ah-mid img { width: 150px; padding: 6px 10px; }
  .auth-wrap2 .ah-mid h1 { font-size: 20px; margin-top: 12px; }
  .auth-wrap2 .ah-mid p { font-size: 12px; }
  .ah-sl { min-height: 0; }
  .ah-sl span { display: none; }
  .ah-nav button { width: 32px; height: 32px; }
  .auth-wrap2 .auth-side { padding: 20px 18px 28px; justify-content: flex-start; }
  .auth-wrap2 .auth-card .alogo { display: none; }
  .auth-wrap2 .auth-card h2 { font-size: 24px; }
}
.lgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.lgc { border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; background: var(--soft); }
.lgp { height: 64px; display: grid; place-items: center; background: #fff; border-radius: 8px; margin-bottom: 8px; padding: 6px; }
.lgp img { max-height: 52px; max-width: 100%; }
.sb .logo .lmark { display: none; }

/* ===== v4.3 Tablet & phone ===== */
/* tablet landscape / small laptop: menu shows icons only */
@media (min-width: 901px) and (max-width: 1280px) {
  :root { --sb: 76px; }
  .sb nav { padding: 8px; }
  .sb .logo { padding: 14px 8px 10px; text-align: center; }
  .sb .logo #sbLogo, .sb .logo small { display: none; }
  .sb .logo .lmark { display: inline-block; width: 42px; height: 42px; object-fit: contain; border-radius: 10px; }
  .sb .grp { font-size: 0; height: 1px; background: var(--line); margin: 10px 8px; }
  .sb .nv { justify-content: center; padding: 11px 0; position: relative; }
  .sb .nv .nt { display: none; }
  .sb .nv .bd { position: absolute; top: 3px; right: 8px; margin: 0; }
  .sb .me { justify-content: center; padding: 12px 6px; }
  .sb .me > :not(.av) { display: none; }
}
/* tablet portrait: job panel uses part of the screen */
@media (min-width: 641px) and (max-width: 900px) {
  .drawer { width: max(62%, 460px); }
}
/* lists as cards on phone & tablet portrait */
.fbtn { display: none; }
.lcards { display: flex; flex-direction: column; gap: 10px; }
.lcard { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--card); cursor: pointer; box-shadow: var(--shadow); }
.lcard:active { transform: scale(0.99); }
.lcard .lc1 { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.lcard .lid { font-size: 12px; font-weight: 700; color: var(--brand); }
.lcard .lt { font-weight: 700; color: var(--ink); margin: 3px 0 4px; font-size: 14px; }
.lcard .lm { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.lcard .lv { font-weight: 800; color: var(--ink); white-space: nowrap; font-size: 14px; }
.lcard .lc2 { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
.lcards .ltot { font-size: 12px; color: var(--muted); text-align: right; padding: 0 4px; }
@media (max-width: 900px) {
  .fbtn { display: inline-flex; }
  .filters.coll:not(.open) > div:not(.grow) { display: none; }
  .filters.coll:not(.open) { grid-template-columns: 1fr; }
  #lrows.cards { overflow: visible; border: 0; }
}
.langseg { display: inline-flex; border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 999px; overflow: hidden; font-size: 11px; }
.langseg button { border: 0; background: none; color: inherit; padding: 4px 10px; font: inherit; font-weight: 700; cursor: pointer; opacity: 0.75; }
.langseg button.on { background: rgba(255, 255, 255, 0.92); color: #0b2540; opacity: 1; }
.btop { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dbanner .langseg { color: #fff; }
.auth-wrap2 .auth-side .langseg { color: var(--text2); border-color: var(--line2); align-self: flex-end; margin-bottom: 8px; }
.auth-wrap2 .auth-side .langseg button.on { background: var(--brand); color: #fff; }
.lted { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-top: 12px; background: var(--soft); }
.lted-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.ltsl { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 8px; align-items: center; margin-top: 10px; }
.ltsl textarea { grid-column: 2; min-height: 0; }
.ltsl .btn { grid-column: 3; grid-row: 1; }
.chk.mp { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; background: var(--soft); cursor: pointer; }
.chk.mp input { margin-top: 3px; }
.chk.mp b { display: block; color: var(--ink); }
.chk.mp span { display: block; margin-top: 2px; }
/* v4.6.1 toast readable in the dark theme */
:root[data-theme='dark'] .toast { background: #1b3a63; color: #fff; border: 1px solid #2f5a8c; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6); }
