/*
 * Theo Properties — RC1.0.15.129.32
 * Global Premium Design System, Cards, Forms, CTA & Typography Lock
 * PRESENTATION-ONLY AUTHORITY
 * No routing, data, workflow, Supabase or JavaScript behaviour is defined here.
 */

:root{
  --theo-ui-font:"Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --theo-ui-display:"Inter Tight","Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;

  --theo-ui-navy-950:#0b1f2d;
  --theo-ui-navy-900:#102b3b;
  --theo-ui-navy-800:#16394d;
  --theo-ui-navy-700:#245168;
  --theo-ui-gold-700:#8f642d;
  --theo-ui-gold-600:#a97838;
  --theo-ui-gold-500:#bd8d49;
  --theo-ui-teal-700:#236b62;
  --theo-ui-green-700:#2f6d4e;
  --theo-ui-amber-700:#8c641f;
  --theo-ui-red-700:#a23b3b;
  --theo-ui-violet-700:#645b8a;

  --theo-ui-text:#172735;
  --theo-ui-text-strong:#0f2432;
  --theo-ui-muted:#526675;
  --theo-ui-muted-2:#60717d;
  --theo-ui-line:#dce3e8;
  --theo-ui-line-strong:#c9d3db;
  --theo-ui-surface:#ffffff;
  --theo-ui-surface-soft:#f7f9fa;
  --theo-ui-surface-muted:#f1f4f6;
  --theo-ui-page:#f2f5f6;

  --theo-ui-card-radius:8px;
  --theo-ui-form-radius:3px;
  --theo-ui-button-radius:0px;
  --theo-ui-status-radius:0px;
  --theo-ui-modal-radius:14px;

  --theo-ui-shadow-card:0 1px 2px rgba(15,36,50,.04),0 10px 30px rgba(15,36,50,.055);
  --theo-ui-shadow-hover:0 2px 5px rgba(15,36,50,.06),0 14px 34px rgba(15,36,50,.075);
  --theo-ui-shadow-modal:0 24px 70px rgba(15,36,50,.18);
  --theo-ui-focus:0 0 0 3px rgba(36,81,104,.16);

  --theo-ui-space-1:4px;
  --theo-ui-space-2:8px;
  --theo-ui-space-3:12px;
  --theo-ui-space-4:16px;
  --theo-ui-space-5:20px;
  --theo-ui-space-6:24px;
  --theo-ui-space-7:28px;
  --theo-ui-space-8:32px;
}

/* ---------- Typography authority ---------- */
html{font-size:16px;}
body,
button,
input,
select,
textarea{
  font-family:var(--theo-ui-font)!important;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
body{
  color:var(--theo-ui-text)!important;
  font-size:15px!important;
  line-height:1.5!important;
}

h1,h2,h3,h4,h5,h6,
.page-title,.workspace-title,.section-title,.panel-title,.card-title{
  font-family:var(--theo-ui-display)!important;
  color:var(--theo-ui-text-strong)!important;
  letter-spacing:-.018em!important;
  text-wrap:balance;
}
h1{font-size:clamp(30px,2.5vw,42px)!important;line-height:1.08!important;font-weight:700!important;}
h2{font-size:clamp(21px,1.7vw,25px)!important;line-height:1.18!important;font-weight:700!important;}
h3{font-size:18px!important;line-height:1.25!important;font-weight:650!important;}
h4{font-size:16px!important;line-height:1.3!important;font-weight:650!important;}
p,li,td,th,label,input,select,textarea,button,a{font-size:inherit;}
small,.small,.helper,.hint,.form-hint,.field-help,.field-note,.cell-sub{font-size:12.5px!important;line-height:1.45!important;}
.eyebrow,.kicker,.section-kicker,.page-kicker,.overline{
  font-size:11px!important;
  line-height:1.25!important;
  font-weight:700!important;
  letter-spacing:.075em!important;
  text-transform:uppercase!important;
}

/* ---------- Premium surface system ---------- */
:where(
  .card,.panel,.kpi,.table-card,.content-card,.insight-card,
  .notification-compose-card,.notification-inbox-card,.admin-config-card,
  .owner-plan-card,.mandate-card,.multiunit-site-card,.maintenance-authority-card,
  .ref32-balance-card,.ref32-share-card,.commercial-billing-card,.hint-card,
  .lifecycle-doc-card,.owner-review-card,.theo-account-card,.premium-form-card,
  .journey-stage-card,.manager-finance-panel,.manager-priority-panel,.manager-context-panel,
  .tenant-applications-panel,.tenant-viewings-panel,.owner-ops-panel,.admin-ops-panel,
  [class$="-card"],[class*="-card "],[class$="-panel"],[class*="-panel "]
):not(.brand-panel):not(.login-panel):not(.panel-head):not(.panel-body):not(.card-actions):not(.premium-card-actions):not(.price-card-icon):not(.journey-image-cards){
  border:1px solid var(--theo-ui-line)!important;
  border-radius:var(--theo-ui-card-radius)!important;
  background-color:var(--theo-ui-surface)!important;
  box-shadow:var(--theo-ui-shadow-card)!important;
}

:where(
  .panel,.kpi,.table-card,.content-card,.insight-card,
  .notification-compose-card,.notification-inbox-card,.admin-config-card,
  .owner-plan-card,.mandate-card,.maintenance-authority-card,
  .ref32-balance-card,.ref32-share-card,.commercial-billing-card,.hint-card,
  .lifecycle-doc-card,.owner-review-card,.theo-account-card,.premium-form-card,
  .manager-finance-panel,.manager-priority-panel,.manager-context-panel,
  .tenant-applications-panel,.tenant-viewings-panel,.owner-ops-panel,.admin-ops-panel
){
  padding:24px!important;
}

.panel-head,
[class$="-card-head"],[class*="-card-head "],
[class$="-panel-head"],[class*="-panel-head "]{
  gap:12px!important;
  margin-bottom:18px!important;
}
.panel-head h2,.panel-head h3,
[class$="-card-head"] h2,[class$="-card-head"] h3,
[class$="-panel-head"] h2,[class$="-panel-head"] h3{
  margin:0!important;
}

.kpi,
[class*="kpi-card"],
[class*="summary-card"]{
  min-height:104px;
}
.kpi strong,.kpi .value,.kpi .metric,
[class*="kpi-card"] strong,[class*="summary-card"] strong{
  font-family:var(--theo-ui-display)!important;
  color:var(--theo-ui-text-strong)!important;
  font-size:clamp(24px,2vw,32px)!important;
  line-height:1!important;
  letter-spacing:-.03em!important;
}

/* Media/property cards keep edge-to-edge media, but adopt premium shell treatment. */
:where(.premium-property-card,.property-card,.mobile-property-card,.category-showcase-card,.premium-category-card,.commercial-price-card,.owner-plan-card){
  overflow:hidden;
  transition:border-color .16s ease,box-shadow .16s ease,transform .16s ease;
}
@media (hover:hover){
  :where(.premium-property-card,.property-card,.category-showcase-card,.premium-category-card,.commercial-price-card,.owner-plan-card):hover{
    border-color:var(--theo-ui-line-strong)!important;
    box-shadow:var(--theo-ui-shadow-hover)!important;
    transform:translateY(-1px);
  }
}

/* ---------- Forms: enterprise control language ---------- */
label,
.field>label,
[class$="-field"]>label,
[class*="-field "]>label{
  color:var(--theo-ui-text-strong)!important;
  font-size:13.5px!important;
  line-height:1.35!important;
  font-weight:600!important;
  letter-spacing:-.005em!important;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
select,
textarea{
  min-height:46px!important;
  border:1px solid var(--theo-ui-line-strong)!important;
  border-radius:var(--theo-ui-form-radius)!important;
  background:var(--theo-ui-surface)!important;
  color:var(--theo-ui-text-strong)!important;
  font-size:15px!important;
  font-weight:450!important;
  line-height:1.35!important;
  padding:11px 13px!important;
  box-shadow:0 1px 1px rgba(15,36,50,.025)!important;
  transition:border-color .14s ease,box-shadow .14s ease,background-color .14s ease!important;
}
select{padding-right:34px!important;}
textarea{min-height:118px!important;resize:vertical;}
input::placeholder,textarea::placeholder{color:#617480!important;opacity:1!important;}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
select:focus,
textarea:focus{
  outline:none!important;
  border-color:var(--theo-ui-navy-700)!important;
  box-shadow:var(--theo-ui-focus)!important;
}
input:disabled,select:disabled,textarea:disabled{
  background:var(--theo-ui-surface-muted)!important;
  color:var(--theo-ui-muted-2)!important;
  border-color:var(--theo-ui-line)!important;
  cursor:not-allowed!important;
}
input[aria-invalid="true"],textarea[aria-invalid="true"],select[aria-invalid="true"],
.field.error input,.field.error select,.field.error textarea{
  border-color:var(--theo-ui-red-700)!important;
  box-shadow:0 0 0 3px rgba(162,59,59,.10)!important;
}
input[type="checkbox"],input[type="radio"]{accent-color:var(--theo-ui-navy-800);}

:where(.theo-form-grid,.form-grid,.market-form-grid,.lifecycle-form-grid,.identity-fields,.admin-form-stack){
  gap:18px!important;
}
:where(.theo-form-section,.multiunit-form-section,.mandate-form-section){
  padding-block:4px 18px!important;
  margin-bottom:18px!important;
  border-bottom:1px solid var(--theo-ui-line)!important;
}
:where(.theo-form-section,.multiunit-form-section,.mandate-form-section):last-child{
  border-bottom:0!important;
  margin-bottom:0!important;
}
:where(.form-error,.error-text,[class*="-error"]){font-size:12.5px!important;line-height:1.4!important;}

/* ---------- CTA / button hierarchy ---------- */
:where(
  button,input[type="submit"],input[type="button"],input[type="reset"],
  a[role="button"],.primary,.secondary,.danger,.table-btn,.text-button,
  .ref32-btn,.theo-account-btn,.top-icon-btn,
  [class$="-btn"],[class*="-btn "],[class$="-button"],[class*="-button "],
  [class$="-cta"],[class*="-cta "]
){
  border-radius:var(--theo-ui-button-radius)!important;
  min-height:42px;
  font-family:var(--theo-ui-font)!important;
  font-size:14px!important;
  line-height:1.2!important;
  font-weight:650!important;
  letter-spacing:-.003em!important;
  box-shadow:none!important;
  transition:background-color .14s ease,border-color .14s ease,color .14s ease,box-shadow .14s ease,transform .08s ease!important;
}

/* Primary action: decisive navy. */
:where(
  button.primary,.btn-primary,input[type="submit"],
  .ref32-btn.primary,
  button[class$="-primary"],button[class*="-primary "],
  a[role="button"][class$="-primary"],a[role="button"][class*="-primary "]
):not(.danger):not([class*="danger"]){
  background:var(--theo-ui-navy-900)!important;
  border:1px solid var(--theo-ui-navy-900)!important;
  color:#fff!important;
}
@media (hover:hover){
  :where(
    button.primary,.btn-primary,input[type="submit"],.ref32-btn.primary,
    button[class$="-primary"],button[class*="-primary "],
    a[role="button"][class$="-primary"],a[role="button"][class*="-primary "]
  ):not(.danger):not([class*="danger"]):hover{
    background:var(--theo-ui-navy-800)!important;
    border-color:var(--theo-ui-navy-800)!important;
  }
}

/* Commercial / premium conversion: Theo gold, dark text for accessible contrast. */
:where(.gold,.ref32-btn.gold,.owner-cta-primary,[class*="commercial-cta"],[class*="upgrade-cta"],[class*="subscribe-cta"]){
  background:var(--theo-ui-gold-500)!important;
  border:1px solid var(--theo-ui-gold-500)!important;
  color:var(--theo-ui-navy-950)!important;
}
@media (hover:hover){
  :where(.gold,.ref32-btn.gold,.owner-cta-primary,[class*="commercial-cta"],[class*="upgrade-cta"],[class*="subscribe-cta"]):hover{
    background:#c79957!important;
    border-color:#c79957!important;
  }
}

/* Secondary: quiet enterprise outline. */
:where(button.secondary,.btn-secondary,.table-btn,.theo-account-btn.secondary,
  button[class$="-secondary"],button[class*="-secondary "],
  a[role="button"][class$="-secondary"],a[role="button"][class*="-secondary "]){
  background:var(--theo-ui-surface)!important;
  border:1px solid var(--theo-ui-line-strong)!important;
  color:var(--theo-ui-navy-900)!important;
}
@media (hover:hover){
  :where(button.secondary,.btn-secondary,.table-btn,.theo-account-btn.secondary,
  button[class$="-secondary"],button[class*="-secondary "],
  a[role="button"][class$="-secondary"],a[role="button"][class*="-secondary "]):hover{
    background:var(--theo-ui-surface-soft)!important;
    border-color:#aebbc4!important;
  }
}

/* Destructive actions are unmistakably destructive. */
:where(button.danger,.theo-account-btn.danger,
  button[class$="-danger"],button[class*="-danger "],
  a[role="button"][class$="-danger"],a[role="button"][class*="-danger "]){
  background:#fff!important;
  border:1px solid #d9a4a4!important;
  color:var(--theo-ui-red-700)!important;
}
@media (hover:hover){
  :where(button.danger,.theo-account-btn.danger,
  button[class$="-danger"],button[class*="-danger "],
  a[role="button"][class$="-danger"],a[role="button"][class*="-danger "]):hover{
    background:#fff6f6!important;
    border-color:#c97b7b!important;
  }
}

/* Positive actions when semantic success classes already exist. */
:where(button.success,.btn-success,
  button[class$="-success"],button[class*="-success "],
  a[role="button"][class$="-success"],a[role="button"][class*="-success "]){
  background:var(--theo-ui-green-700)!important;
  border:1px solid var(--theo-ui-green-700)!important;
  color:#fff!important;
}

:where(button,a[role="button"],input[type="submit"],input[type="button"],.primary,.secondary,.danger,.table-btn,.ref32-btn,.theo-account-btn):focus-visible{
  outline:none!important;
  box-shadow:var(--theo-ui-focus)!important;
}
:where(button,a[role="button"],input[type="submit"],input[type="button"]):active{transform:translateY(1px);}
:where(button,input[type="submit"],input[type="button"]):disabled{
  opacity:.52!important;
  cursor:not-allowed!important;
  transform:none!important;
}

/* Icon-only buttons remain square, never circular/pill. */
:where(.top-icon-btn,.icon-action,.auth-modal-close,.modal-x,.ops-modal-x,.workspace-identity-menu-button){
  width:40px;
  min-width:40px;
  height:40px;
  min-height:40px!important;
  padding:0!important;
  border-radius:0!important;
}

/* ---------- No-pill authority ---------- */
:where(
  .pill,.chip,.badge,.status,.status-badge,.status-pill,.status-chip,.filter-pill,.filter-chip,
  .photo-badge,.nav-badge,.workspace-role-chip,.current-plan-chip,.listing-life-chip,
  .ref32-pill,.aff-pill,.state-pill,.maintenance-authority-pill,.opening-balance-pill,
  .hero-search-badge,.price-card-badge,.multiunit-unit-badge,.manager-scheduled-badge,
  .match-tag,.promotion-label,.health-status,.topbar-status,.commercial-status,.ws30-status,
  .market-registry-status,.notification-email-state,.notification-recipient-summary,
  .notification-selected-chip,.tenant-support-status,.global-notification-badge,.aff-state,.session-badge,
  [class$="-pill"],[class*="-pill "],[class$="-chip"],[class*="-chip "],
  [class$="-badge"],[class*="-badge "]
){
  border-radius:var(--theo-ui-status-radius)!important;
  padding:4px 7px!important;
  font-size:11.5px!important;
  line-height:1.25!important;
  font-weight:650!important;
  letter-spacing:.01em!important;
}

/* All button-based tabs and segmented controls are rectangular, never capsules. */
:where(
  .commercial-tabs button,.category-tabs button,.periods button,.tabs button,
  [role="tab"],button[aria-selected],button[data-active],button[class*="tab"]
){
  border-radius:var(--theo-ui-button-radius)!important;
}
:where([role="tab"][aria-selected="true"],button[aria-selected="true"],button.active){
  border-color:var(--theo-ui-navy-900)!important;
}

/* ---------- Modal/dialog refinement ---------- */
:where(.modal-card,.ops-modal-card,.manager-review-dialog,.dialog,.auth-modal .card,.market-config-modal){
  border-radius:var(--theo-ui-modal-radius)!important;
  border:1px solid var(--theo-ui-line)!important;
  box-shadow:var(--theo-ui-shadow-modal)!important;
}
:where(.modal-actions,.form-actions,.theo-account-actions,.ref32-form-actions,.multiunit-form-actions,.mandate-form-actions,.cta-actions){
  gap:10px!important;
}

/* ---------- Enterprise data/surface details ---------- */
table{font-size:13.5px!important;}
th{
  color:#536471!important;
  font-size:11.5px!important;
  line-height:1.3!important;
  font-weight:700!important;
  letter-spacing:.045em!important;
  text-transform:uppercase!important;
}
td{color:var(--theo-ui-text)!important;}
hr{border:0!important;border-top:1px solid var(--theo-ui-line)!important;}

/* Links retain link affordance rather than masquerading as buttons. */
a:not([role="button"]):not(.primary):not(.secondary):not([class*="btn"]):not([class*="button"]){
  text-underline-offset:2px;
}

/* ---------- Responsive production rules ---------- */
@media (max-width:1180px){
  :where(
    .panel,.kpi,.table-card,.content-card,.insight-card,
    .notification-compose-card,.notification-inbox-card,.admin-config-card,
    .owner-plan-card,.mandate-card,.maintenance-authority-card,
    .ref32-balance-card,.ref32-share-card,.commercial-billing-card,.hint-card,
    .lifecycle-doc-card,.owner-review-card,.theo-account-card,.premium-form-card,
    .manager-finance-panel,.manager-priority-panel,.manager-context-panel,
    .tenant-applications-panel,.tenant-viewings-panel,.owner-ops-panel,.admin-ops-panel
  ){
    padding:20px!important;
  }
  h1{font-size:clamp(28px,3.2vw,36px)!important;}
}

@media (max-width:700px){
  body{font-size:15px!important;}
  h1{font-size:28px!important;line-height:1.12!important;}
  h2{font-size:21px!important;}
  h3{font-size:17px!important;}

  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
  select,textarea{font-size:16px!important;min-height:46px!important;}

  :where(
    .panel,.kpi,.table-card,.content-card,.insight-card,
    .notification-compose-card,.notification-inbox-card,.admin-config-card,
    .owner-plan-card,.mandate-card,.maintenance-authority-card,
    .ref32-balance-card,.ref32-share-card,.commercial-billing-card,.hint-card,
    .lifecycle-doc-card,.owner-review-card,.theo-account-card,.premium-form-card,
    .manager-finance-panel,.manager-priority-panel,.manager-context-panel,
    .tenant-applications-panel,.tenant-viewings-panel,.owner-ops-panel,.admin-ops-panel
  ){
    padding:18px!important;
    border-radius:10px!important;
  }

  :where(
    button,input[type="submit"],input[type="button"],input[type="reset"],
    a[role="button"],.primary,.secondary,.danger,.table-btn,.text-button,
    .ref32-btn,.theo-account-btn,[class$="-btn"],[class*="-btn "],
    [class$="-button"],[class*="-button "],[class$="-cta"],[class*="-cta "]
  ){
    min-height:44px;
    font-size:14px!important;
  }

  .panel-head,[class$="-card-head"],[class*="-card-head "],[class$="-panel-head"],[class*="-panel-head "]{
    margin-bottom:16px!important;
  }
}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{
    scroll-behavior:auto!important;
    transition-duration:.01ms!important;
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
  }
}

/* RC12932 brand refinement: presentation only, no new layout or scroll containers. */
body{background-color:var(--theo-ui-page);}
/* Static ambience is confined to card surfaces; property imagery remains intact. */
:is(#owner,#tenant,#management) :is(.ws30-panel,.ws30-kpi,.kpi),
body :is(.admin-config-card,.notification-compose-card,.premium-form-card){
  background-color:#fff!important;
  background-image:linear-gradient(125deg,rgba(189,141,73,.045),transparent 48%)!important;
  border-color:#d9e2e6!important;
  box-shadow:0 1px 2px rgba(16,43,59,.04),0 6px 18px rgba(16,43,59,.035)!important;
}
:is(#owner,#tenant,#management) .ws30-kpi{
  border-top:2px solid #a97838!important;
  padding:20px!important;
}
:is(#owner,#tenant,#management) .ws30-panel{padding:24px!important;}
/* Explicit semantic actions, including the app's standard .button anchors. */
html body :is(button,a).button:not(.secondary):not(.danger):not(.success):not(.gold),
html body :is(button,a).btn-primary{
  background:#102b3b!important;border:1px solid #102b3b!important;color:#fff!important;
  padding:11px 18px!important;
}
html body :is(button,a).secondary{background:#fff!important;border:1px solid #9daeb9!important;color:#16394d!important;}
html body :is(button,a).danger{background:#fff5f4!important;border:1px solid #c58b87!important;color:#922d2d!important;}
html body :is(button,a).success{background:#236b62!important;border:1px solid #236b62!important;color:#fff!important;}
html body :is(button,a).gold{background:#bd8d49!important;border:1px solid #a97838!important;color:#0b1f2d!important;}
/* Rectangular interactive controls and tags; native radios remain recognisable. */
html body :is(button,.button,.btn,[role="button"],[role="tab"],input[type="submit"],input[type="button"],input[type="reset"],
.pill,.chip,.badge,.status,.ws30-status,[class*="-pill"],[class*="-chip"],[class*="-badge"]),
:is(#owner,#tenant,#management) :is(button,.button,[role="button"],[role="tab"],.pill,.chip,.badge,.ws30-status){border-radius:0!important;}
html body :is(button,a[role="button"],a.button,input,select,textarea):focus-visible{
  outline:2px solid #245168!important;outline-offset:3px!important;
}
/* Tables retain their existing responsive display and overflow behaviour. */
html body table{font-variant-numeric:tabular-nums;line-height:1.5!important;}
html body table thead th{
  background:#eaf0f3!important;color:#16394d!important;
  border-bottom:2px solid #b9c9d2!important;padding:13px 16px!important;
  font-size:12px!important;letter-spacing:.025em!important;
}
html body table tbody td{padding:14px 16px!important;border-bottom:1px solid #e1e7eb!important;vertical-align:middle;}
html body table tbody tr:nth-child(even):not([aria-selected="true"]):not(.selected) td{background-color:#f7f9fa;}
html body table tbody tr[aria-selected="true"] td,
html body table tbody tr.selected td{background-color:#e9f2f0!important;}
html body :is(input,textarea)[readonly]{background-color:#f2f5f6!important;color:#526675!important;}
@media(hover:hover){
 html body :is(button,a).button:not(.secondary):not(.danger):not(.success):not(.gold):not(:disabled):hover{background:#245168!important;border-color:#245168!important;}
 html body table tbody tr:not([aria-selected="true"]):not(.selected):hover td{background-color:#eef4f6;}
}
@media(max-width:700px){
 :is(#owner,#tenant,#management) :is(.ws30-panel,.ws30-kpi){padding:16px!important;}
 html body table thead th{padding:11px 12px!important;}
 html body table tbody td{padding:12px!important;}
}
