:root {
  --navy: #1b2c52;
  --navy-deep: #162443;
  --navy-soft: #24375f;
  --red: #d8113f;
  --red-dark: #b60c33;
  --ink: #16243f;
  --ink-soft: #3d4c66;
  --muted: #74819a;
  --line: #e3e7ee;
  --line-soft: #eef1f5;
  --canvas: #f3f5f9;
  --white: #fff;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(19, 33, 58, 0.06);
  --shadow-md: 0 10px 30px rgba(19, 33, 58, 0.12);
  --shadow-lg: 0 24px 60px rgba(19, 33, 58, 0.22);
  --sidebar-width: 212px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

.icon { flex: 0 0 auto; vertical-align: -0.15em; }
.icon.filled { fill: currentColor; }
.subtle { color: var(--muted); font-size: 11px; }
.subtle.block { display: block; }
.center { text-align: center; }
.body-text { color: var(--ink-soft); font-size: 12.5px; margin-bottom: 14px; }
.stack { display: grid; gap: 16px; padding: 0 24px 28px; }
.right { text-align: right; }

/* ---------- shell ---------- */
.app-shell { display: flex; min-height: 100%; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  padding: 18px 12px 16px;
  background: var(--navy);
  color: #d7deeb;
}

.brand {
  display: grid;
  justify-items: start;
  gap: 7px;
  width: 100%;
  padding: 2px 6px 22px;
  border: 0;
  background: none;
  color: #fff;
  text-align: left;
  cursor: pointer;
}
.brand-logo { display: block; width: 100%; max-width: 156px; height: auto; }
.brand-mini {
  display: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}
.brand-text {
  display: block;
  padding-left: 2px;
  color: #9fb0cd;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 2.1px;
  text-transform: uppercase;
}

.primary-nav { display: grid; gap: 3px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 11px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: #b9c6dc;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.nav-link.active { color: #fff; background: rgba(255, 255, 255, 0.13); }
.nav-link.active .icon { color: #ff4d72; }

.sidebar-footer { margin-top: auto; display: grid; gap: 4px; }
.sidebar-label {
  padding: 0 8px;
  color: #7f8fad;
  font-size: 8.5px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}
.status-count {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 5px 8px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: #a7b5cc;
  font-size: 11px;
  cursor: pointer;
}
.status-count:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.status-count b { color: #7fd7f7; }

.public-link {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px dashed rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: none;
  color: #c7d3e6;
  font-size: 11px;
  cursor: pointer;
}
.public-link:hover { border-color: rgba(255, 255, 255, 0.5); color: #fff; }

.role-switcher {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}
.role-switcher span { color: #92a3bd; font-size: 9.5px; letter-spacing: 0.6px; text-transform: uppercase; }
.role-switcher select {
  width: 100%;
  padding: 4px 0;
  border: 0;
  background: none;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}
.role-switcher option { color: var(--ink); }

.profile {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  padding-top: 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}
.profile-text { flex: 1; }
.profile-text strong { display: block; font-size: 11.5px; color: #fff; }
.profile-text small { display: block; color: #8d9cb6; font-size: 10px; }

.main-content { width: calc(100% - var(--sidebar-width)); margin-left: var(--sidebar-width); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 58px;
  padding: 0 22px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.topbar-title { font-size: 14px; font-weight: 600; }
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(340px, 40vw);
  height: 34px;
  padding: 0 12px;
  border-radius: 7px;
  background: #f1f3f8;
  color: #93a0b4;
}
.search input { width: 100%; border: 0; outline: 0; background: none; color: var(--ink); font-size: 12px; }
.search input::placeholder { color: #98a4b8; }
.filter-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: #5d6b83;
  font-size: 12px;
  cursor: pointer;
}
.filter-trigger:hover { background: #f1f3f8; }
.result-count { margin-left: auto; color: var(--muted); font-size: 11.5px; }
.topbar-note { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }

.view { min-height: calc(100vh - 58px); padding-bottom: 40px; }

/* ---------- buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.button.small { padding: 6px 11px; font-size: 11.5px; }
.button.full { width: 100%; justify-content: center; margin-top: 10px; }
.button-primary { background: var(--red); color: #fff; }
.button-primary:hover { background: var(--red-dark); }
.button-secondary { background: #e9f0fb; color: #1d5bb5; }
.button-secondary:hover { background: #dbe7f8; }
.button-ghost { border-color: var(--line); background: #fff; color: var(--ink-soft); }
.button-ghost:hover { border-color: #c9d2e0; }
.button:disabled { opacity: 0.55; cursor: not-allowed; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }
.link-button { border: 0; background: none; color: #1d5bb5; font-size: inherit; text-decoration: underline; cursor: pointer; padding: 0; }

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: #66748c;
  cursor: pointer;
}
.icon-button:hover { background: #eef1f6; color: var(--ink); }
.icon-button.disabled { opacity: 0.35; }

.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.segmented button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 26px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: #7a879c;
  cursor: pointer;
}
.segmented button.active { background: var(--navy); color: #fff; }

/* ---------- page furniture ---------- */
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 14px; }
.page-heading h1 { font-size: 21px; letter-spacing: -0.3px; }
.page-heading p { max-width: 74ch; margin-top: 4px; color: var(--muted); font-size: 12px; }
.heading-actions { display: flex; gap: 10px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 24px 12px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 11px;
  cursor: pointer;
}
.chip:hover { border-color: #c7d0df; }
.chip-ghost { border-style: dashed; color: var(--red); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 22px 0 10px; }
.section-head:first-child { margin-top: 0; }
.section-title {
  color: #78849a;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.9px;
  text-transform: uppercase;
}

.panel { padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
.inline-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 10px 0;
  padding: 9px 11px;
  border-radius: 8px;
  background: #f2f5fa;
  color: var(--ink-soft);
  font-size: 11.5px;
}
.inline-note.success { background: #e7f7f0; color: #0a6e4f; }
.inline-note .icon { margin-top: 2px; }

.banner {
  display: flex;
  gap: 11px;
  margin: 0 24px 16px;
  padding: 13px 15px;
  border-radius: 10px;
}
.banner.small { margin: 12px 0; }
.banner strong { display: block; font-size: 12.5px; }
.banner p { font-size: 11.5px; margin-top: 2px; }

.empty-state { display: grid; justify-items: center; gap: 6px; padding: 70px 24px; color: var(--muted); text-align: center; }
.empty-state h3 { color: var(--ink); font-size: 15px; }
.empty-state p { font-size: 12px; max-width: 46ch; }

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th {
  padding: 0 14px 9px;
  color: #7c8798;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.9px;
  text-align: left;
  text-transform: uppercase;
}
.table th:first-child, .table td:first-child { padding-left: 24px; }
.table th:last-child, .table td:last-child { padding-right: 24px; }
.table td { padding: 11px 14px; border-top: 1px solid #e0e5ed; font-size: 12px; vertical-align: middle; }
.table tbody tr { cursor: pointer; transition: background 0.12s, box-shadow 0.12s; }
.table tbody tr:hover { background: #fff; }
.table tbody tr.selected { background: #fff; box-shadow: inset 3px 0 0 var(--red); }
.table tbody tr.highlight { background: #fff6f8; box-shadow: inset 3px 0 0 var(--red); }
.chevron { color: #9aa5b8; }
.cell-status { display: table-cell; }
.cell-status .pill { margin: 1px 3px 1px 0; }
.cell-tags { max-width: 280px; }
.cell-applied .subtle { display: block; }

.person { display: flex; align-items: center; gap: 11px; }
.person-plain { gap: 0; min-height: 34px; }
.person strong { display: block; font-size: 12.5px; }
.person small { display: flex; align-items: center; gap: 5px; margin-top: 2px; color: var(--muted); font-size: 10.5px; }
.person small em { font-style: normal; color: #9aa5b8; }
.star { display: inline-flex; margin-left: 5px; color: #f5a400; }
.star-button { border: 0; background: none; color: #c3ccd9; cursor: pointer; padding: 0 0 0 6px; }
.star-button.on { color: #f5a400; }
.job-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: #eef2f7; color: #5b6a85; }

.avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.avatar-sm { width: 28px; height: 28px; font-size: 10px; }
.avatar.red { background: #e10a41; }

/* ---------- pills + tags ---------- */
.pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 600;
  white-space: nowrap;
}
.pill-info { background: #e8f0ff; color: #1a5cc0; }
.pill-success { background: #dff6ec; color: #0a7a55; }
.pill-danger { background: #ffe6ea; color: #c00f36; }
.pill-warning { background: #fff2cf; color: #8a6100; }
.pill-violet { background: #f0e8ff; color: #6330c4; }
.pill-muted { background: #eef1f5; color: #61708a; }
.pill-stack { display: inline-flex; flex-wrap: wrap; gap: 5px; }

.tag {
  display: inline-block;
  margin: 2px 4px 2px 0;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  white-space: nowrap;
}
.t-blue { background: #e7efff; color: #1f5fbe; }
.t-sky { background: #e2f4fd; color: #0b6f96; }
.t-violet { background: #f1e9ff; color: #6535c6; }
.t-indigo { background: #e8eaff; color: #3a44bb; }
.t-green { background: #e3f7ec; color: #0b7a4f; }
.t-teal { background: #ddf5f2; color: #0a7a72; }
.t-amber { background: #fff1d3; color: #8c6100; }
.t-orange { background: #ffe9d8; color: #a4530b; }
.t-red { background: #ffe5ea; color: #bf1038; }
.t-pink { background: #ffe6f2; color: #b2156c; }
.t-olive { background: #eef4d9; color: #5f6f16; }
.t-slate { background: #eef1f5; color: #5a6880; }
.t-muted { background: #f4f6f9; color: #8a95a8; }

.tags-wrap { display: flex; flex-wrap: wrap; gap: 3px; }
.tag-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #e9eef6;
  color: #3f4f6b;
  font-size: 11px;
  cursor: pointer;
}
.tag-button:hover { background: #dee6f1; }
.tag-button.ghost { border-color: var(--line); background: #fff; color: #5f6d85; }
.tag-button.ghost:hover { border-color: #b9c4d6; }

/* ---------- drawer ---------- */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 38;
  background: rgba(15, 26, 46, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 40;
  width: min(430px, 100vw);
  height: 100vh;
  overflow-y: auto;
  background: #fff;
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 0.24s ease;
}
.detail-drawer.open { transform: none; }
.drawer-head { padding: 22px 22px 16px; border-bottom: 1px solid var(--line); }
.drawer-person { display: flex; align-items: flex-start; gap: 14px; }
.drawer-person h2 { display: flex; align-items: center; font-size: 16.5px; letter-spacing: -0.2px; }
.drawer-person p { color: var(--muted); font-size: 11.5px; }
.drawer-person > .icon-button { margin-left: auto; }
.drawer-actions { display: flex; gap: 10px; margin-top: 16px; }
.select-field { flex: 1; display: grid; gap: 3px; }
.select-field span { color: #7b869a; font-size: 9px; font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase; }
.select-field select {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7f9fc;
  font-size: 12px;
  cursor: pointer;
}
.select-field select:disabled { opacity: 0.6; cursor: not-allowed; }

.drawer-tabs { display: flex; border-bottom: 1px solid var(--line); overflow-x: auto; }
.drawer-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  justify-content: center;
  padding: 13px 8px;
  border: 0;
  background: none;
  color: #65728a;
  font-size: 11px;
  white-space: nowrap;
  cursor: pointer;
}
.drawer-tab.active { color: var(--red-dark); font-weight: 600; }
.drawer-tab.active::after { content: ""; position: absolute; inset: auto 6px -1px; height: 2px; background: var(--red); }
.drawer-body { padding: 20px 22px 40px; }

.info-list { display: grid; gap: 9px; }
.info-list.compact { gap: 6px; }
.info-list.boxed { padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #f9fbfd; }
.info-row { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.info-row .icon { color: #63728b; }

.pipeline { display: flex; margin: 6px 0 4px; }
.pipeline-step { position: relative; flex: 1; text-align: center; color: #98a3b5; font-size: 8.5px; }
.pipeline-step::before { content: ""; position: absolute; top: 9px; left: -50%; width: 100%; height: 1px; background: #cdd4de; }
.pipeline-step:first-child::before { display: none; }
.pipeline-dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  margin: 0 auto 5px;
  border: 1px solid #ccd3dd;
  border-radius: 50%;
  background: #f4f6f9;
  color: #fff;
}
.pipeline-step.done .pipeline-dot { border-color: var(--navy); background: var(--navy); }
.pipeline-step.current { color: var(--red); font-weight: 700; }
.pipeline-step.current .pipeline-dot { border-color: var(--red); background: var(--red); }
.pipeline-label { display: block; padding: 0 2px; }

.timeline { display: grid; gap: 10px; }
.timeline li { padding-left: 12px; border-left: 2px solid var(--line); }
.timeline strong { display: block; font-size: 12px; }
.timeline span { display: block; color: var(--ink-soft); font-size: 11.5px; }
.timeline time { color: var(--muted); font-size: 10.5px; }

.activity-list { display: grid; gap: 14px; }
.activity-list li { position: relative; display: flex; gap: 11px; }
.activity-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--red); flex: 0 0 auto; }
.activity-list p { font-size: 12px; }
.activity-list time { color: var(--muted); font-size: 10.5px; }

.note-compose { padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #fafbfd; }
.note-compose textarea {
  width: 100%;
  min-height: 72px;
  border: 0;
  outline: 0;
  background: none;
  resize: vertical;
  font-size: 12.5px;
}
.note-compose footer { display: flex; justify-content: flex-end; }
.note-list { display: grid; gap: 10px; margin-top: 14px; }
.note-card { padding: 13px; border: 1px solid var(--line); border-radius: 12px; }
.note-card header { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.note-card strong { font-size: 11.5px; }
.note-card time { margin-left: auto; color: var(--muted); font-size: 10px; }
.note-card p { color: var(--ink-soft); font-size: 12px; }

.job-list { display: grid; gap: 7px; }
.job-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.job-row .icon:first-child { color: #63728b; }
.job-row strong { display: block; font-size: 12px; }
.job-row small { display: block; margin-top: 1px; color: var(--muted); font-size: 10.5px; }
.job-row > span:nth-child(2) { flex: 1; }
.job-row button { margin-left: auto; }

.mini-card { padding: 13px; border: 1px solid var(--line); border-radius: 11px; }
.mini-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.mini-list { display: grid; gap: 6px; }
.mini-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.mini-row:hover { border-color: #c4cddc; }
.mini-row > span { flex: 1; }
.mini-row strong { display: block; font-size: 12px; }
.mini-row small { display: block; color: var(--muted); font-size: 10.5px; }
.mini-row .icon:last-child { color: #a3adbe; }

/* ---------- filters ---------- */
.filter-panel {
  position: fixed;
  top: 66px;
  right: 18px;
  z-index: 45;
  width: 300px;
  max-height: calc(100vh - 84px);
  padding: 18px;
  overflow-y: auto;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.16s, transform 0.16s;
}
.filter-panel.open { opacity: 1; transform: none; pointer-events: auto; }
.filter-group { margin-bottom: 16px; }
.filter-group h3 { margin-bottom: 7px; color: #78849a; font-size: 9.5px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.filter-options { display: flex; flex-wrap: wrap; gap: 5px; }
.filter-option {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 11px;
  cursor: pointer;
}
.filter-option:hover { border-color: #b9c4d6; }
.filter-option.active { border-color: var(--navy); background: var(--navy); color: #fff; }
.clear-filters { width: 100%; padding: 9px; border: 0; border-radius: 8px; background: #fdecef; color: var(--red); font-weight: 600; cursor: pointer; }

/* ---------- cards + grids ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 14px; padding: 4px 24px 24px; }
.card-grid.two { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); max-width: 900px; }
.job-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.job-card:hover { border-color: #c2cdde; transform: translateY(-1px); }
.job-card h3 { margin: 11px 0 3px; font-size: 13.5px; }
.job-card footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--line-soft); }

.employee-card { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
.employee-card header { display: flex; align-items: center; gap: 10px; }
.employee-card header > span { flex: 1; }
.employee-card strong { display: block; font-size: 12.5px; }
.employee-card .role { display: block; color: var(--red); font-size: 11px; font-weight: 500; }
.employee-card > p { margin: 10px 0 12px; }
.card-actions { display: flex; gap: 8px; margin-top: 12px; }

.metric-row { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 13px; padding: 0 24px 18px; max-width: 900px; }
.metric { display: flex; align-items: center; gap: 11px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.metric-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; }
.metric-icon.tone-blue { background: #e8f0ff; color: #1a5cc0; }
.metric-icon.tone-green { background: #e0f7ec; color: #0a7a55; }
.metric-icon.tone-amber { background: #fff2cf; color: #9a6b00; }
.metric-icon.tone-violet { background: #f1e9ff; color: #6535c6; }
.metric strong { display: block; font-size: 18px; letter-spacing: -0.3px; }
.metric small { display: block; color: var(--muted); font-size: 10px; }

.progress-block { margin-top: 4px; }
.progress-label { display: flex; justify-content: space-between; color: var(--muted); font-size: 10.5px; }
.progress-label b.tone-complete { color: #0a7a55; }
.progress-label b.tone-partial { color: #b07400; }
.progress-label b.tone-empty { color: #8996ab; }
.progress { height: 5px; margin-top: 5px; overflow: hidden; border-radius: 999px; background: #e9edf3; }
.progress span { display: block; height: 100%; border-radius: 999px; background: #0eae7b; }
.progress.tone-partial span { background: #f5a623; }
.progress.tone-empty span { background: #c3ccd9; }

/* ---------- detail pages ---------- */
.detail-page { padding: 20px 24px 30px; display: grid; gap: 16px; justify-items: start; }
.detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; width: 100%; }
.detail-header h1 { font-size: 21px; letter-spacing: -0.3px; }
.detail-header .subtle { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 5px 0 9px; }
.detail-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; width: 100%; align-items: start; }
.explainer { display: grid; gap: 9px; }
.explainer li { display: flex; gap: 8px; color: var(--ink-soft); font-size: 12px; }
.explainer .icon { margin-top: 2px; color: #5c6b85; }
.approval-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}
.approval-row:last-child { border-bottom: 0; }
.approval-row small { display: block; }

/* ---------- forms ---------- */
.field { display: grid; gap: 5px; margin-bottom: 12px; }
.field > span, .field legend { color: #6d7a90; font-size: 10.5px; font-weight: 600; letter-spacing: 0.4px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 12.5px;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid #c7dcff; border-color: #7fa9e8; }
.field input[readonly] { background: #f5f7fa; color: #6c7889; }
.field.inline { grid-template-columns: 150px 1fr; align-items: center; }
.field.signature input { font-family: "Segoe Script", "Snell Roundhand", cursive; font-size: 15px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
fieldset.field { border: 0; padding: 0; margin: 0 0 12px; }

.checkbox-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.checkbox-chip input { position: absolute; opacity: 0; pointer-events: none; }
.checkbox-chip span {
  display: inline-block;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11.5px;
  cursor: pointer;
}
.checkbox-chip input:checked + span { border-color: var(--navy); background: var(--navy); color: #fff; }
.checkbox-chip input:focus-visible + span { outline: 2px solid #c7dcff; }

.switch-field { display: flex; align-items: center; gap: 8px; font-size: 12px; }

.inline-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.inline-form input, .inline-form select { flex: 1; min-width: 120px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }

.modal-layer { position: fixed; inset: 0; z-index: 60; display: none; }
.modal-layer.open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 26, 46, 0.42); }
.modal {
  position: relative;
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  margin: 32px auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-lg);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 15px; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 16px; }

.upload-box {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 6px 0 12px;
  padding: 13px;
  border: 1px dashed #c3cede;
  border-radius: 10px;
  background: #fafbfd;
}
.upload-box.done { border-color: #9ad9bd; background: #f1fbf6; }
.upload-box div { flex: 1; }
.upload-box strong { display: block; font-size: 12px; }
.upload-box small { color: var(--muted); font-size: 10.5px; }

/* ---------- e-forms ---------- */
.form-list { display: grid; gap: 7px; }
.form-row { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; }
.form-name { flex: 1; }
.form-name strong { display: block; font-size: 12px; }
.form-name small { display: block; color: var(--muted); font-size: 10.5px; }
.form-status.tone-success { color: #0a7a55; }
.form-status.tone-warning { color: #c08400; }
.form-status.tone-muted { color: #aab4c4; }

.checklist { display: grid; gap: 4px; margin-bottom: 8px; }
.check-toggle {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  width: 100%;
  padding: 8px 9px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink-soft);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.check-toggle:hover { background: #f4f6fa; }
.check-toggle .icon { margin-top: 1px; color: #9aa5b7; }
.check-toggle.on { color: var(--muted); }
.check-toggle.on .icon { color: #0eae7b; }
.check-toggle.on span { text-decoration: line-through; }

/* ---------- public + portal ---------- */
body.fullscreen .sidebar, body.fullscreen .topbar { display: none; }
body.fullscreen .main-content { width: 100%; margin-left: 0; }
body.fullscreen { background: #eef1f7; }

.public-shell, .portal { min-height: 100vh; }
.public-head, .portal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--navy);
  color: #fff;
}
.portal-brand { display: flex; align-items: center; gap: 12px; }
.portal-brand img { width: 128px; height: auto; }
.portal-brand.on-light img { width: 112px; }
.portal-brand span {
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.28);
}
.portal-brand strong { display: block; font-size: 13px; }
.portal-brand small { display: block; color: #c3cfe2; font-size: 9.5px; letter-spacing: 1.3px; text-transform: uppercase; }
.public-head .button-ghost, .portal-head .button-ghost { border-color: rgba(255,255,255,.3); background: transparent; color: #dfe6f1; }
.public-head .button-ghost:hover, .portal-head .button-ghost:hover { border-color: #fff; color: #fff; }

.public-body, .portal-body { width: min(720px, calc(100vw - 32px)); margin: 0 auto; padding: 26px 0 60px; }
.stepper { display: flex; gap: 8px; margin-bottom: 18px; }
.stepper li { display: flex; align-items: center; gap: 7px; flex: 1; color: var(--muted); font-size: 11px; }
.stepper li span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid #ccd4e0;
  border-radius: 50%;
  background: #fff;
  font-size: 10px;
}
.stepper li.current { color: var(--ink); font-weight: 600; }
.stepper li.current span { border-color: var(--red); background: var(--red); color: #fff; }
.stepper li.done span { border-color: var(--navy); background: var(--navy); color: #fff; }

.apply-form { padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); }
.apply-form h2 { font-size: 18px; letter-spacing: -0.2px; }
.apply-form > p.subtle { margin-bottom: 16px; }
.apply-form h3.section-title { margin: 18px 0 8px; }
.apply-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 20px; }
.apply-actions.center { justify-content: center; }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.choice-card {
  position: relative;
  display: block;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.choice-card:hover { border-color: #b9c6db; }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-body strong { display: block; font-size: 12.5px; }
.choice-body small { display: block; margin: 2px 0 6px; color: var(--muted); font-size: 10.5px; }
.choice-check {
  position: absolute;
  top: 11px;
  right: 11px;
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border: 1px solid #ccd4e0;
  border-radius: 50%;
  color: transparent;
}
.choice-card input:checked ~ .choice-check { border-color: var(--red); background: var(--red); color: #fff; }
.choice-card:has(input:checked) { border-color: var(--red); background: #fff7f9; }

.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.review-grid > div { padding: 11px; border: 1px solid var(--line-soft); border-radius: 9px; background: #fafbfd; }
.review-grid span { display: block; margin-bottom: 2px; }
.review-grid strong { font-size: 12.5px; }

.confirmation { text-align: center; display: grid; justify-items: center; gap: 10px; }
.confirm-mark { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: #e2f8ee; color: #0a7a55; }
.confirm-card { display: inline-flex; align-items: center; gap: 9px; padding: 11px 15px; border: 1px solid var(--line); border-radius: 10px; font-size: 12px; }

.portal-forms { display: grid; gap: 9px; margin-top: 18px; }
.portal-form {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}
.portal-form.complete { background: #f7fcf9; border-color: #cbead9; }
.portal-form div { flex: 1; }
.portal-form strong { display: block; font-size: 12.5px; }
.portal-form small { display: block; color: var(--muted); font-size: 10.5px; }
.portal-body h1 { font-size: 22px; letter-spacing: -0.3px; }
.portal-body > .subtle { display: block; margin: 4px 0 16px; }
.portal-footnote { display: flex; align-items: center; gap: 7px; margin-top: 18px; color: var(--muted); font-size: 11px; }

.reminder-preview .email-head {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 6px 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px 10px 0 0;
  background: #f7f9fc;
  font-size: 12px;
}
.reminder-preview .email-body { padding: 18px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 10px 10px; display: grid; gap: 11px; font-size: 12.5px; }
.fake-button { display: inline-block; padding: 9px 16px; border-radius: 8px; background: var(--red); color: #fff; font-weight: 600; font-size: 12px; }

.offer-preview h2 { margin-top: 12px; font-size: 18px; }
.offer-brand { display: flex; align-items: center; gap: 10px; color: var(--navy); font-weight: 600; font-size: 12px; }
.offer-brand img { width: 104px; height: auto; }
.offer-preview .info-list { margin-top: 14px; }

/* ---------- admin ---------- */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; padding: 0 24px 30px; align-items: start; }
.tag-pick { border: 1px solid transparent; cursor: pointer; font: inherit; font-size: 10.5px; }
.tag-pick:hover { filter: brightness(0.96); }
.tag-pick.selected { border-color: currentColor; }

.tag-editor { margin: 4px 0 14px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfe; }
.tag-editor-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.tag-editor-head strong { font-size: 12px; }
.swatch-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 11px; }
.swatch {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(15, 26, 46, 0.1);
  border-radius: 8px;
  cursor: pointer;
}
.swatch.on { border-color: currentColor; }

.tag-group, .label-group { margin-bottom: 16px; }
.tag-group h4, .label-group h4 { margin-bottom: 7px; font-size: 12px; }
.role-list { display: grid; gap: 9px; }
.role-card {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.role-card:hover { border-color: #b9c6db; }
.role-card.active { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.role-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.role-card small { color: var(--muted); font-size: 11.5px; }
.role-perms { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.perm { display: inline-flex; align-items: center; gap: 4px; color: #9aa5b7; font-size: 10px; }
.perm.on { color: #0a7a55; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 80;
  padding: 11px 18px;
  border-radius: 9px;
  background: var(--navy);
  color: #fff;
  font-size: 12.5px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translate(-50%, 24px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .detail-grid { grid-template-columns: 1fr; }
  .metric-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 880px) {
  :root { --sidebar-width: 68px; }
  .brand-logo, .brand-text, .nav-link span, .sidebar-label, .status-count, .public-link, .role-switcher span, .profile-text { display: none; }
  .brand { justify-items: center; padding-inline: 0; }
  .brand-mini { display: grid; }
  .nav-link { justify-content: center; padding: 11px 0; }
  .role-switcher { padding: 6px; }
  .profile { justify-content: center; }
  .hide-tablet { display: none; }
  .card-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  .sidebar { inset: auto 0 0 0; flex-direction: row; align-items: center; width: 100%; height: 58px; padding: 6px 10px; }
  .brand { display: none; }
  .primary-nav { display: flex; flex: 1; }
  .nav-link { flex: 1; }
  .sidebar-footer { display: flex; margin: 0; }
  .role-switcher { margin: 0; }
  .main-content { width: 100%; margin: 0 0 58px; }
  .hide-mobile { display: none; }
  .search { width: auto; flex: 1; }
  .result-count, .topbar-note { display: none; }
  .page-heading, .chip-row, .card-grid, .metric-row, .admin-grid, .stack, .banner { padding-inline: 14px; margin-inline: 0; }
  .table th:first-child, .table td:first-child { padding-left: 14px; }
  .table th:last-child, .table td:last-child { padding-right: 14px; }
  .card-grid, .metric-row { grid-template-columns: 1fr; }
  .detail-page { padding-inline: 14px; }
  .field-row { grid-template-columns: 1fr; }
  .detail-drawer { width: 100vw; }
  .filter-panel { left: 10px; right: 10px; width: auto; }
}
