:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #172033;
  --muted: #667085;
  --line: #e7eaf0;
  --blue: #3370ff;
  --teal: #13c2c2;
  --green: #1f8a5f;
  --amber: #f59e0b;
  --red: #ef4444;
  --nav: #102a43;
  --nav-deep: #113a32;
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, Arial, "Microsoft YaHei", "PingFang SC", sans-serif;
}

button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
a { color: var(--blue); }

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(120deg, rgba(18, 60, 53, 0.08), rgba(51, 112, 255, 0.05) 42%, rgba(217, 173, 27, 0.08)),
    #f4f7fb;
}
.login-screen.hidden { display: none; }

.login-shell {
  display: grid;
  grid-template-columns: minmax(360px, 1.08fr) minmax(380px, 480px);
  width: min(1180px, 100%);
  min-height: min(760px, calc(100vh - 56px));
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.96);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 28px 80px rgba(16, 42, 67, 0.16);
  backdrop-filter: blur(18px);
}

.login-brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100%;
  padding: 44px;
  color: #fff;
  background: linear-gradient(145deg, var(--nav-deep) 0%, var(--nav) 100%);
}

.login-brand-panel::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0) 46%);
  opacity: 0.72;
}

.login-brand-panel > * {
  position: relative;
  z-index: 1;
}

.login-brand-topline {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,0.84);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

.login-brand-topline::before {
  width: 28px;
  height: 2px;
  content: "";
  border-radius: 999px;
  background: #d9ad1b;
}

.login-brand-visual {
  display: grid;
  flex: 1;
  min-height: 460px;
  place-items: center;
  padding: 34px 0;
}

.login-hero-logo {
  display: block;
  width: min(460px, 80%);
  height: auto;
  filter: drop-shadow(0 20px 28px rgba(0, 0, 0, 0.18));
}

.login-brand-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 18px;
  color: rgba(255,255,255,0.64);
  font-size: 12px;
}

.login-brand-footer strong {
  color: rgba(255,255,255,0.86);
  font-size: 13px;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 42px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.96));
}

.login-card {
  display: grid;
  width: 100%;
  max-width: 390px;
  gap: 14px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.login-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.login-form-head > div:first-child {
  display: grid;
  gap: 4px;
}

.login-form-head strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.25;
}

.login-form-head span {
  color: var(--muted);
  font-size: 12px;
}

.login-language-row {
  min-height: 36px;
  border-radius: 999px;
  padding: 4px 10px;
  background: #fff;
}

.login-title-block {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.login-title-block h1 {
  margin: 0;
  color: var(--ink);
  font-size: 28px;
  line-height: 1.18;
}

.login-title-block p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.login-card label {
  display: grid;
  gap: 8px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.login-card input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 14px;
  outline: 0;
  color: var(--ink);
  background: #fff;
  font-size: 14px;
  font-weight: 650;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.login-card input:focus {
  border-color: rgba(51,112,255,0.8);
  box-shadow: 0 0 0 4px rgba(51,112,255,0.12);
}

.login-card .primary-action {
  height: 50px;
  margin-top: 4px;
  border: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--blue), #1f5eff);
  box-shadow: 0 16px 30px rgba(51, 112, 255, 0.24);
  font-size: 15px;
  font-weight: 800;
}

.login-card .login-hint {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width, 286px) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 24px 18px;
  color: #fff;
  background: linear-gradient(180deg, var(--nav-deep) 0%, var(--nav) 100%);
}

.brand, .topbar-actions, .item-top, .module-toolbar, .language-row, .language-switch {
  display: flex;
  align-items: center;
}

.brand { gap: 12px; min-width: 0; }
.logo-brand { align-items: flex-start; }
.brand-copy { min-width: 0; }
.brand-logo {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.brand-logo-login {
  width: min(292px, 82%);
  max-width: 292px;
  margin: 0 auto;
  filter: drop-shadow(0 10px 14px rgba(196, 142, 0, 0.13));
}
.brand-logo-sidebar {
  max-width: 222px;
  max-height: 78px;
  filter: drop-shadow(0 9px 14px rgba(0, 0, 0, 0.2));
}
.login-brand.logo-brand {
  align-items: center;
  flex-direction: column;
  gap: 9px;
  margin: -2px 0 2px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(231, 234, 240, 0.9);
  text-align: center;
}
.sidebar-brand.logo-brand {
  align-items: flex-start;
  flex-direction: column;
  gap: 12px;
  padding: 0 2px;
}
.sidebar-brand .brand-copy {
  max-width: 230px;
  padding-left: 10px;
  border-left: 2px solid rgba(236, 190, 23, 0.46);
}
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.14);
  font-weight: 800;
}
.login-brand { color: var(--ink); }
.login-brand .brand-copy {
  display: grid;
  justify-items: center;
  gap: 3px;
  width: 100%;
}
.login-brand .brand-copy p { margin: 0; color: var(--muted); }
.login-brand .brand-copy h1 { max-width: 320px; font-size: 17px; line-height: 1.25; }
.sidebar-brand h1 { max-width: 220px; font-size: 15px; }
.login-brand .brand-mark { color: #fff; background: var(--green); }
.brand h1 {
  max-width: 198px;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.22;
}
.brand p, .sidebar-card p, .sidebar-card span, .login-hint {
  margin: 4px 0 0;
  color: rgba(255,255,255,0.68);
  font-size: 12px;
}
.login-hint { color: var(--muted); }

.nav { display: grid; align-content: start; gap: 8px; }
.nav-group { display: grid; gap: 4px; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: var(--radius);
  padding: 0 12px;
  color: rgba(255,255,255,0.74);
  background: transparent;
  text-align: left;
}
.nav-item span {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.1);
}
.nav-item b { flex: 1; overflow-wrap: anywhere; font-size: 15px; }
.nav-item i { color: rgba(255,255,255,0.62); font-style: normal; font-weight: 800; }
.nav-group.open > .nav-item, .nav-item.active, .nav-item:hover {
  color: #fff;
  background: rgba(255,255,255,0.14);
}
.subnav { display: none; gap: 4px; padding: 2px 0 6px; }
.nav-group.open .subnav { display: grid; }
.subnav-item {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-left: 2px solid rgba(255,255,255,0.12);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0 12px 0 40px;
  color: rgba(255,255,255,0.68);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}
.subnav-item:hover, .subnav-item.active {
  border-left-color: #fff;
  color: #fff;
  background: rgba(255,255,255,0.1);
}


.sidebar-resize-handle {
  position: absolute;
  top: 0;
  right: -6px;
  z-index: 4;
  width: 12px;
  height: 100%;
  border: 0;
  padding: 0;
  cursor: col-resize;
  background: transparent;
}

.sidebar-resize-handle::after {
  position: absolute;
  top: 50%;
  right: 4px;
  width: 3px;
  height: 64px;
  content: "";
  transform: translateY(-50%);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.26);
  opacity: 0.72;
}

.sidebar-resize-handle:hover::after,
body.is-sidebar-resizing .sidebar-resize-handle::after {
  background: rgba(255, 255, 255, 0.72);
  opacity: 1;
}

body.is-sidebar-resizing {
  cursor: col-resize;
  user-select: none;
}

.sidebar-card {
  margin-top: auto;
  border-radius: var(--radius);
  padding: 16px;
  background: rgba(255,255,255,0.12);
}
.sidebar-card strong { display: block; margin-top: 8px; }

.main { min-width: 0; padding: 28px; overflow: hidden; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}
.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}
.topbar h2 { margin: 0; font-size: 30px; line-height: 1.2; }
.topbar-actions { flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.account-module {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
}

.language-row, .language-switch, .account-module, .user-pill, .search, .primary-action, .secondary-action, .icon-button, .link-button {
  min-height: 42px;
  border-radius: var(--radius);
}
.language-row, .language-switch, .user-pill, .search {
  border: 1px solid var(--line);
  background: var(--surface);
}
.language-row, .language-switch {
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.language-row select, .language-switch select { width: auto; min-width: 112px; border: 0; padding: 0; outline: 0; }
.user-pill { display: inline-flex; align-items: center; min-height: 42px; padding: 0 12px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.logout-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  color: #b42318;
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.18);
}
.logout-action:hover {
  background: rgba(239, 68, 68, 0.1);
}
.search { display: flex; align-items: center; gap: 8px; width: min(360px, 34vw); padding: 0 12px; }
.search input { width: 100%; border: 0; outline: 0; }

.primary-action, .secondary-action, .icon-button, .link-button {
  padding: 0 14px;
  border: 1px solid transparent;
  font-weight: 700;
  white-space: nowrap;
}
.primary-action { color: #fff; background: var(--blue); border-color: var(--blue); }
.secondary-action, .icon-button { color: var(--ink); background: var(--surface); border-color: var(--line); }
.icon-button { width: 42px; padding: 0; font-size: 22px; }
.view { display: none; }
.view.active { display: block; }

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 18px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  background: linear-gradient(135deg, #ffffff 0%, #eef6ff 100%);
  box-shadow: var(--shadow);
}
.soft-label, .work-panel small, .approval-card small, .metric p, .metric-grid small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.hero-panel h3 { max-width: 720px; margin: 10px 0; font-size: 34px; line-height: 1.16; }
.hero-panel p { max-width: 760px; margin: 0; color: var(--muted); line-height: 1.6; }
.hero-stack { display: grid; gap: 12px; }
.hero-stack article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(255,255,255,0.76);
}
.hero-stack b { display: block; margin-top: 8px; font-size: 28px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric, .panel, .table-card, .contract-preview, .modal-body {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.metric { padding: 18px; }
.metric strong { display: block; margin-top: 10px; font-size: 32px; }
.metric span { display: block; margin-top: 8px; color: var(--muted); font-size: 13px; }
.metric.warning { border-color: rgba(245,158,11,0.32); }
.metric.danger { border-color: rgba(239,68,68,0.32); }

.dashboard-layout, .module-grid, .contract-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  gap: 16px;
  margin-top: 16px;
}
.panel { padding: 18px; }
.panel-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-head h3 { margin: 0; font-size: 20px; line-height: 1.25; }
.panel-head span { color: var(--muted); font-size: 12px; }
.status-bars, .timeline, .ad-list, .approval-list, .repair-list, .record-form { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) 42px; align-items: center; gap: 12px; }
.bar-row label, .bar-row b { font-size: 13px; }
.bar { height: 12px; overflow: hidden; border-radius: 999px; background: #e6ebf2; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--teal)); }
.timeline-item, .ad-item, .approval-item, .repair-item {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface-soft);
}
.item-top { justify-content: space-between; gap: 12px; }
.item-top strong { font-size: 14px; }
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  color: #137333;
  background: rgba(39,174,96,0.12);
  font-size: 12px;
  font-weight: 700;
}
.tag.warn { color: #92400e; background: rgba(245,158,11,0.15); }
.tag.danger { color: #b42318; background: rgba(239,68,68,0.12); }
.status-cell {
  display: inline-flex;
  width: max-content;
}

.status-select {
  width: auto;
  min-width: 88px;
  min-height: 28px;
  border: 0;
  border-radius: 999px;
  padding: 0 28px 0 10px;
  color: #137333;
  background: rgba(39,174,96,0.12);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.status-select.warn {
  color: #92400e;
  background: rgba(245,158,11,0.15);
}

.status-select.danger {
  color: #b42318;
  background: rgba(239,68,68,0.12);
}

.status-select:disabled {
  cursor: wait;
  opacity: 0.72;
}

.staff-row-disabled td {
  background: rgba(245,158,11,0.04);
}

.staff-row-deleted td {
  color: #64748b;
  background: rgba(239,68,68,0.04);
}

.module-toolbar { justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.segmented { display: flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.segmented button { min-height: 40px; border: 0; border-right: 1px solid var(--line); padding: 0 14px; background: transparent; }
.segmented button:last-child { border-right: 0; }
.segmented button.active { color: #fff; background: var(--blue); }

.property-company-bar {
  margin: 0 0 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.property-company-bar[hidden] { display: none; }
.property-company-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.property-company-head strong {
  color: #344054;
  font-size: 13px;
  font-weight: 850;
}
.property-company-head span {
  color: #667085;
  font-size: 12px;
  font-weight: 750;
}
.property-company-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.property-company-tab {
  min-height: 31px;
  border: 1px solid #d8dee9;
  border-radius: 999px;
  padding: 0 11px;
  color: #344054;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.property-company-tab:hover {
  color: #172033;
  background: #f3f6fb;
}
.property-company-tab.active {
  border-color: var(--blue);
  color: #fff;
  background: var(--blue);
  box-shadow: 0 12px 26px rgba(51, 112, 255, 0.14);
}
.property-company-tab small {
  margin-left: 5px;
  opacity: .82;
  font-size: 11px;
  font-weight: 850;
}
.property-hierarchy-bar {
  margin: 0 0 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.property-hierarchy-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}
.property-hierarchy-grid label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 12px;
  font-weight: 850;
}
.property-hierarchy-grid label span {
  color: var(--muted);
  line-height: 1.35;
  text-transform: uppercase;
}
.property-hierarchy-path {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 11px;
  color: #344054;
  background: var(--surface-soft);
  font-size: 13px;
  font-weight: 850;
}

.status-note {
  display: block;
  margin-top: 4px;
  color: #8b95a7;
  font-size: 11px;
  line-height: 1.35;
}
.table-card { overflow: auto; }
table { width: 100%; min-width: 980px; border-collapse: collapse; }
.resizable-table { table-layout: fixed; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); background: var(--surface-soft); font-size: 12px; }
td { font-size: 14px; }
.property-name-cell { min-width: 360px; max-width: 680px; }
.property-title {
  display: block;
  color: #0f172a;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.32;
}
.property-subline,
.property-address-muted {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.property-address-muted {
  max-width: 760px;
  overflow: hidden;
  color: #8b95a7;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.resizable-header {
  position: relative;
  overflow-wrap: anywhere;
  user-select: none;
}
.column-resize-handle {
  position: absolute;
  top: 0;
  right: -5px;
  z-index: 5;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}
.column-resize-handle::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 4px;
  width: 2px;
  height: calc(100% - 24px);
  border-radius: 999px;
  background: transparent;
}
.column-resize-handle:hover::after,
.is-column-resizing .column-resize-handle::after {
  background: var(--blue);
}
body.is-resizing-column {
  cursor: col-resize;
  user-select: none;
}
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; min-width: 150px; }
.link-button { min-height: 30px; padding: 0 9px; border-color: var(--line); color: var(--blue); background: var(--surface); font-size: 12px; }
.role-title-text { display: inline-block; min-width: 90px; color: var(--ink); font-weight: 800; overflow-wrap: anywhere; }
.editable-role {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 190px;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 6px 9px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}
.editable-role span { font-weight: 800; overflow-wrap: anywhere; }
.editable-role i { flex: 0 0 auto; color: var(--blue); font-size: 11px; font-style: normal; font-weight: 800; opacity: 0.76; }
.editable-role:hover { border-color: var(--line); background: var(--surface-soft); }
.role-editor { display: grid; gap: 8px; min-width: 170px; max-width: 230px; }
.role-title-input { min-width: 160px; padding: 8px 10px; font-weight: 800; }
.role-editor-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.role-editor-actions .primary-action,
.role-editor-actions .secondary-action { min-height: 32px; padding: 0 10px; font-size: 12px; }
#staff table { min-width: 1320px; }
#staff th:nth-child(5),
#staff td:nth-child(5) { min-width: 360px; }
.responsibility-summary {
  display: grid;
  gap: 10px;
  max-width: 460px;
}
.responsibility-group {
  display: grid;
  gap: 6px;
}
.responsibility-label {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  color: #14532d;
  background: rgba(39,174,96,0.12);
  font-size: 12px;
  font-weight: 900;
}
.responsibility-group ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
  color: #263449;
  line-height: 1.45;
}
.responsibility-group li { padding-left: 2px; }
.scope-basis {
  display: block;
  color: var(--muted);
  line-height: 1.45;
}
.danger-text { color: var(--red); }


.staff-toolbar > div {
  display: grid;
  gap: 4px;
}

.staff-toolbar h3 {
  margin: 0;
  font-size: 18px;
}

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

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

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}
.field-grid, .detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 11px; color: var(--ink); background: var(--surface); }
textarea { min-height: 110px; resize: vertical; }
.upload-zone { margin-top: 16px; border: 1px dashed #b8c4ba; border-radius: var(--radius); padding: 18px; background: var(--surface-soft); }
.upload-zone p { margin: 8px 0 0; color: var(--muted); }
.contract-preview { position: relative; min-height: 420px; padding: 30px; background: #fffdfa; }
.contract-preview h3 { margin: 0 0 28px; text-align: center; font-size: 24px; }
.stamp { position: absolute; right: 26px; bottom: 68px; display: grid; width: 128px; height: 128px; place-items: center; border: 3px solid rgba(239,68,68,0.55); border-radius: 50%; color: rgba(239,68,68,0.76); font-size: 13px; font-weight: 900; text-align: center; }
.signature { position: absolute; left: 30px; bottom: 50px; width: 210px; padding-top: 18px; border-top: 1px solid var(--ink); color: var(--muted); }
.photo-strip { display: grid; grid-template-columns: repeat(3, 62px); gap: 8px; }
.photo-box { display: grid; min-height: 42px; place-items: center; border-radius: var(--radius); color: #fff; background: linear-gradient(135deg, var(--green), var(--blue)); font-size: 11px; text-align: center; }

.modal { width: min(920px, calc(100vw - 28px)); max-height: calc(100vh - 40px); padding: 0; border: 0; background: transparent; }
.modal::backdrop { background: rgba(15,23,42,0.48); }
.modal-body { display: grid; gap: 14px; max-height: calc(100vh - 40px); overflow: auto; padding: 22px; }
.detail-grid p { display: grid; gap: 6px; min-height: 64px; margin: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; background: var(--surface-soft); }
.detail-grid b { color: var(--muted); font-size: 12px; }
.detail-grid span { overflow-wrap: anywhere; font-size: 14px; }
.error-text { min-height: 18px; margin: 0; color: var(--red); font-size: 13px; }

.module-placeholder .panel { min-height: 360px; }
.module-placeholder p { max-width: 780px; color: var(--muted); line-height: 1.7; }
.module-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.module-cards article { min-height: 126px; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--surface-soft); }
.module-cards b { display: block; margin-bottom: 10px; }
.module-cards p { margin: 0; font-size: 13px; }

.lock-notice { border: 1px solid rgba(245,158,11,0.35); border-radius: var(--radius); padding: 14px; background: rgba(245,158,11,0.1); }
.lock-notice strong { display: block; margin-bottom: 6px; color: #92400e; }
.lock-notice p { margin: 0; color: var(--muted); line-height: 1.55; }
.reconciliation-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.reconciliation-summary article { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--surface-soft); }
.reconciliation-summary span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.reconciliation-summary b { display: block; margin-top: 8px; font-size: 24px; }
.process-rule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.process-rule-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface-soft);
}

.process-rule-card p {
  margin: 0;
  color: #263449;
  line-height: 1.55;
}

.process-rule-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.process-rule-meta span {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: rgba(255,255,255,0.76);
  font-size: 12px;
}

.process-rule-meta b {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}
.task-panel { min-height: 520px; }
.task-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.task-summary article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface-soft);
}
.task-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.task-summary b {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}
.task-list {
  display: grid;
  gap: 12px;
}
.task-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  padding: 15px;
  background: var(--surface-soft);
}
.task-card.overdue,
.task-card.rejected { border-left-color: var(--red); }
.task-card.approval,
.task-card.dueSoon,
.task-card.dueToday,
.task-card.upcoming { border-left-color: #f59e0b; }
.task-card.completed { border-left-color: var(--green); }
.task-card p {
  margin: 0;
  color: #263449;
  line-height: 1.55;
}
.task-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.task-meta span {
  display: grid;
  gap: 4px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 10px;
  background: rgba(255,255,255,0.72);
  overflow-wrap: anywhere;
}
.task-meta b {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.module-search {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(280px, 420px) auto auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.module-search-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.module-search-copy strong {
  font-size: 14px;
}

.module-search-copy span,
.module-search-count {
  color: var(--muted);
  font-size: 12px;
}

.module-search-input {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  background: var(--surface);
}

.module-search-icon {
  position: relative;
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  border: 2px solid var(--muted);
  border-radius: 50%;
  opacity: 0.72;
}

.module-search-icon::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: -4px;
  width: 7px;
  height: 2px;
  border-radius: 999px;
  background: var(--muted);
  transform: rotate(45deg);
}

.module-search-input input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
}

.module-search-clear {
  min-height: 40px;
}

.module-search-empty {
  margin: -2px 0 14px;
}

.hidden,
.search-hidden {
  display: none !important;
}
.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 24px;
  color: var(--muted);
  background: var(--surface-soft);
  text-align: center;
  font-weight: 800;
}



.property-facility-field {
  display: grid;
  gap: 12px;
}

.facility-field-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-end;
}

.facility-field-head > span,
.facility-selected-panel > strong,
.facility-custom-panel > strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.facility-field-head small,
.facility-custom-panel p {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.facility-picker-module {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  display: grid;
  gap: 14px;
  padding: 14px;
}

.facility-add-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(120px, 150px) auto;
  gap: 10px;
  align-items: end;
}

.facility-add-row label,
.facility-selected-item label {
  margin: 0;
}

.facility-add-row .secondary-action {
  min-height: 44px;
  white-space: nowrap;
}

.facility-selected-panel,
.facility-custom-panel {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  padding-top: 14px;
}

.facility-selected-list {
  display: grid;
  gap: 8px;
}

.facility-selected-item {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(160px, 1fr) minmax(100px, 130px) auto;
  padding: 10px;
}

.facility-selected-item > span {
  color: var(--text);
  font-weight: 900;
}

.facility-selected-item input {
  height: 36px;
}

.facility-selected-item .danger-text {
  justify-self: end;
}

.facility-custom-panel.disabled {
  background: #f8fafc;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 12px;
}

.empty-state.compact {
  border-radius: 12px;
  padding: 12px;
  font-size: 12px;
}
@media (max-width: 1100px) {
  .app-shell, .hero-panel, .dashboard-layout, .module-grid, .contract-layout, .field-grid, .detail-grid, .facility-add-row, .facility-selected-item { grid-template-columns: 1fr; }
  .app-shell { --sidebar-width: auto; }
  .sidebar-resize-handle { display: none; }
  .sidebar-card { display: none; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar, .topbar-actions, .module-toolbar { align-items: stretch; flex-direction: column; }
  .topbar-actions { justify-content: flex-start; }
  .account-module { justify-content: space-between; width: 100%; }
  .account-module .user-pill { flex: 1; }
  .search { width: 100%; }
  .module-search { grid-template-columns: 1fr; align-items: stretch; }
  .module-search-count { justify-self: start; }
}

@media (max-width: 760px) {
  .login-screen { padding: 16px; }
  .login-shell { grid-template-columns: 1fr; min-height: auto; }
  .login-brand-panel { min-height: 360px; padding: 28px; }
  .login-brand-visual { min-height: 220px; padding: 22px 0; }
  .login-panel { padding: 30px 22px; }
  .login-form-head { align-items: flex-start; flex-direction: column; }
  .main, .sidebar { padding: 18px 14px; }
  .metric-grid, .module-cards, .reconciliation-summary, .task-summary, .task-meta { grid-template-columns: 1fr; }
  .hero-panel h3 { font-size: 26px; }
  .topbar h2 { font-size: 24px; }
  .metric strong { font-size: 28px; }
  .subnav { padding-left: 0; }
}
.finance-grid {
  align-items: start;
}

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


.client-info-layout {
  grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
}

.client-record-form input[type="file"] {
  height: auto;
  padding: 10px 12px;
  background: #fff;
}

.client-record-form small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.document-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.document-chip {
  display: inline-flex;
  align-items: center;
  max-width: 220px;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  color: #334155;
  background: #eef2f7;
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-empty-row td {
  color: var(--muted);
  text-align: center;
}

.form-status.error {
  color: var(--red);
}
.form-status {
  min-height: 18px;
  margin: 0;
  color: #137333;
  font-size: 13px;
  font-weight: 700;
}

.compact-table small {
  color: var(--muted);
  line-height: 1.5;
}


@media (max-width: 1100px) {
  .report-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .report-summary {
    grid-template-columns: 1fr;
  }
}


.permission-cell {
  display: grid;
  gap: 10px;
  min-width: 320px;
}

.permission-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.permission-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border-radius: 999px;
  padding: 6px 10px;
  color: #314155;
  background: #eef2f7;
  font-size: 12px;
  line-height: 1.35;
}

.permission-pill.strong {
  color: #137333;
  background: rgba(39,174,96,0.12);
  font-weight: 800;
}

.muted-text {
  color: var(--muted);
}

.permission-row td {
  padding: 0;
  background: #fbfcff;
}

.permission-editor {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-top: 1px solid var(--line);
}

.permission-editor-head,
.permission-footer,
.permission-catalog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.permission-editor-head div:first-child,
.permission-catalog-head {
  display: grid;
  align-items: start;
  justify-content: start;
}

.permission-editor-head span,
.permission-catalog-head span {
  color: var(--muted);
  font-size: 12px;
}

.permission-actions,
.permission-footer {
  flex-wrap: wrap;
}

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

.permission-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.permission-group summary {
  min-height: 42px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  font-weight: 800;
}

.permission-options {
  display: grid;
}

.permission-option {
  display: flex;
  grid-template-columns: none;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  border-bottom: 1px solid var(--line);
  padding: 11px 14px;
  color: var(--ink);
  font-size: 13px;
}

.permission-option:last-child {
  border-bottom: 0;
}

.permission-option input {
  width: auto;
  margin-top: 2px;
  accent-color: var(--blue);
}

.permission-option span {
  display: grid;
  gap: 3px;
}

.permission-option small {
  color: var(--muted);
}

.permission-option.readonly {
  background: var(--surface-soft);
}

.permission-catalog {
  display: grid;
  gap: 14px;
}


@media (max-width: 1100px) {
  .permission-groups {
    grid-template-columns: 1fr;
  }

  .permission-editor-head,
  .permission-footer,
  .permission-catalog-head {
    align-items: stretch;
    flex-direction: column;
  }
}



.attachment-native-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.attachment-uploader {
  display: grid;
  gap: 10px;
  border: 1px dashed #b7c4d7;
  border-radius: var(--radius);
  padding: 12px;
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  outline: none;
}

.attachment-uploader:focus,
.attachment-uploader:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(79,100,255,0.12);
}

.attachment-uploader-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.attachment-uploader-main div {
  display: grid;
  gap: 4px;
}

.attachment-uploader-main strong {
  color: var(--ink);
  font-size: 13px;
}

.attachment-uploader-main span,
.attachment-inline-list > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.attachment-inline-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 28px;
}

.attachment-pill,
.attachment-remove,
.attachment-preview-chip {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.attachment-pill {
  display: inline-flex;
  align-items: center;
  max-width: 240px;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  color: #1f3a5f;
  background: #eaf0ff;
  font-size: 12px;
  font-weight: 800;
}

.attachment-pill span,
.attachment-preview-chip {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-remove {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  color: #64748b;
  background: #eef2f7;
  font-weight: 900;
}

.attachment-preview-chip {
  max-width: 220px;
  text-align: left;
}

.attachment-preview-modal {
  width: min(1080px, calc(100vw - 28px));
}

.attachment-preview-body {
  min-height: min(720px, calc(100vh - 64px));
  grid-template-rows: auto minmax(0, 1fr);
}

.attachment-preview-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.attachment-preview-head h3 {
  margin: 0;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.attachment-preview-head span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.attachment-preview-actions {
  display: flex;
  gap: 8px;
}

.attachment-download {
  display: inline-grid;
  place-items: center;
  text-decoration: none;
  font-size: 20px;
}

.attachment-download.disabled {
  pointer-events: none;
  opacity: 0.42;
}

.attachment-preview-content {
  display: grid;
  min-height: 420px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.attachment-preview-content img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 220px);
  margin: auto;
  object-fit: contain;
}

.attachment-preview-content iframe {
  width: 100%;
  height: min(640px, calc(100vh - 220px));
  border: 0;
  background: #fff;
}

.attachment-preview-content pre {
  margin: 0;
  padding: 18px;
  overflow: auto;
  color: var(--ink);
  background: #fff;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.attachment-preview-empty,
.attachment-file-card {
  display: grid;
  place-content: center;
  gap: 10px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.attachment-file-card strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}
.client-row-actions {
  min-width: 142px;
  justify-content: center;
}

.client-edit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 30px;
  border: 1px solid #2563eb;
  border-radius: 8px;
  padding: 0 12px;
  color: #fff;
  background: #2563eb;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(37,99,235,0.16);
}

.client-edit-button:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.client-cancel-edit {
  margin-left: 8px;
}
.client-delete-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 30px;
  border: 1px solid #dc2626;
  border-radius: 8px;
  padding: 0 12px;
  color: #fff;
  background: #dc2626;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(220,38,38,0.18);
}

.client-delete-button:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.client-delete-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.readonly-action {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 8px;
  color: #64748b;
  background: #f1f5f9;
  font-size: 12px;
  font-weight: 700;
}
.empty-attachment {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  color: #64748b;
  background: #eef2f7;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.client-info-layout .table-card th:last-child,
.client-info-layout .table-card td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #fff;
  box-shadow: -10px 0 18px rgba(15, 23, 42, 0.08);
}

.client-info-layout .table-card th:last-child {
  z-index: 3;
  background: #f8fafc;
}
.record-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.record-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--surface);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.record-action-primary,
.record-action-edit {
  border-color: #2563eb;
  color: #fff;
  background: #2563eb;
  box-shadow: 0 8px 16px rgba(37,99,235,0.16);
}

.record-action-primary:hover,
.record-action-edit:hover {
  border-color: #1d4ed8;
  background: #1d4ed8;
}

.record-action-danger,
.record-action-delete,
.record-action-reject {
  border-color: #dc2626;
  color: #fff;
  background: #dc2626;
  box-shadow: 0 8px 16px rgba(220,38,38,0.18);
}

.record-action-danger:hover,
.record-action-delete:hover,
.record-action-reject:hover {
  border-color: #b91c1c;
  background: #b91c1c;
}

.record-action-success,
.record-action-approve {
  border-color: #059669;
  color: #fff;
  background: #059669;
  box-shadow: 0 8px 16px rgba(5,150,105,0.16);
}

.record-action-success:hover,
.record-action-approve:hover {
  border-color: #047857;
  background: #047857;
}

.record-action-neutral,
.record-action-view {
  border-color: #cbd5e1;
  color: #334155;
  background: #fff;
}

.record-action-button:disabled {
  cursor: wait;
  opacity: 0.65;
}
.page-tabbed-panel,
.page-tab-panels,
.page-tab-panel.active {
  display: grid;
  gap: 16px;
}

.page-tabs {
  align-items: flex-end;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 28px;
  min-height: 44px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.page-view-tabs {
  margin-bottom: 14px;
}

.page-tab-button {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  min-height: 42px;
  padding: 0 2px 12px;
  position: relative;
  white-space: nowrap;
}

.page-tab-button:hover,
.page-tab-button.active {
  color: #1d4ed8;
}

.page-tab-button.active::after {
  background: #2563eb;
  border-radius: 999px 999px 0 0;
  bottom: -1px;
  content: "";
  height: 2px;
  left: 0;
  position: absolute;
  right: 0;
}

.page-tab-panel {
  display: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: #fff;
}

.page-tab-panel[hidden] {
  display: none !important;
}

.compact-head {
  margin-bottom: 0;
}

.lease-flow-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.lease-flow-list article {
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface-soft);
}

.lease-flow-list b {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
}

.lease-flow-list p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

@media (max-width: 760px) {
  .page-tabs {
    gap: 18px;
  }

  .lease-flow-list {
    grid-template-columns: 1fr;
  }
}.approval-workflow-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  align-items: start;
}
.approval-workflow-form,
.approval-workflow-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface-soft);
}
.approval-form-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.approval-form-head h4 {
  margin: 0 0 4px;
  font-size: 16px;
}
.approval-form-head span,
.approval-workflow-form small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.approval-form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.approval-form-actions .form-status {
  min-height: 20px;
  margin: 0;
  color: var(--green);
  font-size: 13px;
}
.approval-form-actions .form-status.error {
  color: var(--red);
}
.approval-workflow-card {
  border-left: 4px solid #f59e0b;
  background: #fff;
}
.approval-workflow-card.approved { border-left-color: var(--green); }
.approval-workflow-card.rejected { border-left-color: var(--red); }
.approval-workflow-card p {
  margin: 0;
  color: #263449;
  line-height: 1.55;
}
.approval-flow-line {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.approval-flow-line span,
.approval-note,
.approval-attachments {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: rgba(248,250,252,0.9);
  overflow-wrap: anywhere;
}
.approval-flow-line b,
.approval-note b,
.approval-attachments b {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}
.approval-decision-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.compact-action {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}
.danger-action {
  color: #b42318;
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.06);
}
.approval-decision-modal .modal-body {
  width: min(620px, calc(100vw - 28px));
}
.cleaning-approval-form {
  background: transparent;
  border: 0;
  padding: 0;
  gap: 16px;
}

.cleaning-form-intro,
.cleaning-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.cleaning-section {
  display: grid;
  gap: 14px;
}

.cleaning-section-head {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.cleaning-section-head h4 {
  margin: 0 0 4px;
  font-size: 17px;
  color: var(--ink);
}

.cleaning-section-head span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.55;
}

.step-pill {
  align-items: center;
  background: #eef6ff;
  border: 1px solid #d8eaff;
  border-radius: 999px;
  color: #1d4ed8;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  min-height: 28px;
  padding: 0 10px;
}

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

.area-check {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  display: grid;
  gap: 7px;
  min-height: 96px;
  padding: 12px;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

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

.area-check strong {
  color: var(--ink);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.area-check small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.area-check:has(input:checked) {
  background: #edfdf7;
  border-color: #78d6a4;
  box-shadow: 0 8px 22px rgba(22, 163, 74, 0.08);
}

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

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

.photo-zone-card.is-disabled {
  background: #f8fafc;
  opacity: 0.68;
}

.photo-zone-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.photo-zone-head b {
  color: var(--ink);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.photo-requirement {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 900;
}

.photo-upload-box {
  align-content: center;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  color: var(--muted);
  display: grid;
  gap: 8px;
  min-height: 118px;
  padding: 12px;
}

.photo-upload-box b {
  color: var(--ink);
  font-size: 13px;
}

.photo-upload-box input {
  width: 100%;
}

.approval-footer {
  align-items: end;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 12px;
  padding-top: 14px;
}

.approval-submit-stack {
  align-items: end;
  display: grid;
  gap: 8px;
}

.approval-submit-stack .form-status {
  color: var(--green);
  font-size: 13px;
  margin: 0;
  min-height: 18px;
  text-align: right;
}

.approval-submit-stack .form-status.error {
  color: var(--red);
}

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

.cleaning-meta-summary span {
  background: rgba(248,250,252,0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 4px;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 8px 10px;
}

.cleaning-meta-summary b {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

@media (max-width: 1100px) {
  .cleaning-area-grid,
  .photo-zone-grid,
  .cleaning-meta-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .cleaning-section-head,
  .photo-zone-head,
  .approval-footer {
    grid-template-columns: 1fr;
  }

  .cleaning-section-head,
  .photo-zone-head {
    display: grid;
  }

  .cleaning-area-grid,
  .photo-zone-grid,
  .cleaning-meta-summary {
    grid-template-columns: 1fr;
  }

  .approval-submit-stack {
    align-items: stretch;
  }

  .approval-submit-stack .form-status {
    text-align: left;
  }
}
@media (max-width: 980px) {
  .approval-workflow-layout,
  .approval-flow-line {
    grid-template-columns: 1fr;
  }
}
.pipeline-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  align-items: start;
}

.pipeline-column {
  min-height: 180px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.pipeline-column .item-top {
  margin-bottom: 10px;
}

.pipeline-card {
  display: grid;
  gap: 4px;
  padding: 10px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.pipeline-card strong,
.pipeline-card span,
.pipeline-card small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.date-time-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 8px;
  align-items: center;
}

.date-time-pair input {
  width: 100%;
  min-width: 0;
}

@media (max-width: 640px) {
  .date-time-pair {
    grid-template-columns: 1fr;
  }
}
.flow-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  margin-bottom: 14px;
}

.flow-strip article {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 54px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #f8fafc);
}

.flow-strip article span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  color: #102a43;
  background: rgba(217, 173, 27, 0.18);
  font-size: 12px;
  font-weight: 900;
}

.flow-strip article b {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.35;
}

.lead-flow-layout {
  align-items: start;
}

.flow-worklog-panel {
  margin-bottom: 14px;
}

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

@media (max-width: 1180px) {
  .flow-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .flow-strip { grid-template-columns: 1fr; }
}
.account-security-cell {
  display: grid;
  gap: 8px;
  min-width: 220px;
}

.security-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.security-badges small {
  width: 100%;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.security-badge,
.audit-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: #334155;
  background: #f1f5f9;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.security-badge.ok {
  color: #047857;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.2);
}

.security-badge.warn {
  color: #92400e;
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.22);
}

.security-badge.danger {
  color: #b42318;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.2);
}

.security-reset-button {
  justify-self: start;
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.22);
  background: rgba(37, 99, 235, 0.06);
}

.audit-log-panel {
  display: grid;
  gap: 14px;
}

.audit-filter-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr)) minmax(220px, 1.4fr) auto auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.audit-filter-bar label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.audit-filter-bar input,
.audit-filter-bar select {
  width: 100%;
  min-width: 0;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  background: var(--surface);
}

.audit-search-field input {
  min-width: 220px;
}

.audit-chip.action {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.08);
}

.audit-detail-cell {
  min-width: 220px;
  max-width: 520px;
  overflow-wrap: anywhere;
  color: #334155;
}

.checkbox-line {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--ink);
  font-weight: 800;
}

.checkbox-line input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

@media (max-width: 1180px) {
  .audit-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .audit-filter-bar {
    grid-template-columns: 1fr;
  }
  .audit-search-field input {
    min-width: 0;
  }
}
/* Staff access redesign */
.staff-card-layout {
  display: grid;
  grid-template-columns: minmax(340px, 424px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.staff-card-list-panel,
.staff-detail-panel {
  padding: 0;
  overflow: hidden;
}

.staff-card-list-head,
.staff-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 18px;
}

.staff-card-list-head h3,
.staff-detail-title h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.staff-card-list-head span,
.staff-detail-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.staff-count-pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--blue);
  background: rgba(51, 112, 255, 0.09);
  font-size: 12px;
  font-weight: 900;
}

.staff-card-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
  background: var(--surface);
}

.staff-card-list {
  display: grid;
  gap: 10px;
  height: var(--staff-card-list-height, min(620px, calc(100vh - 286px)));
  min-height: 260px;
  overflow: auto;
  padding: 14px 12px;
  background: var(--surface-soft);
}

.staff-card-list-resize-handle {
  display: grid;
  width: 100%;
  height: 22px;
  place-items: center;
  border: 0;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #eef3f9);
  cursor: row-resize;
}

.staff-card-list-resize-handle::before {
  content: "";
  display: block;
  width: 54px;
  height: 4px;
  border-radius: 999px;
  background: #9aa7b8;
}

.staff-card-list-resize-handle:hover::before,
body.is-staff-list-resizing .staff-card-list-resize-handle::before {
  background: var(--blue);
}

body.is-staff-list-resizing,
body.is-window-resizing {
  cursor: row-resize;
  user-select: none;
}

.staff-card,
.staff-detail-panel {
  --staff-tone: #3370ff;
  --staff-tone-soft: rgba(51, 112, 255, 0.1);
  --staff-tone-pale: rgba(51, 112, 255, 0.08);
  --staff-tone-ink: #1d4ed8;
  --staff-avatar-bg: #172033;
}

.staff-card {
  width: 100%;
  border: 1px solid var(--line);
  border-left: 4px solid var(--staff-tone);
  border-radius: var(--radius);
  padding: 12px;
  color: var(--ink);
  background: linear-gradient(90deg, var(--staff-tone-pale), var(--surface) 34%);
  text-align: left;
}

.staff-card:hover,
.staff-card.active {
  border-color: var(--staff-tone);
  box-shadow: 0 0 0 3px var(--staff-tone-soft);
}

.staff-card-main,
.staff-detail-identity {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.staff-avatar {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: var(--radius);
  color: #fff;
  background: var(--staff-avatar-bg);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  font-weight: 900;
}

.staff-card .role-tone-pill {
  color: var(--staff-tone-ink);
  background: var(--staff-tone-soft);
}

.staff-card .staff-no-pill {
  color: #475569;
  background: #eef2f7;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  letter-spacing: 0;
}

.staff-card[data-role-tone="admin"],
.staff-detail-panel[data-role-tone="admin"] {
  --staff-tone: #3370ff;
  --staff-tone-soft: rgba(51, 112, 255, 0.14);
  --staff-tone-pale: rgba(51, 112, 255, 0.06);
  --staff-tone-ink: #1d4ed8;
  --staff-avatar-bg: #172033;
}

.staff-card[data-role-tone="executive"],
.staff-detail-panel[data-role-tone="executive"] {
  --staff-tone: #4f46e5;
  --staff-tone-soft: rgba(79, 70, 229, 0.13);
  --staff-tone-pale: rgba(79, 70, 229, 0.055);
  --staff-tone-ink: #3730a3;
  --staff-avatar-bg: #252154;
}

.staff-card[data-role-tone="board"],
.staff-detail-panel[data-role-tone="board"] {
  --staff-tone: #0f766e;
  --staff-tone-soft: rgba(15, 118, 110, 0.13);
  --staff-tone-pale: rgba(15, 118, 110, 0.055);
  --staff-tone-ink: #0f766e;
  --staff-avatar-bg: #153f3b;
}

.staff-card[data-role-tone="management"],
.staff-detail-panel[data-role-tone="management"] {
  --staff-tone: #c77700;
  --staff-tone-soft: rgba(199, 119, 0, 0.14);
  --staff-tone-pale: rgba(199, 119, 0, 0.055);
  --staff-tone-ink: #92400e;
  --staff-avatar-bg: #4a3216;
}

.staff-card[data-role-tone="finance"],
.staff-detail-panel[data-role-tone="finance"] {
  --staff-tone: #15803d;
  --staff-tone-soft: rgba(21, 128, 61, 0.13);
  --staff-tone-pale: rgba(21, 128, 61, 0.052);
  --staff-tone-ink: #166534;
  --staff-avatar-bg: #193c2a;
}

.staff-card[data-role-tone="market"],
.staff-detail-panel[data-role-tone="market"] {
  --staff-tone: #ea8a00;
  --staff-tone-soft: rgba(234, 138, 0, 0.14);
  --staff-tone-pale: rgba(234, 138, 0, 0.055);
  --staff-tone-ink: #b45309;
  --staff-avatar-bg: #4a3518;
}

.staff-card[data-role-tone="compliance"],
.staff-detail-panel[data-role-tone="compliance"] {
  --staff-tone: #7c3aed;
  --staff-tone-soft: rgba(124, 58, 237, 0.13);
  --staff-tone-pale: rgba(124, 58, 237, 0.052);
  --staff-tone-ink: #5b21b6;
  --staff-avatar-bg: #312158;
}

.staff-card[data-role-tone="operations"],
.staff-detail-panel[data-role-tone="operations"] {
  --staff-tone: #0891b2;
  --staff-tone-soft: rgba(8, 145, 178, 0.13);
  --staff-tone-pale: rgba(8, 145, 178, 0.052);
  --staff-tone-ink: #0e7490;
  --staff-avatar-bg: #163e4a;
}

.staff-card[data-role-tone="cleaning"],
.staff-detail-panel[data-role-tone="cleaning"] {
  --staff-tone: #22a06b;
  --staff-tone-soft: rgba(34, 160, 107, 0.14);
  --staff-tone-pale: rgba(34, 160, 107, 0.055);
  --staff-tone-ink: #047857;
  --staff-avatar-bg: #173f31;
}

.staff-card[data-role-tone="repair"],
.staff-detail-panel[data-role-tone="repair"] {
  --staff-tone: #0d9488;
  --staff-tone-soft: rgba(13, 148, 136, 0.13);
  --staff-tone-pale: rgba(13, 148, 136, 0.052);
  --staff-tone-ink: #0f766e;
  --staff-avatar-bg: #173f3d;
}

.staff-card-name strong,
.staff-detail-title h3 {
  overflow-wrap: anywhere;
}

.staff-card-name small,
.staff-card-foot,
.staff-muted-line {
  color: var(--muted);
  font-size: 12px;
}

.staff-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.staff-card-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.staff-detail-identity {
  grid-template-columns: 56px minmax(0, 1fr);
}

.staff-detail-identity .staff-avatar {
  width: 56px;
  height: 56px;
  font-size: 18px;
}

.staff-detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.staff-detail-tabs {
  border-bottom: 1px solid var(--line);
  border-left: 0;
  border-right: 0;
  border-radius: 0;
}

.staff-detail-tabs button {
  min-height: 46px;
}

.staff-detail-body {
  padding: 18px;
}

.staff-detail-section[hidden] {
  display: none;
}

.staff-detail-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.staff-detail-stat {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-soft);
}

.staff-detail-stat b {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 15px;
}

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

.staff-readonly-field {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 11px;
  color: var(--ink);
  background: var(--surface);
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.staff-position-editor {
  display: grid;
  gap: 12px;
}

.staff-position-editor .role-editor {
  max-width: none;
}

.staff-position-editor .role-title-input {
  width: 100%;
}

.staff-permission-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 12px;
}

.staff-detail-permission-editor .permission-groups {
  gap: 10px;
}

.staff-detail-permission-editor .permission-group:not([open]) {
  background: var(--surface);
}

.staff-detail-permission-editor .permission-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.staff-security-grid {
  display: grid;
  gap: 10px;
}

.staff-security-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-soft);
}

.staff-security-item b {
  display: block;
  color: var(--ink);
}

.staff-security-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.staff-detail-empty {
  min-height: 360px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1200px) {
  .staff-card-layout {
    grid-template-columns: 1fr;
  }
  .staff-card-list {
    max-height: none;
  }
}

@media (max-width: 720px) {
  .staff-card-filters,
  .staff-detail-stats,
  .staff-detail-form,
  .staff-permission-toolbar,
  .staff-detail-permission-editor .permission-options {
    grid-template-columns: 1fr;
  }
  .staff-card-main,
  .staff-detail-identity,
  .staff-detail-head {
    grid-template-columns: 1fr;
  }
  .staff-detail-actions {
    justify-content: flex-start;
  }
}

.contract-template-select-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr);
  gap: 12px;
  margin: 12px 0 16px;
}

.contract-template-select-row label,
.contract-field-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #24314a;
  font-size: 12px;
  font-weight: 700;
}

.contract-field-group {
  border: 1px solid #d9e3f0;
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
  margin-top: 12px;
}

.contract-field-group h4 {
  margin: 0 0 12px;
  color: #12233f;
  font-size: 14px;
}

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

.contract-field-grid input,
.contract-field-grid textarea,
.contract-template-select-row select {
  width: 100%;
  border: 1px solid #d8e1ee;
  border-radius: 7px;
  padding: 9px 10px;
  font: inherit;
  color: #0f1f3a;
  background: #fff;
}

.contract-field-grid textarea {
  min-height: 76px;
  resize: vertical;
  line-height: 1.45;
}

.contract-confirm-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: #17243c;
  font-weight: 700;
}

.contract-confirm-row input {
  width: 16px;
  height: 16px;
}

@media (max-width: 860px) {
  .contract-field-grid {
    grid-template-columns: 1fr;
  }
}

.contract-preview {
  position: sticky;
  top: 16px;
  height: var(--resizable-window-height, min(760px, calc(100vh - 48px)));
  min-height: 420px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  background: #edf2f8;
  scrollbar-gutter: stable;
}


.resizable-scroll-window {
  scrollbar-width: thin;
}

.resizable-window-handle {
  position: fixed;
  z-index: 1200;
  display: none;
  height: 18px;
  place-items: center;
  border: 0;
  border-top: 1px solid rgba(216, 225, 238, 0.72);
  border-radius: 0 0 8px 8px;
  background: rgba(247, 250, 254, 0.86);
  box-shadow: 0 -5px 12px rgba(15, 23, 42, 0.06);
  cursor: row-resize;
}

.resizable-window-handle::before {
  content: "";
  display: block;
  width: 54px;
  height: 3px;
  border-radius: 999px;
  background: #9aa7b8;
}

.resizable-window-handle:hover::before,
body.is-window-resizing .resizable-window-handle::before {
  background: var(--blue);
}
.contract-preview-empty {
  display: grid;
  min-height: 420px;
  place-content: center;
  gap: 8px;
  text-align: center;
  color: #52627a;
}

.contract-preview-empty h3 {
  margin: 0;
  color: #12233f;
}

.contract-paper-preview {
  box-sizing: border-box;
  width: min(100%, 720px);
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid #d6dfeb;
  border-top: 3px solid #14233d;
  border-radius: 4px;
  background: #fff;
  padding: 32px clamp(22px, 4vw, 38px) 40px;
  color: #111827;
  font-family: Arial, sans-serif;
  font-size: 12px;
  line-height: 1.55;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
}
.contract-paper-preview *,
.contract-paper-preview *::before,
.contract-paper-preview *::after {
  box-sizing: border-box;
}

.contract-paper-preview p,
.contract-paper-preview td,
.contract-paper-preview th {
  overflow-wrap: anywhere;
  word-break: break-word;
}


.contract-docx-preview {
  white-space: normal;
}

.contract-docx-header {
  display: flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 18px;
  border-bottom: 1px solid #d8e1ee;
  padding-bottom: 10px;
  color: #34445f;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
}

.contract-docx-footer {
  margin-top: 28px;
  border-top: 1px solid #d8e1ee;
  padding-top: 10px;
  color: #52627a;
  text-align: center;
  font-size: 10px;
}

.contract-docx-paragraph {
  margin: 7px 0;
  color: #111827;
  text-align: justify;
}

.contract-docx-paragraph.center {
  text-align: center;
}

.contract-docx-paragraph.bold,
.contract-docx-paragraph.heading-like {
  font-weight: 700;
}

.contract-docx-paragraph.heading-like {
  margin-top: 15px;
  color: #101f3d;
}

.contract-docx-table {
  page-break-inside: auto;
}
.contract-preview-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid #d8e1ee;
  padding-bottom: 12px;
  color: #42526d;
  font-size: 11px;
}

.contract-preview-brand img {
  width: 120px;
  height: auto;
  object-fit: contain;
}

.contract-paper-preview h3 {
  margin: 0 0 20px;
  color: #101f3d;
  text-align: center;
  font-size: 18px;
  line-height: 1.35;
}

.contract-paper-preview h3 small {
  font-size: 13px;
}

.contract-paper-preview h4 {
  margin: 16px 0 6px;
  color: #111827;
  font-size: 12px;
  letter-spacing: 0;
}

.contract-paper-preview p {
  margin: 8px 0;
  text-align: justify;
}

.contract-legal-line {
  text-align: center !important;
  font-weight: 700;
}

.contract-preview-callout {
  margin: 14px 0;
  text-align: center;
  font-weight: 700;
  text-transform: uppercase;
}

.contract-preview-table {
  width: 100%;
  max-width: 100%;
  margin: 10px 0 14px;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 11px;
}

.contract-preview-table th,
.contract-preview-table td {
  border: 1px solid #cfd8e6;
  padding: 7px 8px;
  vertical-align: middle;
}

.contract-preview-table th {
  background: #f3f6fa;
  font-weight: 700;
}

.contract-preview-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
  margin-top: 28px;
}

.contract-preview-signatures div {
  border-top: 1px solid #1f2937;
  padding-top: 8px;
  min-height: 64px;
}

.contract-preview-signatures b,
.contract-preview-signatures span {
  display: block;
}

.contract-preview-note {
  margin-top: 24px;
  border-top: 1px solid #d8e1ee;
  padding-top: 10px;
  color: #52627a;
  font-size: 11px;
}








.market-trend-panel {
  margin-bottom: 16px;
}
.market-trend-panel .reconciliation-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.market-trend-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.market-chart-block {
  min-height: 210px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface-soft);
}
.market-chart-block h4 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 14px;
}
.trend-bars {
  display: grid;
  gap: 11px;
}
.trend-row {
  display: grid;
  gap: 6px;
}
.trend-row-head,
.trend-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.trend-row-head span {
  min-width: 0;
  overflow: hidden;
  color: #263449;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trend-row-head b {
  color: #0b2554;
  font-size: 12px;
  white-space: nowrap;
}
.trend-meta {
  justify-content: flex-start;
  color: var(--muted);
  font-size: 11px;
}
.trend-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6ebf2;
}
.trend-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--teal));
}
.trend-bars.compact .trend-track {
  height: 8px;
}
.marketing-workflow-grid {
  align-items: start;
}
.marketing-price-panel .approval-workflow-card,
.marketing-pricing-form {
  border-left: 4px solid var(--blue);
}
.marketing-refresh-form {
  border-left: 4px solid #22c55e;
}
.marketing-ad-panel .ad-list {
  margin-top: 12px;
}

.market-research-panel {
  display: grid;
  gap: 14px;
}
.market-research-panel .page-tab-panels {
  margin-top: 0;
}
.market-research-panel .inline-panel {
  box-shadow: none;
}
.compact-head {
  margin-bottom: 12px;
}
.market-summary-grid,
.market-daily-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.market-daily-summary article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--surface-soft);
}
.market-daily-summary span,
.market-summary-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.market-daily-summary b,
.market-summary-grid b {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 19px;
}
.market-daily-summary small {
  display: block;
  margin-top: 3px;
  color: #168a4a;
  font-size: 11px;
  font-weight: 800;
}
.market-trend-grid,
.market-daily-grid,
.market-funnel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.market-chart-block {
  min-height: 205px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-soft);
}
.market-chart-block h4 {
  margin: 0 0 9px;
  color: var(--ink);
  font-size: 14px;
}
.market-chart-wide {
  grid-column: 1 / -1;
}
.market-line-chart svg {
  display: block;
  width: 100%;
  min-height: 158px;
  height: auto;
  overflow: visible;
}
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.chart-legend span::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--blue);
  vertical-align: -1px;
}
.chart-legend span:nth-child(2)::before {
  background: var(--teal);
}
.market-chart-frame {
  fill: transparent;
  stroke: #dbe4ef;
  stroke-width: 1;
}
.market-chart-grid-line {
  stroke: #e3e9f2;
  stroke-width: 1;
}
.market-line-a,
.market-line-b,
.market-line-c {
  fill: none;
  stroke-width: 2.2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.market-line-a { stroke: var(--blue); }
.market-line-b { stroke: var(--teal); }
.market-line-c { stroke: #7c5cff; }
.market-dot-a { fill: var(--blue); }
.market-dot-b { fill: var(--teal); }
.market-dot-c { fill: #7c5cff; }
.market-chart-label {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.market-target-line {
  fill: none;
  stroke: #c77c17;
  stroke-width: 2;
  stroke-dasharray: 6 6;
}
.market-value-chip rect {
  fill: var(--surface);
  stroke: var(--line);
  rx: 6;
}
.market-value-chip text {
  fill: var(--ink);
  font-size: 11px;
  font-weight: 900;
}
.market-daily-table {
  display: grid;
  gap: 7px;
  margin-top: 6px;
}
.market-daily-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 44px 48px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}
.market-daily-row b {
  color: var(--ink);
  text-align: right;
}
.market-funnel {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}
.market-funnel-step {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) 70px;
  align-items: center;
  gap: 12px;
}
.market-funnel-label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}
.market-funnel-track {
  height: 28px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6edf6;
}
.market-funnel-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--teal));
}
.market-funnel-value {
  color: var(--ink);
  font-weight: 900;
  text-align: right;
}
@media (max-width: 980px) {
  .market-summary-grid,
  .market-daily-summary,
  .market-trend-grid,
  .market-daily-grid,
  .market-funnel-grid {
    grid-template-columns: 1fr;
  }
  .market-chart-wide {
    grid-column: auto;
  }
}

.equipment-filter-panel { margin-bottom: 16px; }
.equipment-filter-grid { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 12px; }
.equipment-filter-grid label { display: grid; gap: 7px; color: #344054; font-size: 12px; font-weight: 850; }
.equipment-filter-grid label span { color: var(--muted); line-height: 1.35; text-transform: uppercase; }
.equipment-path { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 11px; color: #344054; background: var(--surface-soft); font-size: 13px; font-weight: 850; }
.equipment-source-note { color: var(--muted); font-size: 12px; font-weight: 750; }
.equipment-view-tabs { margin: 0 0 16px; }
.equipment-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; margin: 0 0 16px; }
.equipment-search { position: relative; }
.equipment-search span { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #98a2b3; font-weight: 900; }
.equipment-search input { min-height: 42px; padding-left: 42px; font-weight: 750; }
.equipment-view { display: none; }
.equipment-view.active { display: block; }
.equipment-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 430px); gap: 16px; align-items: start; }
.equipment-table-card table { min-width: 1180px; }
.equipment-side { display: grid; gap: 16px; }
.equipment-detail-grid { grid-template-columns: 1fr 1fr; }
.equipment-history { display: grid; gap: 8px; margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; background: var(--surface-soft); }
.equipment-history > strong { color: var(--ink); font-size: 13px; }
.equipment-history div { display: grid; grid-template-columns: 70px minmax(0, 1fr) minmax(90px, auto); gap: 8px; align-items: center; border-top: 1px solid var(--line); padding-top: 8px; color: var(--muted); font-size: 12px; }
.equipment-history b { color: var(--ink); font-size: 12px; }
.equipment-history small { text-align: right; }
.equipment-quick-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.equipment-quick-actions .secondary-action,
.equipment-quick-actions .danger-action { min-height: 32px; padding: 0 10px; font-size: 12px; }
.danger-action { border: 1px solid rgba(239,68,68,.28); border-radius: var(--radius); color: var(--red); background: #fff; font-weight: 850; }
.equipment-flow-note { display: grid; gap: 8px; margin: 0 0 16px; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; background: var(--surface-soft); color: var(--muted); font-size: 12px; line-height: 1.55; }
.equipment-flow-note strong { color: var(--ink); font-size: 13px; }
.equipment-event-type { display: inline-flex; align-items: center; min-height: 24px; border-radius: 999px; padding: 0 9px; color: #1d4ed8; background: rgba(51,112,255,.1); font-size: 12px; font-weight: 850; }
.equipment-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.equipment-form-grid .field-wide { grid-column: 1 / -1; }
.equipment-form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 12px; }
.equipment-readonly-pill { display: inline-flex; align-items: center; min-height: 34px; border: 1px solid var(--line); border-radius: 999px; padding: 0 12px; color: var(--muted); background: var(--surface); font-size: 12px; font-weight: 850; }
@media (max-width: 1320px) { .equipment-filter-grid, .equipment-layout, .equipment-toolbar { grid-template-columns: 1fr; } }
