:root {
  color-scheme: light;
  --bg: #f3f6f7;
  --surface: #ffffff;
  --surface-2: #eef4f1;
  --ink: #15211d;
  --muted: #66736e;
  --line: #dce4df;
  --green: #0f7b68;
  --green-2: #d8f0ea;
  --blue: #255c99;
  --blue-2: #dce8f7;
  --amber: #a76317;
  --amber-2: #f7e7cc;
  --red: #b33c32;
  --red-2: #f6dedb;
  --violet: #6b4ba8;
  --violet-2: #e7e0f7;
  --gold: #c79a39;
  --gold-2: #f5ebd1;
  --shadow: 0 18px 45px rgba(31, 45, 38, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

.sensitive-lock,
.sensitive-field-note {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid #d9e6e1;
  border-radius: 8px;
  background: #f6faf8;
  color: #5f716a;
  font-size: 13px;
  font-weight: 700;
}

.sensitive-field-note {
  width: 100%;
  justify-content: center;
}

.job-stats-table td:last-child,
.job-stats-table th:last-child {
  text-align: center;
  white-space: nowrap;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(15, 123, 104, 0.07), transparent 28%),
    linear-gradient(315deg, rgba(37, 92, 153, 0.06), transparent 32%),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell[hidden] {
  display: none !important;
}

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  place-items: center;
  min-height: 100vh;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(15, 123, 104, 0.16), transparent 34%),
    linear-gradient(315deg, rgba(37, 92, 153, 0.18), transparent 38%),
    #f6faf9;
}

.auth-booting .boot-screen {
  display: grid;
}

.boot-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  min-width: 240px;
  padding: 32px 36px;
  border: 1px solid rgba(15, 123, 104, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  color: var(--ink);
}

.boot-card .brand-mark {
  width: 54px;
  height: 54px;
}

.boot-card strong {
  font-size: 18px;
}

.boot-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.login-screen {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  z-index: 50;
  min-height: 100vh;
  padding: 32px;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(15, 123, 104, 0.22), transparent 34%),
    linear-gradient(310deg, rgba(48, 105, 190, 0.28), transparent 42%),
    linear-gradient(180deg, #10233b 0%, #173d5a 58%, #dce9f6 100%);
}

.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, black, transparent 72%);
  pointer-events: none;
}

.is-logged-out .login-screen {
  display: grid;
}

.login-visual {
  position: absolute;
  top: clamp(38px, 8vh, 86px);
  left: clamp(32px, 8vw, 120px);
  right: clamp(32px, 8vw, 120px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
  color: white;
  z-index: 1;
  pointer-events: none;
}

.login-visual-copy {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  max-width: 720px;
}

.login-visual-copy .brand-mark {
  width: 58px;
  height: 58px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
}

.login-visual h1 {
  margin: 0;
  color: white;
  font-size: 32px;
  line-height: 1.2;
}

.login-visual p {
  grid-column: 2;
  margin: -8px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 15px;
  line-height: 1.6;
}

.login-card {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: min(420px, calc(100vw - 48px));
  margin-top: 92px;
  padding: 42px 42px 34px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 26px 72px rgba(17, 39, 68, 0.24);
}

.login-kicker {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.login-card h2 {
  margin: 0 0 6px;
  font-size: 28px;
  color: #13243a;
}

.login-card label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.login-card input {
  width: 100%;
  min-height: 48px;
  border: 1px solid #d8e2eb;
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: #fbfdff;
  font-size: 14px;
}

.login-card input:focus {
  border-color: #227bd0;
  outline: 3px solid rgba(34, 123, 208, 0.14);
  background: white;
}

.login-card .primary-action {
  width: 100%;
  min-height: 48px;
  justify-content: center;
  margin-top: 2px;
  background: #1967c2;
  color: white;
  font-size: 15px;
}

.login-error {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
}

.login-help {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  line-height: 1.6;
}

.inline-alert {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--red-2);
  border-radius: 8px;
  background: rgba(246, 222, 219, 0.64);
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
}

.inline-alert.subtle {
  border-color: #cfded7;
  background: #f4faf7;
  color: #31564b;
}

.empty-cell {
  height: 120px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.shell {
  display: block;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: auto;
  min-height: auto;
  padding: 0 28px;
  background:
    linear-gradient(90deg, rgba(34, 151, 123, 0.18), transparent 44%),
    #10231f;
  color: #f7fbf8;
  display: flex;
  align-items: center;
  gap: 22px;
  overflow: visible;
  z-index: 9;
}

.brand {
  flex: 0 0 230px;
  height: 72px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #55c79d, #d7b65d);
  color: #06120f;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(69, 176, 139, 0.28);
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 4px;
  color: #b8cac5;
  font-size: 12px;
}

.nav {
  display: flex;
  height: 72px;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  overflow: visible;
  flex: 1 1 auto;
  min-width: 0;
}

.nav-section {
  position: relative;
  flex: 1 1 0;
  min-width: 92px;
}

.nav-section.standalone {
  flex: 0.85 1 0;
}

.nav-group {
  width: 100%;
  height: 46px;
  margin: 0;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  color: #dce8e4;
  background: rgba(255, 255, 255, 0.06);
  font-size: 14px;
  font-weight: 850;
  white-space: nowrap;
}

.nav-section:hover .nav-group,
.nav-section.open .nav-group,
.nav-section.has-active .nav-group {
  color: #06120f;
  background: #dff5ec;
}

.nav-section.locked .nav-group,
.nav-section.locked:hover .nav-group,
.nav-section.locked.open .nav-group {
  color: rgba(220, 232, 228, 0.48);
  background: rgba(255, 255, 255, 0.035);
  cursor: not-allowed;
}

.nav-submenu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: max(260px, 100%);
  max-height: calc(100vh - 92px);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: none;
  padding: 8px;
  border: 1px solid rgba(216, 240, 234, 0.42);
  border-radius: 8px;
  background: #10231f;
  box-shadow: 0 18px 40px rgba(6, 18, 15, 0.22);
  z-index: 20;
}

.nav-submenu::-webkit-scrollbar {
  width: 8px;
}

.nav-submenu::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(216, 240, 234, 0.28);
}

.nav-section:hover .nav-submenu,
.nav-section.open .nav-submenu {
  display: grid;
  gap: 4px;
}

.nav-section.locked:hover .nav-submenu,
.nav-section.locked.open .nav-submenu {
  display: none;
}

.nav-section.standalone .nav-submenu {
  display: none;
}

.nav-item {
  width: auto;
  border: 0;
  color: #dce8e4;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  white-space: nowrap;
}

.nav-section.standalone > .nav-item {
  width: 100%;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 850;
  background: rgba(255, 255, 255, 0.06);
}

.nav-submenu .nav-item {
  width: 100%;
  display: grid;
  gap: 3px;
}

.nav-submenu .nav-item span {
  font-weight: 850;
}

.nav-submenu .nav-item small {
  color: #9db6ae;
  font-size: 11px;
  font-weight: 650;
}

.nav-item.active,
.nav-item:hover {
  color: #06120f;
  background: #dff5ec;
}

.nav-item.active small,
.nav-item:hover small {
  color: #31524a;
}

.nav-item[hidden],
[hidden].nav-group,
[data-action-permission][hidden] {
  display: none;
}

.side-panel {
  display: none;
  margin-top: 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.side-panel span,
.side-panel small {
  display: block;
  color: #b8cac5;
}

.side-panel strong {
  display: block;
  margin: 8px 0;
  font-size: 38px;
  line-height: 1;
}

.main {
  min-width: 0;
  padding: 22px 28px 28px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.topbar > div:first-child {
  flex: 1 1 220px;
  min-width: 180px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--green);
  text-transform: uppercase;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.15;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
}

.top-actions,
.toolbar,
.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toolbar {
  flex-wrap: wrap;
}

.top-actions {
  flex: 1 1 760px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
  overflow: visible;
}

.search {
  flex: 1 1 clamp(220px, 24vw, 320px);
  min-width: 190px;
  max-width: 320px;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.role-switcher {
  flex: 0 0 auto;
  min-width: 140px;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.role-switcher span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.role-switcher select {
  height: 34px;
  border: 0;
  padding: 0 4px;
  background: transparent;
}

.role-switcher.locked {
  opacity: 0.78;
}

.role-switcher.locked select {
  cursor: not-allowed;
}

.search span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.user-chip {
  min-width: 126px;
  min-height: 42px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.user-chip strong,
.user-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip strong {
  font-size: 13px;
}

.user-chip span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.impersonation-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: -8px 0 18px;
  padding: 10px 14px;
  border: 1px solid #f6c453;
  border-radius: 8px;
  background: #fff8df;
  color: #7a4a00;
  font-size: 13px;
  font-weight: 850;
}

.impersonation-banner[hidden] {
  display: none;
}

.impersonation-banner .ghost-button {
  height: 34px;
  background: #fff;
  color: #7a4a00;
  border-color: #f6c453;
}

.compact-search {
  min-width: 280px;
  flex: 1 1 280px;
}

.module-search {
  min-width: 260px;
  max-width: 360px;
  flex: 1 1 260px;
}

.primary-action,
.ghost-button {
  height: 44px;
  border-radius: 8px;
  padding: 0 16px;
  border: 1px solid transparent;
  font-weight: 750;
  white-space: nowrap;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary-action {
  color: white;
  background: var(--green);
}

.ghost-button {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

.ghost-button.danger {
  color: var(--red);
  border-color: var(--red-2);
  background: #fff7f6;
}

.ghost-button.danger:hover {
  background: #fee2e2;
}

.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--ink);
  padding: 0 10px;
  font-weight: 750;
}

.mini-button.danger {
  color: var(--red);
  border-color: var(--red-2);
  background: #fff7f6;
}

.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.action-inline {
  gap: 4px;
}

.row-action-menu {
  position: relative;
  display: inline-flex;
  justify-content: center;
  width: auto;
  margin-inline: auto;
  --action-menu-left: 0px;
  --action-menu-top: 0px;
}

.action-trigger {
  width: 56px;
  min-height: 30px;
  padding: 0;
}

.row-action-popover {
  position: fixed;
  top: var(--action-menu-top);
  left: var(--action-menu-left);
  right: auto;
  z-index: 120;
  display: none;
  gap: 6px;
  min-width: 112px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(22, 34, 25, 0.16);
  opacity: 0;
  transform: translate(-50%, -4px);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.row-action-menu:hover .row-action-popover,
.row-action-menu:focus-within .row-action-popover,
.row-action-menu.open .row-action-popover {
  display: grid;
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.row-action-popover.drop-up {
  transform: translate(-50%, 4px);
}

.row-action-menu:hover .row-action-popover.drop-up,
.row-action-menu:focus-within .row-action-popover.drop-up,
.row-action-menu.open .row-action-popover.drop-up {
  transform: translate(-50%, 0);
}

.row-action-popover .mini-button {
  justify-content: center;
  width: 100%;
  min-height: 30px;
  white-space: nowrap;
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 18px;
}

.brand-hero {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(15, 123, 104, 0.18);
  background: #10231f;
  box-shadow: var(--shadow);
}

.brand-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(7, 20, 18, 0.9), rgba(7, 20, 18, 0.62) 42%, rgba(7, 20, 18, 0.18));
}

.brand-hero-copy {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  padding: 28px;
  color: white;
}

.brand-hero-copy span {
  display: inline-flex;
  margin-bottom: 10px;
  color: #bee7dc;
  font-weight: 850;
  font-size: 12px;
}

.brand-hero-copy h2 {
  margin-bottom: 10px;
  font-size: 30px;
}

.brand-hero-copy p {
  max-width: 520px;
  margin-bottom: 0;
  color: #dcece8;
  line-height: 1.7;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

#dashboard .metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card,
.panel,
.customer-card,
.engineer-card,
.kanban-column,
.drawer-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card {
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--green), var(--gold));
}

.metric-card {
  padding: 18px;
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
}

.metric-card strong {
  display: block;
  margin: 8px 0 5px;
  font-size: 28px;
}

.metric-card small {
  color: var(--green);
  font-weight: 700;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 18px;
  align-items: stretch;
}

#dashboard .two-col {
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel.compact {
  align-self: start;
}

.two-col > .panel.compact {
  align-self: stretch;
}

#dashboard .two-col > .panel {
  display: grid;
  grid-template-rows: auto 1fr;
}

#dashboard .funnel,
#dashboard #risk-list {
  min-height: 340px;
}

#dashboard .funnel {
  align-content: stretch;
}

#dashboard .funnel-row {
  align-content: center;
}

.panel-head {
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

select,
.segmented,
.match-box label {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

select {
  height: 40px;
  padding: 0 34px 0 12px;
  color: var(--ink);
}

.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  flex-wrap: wrap;
}

.segmented button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.segmented button.active {
  background: var(--green-2);
  color: var(--green);
}

.toolbar {
  justify-content: space-between;
  flex-wrap: wrap;
}

.crm-list-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.crm-list-layout.no-groups {
  grid-template-columns: minmax(0, 1fr);
}

.crm-groups,
.crm-list-main,
.crm-filter-panel,
.crm-dashboard .panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.crm-groups {
  display: grid;
  gap: 6px;
  padding: 14px;
}

.crm-groups strong {
  margin-bottom: 6px;
}

.crm-groups button {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
}

.crm-groups button.active,
.crm-groups button:hover {
  color: var(--green);
  background: var(--green-2);
}

.crm-list-main {
  min-width: 0;
  padding: 14px;
  overflow: visible;
}

.crm-titlebar,
.crm-actions,
.crm-filter-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.crm-titlebar {
  justify-content: space-between;
  margin-bottom: 10px;
}

.crm-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.crm-search {
  min-width: 320px;
  height: 38px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(15, 123, 104, 0.02);
}

.crm-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  font-size: 14px;
  color: var(--ink);
}

.crm-search input::placeholder {
  color: #9aa5a1;
}

.crm-count {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.crm-filter-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  box-shadow: none;
  background: #fbfcfb;
}

.crm-filter-head {
  justify-content: space-between;
}

.crm-filter-body {
  display: grid;
  gap: 10px;
}

.crm-filter-panel.collapsed .crm-filter-body {
  display: none;
}

.crm-filter-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.crm-filter-row > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.crm-filter-row div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.crm-filter-row button {
  min-height: 26px;
  border: 0;
  border-radius: 999px;
  padding: 0 9px;
  color: var(--muted);
  background: var(--surface-2);
}

.crm-filter-row button.active {
  color: var(--green);
  background: var(--green-2);
}

.crm-dashboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.crm-wide-panel {
  grid-column: 1 / -1;
}

.sales-dashboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.sales-dashboard-toolbar label {
  display: grid;
  gap: 6px;
  min-width: 190px;
  color: var(--muted);
  font-size: 13px;
}

.sales-dashboard-toolbar select,
.sales-date-range input {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
}

.sales-range-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.sales-range-bar .mini-button.active {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.sales-date-range {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sales-date-range.muted-disabled {
  opacity: 0.55;
}

.sales-period-grid {
  display: grid;
  gap: 10px;
}

.sales-period-card {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.sales-period-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.sales-period-title strong {
  color: var(--text);
  font-size: 15px;
}

.compact-kpis article {
  padding: 10px;
}

.compact-kpis strong {
  font-size: 22px;
}

.crm-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.crm-kpis article {
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-2);
}

.crm-kpis strong {
  display: block;
  margin-bottom: 5px;
  color: var(--blue);
  font-size: 24px;
}

.crm-kpis span,
.crm-todo-list button {
  color: var(--muted);
  font-size: 13px;
}

.crm-todo-list {
  display: grid;
  gap: 8px;
}

.crm-todo-list button {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface-2);
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.crm-todo-list button:hover {
  color: var(--text);
  background: #e8f2ff;
  transform: translateY(-1px);
}

.crm-todo-list b {
  color: var(--blue);
}

.funnel,
.risk-list,
.engineer-list,
#match-results {
  display: grid;
  gap: 10px;
}

.funnel-row,
.risk-item,
.match-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.funnel-meta,
.card-meta,
.row-meta,
.tag-row,
.risk-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.tag,
.status,
.risk {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.tag {
  color: #31524a;
  background: var(--surface-2);
}

.tag.brand {
  color: #7a5713;
  background: var(--gold-2);
}

.status {
  color: var(--blue);
  background: var(--blue-2);
}

.status.hot,
.risk.high {
  color: var(--red);
  background: var(--red-2);
}

.text-danger {
  color: var(--red);
}

.inline-alert.danger {
  border-color: rgba(201, 55, 55, 0.28);
  color: var(--red);
  background: var(--red-2);
}

.customer-protection-warning-row {
  background: linear-gradient(90deg, rgba(201, 55, 55, 0.08), transparent 70%);
}

.customer-protection-badge {
  margin-top: 6px;
}

.status.warm,
.risk.medium {
  color: var(--amber);
  background: var(--amber-2);
}

.status.good,
.risk.low {
  color: var(--green);
  background: var(--green-2);
}

.status.locked {
  color: var(--violet);
  background: var(--violet-2);
}

.risk-item button,
.customer-card button,
.engineer-card button,
.demand-card button {
  justify-self: start;
  border: 0;
  border-radius: 7px;
  background: var(--ink);
  color: white;
  min-height: 32px;
  padding: 0 11px;
  font-weight: 750;
}

#risk-list {
  gap: 8px;
}

#risk-list .risk-item {
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
}

.risk-summary {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.risk-summary strong,
.risk-summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.risk-summary span {
  color: var(--muted);
  font-size: 12px;
}

#risk-list .risk-item button {
  min-height: 30px;
  padding: 0 9px;
}

.risk-more {
  width: 100%;
  min-height: 36px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--green);
  font-weight: 800;
}

.import-help {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.import-help strong {
  color: var(--ink);
}

.import-help span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
  padding-bottom: 0;
}

.dashboard-priority-table {
  table-layout: fixed;
}

.dashboard-priority-table th,
.dashboard-priority-table td {
  height: 54px;
  overflow: hidden;
  vertical-align: middle;
}

.dashboard-priority-table th:nth-child(1),
.dashboard-priority-table td:nth-child(1) {
  width: 24%;
}

.dashboard-priority-table th:nth-child(2),
.dashboard-priority-table td:nth-child(2) {
  width: 22%;
}

.dashboard-priority-table th:nth-child(3),
.dashboard-priority-table td:nth-child(3) {
  width: 10%;
}

.dashboard-priority-table th:nth-child(4),
.dashboard-priority-table td:nth-child(4) {
  width: 7%;
  text-align: center;
}

.dashboard-priority-table th:nth-child(5),
.dashboard-priority-table td:nth-child(5) {
  width: 12%;
}

.dashboard-priority-table th:nth-child(6),
.dashboard-priority-table td:nth-child(6) {
  width: 9%;
}

.dashboard-priority-table th:nth-child(7),
.dashboard-priority-table td:nth-child(7) {
  width: 16%;
}

.priority-main,
.priority-sub,
.priority-next {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.priority-sub,
.priority-next {
  color: var(--muted);
  font-size: 12px;
}

#pipeline .table-wrap {
  overflow-x: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
}

.data-table {
  min-width: 0;
}

.crm-scroll-table,
.crm-fit-table {
  width: 100%;
  table-layout: fixed;
}

.customer-table {
  min-width: 0;
}

.lead-table {
  min-width: 0;
}

.system-settings {
  display: grid;
  gap: 16px;
}

.system-stats {
  margin-top: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.system-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  overflow-x: auto;
}

.system-tabs button {
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
  white-space: nowrap;
}

.system-tabs button.active,
.system-tabs button:hover {
  color: white;
  background: var(--green);
}

.system-settings .table-wrap {
  overflow-x: auto;
}

.system-user-search {
  flex: 0 0 220px;
  height: 38px;
  min-width: 200px;
}

.system-table th,
.system-table td,
.permission-table th,
.permission-table td {
  vertical-align: middle;
  white-space: nowrap;
}

.system-table .actions-cell {
  width: 96px;
  text-align: center;
}

.system-table .row-action-menu {
  min-height: 32px;
  align-items: center;
}

.compact-filter-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.compact-filter-strip label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.compact-filter-strip select,
.compact-filter-strip input {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: white;
  color: var(--ink);
  font-weight: 800;
}

.public-sea-watermark {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 30px;
  margin: -4px 0 8px;
  color: #6f817a;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  user-select: none;
}

.permission-table {
  min-width: 1080px;
}

.permission-table th span {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
}

.permission-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  white-space: nowrap;
}

.permission-check input {
  width: 16px;
  height: 16px;
}

.permission-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.permission-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.permission-card strong {
  font-size: 15px;
}

.permission-card select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: white;
}

.permission-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.public-sea-security-panel {
  margin-bottom: 14px;
}

.public-sea-policy-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.permission-card.compact-card {
  gap: 8px;
}

.permission-card.compact-card input[type="number"],
.public-sea-access-grid input,
.public-sea-assign-grid input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: white;
  color: var(--ink);
  font-weight: 800;
}

.public-sea-access-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.public-sea-access-grid section {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.public-sea-access-grid h3 {
  margin: 0;
  font-size: 16px;
}

.permission-check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.public-sea-sales-check {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}

.public-sea-sales-check span {
  display: inline-flex;
  gap: 5px;
  align-items: baseline;
}

.public-sea-sales-check small {
  color: var(--muted);
  font-size: 11px;
}

.public-sea-assign-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.contact-table {
  min-width: 0;
}

.pipeline-table {
  min-width: 0;
}

.crm-scroll-table .sticky-select,
.crm-scroll-table .sticky-key,
.crm-fit-table .sticky-select,
.crm-fit-table .sticky-key {
  position: static;
  background: transparent;
  box-shadow: none;
}

.crm-scroll-table .sticky-select,
.crm-fit-table .sticky-select {
  width: 46px;
}

.crm-scroll-table td,
.crm-scroll-table th,
.crm-fit-table td,
.crm-fit-table th {
  white-space: nowrap;
}

.crm-scroll-table td,
.crm-fit-table td {
  max-width: none;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crm-scroll-table td .muted,
.crm-scroll-table .sticky-key .muted {
  max-width: 260px;
}

.cell-ellipsis {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
  white-space: nowrap;
}

.crm-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 42px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.crm-pagination strong {
  color: var(--ink);
}

.crm-pagination button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.page-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  white-space: nowrap;
}

.page-jump input {
  width: 56px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 8px;
  text-align: center;
}

.operation-pagination {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.recruiting-overview-panel .panel-head {
  margin-bottom: 10px;
}

.recruiting-overview-panel .table-wrap table {
  table-layout: fixed;
}

.recruiting-overview-panel th,
.recruiting-overview-panel td {
  padding-top: 8px;
  padding-bottom: 8px;
  vertical-align: middle;
}

.recruiting-overview-table {
  width: 100%;
  table-layout: fixed;
}

.recruiting-overview-table th,
.recruiting-overview-table td {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recruiting-overview-table th:nth-child(1),
.recruiting-overview-table td:nth-child(1) {
  width: 11%;
}

.recruiting-overview-table th:nth-child(2),
.recruiting-overview-table td:nth-child(2) {
  width: 16%;
}

.recruiting-overview-table th:nth-child(3),
.recruiting-overview-table td:nth-child(3) {
  width: 18%;
}

.recruiting-overview-table th:nth-child(4),
.recruiting-overview-table td:nth-child(4) {
  width: 11%;
}

.recruiting-overview-table th:nth-child(5),
.recruiting-overview-table td:nth-child(5) {
  width: 11%;
}

.recruiting-overview-table th:nth-child(6),
.recruiting-overview-table td:nth-child(6) {
  width: 13%;
}

.recruiting-overview-table th:nth-child(7),
.recruiting-overview-table td:nth-child(7) {
  width: 20%;
}

.recruiting-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.recruiting-summary-strip span {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.recruiting-summary-strip small,
.recruiting-summary-strip strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recruiting-summary-strip small {
  color: var(--muted);
  font-size: 11px;
}

.recruiting-summary-strip strong {
  margin-top: 3px;
  font-size: 15px;
}

.recruiting-filter-bar {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(140px, 1fr) 132px 132px 124px auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
}

.recruiting-filter-bar label {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.recruiting-filter-bar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.recruiting-filter-bar select,
.recruiting-filter-bar input {
  width: 100%;
  min-width: 0;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}

.recruiting-filter-bar button {
  height: 34px;
  white-space: nowrap;
}

.crm-check-col {
  width: 3.5%;
}

.crm-name-col {
  width: 17%;
}

.crm-contact-col {
  width: 8%;
}

.crm-phone-col {
  width: 12%;
}

.crm-meta-col {
  width: 9%;
}

.crm-owner-col {
  width: 6%;
}

.crm-status-col {
  width: 7%;
}

.crm-follow-col {
  width: 23%;
}

.crm-date-col {
  width: 8%;
}

.crm-protect-col {
  width: 5.5%;
}

.crm-action-col {
  width: 6%;
}

.customer-table .company-cell,
.lead-table .company-cell {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  text-align: left;
  vertical-align: middle;
}

.company-name-block {
  min-height: 42px;
  display: grid;
  align-content: center;
  justify-items: start;
  line-height: 1.35;
  margin-inline: 0;
}

.customer-table .phone-cell,
.lead-table td:nth-child(4) {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.customer-table .company-cell strong,
.lead-table .company-cell strong {
  display: block;
  margin-bottom: 0;
  overflow: visible;
  white-space: normal;
  word-break: break-all;
}

.customer-table .company-cell .muted,
.lead-table .company-cell .muted {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.customer-table .actions-cell,
.lead-table .actions-cell {
  overflow: visible;
  text-overflow: clip;
  text-align: center;
}

.customer-table th,
.customer-table td,
.lead-table th,
.lead-table td {
  vertical-align: middle;
}

.customer-table .row-action-menu,
.lead-table .row-action-menu {
  justify-content: center;
  margin-inline: auto;
}

@media (max-width: 1180px) {
  .customer-table .crm-check-col,
  .customer-table .crm-meta-col,
  .customer-table .crm-owner-col,
  .lead-table .crm-check-col,
  .lead-table .crm-meta-col,
  .lead-table .crm-owner-col,
  .lead-table .crm-protect-col,
  .customer-table th:nth-child(1),
  .customer-table td:nth-child(1),
  .customer-table th:nth-child(5),
  .customer-table td:nth-child(5),
  .customer-table th:nth-child(6),
  .customer-table td:nth-child(6),
  .lead-table th:nth-child(1),
  .lead-table td:nth-child(1),
  .lead-table th:nth-child(5),
  .lead-table td:nth-child(5),
  .lead-table th:nth-child(6),
  .lead-table td:nth-child(6),
  .lead-table th:nth-child(10),
  .lead-table td:nth-child(10) {
    display: none;
  }

  .customer-table .crm-name-col,
  .lead-table .crm-name-col {
    width: 28%;
  }

  .customer-table .crm-contact-col,
  .lead-table .crm-contact-col {
    width: 10%;
  }

  .customer-table .crm-phone-col,
  .lead-table .crm-phone-col {
    width: 20%;
  }

  .customer-table .crm-status-col,
  .lead-table .crm-status-col {
    width: 10%;
  }

  .customer-table .crm-follow-col,
  .lead-table .crm-follow-col {
    width: 16%;
  }

  .customer-table .crm-date-col,
  .lead-table .crm-date-col {
    width: 10%;
  }

  .customer-table .crm-action-col,
  .lead-table .crm-action-col {
    width: 10%;
  }
}

@media (max-width: 760px) {
  .customer-table .crm-date-col,
  .lead-table .crm-date-col,
  .customer-table th:nth-child(9),
  .customer-table td:nth-child(9),
  .lead-table th:nth-child(9),
  .lead-table td:nth-child(9) {
    display: none;
  }

  .customer-table .crm-name-col,
  .lead-table .crm-name-col {
    width: 28%;
  }

  .customer-table .crm-contact-col,
  .lead-table .crm-contact-col {
    width: 10%;
  }

  .customer-table .crm-phone-col,
  .lead-table .crm-phone-col {
    width: 24%;
  }

  .customer-table .crm-status-col,
  .lead-table .crm-status-col {
    width: 9%;
  }

  .customer-table .crm-follow-col,
  .lead-table .crm-follow-col {
    width: 19%;
  }

  .customer-table .crm-action-col,
  .lead-table .crm-action-col {
    width: 10%;
  }
}

.dedupe-box {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr) auto;
  gap: 12px;
  align-items: end;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.dedupe-box label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.dedupe-box input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  color: var(--ink);
  background: #fff;
}

.duplicate-merge-panel {
  margin-top: 16px;
}

.duplicate-group-list {
  display: grid;
  gap: 14px;
}

.duplicate-group-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  overflow: hidden;
}

.duplicate-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #f7faf8;
}

.duplicate-group-head > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.duplicate-merge-table {
  min-width: 980px;
}

.duplicate-merge-table th,
.duplicate-merge-table td {
  vertical-align: middle;
  white-space: nowrap;
}

.duplicate-merge-table td:nth-child(4) {
  min-width: 260px;
  white-space: normal;
}

.duplicate-merge-table td:nth-child(4) strong,
.duplicate-merge-table td:nth-child(4) span {
  display: block;
}

.duplicate-merge-table input[type="radio"],
.duplicate-merge-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.duplicate-merge-note {
  margin: 0;
  padding: 10px 16px 14px;
}

.empty-state {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  background: var(--surface-2);
}

.template-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.section-head-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.mini-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.detail-section + .detail-section {
  margin-top: 2px;
}

.detail-section h3 {
  margin: 0 0 12px;
}

.detail-section .section-head-inline {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.mini-list article {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.mini-list span,
.mini-list small {
  color: var(--muted);
}

.contact-mini-list article {
  grid-template-columns: minmax(0, 1fr);
}

.contact-mini-list article > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.contact-mini-list .compact-actions {
  justify-content: flex-start;
}

.compact-actions {
  margin-top: 8px;
}

.detail-table-wrap {
  overflow: visible;
}

.demand-mini-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}

.demand-mini-table th,
.demand-mini-table td,
.demand-mini-table td strong,
.demand-mini-table td .muted,
.demand-actions {
  white-space: nowrap;
}

.demand-mini-table th,
.demand-mini-table td {
  vertical-align: middle;
}

.demand-mini-table th:nth-child(n + 2),
.demand-mini-table td:nth-child(n + 2) {
  text-align: center;
}

.demand-mini-table th:nth-child(1),
.demand-mini-table td:nth-child(1) {
  width: 30%;
  text-align: left;
}

.demand-mini-table th:nth-child(7),
.demand-mini-table td:nth-child(7) {
  width: 180px;
}

.demand-mini-table th:nth-child(5),
.demand-mini-table td:nth-child(5) {
  width: 72px;
}

.demand-mini-table td:nth-child(1) strong,
.demand-mini-table td:nth-child(1) .muted {
  overflow: hidden;
  text-overflow: ellipsis;
}

.resume-status {
  display: inline-block;
  max-width: 160px;
  overflow: hidden;
  color: var(--ink);
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.resume-status.warn {
  color: #a16207;
}

.resume-status.missing {
  color: var(--muted);
}

.resume-note {
  display: block;
  margin-top: 3px;
}

.placement-overview-panel {
  margin-bottom: 14px;
}

.placement-total {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.placement-total strong {
  color: var(--green);
}

.placement-head-tools {
  display: grid;
  gap: 10px;
  justify-items: end;
  min-width: 0;
}

.placement-top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.placement-top-actions .ghost-button {
  min-width: 96px;
}

.placement-company-list,
.placement-project-list {
  display: grid;
  gap: 16px;
}

.placement-company-card,
.placement-project-card {
  display: grid;
  gap: 0;
  width: 100%;
  overflow: hidden;
  border: 1px solid #dfe7e4;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 45, 38, 0.08);
}

.placement-company-head,
.placement-project-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(520px, auto);
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 12px 14px;
  border-bottom: 2px solid #263b34;
  background: #f8fbfa;
}

.placement-company-head h3,
.placement-project-head h3 {
  margin: 0 0 4px;
  font-size: 18px;
  line-height: 1.2;
}

.placement-company-head > div:first-child,
.placement-project-head > div:first-child {
  min-width: 0;
}

.placement-company-head > div:first-child .muted,
.placement-project-head > div:first-child .muted {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.placement-module-label {
  display: inline-flex;
  align-items: center;
  height: 20px;
  margin-bottom: 5px;
  padding: 0 7px;
  border-left: 3px solid var(--blue);
  background: #eef4ff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.placement-company-meta,
.placement-project-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.placement-company-meta strong,
.placement-project-meta strong {
  color: var(--ink);
  font-size: 14px;
}

.placement-project-blocks {
  display: grid;
  gap: 12px;
  padding: 12px;
  background: #f5f7f6;
}

.placement-project-block {
  overflow: hidden;
  border: 1px solid #e1e8e5;
  border-radius: 6px;
  background: #fff;
}

.placement-project-subhead {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) repeat(4, minmax(86px, auto));
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 9px 12px;
  border-bottom: 1px solid #dfe7e4;
  background: #fbfcfc;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.placement-project-subhead strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  text-overflow: ellipsis;
}

.placement-ledger-table {
  table-layout: fixed;
  font-size: 12px;
}

.placement-ledger-table th,
.placement-ledger-table td {
  height: 38px;
  padding: 8px 10px;
  vertical-align: middle;
}

.placement-ledger-table th {
  color: #1f2d29;
  font-weight: 800;
  background: #fff;
}

.placement-ledger-table th:nth-child(1),
.placement-ledger-table td:nth-child(1) {
  width: 31%;
}

.placement-ledger-table th:nth-child(2),
.placement-ledger-table td:nth-child(2) {
  width: 11%;
  text-align: center;
}

.placement-ledger-table th:nth-child(3),
.placement-ledger-table td:nth-child(3) {
  width: 10%;
  text-align: center;
}

.placement-ledger-table th:nth-child(4),
.placement-ledger-table td:nth-child(4) {
  width: 10%;
  text-align: right;
  white-space: nowrap;
}

.placement-ledger-table th:nth-child(5),
.placement-ledger-table td:nth-child(5),
.placement-ledger-table th:nth-child(6),
.placement-ledger-table td:nth-child(6) {
  width: 10%;
  text-align: right;
  white-space: nowrap;
}

.placement-ledger-table th:nth-child(7),
.placement-ledger-table td:nth-child(7) {
  width: 18%;
  text-align: center;
}

.placement-row-actions {
  display: flex;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.placement-ledger-table td:nth-child(1),
.placement-ledger-table td:nth-child(2),
.placement-ledger-table td:nth-child(3) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.placement-ledger-table td:nth-child(4),
.placement-ledger-table td:nth-child(5) {
  white-space: nowrap;
}

.placement-ledger-table td:nth-child(1) {
  color: #1e2f2a;
  font-weight: 650;
}

.placement-ledger-table .placement-project-summary td {
  height: 42px;
  border-top: 2px solid #263b34;
  border-bottom: 2px solid #263b34;
  background: #fbfcfc;
  color: #111827;
  font-weight: 800;
}

.placement-ledger-table .placement-project-summary strong {
  display: inline;
  margin: 0;
}

.drawer.placement-merge-mode .drawer-card {
  width: min(1500px, calc(100vw - 20px));
  padding: 18px 20px;
}

.drawer.placement-merge-mode .drawer-content-block {
  gap: 14px;
  padding-right: 0;
}

.placement-merge-wrap {
  max-height: calc(100vh - 190px);
  overflow: auto;
}

.placement-merge-table {
  min-width: 1080px;
  table-layout: fixed;
}

.placement-merge-table th,
.placement-merge-table td {
  vertical-align: middle;
}

.placement-merge-table th:nth-child(1),
.placement-merge-table td:nth-child(1) {
  width: 32%;
}

.placement-merge-table th:nth-child(2),
.placement-merge-table td:nth-child(2) {
  width: 28%;
}

.placement-merge-table th:nth-child(3),
.placement-merge-table td:nth-child(3) {
  width: 30%;
}

.placement-merge-table th:nth-child(4),
.placement-merge-table td:nth-child(4) {
  width: 10%;
  text-align: center;
  white-space: nowrap;
}

.placement-merge-table input {
  width: 100%;
  min-width: 0;
}

.placement-merge-table .muted {
  display: block;
  margin-top: 3px;
}

.placement-merge-actions {
  justify-content: flex-end;
}

.placement-customer-list {
  display: grid;
  gap: 14px;
}

.placement-customer-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.placement-customer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.placement-customer-head h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.placement-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.placement-summary-grid div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #edf1ef;
  border-radius: 8px;
  background: #f8faf9;
}

.placement-summary-grid span,
.placement-mini-table .muted {
  display: block;
}

.placement-summary-grid span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.placement-summary-grid strong {
  color: var(--ink);
  font-size: 16px;
}

.placement-mini-table {
  table-layout: fixed;
}

.placement-mini-table th,
.placement-mini-table td {
  vertical-align: middle;
}

.placement-mini-table th:nth-child(1),
.placement-mini-table td:nth-child(1) {
  width: 16%;
}

.placement-mini-table th:nth-child(2),
.placement-mini-table td:nth-child(2) {
  width: 20%;
}

.placement-mini-table th:nth-child(4),
.placement-mini-table td:nth-child(4),
.placement-mini-table th:nth-child(5),
.placement-mini-table td:nth-child(5),
.placement-mini-table th:nth-child(6),
.placement-mini-table td:nth-child(6) {
  text-align: right;
  white-space: nowrap;
}

.project-table {
  table-layout: fixed;
  width: 100%;
  min-width: 1080px;
}

.job-stats-table {
  table-layout: fixed;
  width: 100%;
  min-width: 1120px;
}

.project-progress-table {
  table-layout: fixed;
  width: 100%;
  min-width: 980px;
}

.project-table-wrap,
.project-progress-table-wrap,
.job-stats-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
}

.job-stats-table th,
.job-stats-table td,
.project-progress-table th,
.project-progress-table td {
  overflow: hidden;
  vertical-align: middle;
}

.project-table th,
.project-table td {
  overflow: hidden;
  vertical-align: middle;
}

.project-table th:nth-child(1),
.project-table td:nth-child(1) {
  width: 9%;
}

.project-table th:nth-child(2),
.project-table td:nth-child(2) {
  width: 15%;
}

.project-table th:nth-child(3),
.project-table td:nth-child(3) {
  width: 17%;
}

.project-table th:nth-child(4),
.project-table td:nth-child(4),
.project-table th:nth-child(5),
.project-table td:nth-child(5),
.project-table th:nth-child(6),
.project-table td:nth-child(6),
.project-table th:nth-child(7),
.project-table td:nth-child(7),
.project-table th:nth-child(8),
.project-table td:nth-child(8) {
  width: 8%;
  text-align: center;
  white-space: nowrap;
}

.project-table th:nth-child(9),
.project-table td:nth-child(9) {
  width: 11%;
  text-align: left;
}

.project-table th:nth-child(10),
.project-table td:nth-child(10) {
  width: 8%;
  text-align: center;
}

.job-stats-table th:nth-child(1),
.job-stats-table td:nth-child(1) {
  width: 20%;
}

.job-stats-table th:nth-child(2),
.job-stats-table td:nth-child(2) {
  width: 16%;
}

.job-stats-table th:nth-child(10),
.job-stats-table td:nth-child(10) {
  width: 17%;
  text-align: left;
}

.job-stats-table th:nth-child(11),
.job-stats-table td:nth-child(11) {
  width: 8%;
  text-align: center;
  white-space: nowrap;
}

.job-stats-table th:nth-child(3),
.job-stats-table td:nth-child(3),
.job-stats-table th:nth-child(4),
.job-stats-table td:nth-child(4),
.job-stats-table th:nth-child(5),
.job-stats-table td:nth-child(5),
.job-stats-table th:nth-child(6),
.job-stats-table td:nth-child(6),
.job-stats-table th:nth-child(7),
.job-stats-table td:nth-child(7),
.job-stats-table th:nth-child(8),
.job-stats-table td:nth-child(8),
.job-stats-table th:nth-child(9),
.job-stats-table td:nth-child(9) {
  width: 5%;
  text-align: center;
  white-space: nowrap;
}

.job-stats-table th:nth-child(9),
.job-stats-table td:nth-child(9) {
  width: 7%;
}

.project-progress-table th:nth-child(1),
.project-progress-table td:nth-child(1) {
  width: 18%;
}

.project-progress-table th:nth-child(2),
.project-progress-table td:nth-child(2) {
  width: 8%;
  text-align: center;
}

.project-progress-table th:nth-child(3),
.project-progress-table td:nth-child(3) {
  width: 30%;
}

.project-progress-table th:nth-child(4),
.project-progress-table td:nth-child(4) {
  width: 10%;
  text-align: center;
  white-space: nowrap;
}

.project-progress-table th:nth-child(5),
.project-progress-table td:nth-child(5) {
  width: 10%;
}

.project-progress-table th:nth-child(6),
.project-progress-table td:nth-child(6) {
  width: 18%;
}

.project-progress-table th:nth-child(7),
.project-progress-table td:nth-child(7) {
  width: 6%;
  text-align: center;
  white-space: nowrap;
}

.project-owner-cell,
.project-owner-next {
  display: grid;
  gap: 3px;
  max-width: 100%;
  min-width: 0;
  align-content: center;
  justify-items: start;
}

.project-owner-cell strong,
.project-owner-next strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 820;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-owner-cell small,
.project-owner-next small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-date-cell,
.project-progress-content,
.project-next-cell {
  display: block;
  max-width: 100%;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-demand-metrics {
  margin-bottom: 14px;
}

.daily-demand-list {
  display: grid;
  gap: 12px;
}

.daily-demand-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.daily-demand-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.daily-demand-main strong,
.daily-demand-main span,
.daily-demand-card p {
  min-width: 0;
}

.daily-demand-main div {
  display: grid;
  gap: 4px;
}

.daily-demand-main div > span,
.daily-demand-card p {
  margin: 0;
  color: var(--muted);
}

.daily-demand-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.daily-demand-facts span {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #edf1ef;
  border-radius: 8px;
  background: #f8faf9;
  color: var(--muted);
  font-size: 13px;
}

.daily-demand-facts b {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
}

.daily-demand-tags {
  gap: 6px;
}

.daily-demand-footer {
  display: grid;
  gap: 8px;
}

.daily-demand-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.inline-filter {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.inline-filter input,
.inline-filter select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 6px 9px;
  font: inherit;
}

.budget-cell {
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

.demand-actions {
  flex-wrap: nowrap;
  gap: 4px;
  justify-content: center;
  margin-top: 0;
}

.demand-actions .mini-button {
  min-width: 48px;
  padding-inline: 8px;
}

.operation-log-table td:last-child {
  max-width: 320px;
}

.timeline.followup-timeline {
  display: grid;
  gap: 10px;
}

.timeline.followup-timeline li {
  position: relative;
  padding: 13px 14px 13px 18px;
  border: 1px solid #cfe2ff;
  border-left: 4px solid #1967c2;
  border-radius: 8px;
  background: #f5f9ff;
  box-shadow: 0 8px 20px rgba(25, 103, 194, 0.08);
}

.timeline.followup-timeline strong {
  color: #123c70;
}

.timeline.followup-timeline .followup-meta {
  display: block;
  margin: 6px 0;
  color: #5d6b7d;
  font-size: 12px;
  font-weight: 800;
}

.field-with-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.field-hint.company-verify-result {
  min-height: 18px;
}

.field-hint.company-verify-result.ok {
  color: #127a4d;
}

.field-hint.company-verify-result.warn {
  color: #a55b00;
}

.field-hint.company-verify-result.danger {
  color: #b42318;
  font-weight: 850;
}

.required-mark {
  color: #d92d20;
  font-size: 14px;
  line-height: 1;
  margin-left: 2px;
}

.preference-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.preference-choice {
  height: 32px;
  border: 1px solid #d8e0ea;
  border-radius: 999px;
  padding: 0 12px;
  color: #43536a;
  background: #fff;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.preference-choice:hover {
  transform: translateY(-1px);
  border-color: #1967c2;
  color: #1967c2;
}

.preference-choice.selected {
  border-color: #1967c2;
  color: #174ea6;
  background: #eef5ff;
}

.opportunity-table {
  min-width: 0;
  table-layout: fixed;
}

.opportunity-table th,
.opportunity-table td {
  padding: 9px 8px;
  font-size: 13px;
}

.opportunity-table th:nth-child(1),
.opportunity-table td:nth-child(1) {
  width: 15%;
}

.opportunity-table th:nth-child(2),
.opportunity-table td:nth-child(2) {
  width: 17%;
}

.opportunity-table th:nth-child(3),
.opportunity-table td:nth-child(3),
.opportunity-table th:nth-child(8),
.opportunity-table td:nth-child(8),
.opportunity-table th:nth-child(11),
.opportunity-table td:nth-child(11) {
  width: 7%;
}

.opportunity-table th:nth-child(4),
.opportunity-table td:nth-child(4) {
  width: 5%;
}

.opportunity-table th:nth-child(5),
.opportunity-table td:nth-child(5),
.opportunity-table th:nth-child(6),
.opportunity-table td:nth-child(6),
.opportunity-table th:nth-child(7),
.opportunity-table td:nth-child(7),
.opportunity-table th:nth-child(9),
.opportunity-table td:nth-child(9) {
  width: 8%;
}

.opportunity-table th:nth-child(10),
.opportunity-table td:nth-child(10) {
  width: 17%;
}

.opportunity-table td:nth-child(10) {
  color: var(--muted);
  line-height: 1.35;
}

.opportunity-table td:nth-child(10),
.opportunity-table .muted {
  white-space: normal;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  white-space: nowrap;
}

td strong {
  display: block;
  margin-bottom: 4px;
  white-space: nowrap;
}

td {
  line-height: 1.45;
}

.data-table td {
  max-width: 260px;
}

.data-table td,
.data-table .muted {
  overflow-wrap: normal;
  word-break: keep-all;
}

.customer-table th,
.customer-table td,
.lead-table th,
.lead-table td {
  vertical-align: middle;
}

.customer-table th:nth-child(2),
.lead-table th:nth-child(2) {
  text-align: center;
}

.customer-table th:nth-child(4),
.customer-table td:nth-child(4),
.customer-table th:nth-child(10),
.customer-table td:nth-child(10),
.lead-table th:nth-child(4),
.lead-table td:nth-child(4),
.lead-table th:nth-child(11),
.lead-table td:nth-child(11) {
  text-align: center;
}

.customer-table .company-cell,
.lead-table .company-cell {
  padding-top: 10px;
  padding-bottom: 10px;
  vertical-align: middle;
  text-align: center;
}

.customer-table .company-name-block,
.lead-table .company-name-block {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  width: 100%;
  margin: 0;
}

.customer-table .company-cell strong,
.lead-table .company-cell strong {
  margin: 0;
  line-height: 1.35;
  text-align: center;
}

.customer-table .phone-cell,
.lead-table td:nth-child(4) {
  height: 100%;
  vertical-align: middle;
  line-height: 1.35;
}

.customer-table .actions-cell,
.lead-table .actions-cell {
  padding-top: 10px;
  padding-bottom: 10px;
  vertical-align: middle;
}

.customer-table .row-action-menu,
.lead-table .row-action-menu {
  align-items: center;
  justify-content: center;
  min-height: 32px;
}

.customer-table .company-cell,
.lead-table .company-cell {
  text-align: center;
  vertical-align: middle;
}

.customer-table .company-name-block,
.lead-table .company-name-block {
  display: grid;
  min-height: 40px;
  align-content: center;
  justify-items: center;
  gap: 2px;
}

.customer-table .company-cell strong,
.lead-table .company-cell strong {
  display: block;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-table .company-cell .muted,
.lead-table .company-cell .muted {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-table .phone-cell,
.lead-table td:nth-child(4),
.customer-table .actions-cell,
.lead-table .actions-cell {
  text-align: center;
  vertical-align: middle;
}

.lead-table tr.lead-empty-number-row {
  background: #fff1f2;
}

.lead-table tr.lead-empty-number-row td {
  border-bottom-color: #fecdd3;
}

.lead-table tr.lead-empty-number-row .company-name-block strong {
  color: #9f1239;
}

.lead-table tr.lead-wrong-number-row {
  background: #fff7ed;
}

.lead-table tr.lead-wrong-number-row td {
  border-bottom-color: #fed7aa;
}

.lead-table tr.lead-wrong-number-row .company-name-block strong {
  color: #9a3412;
}

.lead-empty-badge,
.lead-wrong-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  margin-left: 8px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
  white-space: nowrap;
}

.lead-empty-badge {
  border: 1px solid #fecdd3;
  border-radius: 999px;
  background: #ffe4e6;
  color: #be123c;
}

.lead-wrong-badge {
  border: 1px solid #fed7aa;
  border-radius: 999px;
  background: #ffedd5;
  color: #c2410c;
}

.opportunity-table td,
.opportunity-table .muted {
  overflow-wrap: anywhere;
  word-break: normal;
}

.file-pill {
  display: inline-flex;
  max-width: 220px;
  min-height: 26px;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--blue);
  background: var(--blue-2);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-pill a,
.file-box a {
  max-width: 100%;
  color: var(--blue);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-pill a:hover,
.file-box a:hover,
.file-pill a:focus-visible,
.file-box a:focus-visible {
  text-decoration: underline;
  outline: none;
}

.file-box {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.file-box span {
  color: var(--muted);
  word-break: break-all;
}

.click-row {
  cursor: pointer;
}

.click-row:hover {
  background: #f4f8f6;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.customer-card,
.engineer-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.customer-card header,
.engineer-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.customer-card h3,
.engineer-card h3 {
  margin-bottom: 4px;
  font-size: 17px;
}

.card-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.card-stats div {
  padding: 10px;
  border-radius: 8px;
  background: #f7f9f8;
}

.card-stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.card-stats strong {
  display: block;
  margin-top: 4px;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(260px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.kanban-column {
  min-height: 560px;
  padding: 12px;
  box-shadow: none;
}

.kanban-column header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.kanban-list {
  display: grid;
  gap: 10px;
}

.demand-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.demand-card h3 {
  margin-bottom: 3px;
  font-size: 15px;
}

.resource-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
}

.resource-layout.wide-left {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.55fr);
}

.engineer-card {
  box-shadow: none;
}

.match-box {
  display: grid;
  gap: 14px;
}

.match-box label {
  display: grid;
  gap: 8px;
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.match-box select {
  width: 100%;
}

.match-score {
  font-size: 26px;
  color: var(--green);
  font-weight: 850;
}

.module-map {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.module-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 123, 104, 0.07), transparent 48%),
    #fbfcfb;
}

.module-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.module-card h3 {
  margin-bottom: 0;
}

.module-card ul,
.workflow {
  margin: 0;
  padding: 0;
  list-style: none;
}

.module-card li {
  margin-top: 6px;
  color: var(--muted);
}

.workflow {
  display: grid;
  gap: 10px;
}

.workflow-step {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.workflow-step b {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--green-2);
  color: var(--green);
}

.drawer {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: flex-end;
  background: rgba(9, 20, 17, 0.35);
  z-index: 10;
}

.drawer.open {
  display: flex;
}

.drawer-card {
  width: min(1080px, calc(100vw - 36px));
  height: 100%;
  overflow-y: auto;
  border-radius: 8px 0 0 8px;
  padding: 24px;
  position: relative;
}

.drawer-sticky-head {
  position: sticky;
  top: -24px;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 60px;
  margin: -24px -24px 18px;
  padding: 14px 18px 12px 24px;
  border-bottom: 1px solid rgba(220, 228, 223, 0.9);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 30px rgba(31, 45, 38, 0.08);
  backdrop-filter: blur(10px);
}

.drawer-sticky-title {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  font-size: 22px;
}

.drawer-sticky-head .drawer-close {
  position: static;
  flex: 0 0 auto;
}

.text-link-button {
  display: inline;
  border: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-weight: 700;
  line-height: 1.4;
  padding: 0;
  text-align: left;
}

.text-link-button:hover {
  text-decoration: underline;
}

.drawer-content-block {
  display: grid;
  gap: 16px;
  padding-right: 20px;
}

.drawer-content-block .card-stats {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
}

.drawer h2 {
  padding-right: 36px;
}

.drawer.payroll-detail-mode .drawer-card {
  width: min(1760px, calc(100vw - 16px));
  padding: 18px 20px;
}

.drawer.payroll-detail-mode .drawer-content-block {
  gap: 12px;
  padding-right: 0;
}

.drawer.resume-import-mode .drawer-card {
  width: min(1720px, calc(100vw - 12px));
  padding: 18px 20px;
}

.resume-import-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 16px;
}

.resume-import-card h3 {
  margin: 0;
  font-size: 16px;
}

.resume-import-mode .drawer-content-block {
  gap: 14px;
  padding-right: 0;
}

.resume-import-mode .form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
}

.resume-import-mode .form-grid .wide {
  grid-column: 1 / -1;
}

.resume-import-mode .form-grid .span-2 {
  grid-column: span 2;
}

.resume-import-mode .form-grid input,
.resume-import-mode .form-grid select {
  min-height: 38px;
}

.resume-import-mode .form-grid textarea {
  min-height: 132px;
  line-height: 1.65;
}

.resume-import-mode .resume-import-card + .resume-import-card textarea {
  min-height: 168px;
}

.resume-import-actions {
  position: sticky;
  bottom: -18px;
  z-index: 5;
  flex-wrap: wrap;
  margin: 0 -20px -18px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  padding: 12px 20px;
  backdrop-filter: blur(8px);
}

.timeline {
  display: grid;
  gap: 10px;
  padding-left: 0;
  list-style: none;
}

.timeline li {
  padding: 12px;
  border-left: 3px solid var(--green);
  background: #f7f9f8;
  border-radius: 0 8px 8px 0;
}

.timeline-actions {
  margin-top: 10px;
}

.timeline-actions .mini-button {
  min-height: 28px;
  padding: 0 9px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-grid label,
.form-grid .wide {
  display: grid;
  gap: 7px;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.form-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.form-grid small,
.field-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 9px 11px;
  outline: 0;
}

.form-grid input[type="file"] {
  padding: 7px 10px;
}

.employee-combo-field {
  min-width: 0;
}

.employee-combo-field small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-combo-field input[list] {
  padding-right: 28px;
}

.customer-picker-label {
  overflow: visible;
}

.customer-lookup {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.customer-lookup-results {
  position: absolute;
  z-index: 18;
  top: 39px;
  left: 0;
  right: 0;
  display: grid;
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 6px;
}

.customer-lookup-results button {
  display: grid;
  gap: 2px;
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  padding: 8px 10px;
  text-align: left;
}

.customer-lookup-results button:hover {
  background: #f3f6f5;
}

.customer-lookup-results strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-lookup-results span,
.customer-lookup-empty {
  color: var(--muted);
  font-size: 12px;
}

.customer-lookup-results span {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.customer-lookup-status {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 999px;
  background: #eef6ff;
  color: var(--blue);
  font-size: 11px;
  line-height: 1.6;
}

.customer-lookup-status.warn {
  background: #fff7ed;
  color: #b45309;
}

.customer-lookup-status.blocked {
  background: #fef2f2;
  color: #b91c1c;
}

.customer-lookup-empty {
  padding: 10px;
}

.share-candidate-summary {
  border: 1px solid #dbe7ff;
  border-radius: 8px;
  background: #f7faff;
  color: var(--muted);
  font-size: 13px;
  padding: 9px 10px;
}

.share-customer-info {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.share-customer-info.is-ready {
  border-color: #cfe9df;
  background: #f7fcfa;
}

.share-customer-info.is-blocked {
  border-color: #fed7aa;
  background: #fffaf4;
}

.share-customer-info.is-empty {
  color: var(--muted);
  background: #f8fafc;
}

.share-customer-info-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.share-customer-info-head strong,
.share-customer-info-head small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-customer-info-head strong {
  color: var(--ink);
  font-size: 15px;
}

.share-customer-info-head small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.share-customer-status {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 800;
}

.share-customer-status.ok {
  background: var(--green-2);
  color: var(--green);
}

.share-customer-status.warn {
  background: #fff7ed;
  color: #b45309;
}

.share-customer-status.blocked {
  background: #fef2f2;
  color: #b91c1c;
}

.share-customer-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.share-customer-facts span {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-customer-facts b {
  color: var(--muted);
  font-weight: 700;
  margin-right: 6px;
}

.share-demand-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.share-demand-tags span {
  max-width: 100%;
  border-radius: 999px;
  background: #eef6ff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-grid textarea {
  min-height: 86px;
  resize: vertical;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.form-grid .form-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.form-grid .form-actions button {
  width: auto;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  padding: 12px 14px;
  border-radius: 8px;
  background: #10231f;
  color: white;
  box-shadow: var(--shadow);
}

.confirm-modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(9, 20, 17, 0.42);
  z-index: 30;
}

.confirm-modal.open {
  display: grid;
}

.confirm-card {
  width: min(460px, calc(100vw - 48px));
  display: grid;
  gap: 18px;
  padding: 22px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(15, 32, 29, 0.24);
}

.confirm-card h2 {
  margin: 4px 0 8px;
  font-size: 20px;
}

.confirm-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.danger-action {
  background: #c2410c;
}

.danger-action:hover {
  background: #9a3412;
}

@media (max-width: 1080px) {
  .login-screen {
    place-items: center;
    align-content: center;
    overflow-y: auto;
    padding: 24px;
  }

  .login-visual {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    width: min(420px, calc(100vw - 48px));
    margin-bottom: 24px;
  }

  .login-card {
    margin-top: 0;
    padding: 32px 28px;
  }

  .shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    height: auto;
    padding: 16px;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    height: auto;
    overflow: visible;
    padding-bottom: 0;
  }

  .brand {
    flex-basis: auto;
    height: auto;
  }

  .nav-section {
    min-width: 0;
  }

  .nav-section.standalone {
    min-width: 0;
  }

  .nav-group {
    margin-top: 0;
  }

  .side-panel {
    display: none;
  }

  .metrics,
  .cards-grid,
  .module-map,
  .two-col,
  .resource-layout,
  .system-stats,
  .permission-cards {
    grid-template-columns: 1fr 1fr;
  }

  .crm-list-layout {
    grid-template-columns: 1fr;
  }

  .crm-groups {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .crm-groups strong {
    grid-column: 1 / -1;
  }

  .crm-dashboard {
    grid-template-columns: 1fr;
  }

  #dashboard .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #dashboard .two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .main {
    padding: 18px;
  }

  .topbar {
    align-items: center;
    gap: 8px;
  }

  .topbar > div:first-child {
    flex: 0 0 76px;
    min-width: 76px;
  }

  h1 {
    overflow: hidden;
    font-size: 18px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .eyebrow {
    display: none;
  }

  .top-actions {
    flex: 1 1 auto;
    gap: 4px;
    overflow-x: visible;
  }

  .search {
    flex: 0 0 92px;
    min-width: 92px;
    height: 38px;
    gap: 4px;
    padding: 0 6px;
  }

  .role-switcher {
    flex: 0 0 64px;
    min-width: 64px;
    height: 38px;
    padding: 0 6px;
  }

  .role-switcher span {
    display: none;
  }

  .role-switcher select {
    width: 100%;
    font-size: 12px;
  }

  .user-chip {
    flex: 0 0 90px;
    min-width: 90px;
    padding: 4px 8px;
  }

  .search span {
    font-size: 12px;
  }

  .search input {
    font-size: 12px;
  }

  .primary-action,
  .ghost-button {
    flex: 0 0 auto;
    min-width: 54px;
    height: 38px;
    padding: 0 3px;
    font-size: 12px;
    justify-content: center;
    white-space: nowrap;
  }

  .metrics,
  .cards-grid,
  .module-map,
  .resource-layout,
  .system-stats,
  .permission-cards {
    grid-template-columns: 1fr;
  }

  .crm-list-main {
    padding: 12px;
  }

  .crm-titlebar {
    align-items: stretch;
    flex-direction: column;
  }

  .crm-actions {
    justify-content: flex-start;
  }

  .crm-search {
    flex: 1 1 220px;
    min-width: min(100%, 220px);
  }

  .crm-filter-row {
    grid-template-columns: 1fr;
  }

  .crm-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .crm-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dedupe-box {
    grid-template-columns: 1fr;
  }

  #dashboard .metrics,
  #dashboard .two-col {
    grid-template-columns: 1fr;
  }

  #dashboard .two-col > .panel {
    padding: 14px;
  }

  .nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .kanban {
    grid-template-columns: repeat(5, 86vw);
  }

.form-grid {
  grid-template-columns: 1fr;
  }
}

.wide-table {
  overflow-x: visible;
}

.receivable-ledger {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}

.receivable-ledger th:first-child,
.receivable-ledger td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 16%;
  background: var(--surface);
  box-shadow: 1px 0 0 var(--line);
}

.receivable-ledger th:not(:first-child),
.receivable-ledger td:not(:first-child) {
  width: 7%;
  padding-right: 6px;
  padding-left: 6px;
  text-align: center;
}

.receivable-ledger td {
  vertical-align: top;
  min-width: 0;
}

.receivable-ledger td strong,
.receivable-ledger td span {
  display: block;
  line-height: 1.45;
  white-space: nowrap;
}

.receivable-ledger td span {
  color: var(--muted);
  font-size: 12px;
}

.receivable-ledger .ledger-due {
  background: #fff8ec;
}

.change-table {
  table-layout: fixed;
}

.change-table th,
.change-table td {
  overflow: hidden;
  vertical-align: middle;
}

.change-table th:nth-child(1),
.change-table td:nth-child(1) {
  width: 14%;
}

.change-table th:nth-child(2),
.change-table td:nth-child(2) {
  width: 10%;
}

.change-table th:nth-child(3),
.change-table td:nth-child(3),
.change-table th:nth-child(4),
.change-table td:nth-child(4),
.change-table th:nth-child(5),
.change-table td:nth-child(5) {
  width: 18%;
}

.change-table th:nth-child(6),
.change-table td:nth-child(6) {
  width: 13%;
}

.change-table th:nth-child(7),
.change-table td:nth-child(7) {
  width: 9%;
  text-align: center;
}

.payroll-detail-table {
  min-width: 1320px;
}

.employee-kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.employee-kpi-strip article {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.employee-kpi-strip span,
.employee-kpi-strip small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-kpi-strip strong {
  display: block;
  margin: 5px 0 3px;
  overflow: hidden;
  color: var(--ink);
  font-size: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-filter-bar {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(170px, 0.8fr) minmax(260px, 1.5fr);
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.employee-filter-bar label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.employee-filter-bar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.employee-filter-bar select {
  min-width: 0;
}

.employee-filter-bar.advanced {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.employee-filter-bar.compact {
  padding: 10px 12px;
  border-color: #dfe8e5;
  background: #fbfcfb;
}

.employee-search-row {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.employee-keyword-field {
  display: block;
}

.employee-search-control {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-height: 34px;
  overflow: hidden;
  border: 1px solid #cbd8d3;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

.employee-search-control:focus-within {
  border-color: rgba(15, 123, 104, 0.58);
  box-shadow: 0 0 0 2px rgba(15, 123, 104, 0.1);
}

.employee-search-prefix {
  display: inline-grid;
  align-items: center;
  align-self: stretch;
  padding: 0 10px;
  border-right: 1px solid #e2ebe7;
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.employee-search-control input {
  width: 100%;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 13px;
}

.employee-search-control input:focus {
  outline: 0;
  box-shadow: none;
}

.employee-filter-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  min-width: 0;
}

.employee-result-summary {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.employee-filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.employee-filter-grid input,
.employee-filter-grid select {
  min-width: 0;
}

.employee-table-wrap {
  overflow-x: auto;
}

.employee-ledger-table {
  width: 100%;
  min-width: 1220px;
  table-layout: fixed;
}

.employee-ledger-table th,
.employee-ledger-table td {
  padding: 10px 8px;
  vertical-align: middle;
}

.employee-ledger-table th:nth-child(1),
.employee-ledger-table td:nth-child(1) {
  width: 12%;
}

.employee-ledger-table th:nth-child(2),
.employee-ledger-table td:nth-child(2) {
  width: 12%;
}

.employee-ledger-table th:nth-child(3),
.employee-ledger-table td:nth-child(3),
.employee-ledger-table th:nth-child(6),
.employee-ledger-table td:nth-child(6),
.employee-ledger-table th:nth-child(8),
.employee-ledger-table td:nth-child(8),
.employee-ledger-table th:nth-child(10),
.employee-ledger-table td:nth-child(10) {
  width: 9%;
}

.employee-ledger-table th:nth-child(4),
.employee-ledger-table td:nth-child(4),
.employee-ledger-table th:nth-child(5),
.employee-ledger-table td:nth-child(5),
.employee-ledger-table th:nth-child(7),
.employee-ledger-table td:nth-child(7),
.employee-ledger-table th:nth-child(9),
.employee-ledger-table td:nth-child(9) {
  width: 10%;
}

.employee-ledger-table td strong,
.employee-ledger-table td span,
.employee-ledger-table td .status {
  display: block;
  min-width: 0;
  overflow: hidden;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-ledger-table td .status {
  display: inline-flex;
  max-width: 100%;
}

.employee-person-cell strong {
  font-size: 14px;
}

.employee-editor {
  gap: 14px;
}

.employee-editor-hero {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(460px, 1.25fr);
  gap: 16px;
  align-items: end;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.employee-editor-hero h2,
.employee-editor-hero p {
  margin-bottom: 0;
}

.employee-editor-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.employee-editor-summary span {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.employee-editor-summary span:nth-child(1),
.employee-kpi-strip article:nth-child(1) {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.employee-editor-summary span:nth-child(2),
.employee-kpi-strip article:nth-child(2) {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.employee-editor-summary span:nth-child(3),
.employee-kpi-strip article:nth-child(3) {
  border-color: #fed7aa;
  background: #fff7ed;
}

.employee-editor-summary span:nth-child(4),
.employee-kpi-strip article:nth-child(4) {
  border-color: #ddd6fe;
  background: #f5f3ff;
}

.employee-kpi-strip article:nth-child(5) {
  border-color: #fecaca;
  background: #fef2f2;
}

.employee-editor-summary small,
.employee-editor-summary strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-editor-summary small {
  color: var(--muted);
  font-size: 12px;
}

.employee-editor-summary strong {
  margin-top: 4px;
  color: var(--ink);
  font-size: 14px;
}

.employee-editor-form {
  grid-template-columns: 1fr;
}

.employee-editor-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.employee-editor-section h3 {
  margin: 0;
  font-size: 15px;
}

.employee-editor-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.employee-editor-grid label {
  min-width: 0;
}

.employee-editor-grid .span-2 {
  grid-column: span 2;
}

.employee-editor-grid .full {
  grid-column: 1 / -1;
}

.employee-editor-grid .file-field small {
  min-height: 18px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-stack {
  display: grid;
  gap: 8px;
  align-content: start;
}

.field-stack > span {
  color: var(--muted);
  font-size: 13px;
}

.choice-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  max-height: 112px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.choice-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid #dbe3ea;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}

.choice-chip input {
  width: 13px;
  height: 13px;
  margin: 0;
}

.choice-chip:has(input:checked) {
  border-color: #0f8f74;
  background: #ecfdf5;
  color: #047857;
}

.form-grid .file-field-inline {
  grid-template-columns: 92px minmax(180px, 260px) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.form-grid .file-field-inline > span {
  min-width: 0;
  color: var(--ink);
  white-space: nowrap;
}

.form-grid .file-field-inline input[type="file"] {
  min-width: 0;
  min-height: 36px;
  padding: 6px 9px;
}

.file-upload-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.file-upload-inline input[type="file"] {
  width: 100%;
}

.upload-confirm-button {
  min-height: 36px;
  white-space: nowrap;
}

.form-grid .file-field-inline small {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-asset-table {
  display: grid;
  gap: 6px;
}

.employee-asset-row {
  display: grid;
  grid-template-columns: 1.15fr 0.9fr 0.85fr 1fr 1fr 1.1fr;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.employee-asset-row.is-head {
  border-color: #d1fae5;
  background: #ecfdf5;
  color: #047857;
  font-weight: 700;
}

.employee-asset-row span,
.employee-asset-row strong,
.employee-asset-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-asset-row strong {
  display: block;
  color: var(--ink);
  font-size: 13.5px;
}

.employee-asset-row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.asset-kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.asset-kpi-strip article {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.asset-kpi-strip span,
.asset-kpi-strip small,
.asset-ledger-table td span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-kpi-strip strong {
  display: block;
  margin: 5px 0 3px;
  overflow: hidden;
  color: var(--ink);
  font-size: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-ledger-panel {
  gap: 0;
}

.asset-panel-head {
  align-items: center;
  gap: 12px;
}

.asset-panel-head h2,
.asset-panel-head p {
  margin: 0;
}

.asset-filter-bar {
  display: grid;
  grid-template-columns: minmax(210px, 0.85fr) minmax(320px, 1.4fr) repeat(3, minmax(130px, 0.6fr));
  gap: 12px;
  align-items: center;
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.asset-status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.asset-status-tabs button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-weight: 800;
  cursor: pointer;
}

.asset-status-tabs button span {
  color: var(--muted);
  font-size: 12px;
}

.asset-status-tabs button.active {
  border-color: rgba(37, 99, 235, 0.5);
  background: #eff6ff;
  color: var(--blue);
}

.asset-filter-bar label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.asset-filter-bar input,
.asset-filter-bar select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 7px 10px;
  outline: 0;
}

.asset-keyword-field {
  align-self: stretch;
}

.asset-filter-bar label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.asset-table-wrap {
  overflow-x: hidden;
}

.asset-ledger-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.asset-ledger-table th,
.asset-ledger-table td {
  padding: 10px 8px;
  vertical-align: middle;
}

.asset-ledger-table th:nth-child(1),
.asset-ledger-table td:nth-child(1) {
  width: 13%;
}

.asset-ledger-table th:nth-child(2),
.asset-ledger-table td:nth-child(2) {
  width: 15%;
}

.asset-ledger-table th:nth-child(3),
.asset-ledger-table td:nth-child(3) {
  width: 18%;
}

.asset-ledger-table th:nth-child(4),
.asset-ledger-table td:nth-child(4) {
  width: 13%;
}

.asset-ledger-table th:nth-child(5),
.asset-ledger-table td:nth-child(5) {
  width: 8%;
  text-align: center;
}

.asset-ledger-table th:nth-child(6),
.asset-ledger-table td:nth-child(6) {
  width: 15%;
}

.asset-ledger-table th:nth-child(7),
.asset-ledger-table td:nth-child(7) {
  width: 12%;
}

.asset-ledger-table th:nth-child(8),
.asset-ledger-table td:nth-child(8) {
  width: 6%;
  text-align: center;
}

.asset-ledger-table td strong,
.asset-ledger-table td .status,
.asset-ledger-table td em {
  display: block;
  min-width: 0;
  overflow: hidden;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-ledger-table td em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 650;
}

.asset-ledger-table td .status {
  display: inline-flex;
  justify-content: center;
  max-width: 100%;
}

.asset-action-menu {
  position: relative;
  display: inline-flex;
  justify-content: center;
}

.asset-action-trigger {
  min-width: 54px;
  padding-inline: 10px;
}

.asset-action-popover {
  position: absolute;
  z-index: 24;
  top: calc(100% + 4px);
  right: 0;
  display: none;
  min-width: 112px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.asset-action-menu:hover .asset-action-popover,
.asset-action-menu:focus-within .asset-action-popover {
  display: grid;
  gap: 3px;
}

.asset-action-popover button {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  padding: 7px 8px;
  text-align: left;
  white-space: nowrap;
}

.asset-action-popover button:hover {
  background: #f3f6f5;
}

.asset-action-popover button.danger {
  color: #b91c1c;
}

.asset-date-ok {
  color: var(--green) !important;
}

.asset-date-warn {
  color: #b45309 !important;
}

.asset-date-danger {
  color: #b91c1c !important;
}

.asset-date-muted {
  color: var(--muted) !important;
}

.asset-detail,
.asset-editor {
  gap: 14px;
}

.asset-detail-hero,
.asset-editor-hero {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(420px, 1.25fr);
  gap: 16px;
  align-items: end;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.asset-editor-hero {
  grid-template-columns: 1fr;
  align-items: start;
}

.asset-detail-hero h2,
.asset-detail-hero p,
.asset-editor-hero h2,
.asset-editor-hero p {
  margin-bottom: 0;
}

.asset-detail-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.asset-detail-summary span,
.asset-info-grid span {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.asset-detail-summary small,
.asset-detail-summary strong,
.asset-info-grid small,
.asset-info-grid strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-detail-summary small,
.asset-info-grid small {
  color: var(--muted);
  font-size: 12px;
}

.asset-detail-summary strong,
.asset-info-grid strong {
  margin-top: 4px;
  color: var(--ink);
  font-size: 14px;
}

.asset-detail-section,
.asset-editor-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.asset-detail-section h3,
.asset-editor-section h3,
.asset-section-head h3 {
  margin: 0;
  font-size: 15px;
}

.asset-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.asset-info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.asset-info-grid .wide {
  grid-column: 1 / -1;
}

.asset-flow-table {
  display: grid;
  gap: 8px;
}

.asset-flow-table article {
  display: grid;
  grid-template-columns: 130px minmax(190px, 1.1fr) minmax(220px, 1.2fr) 116px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.asset-flow-table strong,
.asset-flow-table span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-flow-table span {
  color: var(--muted);
  font-size: 12px;
}

.asset-editor-form {
  display: grid;
  gap: 12px;
}

.asset-editor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.asset-editor-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.asset-editor-grid label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.asset-editor-grid input,
.asset-editor-grid select,
.asset-editor-grid textarea {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 11px;
  font: inherit;
  outline: 0;
}

.asset-editor-grid .span-2 {
  grid-column: span 2;
}

.asset-editor-grid .span-3 {
  grid-column: 1 / -1;
}

.asset-editor-grid textarea {
  min-height: 110px;
  resize: vertical;
}

.payroll-metric-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.payroll-metric-strip article {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.payroll-metric-strip span,
.payroll-card-facts small,
.payroll-card-money small,
.payroll-detail-groups small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.payroll-metric-strip strong {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: var(--ink);
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payroll-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.payroll-month-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.payroll-month-card:hover {
  border-color: rgba(15, 123, 104, 0.42);
  background: #fbfefd;
}

.payroll-card-head,
.payroll-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.payroll-card-head > div {
  min-width: 0;
}

.payroll-card-head strong {
  display: block;
  font-size: 18px;
}

.payroll-card-head span,
.payroll-card-foot {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payroll-card-facts,
.payroll-card-money {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.payroll-card-money {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.payroll-card-facts span,
.payroll-card-money span {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #edf2ef;
  border-radius: 8px;
  background: #f8faf9;
}

.payroll-card-money .profit {
  background: #eef8f5;
  border-color: #cae9df;
}

.payroll-card-facts b,
.payroll-card-money b {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payroll-row-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.payroll-row {
  display: grid;
  grid-template-columns:
    minmax(0, 0.9fr)
    minmax(0, 0.9fr)
    minmax(0, 0.6fr)
    minmax(0, 0.8fr)
    minmax(0, 1.08fr)
    minmax(0, 1.08fr)
    minmax(0, 1.28fr)
    minmax(0, 1.1fr)
    minmax(0, 0.58fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.payroll-row:hover {
  border-color: rgba(15, 123, 104, 0.38);
  background: #fbfefd;
}

.payroll-row-head {
  min-height: 40px;
  border-color: #e8efec;
  background: #f5f8f7;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.payroll-row-head:hover {
  border-color: #e8efec;
  background: #f5f8f7;
}

.payroll-row > div,
.payroll-row > span {
  min-width: 0;
}

.payroll-row b,
.payroll-row strong,
.payroll-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payroll-row b,
.payroll-row strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.payroll-row-main strong {
  font-size: 14px;
}

.payroll-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.35;
}

.payroll-profit-cell b {
  color: var(--green);
}

.payroll-row-action {
  display: flex;
  align-items: center;
  justify-content: center;
}

.payroll-row-action .mini-button {
  min-width: 52px;
  min-height: 30px;
  padding: 0 8px;
}

.payroll-empty {
  margin-top: 12px;
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.payroll-detail-layout {
  min-height: calc(100vh - 36px);
}

.payroll-detail-head {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) auto minmax(700px, 1.45fr);
  gap: 16px;
  align-items: end;
}

.payroll-detail-head h2,
.payroll-detail-head p {
  margin-bottom: 0;
}

.payroll-detail-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.payroll-detail-summary span {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  min-width: 0;
}

.payroll-detail-summary small {
  color: var(--muted);
}

.payroll-detail-summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payroll-detail-wrap {
  max-height: none;
  height: auto;
  overflow: visible;
  overflow-x: auto;
  padding-right: 0;
}

.payroll-detail-list {
  display: grid;
  gap: 8px;
  min-width: 1540px;
}

.payroll-detail-row {
  display: grid;
  grid-template-columns:
    130px
    220px
    150px
    170px
    170px
    190px
    190px
    180px
    150px;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.payroll-detail-row-head {
  min-height: 40px;
  border-color: #e8efec;
  background: #f5f8f7;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.payroll-detail-row-head:hover {
  border-color: #e8efec;
  background: #f5f8f7;
}

.payroll-detail-row > div {
  min-width: 0;
}

.payroll-detail-row b,
.payroll-detail-row strong,
.payroll-detail-row small,
.payroll-detail-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payroll-detail-row .payroll-money,
.payroll-detail-row > div:nth-child(4) b,
.payroll-detail-row > div:nth-child(7) b {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.payroll-detail-row > div:nth-child(4),
.payroll-detail-row > div:nth-child(7) {
  padding: 6px 8px;
  border-radius: 6px;
  background: #f8fafc;
}

.payroll-detail-pagination {
  min-width: 1540px;
  margin-top: 8px;
}

.payroll-detail-row b,
.payroll-detail-row strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.payroll-detail-person strong {
  font-size: 14px;
}

.payroll-detail-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.35;
}

.payroll-detail-status b {
  color: var(--green);
}

.payroll-detail-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.payroll-detail-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf2ef;
}

.payroll-detail-card-head div {
  min-width: 0;
}

.payroll-detail-card-head strong {
  display: block;
  font-size: 16px;
}

.payroll-detail-card-head span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payroll-detail-card-head em {
  flex: 0 0 auto;
  max-width: 170px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--green-2);
  color: var(--green);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payroll-detail-groups {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.payroll-detail-groups section {
  min-width: 0;
  padding: 10px;
  border: 1px solid #edf2ef;
  border-radius: 8px;
  background: #f8faf9;
}

.payroll-detail-groups h3 {
  margin: 0 0 8px;
  font-size: 13px;
}

.payroll-detail-groups section > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.payroll-detail-groups span {
  min-width: 0;
}

.payroll-detail-groups b {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payroll-detail-groups .highlight b {
  color: var(--green);
}

.employee-ledger-table th,
.employee-ledger-table td,
.payroll-detail-table th,
.payroll-detail-table td {
  vertical-align: middle;
}

.payroll-detail-table {
  min-width: 1420px;
}

.payroll-detail-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  box-shadow: inset 0 -1px 0 var(--line);
}

.payroll-detail-table th:first-child,
.payroll-detail-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fff;
}

.payroll-detail-table th:first-child {
  z-index: 4;
  background: #f8fafc;
}

.payroll-detail-table td {
  white-space: nowrap;
}

.settlement-trend {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  min-height: 170px;
}

.settlement-trend article {
  display: grid;
  gap: 6px;
  justify-items: center;
  min-width: 0;
}

.trend-bars {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 4px;
  width: 100%;
  height: 96px;
  border-bottom: 1px solid var(--line);
}

.trend-bars span {
  display: block;
  width: 14px;
  border-radius: 5px 5px 0 0;
}

.trend-bars .planned {
  background: var(--green);
}

.trend-bars .received {
  background: var(--blue);
}

.settlement-trend strong,
.settlement-trend small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settlement-trend small {
  color: var(--muted);
  font-size: 11px;
}

.share-candidate-list {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.share-flow-hint {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.share-flow-hint span {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--green-2);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  white-space: nowrap;
}

.share-candidate-option {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.share-candidate-option span {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.share-candidate-option small,
.share-candidate-option em {
  color: var(--muted);
  font-style: normal;
  line-height: 1.35;
}

.share-result-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.share-result-box input {
  min-width: 0;
}

.public-share-body {
  margin: 0;
  background: #f4f7fb;
}

/* Readability pass for dense business tables. Keep layout fixed, but avoid 11-12px operational text. */
.data-table th,
.data-table td,
.wide-table th,
.wide-table td,
.system-table th,
.system-table td,
.permission-table th,
.permission-table td,
.project-table th,
.project-table td,
.job-stats-table th,
.job-stats-table td,
.project-progress-table th,
.project-progress-table td,
.recruiting-overview-table th,
.recruiting-overview-table td,
.change-table th,
.change-table td,
.employee-ledger-table th,
.employee-ledger-table td,
.asset-ledger-table th,
.asset-ledger-table td,
.placement-ledger-table th,
.placement-ledger-table td,
.placement-mini-table th,
.placement-mini-table td,
.payroll-detail-table th,
.payroll-detail-table td,
.public-candidate-table th,
.public-candidate-table td {
  font-size: 13px;
}

.employee-person-cell strong,
.employee-ledger-table td strong,
.asset-ledger-table td strong,
.placement-ledger-table td strong,
.placement-mini-table td strong,
.payroll-row-main strong,
.payroll-detail-person strong {
  font-size: 15px;
}

.employee-ledger-table td span,
.asset-ledger-table td span,
.placement-ledger-table td span,
.placement-mini-table .muted,
.payroll-row small,
.payroll-detail-row small,
.payroll-card-head span,
.payroll-card-foot,
.payroll-detail-card-head span,
.payroll-detail-card-head em,
.employee-kpi-strip small,
.asset-kpi-strip small,
.placement-summary-grid span,
.placement-company-meta,
.placement-project-meta,
.placement-module-label,
.permission-table th span,
.permission-check,
.share-candidate-option small,
.share-candidate-option em {
  font-size: 12.5px;
}

.placement-company-head h3,
.placement-project-head h3,
.placement-customer-head h3 {
  font-size: 19px;
}

.placement-project-subhead,
.placement-total,
.payroll-row-head,
.payroll-detail-row-head {
  font-size: 13px;
}

.payroll-row b,
.payroll-row strong,
.payroll-detail-row b,
.payroll-detail-row strong,
.payroll-detail-groups b {
  font-size: 14px;
}

@media (max-width: 900px) {
  .recruiting-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .recruiting-summary-strip,
  .share-flow-hint {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .asset-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .asset-filter-bar,
  .asset-detail-hero,
  .asset-detail-summary {
    grid-template-columns: 1fr;
  }

  .asset-table-wrap {
    overflow-x: auto;
  }

  .asset-ledger-table {
    min-width: 960px;
  }

  .asset-info-grid,
  .asset-editor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .asset-flow-table article {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .employee-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .employee-filter-bar {
    grid-template-columns: 1fr;
  }

  .employee-search-row {
    grid-template-columns: 1fr;
  }

  .employee-filter-actions {
    justify-content: space-between;
    min-width: 0;
  }

  .employee-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .employee-table-wrap {
    overflow-x: auto;
  }

  .employee-ledger-table {
    min-width: 960px;
  }

  .employee-editor-hero,
  .employee-editor-summary {
    grid-template-columns: 1fr;
  }

  .employee-editor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .payroll-metric-strip,
  .payroll-detail-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .payroll-row {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .payroll-row-action {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .payroll-detail-head {
    grid-template-columns: 1fr;
  }

  .payroll-detail-row {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .payroll-card-grid {
    grid-template-columns: 1fr;
  }

  .payroll-card-facts,
  .payroll-card-money {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .placement-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .daily-demand-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.public-share-page {
  min-height: 100vh;
  padding: 20px;
  color: var(--ink);
}

.public-share-shell {
  max-width: 1320px;
  margin: 0 auto;
}

.public-share-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--green);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.public-share-hero h1 {
  margin: 6px 0;
  font-size: 24px;
  letter-spacing: 0;
}

.public-share-hero p {
  margin: 0;
  color: var(--muted);
}

.public-share-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 520px;
  color: var(--muted);
  text-align: right;
}

.public-share-meta span {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  white-space: nowrap;
}

.public-share-note {
  margin: 16px 0;
  padding: 12px 14px;
  border: 1px solid #bfd8ff;
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: #fff;
  color: #475569;
}

.public-share-note span {
  display: block;
  margin-top: 6px;
}

.public-share-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.public-share-toolbar .muted {
  margin-left: auto;
  white-space: nowrap;
}

.public-candidate-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
}

.public-candidate-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
}

.public-candidate-table th,
.public-candidate-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eef2f6;
  color: #243142;
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
  vertical-align: middle;
}

.public-candidate-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #526174;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.public-candidate-table tr:last-child td {
  border-bottom: 0;
}

.public-candidate-table td:first-child,
.public-candidate-table th:first-child {
  width: 42px;
  text-align: center;
}

.public-candidate-table strong,
.public-candidate-table .muted {
  display: block;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.public-candidate-table .muted {
  margin-top: 3px;
  font-size: 12px;
}

.public-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 260px;
}

.public-tag-list span {
  max-width: 96px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--green-2);
  color: var(--green);
  font-size: 12px;
  font-weight: 760;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.public-resume-cell {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.public-resume-link {
  color: var(--blue);
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.public-resume-link:hover {
  text-decoration: underline;
}

.public-resume-button {
  width: max-content;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.public-resume-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(17, 33, 27, 0.42);
}

.public-resume-panel {
  position: relative;
  width: min(920px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(20, 45, 35, 0.24);
}

.public-resume-panel header {
  padding: 24px 28px;
  background: var(--green);
  color: #fff;
}

.public-resume-panel header h2 {
  margin: 4px 0 8px;
  color: #fff;
  font-size: 26px;
}

.public-resume-panel header p {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
}

.public-resume-close {
  top: 14px;
  right: 14px;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}

.public-resume-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfb;
}

.public-resume-grid span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.public-resume-grid small {
  color: var(--muted);
  font-size: 12px;
}

.public-resume-grid strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.public-resume-panel section {
  display: grid;
  gap: 10px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
}

.public-resume-panel section h3 {
  margin: 0;
  color: var(--green);
  font-size: 16px;
}

.public-resume-panel ul {
  margin: 0;
  padding-left: 18px;
  line-height: 1.65;
}

.public-feedback-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.public-feedback-panel h2 {
  margin: 0;
  font-size: 17px;
}

.public-feedback-panel p {
  margin: 0;
  color: var(--muted);
}

.public-feedback-grid {
  display: grid;
  grid-template-columns: 160px 180px minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.public-feedback-grid input,
.public-feedback-grid textarea {
  width: 100%;
  min-width: 0;
}

.public-feedback-grid textarea {
  resize: vertical;
}

.public-share-error {
  max-width: 640px;
  margin: 12vh auto;
  padding: 32px;
  border-radius: 8px;
  background: #fff;
  text-align: center;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

@media (max-width: 480px) {
  .crm-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .crm-search {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .crm-groups,
  .crm-kpis {
    grid-template-columns: 1fr;
  }

  .employee-kpi-strip,
  .asset-kpi-strip,
  .asset-info-grid,
  .asset-editor-grid,
  .asset-editor-grid .span-2,
  .employee-filter-grid,
  .employee-editor-grid,
  .employee-editor-grid .span-2,
  .employee-editor-grid .full {
    grid-template-columns: 1fr;
    grid-column: auto;
  }

  .employee-asset-row,
  .file-upload-inline {
    grid-template-columns: 1fr;
  }

  .form-grid .file-field-inline {
    grid-template-columns: 1fr;
  }

  .employee-filter-actions {
    display: grid;
    justify-content: stretch;
  }

  .asset-flow-table article {
    grid-template-columns: 1fr;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #dashboard .two-col {
    grid-template-columns: 1fr;
  }

  .public-share-page {
    padding: 14px;
  }

  .public-share-hero {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .public-share-meta {
    justify-content: flex-start;
    text-align: left;
  }

  .public-share-toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .public-share-toolbar .muted {
    margin-left: 0;
  }

  .public-feedback-grid,
  .share-result-box {
    grid-template-columns: 1fr;
  }

  .drawer.payroll-detail-mode .drawer-card {
    width: 100vw;
    padding: 16px;
  }

  .payroll-detail-layout {
    min-height: calc(100vh - 32px);
  }

  .payroll-detail-head,
  .payroll-detail-summary {
    grid-template-columns: 1fr;
  }

  .payroll-row,
  .payroll-detail-row {
    grid-template-columns: 1fr;
  }

  .payroll-row-action {
    justify-content: stretch;
  }

  .payroll-row-action .mini-button {
    width: 100%;
  }

  .payroll-metric-strip,
  .payroll-card-facts,
  .payroll-card-money,
  .payroll-detail-groups,
  .payroll-detail-groups section > div {
    grid-template-columns: 1fr;
  }

  .payroll-card-head,
  .payroll-detail-card-head {
    display: grid;
    justify-items: start;
  }

  .payroll-card-head .mini-button {
    width: 100%;
  }

  .payroll-detail-card-head em {
    max-width: 100%;
  }

  .placement-company-head,
  .placement-project-head,
  .placement-customer-head,
  .placement-total,
  .placement-head-tools {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: stretch;
    justify-content: stretch;
    text-align: left;
  }

  .placement-company-meta,
  .placement-project-meta {
    justify-content: flex-start;
  }

  .placement-project-subhead {
    grid-template-columns: 1fr;
    white-space: normal;
  }

  .placement-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
