/* Presentation only. Keep the existing column content, responsive facts,
   action targets and dialog styles in their original owners. */
@font-face {
  font-family: 'Desk Contact Symbols';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url('./fonts/symbols-contact.woff2') format('woff2');
}
.brand-symbol > img { display: block; width: 100%; height: 100%; }
.startup-content { display: grid; justify-items: center; gap: 12px; }
:root {
  --desk-selection-border: #7186a2;
  --desk-control-border: #7c8a9c;
}
@media (min-width: 761px) {
  .app-shell { grid-template-rows: 64px minmax(0, 1fr) 52px; }
  .app-shell > main { padding: 12px; }
  .app-shell > .topbar { gap: 16px; padding-right: 12px; }
  .topbar .brand-symbol { width: 36px; height: 36px; border-radius: 10px; }
  .topbar .count { padding: 3px 7px; }
  .app-shell > .sidebar { padding: 10px 12px; }
  .sidebar .nav-group + .nav-group { margin-top: 8px; padding-top: 8px; }
  .sidebar .nav-heading { margin-bottom: 4px; }
  .sidebar:has(.sidebar-help) .nav { margin-bottom: 8px; }
  .sidebar .sidebar-caption { padding-top: 8px; }
  .app-shell > .app-footer { padding-right: 12px; padding-left: calc(var(--sidebar-width) + 12px); }
}

.app-shell .workspace { border-radius: 10px; }
.workspace .toolbar { padding: 8px 10px; gap: 8px; }
.workspace .active-listing-filters { padding: 4px 10px; gap: 8px; }
.workspace .work-views { min-height: 44px; padding: 4px 10px; gap: 6px; align-items: center; }
.has-row-actions .row-actions { box-shadow: none; }

/* Distinct work areas with consistent surface and selection treatments. */
.app-shell {
  --desk-work-surface: #fff;
  --desk-work-frame: #f3f5f8;
  --desk-work-border: #cbd4df;
  --desk-work-muted: #f1f4f8;
  --desk-work-header: #e5ebf2;
  --desk-pending-ink: #744b00;
  --desk-pending-surface: #fff0d9;
}
.app-shell > main { background: var(--desk-work-frame); }
.app-shell > .sidebar { background: #e8edf3; border-color: var(--desk-work-border); }
.sidebar .nav-heading { color: #465568; }
.sidebar .nav-group + .nav-group { border-color: var(--desk-work-border); }
.sidebar .nav button:hover { background: #dce4ee; }
.sidebar .nav button.active {
  background: #d3e2f7;
  box-shadow: inset 0 0 0 1px var(--desk-selection-border);
}
.sidebar .nav button:focus-visible { outline-offset: -3px; }
.app-shell > :is(.topbar, .app-footer) {
  background: var(--desk-work-frame);
  border-color: var(--desk-work-border);
}
.app-shell .workspace { background: var(--desk-work-surface); border-color: var(--desk-work-border); }
.workspace .toolbar { background: var(--desk-work-muted); border-color: var(--desk-work-border); }
.workspace .toolbar :is(input, select):not(:disabled) {
  background: var(--desk-work-surface);
  border-color: var(--desk-control-border);
}
.workspace .toolbar :is(input, select):not(:disabled):hover { border-color: var(--md-on-surface-variant); }
.workspace .toolbar :is(input, select):not(:disabled):focus {
  border-color: var(--md-primary);
  outline: 3px solid var(--md-primary);
  outline-offset: -1px;
}
.workspace .search-label-line { display: flex; align-items: baseline; gap: 10px; min-width: 0; line-height: 18px; }
.workspace .search-label-line > .control-label { flex-shrink: 0; }
.workspace .search-hint {
  overflow: hidden;
  color: var(--md-on-surface-variant);
  font-size: var(--desk-text-secondary);
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workspace .active-listing-filters { background: var(--desk-work-muted); }
.workspace .work-views { background: var(--desk-work-surface); border-color: var(--desk-work-border); }
.workspace .work-views button {
  min-height: 34px;
  padding: 4px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--md-on-surface-variant);
  font-size: var(--desk-text-body);
  font-weight: 500;
  box-shadow: none;
}
.workspace .work-views button:hover { background: #edf2f8; }
.workspace .work-views button:focus-visible { outline-offset: 2px; }
.workspace .work-views button[aria-pressed=true] {
  background: var(--md-secondary-container);
  color: var(--md-on-secondary-container);
  border-color: var(--desk-selection-border);
  font-weight: 600;
}
.workspace .work-view-count {
  background: #edf1f6;
  color: #465568;
  font-weight: 400;
}
.workspace .work-views button[aria-pressed=true] .work-view-count {
  background: rgb(42 69 103 / 8%);
  color: inherit;
}
.workspace.is-inquiries .work-views button.has-pending .work-view-count {
  background: var(--desk-pending-surface);
  color: var(--desk-pending-ink);
}

/* Repeat the same visible selection in detail tabs and existing choices.
   Styling follows current ARIA/checked states; it never changes selection. */
.detail-nav > div { gap: 8px; padding-block: 4px; }
.detail-nav button {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
}
.detail-nav button[aria-selected=true] {
  background: var(--md-secondary-container);
  border-color: var(--desk-selection-border);
  color: var(--md-on-secondary-container);
  font-weight: 600;
}
.detail-nav button[aria-selected=true]::after { content: none; }
.calls-switch { border-color: var(--desk-selection-border); }
.calls-switch button[aria-pressed=true] { font-weight: 600; }
.filter-menu-row.is-set {
  background: var(--md-secondary-container);
  border-color: var(--desk-selection-border);
}
.filter-choice:has(input:checked),
.agent-picker-option[aria-pressed=true] {
  box-shadow: inset 0 0 0 1px var(--desk-selection-border);
}
.contact-choice:has(input:checked),
.checks label:has(input:checked) { border-color: var(--desk-selection-border); }
.filter-choice:has(input:focus-visible),
.contact-choice:has(input:focus-visible),
.checks label:has(input:focus-visible) {
  outline: 3px solid var(--md-primary);
  outline-offset: -3px;
}
.table-wrap, .form-scroll, .filter-drawer-body,
.calls-table-wrap, .audit-results, .activity-results, .daily-chart-scroll {
  scrollbar-width: auto;
  scrollbar-color: #718096 #eef1f5;
}
#data-table > thead > tr > th {
  background: var(--desk-work-header);
  border-bottom-color: var(--desk-work-border);
  color: #344256;
  font-weight: 600;
}
#data-table > tbody > tr > td { background-color: var(--desk-work-surface); }
#data-table.table-inquiries > :is(thead, tbody) > tr > :nth-child(7),
#data-table.table-offers > :is(thead, tbody) > tr > :nth-child(5) {
  border-left: 1px solid var(--desk-work-border);
}
#data-table .inquiry-forwarding.is-pending small {
  justify-self: start;
  border-radius: 3px;
  background: var(--desk-pending-surface);
  outline: 3px solid var(--desk-pending-surface);
  color: var(--desk-pending-ink);
  font-weight: 600;
}
#data-table > tbody > tr.selected > td { background-color: #e1ebfa; }
@media (hover: hover) {
  #data-table > tbody > tr:hover > td { background-color: #edf3fa; }
  #data-table > tbody > tr.selected:hover > td { background-color: #d8e6f8; }
}

/* The adjacent Kontakt and Javljanje cells form a single visual
   group. Decoration never intercepts clicks or changes table geometry. */
#data-table.table-inquiries {
  min-width: 1510px;
  --inquiry-group-tip: 16px;
}
#data-table.table-inquiries, .inquiry-contact-summary, .history-person {
  --inquiry-person-accent: var(--md-primary);
  --inquiry-person-surface: color-mix(in srgb, var(--inquiry-person-accent) 9%, var(--md-surface));
}
#data-table.table-inquiries .col-contact { width: 224px; }
#data-table .desk-inquiry-contact { position: relative; min-height: 48px; padding-left: 54px; }
#data-table .inquiry-person-link { color: var(--md-primary); }
#data-table .inquiry-person-link strong { font-size: 15px; line-height: 1.4; font-weight: 600; }
#data-table .inquiry-person-avatar {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
}
:where(#data-table, .inquiry-contact-summary, .history-person) .inquiry-person-avatar {
  display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 50%; background: color-mix(in srgb, var(--inquiry-person-accent) 14%, var(--md-surface));
  color: var(--inquiry-person-accent);
}
:where(#data-table, .inquiry-contact-summary, .history-person) .inquiry-person-avatar > .material-symbols-rounded { font-size: 28px; }
:where(#data-table, .inquiry-contact-summary, .history-person) .inquiry-person-avatar .material-symbols-rounded {
  font-family: 'Desk Contact Symbols';
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
:where(#data-table, .inquiry-contact-summary, .history-person) .inquiry-person-role {
  position: absolute; right: -2px; bottom: -2px; display: grid; place-items: center;
  width: 24px; height: 24px; border: 2px solid var(--md-surface); border-radius: 50%;
  color: var(--md-on-primary); background: var(--inquiry-person-accent);
}
:where(#data-table, .inquiry-contact-summary, .history-person) .inquiry-person-role .material-symbols-rounded { font-size: 14px; }
#data-table .inquiry-person-link:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.app-shell:has(.nav [data-module="tenants"].active) #data-table.table-inquiries,
.inquiry-contact-summary[data-module="tenants"], .history-person[data-module="tenants"] {
  --inquiry-person-accent: #246776;
}
#data-table.table-inquiries > tbody > tr > :is(td:nth-child(2), td:nth-child(3)) {
  position: relative;
}
#data-table.table-inquiries > tbody > tr > td:nth-child(3) {
  background-image: linear-gradient(var(--inquiry-person-surface), var(--inquiry-person-surface));
  background-size: 100% calc(100% - 8px);
  background-position: center;
  background-repeat: no-repeat;
}
#data-table.table-inquiries > tbody > tr > td:nth-child(2) {
  isolation: isolate;
}
#data-table.table-inquiries > tbody > tr > td:nth-child(2)::after {
  content: "";
  position: absolute;
  inset-block: 4px;
  inset-inline: 4px 0;
  border-start-start-radius: 6px;
  border-end-start-radius: 6px;
  background: var(--inquiry-person-surface);
  z-index: -1;
  pointer-events: none;
}
#data-table.table-inquiries > tbody > tr > td:nth-child(3)::after {
  content: "";
  position: absolute;
  inset-block: 4px;
  left: 100%;
  width: var(--inquiry-group-tip);
  background: var(--inquiry-person-surface);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 64' preserveAspectRatio='none'%3E%3Cpath d='M0 0C2.5 0 4 1.2 5.2 3.2L20.5 28.8Q22.5 32 20.5 35.2L5.2 60.8C4 62.8 2.5 64 0 64Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  pointer-events: none;
}
#data-table.table-inquiries > :is(thead, tbody) > tr > :is(th, td):nth-child(4) {
  padding-left: calc(var(--inquiry-group-tip) + 10px);
}

/* Mouse workspaces gain density through spacing, not smaller reading text.
   Touch controls and all editing dialogs retain their existing sizes. */
@media (pointer: fine) {
  .topbar :is(.header-workspace > button, .account > button) { min-height: 40px; }
  .sidebar .nav button { min-height: 40px; margin-top: 2px; }
  .sidebar .sidebar-help { min-height: 40px; }
  .workspace .toolbar { padding-block: 4px; }
  .workspace .toolbar label { gap: 2px; }
  .workspace .toolbar :is(input, select) { min-height: 36px; height: 36px; padding-block: 6px; }
  .workspace .search-input > .material-symbols-rounded { top: 7px; }
  .workspace .toolbar :is(.filter-toggle, .refresh) { min-height: 36px; height: 36px; }
  .workspace .refresh { margin-bottom: 0; }
  .workspace .active-listing-filters :is(.filter-chip, button) { min-height: 28px; }
  #data-table > thead > tr > th { height: 36px; padding: 8px 10px; }
  #data-table > tbody > tr > td { height: auto; padding: 8px 10px; }
  #data-table.table-inquiries > :is(thead, tbody) > tr > :is(th, td):nth-child(4) {
    padding-left: calc(var(--inquiry-group-tip) + 10px);
  }
  #data-table .offer-actions { gap: 3px; }
  #data-table .offer-actions > :is(.row-action, .tonal) { min-height: 34px; padding: 4px 10px; }
  #data-table .offer-actions :is(.text-button, .external-link) { min-height: 26px; }
  #data-table .contact-phone { margin-top: 2px; }
  #data-table .contact-financing { margin-top: 4px; padding-block: 1px; }
  #data-table .inquiry-entry-origin { margin-top: 2px; }
  #data-table .offer-meta { margin-bottom: 2px; }
  #data-table .offer-facts dt { margin-bottom: 2px; }
  #data-table .offer-inline-facts { gap: 3px 6px; }
  .app-footer .page-controls button { min-height: 36px; height: 36px; }
  .app-footer #page-number { min-height: 36px; height: 36px; padding-block: 4px; }

  /* Surrounding controls on secondary pages use the same spacing. */
  .app-shell :is(.calls-toolbar, .activity-filters, .audit-filters) { padding: 8px 12px; gap: 8px; }
  .app-shell :is(.calls-toolbar, .activity-filters, .audit-filters, .report-filters) label { gap: 2px; }
  .app-shell :is(.calls-toolbar, .activity-filters, .audit-filters, .report-filters) :is(input, select, button) { min-height: 36px; padding-block: 6px; }
  .app-shell .activity-heading { padding: 10px 12px; }
  .app-shell .activity-summary { padding: 0 12px 8px; gap: 8px; }
  .app-shell .activity-summary > div { padding: 8px 12px; }
  .app-shell :is(.audit-help, .activity-help) { padding: 8px 12px; }
}

@media (min-width: 1721px) and (pointer: fine) {
  #data-table .offer-thumb { flex-basis: 76px; width: 76px; height: 57px; }
}

@media (max-width: 1720px) {
  #data-table.table-inquiries { min-width: 1350px; }
}

@media (min-width: 761px) and (max-width: 1100px) {
  .app-shell > .app-footer { padding-left: 12px; }
}

/* Shared detail presentation; listing gallery geometry and actions stay intact. */
:is(.listing-dialog, .inquiry-dialog, .property-summary) {
  --listing-detail-line: #d1dae6;
  --listing-detail-soft: #f1f5fa;
}
.listing-dialog [data-listing-panel="overview"] > .form-section,
.listing-dialog [data-listing-panel="work"] > .form-section {
  border-bottom-color: var(--listing-detail-line);
}
.listing-dialog [data-listing-panel="overview"] .section-title,
.inquiry-dialog .section-title {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--listing-detail-line);
  color: #344256;
  font-size: 17px;
  font-weight: 600;
}
:is(.listing-dialog, .property-summary) .overview-eyebrow { color: var(--md-on-surface-variant); }
:is(.listing-dialog, .property-summary) .overview-price-row { margin-bottom: 16px; }
:is(.listing-dialog, .property-summary) .overview-identity > .offer-facts {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 12px 0;
  border: 1px solid var(--listing-detail-line);
  border-radius: 10px;
  background: var(--listing-detail-soft);
}
:is(.listing-dialog, .property-summary) .overview-identity > .offer-facts > div { padding: 0 12px; }
:is(.listing-dialog, .property-summary) .overview-identity > .offer-facts > div + div {
  border-left: 1px solid var(--listing-detail-line);
}
:is(.listing-dialog, .property-summary) .overview-identity > .offer-facts dt {
  margin-bottom: 6px;
  font-size: 14px;
}
:is(.listing-dialog, .property-summary) .overview-identity > .offer-facts dd { font-weight: 600; }
:is(.listing-dialog, .property-summary) .overview-identity > .offer-facts :is(dt, dd) {
  white-space: normal;
  overflow-wrap: anywhere;
}
:is(.listing-dialog, .inquiry-dialog) .listing-contacts { gap: 12px; padding: 16px 0; }
:is(.listing-dialog, .inquiry-dialog) .listing-contacts .listing-agent {
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--listing-detail-line);
  border-radius: 10px;
  background: var(--listing-detail-soft);
}
:is(.listing-dialog, .inquiry-dialog) .listing-contacts .account-avatar {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
}
:is(.listing-dialog, .inquiry-dialog) .listing-contacts .listing-agent > div { flex: 1; }
:is(.listing-dialog, .inquiry-dialog) .listing-contacts .listing-agent strong { font-weight: 600; }
:is(.listing-dialog, .inquiry-dialog) .listing-contacts .contact-phone {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 500;
  white-space: normal;
  overflow-wrap: anywhere;
}
:is(.listing-dialog, .inquiry-dialog) .listing-contacts .agent-email {
  color: var(--md-on-surface-variant);
  line-height: 1.45;
}
:is(.listing-dialog, .property-summary) .overview-identity > .meta-list { margin: 0 0 6px; }
:is(.listing-dialog, .property-summary) .overview-identity > [data-show-work] { font-size: 14px; }
.listing-dialog .owner-details { align-items: start; }
.listing-dialog .owner-details > div:first-child > strong:first-of-type {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin-top: 6px;
}
.listing-dialog .owner-phones { align-items: start; }
.listing-dialog .owner-phone {
  background: #e9eef5;
  border-color: var(--listing-detail-line);
  font-weight: 600;
  cursor: text;
}
.listing-dialog .owner-phone:placeholder-shown { font-weight: 400; }
.listing-dialog .owner-phone:focus {
  border-color: var(--md-primary);
  outline: 3px solid var(--md-primary);
  outline-offset: -1px;
}
.listing-dialog [data-listing-panel="overview"] .property-grid:not(.property-grid-essential) {
  gap: 16px 24px;
}
.listing-dialog [data-listing-panel="overview"] .property-grid:not(.property-grid-essential) > div {
  padding: 12px 14px;
  border-radius: 6px;
  background: var(--listing-detail-soft);
}
.listing-dialog [data-listing-panel="overview"] .property-grid dd:not(.property-missing) {
  font-size: 16px;
  font-weight: 600;
}
.listing-dialog .property-grid-essential { column-gap: 24px; }
.listing-dialog .property-grid-essential > div {
  grid-template-columns: minmax(140px, .85fr) minmax(0, 1.15fr);
  gap: 12px;
  padding: 12px 14px;
  border-bottom-color: var(--listing-detail-line);
}
.listing-dialog .property-grid-essential > :is(:nth-child(4n + 1), :nth-child(4n + 2)) {
  background: var(--listing-detail-soft);
}
.listing-dialog .description { max-width: 80ch; }
.listing-dialog [data-listing-panel="work"] > .form-section > .work-checks {
  max-width: none;
  gap: 12px;
}
.listing-dialog [data-listing-panel="work"] .work-checks[role="group"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: none;
  gap: 12px;
}
.listing-dialog [data-listing-panel="work"] .work-check { padding: 16px; }
.listing-dialog [data-listing-panel="work"] .work-check > span { min-width: 0; }
.listing-dialog [data-listing-panel="work"] .work-check strong { font-weight: 600; }
.listing-dialog [data-listing-panel="work"] .work-check:has(input:focus-visible) {
  outline: 3px solid var(--md-primary);
  outline-offset: -3px;
}
.listing-dialog .contract-dates > .property-grid {
  gap: 0;
  margin: 0;
  padding: 16px 0;
  border: 1px solid var(--listing-detail-line);
  border-radius: 10px;
  background: var(--listing-detail-soft);
}
.listing-dialog .contract-dates > .property-grid > div { padding: 0 16px; }
.listing-dialog .contract-dates > .property-grid > div + div {
  border-left: 1px solid var(--listing-detail-line);
}
.listing-dialog .contract-dates > .property-grid dd { font-size: 16px; font-weight: 600; }
.listing-dialog .contract-dates .entry-author { font-weight: 400; }
.listing-dialog [data-listing-panel="inquiries"] .picker-row {
  margin-bottom: 8px;
  border: 1px solid var(--listing-detail-line);
  border-radius: 8px;
  background: var(--listing-detail-soft);
}
.listing-dialog [data-listing-panel="inquiries"] .picker-row:hover {
  border-color: var(--desk-selection-border);
  background: var(--md-secondary-container);
}
.listing-dialog [data-listing-panel="inquiries"] .picker-row strong {
  font-size: 16px;
  font-weight: 600;
}
@media (max-width: 760px) {
  .listing-dialog [data-listing-panel="work"] .work-checks[role="group"] {
    grid-template-columns: 1fr;
  }
  .listing-dialog .property-grid-essential > :is(:nth-child(4n + 1), :nth-child(4n + 2)) {
    background: transparent;
  }
  .listing-dialog .property-grid-essential > :nth-child(odd) { background: var(--listing-detail-soft); }
  .listing-dialog .contract-dates > .property-grid { grid-template-columns: 1fr; gap: 16px; }
  .listing-dialog .contract-dates > .property-grid > div + div {
    padding-top: 16px;
    border-left: 0;
    border-top: 1px solid var(--listing-detail-line);
  }
}
@media (max-width: 480px) {
  :is(.listing-dialog, .property-summary) .overview-identity > .offer-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 16px; }
  :is(.listing-dialog, .property-summary) .overview-identity > .offer-facts > div:nth-child(3) { border-left: 0; }
  .listing-dialog .property-grid-essential > div { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
