
:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --surface2: #f2f1ed;
  --border: #e4e2db;
  --border2: #d0cec5;
  --text: #1a1916;
  --text2: #6b6860;
  --text3: #9c9a94;
  --accent: #0d613f;
  --accent-bg: #e7f1ec;
  --blue: #185fa5;
  --blue-bg: #e8f1fa;
  --green: #0d613f;
  --green-bg: #e7f1ec;
  --amber: #8a5200;
  --amber-bg: #fdf3e0;
  --red: #a32d2d;
  --red-bg: #fdf0f0;
  --purple: #534ab7;
  --purple-bg: #f0effe;
  --gray: #5f5e5a;
  --gray-bg: #f1f0ec;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  height: 100vh;
  overflow: hidden;
}

/* ── LAYOUT ─────────────────────────────── */
.app { display: flex; height: 100vh; }

.sidebar {
  width: 228px;
  min-width: 228px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.logo-area {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.logo-icon {
  width: 28px; height: 28px;
  background: var(--accent);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}

.logo-icon svg { width: 16px; height: 16px; fill: #fff; }

.logo-name { font-size: 15px; font-weight: 600; letter-spacing: -.3px; }

.logo-sub { font-size: 11px; color: var(--text2); }

.nav { padding: 12px 10px; flex: 1; overflow-y: auto; }

.nav-section { margin-bottom: 4px; }

.nav-group-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text3);
  padding: 8px 8px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  color: var(--text2);
  transition: all .12s;
  user-select: none;
}

.nav-item:hover { background: var(--surface2); color: var(--text); }

.nav-item.active {
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 500;
}

.nav-icon {
  width: 18px; height: 18px; flex-shrink: 0;
  opacity: .7;
}

.nav-item.active .nav-icon { opacity: 1; }

.sidebar-footer {
  padding: 10px;
  border-top: 1px solid var(--border);
}

.user-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
}

.user-chip:hover { background: var(--surface2); }

.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--blue-bg);
  color: var(--blue);
  font-size: 11px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.avatar-sm {
  width: 24px; height: 24px;
  font-size: 9px;
}

.user-name { font-size: 13px; font-weight: 500; }
.user-role { font-size: 11px; color: var(--text3); }

/* ── MAIN ───────────────────────────────── */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.topbar-left { display: flex; align-items: center; gap: 12px; }

.breadcrumb {
  font-size: 12px;
  color: var(--text3);
  display: flex; align-items: center; gap: 6px;
}

.breadcrumb-sep { color: var(--border2); }

.page-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.3px;
}

.topbar-right { display: flex; align-items: center; gap: 10px; }

.notif-btn {
  position: relative;
  width: 34px; height: 34px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text2);
}

.notif-btn:hover { background: var(--surface2); }

.notif-badge {
  position: absolute;
  top: -3px; right: -3px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
  border-radius: 9px;
  border: 1.5px solid var(--surface);
  display: flex; align-items: center; justify-content: center;
  box-sizing: border-box;
}

#notif-panel {
  position: fixed; top: 58px; right: 18px; z-index: 1000;
  width: 360px; max-width: calc(100vw - 36px); max-height: 72vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: 0 12px 40px rgba(0,0,0,.18);
  display: none;
}
.notif-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--text);
  position: sticky; top: 0; background: var(--surface);
}
.notif-readall { background: none; border: none; color: var(--blue); font-size: 12px; cursor: pointer; padding: 0; }
.notif-empty { padding: 28px 16px; text-align: center; color: var(--text3); font-size: 13px; }
.notif-item {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.notif-item:hover { background: var(--surface2); }
.notif-item.unread { background: var(--blue-bg); }
.notif-item.unread:hover { background: var(--blue-bg); filter: brightness(.98); }
.notif-ico { flex: 0 0 auto; font-size: 16px; line-height: 1.3; }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 13px; font-weight: 500; color: var(--text); }
.notif-sub { font-size: 12px; color: var(--text2); margin-top: 2px; }
.notif-time { font-size: 11px; color: var(--text3); margin-top: 4px; }
.notif-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 5px; }

/* ── CONTENT ─────────────────────────────── */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 22px 24px;
}

.screen { display: none; }
.screen.active { display: block; }

/* ── METRICS GRID ────────────────────────── */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}

.metric-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 8px;
}

.metric-value {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -.5px;
  line-height: 1;
  margin-bottom: 5px;
}

.metric-sub { font-size: 11px; color: var(--text3); }
.up { color: var(--green); }
.dn { color: var(--red); }

/* ── CARDS ───────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}

.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title { font-size: 13px; font-weight: 600; }
.card-sub { font-size: 11px; color: var(--text3); margin-top: 2px; }

.card-body { padding: 16px 18px; }

/* ── TABLES ──────────────────────────────── */
.tbl-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 12.5px; }

thead th {
  padding: 9px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .05em;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #faf9f7; }

/* ── BADGES ──────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.b-green { background: var(--green-bg); color: var(--green); }
.b-blue { background: var(--blue-bg); color: var(--blue); }
.b-amber { background: var(--amber-bg); color: var(--amber); }
.b-red { background: var(--red-bg); color: var(--red); }
.b-gray { background: var(--gray-bg); color: var(--gray); }
.b-purple { background: var(--purple-bg); color: var(--purple); }
.b-accent { background: var(--accent-bg); color: var(--accent); }

/* ── BUTTONS ─────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  border-radius: var(--radius);
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all .12s;
  white-space: nowrap;
}

.btn:hover { background: var(--surface2); border-color: var(--border2); }
.btn-sm { padding: 5px 10px; font-size: 11px; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: #0a4e32; border-color: #0a4e32; }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text2);
}

.btn-ghost:hover { background: var(--surface2); border-color: var(--border); }

/* ── TABS ────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.tab {
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all .12s;
}

.tab:hover { color: var(--text2); }

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── TWO / THREE COL ─────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── DETAIL GRID ─────────────────────────── */
.dl {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 12px;
  font-size: 12.5px;
}

.dl-key { color: var(--text3); font-weight: 500; }

/* ── PROGRESS BAR ────────────────────────── */
.prog-wrap {
  height: 5px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
}

.prog-fill { height: 100%; border-radius: 99px; }

/* ── TIMELINE ────────────────────────────── */
.timeline { position: relative; padding-left: 20px; }

.timeline::before {
  content: '';
  position: absolute;
  left: 5px; top: 6px; bottom: 6px;
  width: 1px;
  background: var(--border2);
}

.tl-item { position: relative; padding-bottom: 16px; }

.tl-dot {
  position: absolute;
  left: -17px; top: 4px;
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 2px solid var(--border2);
  background: var(--surface);
}

.tl-dot.done { background: var(--green); border-color: var(--green); }
.tl-dot.active { background: var(--blue); border-color: var(--blue); }

.tl-label { font-size: 12.5px; font-weight: 500; }
.tl-sub { font-size: 11px; color: var(--text3); margin-top: 2px; }

/* ── TASK LIST ───────────────────────────── */
.task-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.task-row:last-child { border-bottom: none; }

.task-chk {
  width: 16px; height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--border2);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  transition: all .12s;
}

.task-chk.done {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.task-text { font-size: 13px; margin-bottom: 2px; }
.task-text.done { text-decoration: line-through; color: var(--text3); }
.task-meta-txt { font-size: 11px; color: var(--text3); }

/* ── PIPELINE BARS ───────────────────────── */
.pip-row { margin-bottom: 12px; }
.pip-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--text3); margin-bottom: 4px; }
.pip-labels span:last-child { font-weight: 500; color: var(--text); }

/* ── SEARCH ──────────────────────────────── */
.search-input {
  padding: 6px 12px;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  background: var(--surface2);
  font-size: 12px;
  color: var(--text);
  font-family: inherit;
  width: 200px;
  outline: none;
}

.search-input:focus { border-color: var(--blue); background: var(--surface); }

/* ── SELECT ──────────────────────────────── */
.sel {
  padding: 6px 10px;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  background: var(--surface2);
  font-size: 12px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

/* ── INFO PANEL ──────────────────────────── */
.info-panel {
  background: var(--surface2);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}

.info-panel-title { font-size: 12px; font-weight: 600; margin-bottom: 10px; }

/* ── BAR CHART ───────────────────────────── */
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 110px; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; }
.bar { width: 100%; border-radius: 4px 4px 0 0; background: var(--blue-bg); min-width: 20px; }
.bar-label { font-size: 10px; color: var(--text3); }
.bar-val { font-size: 10px; color: var(--text2); font-weight: 500; }

/* ── KPI GAUGE ───────────────────────────── */
.kpi-big {
  text-align: center;
  padding: 16px 0 8px;
}

.kpi-num { font-size: 38px; font-weight: 700; letter-spacing: -1px; line-height: 1; }
.kpi-sub { font-size: 11px; color: var(--text3); margin-top: 4px; }

/* ── CHIP ROW ────────────────────────────── */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* ── OVERDUE HIGHLIGHT ───────────────────── */
.overdue-text { color: var(--red); font-weight: 600; }

/* ── LINK STYLE ──────────────────────────── */
.link-text { color: var(--blue); cursor: pointer; }
.link-text:hover { text-decoration: underline; }

/* ── SECTION TABS PANELS ─────────────────── */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── UTILITY ─────────────────────────────── */
.flex-row { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }
.mb12 { margin-bottom: 12px; }

/* ── DOC ROW ─────────────────────────────── */
.doc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--radius);
  background: var(--surface2);
  margin-bottom: 6px;
}

.doc-row:hover { background: var(--border); }
.doc-name { font-size: 12.5px; display: flex; align-items: center; gap: 8px; }

/* ── CONTACT ROW ─────────────────────────── */
.contact-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.contact-row:last-child { border-bottom: none; }
.contact-info .name { font-size: 13px; font-weight: 500; }
.contact-info .role { font-size: 11px; color: var(--text3); }

/* ── SCROLLBAR ───────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }

/* ── LOGIN ───────────────────────────────── */
.login-wrap {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px rgba(0,0,0,.06);
  padding: 30px 28px 26px;
}
.login-brand { display:flex; align-items:center; gap:10px; margin-bottom:4px; }
.login-brand .logo-icon { width:32px; height:32px; }
.login-brand .logo-icon svg { width:18px; height:18px; }
.login-title { font-size:18px; font-weight:600; letter-spacing:-.3px; }
.login-sub { font-size:12px; color:var(--text2); margin-bottom:22px; }
.field { margin-bottom:14px; }
.field label { display:block; font-size:11px; font-weight:600; letter-spacing:.04em;
  text-transform:uppercase; color:var(--text3); margin-bottom:6px; }
.field input {
  width:100%; padding:10px 12px; font-size:13px; font-family:inherit;
  color:var(--text); background:var(--surface2);
  border:1px solid var(--border2); border-radius:var(--radius); outline:none;
  transition:all .12s;
}
.field input:focus { border-color:var(--blue); background:var(--surface); }
.login-btn { width:100%; justify-content:center; padding:11px; font-size:13px; margin-top:6px; }
.login-error {
  background:var(--red-bg); color:var(--red); font-size:12px;
  padding:9px 12px; border-radius:var(--radius); margin-bottom:14px; display:none;
}
.login-error.show { display:block; }
.login-foot { margin-top:18px; text-align:center; font-size:11px; color:var(--text3); }

/* ── MODAL ───────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(26,25,22,.38);
  display: none; align-items: center; justify-content: center;
  z-index: 50; padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal-card {
  width: 100%; max-width: 460px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
  max-height: 90vh; overflow-y: auto;
}
.modal-head {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 15px; font-weight: 600; }
.modal-close { cursor: pointer; color: var(--text3); font-size: 18px; line-height: 1; background: none; border: none; }
.modal-body { padding: 18px 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.form-row { margin-bottom: 13px; }
.form-row label { display: block; font-size: 11px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text3); margin-bottom: 5px; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 9px 11px; font-size: 13px; font-family: inherit; color: var(--text);
  background: var(--surface2); border: 1px solid var(--border2); border-radius: var(--radius); outline: none;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: var(--blue); background: var(--surface); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.modal-error { background: var(--red-bg); color: var(--red); font-size: 12px; padding: 8px 11px;
  border-radius: var(--radius); margin-bottom: 12px; display: none; }
.modal-error.show { display: block; }

/* ── Workflow template builder ───────────────────────────── */
.modal-wide { max-width: 780px; }
.tpl-steps-head {
  display: flex; gap: 8px; align-items: center;
  font-size: 10px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text3); margin-bottom: 6px;
}
.tpl-steps-head .h-handle { flex: 0 0 14px; }
.tpl-steps-head .h-name   { flex: 1 1 auto; }
.tpl-steps-head .h-type   { flex: 0 0 150px; }
.tpl-steps-head .h-sla    { flex: 0 0 74px; text-align: center; }
.tpl-steps-head .h-del    { flex: 0 0 26px; }
.tpl-step { display: flex; gap: 8px; align-items: center; margin-bottom: 7px; }
.tpl-step input, .tpl-step select {
  padding: 7px 9px; font-size: 12.5px; font-family: inherit; color: var(--text);
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--radius); outline: none; min-width: 0;
}
.tpl-step input:focus, .tpl-step select:focus { border-color: var(--blue); background: var(--surface); }
.tpl-step .tpl-handle  { flex: 0 0 14px; color: var(--text3); cursor: default; text-align: center; }
.tpl-step .tpl-s-name  { flex: 1 1 auto; }
.tpl-step .tpl-s-type  { flex: 0 0 150px; }
.tpl-step .tpl-s-sla   { flex: 0 0 74px; text-align: center; }
.tpl-step .tpl-del {
  flex: 0 0 26px; width: 26px; height: 30px; padding: 0; cursor: pointer;
  background: none; border: none; color: var(--text3); font-size: 15px; line-height: 1;
  border-radius: var(--radius);
}
.tpl-step .tpl-del:hover { background: var(--red-bg); color: var(--red); }

/* ── Account menu ─────────────────────────────────────────── */
#user-menu {
  position: fixed; top: 58px; right: 18px; z-index: 1000; width: 240px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: 0 12px 40px rgba(0,0,0,.18);
  display: none; overflow: hidden;
}
.um-head { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.um-name { font-size: 13px; font-weight: 600; color: var(--text); }
.um-email { font-size: 11.5px; color: var(--text3); margin-top: 2px; word-break: break-all; }
.um-item { padding: 11px 14px; font-size: 13px; color: var(--text); cursor: pointer; }
.um-item:hover { background: var(--surface2); }

/* ── Job workflow bar + lockable checklist ────────────────── */
.job-workflow { display: flex; flex-wrap: wrap; gap: 8px; }
.lock-note {
  font-size: 12px; color: var(--text2);
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; margin-bottom: 10px;
}
.task-list.locked .task-chk { pointer-events: none; opacity: .4; cursor: not-allowed; }
.task-list.locked .task-text { opacity: .65; }

/* ── Job detail sub-tabs + activity timeline ──────────────── */
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.subtab {
  font-size: 13px; color: var(--text3); padding: 8px 14px; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.subtab:hover { color: var(--text); }
.subtab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }
.act-list { position: relative; padding-left: 6px; }
.act-row { display: flex; gap: 12px; padding: 0 0 16px; position: relative; }
.act-row::before {
  content: ''; position: absolute; left: 4px; top: 12px; bottom: -4px;
  width: 1px; background: var(--border);
}
.act-row:last-child::before { display: none; }
.act-dot {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; margin-top: 3px;
  background: var(--text3); position: relative; z-index: 1;
  box-shadow: 0 0 0 3px var(--surface);
}
.act-dot.d-blue { background: var(--blue, #378ADD); }
.act-dot.d-green { background: var(--green, #639922); }
.act-dot.d-amber { background: var(--amber, #BA7517); }
.act-dot.d-purple { background: var(--purple, #7F77DD); }
.act-dot.d-gray { background: var(--text3); }
.act-text { font-size: 13px; color: var(--text); }
.act-meta { font-size: 11px; color: var(--text3); margin-top: 2px; }

/* ── Dashboard "My work" rows ──────────────────────────────── */
.mw-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 0;
  border-top: 1px solid var(--border); cursor: pointer;
}
.mw-row:first-child { border-top: none; }
.mw-row:hover .mw-title { color: var(--accent); }
.mw-title { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mw-meta { font-size: 11px; color: var(--text3); margin-top: 2px; }

/* ── "My work" — compact, height-bounded ──────────────────── */
#my-work-card .card-body { padding: 12px 18px 14px; }
#my-work-card .two-col { gap: 28px; }
#mw-jobs, #mw-tasks { max-height: 220px; overflow-y: auto; padding-right: 4px; }
#mw-jobs .mw-row { padding: 6px 0; }
#mw-tasks .task-row { padding: 6px 0; gap: 9px; }
#mw-tasks .task-text { font-size: 12.5px; }
#mw-tasks .task-meta-txt { font-size: 11px; }
#mw-jobs::-webkit-scrollbar, #mw-tasks::-webkit-scrollbar { width: 6px; }
#mw-jobs::-webkit-scrollbar-thumb, #mw-tasks::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── Branch column + filter — visible only for multi-branch users ──── */
.branch-col { display: none; }
body.multi-branch .branch-col { display: table-cell; }
.branch-filter { display: none; }
body.multi-branch .branch-filter { display: inline-block; }

/* ── Template builder: designated sign-off row ─────────────── */
.tpl-step { flex-wrap: wrap; }
.tpl-step .tpl-s-signoff { flex: 1 0 100%; padding: 2px 0 4px 22px; }
.tpl-step .tpl-s-signoff label { display: block; font-size: 11px; color: var(--text3); margin-bottom: 3px; }
.tpl-step .tpl-s-signoff select { width: 100%; }

/* ── View toggle (List | Board) ────────────────────────────── */
.view-toggle { display: inline-flex; flex-shrink: 0; border: 1px solid var(--border2); border-radius: var(--radius); overflow: hidden; }
.vt-btn { white-space: nowrap; }
.vt-btn { font: inherit; font-size: 12px; padding: 6px 12px; border: none; background: var(--surface2); color: var(--text2); cursor: pointer; }
.vt-btn + .vt-btn { border-left: 1px solid var(--border2); }
.vt-btn.active { background: var(--surface); color: var(--text); font-weight: 600; }

/* ── Growth Kanban board ───────────────────────────────────── */
.kb-board { display: flex; gap: 10px; overflow-x: auto; padding: 14px 16px 16px; align-items: flex-start; }
.kb-col { flex: 0 0 216px; min-height: 120px; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 8px; }
.kb-col.kb-muted .kb-head span:first-child { color: var(--text3); }
.kb-col.kb-over { border-color: var(--accent); background: #fdf3f1; }
.kb-head { display: flex; justify-content: space-between; gap: 6px; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text2); margin: 2px 2px 8px; }
.kb-head span:last-child { font-weight: 400; color: var(--text3); text-transform: none; letter-spacing: 0; }
.kb-card { background: var(--surface); border: 1px solid var(--border2); border-radius: 8px; padding: 9px 10px; margin-bottom: 7px; cursor: grab; }
.kb-card:active { cursor: grabbing; }
.kb-card:hover { border-color: var(--border-strong, var(--border2)); box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.kb-title { font-size: 12.5px; font-weight: 600; }
.kb-sub { font-size: 11.5px; color: var(--text3); margin-top: 2px; }
.kb-val { font-size: 11.5px; color: var(--text2); margin-top: 4px; }

/* Kanban cards: never start a text-selection drag — always drag the card. */
.kb-card { user-select: none; -webkit-user-select: none; }

/* ── Inline-editable detail fields ─────────────────────────── */
.inline-edit { font: inherit; font-size: 13px; color: var(--text); width: 100%; max-width: 240px;
  padding: 5px 7px; background: transparent; border: 1px solid transparent; border-radius: 6px; outline: none; }
.inline-edit:hover { border-color: var(--border2); background: var(--surface2); }
.inline-edit:focus { border-color: var(--blue); background: var(--surface); }
.inline-edit:disabled { opacity: .5; }

/* Kanban: "view older" for month-scoped Won/Lost columns */
.kb-older { display: block; width: 100%; font: inherit; font-size: 11.5px; padding: 7px;
  border: 1px dashed var(--border2); background: transparent; color: var(--text2);
  border-radius: 8px; cursor: pointer; margin-top: 2px; }
.kb-older:hover { background: var(--surface); color: var(--text); }

/* ── Clickable user chips (sign-off picker etc.) ───────────── */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; padding: 5px 11px; border: 1px solid var(--border2); border-radius: 999px;
  background: var(--surface2); color: var(--text2); cursor: pointer; user-select: none; }
.chip:hover { border-color: var(--blue); }
.chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }


/* ── Mayo brand logo ─────────────────────────────────────── */
.brand-logo { display: block; width: 100%; max-width: 176px; height: auto; }
.login-brand .brand-logo { max-width: 210px; margin: 0 auto; }

/* ── Template builder (layout rebuild) ─────────────────────── */
.tpl-step { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); margin-bottom: 10px; }
.tpl-step-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer; }
.tpl-step-head .tpl-s-name { flex: 1; font: inherit; font-weight: 600; border: 1px solid var(--border); border-radius: 8px; padding: 6px 9px; background: var(--surface2); min-width: 0; }
.tpl-s-summary { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text3); white-space: nowrap; }
.tsum { font-size: 11px; color: var(--text3); }
.tpl-handle { cursor: grab; color: var(--text3); font-size: 14px; flex-shrink: 0; }
.tpl-step-body { padding: 0 10px 10px; border-top: 1px solid var(--border); }
.tpl-fields { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.15fr) auto 74px auto; gap: 10px; align-items: end; padding-top: 10px; }
.tpl-fields label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text3); display: block; min-width: 0; white-space: nowrap; }
.tpl-fields label > select, .tpl-fields label > input, .tpl-fields label > .ndays { margin-top: 4px; }
.tpl-fields select, .tpl-fields input[type=number] { font: inherit; font-size: 13px; border: 1px solid var(--border); border-radius: 8px; padding: 0 8px; background: var(--surface); height: 32px; width: 100%; box-sizing: border-box; display: block; }
.ndays { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text2); text-transform: none; letter-spacing: 0; }
.ndays input { width: 60px !important; }
.ndays span { flex-shrink: 0; }
.tpl-docreq { display: inline-flex !important; flex-direction: row; align-items: center; gap: 6px; text-transform: none !important; letter-spacing: 0 !important; font-size: 12.5px !important; color: var(--text2) !important; height: 32px; white-space: nowrap; }
.tpl-docreq input[type=checkbox] { width: auto; height: auto; }
@media (max-width: 700px) { .tpl-fields { grid-template-columns: minmax(0,1fr) minmax(0,1fr); } }
.tpl-toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text2); cursor: pointer; }
.tpl-subs-head { display: flex; justify-content: space-between; align-items: center; margin: 12px 0 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text3); }
.tpl-sub { display: flex; gap: 7px; align-items: center; margin-bottom: 6px; }
.tpl-sub .sub-name { flex: 1; font: inherit; font-size: 12.5px; border: 1px solid var(--border); border-radius: 8px; padding: 5px 8px; background: var(--surface2); min-width: 0; }
.tpl-sub .sub-type { font: inherit; font-size: 12px; border: 1px solid var(--border); border-radius: 8px; padding: 5px 6px; }
.sub-doc { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--text2); white-space: nowrap; }
.tpl-duenote { margin-top: 10px; padding: 9px 11px; border-left: 3px solid var(--accent); background: var(--accent-bg); border-radius: 6px; font-size: 12px; color: var(--text2); }

/* Job-side sub-task checklist */
.task-checklist { margin: 4px 0 2px 26px; display: flex; flex-direction: column; gap: 3px; }
.task-checklist label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text2); cursor: pointer; }
.task-checklist .ck-done { text-decoration: line-through; color: var(--text3); }
.task-role-tag { font-size: 10.5px; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 1px 7px; margin-left: 6px; }

/* ── Job detail: workflow step timeline (View A) ───────────── */
.wf-step { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); position: relative; }
.wf-step:last-child { border-bottom: none; }
.wf-num { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; border: 2px solid var(--border2); color: var(--text3); background: var(--surface); }
.wf-num.active { border-color: var(--accent); color: var(--accent); }
.wf-num.done { border-color: var(--green); background: var(--green); color: #fff; }
.wf-num.sm { width: 20px; height: 20px; font-size: 10.5px; border-width: 1.5px; }
.wf-step.s-locked { opacity: .6; }
.wf-summary { font-size: 12px; color: var(--text3); margin-top: 2px; }
.wf-chip { font-size: 10.5px; border: 1px solid var(--border2); border-radius: 999px; padding: 1px 7px; color: var(--text2); white-space: nowrap; }
.wf-chip.late { border-color: #c0392b; color: #c0392b; }
.wf-prog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 8px; }
.wf-prog-n { font-size: 18px; font-weight: 700; letter-spacing: -.3px; }
.wf-prog-l { font-size: 10.5px; color: var(--text3); text-transform: uppercase; letter-spacing: .04em; }

/* ── Client profile: service cards (View B) ────────────────── */
.svc-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.svc-card { border: 1px solid var(--border); border-left-width: 4px; border-radius: 10px; background: var(--surface); }
.svc-card.sv-active { border-left-color: var(--accent); }
.svc-card.sv-done { border-left-color: var(--green); }
.svc-card.sv-overdue { border-left-color: #c0392b; }
.svc-card.sv-planned { border-left-color: #4a7fb5; }
.svc-head { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; cursor: pointer; }
.svc-body { padding: 0 12px 10px 12px; border-top: 1px solid var(--border); }
.svc-step { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.svc-card.sv-cancelled { border-left-color: var(--border2); opacity: .75; }

/* Card refinements: spacing + right column + full bars */
.svc-head { padding: 12px 14px; gap: 14px; align-items: center; }
.svc-head > div:first-child > div { line-height: 1.45; }
.svc-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; text-align: right; }
.svc-meta { font-size: 11px; color: var(--text3); }
.svc-prog { margin-top: 8px; max-width: 240px; height: 5px; }
.svc-prog .prog-fill.full { background: var(--green); }
.svc-body { padding: 10px 14px 12px 14px; }
.svc-step { padding: 6px 0; }
.svc-step + .svc-step { border-top: 1px solid var(--border); }

/* ── Mail: two-pane client ─────────────────────────────────── */
.mail-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.mail-folders { display: flex; gap: 6px; }
.mf-pill { font: inherit; font-size: 12.5px; font-weight: 600; border: 1px solid var(--border); background: var(--surface); color: var(--text2); border-radius: 999px; padding: 6px 15px; cursor: pointer; }
.mf-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.mail-search { font: inherit; font-size: 13px; flex: 1; max-width: 320px; border: 1px solid var(--border); border-radius: 999px; padding: 7px 15px; background: var(--surface); }
.mail-split { display: grid; grid-template-columns: minmax(280px, 370px) 1fr; gap: 14px; align-items: start; }
@media (max-width: 900px) { .mail-split { grid-template-columns: 1fr; } .mail-read { display: none; } .mail-read.mobile-open { display: block; } }
.mail-list { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; max-height: calc(100vh - 210px); overflow-y: auto; }
.ml-row { display: flex; gap: 10px; padding: 11px 13px; border-bottom: 1px solid var(--border); cursor: pointer; position: relative; }
.ml-row:hover { background: var(--bg); }
.ml-row.sel { background: rgba(29, 158, 117, .08); box-shadow: inset 3px 0 0 var(--accent); }
.ml-row.unread .ml-from, .ml-row.unread .ml-subj { font-weight: 700; color: var(--text); }
.ml-av { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; color: #fff; }
.ml-main { flex: 1; min-width: 0; }
.ml-top { display: flex; justify-content: space-between; gap: 8px; }
.ml-from { font-size: 12.5px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-time { font-size: 11px; color: var(--text3); flex-shrink: 0; }
.ml-subj { font-size: 13px; color: var(--text2); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-prev { font-size: 11.5px; color: var(--text3); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); position: absolute; left: 4px; top: 50%; transform: translateY(-50%); }
.mail-read { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px 22px; min-height: 340px; max-height: calc(100vh - 210px); overflow-y: auto; }
.mail-empty { text-align: center; color: var(--text3); font-size: 13px; padding: 60px 20px; }
.mr-subject { font-size: 18px; font-weight: 700; letter-spacing: -.3px; margin-bottom: 12px; }
.mr-head { display: flex; gap: 12px; align-items: flex-start; padding-bottom: 14px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.mr-meta { flex: 1; min-width: 0; font-size: 12.5px; color: var(--text3); line-height: 1.55; }
.mr-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }
.mr-act { font: inherit; font-size: 12.5px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 6px 13px; cursor: pointer; color: var(--text2); }
.mr-act:hover { border-color: var(--accent); color: var(--accent); }
.mr-att { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; font-size: 12.5px; text-decoration: none; color: var(--text); background: var(--bg); }
.mr-att:hover { border-color: var(--accent); }
.mr-body { white-space: pre-wrap; font-size: 13.5px; line-height: 1.65; color: var(--text); }

/* Client profile: communication entries as mail cards */
.cm-item { display: flex; gap: 10px; padding: 11px 0; border-top: 1px solid var(--border); }
.cm-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.cm-who { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-email { font-size: 11.5px; font-weight: 400; color: var(--text3); }
.cm-when { font-size: 11px; color: var(--text3); flex-shrink: 0; white-space: nowrap; }
.cm-subj { font-size: 12.5px; color: var(--text2); margin-top: 1px; }
.cm-body { font-size: 12.5px; color: var(--text2); line-height: 1.55; margin-top: 6px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; white-space: pre-wrap; }
.cm-toggle { display: inline-block; font-size: 11.5px; color: var(--accent); cursor: pointer; margin-top: 4px; }
