/* ==========================================================================
   ERP Pro Kit — application design system (v0.8)

   One stylesheet, one set of tokens. Brand colours (--pms-primary,
   --pms-secondary and everything derived from them) are injected from
   Settings by PMS_Settings::theme_css(); the values below are only fallbacks.

   Scoped to .pms-shell (wp-admin app) and .pms-wrap (front-end shortcodes) so
   nothing leaks into other plugins' screens.

   1  Tokens & base          5  Page furniture (headers, cards, KPIs)
   2  App shell              6  Tables, chips, forms, buttons
   3  Menus & quick search   7  Dashboard
   4  Motion                 8  Module screens (tabs, real estate, invoicing…)
                             9  Settings, login, front-end, responsive
   ========================================================================== */

/* 1 · Tokens & base ------------------------------------------------------- */
.pms-shell,
.pms-wrap,
body.login {
    --pms-primary: #2563eb;
    --pms-primary-dark: #1e4fc4;
    --pms-primary-light: #5b8def;
    --pms-primary-soft: rgba(37, 99, 235, .10);
    --pms-primary-softer: rgba(37, 99, 235, .05);
    --pms-primary-ring: rgba(37, 99, 235, .28);
    --pms-on-primary: #ffffff;
    --pms-glow: 0 10px 24px -6px rgba(37, 99, 235, .45);
    --pms-secondary: #0b1d51;
    --pms-secondary-dark: #07123a;
    --pms-secondary-soft: rgba(11, 29, 81, .08);
    --pms-heading: #0a1b4d;
    --pms-side-top: #11255f;
    --pms-side-bottom: #071439;
    --pms-side-text: #ffffff;
    --pms-side-muted: rgba(255, 255, 255, .62);
    --pms-side-hover: rgba(255, 255, 255, .08);
    --pms-side-line: rgba(255, 255, 255, .14);
}

.pms-shell,
.pms-wrap {
    --pms-bg: #f4f7fc;
    --pms-surface: #ffffff;
    --pms-surface-2: #f7f9fd;
    --pms-text: #334155;
    --pms-muted: #62728f;
    --pms-border: #e6ecf5;
    --pms-border-strong: #d5deec;
    --pms-success: #16a34a;
    --pms-success-soft: #e7f7ee;
    --pms-warning: #d97706;
    --pms-warning-soft: #fef3dc;
    --pms-danger: #e5484d;
    --pms-danger-soft: #fdecec;
    --pms-info: #0284c7;
    --pms-info-soft: #e5f4fc;
    --pms-violet: #7c3aed;
    --pms-violet-soft: #f0e9fe;
    --pms-radius: 20px;
    --pms-radius-md: 14px;
    --pms-radius-sm: 10px;
    --pms-sidebar-w: 280px;
    --pms-topbar-h: 80px;
    --pms-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 14px 34px -16px rgba(30, 58, 138, .16);
    --pms-shadow-lg: 0 2px 4px rgba(16, 24, 40, .05), 0 24px 48px -18px rgba(30, 58, 138, .28);
    font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--pms-text);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

:is(.pms-shell, .pms-wrap) *,
:is(.pms-shell, .pms-wrap) *::before,
:is(.pms-shell, .pms-wrap) *::after { box-sizing: border-box; }
:is(.pms-shell, .pms-wrap) :is(input, select, textarea, button) { font-family: inherit; }
:is(.pms-shell, .pms-wrap) :is(h1, h2, h3, h4, p) { margin: 0; }
:is(.pms-shell, .pms-wrap) :is(h1, h2, h3, h4) { color: var(--pms-heading); font-family: inherit; letter-spacing: -.01em; }
:is(.pms-shell, .pms-wrap) a { color: var(--pms-primary); text-decoration: none; }
:is(.pms-shell, .pms-wrap) a:hover { color: var(--pms-primary-dark); }
:is(.pms-shell, .pms-wrap) :focus-visible { outline: 3px solid var(--pms-primary-ring); outline-offset: 2px; border-radius: 8px; }

/* SVG icons: sized by their container, coloured by the text colour. */
.pms-icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.2em; }
:is(.pms-btn, .pms-btn-primary, .pms-btn-secondary, .pms-btn-danger) > .pms-icon { width: 18px; height: 18px; vertical-align: middle; }
.dashicons { font-size: 18px; width: 18px; height: 18px; line-height: 1; vertical-align: middle; }  /* only for any icon without an SVG twin */

/* 2 · App shell ------------------------------------------------------------ */
body.pms-fullscreen-app { background: #f4f7fc; }

.pms-shell {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    grid-template-columns: var(--pms-sidebar-w) minmax(0, 1fr);
    background: var(--pms-bg);
    overflow: hidden;
}

.pms-skip-link {
    position: absolute; left: 16px; top: -60px; z-index: 100000;
    padding: 10px 16px; border-radius: 10px; background: var(--pms-primary); color: var(--pms-on-primary) !important; font-weight: 700;
}
.pms-skip-link:focus { top: 12px; }

/* Sidebar */
.pms-shell-sidebar {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    min-height: 0;
    color: var(--pms-side-text);
    background: linear-gradient(190deg, var(--pms-side-top) 0%, var(--pms-secondary) 48%, var(--pms-side-bottom) 100%);
    overflow: hidden;
    view-transition-name: pms-sidebar;
}
/* Decorative layer: faint towers and a sweep of the brand colour, bottom right. */
.pms-shell-sidebar::before,
.pms-shell-sidebar::after { content: ""; position: absolute; pointer-events: none; z-index: 0; }
.pms-shell-sidebar::before {
    inset: auto 0 0 0; height: 46%;
    background:
        linear-gradient(180deg, transparent, rgba(255, 255, 255, .035)) 18% 100% / 22% 78% no-repeat,
        linear-gradient(180deg, transparent, rgba(255, 255, 255, .05)) 44% 100% / 26% 100% no-repeat,
        linear-gradient(180deg, transparent, rgba(255, 255, 255, .03)) 74% 100% / 20% 64% no-repeat;
}
.pms-shell-sidebar::after {
    right: 0; bottom: 0; width: 100%; height: 26%;
    background: linear-gradient(112deg, transparent 38%, var(--pms-primary) 100%);
    opacity: .34;
    clip-path: polygon(0 100%, 100% 46%, 100% 100%);
}
.pms-shell-sidebar > * { position: relative; z-index: 1; }

.pms-shell-brand {
    display: flex; align-items: center; gap: 14px;
    padding: 26px 22px 18px;
    color: var(--pms-side-text) !important;
}
.pms-brand-mark {
    display: grid; place-items: center; flex: none;
    width: 48px; height: 48px; border-radius: 13px;
    background: linear-gradient(135deg, var(--pms-primary-light), var(--pms-primary) 55%, var(--pms-primary-dark));
    color: var(--pms-on-primary);
    font-size: 21px; font-weight: 800; letter-spacing: -.02em;
    box-shadow: var(--pms-glow);
    overflow: hidden;
}
.pms-brand-mark.has-logo { background: #fff; box-shadow: 0 6px 18px rgba(2, 6, 23, .25); }
.pms-brand-mark img { width: 82%; height: 82%; object-fit: contain; display: block; }
.pms-brand-copy { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.pms-brand-copy strong { font-size: 17px; font-weight: 800; letter-spacing: -.015em; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pms-brand-copy small { margin-top: 3px; font-size: 13px; color: var(--pms-side-muted); }

.pms-shell-nav { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px 18px; scrollbar-width: thin; scrollbar-color: var(--pms-side-line) transparent; }
.pms-shell-nav::-webkit-scrollbar { width: 6px; }
.pms-shell-nav::-webkit-scrollbar-thumb { background: var(--pms-side-line); border-radius: 6px; }
.pms-nav-group + .pms-nav-group { margin-top: 10px; }
.pms-nav-label {
    margin: 22px 12px 8px !important;
    color: var(--pms-side-muted);
    font-size: 11.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
}
.pms-nav-group:first-child .pms-nav-label { margin-top: 12px !important; }
.pms-nav-item {
    position: relative;
    display: flex; align-items: center; gap: 14px;
    height: 48px; margin: 3px 0; padding: 0 14px;
    border-radius: 13px;
    color: var(--pms-side-text) !important;
    font-size: 15.5px; font-weight: 500; letter-spacing: -.005em;
    transition: background-color .15s ease, box-shadow .15s ease;
}
.pms-nav-icon { display: grid; place-items: center; width: 24px; height: 24px; flex: none; }
.pms-nav-icon .pms-icon { width: 23px; height: 23px; stroke-width: 1.8; }
.pms-nav-item:hover { background: var(--pms-side-hover); }
.pms-nav-item.is-active {
    background: linear-gradient(180deg, var(--pms-primary-light), var(--pms-primary) 35%, var(--pms-primary-dark));
    color: var(--pms-on-primary) !important;
    font-weight: 700;
    box-shadow: var(--pms-glow), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.pms-nav-item.is-active .pms-icon { stroke-width: 2.1; }
.pms-nav-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pms-shell-account { padding: 14px 16px 18px; }
.pms-back-link {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 14px; margin-bottom: 14px;
    border: 1px solid var(--pms-side-line); border-radius: 13px;
    background: rgba(255, 255, 255, .03);
    color: var(--pms-side-text) !important; font-size: 14px; font-weight: 600;
    transition: background-color .15s ease;
}
.pms-back-link:hover { background: var(--pms-side-hover); }
.pms-back-link .pms-icon { width: 21px; height: 21px; }
.pms-account-card {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 6px 0; border-top: 1px solid var(--pms-side-line);
    color: var(--pms-side-text) !important;
}
.pms-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex: none; display: block; box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }
.pms-account-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.pms-account-copy strong { font-size: 15.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pms-account-copy small { font-size: 13px; color: var(--pms-side-muted); }
.pms-account-arrow { width: 20px; height: 20px; color: var(--pms-side-muted); }

/* Body */
.pms-shell-body { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--pms-bg); }

.pms-shell-topbar {
    position: relative; z-index: 5;
    display: flex; align-items: center; gap: 14px;
    flex: none; height: var(--pms-topbar-h); padding: 0 40px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--pms-border);
    view-transition-name: pms-topbar;
}
.pms-topbar-spacer { flex: 1; }
.pms-mobile-menu-toggle {
    display: none; place-items: center; width: 44px; height: 44px; flex: none;
    border: 0; border-radius: 12px; background: var(--pms-surface-2); color: var(--pms-heading); cursor: pointer;
}
.pms-mobile-menu-toggle .pms-icon { width: 22px; height: 22px; }

.pms-topbar-search {
    position: relative; display: flex; align-items: center; gap: 12px;
    width: min(560px, 48vw); height: 50px; padding: 0 14px 0 18px;
    border: 1px solid transparent; border-radius: 15px;
    background: #eaf0fb; color: var(--pms-muted);
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.pms-topbar-search:focus-within { background: #fff; border-color: var(--pms-primary); box-shadow: 0 0 0 4px var(--pms-primary-soft); }
.pms-topbar-search > .pms-icon { width: 21px; height: 21px; flex: none; }
.pms-topbar-search input[type="search"] {
    flex: 1; min-width: 0; height: 100%; padding: 0 !important; margin: 0;
    border: 0 !important; outline: 0 !important; box-shadow: none !important; background: transparent !important;
    color: var(--pms-heading); font-size: 15.5px; font-weight: 500;
}
.pms-topbar-search input::placeholder { color: var(--pms-muted); opacity: .9; }
.pms-topbar-search input::-webkit-search-cancel-button { display: none; }
.pms-topbar-search kbd {
    flex: none; padding: 4px 9px; border-radius: 8px; background: rgba(255, 255, 255, .85); border: 1px solid var(--pms-border);
    color: var(--pms-muted); font-size: 12.5px; font-weight: 700; line-height: 1.2; letter-spacing: .02em; white-space: nowrap;
}

.pms-topbar-notification {
    position: relative; display: grid; place-items: center; width: 46px; height: 46px; padding: 0;
    border: 0; border-radius: 50%; background: transparent; color: var(--pms-heading); cursor: pointer;
    transition: background-color .15s ease;
}
.pms-topbar-notification:hover, .pms-topbar-notification[aria-expanded="true"] { background: var(--pms-surface-2); }
.pms-topbar-notification .pms-icon { width: 25px; height: 25px; }
.pms-notification-badge {
    position: absolute; top: 2px; right: 1px; min-width: 20px; height: 20px; padding: 0 5px;
    display: grid; place-items: center; border-radius: 10px;
    background: var(--pms-danger); color: #fff; font-size: 11px; font-weight: 800; line-height: 1;
    box-shadow: 0 0 0 2px #fff;
}
.pms-topbar-account {
    display: flex; align-items: center; gap: 12px; padding: 5px 10px 5px 5px;
    border: 0; border-radius: 16px; background: transparent; cursor: pointer; text-align: left;
    transition: background-color .15s ease;
}
.pms-topbar-account:hover, .pms-topbar-account[aria-expanded="true"] { background: var(--pms-surface-2); }
.pms-topbar-account .pms-avatar { width: 48px; height: 48px; box-shadow: 0 0 0 2px #fff, 0 2px 8px rgba(15, 23, 42, .18); }
.pms-topbar-account-copy { display: flex; flex-direction: column; line-height: 1.25; }
.pms-topbar-account-copy strong { color: var(--pms-heading); font-size: 15.5px; font-weight: 700; }
.pms-topbar-account-copy small { color: var(--pms-muted); font-size: 13.5px; }
.pms-caret { width: 18px; height: 18px; color: var(--pms-heading); flex: none; }

.pms-shell-main { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; outline: 0; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: #c5d0e4 transparent; }
.pms-content { width: 100%; max-width: 1320px; margin: 0 auto; padding: 36px 40px 72px; }

.pms-scrim { position: fixed; inset: 0; z-index: 2; background: rgba(2, 6, 23, .5); backdrop-filter: blur(2px); }
.pms-scrim[hidden] { display: none; }

/* 3 · Menus & quick search ------------------------------------------------- */
.pms-menu-wrap { position: relative; }
.pms-menu {
    position: absolute; right: 0; top: calc(100% + 10px); z-index: 20;
    min-width: 270px; padding: 8px;
    border: 1px solid var(--pms-border); border-radius: 16px; background: #fff;
    box-shadow: var(--pms-shadow-lg);
    animation: pms-pop .14s ease-out;
}
.pms-menu[hidden] { display: none; }
.pms-menu-title { padding: 10px 12px 8px !important; color: var(--pms-muted); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.pms-menu-item {
    display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 11px;
    color: var(--pms-heading) !important; font-size: 14.5px; font-weight: 600;
}
.pms-menu-item:hover { background: var(--pms-surface-2); }
.pms-menu-item.is-danger { color: var(--pms-danger) !important; }
.pms-menu-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--pms-primary-soft); color: var(--pms-primary); }
.pms-menu-item.is-danger .pms-menu-icon { background: var(--pms-danger-soft); color: var(--pms-danger); }
.pms-menu-icon .pms-icon { width: 18px; height: 18px; }
.pms-menu-empty { display: flex; align-items: center; gap: 10px; padding: 14px 12px 16px; color: var(--pms-muted); font-weight: 600; }
.pms-menu-empty .pms-icon { color: var(--pms-success); width: 22px; height: 22px; }

.pms-search-results {
    position: absolute; left: 0; right: 0; top: calc(100% + 10px); z-index: 20; max-height: 380px; overflow-y: auto;
    padding: 8px; border: 1px solid var(--pms-border); border-radius: 16px; background: #fff; box-shadow: var(--pms-shadow-lg);
    animation: pms-pop .14s ease-out;
}
.pms-search-results[hidden] { display: none; }
.pms-search-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; color: var(--pms-heading) !important; font-weight: 600; font-size: 14.5px; }
.pms-search-item small { margin-left: auto; color: var(--pms-muted); font-size: 12px; font-weight: 600; }
.pms-search-item.is-active, .pms-search-item:hover { background: var(--pms-primary-soft); }
.pms-search-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--pms-surface-2); color: var(--pms-primary); flex: none; }
.pms-search-icon .pms-icon { width: 18px; height: 18px; }
.pms-search-label { flex: 1; min-width: 0; }
.pms-search-empty { padding: 16px; color: var(--pms-muted); text-align: center; font-weight: 600; }

/* 4 · Motion ---------------------------------------------------------------
   Navigation: a thin progress bar while the next screen loads, and (where the
   browser supports it) a cross-fade between screens while sidebar and topbar
   stay perfectly still, which is what makes a multi-page app feel like an SPA. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .16s; }
::view-transition-group(pms-sidebar), ::view-transition-group(pms-topbar) { animation: none; }

.pms-progress { position: absolute; top: 0; left: 0; right: 0; height: 3px; z-index: 30; pointer-events: none; opacity: 0; }
.pms-progress::after { content: ""; position: absolute; inset: 0; width: 0; background: linear-gradient(90deg, var(--pms-primary-light), var(--pms-primary)); box-shadow: 0 0 10px var(--pms-primary); }
.pms-shell.is-loading .pms-progress { opacity: 1; }
.pms-shell.is-loading .pms-progress::after { width: 85%; transition: width 2.4s cubic-bezier(.1, .7, .2, 1); }
.pms-shell.is-loading .pms-shell-main { opacity: .72; transition: opacity .2s ease .1s; }

@keyframes pms-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes pms-pulse { 0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .5); } 100% { box-shadow: 0 0 0 10px rgba(22, 163, 74, 0); } }
@media (prefers-reduced-motion: reduce) {
    .pms-shell *, .pms-shell *::before, .pms-shell *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
    @view-transition { navigation: none; }
}

/* 5 · Page furniture ------------------------------------------------------- */
.pms-page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 0 0 28px; }
.pms-page-header h1 { font-size: 34px; line-height: 1.15; font-weight: 800; letter-spacing: -.025em; }
.pms-eyebrow { margin: 0 0 6px !important; color: var(--pms-primary); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.pms-page-description { margin-top: 8px !important; max-width: 720px; color: var(--pms-muted); font-size: 15.5px; line-height: 1.6; }
.pms-hint { margin: -10px 0 20px !important; color: var(--pms-muted); font-size: 14px; }
.pms-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.pms-section-head h2 { font-size: 19px; font-weight: 800; }
.pms-section-head p { margin-top: 4px; color: var(--pms-muted); font-size: 13.5px; }
.pms-header-date { display: flex; align-items: center; gap: 8px; color: var(--pms-muted); font-weight: 600; }
.pms-date-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pms-success); }

.pms-card, .pms-panel, .pms-form-panel, .pms-profile-summary {
    background: var(--pms-surface); border: 1px solid var(--pms-border); border-radius: var(--pms-radius); box-shadow: var(--pms-shadow);
}
.pms-panel { margin-bottom: 24px; overflow: hidden; }
.pms-form-panel { padding: 28px; }
.pms-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 26px; border-bottom: 1px solid var(--pms-border); }
.pms-panel-heading h2 { font-size: 17px; font-weight: 800; }
.pms-panel-heading a { font-size: 13.5px; font-weight: 700; }
.pms-panel-heading span { color: var(--pms-muted); font-size: 13px; font-weight: 600; }
.pms-panel-heading form { margin: 0; }
.pms-panel > h2, .pms-form-panel > h2 { margin-bottom: 16px; font-size: 18px; font-weight: 800; }
.pms-panel + .pms-panel, .pms-form-panel + .pms-panel { margin-top: 0; }

.pms-card { margin-bottom: 24px; overflow: hidden; }
.pms-card-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 24px 28px; }
.pms-card-title { display: flex; align-items: center; gap: 16px; min-width: 0; }
.pms-card-title h2 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.pms-card-title p { margin-top: 3px; color: var(--pms-muted); font-size: 14.5px; max-width: 640px; }
.pms-card-actions { display: flex; align-items: center; gap: 18px; flex: none; }
.pms-badge-icon {
    display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 14px;
    background: var(--pms-primary-soft); color: var(--pms-primary);
}
.pms-badge-icon .pms-icon { width: 24px; height: 24px; }
.pms-badge-accent { background: linear-gradient(180deg, var(--pms-primary-light), var(--pms-primary-dark)); color: var(--pms-on-primary); box-shadow: var(--pms-glow); }
.pms-badge-danger { background: var(--pms-danger-soft); color: var(--pms-danger); }
.pms-link-arrow { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 15px; }
.pms-link-arrow .pms-icon { width: 18px; height: 18px; }

.pms-notice { display: flex; align-items: center; gap: 10px; padding: 14px 18px; margin: 0 0 20px; border: 1px solid transparent; border-radius: 14px; font-size: 14.5px; font-weight: 600; transition: opacity .35s ease, transform .35s ease; }
.pms-notice-success { background: var(--pms-success-soft); border-color: #bde8cd; color: #12683a; }
.pms-notice-error { background: var(--pms-danger-soft); border-color: #f6c4c6; color: #a12a2e; }
.pms-notice.is-leaving { opacity: 0; transform: translateY(-6px); }

/* KPI tiles: used by People, Reports, Real Estate, Invoicing, Expenses, Inventory… */
.pms-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 20px; margin: 0 0 26px; }
.pms-kpi, .pms-kpi-card {
    position: relative; padding: 22px 24px; border: 1px solid var(--pms-border); border-radius: 18px; background: var(--pms-surface); box-shadow: var(--pms-shadow);
}
.pms-kpi::before {
    content: ""; position: absolute; left: 24px; right: 24px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0;
    background: linear-gradient(90deg, var(--pms-primary), var(--pms-primary-light)); opacity: .85;
}
.pms-kpi-label, .pms-kpi-card small { display: block; color: var(--pms-muted); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.pms-kpi strong, .pms-kpi-card strong { display: block; margin-top: 8px; color: var(--pms-heading); font-size: 32px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pms-kpi-card { display: grid; grid-template-columns: auto 1fr; column-gap: 16px; align-items: center; min-height: 112px; }
.pms-kpi-card > .pms-icon { grid-row: 1 / span 2; width: 52px; height: 52px; padding: 13px; border-radius: 15px; background: var(--pms-primary-soft); color: var(--pms-primary); }
.pms-kpi-card strong { margin-top: 2px; font-size: 26px; }

/* 6 · Tables, chips, forms, buttons --------------------------------------- */
.pms-table-wrap, .pms-table-responsive { overflow-x: auto; }
.pms-table { width: 100%; border-collapse: collapse; border: 0; background: transparent; }
.pms-table thead th {
    padding: 14px 26px; background: var(--pms-surface-2); border-bottom: 1px solid var(--pms-border);
    color: var(--pms-muted); font-size: 12px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; text-align: left; white-space: nowrap;
}
.pms-table tbody th { padding: 15px 26px; border-bottom: 1px solid #edf1f8; color: var(--pms-muted); font-size: 14px; font-weight: 700; text-align: left; }
.pms-table tbody td { padding: 15px 26px; border-bottom: 1px solid #edf1f8; color: var(--pms-text); font-size: 14.5px; vertical-align: middle; }
.pms-table tbody tr:last-child :is(td, th) { border-bottom: 0; }
.pms-table tbody tr:hover :is(td, th) { background: var(--pms-primary-softer); }
.pms-table td strong { color: var(--pms-heading); font-weight: 700; }
.pms-empty { padding: 44px 24px !important; text-align: center; color: var(--pms-muted); font-weight: 600; }
.pms-row-actions { white-space: nowrap; }
.pms-row-actions a, .pms-row-actions button { margin-right: 14px; padding: 0; border: 0; background: none; color: var(--pms-primary); font-size: 14px; font-weight: 700; cursor: pointer; }
.pms-link-danger { color: var(--pms-danger) !important; }
.pms-person-cell { display: flex; align-items: center; gap: 12px; }
.pms-person-cell img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.pms-avatar-large img { width: 96px; height: 96px; border-radius: 28px; object-fit: cover; }

.pms-chip, .pms-status {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
    background: #eef2f8; color: #475a78; font-size: 12.5px; font-weight: 700; line-height: 1.3; white-space: nowrap;
}
/* The three task states follow the dashboard tiles: to do = brand, in progress = green, done = violet. */
.pms-status-todo { background: var(--pms-primary-soft); color: var(--pms-primary-dark); }
.pms-status-in_progress, .pms-status-in-progress, .pms-status-clocked_in { background: var(--pms-success-soft); color: #12683a; }
.pms-status-done, .pms-status-clocked_out { background: var(--pms-violet-soft); color: #5b21b6; }
.pms-status-approved, .pms-status-paid, .pms-status-active, .pms-status-completed, .pms-status-won, .pms-status-available, .pms-status-accepted, .pms-status-received, .pms-status-success { background: var(--pms-success-soft); color: #12683a; }
.pms-status-pending, .pms-status-partial, .pms-status-partially_paid, .pms-status-scheduled, .pms-status-negotiation, .pms-status-warning, .pms-badge-pending, .pms-badge-warning { background: var(--pms-warning-soft); color: #9a5a05; }
.pms-status-rejected, .pms-status-overdue, .pms-status-unpaid, .pms-status-lost, .pms-status-cancelled, .pms-status-canceled, .pms-status-declined, .pms-status-expired, .pms-status-danger, .pms-badge-danger { background: var(--pms-danger-soft); color: #a12a2e; }
.pms-status-sent, .pms-status-open, .pms-status-new, .pms-status-info, .pms-badge-info { background: var(--pms-info-soft); color: #075f8c; }
.pms-status-draft, .pms-status-inactive, .pms-status-closed, .pms-status-neutral { background: #eef2f8; color: #475a78; }
.pms-badge-success { background: var(--pms-success-soft); color: #12683a; }
.pms-badge-purple, .pms-status-purple { background: var(--pms-violet-soft); color: #5b21b6; }
.pms-priority-high { background: var(--pms-danger-soft); color: #a12a2e; }
.pms-priority-medium { background: var(--pms-warning-soft); color: #9a5a05; }
.pms-priority-low { background: var(--pms-info-soft); color: #075f8c; }
.pms-role-admin { background: var(--pms-primary-soft); color: var(--pms-primary-dark); }
.pms-role-staff { background: #eef2f8; color: #475a78; }
.pms-inventory-low { background: var(--pms-danger-soft) !important; color: #a12a2e !important; }

/* Buttons */
.pms-btn, .pms-btn-primary, .pms-btn-secondary, .pms-btn-danger, .pms-btn-success,
.pms-shell .button, .pms-wrap .button {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 46px; padding: 0 20px; border: 1px solid transparent; border-radius: 13px;
    font-size: 14.5px; font-weight: 700; line-height: 1; text-decoration: none; white-space: nowrap; cursor: pointer;
    transition: transform .12s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease;
}
.pms-btn:active, .pms-btn-primary:active, .pms-btn-secondary:active { transform: translateY(1px); }
.pms-btn-primary, .pms-shell .button-primary, .pms-wrap .button-primary, .pms-wrap input[type="submit"] {
    background: linear-gradient(180deg, var(--pms-primary-light), var(--pms-primary) 38%, var(--pms-primary-dark));
    color: var(--pms-on-primary) !important; box-shadow: var(--pms-glow), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.pms-btn-primary:hover, .pms-shell .button-primary:hover { color: var(--pms-on-primary) !important; filter: brightness(1.05); transform: translateY(-1px); }
.pms-btn-secondary, .pms-btn, .pms-shell .button:not(.button-primary), .pms-wrap .button:not(.button-primary) {
    background: #fff; border-color: var(--pms-border-strong); color: var(--pms-heading) !important;
}
.pms-btn-secondary:hover, .pms-btn:hover, .pms-shell .button:not(.button-primary):hover { background: var(--pms-surface-2); border-color: var(--pms-primary); color: var(--pms-heading) !important; }
.pms-btn.pms-btn-primary { border-color: transparent; color: var(--pms-on-primary) !important; }
.pms-btn-danger { background: var(--pms-danger-soft); border-color: #f6c4c6; color: #a12a2e !important; }
.pms-btn-danger:hover { background: #fbdcdc; }
.pms-btn-success { background: var(--pms-success); color: #fff !important; }
.pms-btn-small { height: 36px !important; padding: 0 14px !important; border-radius: 10px !important; font-size: 13px !important; }
.pms-btn:disabled, .pms-btn-primary:disabled, .pms-btn-secondary:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; transform: none; }
.pms-inline-form { display: inline; margin: 0; }

/* Forms */
.pms-form-row { margin-bottom: 18px; }
.pms-form-row > label, .pms-field > label, .pms-form-field > label { display: block; margin-bottom: 7px; color: var(--pms-heading); font-size: 13.5px; font-weight: 700; }
.pms-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; }
.pms-form-actions { display: flex; justify-content: flex-end; gap: 12px; padding: 6px 0 0; }
.pms-field { display: flex; flex-direction: column; gap: 7px; }
.pms-field-full { grid-column: 1 / -1; }
.pms-field small, .pms-form-row small { color: var(--pms-muted); font-size: 12.5px; line-height: 1.5; }
.pms-form-panel form > .pms-btn-primary, .pms-form-panel form > button.pms-btn-primary { margin-top: 6px; }

.pms-input,
:is(.pms-shell, .pms-wrap) :is(input[type="text"], input[type="search"], input[type="date"], input[type="time"], input[type="number"], input[type="email"], input[type="url"], input[type="password"], input[type="tel"], input[type="datetime-local"], select, textarea) {
    width: 100%; max-width: 100%; min-height: 46px; padding: 0 14px; margin: 0;
    border: 1px solid var(--pms-border-strong); border-radius: 12px; background: #fff; color: var(--pms-heading);
    font-size: 14.5px; font-weight: 500; box-shadow: none; transition: border-color .15s ease, box-shadow .15s ease;
}
:is(.pms-shell, .pms-wrap) textarea, textarea.pms-input { padding: 12px 14px; min-height: 108px; line-height: 1.55; }
:is(.pms-shell, .pms-wrap) select, select.pms-input { padding-right: 38px; appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2362728f' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center; }
.pms-input:hover, :is(.pms-shell, .pms-wrap) :is(input, select, textarea):hover { border-color: #b8c6de; }
.pms-input:focus,
:is(.pms-shell, .pms-wrap) :is(input, select, textarea):focus { border-color: var(--pms-primary); box-shadow: 0 0 0 4px var(--pms-primary-soft); outline: 0; }
:is(.pms-shell, .pms-wrap) :is(input[type="checkbox"], input[type="radio"]) { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--pms-primary); box-shadow: none; }
:is(.pms-shell, .pms-wrap) ::placeholder { color: #94a3bb; }
:is(.pms-shell, .pms-wrap) .description { color: var(--pms-muted); font-size: 13.5px; }
.pms-checkbox-row { align-self: end; }
.pms-checkbox-row label, .pms-invoice-check { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.pms-wrap .form-table { width: 100%; border-collapse: collapse; }
.pms-wrap .form-table th { width: 220px; padding: 18px 12px 18px 0; text-align: left; color: var(--pms-heading); font-weight: 700; }
.pms-wrap .form-table td { padding: 14px 0; }

.pms-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 20px; }
.pms-toolbar form { margin: 0; }
.pms-toolbar :is(.pms-input, select) { width: auto; min-width: 150px; }
.pms-search { position: relative; display: flex; align-items: center; gap: 10px; flex: 1; min-width: 240px; max-width: 520px; padding: 0 14px; height: 46px; border: 1px solid var(--pms-border-strong); border-radius: 12px; background: #fff; color: var(--pms-muted); }
.pms-search:focus-within { border-color: var(--pms-primary); box-shadow: 0 0 0 4px var(--pms-primary-soft); }
.pms-search input[type="search"], .pms-search input { flex: 1; min-width: 0; min-height: 0 !important; height: 100%; padding: 0 !important; border: 0 !important; box-shadow: none !important; background: transparent !important; }
.pms-search .pms-icon { flex: none; }

.pms-permission-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin: 22px 0; }
.pms-permission-group { padding: 20px; border: 1px solid var(--pms-border); border-radius: 16px; background: var(--pms-surface-2); }
.pms-permission-group h3 { margin-bottom: 12px; font-size: 15px; font-weight: 800; }
.pms-permission-group label { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; font-size: 14px; line-height: 1.4; font-weight: 500; }
.pms-permission-group input[type="checkbox"] { margin-top: 1px; }

/* 7 · Dashboard ------------------------------------------------------------ */
.pms-hero { position: relative; display: flex; align-items: flex-start; justify-content: space-between; min-height: 250px; margin: 0 0 30px; padding: 6px 0 40px; }
.pms-hero-copy { position: relative; z-index: 2; max-width: 640px; }
.pms-hero-kicker { margin-bottom: 8px !important; color: var(--pms-heading); font-size: 14px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; }
.pms-workspace-staff .pms-hero-kicker { color: var(--pms-muted); }
.pms-hero-title { font-size: clamp(34px, 4.6vw, 58px) !important; line-height: 1.08; font-weight: 800; letter-spacing: -.035em !important; }
.pms-hero-name { color: var(--pms-primary); }
.pms-wave { display: inline-block; transform-origin: 70% 70%; }
.pms-hero-sub { margin-top: 14px !important; color: var(--pms-muted); font-size: 19px; line-height: 1.5; }
.pms-city-art { position: absolute; right: -40px; bottom: -6px; z-index: 0; width: min(400px, 40%); height: auto; pointer-events: none; }
.pms-date-pill {
    position: absolute; right: 0; top: 0; z-index: 3; display: inline-flex; align-items: center; gap: 12px;
    padding: 13px 18px; border-radius: 16px; background: #fff; border: 1px solid var(--pms-border); box-shadow: var(--pms-shadow);
    color: var(--pms-heading); font-size: 15.5px; font-weight: 600;
}
.pms-date-pill .pms-icon { width: 20px; height: 20px; }
.pms-date-pill-small { position: static; padding: 11px 16px; border-radius: 14px; box-shadow: none; background: var(--pms-surface-2); font-size: 14.5px; }

.pms-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 0 0 28px; position: relative; z-index: 2; }
.pms-stat {
    --stat: var(--pms-primary); --stat-soft: var(--pms-primary-soft);
    position: relative; display: grid; grid-template-columns: 70px minmax(0, 1fr) 38px; grid-template-areas: "icon label go" "icon value value" "icon caption caption";
    column-gap: 20px; align-items: center; padding: 26px 26px 34px;
    border: 1px solid var(--pms-border); border-radius: 20px; background: #fff; box-shadow: var(--pms-shadow);
    color: var(--pms-heading) !important; transition: transform .15s ease, box-shadow .15s ease;
}
.pms-stat:hover { transform: translateY(-2px); box-shadow: var(--pms-shadow-lg); }
.pms-stat-progress { --stat: #16a34a; --stat-soft: rgba(22, 163, 74, .12); }
.pms-stat-done { --stat: var(--pms-violet); --stat-soft: rgba(124, 58, 237, .12); }
.pms-stat-icon { grid-area: icon; display: grid; place-items: center; width: 70px; height: 70px; border-radius: 19px; background: var(--stat-soft); color: var(--stat); }
.pms-stat-icon .pms-icon { width: 34px; height: 34px; stroke-width: 1.8; }
.pms-stat-label { grid-area: label; align-self: end; color: var(--pms-muted); font-size: 12.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.pms-stat-value { grid-area: value; font-size: 42px; line-height: 1.05; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.pms-stat-caption { grid-area: caption; color: var(--pms-muted); font-size: 16px; }
.pms-stat-go { grid-area: go; align-self: start; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #edf1f8; color: var(--pms-heading); }
.pms-stat-go .pms-icon { width: 18px; height: 18px; }
.pms-stat-bar { position: absolute; left: 26px; right: 26px; bottom: 16px; height: 3px; border-radius: 3px; background: var(--stat); opacity: .9; }

.pms-attendance { container-type: inline-size; }
.pms-attendance-stage {
    display: grid; grid-template-columns: minmax(230px, 1fr) 300px minmax(300px, 1.05fr); gap: 24px; align-items: center;
    margin: 0 28px; padding: 24px; border: 1px solid var(--pms-border); border-radius: 22px;
    background: linear-gradient(180deg, #f5f8ff, #edf3fc);
}
.pms-status-card { align-self: stretch; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 24px; border-radius: 18px; background: rgba(255, 255, 255, .7); border: 1px solid rgba(213, 222, 236, .6); }
.pms-status-label { display: flex; align-items: center; gap: 12px; color: var(--pms-muted); font-size: 16.5px; font-weight: 500; }
.pms-status-label .pms-icon { width: 28px; height: 28px; color: var(--pms-heading); }
.pms-status-value { display: flex; align-items: center; gap: 12px; }
.pms-status-value strong { color: var(--pms-heading); font-size: 32px; font-weight: 800; letter-spacing: -.02em; }
.pms-status-minutes { color: var(--pms-muted); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.pms-live-dot { display: inline-block; width: 12px; height: 12px; flex: none; border-radius: 50%; background: #cbd5e1; }
.pms-live-dot.is-live { background: var(--pms-success); animation: pms-pulse 1.8s ease-out infinite; }
.pms-status-value .pms-live-dot:not(.is-live) { background: var(--pms-success); opacity: .55; }

.pms-dial-wrap { display: grid; place-items: center; padding: 34px 0; }
.pms-dial { position: relative; width: 200px; height: 200px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 10px rgba(255, 255, 255, .75), 0 0 0 11px var(--pms-border), 0 22px 44px -18px rgba(30, 58, 138, .4); display: grid; place-items: center; }
.pms-dial::before {
    content: ""; position: absolute; inset: -32px; border-radius: 50%;
    background: repeating-conic-gradient(from -.6deg, rgba(98, 114, 143, .34) 0 1.2deg, transparent 1.2deg 7.5deg);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 9px), #000 calc(100% - 8px)); mask: radial-gradient(farthest-side, transparent calc(100% - 9px), #000 calc(100% - 8px));
}
.pms-dial.is-live { box-shadow: 0 0 0 10px var(--pms-primary-soft), 0 0 0 11px var(--pms-primary), 0 22px 44px -18px var(--pms-primary-ring); }
.pms-dial-inner { text-align: center; }
.pms-dial-inner strong { display: block; color: var(--pms-heading); font-size: 46px; line-height: 1; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.pms-dial-inner span { display: block; margin-top: 8px; color: var(--pms-muted); font-size: 15.5px; }

.pms-clock-actions { display: grid; gap: 14px; }
.pms-clock-btn {
    display: grid; grid-template-columns: 58px minmax(0, 1fr) 22px; align-items: center; gap: 16px;
    width: 100%; height: 88px; padding: 0 24px; border: 1.5px solid transparent; border-radius: 20px; text-align: left; cursor: pointer;
    transition: transform .12s ease, box-shadow .15s ease, filter .15s ease;
}
.pms-clock-btn:not(:disabled):hover { transform: translateY(-2px); }
.pms-clock-btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; filter: saturate(.6); }
.pms-clock-btn-icon { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; }
.pms-clock-btn-icon .pms-icon { width: 26px; height: 26px; }
.pms-clock-btn-copy { display: flex; flex-direction: column; line-height: 1.25; }
.pms-clock-btn-copy strong { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.pms-clock-btn-copy small { font-size: 14.5px; }
.pms-clock-btn > .pms-icon { width: 22px; height: 22px; }
.pms-clock-in { background: linear-gradient(135deg, #25b868, #11904c); color: #fff; box-shadow: 0 18px 30px -16px rgba(22, 163, 74, .85); }
.pms-clock-in .pms-clock-btn-icon { background: rgba(255, 255, 255, .22); }
.pms-clock-in .pms-clock-btn-icon .pms-icon { fill: currentColor; }
.pms-clock-in small { color: rgba(255, 255, 255, .88); }
.pms-clock-out { background: #fff6f6; border-color: #f6bcbf; color: #d1242a; }
.pms-clock-out .pms-clock-btn-icon { background: #ffe2e3; }
.pms-clock-out .pms-clock-btn-icon .pms-icon { fill: currentColor; width: 22px; height: 22px; }
.pms-clock-out small { color: #a8484c; }
.pms-attendance-note { min-height: 18px; color: var(--pms-danger); font-size: 13.5px; font-weight: 600; }
.pms-attendance-note:empty { display: none; }

.pms-attendance-meta { display: grid; grid-template-columns: 1fr 1fr; padding: 24px 28px 28px; }
.pms-attendance-meta > div { display: flex; align-items: center; gap: 16px; }
.pms-attendance-meta > div + div { padding-left: 28px; border-left: 1px solid var(--pms-border); }
.pms-meta-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--pms-surface-2); border: 1px solid var(--pms-border); color: var(--pms-heading); flex: none; }
.pms-meta-icon .pms-icon { width: 24px; height: 24px; }
.pms-attendance-meta small { display: block; color: var(--pms-muted); font-size: 14.5px; }
.pms-attendance-meta strong { display: block; color: var(--pms-heading); font-size: 19px; font-weight: 800; }

.pms-recent .pms-card-head { border-bottom: 1px solid var(--pms-border); }
.pms-recent .pms-card-title h2 { font-size: 26px; }
.pms-empty-state { display: flex; flex-direction: column; align-items: center; padding: 48px 24px 60px; text-align: center; }
.pms-empty-art { width: 170px; height: auto; margin-bottom: 14px; }
.pms-empty-state h3 { font-size: 21px; font-weight: 700; }
.pms-empty-state p { margin-top: 6px; color: var(--pms-muted); font-size: 16px; }
.pms-task-list { display: grid; }
.pms-task-row { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 22px; align-items: center; gap: 18px; padding: 18px 28px; border-top: 1px solid #edf1f8; color: var(--pms-heading) !important; font-size: 16px; font-weight: 600; }
.pms-task-row:first-child { border-top: 0; }
.pms-task-row:hover { background: var(--pms-primary-softer); }
.pms-task-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pms-task-go { width: 20px; height: 20px; color: var(--pms-muted); }
.pms-task-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--pms-primary); }
.pms-task-dot-in_progress { background: #16a34a; }
.pms-task-dot-done { background: var(--pms-violet); }

/* 8 · Module screens --------------------------------------------------------
   Every module (Payroll, Real Estate, CRM, Invoicing, Expenses, Inventory)
   uses the same segmented tab bar, so they all read as one product. */
:is(.pms-payroll-tabs, .pms-real-estate-tabs, .pms-crm-tabs, .pms-invoice-tabs, .pms-expense-tabs, .pms-inventory-tabs) {
    display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; margin: 0 0 24px; padding: 6px;
    border: 1px solid var(--pms-border); border-radius: 18px; background: #fff; box-shadow: var(--pms-shadow); scrollbar-width: none;
}
:is(.pms-payroll-tabs, .pms-real-estate-tabs, .pms-crm-tabs, .pms-invoice-tabs, .pms-expense-tabs, .pms-inventory-tabs)::-webkit-scrollbar { display: none; }
:is(.pms-payroll-tabs, .pms-real-estate-tabs, .pms-crm-tabs, .pms-invoice-tabs, .pms-expense-tabs, .pms-inventory-tabs) a {
    display: inline-flex; align-items: center; gap: 9px; padding: 12px 18px; border-radius: 13px; white-space: nowrap;
    color: var(--pms-muted); font-size: 14.5px; font-weight: 700; transition: background-color .15s ease, color .15s ease;
}
:is(.pms-payroll-tabs, .pms-real-estate-tabs, .pms-crm-tabs, .pms-invoice-tabs, .pms-expense-tabs, .pms-inventory-tabs) a .pms-icon { width: 19px; height: 19px; }
:is(.pms-payroll-tabs, .pms-real-estate-tabs, .pms-crm-tabs, .pms-invoice-tabs, .pms-expense-tabs, .pms-inventory-tabs) a:hover { background: var(--pms-surface-2); color: var(--pms-heading); }
:is(.pms-payroll-tabs, .pms-real-estate-tabs, .pms-crm-tabs, .pms-invoice-tabs, .pms-expense-tabs, .pms-inventory-tabs) a.is-active {
    background: linear-gradient(180deg, var(--pms-primary-light), var(--pms-primary) 38%, var(--pms-primary-dark)); color: var(--pms-on-primary); box-shadow: var(--pms-glow);
}

/* Real Estate */
.pms-real-estate-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.pms-real-estate-grid > .pms-panel { margin-bottom: 0; }
.pms-real-estate-mini-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--pms-border); }
.pms-real-estate-mini-list span { padding: 6px 13px; border-radius: 999px; background: var(--pms-primary-soft); color: var(--pms-primary-dark); font-size: 13px; font-weight: 700; }
.pms-real-estate-mini-list em { color: var(--pms-muted); font-size: 13.5px; }
.pms-re-listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; padding: 26px; }
.pms-re-listing-card { overflow: hidden; border: 1px solid var(--pms-border); border-radius: 18px; background: #fff; box-shadow: var(--pms-shadow); transition: transform .15s ease, box-shadow .15s ease; }
.pms-re-listing-card:hover { transform: translateY(-3px); box-shadow: var(--pms-shadow-lg); }
.pms-re-listing-image { position: relative; display: grid; place-items: center; height: 200px; overflow: hidden; background: linear-gradient(135deg, var(--pms-primary-soft), var(--pms-secondary-soft)); color: var(--pms-primary); }
.pms-re-listing-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pms-re-listing-image .pms-icon { width: 42px; height: 42px; opacity: .7; }
.pms-re-listing-type { position: absolute; top: 14px; left: 14px; padding: 6px 12px; border-radius: 999px; background: rgba(8, 20, 60, .78); backdrop-filter: blur(4px); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .03em; }
.pms-re-listing-body { padding: 18px 20px 20px; }
.pms-re-listing-code { color: var(--pms-muted); font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.pms-re-listing-body h3 { margin: 5px 0 10px; font-size: 18px; font-weight: 800; }
.pms-re-listing-price { display: block; color: var(--pms-primary); font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.pms-re-listing-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--pms-border); color: var(--pms-muted); font-size: 13px; font-weight: 600; }
.pms-re-image-picker { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pms-re-image-preview { display: flex; align-items: center; justify-content: center; gap: 8px; width: 200px; height: 120px; overflow: hidden; border: 2px dashed var(--pms-border-strong); border-radius: 16px; background: var(--pms-surface-2); color: var(--pms-muted); font-size: 13px; font-weight: 600; }
.pms-re-image-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pms-re-table-thumb, .pms-re-table-placeholder { width: 60px; height: 46px; border-radius: 10px; object-fit: cover; display: block; }
.pms-re-table-placeholder { display: grid; place-items: center; background: var(--pms-surface-2); color: var(--pms-muted); }
.pms-re-email-check { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding: 16px; border: 1px solid var(--pms-border); border-radius: 16px; background: var(--pms-surface-2); }
.pms-re-email-check > .pms-icon { width: 46px; height: 46px; padding: 12px; border-radius: 13px; background: var(--pms-primary-soft); color: var(--pms-primary); }
.pms-re-email-check strong { display: block; color: var(--pms-heading); font-size: 14.5px; }
.pms-re-email-check p { margin-top: 2px; color: var(--pms-muted); }
.pms-real-estate .pms-panel > form { margin: 0; }
.pms-real-estate .pms-panel > h2 { padding: 0; }

/* Real Estate: flats, tenants, expiry and miscellaneous bills */
.pms-re-occupancy-kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.pms-re-building { margin-bottom: 24px; }
.pms-re-building-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px 26px; border-bottom: 1px solid var(--pms-border); background: linear-gradient(180deg, var(--pms-surface-2), #fff); }
.pms-re-building-title { display: flex; align-items: center; gap: 16px; min-width: 0; }
.pms-re-building-title h2 { font-size: 21px; font-weight: 800; }
.pms-re-building-title p { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 5px; color: var(--pms-muted); font-size: 13.5px; }
.pms-re-occupancy { display: grid; grid-template-columns: auto auto; grid-template-areas: "count label" "meter meter"; align-items: baseline; column-gap: 8px; row-gap: 8px; min-width: 190px; text-align: left; }
.pms-re-occupancy strong { grid-area: count; color: var(--pms-heading); font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pms-re-occupancy span { grid-area: label; color: var(--pms-muted); font-size: 13.5px; font-weight: 600; }
.pms-re-meter { grid-area: meter; height: 8px; overflow: hidden; border-radius: 999px; background: #e3eaf6; }
.pms-re-meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--pms-primary), var(--pms-primary-light)); }
.pms-re-units-table { min-width: 1010px; }
.pms-re-units-table :is(th, td) { padding-left: 16px; padding-right: 16px; }
.pms-re-units-table :is(th, td):first-child { padding-left: 24px; white-space: nowrap; }
.pms-re-units-table :is(th, td):last-child { padding-right: 20px; }
.pms-re-units-table td:nth-child(3) .pms-re-sub { white-space: nowrap; }
.pms-re-units-table td { vertical-align: top; }
.pms-re-units-table tr.is-vacant td { background: var(--pms-primary-softer); }
.pms-re-units-table td strong { display: block; }
.pms-re-sub { display: block; margin-top: 2px; color: var(--pms-muted); font-size: 12.5px; font-weight: 500; line-height: 1.4; }
.pms-re-expiry { margin-top: 6px; }
.pms-re-bills-cell { min-width: 205px; }
.pms-bill-chip { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 0 0 6px; padding: 5px 5px 5px 10px; border: 1px solid var(--pms-border); border-radius: 12px; background: #fff; color: var(--pms-text); font-size: 12.5px; line-height: 1.35; }
.pms-bill-chip:last-child { margin-bottom: 0; }
.pms-bill-chip strong { display: inline; color: var(--pms-heading); }
.pms-bill-chip .pms-inline-form { display: flex; }
.pms-bill-x { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--pms-muted); cursor: pointer; }
.pms-bill-x:hover { background: var(--pms-danger-soft); color: var(--pms-danger); }
.pms-bill-x .pms-icon { width: 14px; height: 14px; }
.pms-re-actions { width: 196px; min-width: 196px; }
.pms-re-inline { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; margin: 0 0 8px; }
.pms-re-inline .pms-btn { flex: 1; white-space: nowrap; }
.pms-re-inline:last-child { margin-bottom: 0; }
.pms-re-inline select.pms-input { width: 78px; flex: none; min-height: 36px; padding: 0 28px 0 10px; border-radius: 10px; font-size: 13px; background-position: right 9px center; }
.pms-re-no-flats { margin: 0; }
.pms-re-forms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; margin-top: 8px; }
.pms-re-forms > .pms-panel { margin-bottom: 0; }
.pms-re-forms > .pms-panel.pms-re-add-flats { grid-column: 1 / -1; }
.pms-re-forms .pms-field-full { grid-column: 1 / -1; }
.pms-re-expiry-preview { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; padding: 14px 16px; border: 1px dashed var(--pms-primary); border-radius: 14px; background: var(--pms-primary-softer); color: var(--pms-heading); font-size: 14.5px; }
.pms-re-expiry-preview .pms-icon { width: 22px; height: 22px; color: var(--pms-primary); }
.pms-re-expiry-preview strong { color: var(--pms-primary-dark); }
.pms-re-setup-cell { min-width: 250px; }
.pms-re-setup-form { display: flex; align-items: center; gap: 6px; margin: 0; }
.pms-re-setup-form select.pms-input { width: auto; min-width: 104px; min-height: 36px; padding: 0 26px 0 10px; border-radius: 10px; font-size: 13px; background-position: right 8px center; }
.pms-status-ended, .pms-status-terminated { background: #eef2f8; color: #475a78; }
.pms-status-occupied { background: var(--pms-primary-soft); color: var(--pms-primary-dark); }
.pms-status-maintenance { background: var(--pms-warning-soft); color: #9a5a05; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Invoicing */
.pms-invoice-kpis, .pms-expense-kpis, .pms-inventory-kpis { margin-bottom: 24px; }
.pms-invoice-quick { margin-top: 24px; }
.pms-invoice-quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.pms-invoice-quick-grid .pms-btn { height: 52px; }
.pms-invoice-items { margin: 20px 0; }
.pms-invoice-items-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; color: var(--pms-heading); font-size: 15px; }
.pms-invoice-item-list { display: grid; gap: 10px; }
.pms-invoice-item { display: grid; grid-template-columns: minmax(0, 2fr) 120px 150px auto; gap: 10px; align-items: center; }
.pms-invoice-total { color: var(--pms-primary); font-size: 22px; font-weight: 800; }
.pms-invoice-builder { overflow: hidden; border: 1px solid var(--pms-border); border-radius: 22px; background: #fff; box-shadow: var(--pms-shadow-lg); }
.pms-invoice-builder-head { display: flex; justify-content: space-between; gap: 24px; padding: 28px 30px; background: linear-gradient(135deg, var(--pms-secondary-dark), var(--pms-secondary)); color: var(--pms-side-text); }
.pms-invoice-eyebrow { color: var(--pms-primary-light); font-size: 11.5px; font-weight: 800; letter-spacing: .16em; }
.pms-invoice-builder-head h3 { margin: 8px 0 4px; color: var(--pms-side-text); font-size: 24px; font-weight: 800; }
.pms-invoice-builder-head p { color: var(--pms-side-muted); }
.pms-invoice-number-badge { min-width: 160px; padding: 14px 16px; border: 1px solid var(--pms-side-line); border-radius: 14px; background: rgba(255, 255, 255, .07); color: var(--pms-side-muted); font-size: 12px; text-align: right; }
.pms-invoice-number-badge strong { display: block; margin-top: 4px; color: var(--pms-side-text); font-size: 15px; }
.pms-invoice-builder > .pms-form-grid, .pms-invoice-builder > .pms-form-field, .pms-invoice-builder > .pms-invoice-items { padding-left: 30px; padding-right: 30px; }
.pms-invoice-builder > .pms-form-grid:first-of-type { padding-top: 26px; }
.pms-invoice-check { padding: 12px 14px; border: 1px solid var(--pms-border); border-radius: 12px; background: var(--pms-surface-2); }
.pms-invoice-check span { display: flex; flex-direction: column; gap: 2px; }
.pms-invoice-check small { color: var(--pms-muted); line-height: 1.4; }
.pms-invoice-builder-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 30px; border-top: 1px solid var(--pms-border); background: var(--pms-surface-2); }
.pms-invoice-builder-footer > span { color: var(--pms-muted); font-size: 13px; }
.pms-invoice-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pms-invoice-actions .pms-inline-form { margin: 0; }

/* Payroll, reports, projects, people */
.pms-payroll-header { margin-bottom: 20px; }
.pms-payroll-report-total { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border: 1px solid var(--pms-border); border-radius: 16px; background: var(--pms-surface-2); }
.pms-payroll-report-total span { color: var(--pms-muted); font-weight: 700; }
.pms-payroll-report-total strong { color: var(--pms-heading); font-size: 28px; font-weight: 800; }
.pms-report-bars { display: grid; gap: 16px; padding: 4px 0; }
.pms-report-bars > div { display: grid; grid-template-columns: 120px 1fr 48px; gap: 14px; align-items: center; color: var(--pms-text); font-size: 14px; font-weight: 700; }
.pms-report-bars b { display: block; min-width: 4px; height: 11px; border-radius: 999px; background: linear-gradient(90deg, var(--pms-primary), var(--pms-primary-light)); }
.pms-report-bars strong { text-align: right; color: var(--pms-heading); }
.pms-report-filter { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.pms-project-assign-form { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 12px; align-items: end; margin-bottom: 20px; }
.pms-profile-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, .8fr); gap: 24px; align-items: start; }
.pms-profile-summary { padding: 30px; text-align: center; }
.pms-profile-summary h2 { margin: 16px 0 4px; font-size: 22px; font-weight: 800; }
.pms-profile-summary > p { margin: 0 0 22px; color: var(--pms-muted); }
.pms-profile-summary .pms-avatar-large { display: flex; justify-content: center; }
.pms-profile-meta { display: grid; gap: 4px; padding-top: 18px; border-top: 1px solid var(--pms-border); text-align: left; }
.pms-profile-meta span { color: var(--pms-muted); font-size: 12.5px; }
.pms-profile-meta strong { margin-bottom: 8px; color: var(--pms-heading); font-size: 14.5px; }
.pms-profile-summary .pms-btn-secondary { width: 100%; margin-top: 20px; }
.pms-clock-cta {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 150px; height: 46px; padding: 0 22px;
    border: 0; border-radius: 13px; background: linear-gradient(180deg, var(--pms-primary-light), var(--pms-primary) 38%, var(--pms-primary-dark));
    color: var(--pms-on-primary); font-size: 14.5px; font-weight: 700; cursor: pointer; box-shadow: var(--pms-glow);
}
.pms-clock-cta:disabled { opacity: .55; cursor: default; box-shadow: none; }
.pms-location-note { color: var(--pms-muted); font-size: 13px; }

/* 9 · Settings, login, front-end, responsive ----------------------------- */
.pms-settings-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 32px; align-items: start; }
.pms-settings-nav { position: sticky; top: 0; display: grid; gap: 4px; padding: 8px; border: 1px solid var(--pms-border); border-radius: 18px; background: #fff; box-shadow: var(--pms-shadow); }
.pms-settings-nav a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; color: var(--pms-muted); font-size: 14.5px; font-weight: 700; }
.pms-settings-nav a:hover { background: var(--pms-surface-2); color: var(--pms-heading); }
.pms-settings-nav .pms-icon { width: 19px; height: 19px; }
.pms-settings-stack { min-width: 0; }
.pms-settings-card { scroll-margin-top: 20px; }
.pms-settings-card .pms-card-head { padding-bottom: 8px; }
.pms-settings-card .pms-card-title h2 { font-size: 20px; }
.pms-settings-card .pms-card-title .description, .pms-settings-card .pms-card-title p { margin-top: 3px; color: var(--pms-muted); font-size: 14px; }
.pms-settings-rows { padding: 6px 28px 14px; }
.pms-setting-row { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; padding: 20px 0; border-top: 1px solid #edf1f8; }
.pms-setting-row:first-child { border-top: 0; }
.pms-setting-label { padding-top: 12px; color: var(--pms-heading); font-size: 14.5px; font-weight: 700; }
.pms-setting-control { min-width: 0; max-width: 560px; }
.pms-setting-control label { cursor: pointer; }
.pms-setting-control .regular-text, .pms-setting-control .large-text { width: 100%; }
.pms-setting-control input[type="number"] { width: 120px; }
.pms-setting-control p.description { margin-top: 8px; }
.pms-settings-time-range { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.pms-settings-time-range label { display: flex; flex-direction: column; gap: 6px; color: var(--pms-muted); font-size: 12.5px; font-weight: 700; }
.pms-settings-time-range input[type="time"] { width: 160px; }
.pms-company-logo-setting img { padding: 12px; border: 1px solid var(--pms-border); border-radius: 14px; background: #fff; }
.pms-brand-studio { padding: 8px 28px 4px; }
.pms-brand-presets { display: flex; flex-wrap: wrap; gap: 10px; }
.pms-preset { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border: 1px solid var(--pms-border-strong); border-radius: 14px; background: #fff; color: var(--pms-heading); font-size: 14px; font-weight: 700; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
.pms-preset:hover { border-color: var(--pms-primary); box-shadow: 0 0 0 4px var(--pms-primary-soft); }
.pms-preset-swatch { display: inline-flex; overflow: hidden; width: 46px; height: 30px; border-radius: 9px; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08); }
.pms-preset-swatch i { flex: 1; display: block; }
.pms-brand-hint { margin: 12px 0 0; color: var(--pms-muted); font-size: 13.5px; }
.pms-shell .wp-picker-container { display: inline-flex; align-items: center; gap: 8px; }
.pms-shell .wp-picker-container .wp-color-result.button { height: 46px; min-height: 46px; margin: 0; padding: 0 0 0 46px; }
.pms-shell .wp-picker-container .wp-color-result-text { line-height: 44px; padding: 0 14px; }
.pms-shell .wp-picker-container input[type="text"].wp-color-picker { width: 110px; }
.pms-shell .wp-picker-holder { position: absolute; z-index: 30; }
.pms-save-bar { position: sticky; bottom: 0; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 8px; padding: 16px 22px; border: 1px solid var(--pms-border); border-radius: 18px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); box-shadow: var(--pms-shadow-lg); }
.pms-save-bar span { color: var(--pms-muted); font-size: 14px; }

/* Front-end shortcodes ([pms_login], [pms_dashboard]) */
.pms-wrap.pms-frontend { max-width: 980px; margin: 0 auto; padding: 24px 16px; }
.pms-wrap.pms-frontend .pms-panel { margin-bottom: 20px; }
.pms-login-wrap { display: grid; place-items: center; min-height: 60vh; }
.pms-login-card { width: min(440px, 100%); padding: 34px 32px 28px; border: 1px solid var(--pms-border); border-radius: 22px; background: #fff; box-shadow: var(--pms-shadow-lg); }
.pms-login-brand { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 8px; color: var(--pms-heading); font-size: 20px; font-weight: 800; }
.pms-login-lede { margin-bottom: 22px !important; text-align: center; color: var(--pms-muted); font-size: 14.5px; }
.pms-login-card form p { margin: 0 0 16px; }
.pms-login-card form label { display: block; margin-bottom: 6px; color: var(--pms-heading); font-size: 13.5px; font-weight: 700; }
.pms-login-card form .login-remember label { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.pms-login-card form .login-submit input { width: 100%; height: 48px; border: 0; border-radius: 13px; cursor: pointer; }
.pms-login-forgot { margin-top: 6px; text-align: center; font-size: 14px; }
.pms-already-in, .pms-frontend-denied { padding: 16px 20px; border-radius: 14px; background: var(--pms-primary-soft); color: var(--pms-primary-dark); font-weight: 600; }
.pms-toasts { position: fixed; right: 24px; bottom: 24px; z-index: 40; display: grid; gap: 10px; }

/* 10 · Refinements: buttons, form fields, spacing --------------------------
   Variant colours use a doubled class so they always beat the base .pms-btn
   (which is the neutral, white button). Without this, "pms-btn pms-btn-primary"
   rendered white text on a white button. */
.pms-btn.pms-btn-primary, .pms-btn-primary.pms-btn-small {
    background: linear-gradient(180deg, var(--pms-primary-light), var(--pms-primary) 38%, var(--pms-primary-dark));
    border-color: transparent; color: var(--pms-on-primary) !important;
    box-shadow: var(--pms-glow), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.pms-btn.pms-btn-primary:hover { background: linear-gradient(180deg, var(--pms-primary-light), var(--pms-primary) 38%, var(--pms-primary-dark)); border-color: transparent; color: var(--pms-on-primary) !important; filter: brightness(1.06); transform: translateY(-1px); }
.pms-btn.pms-btn-danger { background: var(--pms-danger-soft); border-color: #f6c4c6; color: #a12a2e !important; box-shadow: none; }
.pms-btn.pms-btn-danger:hover { background: #fbdcdc; border-color: #eea5a8; color: #8c2125 !important; }
.pms-btn.pms-btn-success { background: var(--pms-success); border-color: transparent; color: #fff !important; }
.pms-btn { min-width: 0; }
.pms-btn-primary > .pms-icon, .pms-btn-secondary > .pms-icon, .pms-btn-danger > .pms-icon { width: 18px; height: 18px; }
button.pms-btn, button.pms-btn-primary, button.pms-btn-secondary, button.pms-btn-danger { font-family: inherit; }

/* Groups of actions inside table cells (expenses approve/reject/paid, invoice preview/download/send) */
.pms-table td > .pms-btn, .pms-table td > form, .pms-table td > a.pms-btn { margin: 2px 6px 2px 0; vertical-align: middle; }
.pms-table td form { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 2px 6px 2px 0; }
.pms-invoice-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.pms-invoice-actions form { margin: 0; }
.pms-table td .pms-btn-small { height: 34px !important; }

/* Fields where the label wraps the control: <label>Category<select></label> */
.pms-form-grid > label, .pms-form-field, label.pms-form-field {
    display: flex; flex-direction: column; gap: 7px; margin: 0 0 18px;
    color: var(--pms-heading); font-size: 13.5px; font-weight: 700; line-height: 1.35;
}
.pms-form-grid > label > :is(input, select, textarea), .pms-form-field > :is(input, select, textarea) { font-weight: 500; }
.pms-form-grid > label > span { color: var(--pms-heading); font-size: 13.5px; font-weight: 700; }
.pms-form-grid > label > small, .pms-form-row > small, .pms-field > small { font-weight: 500; }
form > label.pms-form-field { margin-bottom: 18px; }
.pms-form-panel form > .pms-btn-primary, .pms-form-panel form > button[type="submit"] { margin-top: 4px; }
.pms-form-row > label .pms-optional, .pms-optional { color: var(--pms-muted); font-size: 12.5px; font-weight: 500; }
.pms-inline-field { display: flex; gap: 8px; align-items: stretch; }
.pms-inline-field > input { flex: 1; min-width: 0; }
.pms-form-row > p.description, .pms-form-row > .description { margin-top: 7px; }

/* Text sizing: some screens carry tiny inline sizes; keep every note readable */
:is(.pms-shell, .pms-wrap) [style*="font-size:11px"], :is(.pms-shell, .pms-wrap) [style*="font-size: 11px"],
:is(.pms-shell, .pms-wrap) [style*="font-size:12px"], :is(.pms-shell, .pms-wrap) [style*="font-size: 12px"] { font-size: 13px !important; line-height: 1.5 !important; }
:is(.pms-shell, .pms-wrap) .pms-table td small, :is(.pms-shell, .pms-wrap) .pms-table td br + small { color: var(--pms-muted); font-size: 12.5px; line-height: 1.5; }
.pms-table td { line-height: 1.5; }
.pms-table td strong + br { display: none; }
.pms-table td strong + br + small { display: block; margin-top: 2px; }
.pms-page-header h1 + p, .pms-page-header .pms-hint { margin-top: 6px; }
.pms-section-head > h2:only-child { margin: 0; }
.pms-panel-heading > h2, .pms-section-head h2 { line-height: 1.3; }
.pms-form-panel .pms-section-head { margin-bottom: 20px; }
.pms-panel > .pms-section-head { padding: 22px 26px 0; margin-bottom: 14px; }
.pms-panel > .pms-table-wrap > .pms-table, .pms-panel > .pms-table { margin: 0; }

/* Compact inputs inside tables / inline controls */
.pms-input-narrow { width: 92px !important; }
.pms-table td .pms-input, .pms-input-inline { min-height: 38px; padding-top: 0; padding-bottom: 0; border-radius: 10px; font-size: 13.5px; }
.pms-input-inline { width: auto; min-width: 150px; }
.pms-table td select.pms-input { padding-right: 32px; }

/* Spacing fixes: form panels carry their own padding; quick-action grids sit inside their card */
.pms-panel.pms-form-panel > .pms-section-head, .pms-form-panel .pms-section-head { padding: 0; }
.pms-invoice-quick-grid { padding: 0 26px 26px; }
.pms-status-auto { color: var(--pms-muted); font-size: 13px; line-height: 1.5; }

/* Profile photo */
.pms-avatar-editor { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.pms-avatar-editor .pms-avatar-preview { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 4px #fff, 0 6px 20px rgba(15, 23, 42, .18); }
.pms-avatar-editor form { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0; }
.pms-avatar-editor form > * { margin: 0 !important; }
.pms-inline-field > .pms-btn { flex: none; }
.pms-avatar-editor input[type="file"] { max-width: 260px; font-size: 13px; }

/* CRM pipeline stages */
.pms-stage-table td { vertical-align: middle; }
.pms-stage-table td:first-child { min-width: 200px; }
.pms-stage-actions { white-space: nowrap; }
.pms-stage-actions .pms-btn { margin-right: 6px; }

/* Tenant portal: wallet, home, complaints */
.pms-stat-money { font-size: 26px; letter-spacing: -.02em; line-height: 1.15; }
.pms-amount-in { color: #12683a; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pms-amount-out { color: #a12a2e; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pms-save-meter { height: 10px; overflow: hidden; border-radius: 999px; background: #e3eaf6; }
.pms-save-meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--pms-primary), var(--pms-primary-light)); transition: width .4s ease; }
.pms-save-meter-lg { height: 14px; }
.pms-save-meter-light { background: rgba(255, 255, 255, .25); }
.pms-save-meter-light i { background: #fff; }

/* The wallet card on the tenant dashboard */
.pms-wallet-card { position: relative; display: grid; gap: 22px; margin: 0 0 28px; padding: 28px 32px; border-radius: 24px; overflow: hidden; color: #fff; background: linear-gradient(135deg, var(--pms-secondary) 0%, var(--pms-primary-dark) 55%, var(--pms-primary) 100%); box-shadow: 0 24px 48px -20px var(--pms-primary-ring), var(--pms-shadow-lg); }
.pms-wallet-card::before { content: ""; position: absolute; right: -80px; top: -90px; width: 320px; height: 320px; border-radius: 50%; background: rgba(255, 255, 255, .09); }
.pms-wallet-card::after { content: ""; position: absolute; right: 90px; bottom: -140px; width: 300px; height: 300px; border-radius: 50%; background: rgba(255, 255, 255, .06); }
.pms-wallet-card > * { position: relative; z-index: 1; }
.pms-wallet-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pms-wallet-card-title { display: inline-flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; letter-spacing: .02em; }
.pms-wallet-card-title .pms-icon { width: 22px; height: 22px; }
.pms-wallet-card-chip { padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, .16); font-size: 13px; font-weight: 700; }
.pms-wallet-card-balance small { display: block; color: rgba(255, 255, 255, .78); font-size: 13.5px; font-weight: 600; }
.pms-wallet-card-balance strong { display: block; margin-top: 2px; font-size: clamp(34px, 5vw, 52px); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pms-wallet-card-save-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 9px; font-size: 14px; color: rgba(255, 255, 255, .9); }
.pms-wallet-card-save-head strong { font-size: 20px; font-weight: 800; }
.pms-wallet-card-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.pms-wallet-card-btn { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 22px; border-radius: 13px; background: rgba(255, 255, 255, .16); color: #fff !important; font-size: 14.5px; font-weight: 700; transition: background-color .15s ease; }
.pms-wallet-card-btn:hover { background: rgba(255, 255, 255, .26); }
.pms-wallet-card-btn.is-primary { background: #fff; color: var(--pms-primary-dark) !important; }
.pms-wallet-card-btn.is-primary:hover { background: #fff; filter: brightness(.96); }
.pms-wallet-card-btn .pms-icon { width: 18px; height: 18px; }

.pms-home-card { margin-bottom: 24px; }
.pms-home-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding: 4px 28px 8px; }
.pms-home-grid > div { padding: 14px 16px; border: 1px solid var(--pms-border); border-radius: 14px; background: var(--pms-surface-2); }
.pms-home-grid span { display: block; color: var(--pms-muted); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.pms-home-grid strong { display: block; margin-top: 4px; color: var(--pms-heading); font-size: 17px; font-weight: 800; }
.pms-home-grid small { color: var(--pms-muted); font-size: 12.5px; }
.pms-home-paid { padding: 18px 28px 6px; }
.pms-home-paid-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.pms-home-paid-head strong { color: var(--pms-heading); font-size: 14.5px; }
.pms-home-paid-head span { color: var(--pms-muted); font-size: 13.5px; font-weight: 600; }
.pms-home-paid small { display: block; margin-top: 8px; color: var(--pms-muted); font-size: 13px; }
.pms-home-bills { padding: 14px 28px 22px; }
.pms-home-bills h3 { margin-bottom: 8px; font-size: 14.5px; font-weight: 800; }
.pms-home-bills ul { margin: 0; padding: 0; list-style: none; }
.pms-home-bills li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid #edf1f8; font-size: 14px; }
.pms-home-bills li strong { color: var(--pms-heading); font-weight: 700; text-align: right; }

.pms-wallet-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.pms-wallet-main, .pms-wallet-side { display: grid; gap: 24px; min-width: 0; }
.pms-wallet-main .pms-panel, .pms-wallet-side .pms-panel { margin-bottom: 0; }
.pms-wallet-hero { padding: 26px 28px; border-radius: var(--pms-radius); color: #fff; background: linear-gradient(135deg, var(--pms-secondary), var(--pms-primary-dark) 60%, var(--pms-primary)); box-shadow: var(--pms-shadow-lg); }
.pms-wallet-label { display: block; color: rgba(255, 255, 255, .8); font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.pms-wallet-balance { display: block; margin: 4px 0 18px; font-size: clamp(32px, 4.4vw, 46px); font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.pms-wallet-hero .pms-save-meter { background: rgba(255, 255, 255, .25); }
.pms-wallet-hero .pms-save-meter i { background: #fff; }
.pms-wallet-meter-text { display: flex; align-items: baseline; gap: 10px; margin: 12px 0 0 !important; color: rgba(255, 255, 255, .92); font-size: 14px; }
.pms-wallet-meter-text strong { font-size: 22px; font-weight: 800; }
.pms-bank-card { display: grid; gap: 10px; margin: 0 0 16px; padding: 18px; border: 1px solid var(--pms-border); border-radius: 16px; background: var(--pms-surface-2); }
.pms-bank-card > div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; align-items: center; }
.pms-bank-card dt { color: var(--pms-muted); font-size: 12.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.pms-bank-card dd { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0; color: var(--pms-heading); font-size: 16px; font-weight: 700; }
.pms-bank-card .is-number [data-copy-value] { font-size: 22px; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.pms-copy-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--pms-border-strong); border-radius: 9px; background: #fff; color: var(--pms-heading); font-size: 12.5px; font-weight: 700; cursor: pointer; }
.pms-copy-btn .pms-icon { width: 14px; height: 14px; display: none; }
.pms-copy-btn.is-copied { border-color: var(--pms-success); color: #12683a; background: var(--pms-success-soft); }
.pms-copy-btn.is-copied .pms-icon { display: inline-block; }
.pms-proof-list { margin: 0; padding: 0; list-style: none; }
.pms-proof-list li { display: grid; gap: 4px; padding: 14px 24px; border-top: 1px solid #edf1f8; }
.pms-proof-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pms-proof-top strong { color: var(--pms-heading); font-size: 16px; font-weight: 800; }
.pms-proof-list small { color: var(--pms-muted); font-size: 13px; }
.pms-proof-note { color: #12683a !important; }
.pms-proof-note.is-bad { color: #a12a2e !important; }

.pms-complaints-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.pms-complaints-layout .pms-panel { margin-bottom: 0; }
.pms-complaint-list { margin: 0; padding: 0; list-style: none; }
.pms-complaint-list li + li { border-top: 1px solid #edf1f8; }
.pms-complaint-list a { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 24px; color: var(--pms-heading) !important; }
.pms-complaint-list a:hover { background: var(--pms-primary-softer); }
.pms-complaint-title { display: grid; gap: 2px; min-width: 0; }
.pms-complaint-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.pms-complaint-title small { color: var(--pms-muted); font-size: 12.5px; }
.pms-complaint-chips { display: inline-flex; gap: 6px; flex: none; }
.pms-complaint-detail { overflow: visible; }
.pms-complaint-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 26px 8px; }
.pms-complaint-head h2 { font-size: 22px; font-weight: 800; }
.pms-complaint-head p { margin-top: 4px; color: var(--pms-muted); font-size: 13.5px; }
.pms-thread { display: grid; gap: 14px; padding: 18px 26px; }
.pms-msg { max-width: 86%; padding: 14px 18px; border-radius: 16px; background: var(--pms-surface-2); border: 1px solid var(--pms-border); }
.pms-msg.is-mine { justify-self: end; background: var(--pms-primary-soft); border-color: var(--pms-primary-ring); }
.pms-msg-meta { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 4px; font-size: 12.5px; }
.pms-msg-meta strong { color: var(--pms-heading); font-weight: 800; }
.pms-msg-meta span { color: var(--pms-muted); }
.pms-msg p { margin: 0; color: var(--pms-text); font-size: 14.5px; line-height: 1.6; overflow-wrap: anywhere; }
.pms-msg-photo { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13.5px; font-weight: 700; }
.pms-msg-photo .pms-icon { width: 18px; height: 18px; }
.pms-reply-form { display: grid; gap: 12px; padding: 4px 26px 24px; }
.pms-reply-form .pms-form-field { margin: 0; }
.pms-reply-form .pms-btn-primary { justify-self: start; }

/* Staff: reviewing payments */
.pms-proof-table td { vertical-align: top; }
.pms-proof-decide { min-width: 310px; }
.pms-proof-approve { display: flex !important; flex-wrap: nowrap !important; gap: 6px; align-items: center; margin: 0 0 8px !important; }
.pms-proof-approve .pms-input-money { flex: none; width: 120px !important; max-width: 120px; }
.pms-proof-approve .pms-btn { flex: 1; white-space: nowrap; }
.pms-proof-reject { display: grid !important; gap: 6px; margin-top: 8px !important; }
.pms-mini-meter { width: 110px; height: 8px; overflow: hidden; border-radius: 999px; background: #e3eaf6; }
.pms-mini-meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--pms-primary), var(--pms-primary-light)); }
@media (max-width: 1100px) { .pms-wallet-layout, .pms-complaints-layout { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .pms-home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-inline: 16px; } .pms-wallet-card { padding: 22px 20px; } .pms-bank-card > div { grid-template-columns: 1fr; gap: 4px; } .pms-msg { max-width: 100%; } .pms-complaint-head { flex-direction: column; } }

/* Getting started checklist */
.pms-setup { margin-bottom: 28px; }
.pms-setup-meter { width: 220px; height: 8px; overflow: hidden; border-radius: 999px; background: #e3eaf6; flex: none; }
.pms-setup-meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--pms-primary), var(--pms-primary-light)); }
.pms-setup-list { margin: 0; padding: 0 28px 14px; list-style: none; }
.pms-setup-list li { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid #edf1f8; }
.pms-setup-tick { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border: 2px solid var(--pms-border-strong); border-radius: 50%; color: #fff; }
.pms-setup-tick .pms-icon { width: 15px; height: 15px; stroke-width: 3; }
.pms-setup-list li.is-done .pms-setup-tick { border-color: var(--pms-success); background: var(--pms-success); }
.pms-setup-text { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.pms-setup-text strong { color: var(--pms-heading); font-size: 15px; font-weight: 700; }
.pms-setup-text small { color: var(--pms-muted); font-size: 13px; }
.pms-setup-list li.is-done .pms-setup-text strong { color: var(--pms-muted); text-decoration: line-through; text-decoration-color: var(--pms-border-strong); }
@media (max-width: 900px) { .pms-setup-meter { width: 100%; } }

/* Payroll: editable and printable payslips */
.pms-payslip-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 4px 0 18px; }
.pms-payslip-summary > div { padding: 14px 16px; border: 1px solid var(--pms-border); border-radius: 14px; background: var(--pms-surface-2); }
.pms-payslip-summary span { display: block; color: var(--pms-muted); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.pms-payslip-summary strong { display: block; margin-top: 4px; color: var(--pms-heading); font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pms-payslip-summary .is-net { background: var(--pms-primary-soft); border-color: var(--pms-primary-ring); }
.pms-payslip-summary .is-net strong { color: var(--pms-primary-dark); font-size: 20px; }
.pms-row-actions .pms-btn:not(.pms-btn-primary):not(.pms-btn-danger) { padding: 0 14px; margin-right: 6px; border: 1px solid var(--pms-border-strong); background: #fff; color: var(--pms-heading) !important; font-size: 13px; }
.pms-row-actions .pms-btn { margin-right: 6px; }
.pms-payslip-basic { margin-bottom: 10px; }
.pms-payslip-h3 { margin: 28px 0 12px; font-size: 16px; font-weight: 800; }
.pms-payslip-items td { vertical-align: middle; }
.pms-input-money { max-width: 170px; }
.pms-payslip-add { margin-top: 18px; padding: 18px 18px 4px; border: 1px dashed var(--pms-primary); border-radius: 16px; background: var(--pms-primary-softer); }
.pms-payslip-add-grid { grid-template-columns: minmax(200px, 1.2fr) minmax(200px, 1.4fr) minmax(130px, .8fr) auto; align-items: end; }
.pms-payslip-flow { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--pms-border); flex-wrap: wrap; }
.pms-payslip-doc { max-width: 880px; margin: 0 auto 32px; padding: 40px 44px; border: 1px solid var(--pms-border); border-radius: 12px; background: #fff; box-shadow: var(--pms-shadow); color: #1f2937; }
.pms-payslip-head { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 20px; border-bottom: 2px solid var(--pms-heading); }
.pms-payslip-head h2 { font-size: 22px; font-weight: 800; }
.pms-payslip-head p { margin-top: 4px; color: var(--pms-muted); font-size: 13px; }
.pms-payslip-title { text-align: right; }
.pms-payslip-title strong { display: block; color: var(--pms-primary); font-size: 22px; font-weight: 800; letter-spacing: .12em; }
.pms-payslip-title span { color: var(--pms-muted); font-size: 13px; }
.pms-payslip-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 22px 0; }
.pms-payslip-meta dt { color: var(--pms-muted); font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.pms-payslip-meta dd { margin: 3px 0 0; color: var(--pms-heading); font-size: 14.5px; font-weight: 700; }
.pms-payslip-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.pms-payslip-table { width: 100%; border-collapse: collapse; }
.pms-payslip-table th { padding: 9px 0; border-bottom: 1px solid var(--pms-border-strong); color: var(--pms-muted); font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
.pms-payslip-table th:last-child, .pms-payslip-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.pms-payslip-table td { padding: 9px 0; border-bottom: 1px solid #edf1f8; font-size: 14px; }
.pms-payslip-table .is-total td { border-top: 2px solid var(--pms-border-strong); border-bottom: 0; font-weight: 800; color: var(--pms-heading); }
.pms-payslip-net { display: flex; align-items: center; justify-content: space-between; margin-top: 26px; padding: 18px 22px; border-radius: 12px; background: var(--pms-heading); color: #fff; }
.pms-payslip-net span { font-size: 13px; font-weight: 800; letter-spacing: .14em; }
.pms-payslip-net strong { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pms-payslip-notes { margin-top: 18px !important; color: var(--pms-muted); font-size: 13.5px; }
@media (max-width: 900px) { .pms-payslip-summary { grid-template-columns: repeat(2, 1fr); } .pms-payslip-cols, .pms-payslip-meta { grid-template-columns: 1fr; } .pms-payslip-add-grid { grid-template-columns: 1fr; } .pms-payslip-doc { padding: 24px 20px; } }
@media print {
    body.pms-fullscreen-app { overflow: visible !important; background: #fff !important; }
    #adminmenumain, #wpadminbar, #wpfooter, .pms-shell-sidebar, .pms-shell-topbar, .pms-no-print, .pms-page-header, .pms-payroll-tabs, .pms-notice, .pms-toasts, .pms-progress { display: none !important; }
    .pms-shell { position: static !important; display: block !important; overflow: visible !important; background: #fff !important; }
    .pms-shell-body, .pms-shell-main { display: block !important; overflow: visible !important; background: #fff !important; }
    .pms-content { max-width: none !important; padding: 0 !important; }
    .pms-payslip-doc { border: 0 !important; box-shadow: none !important; padding: 0 !important; max-width: none !important; }
    .pms-payslip-net { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Edit affordances */
.pms-row-edit { display: inline-block; margin-left: 10px; font-size: 12.5px; font-weight: 700; }
td > strong + .pms-row-edit { display: block; margin: 2px 0 0; }
.pms-edit-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--pms-primary-soft); border-color: var(--pms-primary-ring); color: var(--pms-primary-dark); }
.pms-edit-panel { border-color: var(--pms-primary); box-shadow: 0 0 0 4px var(--pms-primary-soft), var(--pms-shadow); }
.pms-form-actions-start { justify-content: flex-start; align-items: center; }
.pms-manage { display: block; }
.pms-manage > summary { list-style: none; cursor: pointer; width: 100%; }
.pms-manage > summary::-webkit-details-marker { display: none; }
.pms-manage > summary .pms-icon { width: 14px; height: 14px; margin-left: 2px; }
.pms-manage-menu a, .pms-manage-menu button { white-space: nowrap; }
.pms-manage-menu { margin-top: 6px; padding: 6px; border: 1px solid var(--pms-border); border-radius: 12px; background: #fff; }
.pms-manage-menu a, .pms-manage-menu button { display: block; width: 100%; padding: 9px 12px; border: 0; border-radius: 8px; background: none; color: var(--pms-heading) !important; font-size: 13.5px; font-weight: 600; text-align: left; cursor: pointer; }
.pms-manage-menu a:hover, .pms-manage-menu button:hover { background: var(--pms-surface-2); }
.pms-manage-menu .pms-manage-danger { color: var(--pms-danger) !important; }
.pms-manage-menu form { margin: 0; display: block; }

/* Flat builder: many flats, each with its own tenant */
.pms-flats-section { margin: 4px 0 8px; padding: 20px; border: 1px solid var(--pms-border); border-radius: 18px; background: var(--pms-surface-2); }
.pms-flats-section .pms-section-head { margin-bottom: 16px; }
.pms-flat-builder { display: grid; gap: 16px; }
.pms-flat-quick { display: grid; gap: 14px; padding: 18px; border: 1px dashed var(--pms-primary); border-radius: 16px; background: var(--pms-primary-softer); }
.pms-flat-quick-text { display: grid; gap: 2px; }
.pms-flat-quick-text strong { color: var(--pms-heading); font-size: 14.5px; }
.pms-flat-quick-text span { color: var(--pms-muted); font-size: 13px; line-height: 1.5; }
.pms-flat-quick-fields { display: grid; grid-template-columns: 90px minmax(150px, 1.4fr) 100px 100px minmax(110px, 1fr) auto; gap: 12px; align-items: end; }
.pms-flat-quick-fields .pms-form-field { margin: 0; }
.pms-flat-quick-fields .pms-btn { height: 46px; }
.pms-flat-rows { display: grid; gap: 14px; }
.pms-flat-row { padding: 18px; border: 1px solid var(--pms-border-strong); border-radius: 16px; background: #fff; box-shadow: var(--pms-shadow); }
.pms-flat-row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.pms-flat-row-head strong { color: var(--pms-heading); font-size: 15.5px; font-weight: 800; }
.pms-flat-row-actions { display: inline-flex; gap: 8px; }
.pms-flat-grid { display: grid; grid-template-columns: minmax(160px, 1.5fr) 80px 90px 90px minmax(120px, 1fr) minmax(130px, 1fr); gap: 12px; }
.pms-flat-grid .pms-form-field, .pms-flat-tenant .pms-form-field { margin: 0; }
.pms-flat-tenant { display: grid; grid-template-columns: minmax(220px, 1fr); gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--pms-border); }
.pms-flat-new, .pms-flat-term { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.pms-flat-new[hidden], .pms-flat-term[hidden] { display: none; }
.pms-flat-expiry { margin: 0 !important; padding: 0 0 12px; color: var(--pms-primary-dark); font-size: 13.5px; font-weight: 700; }
.pms-flat-expiry:empty { display: none; }
.pms-flat-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pms-flat-currency { display: inline-flex; align-items: center; gap: 8px; color: var(--pms-muted); font-size: 13.5px; font-weight: 600; }
.pms-flat-note { margin: 0 !important; color: var(--pms-muted); font-size: 13px; }

/* Email */
.pms-email-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); gap: 24px; align-items: start; margin-bottom: 24px; }
.pms-email-layout > .pms-panel { margin-bottom: 0; }
.pms-email-note { margin: 0 0 14px !important; color: var(--pms-muted); font-size: 13.5px; line-height: 1.6; }
.pms-email-note code { padding: 1px 6px; border-radius: 6px; background: var(--pms-surface-2); font-size: 12.5px; }
.pms-email-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--pms-border); }
.pms-email-stats strong { display: block; color: var(--pms-heading); font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.pms-email-stats span { color: var(--pms-muted); font-size: 12.5px; font-weight: 600; }
.pms-filter-pills { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--pms-surface-2); }
.pms-filter-pills a { padding: 7px 14px; border-radius: 9px; color: var(--pms-muted); font-size: 13px; font-weight: 700; }
.pms-filter-pills a.is-active { background: #fff; color: var(--pms-heading); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
[hidden] { display: none !important; }

/* Role picker (a person can hold several roles) */
.pms-role-picker { margin: 0 0 18px; padding: 0; border: 0; min-width: 0; }
.pms-role-picker > legend { padding: 0; margin-bottom: 4px; color: var(--pms-heading); font-size: 13.5px; font-weight: 700; }
.pms-role-picker-hint { margin: 0 0 12px !important; color: var(--pms-muted); font-size: 13px; line-height: 1.5; }
.pms-role-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.pms-role-option { display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 14px 16px; border: 1px solid var(--pms-border-strong); border-radius: 14px; background: #fff; cursor: pointer; transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease; }
.pms-role-option:hover { border-color: var(--pms-primary); }
.pms-role-option:has(input:checked) { border-color: var(--pms-primary); background: var(--pms-primary-softer); box-shadow: 0 0 0 3px var(--pms-primary-soft); }
.pms-role-option input[type="checkbox"] { margin-top: 2px; flex: none; }
.pms-role-option-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pms-role-option-body strong { color: var(--pms-heading); font-size: 14.5px; font-weight: 700; }
.pms-role-option-body small { color: var(--pms-muted); font-size: 12.5px; }
.pms-person-roles { display: flex; flex-wrap: wrap; gap: 6px; }

/* Responsive */
@container (max-width: 1020px) {
    .pms-attendance-stage { grid-template-columns: minmax(0, 1fr) 280px; }
    .pms-clock-actions { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
}
@container (max-width: 700px) {
    .pms-attendance-stage { grid-template-columns: 1fr; margin: 0 14px; padding: 16px; }
    .pms-clock-actions { grid-template-columns: 1fr; }
    .pms-attendance-meta { grid-template-columns: 1fr; gap: 18px; padding: 20px; }
    .pms-attendance-meta > div + div { padding-left: 0; border-left: 0; }
}
@media (max-height: 900px) {
    .pms-nav-item { height: 42px; margin: 2px 0; font-size: 15px; }
    .pms-nav-label { margin: 16px 12px 6px !important; }
    .pms-shell-brand { padding-top: 20px; padding-bottom: 12px; }
}
@media (max-width: 1100px) {
    .pms-shell { --pms-sidebar-w: 248px; }
    .pms-content { padding: 28px 28px 64px; }
    .pms-shell-topbar { padding: 0 28px; }
    .pms-stats { gap: 16px; }
    .pms-stat { grid-template-columns: 56px minmax(0, 1fr) 34px; column-gap: 14px; padding: 22px 20px 30px; }
    .pms-stat-icon { width: 56px; height: 56px; }
    .pms-stat-value { font-size: 34px; }
    .pms-real-estate-grid, .pms-re-forms, .pms-email-layout { grid-template-columns: 1fr; }
    .pms-flat-quick-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .pms-flat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .pms-settings-layout { grid-template-columns: 1fr; }
    .pms-settings-nav { position: static; display: flex; overflow-x: auto; }
    .pms-settings-nav a { white-space: nowrap; }
}
@media (max-width: 900px) {
    .pms-shell { grid-template-columns: minmax(0, 1fr); }
    .pms-shell-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 10; width: min(var(--pms-sidebar-w), 86vw); transform: translateX(-102%); transition: transform .22s ease, box-shadow .22s ease; }
    .pms-shell-sidebar.is-open { transform: none; box-shadow: 24px 0 60px rgba(2, 6, 23, .35); }
    .pms-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .pms-kpi, .pms-kpi-card { padding: 16px 16px 18px; }
    .pms-kpi strong { font-size: 24px; }
    .pms-scrim { z-index: 9; }
    .pms-mobile-menu-toggle { display: grid; }
    .pms-shell-topbar { gap: 8px; padding: 0 16px; --pms-topbar-h: 68px; height: 68px; }
    .pms-topbar-search { width: auto; flex: 1; height: 44px; }
    .pms-topbar-search kbd, .pms-topbar-spacer, .pms-topbar-account-copy, .pms-topbar-account .pms-caret { display: none; }
    .pms-topbar-account { padding: 0; }
    .pms-topbar-account .pms-avatar { width: 42px; height: 42px; }
    .pms-content { padding: 22px 16px 56px; }
    .pms-page-header { flex-direction: column; align-items: flex-start; }
    .pms-page-header h1 { font-size: 28px; }
    .pms-stats { grid-template-columns: 1fr; }
    .pms-hero { min-height: 0; padding-bottom: 150px; }
    .pms-date-pill { position: static; margin-top: 18px; }
    .pms-hero { flex-direction: column; }
    .pms-city-art { width: 300px; right: -20px; }
    .pms-card-head { flex-wrap: wrap; padding: 20px; }
    .pms-re-building-head { flex-direction: column; align-items: flex-start; }
    .pms-flat-quick-fields, .pms-flat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pms-form-grid, .pms-profile-layout, .pms-invoice-quick-grid, .pms-invoice-item, .pms-project-assign-form { grid-template-columns: 1fr; }
    .pms-field-full { grid-column: auto; }
    .pms-setting-row { grid-template-columns: 1fr; gap: 8px; }
    .pms-setting-label { padding-top: 0; }
    .pms-invoice-builder-head, .pms-invoice-builder-footer { flex-direction: column; align-items: flex-start; }
    .pms-invoice-number-badge { text-align: left; }
    .pms-save-bar { flex-direction: column; align-items: stretch; text-align: center; }
    .pms-panel { overflow-x: auto; }
    .pms-table { min-width: 640px; }
    .pms-toolbar form { width: 100%; }
}
@media (max-width: 520px) {
    .pms-hero-title { font-size: 32px !important; }
    .pms-hero-sub { font-size: 16px; }
    .pms-dial-wrap { padding: 30px 0; }
    .pms-report-bars > div { grid-template-columns: 84px 1fr 38px; }
}
