/* PropertyWorkHQ V13.10 — vivid operations layer
   Progressive visual + interaction polish over the V13.9 product architecture. */
:root{
  --pw10-emerald:#08735f;
  --pw10-emerald-bright:#12a184;
  --pw10-teal:#0e7f83;
  --pw10-blue:#1769b0;
  --pw10-sky:#2587c9;
  --pw10-indigo:#545bc5;
  --pw10-violet:#7048b5;
  --pw10-amber:#976100;
  --pw10-gold:#c18312;
  --pw10-coral:#b94231;
  --pw10-rose:#a83b63;
  --pw10-danger:#bd3941;
  --pw10-success:#257658;
  --pw10-ink:#12334c;
  --pw10-canvas:#f5f8f6;
  --pw10-shadow:0 18px 48px rgba(20,49,70,.105);
}

/* A livelier canvas without turning the product into a neon dashboard. */
body.pw-app-mode{
  background:
    radial-gradient(circle at 4% 3%,rgba(37,135,201,.15),transparent 28rem),
    radial-gradient(circle at 96% 2%,rgba(18,161,132,.13),transparent 31rem),
    radial-gradient(circle at 76% 95%,rgba(193,131,18,.09),transparent 32rem),
    linear-gradient(135deg,#fbf9f3 0%,#f2f8f6 47%,#f7f4ed 100%)!important;
}
body.pw-app-mode::before{
  content:"";position:fixed;z-index:-2;inset:0;pointer-events:none;
  background-image:linear-gradient(rgba(23,105,176,.025) 1px,transparent 1px),linear-gradient(90deg,rgba(23,105,176,.025) 1px,transparent 1px);
  background-size:44px 44px;mask-image:linear-gradient(to bottom,rgba(0,0,0,.48),transparent 72%);
}
body.pw-app-mode .pw-app-sidebar{
  background:linear-gradient(180deg,#fffaf1 0%,#f0e7da 56%,#edf3ef 100%)!important;
  border-right-color:#d8c3aa!important;
  box-shadow:15px 0 42px rgba(23,49,68,.08)!important;
}
body.pw-app-mode .pw-app-topbar{
  background:rgba(255,251,245,.9)!important;
  box-shadow:0 1px 0 #decdb9,0 12px 34px rgba(24,51,72,.07)!important;
  backdrop-filter:blur(22px) saturate(1.35)!important;
}
body.pw-app-mode .pw-app-topbar::before{
  content:"";position:absolute;left:0;right:0;top:0;height:2px;pointer-events:none;
  background:linear-gradient(90deg,var(--pw10-blue),var(--pw10-emerald-bright),var(--pw10-gold),var(--pw10-coral),var(--pw10-violet));
  opacity:.8;
}
body.pw-app-mode .pw-app-search input{
  background:linear-gradient(180deg,rgba(255,255,255,.9),rgba(246,249,247,.92))!important;
  border:1px solid rgba(23,105,176,.13)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.8),0 5px 14px rgba(30,58,78,.04)!important;
  transition:border-color .16s ease,box-shadow .16s ease,transform .16s ease!important;
}
body.pw-app-mode .pw-app-search input:hover{border-color:rgba(23,105,176,.34)!important;box-shadow:0 7px 18px rgba(23,105,176,.075)!important}
body.pw-app-mode .pw-app-search input:focus{border-color:var(--pw10-blue)!important;box-shadow:0 0 0 4px rgba(23,105,176,.10),0 9px 22px rgba(23,105,176,.10)!important}

/* Navigation becomes a colorful operating map, not a monochrome directory. */
body.pw-app-mode .pw-app-nav a{font-weight:780!important}
body.pw-app-mode .pw-app-nav a::before{
  content:"";position:absolute;right:10px;top:50%;width:5px;height:5px;border-radius:999px;
  background:var(--nav-accent,var(--pw10-blue));opacity:0;transform:translateY(-50%) scale(.6);transition:opacity .18s ease,transform .18s ease;
}
body.pw-app-mode .pw-app-nav a:hover::before,body.pw-app-mode .pw-app-nav a.active::before{opacity:.75;transform:translateY(-50%) scale(1)}
body.pw-app-mode .pw-app-nav a.active{
  background:linear-gradient(90deg,color-mix(in srgb,var(--nav-accent,var(--pw10-blue)) 20%,#fff),rgba(255,255,255,.54))!important;
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--nav-accent,var(--pw10-blue)) 17%,transparent),0 9px 20px rgba(31,59,79,.055)!important;
}
body.pw-app-mode .pw-nav-svg{filter:saturate(1.18)}

/* Topbar utilities */
.pw10-tool{width:38px;height:38px;border-radius:12px;border:1px solid var(--ui-border);background:linear-gradient(180deg,#fff,var(--ui-surface-alt));display:grid;place-items:center;color:var(--ui-ink);cursor:pointer;transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease,background .16s ease;position:relative}
.pw10-tool:hover{transform:translateY(-2px);border-color:rgba(23,105,176,.28);box-shadow:0 9px 20px rgba(23,105,176,.10);background:#fff}
.pw10-tool svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.pw10-tool[data-active="true"]{color:#fff;border-color:transparent;background:linear-gradient(135deg,var(--pw10-blue),var(--pw10-teal));box-shadow:0 8px 19px rgba(23,105,176,.2)}
.pw10-online{display:flex;align-items:center;gap:6px;padding:7px 9px;border-radius:999px;background:rgba(37,118,88,.08);color:var(--pw10-success);border:1px solid rgba(37,118,88,.14);font-size:.58rem;font-weight:900;letter-spacing:.04em;text-transform:uppercase;white-space:nowrap}
.pw10-online::before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor;box-shadow:0 0 0 4px rgba(37,118,88,.10)}
.pw10-online.offline{color:var(--pw10-danger);background:rgba(189,57,65,.08);border-color:rgba(189,57,65,.15)}

/* Module canvases — each section keeps a recognizable visual identity. */
body[data-pw-module="work-orders"]{--pw10-module:var(--pw10-coral);--pw10-module2:var(--pw10-gold)}
body[data-pw-module="properties"]{--pw10-module:var(--pw10-blue);--pw10-module2:var(--pw10-emerald-bright)}
body[data-pw-module="approvals"]{--pw10-module:var(--pw10-amber);--pw10-module2:var(--pw10-violet)}
body[data-pw-module="providers"]{--pw10-module:var(--pw10-emerald);--pw10-module2:var(--pw10-blue)}
body[data-pw-module="projects"]{--pw10-module:var(--pw10-violet);--pw10-module2:var(--pw10-coral)}
body[data-pw-module="recurring"]{--pw10-module:var(--pw10-indigo);--pw10-module2:var(--pw10-sky)}
body[data-pw-module="residents"]{--pw10-module:var(--pw10-rose);--pw10-module2:var(--pw10-emerald)}
body[data-pw-module="team"]{--pw10-module:var(--pw10-teal);--pw10-module2:var(--pw10-violet)}
body[data-pw-module="rules"]{--pw10-module:#315b85;--pw10-module2:var(--pw10-gold)}
body[data-pw-module="settings"]{--pw10-module:#4c6478;--pw10-module2:var(--pw10-blue)}
body[data-pw-module] .pwm-hero{
  border-color:color-mix(in srgb,var(--pw10-module,var(--pwm-accent)) 38%,var(--ui-border))!important;
  background:
    radial-gradient(circle at 93% 12%,color-mix(in srgb,var(--pw10-module,var(--pwm-accent)) 22%,transparent),transparent 19rem),
    radial-gradient(circle at 70% 116%,color-mix(in srgb,var(--pw10-module2,var(--pwm-secondary)) 19%,transparent),transparent 24rem),
    linear-gradient(120deg,color-mix(in srgb,var(--pw10-module,var(--pwm-accent)) 12%,#fff),rgba(255,255,255,.91) 52%,color-mix(in srgb,var(--pw10-module2,var(--pwm-secondary)) 9%,#fff))!important;
  box-shadow:0 24px 58px rgba(24,54,77,.13),inset 0 1px 0 rgba(255,255,255,.82)!important;
}
body[data-pw-module] .pwm-hero::before{background:radial-gradient(circle,color-mix(in srgb,var(--pw10-module,var(--pwm-accent)) 32%,transparent),transparent 69%)!important}
body[data-pw-module] .pwm-hero::after{background:radial-gradient(circle,color-mix(in srgb,var(--pw10-module2,var(--pwm-secondary)) 27%,transparent),transparent 70%)!important}
body[data-pw-module] .pwm-kicker{color:color-mix(in srgb,var(--pw10-module,var(--pwm-accent)) 92%,#152f45)!important}
.pwm-hero-art{filter:saturate(1.12)}
.pwm-hero-art::after{content:"";position:absolute;inset:-10px;border-radius:24px;background:linear-gradient(135deg,color-mix(in srgb,var(--pw10-module,var(--pwm-accent)) 7%,transparent),color-mix(in srgb,var(--pw10-module2,var(--pwm-secondary)) 5%,transparent));z-index:-1;transform:rotate(-1.4deg)}

/* Stronger metric hierarchy and state color vocabulary. */
.pwm-metric{position:relative;overflow:hidden;background:linear-gradient(160deg,#fff,var(--ui-field-bg))!important;border-color:color-mix(in srgb,var(--metric,var(--pwm-accent)) 20%,var(--ui-border))!important;box-shadow:0 10px 24px rgba(27,54,75,.055);transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease!important}
.pwm-metric::after{content:"";position:absolute;width:82px;height:82px;border-radius:50%;right:-38px;top:-42px;background:color-mix(in srgb,var(--metric,var(--pwm-accent)) 11%,transparent)}
.pwm-metric:hover{transform:translateY(-3px);box-shadow:0 17px 33px color-mix(in srgb,var(--metric,var(--pwm-accent)) 11%,rgba(27,54,75,.08));border-color:color-mix(in srgb,var(--metric,var(--pwm-accent)) 36%,var(--ui-border))!important}
.pwm-metric strong{color:color-mix(in srgb,var(--metric,var(--pwm-accent)) 76%,var(--ui-ink))!important}

/* Make current filters and common controls feel app-like. */
.pwm-toolbar{position:sticky;top:74px;z-index:32;padding:9px;border:1px solid rgba(23,105,176,.11);border-radius:16px;background:rgba(255,252,247,.88);box-shadow:0 9px 26px rgba(28,53,72,.07);backdrop-filter:blur(14px) saturate(1.2)}
.pwm-filter,.pwm-small,.pwm-link{transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease,background .15s ease,color .15s ease!important}
.pwm-filter:hover,.pwm-small:hover,.pwm-link:hover{transform:translateY(-1px)}
.pwm-filter.active{box-shadow:0 7px 16px color-mix(in srgb,var(--pwm-accent) 19%,transparent)!important}

/* Cards become richer surfaces with directional hover, not just elevation. */
:is(.pwm-card,.pwm-row,.pwm-property-tile,.pwm-provider-card,.pwm-project-card,.pwm-person-card,.pwm-rule,.pwm-connection,.pwm-agenda-row){position:relative;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease,background .18s ease,filter .18s ease!important}
:is(.pwm-card,.pwm-property-tile,.pwm-provider-card,.pwm-project-card,.pwm-person-card):hover{box-shadow:0 20px 42px rgba(23,51,72,.105)!important}
:is(.pwm-property-tile,.pwm-provider-card,.pwm-project-card,.pwm-person-card):hover{transform:translateY(-4px)}
.pwm-row:hover,.pwm-agenda-row:hover{transform:translateX(2px);background:color-mix(in srgb,var(--pwm-accent) 3%,var(--ui-field-bg))!important}
.pwm-property-photo img,.pwm-drawer-hero img{transition:transform .35s ease,filter .35s ease!important}.pwm-property-tile:hover .pwm-property-photo img,.pwm-drawer-hero:hover img{transform:scale(1.035);filter:saturate(1.34) contrast(1.05)!important}

/* Semantic states applied by V13.10 JS. */
[data-pw-state]{--pw-state:var(--pw10-blue);--pw-state-bg:rgba(23,105,176,.065)}
[data-pw-state="urgent"],[data-pw-state="blocked"],[data-pw-state="overdue"]{--pw-state:var(--pw10-danger);--pw-state-bg:rgba(189,57,65,.07)}
[data-pw-state="warning"],[data-pw-state="pending"]{--pw-state:var(--pw10-amber);--pw-state-bg:rgba(151,97,0,.065)}
[data-pw-state="approval"]{--pw-state:var(--pw10-violet);--pw-state-bg:rgba(112,72,181,.07)}
[data-pw-state="healthy"],[data-pw-state="complete"]{--pw-state:var(--pw10-success);--pw-state-bg:rgba(37,118,88,.065)}
[data-pw-state="active"],[data-pw-state="info"]{--pw-state:var(--pw10-blue);--pw-state-bg:rgba(23,105,176,.065)}
:is(.pwm-row,.pwm-card,.pwm-provider-card,.pwm-project-card,.pwm-property-tile,.pwm-person-card,.pwm-agenda-row)[data-pw-state]{border-color:color-mix(in srgb,var(--pw-state) 24%,var(--ui-border))!important;background:linear-gradient(110deg,var(--pw-state-bg),var(--ui-surface) 27%)!important}
:is(.pwm-row,.pwm-provider-card,.pwm-project-card,.pwm-person-card,.pwm-agenda-row)[data-pw-state]::before{content:"";position:absolute;left:-1px;top:12px;bottom:12px;width:3px;border-radius:3px;background:var(--pw-state);opacity:.84}
.pwm-pill[data-pw-state]{border-color:color-mix(in srgb,var(--pw-state) 28%,transparent)!important;background:color-mix(in srgb,var(--pw-state) 10%,var(--ui-surface))!important;color:color-mix(in srgb,var(--pw-state) 78%,#1c2f3e)!important}

/* Empty, error and loading states feel deliberate. */
.pwm-empty{position:relative;overflow:hidden;min-height:92px;display:grid;place-items:center;padding:27px!important;background:linear-gradient(135deg,color-mix(in srgb,var(--pwm-accent) 5%,#fff),#fff 55%,color-mix(in srgb,var(--pwm-secondary) 4%,#fff))!important}
.pwm-empty::before{content:"";position:absolute;width:94px;height:94px;border:1px solid color-mix(in srgb,var(--pwm-accent) 13%,transparent);border-radius:50%;right:-40px;top:-45px}
.pw10-skeleton{display:grid;gap:12px;padding:4px 0}.pw10-skeleton-row{height:88px;border-radius:16px;border:1px solid var(--ui-border);background:linear-gradient(100deg,var(--ui-field-bg) 20%,color-mix(in srgb,var(--pwm-accent) 7%,#fff) 40%,var(--ui-field-bg) 60%);background-size:220% 100%;animation:pw10Shimmer 1.5s ease-in-out infinite}.pw10-skeleton-row:first-child{height:122px}.pw10-skeleton-row:last-child{width:72%}@keyframes pw10Shimmer{to{background-position:-220% 0}}

/* Drawer treatment */
.pwm-drawer-panel{border-left:1px solid rgba(23,105,176,.13);background:linear-gradient(180deg,#fffdf9,#f7faf8)!important}.pwm-drawer-close{box-shadow:0 6px 16px rgba(26,53,72,.08)}

/* Toasts: lightweight, high-feedback interaction layer. */
.pw10-toast-host{position:fixed;right:22px;bottom:22px;z-index:5000;display:grid;gap:9px;width:min(380px,calc(100vw - 28px));pointer-events:none}
.pw10-toast{--toast:var(--pw10-blue);display:grid;grid-template-columns:auto 1fr;gap:10px;align-items:start;padding:12px 13px;border:1px solid color-mix(in srgb,var(--toast) 24%,var(--ui-border));border-radius:14px;background:rgba(255,255,255,.96);box-shadow:0 20px 44px rgba(19,45,65,.16);backdrop-filter:blur(15px);pointer-events:auto;animation:pw10ToastIn .2s ease-out both}
.pw10-toast[data-kind="ok"]{--toast:var(--pw10-success)}.pw10-toast[data-kind="error"]{--toast:var(--pw10-danger)}.pw10-toast[data-kind="warning"]{--toast:var(--pw10-amber)}
.pw10-toast-dot{width:24px;height:24px;border-radius:9px;background:color-mix(in srgb,var(--toast) 13%,#fff);color:var(--toast);display:grid;place-items:center;font-size:.72rem;font-weight:950}.pw10-toast strong{display:block;font-size:.72rem;color:var(--ui-ink)}.pw10-toast p{margin:2px 0 0;font-size:.64rem;line-height:1.45;color:var(--ui-muted)}
@keyframes pw10ToastIn{from{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}

/* Command palette gets a genuine app-command feel. */
.pw-command-box{border-color:rgba(23,105,176,.23)!important;background:rgba(255,253,249,.97)!important;box-shadow:0 36px 100px rgba(16,42,61,.29)!important}
.pw-command-input{background:linear-gradient(90deg,rgba(23,105,176,.045),transparent)}
.pw-command-results>a{border:1px solid transparent}.pw-command-results>a:hover{border-color:rgba(23,105,176,.11);background:linear-gradient(90deg,rgba(23,105,176,.08),rgba(18,161,132,.045))!important}
.pw10-command-help{display:flex;gap:10px;flex-wrap:wrap;padding:9px 13px 11px;border-top:1px solid var(--ui-border);font-size:.58rem;color:var(--ui-muted);background:rgba(246,248,246,.82)}.pw10-command-help kbd{font:800 .54rem/1 var(--pw-ui,system-ui);padding:4px 6px;border:1px solid var(--ui-border);border-bottom-width:2px;border-radius:6px;background:#fff;color:var(--ui-ink)}

/* Density mode: useful on bigger portfolios. */
body.pw10-compact .pwm-shell{padding-top:20px}
body.pw10-compact .pwm-hero{min-height:180px;padding:24px 28px}
body.pw10-compact .pwm-hero h1{font-size:clamp(2.2rem,4vw,4.1rem)}
body.pw10-compact .pwm-metric{padding:12px 14px!important}
body.pw10-compact .pwm-row{padding:9px 10px!important}
body.pw10-compact :is(.pwm-card,.pwm-provider-card,.pwm-project-card,.pwm-person-card){padding:14px!important}

/* Small-screen operating mode prioritizes actions and readable state. */
@media(max-width:900px){.pw10-online{display:none}.pwm-toolbar{top:66px;overflow-x:auto;flex-wrap:nowrap!important}.pwm-toolbar>*{flex:0 0 auto}.pw10-toast-host{right:14px;bottom:14px}}
@media(max-width:600px){body[data-pw-module] .pwm-hero{border-radius:20px!important}.pwm-metric{box-shadow:none}.pw10-tool{width:36px;height:36px}.pwm-toolbar{margin-inline:-3px}.pw10-command-help{display:none}}
@media(prefers-reduced-motion:reduce){.pw10-skeleton-row{animation:none!important}.pw10-toast{animation:none!important}}

/* V13.10 record-aware command search */
.pw10-command-records{margin-top:5px;padding-top:6px;border-top:1px solid var(--ui-border)}
.pw10-command-label{padding:7px 10px 5px;font-size:.54rem;font-weight:950;letter-spacing:.13em;color:var(--ui-muted)}
.pw10-command-records>a{display:grid;grid-template-columns:38px minmax(0,1fr) auto;gap:11px;align-items:center;padding:10px;border-radius:12px;text-decoration:none;color:var(--ui-ink)!important;border:1px solid transparent;transition:background .14s ease,border-color .14s ease,transform .14s ease}
.pw10-command-records>a:hover{transform:translateX(2px);border-color:color-mix(in srgb,var(--record,var(--pw10-blue)) 18%,var(--ui-border));background:linear-gradient(90deg,color-mix(in srgb,var(--record,var(--pw10-blue)) 8%,#fff),#fff)}
.pw10-command-record-icon{width:35px;height:35px;border-radius:11px;display:grid;place-items:center;background:color-mix(in srgb,var(--record,var(--pw10-blue)) 11%,#fff);color:var(--record,var(--pw10-blue));font-size:.68rem;font-weight:950;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--record,var(--pw10-blue)) 13%,transparent)}
.pw10-command-records strong{font-size:.8rem}.pw10-command-records p{margin:2px 0 0;font-size:.64rem;color:var(--ui-muted)}
