/* Workspace shell, overview, and shared operating surfaces. */
html {
  scrollbar-color: var(--control-border) var(--canvas);
  scroll-padding-top: 124px;
}

:is(.workspace-body, .guest-body, .sg-login-page) {
  --shell-sidebar: 232px;
  --shell-gutter: clamp(22px, 2.5vw, 40px);
  --shell-header: 69px;
  --shell-nav: 64px;
  --series-files: #2563eb;
  --series-completed: #168167;
  --brand-mark-bg: #0d1b34;
}

html[data-theme="dark"] .workspace-body {
  --series-files: #81a7ff;
  --series-completed: #66c4a2;
}

body.workspace-body { font-size: .94rem; }
body.workspace-body ::selection, body.sg-login-page ::selection {
  color: var(--ink);
  background: var(--brand-tint);
}

.brand-mark {
  display: inline-grid;
  flex: none;
  width: 43px;
  height: 43px;
  place-items: center;
  border: 1px solid #dfbd7259;
  border-radius: 11px;
  background: var(--brand-mark-bg);
}

.brand-mark img { width: 23px; height: 23px; object-fit: contain; }
.workspace-scrim, .sidebar-close { display: none; }

.workspace-body .workspace-sidebar {
  display: flex;
  flex-direction: column;
  width: var(--shell-sidebar);
  padding: 20px 13px 12px;
  overflow: hidden;
  color: var(--sidebar-text);
  background: var(--sidebar-bg) !important;
}

.sidebar-header { display: flex; align-items: center; justify-content: space-between; margin: 0 0 15px; }
.workspace-sidebar .workspace-brand { display: flex; align-items: center; gap: 10px; padding: 1px 8px 9px; min-width: 0; }
.workspace-sidebar .workspace-brand b { font-size: 1.48rem; line-height: 1.15; letter-spacing: 0; }
.workspace-sidebar .workspace-brand small { font-size: .72rem; line-height: 1.5; margin-top: 4px; }
.workspace-sidebar .workspace-nav {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #435779 transparent;
  gap: 2px;
  padding: 3px;
  margin: 0 0 10px;
}

.workspace-sidebar .nav-label {
  color: var(--sidebar-muted) !important;
  font-size: .72rem;
  font-weight: 650;
  padding: 9px 9px 4px;
  margin: 0;
}

.workspace-sidebar .nav-label:not(:first-child) { margin-top: 10px; border-top: 1px solid var(--sidebar-border); }
.workspace-sidebar .workspace-nav :is(a, .workspace-nav-locked) {
  flex: none;
  min-height: 39px;
  gap: 10px;
  padding: 6px 9px;
  border-radius: 8px;
  font-size: .86rem;
  line-height: 1.5;
}

.workspace-sidebar .workspace-nav :is(a, .workspace-nav-locked) > .ui-icon {
  width: 17px;
  height: 17px;
  flex: none;
  color: var(--sidebar-muted) !important;
}

.workspace-sidebar .workspace-nav .workspace-nav-locked { color: var(--sidebar-muted); }
.workspace-sidebar .workspace-nav a:hover { background: var(--sidebar-surface) !important; text-decoration: none; }
html .workspace-sidebar .workspace-nav a[aria-current="page"] {
  background: var(--sidebar-selected) !important;
  border-color: #35517a !important;
  box-shadow: none;
}

html .workspace-sidebar .workspace-nav a[aria-current="page"] > .ui-icon,
.workspace-sidebar .workspace-nav .nav-lock { color: #a6c6ff !important; }
.workspace-sidebar .workspace-nav .nav-count {
  margin-inline-start: auto;
  background: #3f2b41 !important;
  color: #ffd1db !important;
  font-size: .74rem;
}

.workspace-sidebar .sidebar-footer { margin-top: auto; padding: 9px 4px 0; }
.sidebar-profile { display: flex; align-items: center; gap: 4px; }
.workspace-sidebar .workspace-user { flex: 1; min-width: 0; border-radius: 8px; gap: 8px; padding: 5px 4px; }
.workspace-sidebar .workspace-user:hover { background: var(--sidebar-surface); text-decoration: none; }
.workspace-sidebar .workspace-user > span:last-child { min-width: 0; }
.workspace-sidebar .workspace-user b, .workspace-sidebar .workspace-user small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: .79rem;
}
.workspace-sidebar .workspace-user small { font-size: .71rem; }
.workspace-sidebar .user-avatar { width: 35px; height: 35px; background: #263d62 !important; color: #dfebff !important; border-radius: 9px; }
.workspace-sidebar .logout-link, .sidebar-close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--sidebar-muted) !important;
  cursor: pointer;
}
.sidebar-close { display: none; }
.workspace-sidebar :is(.logout-link, .sidebar-close):hover { background: var(--sidebar-surface); color: white !important; }
.workspace-sidebar .install-app { background: var(--sidebar-surface) !important; color: var(--sidebar-text) !important; border-color: var(--sidebar-border) !important; }
body.workspace-body .workspace-sidebar :focus-visible { outline-color: #a6c6ff !important; outline-offset: 1px; }

.workspace-body :is(.workspace-topbar, .workspace-content) { margin-inline-start: var(--shell-sidebar); }
.workspace-body .workspace-topbar {
  display: grid;
  grid-template-columns: minmax(108px, 1fr) minmax(200px, 440px) minmax(max-content, 1fr);
  align-items: center;
  gap: 18px;
  min-height: var(--shell-header);
  height: auto;
  padding: 10px var(--shell-gutter);
  z-index: 70;
}

.workspace-topbar:not(:has(.topbar-search)) { grid-template-columns: minmax(0, 1fr) auto; }
.workspace-body .topbar-workspace { display: flex; align-items: center; gap: 9px !important; min-width: 0; }
.topbar-agency-logo, .topbar-agency-icon {
  width: 33px;
  height: 33px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--muted);
  object-fit: contain;
}

.topbar-agency-icon .ui-icon { width: 17px; height: 17px; }
.workspace-topbar .topbar-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }
.workspace-topbar .topbar-actions { justify-self: end; flex-wrap: nowrap; gap: 7px; }
.workspace-topbar .mobile-brand { display: none; }

.topbar-search { position: relative; min-width: 0; margin: 0; }
.topbar-search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding-inline: 12px 5px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-raised);
  color: var(--muted);
}
.topbar-search-field:focus-within { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.topbar-search-field > .ui-icon { width: 17px; height: 17px; flex: none; }
body.workspace-body .topbar-search-field input[type="search"] {
  min-width: 0;
  width: 100%;
  height: 40px;
  min-height: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--ink);
  font-size: .84rem !important;
}
.workspace-body .topbar-search-field input:focus-visible { outline: none !important; }
.topbar-search-field input::placeholder { color: var(--placeholder); opacity: 1; }
.topbar-search-field kbd {
  flex: none;
  color: var(--muted);
  font-size: .69rem;
  line-height: 1.5;
  background: var(--surface);
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  white-space: nowrap;
}

.topbar-search-submit {
  display: grid;
  flex: 0 0 33px;
  place-items: center;
  width: 33px;
  height: 33px;
  border: 0;
  border-radius: 6px;
  color: var(--link);
  background: transparent;
  cursor: pointer;
}
.topbar-search-submit:hover { background: var(--brand-tint); }
.topbar-search-submit .ui-icon { width: 17px; height: 17px; }
.topbar-search-results {
  display: none;
  position: absolute;
  inset: calc(100% + 8px) 0 auto;
  z-index: 6;
  max-height: min(54dvh, 460px);
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: 0 14px 32px #0f172a24;
  color: var(--muted);
  font-size: .85rem;
}
.topbar-search:not([data-preview-closed]):focus-within .topbar-search-results:not(:empty) { display: block; }
.topbar-search-results[aria-busy="true"] { padding: 12px; }
.preview-groups { padding: 6px 8px; }
.preview-group + .preview-group { border-top: 1px solid var(--line); }
body.workspace-body .preview-group h2 {
  margin: 7px 9px 4px;
  color: var(--muted) !important;
  font-size: .78rem !important;
}
.preview-group a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 6px 9px; min-height: 43px; border-radius: 7px; }
.preview-group a:hover { background: var(--surface-raised); text-decoration: none; }
.preview-group b { color: var(--ink); overflow-wrap: anywhere; }
.preview-group small { display: block; color: var(--muted); }
.preview-group .ui-icon, .preview-full .ui-icon { width: 16px; height: 16px; }
.preview-full { display: flex; gap: 7px; align-items: center; justify-content: center; min-height: 44px; padding: 7px 10px; border-top: 1px solid var(--line); background: var(--surface-raised); font-weight: 750; }
.preview-message { margin: 0; padding: 11px 14px; overflow-wrap: anywhere; }

body.workspace-body :is(.theme-toggle, .notification-button) {
  display: inline-grid;
  width: 42px;
  min-height: 42px;
  place-items: center;
  padding: 0 !important;
  border-color: var(--line) !important;
  border-radius: 9px !important;
}
.workspace-topbar .theme-toggle-label, .guest-theme-control .theme-toggle-label { display: none; }
.workspace-topbar :is(.theme-toggle, .notification-button) .ui-icon { width: 18px; height: 18px; }
.workspace-topbar .notice-count { background: #a12e42; inset: -5px auto auto -4px; }
.workspace-topbar .quick-create > button { min-height: 42px; flex-wrap: nowrap; white-space: nowrap; }
.workspace-topbar .quick-create .dropdown-menu {
  inset: calc(100% + 8px) auto auto 0;
  width: 205px;
  padding: 5px;
  box-shadow: 0 14px 32px #0f172a24 !important;
}
.workspace-topbar .quick-create .dropdown-menu a { display: flex; align-items: center; gap: 9px; padding: 8px; min-height: 42px; border-radius: 7px; }
.workspace-topbar .quick-create .dropdown-menu .ui-icon { color: var(--muted); width: 17px; height: 17px; flex: none; }

/* Shared controls and working surfaces. */
.workspace-body .container.app-main {
  max-width: 1520px !important;
  padding: 25px var(--shell-gutter) 36px !important;
  min-height: calc(100vh - var(--shell-header));
}

body.workspace-body :is(.panel, .info-card, .form-section, .part-detail-panel, .property-card, .smart-form) { border-radius: 14px !important; }
.workspace-body .panel { margin-bottom: 16px; }
.workspace-body .panel-head { gap: 8px 16px; padding-bottom: 12px; margin-bottom: 12px; }
body.workspace-body .panel-head h2 { font-size: 1.12rem !important; }
body.workspace-body :is(.btn, .segmented) { border-radius: 8px !important; }
body.workspace-body .btn { font-size: .875rem !important; }
body.workspace-body .btn-sm { font-size: .81rem !important; }
.workspace-body .btn > .ui-icon { width: 17px; height: 17px; flex: none; }
.workspace-body .btn:disabled { opacity: .72; cursor: wait; transform: none !important; }
.workspace-body .btn:hover { transform: none !important; }
body.workspace-body .text-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--link) !important;
  font-size: .84rem !important;
  white-space: normal;
}
.text-link > .ui-icon { width: 16px; height: 16px; flex: none; }
body.workspace-body :is(.page-head, .page-title) { margin-block-end: 20px !important; }
body.workspace-body :is(.page-head, .page-title, .dashboard-heading) h1 { font-size: 1.8rem !important; margin: 0 !important; line-height: 1.45 !important; }
body.workspace-body :is(.page-head, .page-title) p { margin-top: 4px; font-size: .89rem !important; }
.workspace-body :is(.page-head, .page-title) :is(.section-kicker, .eyebrow) { display: none !important; }
.workspace-body .workspace-crumbs { margin-bottom: 12px; font-size: .8rem; }
.workspace-body .segmented a { min-height: 35px; border-radius: 6px; }
.workspace-body .segmented a.is-active { color: var(--link) !important; }
.workspace-body .form-input, .workspace-body :is(.filter-grid, .form-grid) :is(select, textarea) { border-radius: 8px !important; }
.workspace-body .form-input[aria-invalid="true"] { border-color: var(--danger) !important; }
.workspace-body :is(.sb18-workflow, .form-context-banner, .sticky-form-actions, .price-preview) {
  color: var(--ink) !important;
  background: var(--surface-raised) !important;
  border-color: var(--line) !important;
  border-radius: 10px !important;
}
.workspace-body .form-context-banner [data-property-context] { color: var(--ink) !important; }
.workspace-body :is(.sb18-workflow-steps, .sb18-eyebrow, .sb18-progress-note) { display: none !important; }
.workspace-body .sb18-workflow { padding: 13px 16px; margin-bottom: 12px; box-shadow: none !important; }
.workspace-body .form-context-banner { min-height: 0; padding: 9px 16px; box-shadow: none !important; }
.workspace-body .form-context-banner strong { font-size: 1rem !important; }
.workspace-body .sb18-workflow h2 { font-size: 1.08rem !important; margin: 0; }
.workspace-body .sb18-workflow p { font-size: .83rem; margin: 4px 0 0; }
.workspace-body .form-section-title > span { background: var(--surface-raised) !important; color: var(--link) !important; border-color: var(--line) !important; }
.workspace-body .form-section-title h2 { font-size: 1.1rem !important; }
.workspace-body .sb18-section-toggle { background: var(--surface-raised) !important; color: var(--muted) !important; border-color: var(--line) !important; }
.workspace-body .sb18-section-toggle .ui-icon { width: 15px; height: 15px; transform: rotate(-90deg); }
.workspace-body .sb18-section-toggle[aria-expanded="false"] .ui-icon { transform: none; }
.workspace-body .agenda-preview { background: var(--surface) !important; border-color: var(--control-border) !important; color: var(--ink); border-radius: 10px; }
.workspace-body .agenda-preview strong { color: var(--ink); }

/* Overview. */
.dashboard-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 16px; }
.workspace-date { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 35px; padding: 4px 11px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 8px; font-size: .83rem; white-space: nowrap; }
.workspace-date .ui-icon { width: 16px; height: 16px; }
.dashboard-welcome {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  overflow: hidden;
  min-height: 211px;
  margin: 0 0 17px;
  border-radius: 15px;
  background: #10203c;
  color: #f3f7ff;
}
.dashboard-welcome .welcome-photo {
  position: absolute;
  z-index: -2;
  inset: 0 auto 0 0;
  width: 66%;
  height: 100%;
  object-fit: cover;
  object-position: 68% 53%;
  filter: saturate(.8);
}
.dashboard-welcome::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(270deg, #10203c 24%, #10203cf7 39%, #10203c74 65%, #10203c05 100%);
}
.welcome-copy { width: min(68%, 650px); padding: 24px 26px; overflow-wrap: anywhere; }
body.workspace-body .welcome-copy h2 { margin: 0; color: #f7f9ff !important; font-size: 1.82rem !important; font-weight: 820; line-height: 1.5 !important; }
.welcome-copy p { color: #d9e6fa; margin: 5px 0 0; font-size: .93rem; }
.welcome-copy p strong { color: #ffffff; font-weight: 780; }
.welcome-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 12px; }
.welcome-actions:empty { display: none; }
.welcome-actions :is(a, button) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  color: #e9f1ff !important;
  font-size: .84rem;
  font-weight: 720;
  background: transparent;
  border: 0;
  padding: 0 3px;
  cursor: pointer;
}
.welcome-actions > a:first-child { background: #ffffff15; border: 1px solid #b1c7e869; border-radius: 8px; padding: 4px 10px; }
.welcome-actions > a:first-child:hover { background: #ffffff29; text-decoration: none; }
.welcome-actions .ui-icon { width: 15px; height: 15px; }
body.workspace-body .welcome-actions :focus-visible { outline-color: #c8dfff !important; }

.overview-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 155px), 1fr));
  gap: 12px;
  margin: 0 0 17px;
}
.overview-metric {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto auto;
  align-items: start;
  gap: 3px 6px;
  min-width: 0;
  padding: 13px 13px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: border-color .16s ease, background .16s ease;
}
.overview-metric:hover { border-color: var(--control-border); background: var(--surface-raised); text-decoration: none; }
.metric-label { grid-column: 1; grid-row: 1; color: var(--muted); font-size: .8rem; font-weight: 690; line-height: 1.65; }
.overview-metric strong { grid-column: 1; grid-row: 2; color: var(--ink); font-size: 1.8rem; font-weight: 790; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.overview-metric small { grid-column: 1 / -1; grid-row: 3; color: var(--muted); font-size: .74rem; line-height: 1.65; }
.metric-mark, .agenda-mark, .empty-mark, .contact-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  color: var(--link);
  background: var(--brand-tint);
  border-radius: 8px;
}
.metric-mark { grid-column: 2; grid-row: 1 / 3; }
.metric-mark .ui-icon, .agenda-mark .ui-icon, .empty-mark .ui-icon { width: 17px; height: 17px; }
.metric-attention .metric-mark, .agenda-task.is-overdue .agenda-mark { background: var(--danger-bg); color: var(--danger); }
.metric-attention strong { color: var(--danger); }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: stretch; margin-bottom: 16px; }
.overview-grid > .panel { margin: 0; padding: 17px 17px 14px; }
.overview-grid > :only-child { grid-column: 1 / -1; }
.overview-grid .panel-head { margin: 0 0 4px; }
.agenda-list { display: grid; align-content: start; }
.agenda-list .agenda-task { padding: 0; border-bottom: 1px solid var(--line); }
.overview-grid .agenda-task.is-overdue .agenda-link { background: transparent !important; }
.overview-grid .agenda-task.is-overdue .agenda-link:hover { background: var(--surface-raised) !important; }
.agenda-list .agenda-task:last-child { border-bottom: 0; }
.agenda-list .agenda-link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  min-height: 55px;
  padding: 7px 4px;
  border: 0;
  border-radius: 6px;
  color: var(--ink) !important;
}
.agenda-list .agenda-link:hover { background: var(--surface-raised); text-decoration: none; }
.agenda-list .agenda-link > .ui-icon { width: 15px; height: 15px; color: var(--muted); }
.agenda-copy strong { display: block; line-height: 1.6; font-size: .86rem; font-weight: 770; overflow-wrap: anywhere; }
.agenda-list .agenda-copy small { display: block; margin: 1px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.55; }
.state-label { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border-radius: 6px; background: var(--surface-raised); color: var(--muted); font-size: .74rem; font-weight: 700; line-height: 1.55; white-space: nowrap; }
.state-label i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.state-label:is(.state-active, .state-sold, .state-rented) { color: var(--success-text); background: var(--success-bg); }
.state-label:is(.state-warning, .state-following) { color: var(--warning-text); background: var(--warning-bg); }
.state-label:is(.state-error, .state-cancelled) { color: var(--danger); background: var(--danger-bg); }

.activity-period { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: .78rem; white-space: nowrap; }
.activity-period .ui-icon { width: 15px; height: 15px; }
.activity-legend { display: flex; align-items: center; gap: 5px 12px; flex-wrap: wrap; padding-top: 9px; color: var(--muted); font-size: .78rem; }
.activity-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.activity-legend b { color: var(--ink); font-size: .94rem; }
.activity-legend i { width: 8px; height: 8px; border-radius: 2px; }
.activity-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  --chart-height: 153px;
  background: repeating-linear-gradient(to top, var(--line) 0 1px, transparent 1px 25%) top / 100% var(--chart-height) no-repeat;
}
.activity-chart > li { min-width: 0; text-align: center; }
.activity-bars { height: var(--chart-height); display: flex; align-items: end; justify-content: center; gap: 4px; }
.activity-bars > span { width: min(30%, 15px); height: var(--value); border-radius: 3px 3px 0 0; }
.series-files { background: var(--series-files); }
.series-completed { background: var(--series-completed); }
.activity-day { display: block; padding-top: 4px; color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
.workspace-empty { display: grid; justify-items: center; align-content: center; gap: 7px; min-height: 136px; padding: 18px; text-align: center; color: var(--muted); }
.workspace-empty b { color: var(--ink); font-size: .89rem; }
.overview-recent > .panel-head { margin: 0; padding: 15px 17px; border: 0; }
body.workspace-body .overview-recent, body.workspace-body .listing-shell { padding: 0; }

/* File and contact lists. */
.listing-shell .listing-controls, .contact-toolbar { margin: 0; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.listing-shell .listing-controls .pro-search { margin: 0; }
.listing-shell .property-list-toolbar { padding: 9px 16px; margin: 0; }
.listing-shell .property-list-toolbar .list-actions { width: auto; }
.listing-shell :is(.table-scroll, .workspace-table) { border-radius: 0 0 13px 13px; }
:is(.listing-shell, .overview-recent) .table-scroll { border: 0; }
body.workspace-body .listing-shell .result-count { border: 0 !important; background: transparent !important; color: var(--muted) !important; font-size: .83rem; padding: 0; }
.property-list-toolbar .view-mode { flex-wrap: nowrap; }
.view-mode > a { display: grid; place-items: center; width: 35px; padding: 0; }
.view-mode .ui-icon { width: 17px; height: 17px; }
.contact-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.contact-toolbar .pro-search { flex: 1; max-width: 530px; margin: 0; }
.contact-toolbar .result-count { flex: none; }
.workspace-table { min-width: 660px; }
.property-table { min-width: 790px; }
.workspace-body .workspace-table :is(th, td) { padding: 10px 14px; font-size: .84rem !important; }
.workspace-body .workspace-table th { color: var(--muted) !important; border-top: 1px solid var(--line); }
.workspace-body .workspace-table tbody tr:last-child td { border-bottom: 0 !important; }
.workspace-body .workspace-table .price-cell { color: var(--ink); font-weight: 740; white-space: nowrap; font-variant-numeric: tabular-nums; }
.file-cell { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--ink) !important; }
.file-cell:hover .file-name strong { color: var(--link); text-decoration: underline; }
.file-thumb { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; overflow: hidden; border-radius: 8px; background: var(--surface-raised); color: var(--muted); }
.file-thumb > img { width: 100%; height: 100%; object-fit: cover; }
.file-thumb > .ui-icon { width: 18px; height: 18px; }
.file-name { min-width: 0; overflow-wrap: anywhere; }
.file-name strong { display: block; font-size: .88rem; line-height: 1.5; font-weight: 770; }
.file-name small { display: block; margin: 2px 0 0 !important; color: var(--muted); font-size: .74rem !important; }
.contact-avatar { width: 40px; height: 40px; font-weight: 780; font-size: .95rem; }
.full-search-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 7px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .86rem; }
.full-search-row:last-child { border-bottom: 0; }
.search-section .search-pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 11px; margin-top: 12px; }


/* Compact owner identity on internal property cards and file rows. */
.property-card .property-agent { flex-wrap: wrap; gap: 6px 10px; }
.property-card .property-agent .property-owner {
  display: inline-flex; align-items: baseline; gap: 5px; min-width: 0; max-width: 100%;
  padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface-raised); color: var(--muted); line-height: 1.5;
}
.property-card .property-agent .property-owner small {
  flex: 0 0 auto; color: var(--muted); font-size: 10px !important; font-weight: 600;
}
.property-card .property-agent .property-owner b {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink); font-size: 11px; font-weight: 750;
}
.file-name .file-owner { color: var(--ink); font-size: .72rem !important; font-weight: 650; }

/* Sign-in uses the same local photo and visual identity. */
body.sg-login-page { padding: 24px; min-height: 100dvh; }
.sg-login-page .sg-login-shell { min-height: 570px; width: min(1060px, 100%); grid-template-columns: minmax(0, .93fr) minmax(0, 1fr); box-shadow: 0 16px 42px #0f172a14 !important; }
.sg-login-page .sg-login-form-panel { min-width: 0; padding: 44px 34px; }
.sg-login-page .sg-login-form-wrap { width: min(100%, 355px); }
.sg-login-page .sg-login-brand {
  isolation: isolate;
  padding: 36px;
  background: #10203c !important;
  min-height: 100%;
}
.sg-login-page .sg-login-brand::before, .sg-login-page .sg-login-brand::after { display: none; }
.login-photo { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 69% center; }
.sg-login-brand .login-photo-overlay { position: absolute; z-index: -1; inset: 0; background: linear-gradient(0deg, #0b172eee 4%, #0b172e1a 57%, #0b172eaa 100%); }
.sg-login-page .sg-login-lockup, .sg-login-page .sg-login-mobile-brand { display: flex; align-items: center; gap: 10px; }
.sg-login-page .sg-login-mobile-brand { display: none; }
.sg-login-page .sg-login-lockup strong { color: #ffffff !important; font-size: 1.42rem; }
html .sg-login-page .sg-login-lockup small { color: #dce9ff !important; }
html .sg-login-page .sg-login-brand-copy h2 { margin: 0; color: #ffffff !important; font-size: 1.8rem; line-height: 1.5; font-weight: 800; }
html .sg-login-page .sg-login-brand-copy p { color: #e0ebff !important; font-size: .92rem; margin: 5px 0 0; }
.sg-login-page .sg-login-heading h1 { margin: 0; color: var(--ink) !important; font-size: 1.85rem; line-height: 1.5; }
.sg-login-page .sg-login-heading p { margin: 7px 0 0; font-size: .87rem !important; }
.sg-login-page .sg-login-field input { border-radius: 8px !important; }
.sg-login-page .sg-login-password input { padding-inline-end: 72px !important; }
.sg-login-page .sg-login-submit { min-height: 46px; border-radius: 8px !important; }
.sg-login-page .sg-login-submit:hover { background: var(--action-hover) !important; }
.sg-login-page .sg-login-help { text-align: start; }
.sg-login-page .guest-theme-control .theme-toggle { width: 42px; min-width: 42px; padding: 0; justify-content: center; }
.guest-brand .brand-mark img { width: 23px; height: 23px; }

@media (max-width: 1080px) and (min-width: 801px) {
  .workspace-body { --shell-sidebar: 204px; }
  .workspace-body .workspace-topbar:has(.topbar-search) { grid-template-columns: minmax(72px, 1fr) minmax(170px, 350px) auto; gap: 12px; }
  .workspace-body .topbar-agency-icon, .workspace-body .topbar-agency-logo { display: none; }
  .topbar-search-field kbd { display: none; }
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 800px) {
  .workspace-body { --shell-gutter: 16px; }
  .workspace-body :is(.workspace-content, .workspace-topbar) { margin-inline-start: 0; }
  .workspace-body .workspace-topbar { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; min-height: 61px; padding-block: 9px; }
  .workspace-topbar .mobile-brand { display: flex; align-items: center; gap: 6px; font-size: 1.19rem; }
  .workspace-topbar .mobile-brand .brand-mark { width: 31px; height: 31px; border-radius: 7px; background: var(--brand-mark-bg) !important; }
  .workspace-topbar .quick-create { display: block !important; }
  .workspace-topbar .mobile-brand img { width: 18px; height: 18px; }
  .workspace-topbar :is(.topbar-label, .topbar-agency-icon, .topbar-agency-logo), .topbar-search-field kbd { display: none; }
  .topbar-search { grid-column: 1 / -1; grid-row: 2; }
  .workspace-body .container.app-main { padding: 16px var(--shell-gutter) calc(var(--shell-nav) + 24px + env(safe-area-inset-bottom)) !important; }
  .workspace-body .workspace-sidebar {
    inset-block: 0 calc(var(--shell-nav) + env(safe-area-inset-bottom));
    width: min(292px, 84vw);
    transform: translateX(104%);
    visibility: hidden;
    z-index: 102;
    transition: transform .18s ease, visibility .18s;
  }
  .workspace-menu-open .workspace-sidebar { transform: translateX(0); visibility: visible; }
  .workspace-body.workspace-menu-open::after { content: none; }
  .workspace-menu-open .workspace-scrim { display: block; position: fixed; z-index: 95; inset: 0; background: #0d142366; }
  .workspace-body.workspace-menu-open { overflow: hidden; }
  .workspace-sidebar .sidebar-close { display: grid; }
  .workspace-sidebar .workspace-nav :is(a, .workspace-nav-locked) { min-height: 43px; }
  .workspace-body .bottom-nav {
    display: flex;
    z-index: 105;
    min-height: calc(var(--shell-nav) + env(safe-area-inset-bottom));
    padding: 5px 6px calc(5px + env(safe-area-inset-bottom));
  }
  .bottom-nav :is(a, button) { flex: 1; min-width: 0; min-height: 45px; gap: 2px; border-radius: 8px; }
  body.workspace-body .bottom-nav :is(a, button) { font-size: .72rem !important; }
  .bottom-nav :is(a[aria-current="page"], button[aria-expanded="true"]) { color: var(--link) !important; background: var(--brand-tint); }
  body.workspace-body :is(.page-head, .page-title, .dashboard-heading) h1 { font-size: 1.43rem !important; }
  .overview-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .overview-grid > .panel { padding: 14px; }
  .overview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
  .overview-metrics > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .overview-metric { padding: 8px 9px; }
  .overview-metric .metric-label { font-size: .76rem; line-height: 1.5; }
  .overview-metric strong { font-size: 1.57rem; line-height: 1.1; }
  .overview-metric small { font-size: .69rem; line-height: 1.6; }
  .overview-metric:last-child:nth-child(odd):not(:only-child) { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 0 8px; }
  .overview-metric:last-child:nth-child(odd):not(:only-child) .metric-mark { grid-area: 1 / 1 / 3 / 2; align-self: center; }
  .overview-metric:last-child:nth-child(odd):not(:only-child) .metric-label { grid-column: 2; }
  .overview-metric:last-child:nth-child(odd):not(:only-child) small { grid-column: 2; grid-row: 2; }
  .overview-metric:last-child:nth-child(odd):not(:only-child) strong { grid-area: 1 / 3 / 3 / 4; align-self: center; }
  .dashboard-welcome { min-height: 155px; margin-bottom: 12px; }
  .welcome-copy { padding: 14px 16px; width: 87%; }
  body.workspace-body .welcome-copy h2 { font-size: 1.4rem !important; }
  .welcome-copy p { font-size: .85rem; }
  .dashboard-welcome::before { background: linear-gradient(270deg, #10203c 14%, #10203ced 47%, #10203c45 100%); }
  .dashboard-welcome .welcome-photo { width: 77%; }
  .welcome-actions { margin-top: 8px; }
  .welcome-actions :is(a, button) { font-size: .78rem; }
  .workspace-body .workspace-table :is(th, td) { padding-inline: 9px; }
  .workspace-table :is(th, td):first-child { position: sticky; inset-inline-start: 0; z-index: 1; min-width: 160px; max-width: 215px; background: var(--surface); box-shadow: -1px 0 var(--line); }
  .workspace-body .table-scroll:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
  .sg-login-page .sg-login-shell { grid-template-columns: minmax(0, 1fr); max-width: 480px; min-height: 0; }
  .sg-login-page .sg-login-mobile-brand { display: flex; margin: 0 0 20px; }
  .sg-login-page .sg-login-form-panel { min-height: 0; padding: 31px 23px; }
}

@media (max-width: 480px) {
  .workspace-body { --shell-gutter: 12px; }
  body.workspace-body .topbar-search-field input[type="search"] { font-size: 16px !important; }
  .topbar-search-field input::placeholder { font-size: .81rem; }
  .workspace-topbar .quick-create > button { padding-inline: 9px !important; }
  .workspace-body .agenda-list .agenda-link { grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px; }
  .agenda-list .agenda-link > .ui-icon { display: none; }
  .agenda-mark { width: 29px; height: 29px; }
  .agenda-list .agenda-copy small { font-size: .71rem; }
  .state-label { padding-inline: 5px; font-size: .69rem; }
  .contact-toolbar, .listing-shell .listing-controls { padding: 10px; }
  .listing-shell .property-list-toolbar { padding-inline: 10px; }
  .property-list-toolbar .list-actions { gap: 4px; }
  .property-list-toolbar .btn-sm { padding-inline: 7px !important; }
  .property-list-toolbar .btn-sm > .ui-icon { display: none; }
  .contact-toolbar { flex-wrap: wrap; }
  .contact-toolbar .pro-search { flex-basis: 100%; }
  .welcome-actions { column-gap: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .workspace-body .workspace-sidebar, .overview-metric { transition: none; }
}

@media print {
  .workspace-scrim, .workspace-body .workspace-topbar, .workspace-body .bottom-nav, .workspace-body .workspace-sidebar { display: none !important; }
  .workspace-body .workspace-content { margin: 0; }
}

.brand-mark-original { overflow: hidden; }
.brand-mark-original img, .guest-brand .brand-mark-original img { width: 100%; height: 100%; object-fit: cover; }
.sg-login-submit > .ui-icon { width: 18px; height: 18px; vertical-align: middle; margin-inline-start: 4px; }

/* Shared illustrations occupy the existing photo slot. */
.property-placeholder { position: relative; display: block; width: 100%; height: 100%; overflow: hidden; }
.property-placeholder-image { object-fit: cover; object-position: 88% center !important; }
.property-placeholder > img { display: block; width: 100%; height: 100%; }
.property-placeholder-label { position: absolute; inset: auto auto 8px 8px; padding: 2px 7px; border-radius: 5px; background: #10203c; color: #f3f7ff; font-size: .72rem; font-weight: 650; line-height: 1.65; }
.detail-media .property-placeholder-label { inset: 12px auto auto 12px; z-index: 2; }

/* Property form controls stay beside the workflow title. */
.workspace-body .entry-workflow { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; }
.workspace-body .entry-workflow > div { flex: 1 1 240px; }
.workspace-body .entry-workflow .sb18-expand-all { flex: 0 0 auto; margin: 0; min-height: 41px; }
.workspace-body .entry-workflow .sb18-expand-all[hidden], .partnership-section.sb18-collapsed { display: none !important; }

/* Suggested properties and visit status. */
body.workspace-body .match-section {
  padding: clamp(12px, 2vw, 23px);
  border: 1px solid var(--line) !important;
  border-radius: 14px !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
  box-shadow: var(--shadow) !important;
}
.match-section .match-strip { grid-auto-columns: minmax(0, min(100%, 345px)); }
body.workspace-body .match-section :is(.result-count, .empty) {
  background: var(--surface-raised) !important;
  border-color: var(--line) !important;
  color: var(--ink) !important;
}
body.workspace-body .match-section .match-card { overflow: hidden; }
body.workspace-body .match-section .match-media { background: var(--surface-raised) !important; }
body.workspace-body .match-section .match-score { background: #152b4c !important; color: #f2f7ff !important; border: 1px solid #a2bbdd; }
body.workspace-body .match-section .match-body { color: var(--ink) !important; background: var(--surface) !important; box-shadow: none !important; }
body.workspace-body .match-section .match-body h3 a { color: var(--ink) !important; }
body.workspace-body .match-section :is(.match-body p, .visit-state > span, .match-history summary) { color: var(--muted) !important; }
body.workspace-body .match-section .match-meta > span { color: var(--ink) !important; background: var(--surface-raised) !important; border-color: var(--line) !important; }
body.workspace-body .match-section .match-meta { border-color: var(--line) !important; }
body.workspace-body .match-section :is(.visit-state, .match-history) { background: var(--surface-raised) !important; border-color: var(--line) !important; color: var(--ink) !important; }
body.workspace-body .match-section .history-list a { background: var(--surface) !important; border-color: var(--line) !important; color: var(--ink) !important; }
body.workspace-body .match-section .history-list b { color: var(--link) !important; }
body.workspace-body .match-section .visit-btn {
  display: inline-grid; place-items: center; min-width: 36px; min-height: 36px; padding: 4px;
  background: var(--surface) !important; color: var(--ink) !important; border: 1px solid var(--control-border) !important; border-radius: 8px;
}
body.workspace-body .match-section .visit-btn.active { background: var(--brand-tint) !important; color: var(--link) !important; border-color: var(--focus) !important; }
body.workspace-body .match-section .visit-btn.yes.active { background: var(--success-bg) !important; color: var(--success-text) !important; border-color: var(--success-border) !important; }
body.workspace-body .match-section .visit-btn.no.active { background: var(--danger-bg) !important; color: var(--danger) !important; border-color: var(--danger-border) !important; }
.match-section .visit-btn .ui-icon { width: 17px; height: 17px; }

/* Partnership files use the same contrast and spacing as other working pages. */
.partnership-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(135px, 205px) auto auto; align-items: center; gap: 9px; padding: 12px; }
.partnership-filters .form-input { min-width: 0; }
.partnership-list-heading > span, .partnership-card-meta > :not(.state-label) { color: var(--muted); font-size: .82rem; }
.partnership-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 14px; }
.partnership-grid > .workspace-empty { grid-column: 1 / -1; }
.partnership-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.partnership-cover { display: block; aspect-ratio: 2.25; overflow: hidden; background: var(--surface-raised); }
.partnership-cover > img, .part-project-photo > img { width: 100%; height: 100%; object-fit: cover; }
.partnership-card-body { display: grid; gap: 7px; padding: 13px; }
.partnership-card-body h3, .partnership-card-body p { margin: 0; overflow-wrap: anywhere; }
body.workspace-body .partnership-card-body h3 a { color: var(--ink) !important; }
.partnership-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 7px; min-width: 0; }
.partnership-card-meta bdi { overflow-wrap: anywhere; }
.partnership-stage { color: var(--muted); font-size: .78rem; }
.partnership-card .part-muted { color: var(--muted) !important; font-size: .85rem; }
.state-label:is(.part-state-open, .part-state-agreed, .part-state-contracted) { background: var(--success-bg); color: var(--success-text); }
.state-label:is(.part-state-negotiating, .part-state-on_hold) { background: var(--warning-bg); color: var(--warning-text); }
body.workspace-body :is(.partnership-card, .part-detail-panel) .part-ratio { height: 8px; margin: 3px 0; background: var(--brand-tint) !important; border: 0; }
body.workspace-body :is(.partnership-card, .part-detail-panel) .part-ratio-owner { background: var(--action-bg) !important; }
body.workspace-body :is(.part-ratio-legend, .part-ratio-legend b, .part-large-ratio strong, .part-finance-row strong, .part-data-grid b) { color: var(--ink) !important; }
body.workspace-body :is(.part-ratio-legend span, .part-muted, .part-large-ratio small, .part-data-grid small, .part-finance-row span, .part-notes p) { color: var(--muted) !important; }
.partnership-card .part-ratio-legend { font-size: .82rem; }
.partnership-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin: 2px 0; }
.partnership-facts > div, body.workspace-body :is(.part-data-grid, .part-notes, .part-large-ratio) > div { background: var(--surface-raised) !important; border: 1px solid var(--line) !important; border-radius: 8px; padding: 8px; }
.partnership-facts > div:last-child { grid-column: 1 / -1; }
.partnership-facts dt { color: var(--muted); font-size: .74rem; }
.partnership-facts dd { margin: 2px 0 0; color: var(--ink); font-size: .85rem; font-weight: 730; overflow-wrap: anywhere; }
.partnership-card-body > .text-link { min-height: 38px; align-self: start; justify-self: start; }
.part-project-photo { height: clamp(170px, 24vw, 305px); margin: 0 0 16px; border-radius: 14px; overflow: hidden; background: var(--surface-raised); }
body.workspace-body .part-detail-panel :is(.part-status, .part-phone) { background: var(--brand-tint) !important; color: var(--link) !important; border-color: var(--line) !important; }
body.workspace-body .part-detail-panel :is(.part-finance-row, header) { border-color: var(--line) !important; }
body.workspace-body .part-detail-panel header > .section-kicker { display: none !important; }

.partnership-form { display: grid; gap: 12px; }
.partnership-form > .entry-workflow { margin: 0; border: 1px solid var(--line); }
body.workspace-body :is(.partnership-section, .partnership-footer) { padding: 16px; margin: 0; border: 1px solid var(--line); border-radius: 13px; background: var(--surface) !important; color: var(--ink) !important; }
.partnership-section-head { padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
body.workspace-body .partnership-section-head h2 { font-size: 1.06rem !important; margin: 0; }
.partnership-section-head p, .partnership-footer p { margin: 2px 0 0; color: var(--muted); font-size: .82rem; }
body.workspace-body .partnership-field label { color: var(--ink) !important; }
.partnership-field :is(textarea, input, select) { min-width: 0; }
.partnership-field-check { background: var(--surface-raised) !important; border-color: var(--line) !important; }
.partnership-field input[type="file"] { border: 1px dashed var(--control-border) !important; background: var(--surface-raised) !important; color: var(--ink) !important; }
.partnership-field input[type="file"]::file-selector-button { background: var(--brand-tint); color: var(--link); border: 1px solid var(--line); padding: 4px 7px; border-radius: 6px; font: inherit; }

@media (max-width: 660px) {
  .partnership-filters { grid-template-columns: minmax(0, 1fr) auto; }
  .partnership-filters input { grid-column: 1 / -1; }
  .partnership-filters :is(button, a) { white-space: nowrap; }
  .part-project-photo { height: 175px; }
}
