:root {
  --navy: #05264b;
  --ink: #142033;
  --muted: #647083;
  --line: #d9e3ee;
  --mist: #f4f7fb;
  --teal: #168b86;
  --orange: #f36b2b;
  --green: #2f8b42;
  --red: #d84242;
  --white: #fff;
  --shadow: 0 14px 40px rgba(5, 38, 75, .12);
  --soft-shadow: 0 16px 48px rgba(15, 38, 75, .08);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: linear-gradient(180deg, #eef5f8 0, var(--mist) 260px, #f8fafc 100%); color: var(--ink); line-height: 1.5; }
body { animation: pageIn .42s ease both; }
@supports (padding: max(0px)) {
  body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.login-wrap { min-height: 100svh; position: relative; isolation: isolate; display: grid; place-items: center; padding: 104px 24px 72px; overflow: hidden; background: #071d32 url("login-dubai-blue-hour.jpg?v=20260817") center/cover no-repeat; }
.login-wrap::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(3,17,32,.58); box-shadow: inset 0 0 180px rgba(0,10,24,.36); }
.login-brand-top { position: absolute; inset: max(22px,env(safe-area-inset-top,0px)) clamp(22px,5vw,72px) auto; display: flex; justify-content: space-between; align-items: center; gap: 18px; color: #fff; }
.login-brand-top a { display: flex; align-items: center; gap: 12px; }
.login-brand-top img, .login-card-brand img { width: 46px; height: 46px; object-fit: contain; border-radius: 8px; background: #fff; }
.login-brand-top span { display: grid; }
.login-brand-top strong { font-size: 18px; }
.login-brand-top small { color: rgba(255,255,255,.72); font-size: 11px; }
.login-top-actions { display: flex; align-items: center; gap: 9px; }
.login-demo-corner,.secure-access { min-height: 36px; display: inline-flex !important; align-items: center; gap: 7px; padding: 7px 11px; border: 1px solid rgba(255,255,255,.34); border-radius: 6px; color: rgba(255,255,255,.92); background: rgba(5,29,51,.36); font-size: 11px; font-weight: 850; backdrop-filter: blur(14px); }
.login-demo-corner .ui-icon { width: 15px; height: 15px; transition: transform .18s ease; }
.login-demo-corner:hover { border-color: rgba(255,255,255,.72); background: rgba(255,255,255,.12); }
.login-demo-corner:hover .ui-icon { transform: translateX(2px); }
.secure-access { background: rgba(255,255,255,.08); }
.login-stage { width: min(930px,100%); display: grid; grid-template-columns: minmax(0,1.45fr) minmax(270px,.82fr); align-items: center; gap: 16px; animation: liftIn .5s ease both; }
.login-card { min-width: 0; padding: 30px 34px 25px; border: 1px solid rgba(255,255,255,.22); border-radius: 8px; color: #fff; background: rgba(6,25,46,.79); box-shadow: 0 30px 80px rgba(0,9,22,.42); backdrop-filter: blur(24px) saturate(125%); }
.login-card-brand { display: flex; align-items: center; gap: 11px; padding-bottom: 18px; border-bottom: 1px solid rgba(255,255,255,.15); color: #fff; font-weight: 900; }
.login-card-brand img,.login-card-brand .logo-fallback { width: 40px; height: 40px; }
.login-card-brand .logo-fallback { border-radius: 7px; }
.login-form { display: grid; gap: 15px; padding: 23px 0 9px; }
.login-form h1 { margin: -2px 0 0; color: #fff; font-size: 36px; line-height: 1.04; }
.login-kicker { margin: 0; color: #77ddd5; font-size: 10px; font-weight: 950; text-transform: uppercase; }
.login-intro, .login-form > .muted { margin: -4px 0 3px; color: rgba(255,255,255,.67); font-size: 13px; }
.login-form .field { gap: 6px; }
.login-form .field label { color: rgba(255,255,255,.9); font-size: 11px; }
.login-form .field > input,.login-input-shell { min-height: 48px; border: 1px solid rgba(255,255,255,.21); border-radius: 6px; color: #fff; background: rgba(255,255,255,.08); outline: 0; }
.login-form .field > input { padding: 10px 12px; }
.login-form .field > input::placeholder,.login-input-shell input::placeholder { color: rgba(255,255,255,.43); }
.login-form .field > input:focus,.login-input-shell:focus-within { border-color: #77ddd5; background: rgba(255,255,255,.12); box-shadow: 0 0 0 3px rgba(119,221,213,.12); }
.login-input-shell { display: grid; grid-template-columns: 20px minmax(0,1fr); align-items: center; gap: 9px; padding: 0 12px; }
.login-form .login-input-shell input { width: 100%; min-width: 0; min-height: 46px; padding: 9px 0; border: 0; border-radius: 0; color: #fff; background: transparent; outline: 0; box-shadow: none; }
.login-input-icon { width: 18px; height: 18px; color: #82d9d1; }
.login-helper { display: flex; justify-content: space-between; gap: 12px; color: rgba(255,255,255,.54); font-size: 11px; }
.login-helper a,.login-card .text-link,.login-card .login-links a { color: #fff; font-weight: 900; }
.login-submit { width: 100%; min-height: 49px; border-color: #ff7a3a; border-radius: 6px; background: #f36b2b; color: #fff; box-shadow: 0 12px 28px rgba(243,107,43,.25); }
.login-submit:hover { background: #ff7a3a; box-shadow: 0 16px 32px rgba(243,107,43,.32); }
.login-links { justify-content: center; margin-top: 2px; font-size: 13px; }
.login-card .login-links { color: rgba(255,255,255,.66); }
.login-security { padding-top: 14px; border-top: 1px solid rgba(255,255,255,.14); color: rgba(255,255,255,.48); text-align: center; font-size: 10px; }
.portal-side-option { min-width: 0; padding: 28px 24px; border: 1px solid rgba(255,255,255,.19); border-radius: 8px; background: rgba(8,44,72,.76); color: #fff; box-shadow: 0 26px 68px rgba(0,12,27,.3); backdrop-filter: blur(20px) saturate(120%); }
.side-label { color: #82d9d1; font-size: 11px; font-weight: 950; text-transform: uppercase; }
.portal-side-option h2 { margin: 10px 0 9px; font-size: 25px; line-height: 1.08; }
.portal-side-option p { margin: 0 0 18px; color: rgba(255,255,255,.72); font-size: 13px; }
.portal-side-option > small { display: block; margin-top: 12px; color: rgba(255,255,255,.52); font-size: 10px; }
.side-portal-button { width: 100%; min-height: 46px; border-color: #fff; border-radius: 6px; background: #fff; color: var(--navy); box-shadow: 0 12px 26px rgba(0,10,24,.18); }
.side-portal-button:hover { background: #edf8f7; border-color: #edf8f7; }
.side-service-divider { display: flex; align-items: center; gap: 8px; margin: 20px 0 10px; color: rgba(255,255,255,.49); font-size: 9px; font-weight: 850; text-transform: uppercase; }
.side-service-divider::after { content: ""; height: 1px; flex: 1; background: rgba(255,255,255,.15); }
.walkin-side-link { min-height: 62px; display: grid; grid-template-columns: 34px minmax(0,1fr) 18px; align-items: center; gap: 10px; padding: 10px 11px; border: 1px solid rgba(129,229,218,.42); border-radius: 6px; color: #fff; background: rgba(22,139,134,.28); transition: transform .18s ease,background .18s ease,border-color .18s ease; }
.walkin-side-link:hover { transform: translateY(-2px); border-color: #82d9d1; background: rgba(22,139,134,.45); }
.walkin-side-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 5px; color: var(--navy); background: #82d9d1; }
.walkin-side-icon .ui-icon,.walkin-side-arrow { width: 17px; height: 17px; }
.walkin-side-link > span:nth-child(2) { min-width: 0; display: grid; }
.walkin-side-link strong { font-size: 12px; }
.walkin-side-link small { margin: 0; color: rgba(255,255,255,.66); font-size: 9px; }
.login-footer { position: absolute; inset: auto clamp(22px,5vw,72px) max(18px,env(safe-area-inset-bottom,0px)); display: flex; gap: 20px; color: rgba(255,255,255,.7); font-size: 12px; }
.logo-fallback { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 8px; background: #fff; color: var(--navy); font-weight: 950; }
body:has(.login-wrap) .whatsapp-float,
body:has(.login-wrap) .install-app-btn { display: none; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 272px minmax(0,1fr); }
.sidebar { background: linear-gradient(180deg, #06182d, #092544); color: #fff; padding: 20px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 950; margin-bottom: 22px; }
.brand img { width: 44px; height: 44px; object-fit: contain; border-radius: 10px; background: #fff; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; background: #fff; color: var(--navy); border-radius: 10px; font-weight: 950; }
.nav { display: grid; gap: 8px; }
.nav a { display: block; padding: 11px 12px; border-radius: 10px; color: rgba(255,255,255,.78); font-weight: 850; }
.nav a.active, .nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.topbar { min-height: 76px; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 26px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 4; backdrop-filter: blur(14px); }
.topbar h1 { margin: 0; color: var(--navy); font-size: clamp(23px, 3vw, 34px); }
.top-actions, .row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.content { padding: 26px; position: relative; }
.content::before { content: ""; position: fixed; inset: 76px 0 auto 272px; height: 96px; pointer-events: none; background: linear-gradient(90deg, rgba(22,139,134,.08), rgba(243,107,43,.06), transparent); z-index: -1; }
.grid { display: grid; gap: 16px; }
.metrics { grid-template-columns: repeat(4, minmax(0,1fr)); }
.two { grid-template-columns: minmax(0,1fr) 360px; align-items: start; }
.card { background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: var(--soft-shadow); animation: liftIn .5s ease both; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.card:hover { border-color: #c8d9e8; box-shadow: 0 18px 52px rgba(5,38,75,.1); }
.metric { min-height: 126px; display: grid; align-content: space-between; }
.metric strong { display: block; color: var(--navy); font-size: 28px; line-height: 1.08; word-break: break-word; }
.metric span, .muted { color: var(--muted); }
.btn { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 10px; padding: 8px 14px; font-weight: 900; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(5,38,75,.12); }
.btn.is-loading { opacity: .78; pointer-events: none; position: relative; }
.btn.is-loading::after { content: ""; width: 14px; height: 14px; margin-left: 9px; border: 2px solid rgba(255,255,255,.55); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.btn-primary { background: var(--orange); color: #fff; }
.btn-dark { background: var(--navy); color: #fff; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--navy); }
.btn-success { background: var(--green); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 900; color: var(--navy); }
.field input, .field select, .field textarea { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #cdd8e5; border-radius: 9px; background: #fff; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.wide { grid-column: 1 / -1; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select { min-height: 40px; padding: 8px 10px; border: 1px solid #cdd8e5; border-radius: 9px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; }
tbody tr { transition: background .16s ease; }
tbody tr:hover { background: #f8fcff; }
.client-link { color: var(--navy); font-weight: 950; border-bottom: 2px solid rgba(22,139,134,.2); }
.client-link:hover { color: var(--teal); border-bottom-color: var(--teal); }
.badge { display: inline-flex; min-height: 26px; align-items: center; border-radius: 999px; padding: 4px 9px; font-size: 12px; font-weight: 900; background: #edf4fb; color: var(--navy); }
.green { background: #eaf7ec; color: var(--green); }
.orange { background: #fff1e8; color: var(--orange); }
.red { background: #feecec; color: var(--red); }
.teal { background: #e8f7f5; color: var(--teal); }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; font-weight: 900; background: #fff; color: var(--navy); }
.tabs a.active { background: var(--teal); color: #fff; border-color: var(--teal); }
.timeline { display: grid; gap: 10px; }
.stage { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.stage-no { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #edf4fb; color: var(--navy); font-weight: 950; }
.stage.done .stage-no { background: var(--green); color: #fff; }
.stage.current { border-color: rgba(243,107,43,.55); background: #fff8f2; box-shadow: 0 10px 28px rgba(243,107,43,.08); }
.stage.current .stage-no { background: var(--orange); color: #fff; }
.notice { padding: 12px 14px; border-radius: 10px; background: #fff3d7; color: #805100; margin-bottom: 14px; border: 1px solid #ffd890; }
.error { background: #feecec; color: #8d2121; border-color: #fac1c1; }
.success { background: #eaf7ec; color: #1f6b30; border-color: #bfe4c6; }
.section-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 14px; }
.section-head h2 { margin: 0; color: var(--navy); }
.support-card { margin-top: 22px; padding: 14px; border: 1px solid rgba(255,255,255,.14); border-radius: 10px; display: grid; gap: 8px; color: rgba(255,255,255,.82); }
.support-card a:not(.btn) { color: #fff; font-size: 13px; }
.auth-options { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.auth-options span { border: 1px solid rgba(255,255,255,.24); border-radius: 999px; padding: 7px 10px; font-weight: 850; font-size: 13px; }
.login-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-weight: 850; color: var(--navy); }
.status-banner { margin-bottom: 16px; padding: 14px 16px; border-radius: 12px; background: #e8f7f5; color: var(--navy); border: 1px solid #b9e4df; font-size: 18px; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.status-banner.overdue { background: #fff1e8; border-color: #ffc9a8; }
.status-banner.completed-balance { background: #fff1f1; border-color: #ef9d9d; box-shadow: 0 10px 30px rgba(181,55,62,.10); }
.balance-warning { display: inline-block; margin-top: 5px; color: #a92f37; font-size: 14px; font-weight: 900; }
.metric-alert { border-color: #e98f94 !important; background: #fff5f5 !important; box-shadow: 0 14px 34px rgba(181,55,62,.10) !important; }
.metric-alert strong, .metric-alert span { color: #a92f37 !important; }
.completed-balance-row { background: #fff7f7; box-shadow: inset 4px 0 #d94b54; }
.completed-balance-row td { border-bottom-color: #f2c4c7; }
.deadline-chip.payment-due { background: #ffe7e8; color: #a92f37; border-color: #ef9d9d; }
.work-row.balance-alert { border-color: #e98f94; background: #fff5f5; }
.work-row.balance-alert em { color: #a92f37; }
.service-credit { display: inline-block; margin-top: 4px; color: #157d69; font-size: 12px; font-weight: 900; }
.service-adjustment-card { border-color: #b9e4df; background: #f1fbf9; }
.service-balance-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin: 14px 0 18px; }
.service-balance-summary span { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #f8fbfd; color: var(--muted); font-size: 13px; }
.service-balance-summary strong { display: block; margin-top: 4px; color: var(--navy); font-size: 17px; }
.payment-summary-strip { margin-bottom: 16px; }
.payment-workspace { display: grid; gap: 16px; }
.fab-account-card { overflow: hidden; border: 1px solid #b6c7d8; border-radius: 7px; background: #f7fafc; }
.fab-account-card > div { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; background: var(--navy); color: #fff; }
.fab-account-card > div span { color: #cbd9e8; font-size: 11px; font-weight: 850; text-transform: uppercase; }
.fab-account-card > div strong { font-size: 14px; text-align: right; }
.fab-account-card dl { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); margin: 0; }
.fab-account-card dl div { min-width: 0; display: grid; gap: 3px; padding: 10px 13px; border-right: 1px solid #dce5ed; border-bottom: 1px solid #dce5ed; }
.fab-account-card dt { color: var(--muted); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.fab-account-card dd { min-width: 0; margin: 0; color: var(--navy); font-size: 12px; font-weight: 900; overflow-wrap: anywhere; }
.deadline-chip { display: inline-flex; align-items: center; min-height: 30px; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 950; white-space: nowrap; }
.deadline-chip.safe { background: #eaf7ec; color: var(--green); }
.deadline-chip.late { background: #feecec; color: var(--red); }
.deadline-chip.pending { background: #fff7e9; color: #8b570d; border: 1px solid #efc78e; }
.profile-card { background: linear-gradient(145deg, #fff, #f7fbfd); }
.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.detail-grid div { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.detail-grid span { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; font-weight: 900; margin-bottom: 4px; }
.detail-grid strong { color: var(--navy); }
.special-note { margin-top: 14px; padding: 14px; border-radius: 12px; background: #fff8f2; border: 1px solid #ffd8bf; }
.special-note strong { color: var(--navy); }
.special-note p { margin: 6px 0 0; color: var(--muted); }
.cost-schedule { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.cost-schedule h3 { margin: 0 0 4px; color: var(--navy); }
.cost-schedule div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: 10px; background: #f8fcff; border: 1px solid #e2ebf3; }
.cost-schedule span { color: var(--muted); font-weight: 850; }
.cost-schedule strong { color: var(--navy); white-space: nowrap; }
.bar-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px 12px; align-items: center; margin: 12px 0; }
.bar-row span { font-weight: 850; color: var(--navy); }
.bar { grid-column: 1 / -1; height: 10px; border-radius: 999px; overflow: hidden; background: #edf4fb; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--orange)); border-radius: inherit; }
.whatsapp-float { position: fixed; right: 18px; bottom: 18px; z-index: 20; background: #1fb455; color: #fff; border-radius: 999px; padding: 11px 15px; font-weight: 950; box-shadow: var(--shadow); }
.install-app-btn { position: fixed; right: 18px; bottom: 68px; z-index: 20; min-height: 42px; border: 0; border-radius: 999px; padding: 10px 15px; background: var(--navy); color: #fff; font-weight: 950; box-shadow: var(--shadow); cursor: pointer; }
.install-app-btn[hidden] { display: none; }
.dashboard-hero { margin-bottom: 18px; padding: 24px; border-radius: 18px; background: linear-gradient(135deg, #06264b, #0f5f68 70%, #1d6b55); color: #fff; display: flex; justify-content: space-between; gap: 18px; align-items: center; box-shadow: var(--shadow); }
.dashboard-hero .eyebrow { margin: 0 0 7px; color: #ffd7bf; }
.dashboard-hero h2 { margin: 0; font-size: clamp(28px, 4vw, 46px); line-height: 1; }
.dashboard-hero p { margin: 10px 0 0; color: rgba(255,255,255,.8); }
.hero-status { min-width: 140px; display: grid; gap: 8px; justify-items: end; }
.hero-status span { border: 1px solid rgba(255,255,255,.25); border-radius: 999px; padding: 7px 10px; font-weight: 900; }
.hero-status strong { font-size: 42px; }
.hero-status small { color: rgba(255,255,255,.78); font-weight: 850; }
.hero-alert { background: linear-gradient(135deg, #5b1f1f, #9b3e1b 60%, #174a3f); }
.dashboard-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 16px; align-items: stretch; }
.chart-card { min-height: 300px; }
.donut-wrap { min-height: 220px; display: flex; align-items: center; gap: 24px; }
.donut { --value: 0%; width: 170px; height: 170px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: conic-gradient(var(--teal) var(--value), #edf4fb 0); position: relative; }
.donut::after { content: ""; position: absolute; inset: 18px; border-radius: 50%; background: #fff; }
.donut span { position: relative; z-index: 1; color: var(--navy); font-size: 30px; font-weight: 950; }
.legend { display: grid; gap: 12px; color: var(--muted); }
.legend div { display: flex; align-items: center; gap: 9px; }
.legend i { width: 11px; height: 11px; border-radius: 50%; }
.green-dot { background: var(--teal); }
.orange-dot { background: var(--orange); }
.red-dot { background: var(--red); }
.pipeline-chart { display: grid; gap: 12px; }
.pipeline-row { display: grid; grid-template-columns: 190px minmax(90px,1fr) 36px; gap: 12px; align-items: center; }
.pipeline-row { padding: 7px 8px; margin: 0 -8px; border-radius: 9px; transition: background .16s ease, transform .16s ease; }
.pipeline-row:hover { background: #f1f8fb; transform: translateX(3px); }
.pipeline-row span { color: var(--navy); font-weight: 850; font-size: 13px; }
.pipeline-row div { height: 13px; border-radius: 999px; background: #edf4fb; overflow: hidden; }
.pipeline-row i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--orange)); border-radius: inherit; }
.pipeline-row strong { color: var(--navy); text-align: right; }
.leaderboard, .compact-timeline { display: grid; gap: 10px; }
.leader-row, .work-row, .doc-row, .payment-pill { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdff; }
.leader-row small, .work-row small { display: block; color: var(--muted); margin-top: 3px; }
.leader-row b { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: #e8f7f5; color: var(--teal); }
.work-row em, .payment-pill em { font-style: normal; color: var(--orange); font-weight: 900; }
.compact-timeline div { display: grid; grid-template-columns: 34px minmax(0,1fr); align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.compact-timeline span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #edf4fb; color: var(--navy); font-weight: 950; }
.compact-timeline .complete span { background: var(--teal); color: #fff; }
.doc-row { display: grid; align-items: start; }
.doc-row span { color: var(--teal); font-weight: 950; font-size: 12px; text-transform: uppercase; }
.empty-state { width: min(680px, 100%); margin: 8vh auto; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 44px; box-shadow: var(--soft-shadow); }
.empty-icon { width: 70px; height: 70px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 20px; background: #e8f7f5; color: var(--teal); font-weight: 950; }
.terms-hero { padding: 30px; border-radius: 20px; background: linear-gradient(135deg, #06264b, #0f5f68); color: #fff; box-shadow: var(--shadow); }
.terms-hero .eyebrow { color: #ffd7bf; margin-top: 0; }
.terms-hero h2 { margin: 0; font-size: clamp(30px, 5vw, 54px); line-height: 1; }
.terms-hero p { color: rgba(255,255,255,.78); max-width: 720px; }
.terms-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; margin-top: 16px; }
.term-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: var(--soft-shadow); }
.term-card.highlight { border-color: rgba(22,139,134,.35); background: #f1fbf9; }
.term-card span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--navy); color: #fff; font-weight: 950; }
.term-card h3 { color: var(--navy); margin: 16px 0 8px; }
.term-card p { color: var(--muted); margin: 0; }
.terms-strip { margin-top: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.terms-strip span { display: block; color: var(--muted); }
.wide-panel { grid-column: 1 / -1; }
.refund-form { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 16px; }
.sync-cost-form { margin: 8px 0 16px; }
.danger-zone { margin-top: 16px; padding-top: 16px; border-top: 1px solid #fac1c1; }
.filter-chip { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 12px; border: 1px solid #b9e4df; border-radius: 999px; background: #e8f7f5; color: var(--navy); font-weight: 900; }
.document-upload-group { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #f8fbfd; }
.document-upload-group h3 { margin: 0; color: var(--navy); }
.upload-guidance, .file-limit, .file-error, .upload-progress-note { display: block; margin-top: 5px; font-size: 12px; font-weight: 800; }
.upload-guidance, .file-limit, .upload-progress-note { color: var(--muted); }
.file-error { color: #b13c41; }
input[type="file"].upload-invalid { border-color: #d94b54; background: #fff5f5; }
.btn.is-loading { cursor: wait; opacity: .78; }
.correction-panel { position: relative; }
.correction-panel summary { list-style: none; }
.correction-panel summary::-webkit-details-marker { display: none; }
.correction-panel[open] { width: min(440px, 80vw); }
.correction-form { position: absolute; right: 0; top: calc(100% + 8px); z-index: 15; width: min(440px, 82vw); display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 22px 60px rgba(5,38,75,.2); }
.correction-form .wide, .correction-form button { grid-column: 1 / -1; }
.workflow-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.workflow-actions form { display: grid; gap: 7px; }
.action-hint { max-width: 420px; font-size: 12px; }
.invoice { max-width: 980px; margin: 0 auto; }
.proforma { position: relative; background: #fff; border: 1px solid #cfd9e6; border-radius: 0; padding: 34px; box-shadow: 0 18px 60px rgba(5,38,75,.12); overflow: hidden; }
.invoice-ribbon { margin: -34px -34px 24px; padding: 10px 34px; background: var(--navy); color: #fff; font-weight: 950; letter-spacing: .04em; text-transform: uppercase; font-size: 12px; }
.invoice-top { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; border-bottom: 3px solid var(--navy); padding-bottom: 18px; margin-bottom: 18px; }
.invoice-company { display: flex; gap: 14px; align-items: center; color: var(--navy); }
.invoice-company img { width: 72px; height: 72px; object-fit: contain; }
.invoice-company strong { display: block; font-size: 20px; }
.invoice-company span { color: var(--muted); }
.invoice-title { text-align: right; }
.invoice-title h2 { margin: 0; color: #7890c9; font-size: 34px; letter-spacing: .06em; }
.invoice-title p { margin: 8px 0 0; color: var(--ink); font-weight: 850; }
.invoice-info-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; margin-bottom: 18px; }
.invoice-info-grid article { border: 1px solid var(--line); border-radius: 0; padding: 12px; }
.invoice-info-grid h3 { margin: -12px -12px 10px; padding: 6px 10px; background: #40558f; color: #fff; font-size: 13px; text-transform: uppercase; }
.invoice-table th { background: #40558f; color: #fff; font-size: 12px; }
.invoice-table td { border: 1px solid #9da8b8; }
.invoice-summary { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 18px; margin-top: 18px; align-items: start; }
.invoice-note { min-height: 120px; border: 1px solid #9da8b8; padding: 12px; color: var(--muted); }
.summary-box { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; padding: 12px; border: 1px solid #9da8b8; background: #f7f9fd; }
.summary-box strong { color: var(--navy); }
.stamp { position: absolute; right: 56px; bottom: 68px; width: 122px; height: 122px; border: 4px double rgba(22,139,134,.65); border-radius: 50%; display: grid; place-items: center; text-align: center; color: rgba(22,139,134,.78); font-weight: 950; transform: rotate(-12deg); line-height: 1.1; }
.stamp small { font-size: 10px; }
.invoice-head { display: flex; justify-content: space-between; gap: 18px; align-items: center; border-bottom: 2px solid var(--line); padding-bottom: 16px; margin-bottom: 18px; }
.invoice-brand { margin-bottom: 0; color: var(--navy); }
.invoice-total { display: flex; justify-content: flex-end; gap: 18px; flex-wrap: wrap; margin: 18px 0; font-weight: 900; color: var(--navy); }
.terms h3 { color: var(--navy); margin-top: 22px; }
.metric-link { color: inherit; text-decoration: none; cursor: pointer; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.metric-link:hover { transform: translateY(-3px); border-color: rgba(22,139,134,.5); box-shadow: 0 18px 40px rgba(5,38,75,.12); }
.notification-button { position: relative; }
.notification-button .notification-count { min-width: 21px; height: 21px; display: inline-grid; place-items: center; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: #e5484d; color: #fff; font-size: 11px; font-weight: 900; }
.notification-center { max-width: 1100px; margin: 0 auto; }
.notification-list { display: grid; gap: 10px; margin-top: 18px; }
.notification-item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 18px; align-items: center; padding: 16px; border: 1px solid var(--line); border-left: 4px solid var(--teal); border-radius: 8px; background: #fff; }
.notification-item.warning { border-left-color: #e79b36; }
.notification-item.urgent { border-left-color: #e5484d; }
.notification-item.success { border-left-color: #2e9b73; }
.notification-item.read { opacity: .72; }
.notification-item h3 { margin: 8px 0 4px; font-size: 17px; }
.notification-item p { margin: 0 0 6px; color: var(--muted); }
.automation-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px; border-radius: 8px; background: #05264b; color: #fff; }
.automation-hero h2 { margin: 0; color: #fff; font-size: 32px; }
.automation-hero p:not(.eyebrow) { margin: 8px 0 0; max-width: 720px; color: #d9e7f4; }
.automation-live-status { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 16px; padding: 15px 18px; }
.automation-live-status > div:first-child { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; }
.automation-live-status small { grid-column: 2; color: var(--muted); }
.automation-status-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.automation-status-meta span { padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: #f8fbfd; color: var(--muted); font-size: 12px; }
.status-dot { width: 11px; height: 11px; grid-row: 1 / 3; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(47,139,66,.11); }
.status-dot.running { background: var(--orange); box-shadow: 0 0 0 5px rgba(243,107,43,.12); animation: statusPulse 1.4s ease-in-out infinite; }
.status-dot.failed { background: var(--red); box-shadow: 0 0 0 5px rgba(216,66,66,.11); }
@keyframes statusPulse { 50% { transform: scale(.78); opacity: .68; } }
.email-log { display: grid; gap: 12px; margin-top: 18px; }
.email-event { border: 1px solid var(--line); border-left: 4px solid #7893ad; border-radius: 8px; padding: 16px; background: #fff; }
.email-event.processed { border-left-color: #2e9b73; }
.email-event.review { border-left-color: #e79b36; }
.email-event.failed { border-left-color: #e5484d; }
.email-event-head { display: grid; grid-template-columns: minmax(0,1fr) minmax(180px,auto); gap: 18px; align-items: start; }
.email-event h3 { margin: 8px 0 4px; font-size: 18px; }
.artifact-list { display: grid; gap: 6px; margin-top: 12px; }
.artifact-list > div { display: grid; grid-template-columns: 110px minmax(0,1fr) auto auto; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 6px; background: #f4f7fb; }
.artifact-list span, .artifact-list em { color: var(--muted); font-size: 12px; font-style: normal; text-transform: capitalize; }
.artifact-list button { padding: 0; border: 0; background: transparent; color: var(--teal); font: inherit; font-size: 12px; font-weight: 850; cursor: pointer; }
.manual-match { margin-top: 14px; }
.manual-match > summary { width: fit-content; list-style: none; }
.manual-match form { margin-top: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #f8fbfd; }
.issue-list { display: grid; gap: 12px; margin-top: 16px; }
.issue-card { padding: 16px; border: 1px solid var(--line); border-left: 4px solid var(--teal); border-radius: 8px; background: #fff; }
.issue-card.warning { border-left-color: #e79b36; }
.issue-card.urgent { border-left-color: #e5484d; }
.issue-card h3 { margin: 8px 0 0; font-size: 18px; }
.resolution-note { margin: 14px 0; padding: 12px; border-radius: 6px; background: #edf8f6; }
.resolution-note p { margin: 5px 0 0; }
.issue-response { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.review-remark { display: inline-block; margin-top: 6px; color: #b13c41; font-weight: 700; }
.empty-mini { padding: 28px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 8px; }
.invoice-builder { display: grid; gap: 18px; }
.invoice-items { display: grid; gap: 10px; }
.invoice-item-row { display: grid; grid-template-columns: minmax(220px,1fr) 110px 150px auto; gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #f8fbfd; }
.invoice-controls { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.invoice-controls form { display: flex; align-items: end; gap: 10px; }
.standalone-print { max-width: 1180px; margin: 0 auto; }

/* Premium workspace */
.app-body {
  min-height: 100vh;
  background: #e8f0f4;
}
.app-body .shell {
  grid-template-columns: 252px minmax(0,1fr);
  background: rgba(239,245,248,.9);
}
.app-body .shell > main {
  min-width: 0;
  background:
    linear-gradient(rgba(239,245,248,.92),rgba(246,249,250,.97)),
    url("login-dubai-blue-hour.jpg?v=20260817") center/cover fixed no-repeat;
}
.app-body .sidebar {
  isolation: isolate;
  display: flex;
  flex-direction: column;
  width: 252px;
  padding: 18px 16px;
  border-right: 1px solid rgba(255,255,255,.13);
  background:
    linear-gradient(180deg,rgba(3,20,37,.93),rgba(4,31,53,.96)),
    url("login-dubai-blue-hour.jpg?v=20260817") 38% center/cover no-repeat;
  box-shadow: 16px 0 44px rgba(5,28,50,.14);
}
.app-body .brand {
  gap: 11px;
  margin: 0 0 24px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 8px;
  background: rgba(255,255,255,.075);
  backdrop-filter: blur(14px);
}
.app-body .brand img { width: 42px; height: 42px; border-radius: 7px; }
.app-body .brand > span,
.sidebar-user > span:last-child,
.topbar-user > span:last-child { display: grid; min-width: 0; }
.app-body .brand strong { font-size: 15px; }
.app-body .brand small { color: rgba(255,255,255,.55); font-size: 10px; font-weight: 700; }
.nav-label {
  margin: 0 10px 8px;
  color: rgba(255,255,255,.42);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}
.app-body .nav { flex: 1; align-content: start; gap: 4px; }
.app-body .nav a {
  position: relative;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: rgba(255,255,255,.69);
  font-size: 13px;
  font-weight: 760;
}
.app-body .nav a::before {
  content: "";
  width: 3px;
  position: absolute;
  inset: 9px auto 9px 0;
  border-radius: 2px;
  background: transparent;
}
.app-body .nav a:hover { border-color: rgba(255,255,255,.1); background: rgba(255,255,255,.07); color: #fff; }
.app-body .nav a.active {
  border-color: rgba(255,255,255,.17);
  background: rgba(235,245,252,.14);
  color: #fff;
  box-shadow: inset 0 1px rgba(255,255,255,.08), 0 8px 22px rgba(0,10,24,.14);
}
.app-body .nav a.active::before { background: #64d4c9; }
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 12px 10px;
  border-top: 1px solid rgba(255,255,255,.13);
  color: #fff;
}
.sidebar-user strong,.topbar-user strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user small { color: rgba(255,255,255,.54); font-size: 10px; }
.user-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 50%;
  background: rgba(22,139,134,.38);
  color: #fff;
  font-size: 13px;
  font-weight: 950;
}
.app-body .topbar {
  min-height: 86px;
  padding: 14px clamp(18px,2.5vw,34px);
  border-bottom: 1px solid rgba(5,38,75,.1);
  background: rgba(242,247,249,.76);
  box-shadow: 0 10px 30px rgba(5,38,75,.045);
  backdrop-filter: blur(22px) saturate(120%);
}
.page-heading { display: grid; gap: 1px; }
.page-kicker { color: var(--teal); font-size: 10px; font-weight: 950; text-transform: uppercase; }
.app-body .topbar h1 { font-size: clamp(23px,2.4vw,31px); line-height: 1.05; }
.app-body .topbar .muted { font-size: 12px; }
.topbar-right,.topbar-user { display: flex; align-items: center; gap: 12px; }
.topbar-right { gap: 18px; }
.topbar-user { padding-right: 18px; border-right: 1px solid rgba(5,38,75,.12); }
.topbar-user .user-avatar { background: var(--navy); }
.topbar-user small { color: var(--muted); font-size: 10px; }
.app-body .top-actions { flex-wrap: nowrap; }
.app-body .top-actions .btn { min-height: 38px; border-radius: 6px; background: rgba(255,255,255,.62); font-size: 12px; }
.app-body .content {
  width: min(1640px,100%);
  margin: 0 auto;
  padding: clamp(18px,2.5vw,34px);
}
.app-body .content::before { display: none; }
.app-body .card,
.app-body .term-card,
.app-body .terms-strip,
.app-body .empty-state {
  border-color: rgba(5,38,75,.11);
  border-radius: 8px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 14px 36px rgba(5,38,75,.065), inset 0 1px rgba(255,255,255,.7);
  backdrop-filter: blur(16px) saturate(112%);
}
.app-body .card:hover { border-color: rgba(22,139,134,.26); box-shadow: 0 18px 42px rgba(5,38,75,.085), inset 0 1px rgba(255,255,255,.76); }
.app-body .metrics { gap: 12px; }
.app-body .metric {
  position: relative;
  min-height: 112px;
  padding: 17px;
  overflow: hidden;
}
.app-body .metric::before {
  content: "";
  height: 3px;
  position: absolute;
  inset: 0 0 auto;
  background: var(--teal);
  opacity: .82;
}
.app-body .metric:nth-child(3n+2)::before { background: var(--orange); }
.app-body .metric:nth-child(3n)::before { background: #7890c9; }
.app-body .metric strong { font-size: 25px; letter-spacing: 0; }
.app-body .metric span { font-size: 11px; font-weight: 820; text-transform: uppercase; }
.app-body .metric-link:hover { transform: translateY(-2px); }
.app-body .dashboard-hero,
.app-body .terms-hero {
  min-height: 174px;
  padding: 26px clamp(22px,3vw,36px);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 8px;
  background:
    linear-gradient(90deg,rgba(3,20,37,.95),rgba(5,38,75,.78) 62%,rgba(22,139,134,.46)),
    url("login-dubai-blue-hour.jpg?v=20260817") center 54%/cover no-repeat;
  box-shadow: 0 22px 52px rgba(5,38,75,.18);
}
.app-body .dashboard-hero h2 { max-width: 820px; font-size: clamp(27px,3.6vw,42px); line-height: 1.04; }
.app-body .dashboard-hero .btn { background: #fff; color: var(--navy); }
.app-body .dashboard-hero .eyebrow,.app-body .terms-hero .eyebrow { color: #7ee1d7; }
.app-body .dashboard-hero.hero-alert {
  background:
    linear-gradient(90deg,rgba(60,18,25,.95),rgba(131,46,30,.78) 62%,rgba(5,67,63,.55)),
    url("login-dubai-blue-hour.jpg?v=20260817") center 54%/cover no-repeat;
}
.app-body .automation-hero {
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  background:
    linear-gradient(90deg,rgba(3,20,37,.95),rgba(5,38,75,.78)),
    url("login-dubai-blue-hour.jpg?v=20260817") center 45%/cover no-repeat;
  box-shadow: 0 18px 44px rgba(5,38,75,.15);
}
.app-body .chart-card { min-height: 290px; }
.app-body .section-head h2,.app-body .card > h2 { color: var(--navy); font-size: 18px; }
.app-body .donut { width: 160px; height: 160px; background: conic-gradient(var(--teal) var(--value),rgba(5,38,75,.08) 0); box-shadow: 0 16px 34px rgba(5,38,75,.09); }
.app-body .donut::after { background: rgba(251,253,254,.96); }
.app-body .pipeline-row { border-radius: 5px; }
.app-body .pipeline-row:hover { background: rgba(22,139,134,.065); }
.app-body .pipeline-row div,.app-body .bar { background: rgba(5,38,75,.075); }
.app-body .pipeline-row i,.app-body .bar i { background: linear-gradient(90deg,#168b86,#6bcfc3 68%,#f36b2b); }
.app-body .leader-row,
.app-body .work-row,
.app-body .doc-row,
.app-body .payment-pill,
.app-body .compact-timeline div {
  border-color: rgba(5,38,75,.1);
  border-radius: 6px;
  background: rgba(248,251,252,.84);
}
.app-body .leader-row:hover,.app-body .work-row:hover,.app-body .doc-row:hover { border-color: rgba(22,139,134,.28); background: #fff; }
.app-body .btn { min-height: 40px; border-radius: 6px; }
.app-body .btn-primary { background: var(--navy); }
.app-body .btn-primary:hover { background: #0a3a69; }
.app-body .btn-ghost { border-color: rgba(5,38,75,.13); background: rgba(255,255,255,.68); }
.app-body .field input,
.app-body .field select,
.app-body .field textarea,
.app-body .toolbar input,
.app-body .toolbar select {
  border-color: rgba(5,38,75,.16);
  border-radius: 6px;
  background: rgba(255,255,255,.85);
  box-shadow: inset 0 1px 2px rgba(5,38,75,.025);
}
.app-body .field input:focus,
.app-body .field select:focus,
.app-body .field textarea:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(22,139,134,.1);
}
.app-body .table-wrap { border: 1px solid rgba(5,38,75,.08); border-radius: 6px; background: rgba(255,255,255,.55); }
.app-body th { background: #edf3f6; color: #526477; }
.app-body td { background: rgba(255,255,255,.38); }
.app-body tbody tr:hover td { background: rgba(232,247,245,.58); }
.app-body .tabs { padding: 4px; border: 1px solid rgba(5,38,75,.1); border-radius: 7px; background: rgba(255,255,255,.5); }
.app-body .tabs a { border: 0; border-radius: 5px; background: transparent; font-size: 12px; }
.app-body .tabs a.active { background: var(--navy); }
.app-body .notice,.app-body .status-banner,.app-body .notification-item,.app-body .email-event,.app-body .issue-card { border-radius: 6px; }
.app-body .whatsapp-float,.app-body .install-app-btn { border: 1px solid rgba(255,255,255,.35); border-radius: 7px; backdrop-filter: blur(12px); }
.app-body .whatsapp-float { background: rgba(24,151,78,.9); }
.app-body .install-app-btn { background: rgba(5,38,75,.92); }
.gateway-services { display: flex; gap: 7px; margin: -4px 0 18px; }
.gateway-services span { padding: 5px 8px; border: 1px solid rgba(255,255,255,.2); border-radius: 4px; background: rgba(255,255,255,.07); color: rgba(255,255,255,.86); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.client-portfolio-hero { min-height: 204px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 30px clamp(24px,4vw,48px); border: 1px solid rgba(255,255,255,.22); border-radius: 8px; background: rgba(4,31,53,.96) url("login-dubai-blue-hour.jpg?v=20260817") center 48%/cover no-repeat; background-blend-mode: multiply; color: #fff; box-shadow: 0 22px 52px rgba(5,38,75,.18); }
.client-portfolio-hero .eyebrow,.service-detail-hero .eyebrow,.relationship-card .eyebrow,.service-admin-hero .eyebrow,.form-card .eyebrow,.workspace-control-card .eyebrow { margin: 0 0 8px; color: #68d4ca; font-size: 10px; font-weight: 950; text-transform: uppercase; }
.client-portfolio-hero h2,.service-detail-hero h2 { margin: 0; max-width: 760px; font-size: clamp(30px,4.5vw,52px); line-height: 1.02; overflow-wrap: anywhere; }
.client-portfolio-hero p,.service-detail-hero p { max-width: 720px; margin: 12px 0 0; color: rgba(255,255,255,.76); }
.portfolio-score { min-width: 174px; display: grid; justify-items: end; gap: 3px; }
.portfolio-score span { color: rgba(255,255,255,.62); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.portfolio-score strong { font-size: 54px; line-height: 1; }
.portfolio-score small { color: rgba(255,255,255,.78); font-weight: 800; }
.journey-rail { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin: 16px 0; border: 1px solid rgba(5,38,75,.1); border-radius: 8px; overflow: hidden; background: rgba(255,255,255,.74); box-shadow: 0 12px 30px rgba(5,38,75,.05); }
.journey-rail div { position: relative; display: grid; grid-template-columns: 32px minmax(0,1fr); gap: 1px 10px; padding: 16px; border-right: 1px solid rgba(5,38,75,.09); }
.journey-rail div:last-child { border-right: 0; }
.journey-rail div.active { background: rgba(22,139,134,.065); }
.journey-rail div.active::after { content: ""; position: absolute; inset: auto 0 0; height: 3px; background: var(--teal); }
.journey-rail span { grid-row: 1 / 3; color: #93a1b0; font-size: 11px; font-weight: 950; }
.journey-rail strong { color: var(--navy); }
.journey-rail small { color: var(--muted); font-size: 11px; }
.service-portfolio-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.service-workspace-card { --service-accent: var(--teal); min-width: 0; display: grid; gap: 11px; padding: 22px; border: 1px solid rgba(5,38,75,.11); border-top: 4px solid var(--service-accent); border-radius: 8px; background: rgba(255,255,255,.86); box-shadow: 0 14px 36px rgba(5,38,75,.065); transition: transform .18s ease,border-color .18s ease,box-shadow .18s ease; animation: liftIn .45s ease both; }
.service-workspace-card:hover { transform: translateY(-3px); border-color: rgba(22,139,134,.3); box-shadow: 0 20px 48px rgba(5,38,75,.11); }
.accent-orange { --service-accent: var(--orange); }
.accent-blue { --service-accent: #5374b9; }
.accent-green { --service-accent: #3d8b64; }
.accent-teal { --service-accent: var(--teal); }
.service-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.service-initial { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 7px; background: color-mix(in srgb,var(--service-accent) 12%,white); color: var(--service-accent); font-size: 12px; font-weight: 950; }
.service-group-label { margin: 2px 0 -7px !important; color: var(--service-accent) !important; font-size: 10px; font-weight: 950; text-transform: uppercase; }
.service-workspace-card h3 { margin: 0; color: var(--navy); font-size: 21px; line-height: 1.15; overflow-wrap: anywhere; }
.service-workspace-card > p:not(.service-group-label) { min-height: 42px; margin: 0; color: var(--muted); font-size: 13px; }
.service-progress { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; }
.service-progress > span,.workspace-admin-progress { height: 8px; overflow: hidden; border-radius: 999px; background: rgba(5,38,75,.08); }
.service-progress i,.workspace-admin-progress i { display: block; height: 100%; border-radius: inherit; background: var(--service-accent); }
.service-progress strong { color: var(--navy); font-size: 13px; }
.service-card-meta { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; padding-top: 12px; border-top: 1px solid rgba(5,38,75,.09); }
.service-card-meta span,.summary-list span { min-width: 0; }
.service-card-meta small,.summary-list small { display: block; color: var(--muted); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.service-card-meta strong,.summary-list strong { display: block; margin-top: 3px; color: var(--navy); font-size: 12px; overflow-wrap: anywhere; }
.service-balance-line { display: flex; justify-content: space-between; gap: 12px; padding: 9px 10px; border-radius: 5px; background: #f2f7f9; color: var(--muted); font-size: 12px; }
.service-balance-line strong { color: var(--navy); }
.service-lower-grid { margin-top: 16px; }
.next-action-list { display: grid; gap: 8px; }
.next-action-list a { display: grid; grid-template-columns: minmax(150px,.45fr) minmax(0,1fr); gap: 16px; padding: 13px; border: 1px solid rgba(5,38,75,.09); border-radius: 6px; background: rgba(248,251,252,.8); }
.next-action-list a:hover { border-color: rgba(22,139,134,.3); background: #fff; }
.next-action-list small { display: block; margin-top: 3px; color: var(--teal); font-size: 11px; }
.next-action-list p { margin: 0; color: var(--muted); font-size: 13px; }
.quiet-complete { display: grid; gap: 4px; padding: 18px; border: 1px dashed rgba(5,38,75,.18); border-radius: 6px; color: var(--navy); text-align: center; }
.quiet-complete span { color: var(--muted); font-size: 13px; }
.relationship-card { background: rgba(5,38,75,.96) !important; color: #fff; }
.relationship-card h2 { color: #fff !important; font-size: 25px !important; line-height: 1.12; }
.relationship-card > p:not(.eyebrow) { color: rgba(255,255,255,.7); }
.relationship-card .btn { background: #fff; color: var(--navy); }
.service-admin-layout { grid-template-columns: minmax(0,1fr) 390px; align-items: start; }
.workspace-admin-list { display: grid; gap: 8px; }
.workspace-admin-row { --service-accent: var(--teal); display: grid; grid-template-columns: 42px minmax(180px,1.5fr) minmax(100px,1fr) auto 48px; gap: 12px; align-items: center; padding: 12px; border: 1px solid rgba(5,38,75,.09); border-radius: 6px; background: rgba(248,251,252,.82); }
.workspace-admin-row:hover { border-color: color-mix(in srgb,var(--service-accent) 42%,white); background: #fff; }
.workspace-admin-row > span:nth-child(2) { min-width: 0; }
.workspace-admin-row > span:nth-child(2) strong,.workspace-admin-row > span:nth-child(2) small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-admin-row small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.workspace-admin-row b { color: var(--navy); font-size: 12px; text-align: right; }
.metric-alert-soft { border-color: #f0c7a7 !important; background: #fff9f2 !important; }
.service-detail-hero { --service-hero: #168b86; min-height: 224px; display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 32px clamp(24px,4vw,48px); border: 1px solid rgba(255,255,255,.18); border-radius: 8px; background: linear-gradient(110deg,#041f35 0,#073a54 62%,var(--service-hero) 160%); color: #fff; box-shadow: 0 22px 52px rgba(5,38,75,.18); }
.service-group-launch { --service-hero: #168b86; }
.service-group-operate { --service-hero: #5374b9; }
.service-group-grow { --service-hero: #d75f29; }
.hero-reference { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.hero-reference span { padding: 6px 9px; border: 1px solid rgba(255,255,255,.2); border-radius: 4px; background: rgba(255,255,255,.06); color: rgba(255,255,255,.86); font-size: 11px; font-weight: 850; }
.service-progress-ring { --value: 0%; width: 148px; height: 148px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: conic-gradient(#74ddd2 var(--value),rgba(255,255,255,.14) 0); }
.service-progress-ring::before { content: ""; width: 116px; height: 116px; grid-area: 1/1; border-radius: 50%; background: #062b43; }
.service-progress-ring > span { z-index: 1; grid-area: 1/1; display: grid; justify-items: center; }
.service-progress-ring strong { font-size: 30px; }
.service-progress-ring small { max-width: 90px; color: rgba(255,255,255,.7); font-size: 10px; text-align: center; }
.service-detail-metrics { margin-top: 16px; }
.metric-paid strong { color: var(--green) !important; }
.next-action-banner { display: grid; grid-template-columns: 110px minmax(0,1fr); gap: 16px; align-items: center; margin: 16px 0; padding: 14px 18px; border: 1px solid #b9e4df; border-radius: 7px; background: #f1fbf9; }
.next-action-banner span { color: var(--teal); font-size: 10px; font-weight: 950; text-transform: uppercase; }
.next-action-banner strong { color: var(--navy); overflow-wrap: anywhere; }
.service-detail-layout { grid-template-columns: minmax(0,1fr) 340px; align-items: start; }
.service-stage-list { display: grid; gap: 8px; }
.service-stage { display: grid; grid-template-columns: 38px minmax(140px,1fr) minmax(240px,1.4fr); gap: 12px; align-items: center; padding: 12px; border: 1px solid rgba(5,38,75,.1); border-radius: 6px; background: rgba(248,251,252,.82); }
.service-stage.completed { border-color: #b8dfca; background: #f2faf5; }
.service-stage.in-progress { border-color: #abdcd7; background: #f1fbf9; }
.service-stage.blocked { border-color: #f1c9a8; background: #fff8f1; }
.stage-marker { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #e8eff4; color: var(--navy); font-size: 12px; font-weight: 950; }
.service-stage.completed .stage-marker { background: var(--green); color: #fff; }
.service-stage.in-progress .stage-marker { background: var(--teal); color: #fff; }
.service-stage > span:nth-child(2) small { display: block; color: var(--muted); font-size: 11px; }
.stage-inline-form { display: grid; grid-template-columns: 130px minmax(110px,1fr) auto; gap: 7px; }
.stage-inline-form select,.stage-inline-form input { width: 100%; min-height: 38px; padding: 7px 8px; border: 1px solid rgba(5,38,75,.15); border-radius: 5px; background: #fff; }
.summary-list { display: grid; gap: 0; margin-top: 14px; }
.summary-list span { padding: 11px 0; border-bottom: 1px solid rgba(5,38,75,.09); }
.service-note { margin-top: 16px; padding: 13px; border-radius: 6px; background: #f2f7f9; }
.service-note p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.service-document-layout { grid-template-columns: minmax(0,1fr) 340px; align-items: start; margin-top: 16px; }
.service-documents { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.service-documents button { width: 100%; min-width: 0; display: grid; gap: 4px; padding: 13px; border: 1px solid rgba(5,38,75,.1); border-radius: 6px; background: rgba(248,251,252,.8); text-align: left; cursor: pointer; }
.service-documents button:hover { border-color: rgba(22,139,134,.3); background: #fff; }
.service-documents span { color: var(--teal); font-size: 10px; font-weight: 950; text-transform: uppercase; }
.service-documents strong { color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.service-documents small { color: var(--muted); }
.workspace-control-card { overflow: hidden; }

/* HR document studio */
.hr-tool-hero { min-height: 206px; display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-bottom: 16px; padding: 30px clamp(24px,4vw,46px); border-radius: 8px; background: linear-gradient(112deg,#041f35 0,#073954 62%,#167d78 140%); color: #fff; box-shadow: 0 22px 52px rgba(5,38,75,.17); }
.hr-tool-hero .eyebrow { margin: 0 0 7px; color: #80ddd5; }
.hr-tool-hero h2 { max-width: 700px; margin: 0; font-size: clamp(30px,4vw,48px); line-height: 1.02; }
.hr-tool-hero p:not(.eyebrow) { max-width: 720px; margin: 12px 0 0; color: rgba(255,255,255,.76); }
.hr-tool-stats { display: flex; gap: 10px; flex: 0 0 auto; }
.hr-tool-stats span { min-width: 112px; padding: 13px; border: 1px solid rgba(255,255,255,.18); border-radius: 7px; background: rgba(255,255,255,.07); color: rgba(255,255,255,.72); font-size: 11px; font-weight: 800; text-align: center; }
.hr-tool-stats strong { display: block; color: #fff; font-size: 25px; }
.hr-tool-layout { grid-template-columns: minmax(0,1fr) 380px; align-items: start; }
.hr-builder-card { padding: 24px; border-radius: 8px; }
.hr-letter-builder { display: grid; gap: 14px; }
.hr-type-switch { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.hr-type-switch label { cursor: pointer; }
.hr-type-switch input { position: absolute; opacity: 0; pointer-events: none; }
.hr-type-switch span { min-height: 76px; display: grid; align-content: center; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 7px; background: #f8fbfd; transition: border-color .18s ease,background .18s ease,box-shadow .18s ease; }
.hr-type-switch b { color: var(--navy); font-size: 17px; }
.hr-type-switch small { color: var(--muted); }
.hr-type-switch input:checked + span { border-color: var(--teal); background: #effaf8; box-shadow: inset 4px 0 var(--teal); }
.hr-type-switch input:focus-visible + span { outline: 3px solid rgba(22,139,134,.22); outline-offset: 2px; }
.hr-form-section { padding: 18px; border: 1px solid rgba(5,38,75,.1); border-radius: 7px; background: rgba(248,251,252,.72); }
.hr-form-section[hidden] { display: none; }
.hr-section-title { display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 10px; align-items: center; margin-bottom: 15px; }
.hr-section-title > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 6px; background: var(--navy); color: #fff; font-size: 11px; font-weight: 950; }
.hr-section-title strong,.hr-section-title small { display: block; }
.hr-section-title strong { color: var(--navy); }
.hr-section-title small { color: var(--muted); font-size: 11px; }
.hr-form-section .field > small { font-size: 11px; }
.hr-generate-button { width: 100%; min-height: 50px; margin-top: 2px; border-radius: 7px; font-size: 15px; }
.hr-tool-aside { display: grid; gap: 16px; position: sticky; top: 94px; }
.hr-identity-card,.hr-history-card { border-radius: 8px; }
.hr-signature-preview { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.hr-signature-preview img { width: auto; max-width: 180px; height: auto; max-height: 72px; object-fit: contain; }
.hr-signature-preview label { color: var(--muted); font-size: 12px; }
.hr-letter-history { display: grid; gap: 7px; max-height: 500px; overflow: auto; }
.hr-letter-history a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px; border: 1px solid rgba(5,38,75,.09); border-radius: 6px; background: #f8fbfd; transition: border-color .16s ease,background .16s ease; }
.hr-letter-history a:hover { border-color: rgba(22,139,134,.3); background: #fff; }
.hr-letter-history strong,.hr-letter-history small { display: block; }
.hr-letter-history strong { color: var(--navy); }
.hr-letter-history small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.hr-letter-history em { flex: 0 0 auto; font-style: normal; }
.hr-document-toolbar { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.94); box-shadow: var(--soft-shadow); }
.hr-document-toolbar > div:first-child { display: grid; grid-template-columns: auto 1fr; gap: 2px 9px; align-items: center; }
.hr-document-toolbar > div:first-child .badge { grid-row: 1 / 3; }
.hr-document-toolbar strong { color: var(--navy); }
.hr-document-toolbar small { color: var(--muted); }
.hr-document-canvas { overflow: auto; padding: 24px; border-radius: 8px; background: #dce4e9; box-shadow: inset 0 1px 7px rgba(5,38,75,.1); }
.hr-letter-sheet { position: relative; width: 210mm; min-height: 297mm; margin: 0 auto; overflow: hidden; padding: 24mm 18mm 29mm; background: #fff; color: #172233; font-family: Arial,"Segoe UI",sans-serif; box-shadow: 0 18px 55px rgba(5,38,75,.2); }
.hr-letter-top-band { position: absolute; inset: 0 0 auto; height: 13mm; border-bottom: 1.6mm solid #18b8d5; background: #0b2d49; }
.hr-letter-top-band i,.hr-letter-top-band b,.hr-letter-bottom-band > i,.hr-letter-bottom-band > b { position: absolute; display: block; }
.hr-letter-top-band i { left: 0; bottom: -1.6mm; width: 58mm; height: 4.8mm; background: #18b8d5; clip-path: polygon(0 0,100% 0,88% 100%,0 100%); }
.hr-letter-top-band b { left: 42mm; bottom: -1.6mm; width: 32mm; height: 4.8mm; background: #0b2d49; transform: skewX(-35deg); }
.hr-letter-header { width: 100%; padding: 2mm 0 6mm; border-bottom: 1px solid #dbe4ea; text-align: center; }
.hr-letter-company strong,.hr-letter-company span { display: block; }
.hr-letter-company strong { color: #0b2d49; font-size: 27px; line-height: 1.14; text-transform: uppercase; }
.hr-letter-company.is-long strong { font-size: 22px; }
.hr-letter-company span { margin-top: 2.2mm; color: #253e55; font-family: Arial,Tahoma,sans-serif; font-size: 18px; line-height: 1.2; }
.hr-letter-meta { display: flex; justify-content: space-between; gap: 20px; margin-top: 4mm; color: #687586; font-size: 11px; }
.hr-letter-content { margin-top: 13mm; font-size: 15px; line-height: 1.68; }
.hr-letter-kicker { margin: 0 !important; color: #139eb9 !important; font-size: 10px !important; font-weight: 950; text-align: center; text-transform: uppercase; }
.hr-letter-content h1 { margin: 2mm 0 12mm; color: #0b2d49; font-family: Georgia,"Times New Roman",serif; font-size: 28px; letter-spacing: 0; text-align: center; }
.hr-letter-content p { margin: 0 0 6.2mm; }
.hr-letter-addressee { font-weight: 900; }
.hr-letter-disclaimer { margin-top: 8mm !important; color: #445164; }
.hr-letter-contact { color: #526476; font-size: 13px; }
.hr-letter-signoff { position: absolute; left: 18mm; right: 18mm; bottom: 34mm; display: flex; align-items: flex-end; justify-content: space-between; gap: 16mm; }
.hr-signature-block { width: 76mm; }
.hr-signature-block span,.hr-signature-block strong,.hr-signature-block small,.hr-signature-block em { display: block; }
.hr-signature-block span { font-size: 12px; }
.hr-signature-block img { display: block; width: auto; max-width: 42mm; height: auto; max-height: 19mm; margin: 1mm 0; object-fit: contain; mix-blend-mode: multiply; }
.hr-signature-line { width: 42mm; height: 14mm; border-bottom: 1px solid #172233; }
.hr-signature-block strong { font-size: 15px; }
.hr-signature-block small,.hr-signature-block em { font-size: 11px; }
.hr-signature-block em { margin-top: 1mm; color: #687586; font-style: normal; }
.hr-company-stamp { color: #111; text-align: center; }
.hr-company-stamp.round { width: 76mm; min-height: 25mm; flex: 0 0 76mm; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3mm 4mm; border: 4px solid #111; border-radius: 0; background: #fff; }
.hr-company-stamp.round strong,.hr-company-stamp.round b { display: block; max-width: 68mm; color: #111; font-weight: 950; line-height: 1.18; overflow-wrap: anywhere; }
.hr-company-stamp.round strong { font-size: 16px; text-transform: uppercase; }
.hr-company-stamp.round b { margin-top: 1.5mm; font-family: Arial,Tahoma,sans-serif; font-size: 15px; }
.hr-company-stamp.round.is-long strong { font-size: 13px; }
.hr-company-stamp.square { width: 64mm; min-height: 29mm; display: grid; place-items: center; align-content: center; padding: 3mm; border: 2px solid #1c5fd4; }
.hr-company-stamp.square span,.hr-company-stamp.square strong,.hr-company-stamp.square b,.hr-company-stamp.square small { display: block; }
.hr-company-stamp.square span,.hr-company-stamp.square small { font-size: 8px; font-weight: 900; }
.hr-company-stamp.square strong { max-width: 56mm; margin: 1mm 0; font-size: 11px; overflow-wrap: anywhere; }
.hr-company-stamp.square b { max-width: 56mm; font-size: 11px; overflow-wrap: anywhere; }
.hr-letter-bottom-band { position: absolute; inset: auto 0 0; height: 16mm; display: grid; place-items: center; padding: 4.2mm 20mm; background: #0b2d49; color: #fff; font-size: 9px; }
.hr-letter-bottom-band > i { top: 0; right: 0; width: 56mm; height: 4mm; background: #18b8d5; clip-path: polygon(12% 0,100% 0,100% 100%,0 100%); }
.hr-letter-bottom-band > b { top: 0; right: 39mm; width: 27mm; height: 4mm; background: #fff; transform: skewX(-35deg); }
.hr-letter-contact-strip { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 7mm; width: 100%; }
.hr-letter-contact-strip span { display: inline-flex; align-items: center; gap: 1.5mm; }
.hr-letter-contact-strip span b { display: grid; width: 5mm; height: 5mm; place-items: center; border: 1px solid rgba(255,255,255,.45); border-radius: 50%; color: #58d8ef; font-size: 7px; }
.hr-letter-contact-strip .address { max-width: 74mm; }
.hr-void-mark { position: absolute; top: 122mm; left: 34mm; transform: rotate(-28deg); color: rgba(190,30,45,.14); font-size: 100px; font-weight: 950; }
.hr-document-audit { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; border-radius: 8px; }
.hr-document-audit div { display: grid; }
.hr-document-audit strong { color: var(--navy); }
.hr-document-audit span { color: var(--muted); font-size: 12px; }

/* Client intake, document preview and finance intelligence */
[data-uppercase-name] { text-transform: uppercase; }
.client-command-bar { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-bottom: 12px; padding: 20px 22px; border: 1px solid rgba(5,38,75,.1); border-radius: 8px; background: #fff; box-shadow: 0 10px 30px rgba(5,38,75,.06); }
.client-command-bar h2 { margin: 2px 0 1px; color: var(--navy); font-size: 24px; line-height: 1.15; }
.client-command-bar > div:first-child > span { color: var(--muted); font-size: 13px; }
.client-command-actions { display: flex; flex: 0 0 auto; gap: 9px; }
.operations-alert-strip { min-width: 0; display: flex; align-items: stretch; gap: 9px; margin-bottom: 15px; }
.operations-alert { min-width: 210px; display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #dce6ee; border-radius: 7px; background: #fff; box-shadow: 0 7px 18px rgba(5,38,75,.04); }
.operations-alert strong { min-width: 30px; color: var(--navy); font-size: 20px; line-height: 1; }
.operations-alert span { color: #536477; font-size: 12px; font-weight: 800; line-height: 1.35; }
.operations-alert.warning { border-color: #f0c997; background: #fffaf1; }
.operations-alert.warning strong { color: #b9680b; }
.operations-alert.urgent { border-color: #efb1b5; background: #fff6f6; }
.operations-alert.urgent strong { color: #b82f38; }
.operations-alert.clear { border-color: #b9dfcf; background: #f3fbf7; }
.operations-alert.clear strong { color: var(--green); font-size: 13px; }
.operations-alert-link { display: inline-flex; align-items: center; justify-content: center; margin-left: auto; padding: 9px 12px; color: var(--navy); font-size: 12px; font-weight: 900; }
.client-directory-layout,.client-documents-layout { min-width: 0; display: grid; }
.client-directory-card { min-width: 0; overflow: hidden; }
.client-directory-table { overflow: visible; }
.client-directory-table table { min-width: 0; table-layout: fixed; }
.client-directory-table th,.client-directory-table td { padding: 12px 8px; overflow-wrap: anywhere; }
.client-directory-table th:nth-child(1) { width: 16%; }
.client-directory-table th:nth-child(2) { width: 11%; }
.client-directory-table th:nth-child(3) { width: 12%; }
.client-directory-table th:nth-child(4) { width: 6%; }
.client-directory-table th:nth-child(5) { width: 18%; }
.client-directory-table th:nth-child(6) { width: 14%; }
.client-directory-table th:nth-child(7) { width: 16%; }
.client-directory-table th:nth-child(8) { width: 7%; }
.client-directory-table td:nth-child(2),.client-directory-table td:nth-child(4) { overflow-wrap: normal; word-break: normal; white-space: nowrap; }
.client-directory-table .btn { min-height: 36px; padding: 6px 10px; border-radius: 6px; }
.client-alert-stack { display: grid; justify-items: start; gap: 5px; }
.client-alert-tag { display: inline-flex; align-items: center; min-height: 25px; padding: 4px 7px; border: 1px solid transparent; border-radius: 5px; font-size: 10px; font-weight: 900; line-height: 1.2; }
.client-alert-tag.warning { border-color: #efc78e; color: #9a590b; background: #fff7e9; }
.client-alert-tag.urgent { border-color: #eeb5ba; color: #ab3039; background: #fff0f1; }
.client-alert-tag.clear { border-color: #bfe1d3; color: #24764e; background: #effaf4; }
.stalled-client-row { box-shadow: inset 4px 0 #e9a03a; }
.payment-alert-row:not(.completed-balance-row) { background: #fffafa; }
.workflow-modal { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 22px; }
.workflow-modal[hidden] { display: none; }
.workflow-modal-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(3,18,34,.72); backdrop-filter: blur(6px); cursor: default; }
.workflow-modal-window { width: min(610px,100%); max-height: calc(100svh - 44px); position: relative; z-index: 1; display: grid; grid-template-rows: auto minmax(0,1fr); overflow: hidden; border: 1px solid rgba(255,255,255,.38); border-radius: 8px; background: #fff; box-shadow: 0 30px 90px rgba(0,13,29,.36); }
.workflow-modal-window.workflow-modal-wide { width: min(920px,100%); }
.workflow-modal-window > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 17px 19px; border-bottom: 1px solid var(--line); background: #f9fbfd; }
.workflow-modal-window > header > div { min-width: 0; }
.workflow-modal-window h2 { margin: 2px 0 0; color: var(--navy); font-size: 21px; line-height: 1.2; }
.workflow-modal-window header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.workflow-modal-body { min-height: 0; overflow: auto; padding: 19px; }
.workflow-modal-body textarea { min-height: 86px; resize: vertical; }
.workflow-modal-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 5px; }
.modal-help { display: block; color: var(--muted); font-size: 11px; font-weight: 750; }
.document-upload-list { display: grid; gap: 10px; }
.document-upload-row { display: grid; grid-template-columns: minmax(180px,.8fr) minmax(220px,1.2fr) auto; gap: 10px; align-items: end; padding: 11px; border: 1px solid rgba(5,38,75,.1); border-radius: 6px; background: #fff; }
.document-upload-row .remove-document-row { min-width: 84px; }
.add-document-row { margin-top: 10px; }
.document-row-button { width: 100%; border: 1px solid var(--line); color: inherit; text-align: left; cursor: pointer; }
.document-name-button { padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; }
.modal-open { overflow: hidden; }
.document-preview-modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; }
.document-preview-modal[hidden] { display: none; }
.document-preview-backdrop { position: absolute; inset: 0; background: rgba(4,18,34,.72); backdrop-filter: blur(8px); }
.document-preview-window { position: relative; z-index: 1; width: min(1040px,96vw); height: min(840px,90vh); display: grid; grid-template-rows: auto minmax(0,1fr) auto; overflow: hidden; border: 1px solid rgba(255,255,255,.38); border-radius: 8px; background: #fff; box-shadow: 0 32px 90px rgba(0,13,29,.38); }
.document-preview-window > header,.document-preview-window > footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.document-preview-window > footer { justify-content: flex-end; border-top: 1px solid var(--line); border-bottom: 0; }
.document-preview-window h2 { max-width: min(720px,70vw); margin: 2px 0 0; overflow: hidden; color: var(--navy); font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
.icon-close { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 38px; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--navy); font-size: 25px; line-height: 1; cursor: pointer; }
.document-preview-body { min-height: 0; display: grid; place-items: center; overflow: auto; background: #e8edf1; }
.document-preview-body iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.document-preview-body img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.document-preview-fallback { width: min(440px,88%); display: grid; gap: 8px; padding: 28px; border: 1px solid var(--line); border-radius: 8px; background: #fff; text-align: center; }
.document-preview-fallback[hidden],.document-preview-body img[hidden],.document-preview-body iframe[hidden] { display: none; }
.document-preview-fallback strong { color: var(--navy); }
.document-preview-fallback span { color: var(--muted); }
.metric.tone-green::before { background: #2f9b57 !important; }
.metric.tone-blue::before { background: #2479c9 !important; }
.metric.tone-orange::before { background: #f28a30 !important; }
.metric.tone-red::before { background: #d94b52 !important; }
.metric.tone-teal::before { background: #168b86 !important; }
.metric.tone-navy::before { background: #05264b !important; }
.finance-report-shell { display: grid; gap: 16px; }
.finance-hero { min-height: 176px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 28px clamp(22px,3vw,38px); border-radius: 8px; background: linear-gradient(105deg,#06192e 0,#07375b 58%,#13877f 118%); color: #fff; box-shadow: 0 24px 56px rgba(5,38,75,.18); }
.finance-hero .eyebrow { margin: 0 0 7px; color: #82ddd5; }
.finance-hero h2 { max-width: 820px; margin: 0; font-size: clamp(29px,4vw,46px); line-height: 1.04; }
.finance-hero p:not(.eyebrow) { margin: 10px 0 0; color: rgba(255,255,255,.76); }
.finance-hero .btn { flex: 0 0 auto; background: #fff; color: var(--navy); }
.finance-filter-card { padding: 15px 18px; }
.finance-filter { display: grid; grid-template-columns: minmax(160px,.7fr) 30px minmax(150px,.7fr) minmax(150px,.7fr) auto; gap: 10px; align-items: end; }
.filter-or { align-self: end; padding-bottom: 10px; color: var(--muted); font-size: 11px; font-weight: 900; text-align: center; text-transform: uppercase; }
.quick-periods { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.quick-periods a { padding: 6px 10px; border: 1px solid rgba(5,38,75,.12); border-radius: 5px; background: #f7fafc; color: var(--navy); font-size: 12px; font-weight: 850; }
.finance-metrics { grid-template-columns: repeat(4,minmax(0,1fr)); }
.finance-metrics .metric { min-height: 134px; }
.finance-metrics .metric span { order: 0; }
.finance-metrics .metric strong { order: 1; }
.finance-metrics .metric small { order: 2; color: var(--muted); font-size: 11px; }
.finance-dashboard-grid { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(310px,.7fr); gap: 16px; align-items: stretch; }
.finance-chart-card,.portfolio-position { min-height: 380px; }
.finance-month-chart { display: grid; gap: 13px; margin-top: 22px; }
.finance-month-row { display: grid; grid-template-columns: 76px minmax(120px,1fr) 112px; gap: 12px; align-items: center; }
.finance-month-row > span { color: var(--muted); font-size: 12px; font-weight: 850; }
.finance-month-row > strong { text-align: right; font-size: 12px; }
.finance-month-row > strong.positive,.money-in { color: #238449; font-weight: 900; }
.finance-month-row > strong.negative,.money-out { color: #c63f47; font-weight: 900; }
.money-pending { color: #2b70b5; font-weight: 900; }
.finance-bars { display: grid; gap: 4px; }
.finance-bars i { display: block; min-width: 2px; height: 8px; border-radius: 2px; }
.finance-bars .receipt,.finance-legend .receipt { background: #24a467; }
.finance-bars .outflow,.finance-legend .outflow { background: #f07a36; }
.finance-legend { display: flex; gap: 18px; margin-top: 20px; color: var(--muted); font-size: 11px; }
.finance-legend span { display: inline-flex; align-items: center; gap: 6px; }
.finance-legend i { width: 10px; height: 10px; border-radius: 2px; }
.portfolio-position { display: grid; align-content: start; }
.portfolio-ring { width: 188px; aspect-ratio: 1; display: grid; place-items: center; margin: 18px auto; border-radius: 50%; background: conic-gradient(#24a467 var(--collection),#e7edf1 0); position: relative; }
.portfolio-ring::after { content: ""; width: 142px; aspect-ratio: 1; border-radius: 50%; background: #fff; position: absolute; }
.portfolio-ring span { z-index: 1; display: grid; color: var(--muted); font-size: 11px; text-align: center; text-transform: uppercase; }
.portfolio-ring strong { color: var(--navy); font-size: 28px; }
.portfolio-summary { display: grid; gap: 0; }
.portfolio-summary div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.portfolio-summary span { color: var(--muted); font-size: 12px; }
.portfolio-summary strong { color: var(--navy); font-size: 13px; }
.finance-ledger-card { overflow: hidden; }
.finance-ledger-card table { min-width: 1000px; }
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (max-width: 980px) {
  .shell, .two, .dashboard-grid, .terms-grid, .invoice-info-grid, .invoice-summary, .hr-tool-layout { grid-template-columns: 1fr; }
  .shell { display: block; min-height: 100vh; }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 12;
    height: auto;
    padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px 10px;
    overflow: hidden;
    background: rgba(6,24,45,.98);
    box-shadow: 0 12px 30px rgba(5,38,75,.18);
  }
  .brand { margin-bottom: 10px; gap: 9px; }
  .brand img { width: 34px; height: 34px; border-radius: 9px; }
  .brand span { font-size: 17px; }
  .nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 0 4px;
    margin: 0 -2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a {
    flex: 0 0 auto;
    padding: 8px 12px;
    min-height: 38px;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    font-size: 14px;
    white-space: nowrap;
  }
  .nav a.active { background: #fff; color: var(--navy); }
  .topbar {
    position: static;
    min-height: 0;
    padding: 14px 16px;
    align-items: flex-start;
    background: #fff;
  }
  .topbar h1 { font-size: 27px; }
  .top-actions .btn { min-height: 38px; padding: 7px 12px; }
  .metrics, .form-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-hero, .terms-strip { flex-direction: column; align-items: flex-start; }
  .dashboard-hero { padding: 18px; border-radius: 16px; }
  .dashboard-hero h2 { font-size: 30px; }
  .dashboard-hero .eyebrow { font-size: 11px; }
  .hero-status { justify-items: start; min-width: 0; }
  .content::before { left: 0; top: 0; }
  .detail-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .donut-wrap { flex-direction: column; align-items: flex-start; }
  .app-body .shell { display: block; }
  .app-body .shell > main { min-height: calc(100vh - 106px); }
  .app-body .sidebar {
    width: 100%;
    height: auto;
    display: block;
    padding: calc(env(safe-area-inset-top,0px) + 9px) 12px 9px;
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,.13);
    background:
      linear-gradient(90deg,rgba(3,20,37,.97),rgba(5,38,75,.94)),
      url("login-dubai-blue-hour.jpg?v=20260817") center 46%/cover no-repeat;
  }
  .app-body .brand { width: fit-content; margin: 0 0 8px; padding: 6px 8px; border: 0; background: transparent; }
  .app-body .brand img { width: 34px; height: 34px; }
  .app-body .brand small,.nav-label,.sidebar-user { display: none; }
  .app-body .nav { display: flex; gap: 7px; }
  .app-body .nav a { min-height: 36px; padding: 7px 11px; border-radius: 6px; background: rgba(255,255,255,.07); white-space: nowrap; }
  .app-body .nav a::before { display: none; }
  .app-body .nav a.active { background: #fff; color: var(--navy); }
  .app-body .topbar { position: static; padding: 13px 16px; }
  .topbar-user { display: none; }
  .topbar-right { gap: 8px; }
  .app-body .content { padding: 18px 16px 96px; }
  .app-body .dashboard-hero,.app-body .terms-hero { min-height: 154px; }
  .service-admin-layout,.service-detail-layout,.service-document-layout { grid-template-columns: 1fr; }
  .workspace-admin-row { grid-template-columns: 42px minmax(160px,1fr) minmax(90px,.7fr) auto 44px; }
  .hr-tool-aside { position: static; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .hr-document-toolbar { align-items: flex-start; flex-direction: column; }
}
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes liftIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@media print {
  @page { size: A4 portrait; margin: 0; }
  html, body { width: auto !important; min-height: 0; margin: 0 !important; padding: 0 !important; background: #fff !important; animation: none !important; }
  body, body * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  .sidebar, .topbar, .no-print, .whatsapp-float, .install-app-btn { display: none !important; }
  .shell, .shell main { display: block !important; width: 100% !important; min-height: 0 !important; }
  .content { width: 100% !important; padding: 0 !important; }
  .content::before { display: none !important; }
  .card { box-shadow: none !important; border: none !important; animation: none !important; }
  .invoice.proforma { width: 100% !important; max-width: none !important; min-height: 0; margin: 0 !important; padding: 7mm !important; border: 0 !important; box-shadow: none !important; overflow: visible !important; break-after: auto; }
  .invoice-ribbon { margin: -7mm -7mm 5mm !important; padding: 2.5mm 7mm !important; font-size: 9px; }
  .invoice-top { display: flex !important; gap: 5mm; padding-bottom: 4mm; margin-bottom: 4mm; break-inside: avoid; }
  .invoice-company { gap: 3mm; }
  .invoice-company img { width: 17mm; height: 17mm; }
  .invoice-company strong { font-size: 14px; }
  .invoice-company span, .invoice-title p { font-size: 8.5px; }
  .invoice-title { flex: 0 0 66mm; }
  .invoice-title h2 { font-size: 22px; letter-spacing: 0; }
  .invoice-info-grid { display: grid !important; grid-template-columns: repeat(3,minmax(0,1fr)) !important; gap: 3mm; margin-bottom: 4mm; break-inside: avoid; }
  .invoice-info-grid article { padding: 3mm; font-size: 8.5px; overflow-wrap: anywhere; }
  .invoice-info-grid h3 { margin: -3mm -3mm 2mm; padding: 1.5mm 2mm; font-size: 8.5px; }
  .invoice .table-wrap { overflow: visible !important; }
  .invoice table { width: 100% !important; min-width: 0 !important; table-layout: fixed; font-size: 8px; }
  .invoice th, .invoice td { padding: 1.8mm 1.3mm; overflow-wrap: anywhere; }
  .invoice thead { display: table-header-group; }
  .invoice tr { break-inside: avoid; }
  .invoice-summary { display: grid !important; grid-template-columns: minmax(0,1fr) 62mm !important; gap: 4mm; margin-top: 4mm; break-inside: avoid; }
  .invoice-note, .summary-box { min-height: 0; padding: 3mm; font-size: 8.5px; }
  .stamp { position: static !important; width: 25mm; height: 25mm; margin: 5mm 0 0 auto; border-width: 3px; font-size: 9px; break-inside: avoid; }
  .hr-document-canvas { overflow: visible !important; padding: 0 !important; background: #fff !important; box-shadow: none !important; }
  .hr-letter-sheet { width: 210mm !important; min-height: 297mm !important; height: 297mm !important; margin: 0 !important; padding: 24mm 18mm 29mm !important; box-shadow: none !important; break-after: auto; }
  .hr-letter-content { margin-top: 13mm !important; font-size: 10.8pt !important; }
  .hr-letter-content h1 { margin-bottom: 12mm !important; font-size: 20pt !important; }
  .hr-letter-content p { margin-bottom: 6.2mm !important; }
  .hr-letter-signoff { left: 18mm !important; right: 18mm !important; bottom: 34mm !important; }
  .hr-letter-bottom-band { height: 16mm !important; padding: 4.2mm 20mm !important; }
}
@media (max-width: 640px) {
  body { background: #f7fafc; }
  .login-wrap { min-height: 100svh; padding: 84px 14px 68px; place-items: center; overflow: auto; background-position: 58% center; }
  .login-wrap::before { background: rgba(3,20,37,.57); }
  .login-brand-top { inset: max(13px,env(safe-area-inset-top,0px)) 14px auto; }
  .login-brand-top img { width: 38px; height: 38px; }
  .login-brand-top strong { font-size: 15px; }
  .login-brand-top small { display: none; }
  .login-top-actions { gap: 6px; }
  .login-demo-corner,.secure-access { min-height: 34px; padding: 6px 8px; font-size: 9px; }
  .secure-access { display: none !important; }
  .login-stage { width: min(430px,100%); grid-template-columns: 1fr; gap: 10px; }
  .login-card { width: 100%; margin: 0; padding: 22px 20px 18px; border-radius: 8px; }
  .login-card-brand { padding-bottom: 14px; }
  .login-form { padding: 18px 0 7px; }
  .login-form h1 { font-size: 27px; }
  .login-form .btn { width: 100%; }
  .portal-side-option { padding: 18px; border-radius: 8px; }
  .portal-side-option h2 { margin-top: 7px; font-size: 19px; }
  .portal-side-option p { margin-bottom: 13px; font-size: 13px; }
  .portal-side-option > small { display: none; }
  .side-service-divider { margin-top: 16px; }
  .login-footer { inset: auto 14px max(13px,env(safe-area-inset-bottom,0px)); width: calc(100% - 28px); justify-content: center; gap: 12px; font-size: 10px; }
  .topbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .topbar > div:first-child { min-width: 0; }
  .topbar h1 { font-size: 26px; line-height: 1.1; }
  .top-actions { width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .top-actions .btn { min-width: 0; font-size: 14px; }
  .content { padding: 12px; padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 82px); }
  .metrics, .form-grid { grid-template-columns: 1fr; }
  .service-balance-summary { grid-template-columns: 1fr; }
  .metric { min-height: 104px; }
  .metric strong { font-size: 24px; }
  .card { padding: 16px; border-radius: 13px; }
  .dashboard-hero { margin: 10px 0 14px; padding: 18px; }
  .dashboard-hero h2 { font-size: 28px; max-width: 100%; }
  .dashboard-hero p { font-size: 14px; }
  .pipeline-row { grid-template-columns: 122px minmax(80px,1fr) 28px; gap: 8px; }
  .leader-row, .work-row, .doc-row, .payment-pill { align-items: flex-start; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { flex: 0 0 auto; white-space: nowrap; }
  table { min-width: 680px; }
  .detail-grid { grid-template-columns: 1fr; }
  .status-banner { align-items: flex-start; flex-direction: column; }
  .stage { grid-template-columns: 34px minmax(0,1fr); }
  .stage form { grid-column: 1 / -1; }
  .correction-panel[open] { width: 100%; }
  .correction-form { position: fixed; inset: auto 12px calc(env(safe-area-inset-bottom, 0px) + 12px); width: auto; max-height: 78vh; overflow: auto; grid-template-columns: 1fr; border-radius: 16px; }
  .correction-form .wide, .correction-form button { grid-column: 1; }
  .workflow-actions, .workflow-actions form, .workflow-actions .btn { width: 100%; }
  .notification-item, .email-event-head { grid-template-columns: 1fr; }
  .notification-item .row-actions { justify-content: flex-start; }
  .automation-hero { align-items: flex-start; flex-direction: column; }
  .automation-live-status { align-items: flex-start; flex-direction: column; }
  .automation-status-meta { justify-content: flex-start; }
  .artifact-list > div { grid-template-columns: 88px minmax(0,1fr); }
  .artifact-list a, .artifact-list button, .artifact-list em { grid-column: 2; justify-self: start; }
  .invoice-item-row { grid-template-columns: 1fr 1fr; }
  .invoice-item-row .field:first-child { grid-column: 1 / -1; }
  .invoice-controls, .invoice-controls form { align-items: stretch; flex-direction: column; }
  .invoice-controls .btn { width: 100%; }
  .whatsapp-float { right: 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); }
  .install-app-btn { right: 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 62px); }
  .app-body .topbar { gap: 12px; background: rgba(247,250,251,.94); }
  .app-body .topbar h1 { font-size: 25px; }
  .topbar-right,.app-body .top-actions { width: 100%; }
  .app-body .top-actions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); overflow: visible; }
  .app-body .top-actions .btn { width: 100%; padding: 7px 8px; }
  .app-body .content { padding: 12px 12px calc(env(safe-area-inset-bottom,0px) + 84px); }
  .app-body .dashboard-hero,.app-body .terms-hero { min-height: 0; margin-top: 2px; padding: 20px 18px; }
  .app-body .dashboard-hero h2 { font-size: 27px; }
  .app-body .metric { min-height: 98px; padding: 15px; }
  .app-body .metric strong { font-size: 23px; }
  .app-body .card { padding: 15px; }
  .app-body .chart-card { min-height: 0; }
  .app-body .donut { width: 142px; height: 142px; }
  .app-body .donut-wrap { min-height: 0; }
  .app-body .pipeline-row { grid-template-columns: minmax(104px,1.1fr) minmax(72px,1fr) 28px; }
  .client-portfolio-hero,.service-detail-hero { min-height: 0; align-items: flex-start; flex-direction: column; padding: 24px 20px; }
  .client-portfolio-hero h2,.service-detail-hero h2 { font-size: 31px; }
  .portfolio-score { min-width: 0; justify-items: start; }
  .portfolio-score strong { font-size: 42px; }
  .journey-rail { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .journey-rail div:nth-child(2) { border-right: 0; }
  .journey-rail div:nth-child(-n+2) { border-bottom: 1px solid rgba(5,38,75,.09); }
  .service-portfolio-grid,.service-documents { grid-template-columns: 1fr; }
  .service-workspace-card { padding: 18px; }
  .service-card-meta { grid-template-columns: 1fr; }
  .next-action-list a { grid-template-columns: 1fr; gap: 7px; }
  .workspace-admin-row { grid-template-columns: 42px minmax(0,1fr) auto; }
  .workspace-admin-row .workspace-admin-progress,.workspace-admin-row > b { display: none; }
  .service-progress-ring { width: 126px; height: 126px; }
  .service-progress-ring::before { width: 98px; height: 98px; }
  .next-action-banner { grid-template-columns: 1fr; gap: 4px; }
  .service-stage { grid-template-columns: 38px minmax(0,1fr); }
  .service-stage > .badge,.stage-inline-form { grid-column: 1 / -1; }
  .stage-inline-form { grid-template-columns: 1fr; }
  .stage-inline-form .btn { width: 100%; }
  .hr-tool-hero { min-height: 0; align-items: flex-start; flex-direction: column; padding: 22px 18px; }
  .hr-tool-hero h2 { font-size: 29px; }
  .hr-tool-stats { width: 100%; }
  .hr-tool-stats span { min-width: 0; flex: 1; }
  .hr-tool-aside { grid-template-columns: 1fr; }
  .hr-type-switch { grid-template-columns: 1fr; }
  .hr-builder-card { padding: 15px; }
  .hr-form-section { padding: 14px; }
  .hr-document-canvas { margin: 0 -12px; padding: 12px; border-radius: 0; }
  .hr-document-toolbar .row-actions { width: 100%; }
  .hr-document-toolbar .btn { flex: 1 1 46%; }
  .hr-document-audit { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 1100px) {
  .finance-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .finance-dashboard-grid { grid-template-columns: 1fr; }
  .finance-filter { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .finance-filter .filter-or { display: none; }
}
@media (max-width: 640px) {
  .document-upload-row { grid-template-columns: 1fr; }
  .document-upload-row .remove-document-row { width: 100%; }
  .document-preview-modal { padding: 0; }
  .document-preview-window { width: 100vw; height: 100svh; border: 0; border-radius: 0; }
  .document-preview-window > header,.document-preview-window > footer { padding: 12px; }
  .document-preview-window > footer .btn { flex: 1; }
  .finance-hero { min-height: 0; align-items: flex-start; flex-direction: column; padding: 22px 18px; }
  .finance-hero h2 { font-size: 29px; }
  .finance-hero .btn { width: 100%; }
  .finance-filter,.finance-metrics { grid-template-columns: 1fr; }
  .finance-filter .btn { width: 100%; }
  .finance-month-row { grid-template-columns: 62px minmax(100px,1fr) 88px; gap: 8px; }
  .finance-month-row > strong { font-size: 10px; }
  .portfolio-ring { width: 168px; }
  .portfolio-ring::after { width: 126px; }
}
@media print {
  body:has(.finance-report-shell) { background: #fff !important; }
  body:has(.finance-report-shell) .finance-filter-card,
  body:has(.finance-report-shell) .finance-hero .btn,
  body:has(.finance-report-shell) .document-preview-modal { display: none !important; }
  body:has(.finance-report-shell) .finance-report-shell { gap: 4mm; }
  body:has(.finance-report-shell) .finance-hero { min-height: 0; padding: 7mm; box-shadow: none; break-inside: avoid; }
  body:has(.finance-report-shell) .finance-hero h2 { font-size: 22pt; }
  body:has(.finance-report-shell) .finance-metrics { display: grid !important; grid-template-columns: repeat(4,minmax(0,1fr)) !important; gap: 2mm; break-inside: avoid; }
  body:has(.finance-report-shell) .finance-metrics .metric { min-height: 25mm; padding: 3mm; border: .3mm solid #d9e3ee !important; }
  body:has(.finance-report-shell) .finance-metrics .metric strong { font-size: 13pt; }
  body:has(.finance-report-shell) .finance-dashboard-grid { display: grid !important; grid-template-columns: 1.5fr .8fr !important; gap: 3mm; break-inside: avoid; }
  body:has(.finance-report-shell) .finance-chart-card,
  body:has(.finance-report-shell) .portfolio-position { min-height: 0; padding: 4mm; border: .3mm solid #d9e3ee !important; }
  body:has(.finance-report-shell) .portfolio-ring { width: 35mm; }
  body:has(.finance-report-shell) .portfolio-ring::after { width: 26mm; }
  body:has(.finance-report-shell) .finance-ledger-card { padding: 3mm; border: .3mm solid #d9e3ee !important; break-before: page; }
  body:has(.finance-report-shell) .finance-ledger-card table { min-width: 0 !important; font-size: 7pt; }
  body:has(.finance-report-shell) .finance-ledger-card th,
  body:has(.finance-report-shell) .finance-ledger-card td { padding: 1.4mm; }
}

/* Public interactive product tour. Kept independent from authenticated layouts. */
.btn-demo-login { width: 100%; min-height: 54px; display: grid; gap: 1px; border-color: rgba(5,38,75,.22); border-radius: 6px; background: rgba(255,255,255,.58); color: var(--navy); }
.btn-demo-login span { font-size: 14px; }
.btn-demo-login small { color: #647083; font-size: 10px; font-weight: 750; }
.btn-demo-login:hover { border-color: var(--teal); background: #fff; }
.demo-body { min-width: 0; background: #f3f7fa; animation: none; }
.demo-body.modal-open { overflow: hidden; }
.demo-topbar { min-height: 72px; position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: 220px minmax(0,1fr) auto; align-items: center; gap: 20px; padding: 10px 22px; border-bottom: 1px solid #d5e0e9; background: rgba(255,255,255,.96); box-shadow: 0 4px 18px rgba(5,38,75,.06); backdrop-filter: blur(14px); }
.demo-brand { min-width: 0; display: flex; align-items: center; gap: 10px; color: var(--navy); }
.demo-brand img { width: 42px; height: 42px; object-fit: contain; border: 1px solid #dce5ed; border-radius: 7px; background: #fff; }
.demo-brand span { min-width: 0; display: grid; line-height: 1.2; }
.demo-brand strong { font-size: 16px; }
.demo-brand small { color: var(--muted); font-size: 10px; }
.demo-role-switch { min-width: 0; display: flex; justify-content: center; gap: 3px; padding: 4px; border: 1px solid #dce5ed; border-radius: 7px; background: #edf3f7; }
.demo-role-switch a { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 7px 13px; border-radius: 5px; color: #526477; font-size: 12px; font-weight: 900; white-space: nowrap; }
.demo-role-switch a:hover { color: var(--navy); background: rgba(255,255,255,.7); }
.demo-role-switch a.active { color: #fff; background: var(--navy); box-shadow: 0 5px 12px rgba(5,38,75,.18); }
.demo-top-actions { display: flex; align-items: center; gap: 8px; }
.demo-top-actions .btn { min-height: 38px; border-radius: 6px; font-size: 12px; }
.demo-safe-pill { min-height: 30px; display: inline-flex; align-items: center; padding: 5px 9px; border: 1px solid #b9e4df; border-radius: 999px; color: #117069; background: #ecf9f7; font-size: 10px; font-weight: 950; white-space: nowrap; }
.demo-safe-pill::before { content: ""; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 3px rgba(22,139,134,.12); }
.demo-layout { min-height: calc(100svh - 72px); display: grid; grid-template-columns: 238px minmax(0,1fr); }
.demo-sidebar { height: calc(100svh - 72px); position: sticky; top: 72px; display: flex; flex-direction: column; gap: 16px; padding: 22px 16px; overflow: auto; color: #fff; background: #06182d; }
.demo-view-identity { display: grid; grid-template-columns: 40px minmax(0,1fr); align-items: center; gap: 10px; padding-bottom: 17px; border-bottom: 1px solid rgba(255,255,255,.12); }
.demo-view-identity > span { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 7px; color: var(--navy); background: #fff; font-weight: 950; }
.demo-view-identity div { min-width: 0; display: grid; }
.demo-view-identity strong { font-size: 14px; }
.demo-view-identity small { color: rgba(255,255,255,.58); font-size: 10px; }
.demo-sidebar .nav-label { color: rgba(255,255,255,.46); font-size: 10px; font-weight: 950; text-transform: uppercase; }
.demo-side-nav { display: grid; gap: 5px; }
.demo-side-nav a { padding: 10px 11px; border-radius: 6px; color: rgba(255,255,255,.72); font-size: 13px; font-weight: 850; }
.demo-side-nav a:hover,.demo-side-nav a.active { color: #fff; background: rgba(255,255,255,.1); }
.demo-side-nav a.active { box-shadow: inset 3px 0 var(--orange); }
.demo-sidebar-note { margin-top: auto; display: grid; gap: 5px; padding: 12px; border: 1px solid rgba(255,255,255,.13); border-radius: 7px; background: rgba(255,255,255,.06); }
.demo-sidebar-note strong { color: #8bd9d3; font-size: 11px; }
.demo-sidebar-note span { color: rgba(255,255,255,.59); font-size: 10px; line-height: 1.45; }
.demo-main { min-width: 0; display: grid; align-content: start; gap: 18px; padding: 24px; overflow: hidden; }
.demo-notice { display: flex; justify-content: space-between; gap: 14px; padding: 10px 12px; border: 1px solid #d6e8e5; border-radius: 7px; color: #4a6772; background: #f7fcfb; font-size: 11px; }
.demo-notice strong { margin-right: 4px; color: var(--teal); }
.demo-hero,.demo-client-hero { min-height: 210px; display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 30px; border-radius: 8px; color: #fff; background: linear-gradient(120deg,#06182d,#0a3f59 58%,#13786f); box-shadow: 0 14px 34px rgba(5,38,75,.15); }
.demo-hero.partner { background: linear-gradient(120deg,#06182d,#124d64 62%,#168b86); }
.demo-hero.finance { background: linear-gradient(120deg,#071a30,#12395e 58%,#345369); }
.demo-hero.services { background: linear-gradient(120deg,#071a30,#0f5360 58%,#257d65); }
.demo-hero .eyebrow,.demo-client-hero .eyebrow,.demo-service-group .eyebrow { margin: 0 0 7px; color: #ffc5a5; font-size: 10px; font-weight: 950; text-transform: uppercase; }
.demo-hero h1,.demo-client-hero h1 { max-width: 760px; margin: 0; font-size: 40px; line-height: 1.04; letter-spacing: 0; }
.demo-hero p:not(.eyebrow),.demo-client-hero p:not(.eyebrow) { max-width: 720px; margin: 12px 0 0; color: rgba(255,255,255,.75); font-size: 14px; }
.demo-hero-stat { min-width: 154px; display: grid; justify-items: end; padding-left: 24px; border-left: 1px solid rgba(255,255,255,.2); }
.demo-hero-stat strong { font-size: 42px; line-height: 1; }
.demo-hero-stat span { margin-top: 7px; color: rgba(255,255,255,.67); font-size: 11px; font-weight: 800; }
.demo-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.demo-metrics .metric { min-height: 116px; position: relative; overflow: hidden; padding: 16px; border-radius: 8px; box-shadow: 0 8px 22px rgba(5,38,75,.06); }
.demo-metrics .metric::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--navy); }
.demo-metrics .metric.tone-green::before { background: var(--green); }
.demo-metrics .metric.tone-orange::before { background: var(--orange); }
.demo-metrics .metric.tone-red::before { background: var(--red); }
.demo-metrics .metric.tone-teal::before { background: var(--teal); }
.demo-metrics .metric strong { font-size: 25px; }
.demo-metrics .metric small { color: var(--muted); font-size: 10px; }
.demo-dashboard-grid { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(290px,.8fr); gap: 14px; align-items: start; }
.demo-panel { min-width: 0; padding: 18px; border-radius: 8px; box-shadow: 0 8px 22px rgba(5,38,75,.06); }
.demo-panel .section-head h2,.demo-service-group .section-head h2 { font-size: 18px; }
.demo-panel .section-head .muted { font-size: 11px; }
.demo-stage-row { width: 100%; border: 0; background: transparent; cursor: pointer; font: inherit; }
.demo-stage-row:hover { background: #f4f9fb; }
.demo-stage-row div i { background: linear-gradient(90deg,var(--teal),#2f7790); }
.demo-action-list { display: grid; gap: 5px; }
.demo-action-list button { width: 100%; min-width: 0; display: grid; grid-template-columns: 10px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 11px 7px; border: 0; border-bottom: 1px solid #e7edf2; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.demo-action-list button:last-child { border-bottom: 0; }
.demo-action-list button:hover { background: #f7fafc; }
.demo-action-list button > span:nth-child(2) { min-width: 0; display: grid; }
.demo-action-list strong { color: var(--navy); font-size: 12px; }
.demo-action-list small { color: var(--muted); font-size: 10px; }
.demo-action-list em { color: var(--muted); font-size: 10px; font-style: normal; font-weight: 900; }
.demo-alert-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
.demo-alert-dot.urgent { background: var(--red); box-shadow: 0 0 0 4px rgba(216,66,66,.1); }
.demo-alert-dot.warning { background: var(--orange); }
.demo-alert-dot.info { background: #347dad; }
.demo-panel table { min-width: 720px; font-size: 12px; }
.demo-panel th { font-size: 9px; }
.demo-panel .btn { min-height: 34px; padding: 6px 10px; border-radius: 6px; font-size: 10px; }
.demo-payment-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.demo-payment-grid article { display: grid; gap: 5px; padding: 15px; border: 1px solid #dce5ed; border-radius: 7px; background: #f8fbfd; }
.demo-payment-grid span,.demo-payment-grid small { color: var(--muted); font-size: 10px; }
.demo-payment-grid strong { color: var(--navy); font-size: 18px; }
.demo-client-hero { background: linear-gradient(120deg,#06182d,#0d5363 64%,#168b86); }
.demo-hero-tags { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 18px; }
.demo-hero-tags span { padding: 5px 8px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; color: rgba(255,255,255,.7); font-size: 9px; font-weight: 850; }
.demo-progress-ring { --demo-progress: 72%; width: 142px; aspect-ratio: 1; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(#50cfbd var(--demo-progress),rgba(255,255,255,.16) 0); }
.demo-progress-ring::before { content: ""; width: 108px; aspect-ratio: 1; grid-area: 1/1; border-radius: 50%; background: #0a364d; }
.demo-progress-ring span { z-index: 1; grid-area: 1/1; display: grid; justify-items: center; color: rgba(255,255,255,.66); font-size: 9px; }
.demo-progress-ring strong { color: #fff; font-size: 25px; }
.demo-client-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border: 1px solid #dce5ed; border-radius: 8px; background: #fff; box-shadow: 0 8px 22px rgba(5,38,75,.05); }
.demo-client-summary article { display: grid; gap: 3px; padding: 15px 18px; border-right: 1px solid #e1e8ee; }
.demo-client-summary article:last-child { border-right: 0; }
.demo-client-summary span { color: var(--muted); font-size: 10px; }
.demo-client-summary strong { color: var(--navy); font-size: 21px; }
.demo-services-assigned { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.demo-assigned-card { display: grid; grid-template-columns: 38px minmax(0,1fr); gap: 10px 12px; padding: 16px; border-radius: 8px; box-shadow: 0 8px 22px rgba(5,38,75,.05); }
.demo-service-label { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 7px; color: #fff; background: var(--navy); font-size: 11px; font-weight: 950; text-transform: uppercase; }
.demo-service-label.teal { background: var(--teal); }
.demo-service-label.orange { background: var(--orange); }
.demo-service-label.green { background: var(--green); }
.demo-assigned-card > div:nth-child(2) { min-width: 0; display: grid; }
.demo-assigned-card > div:nth-child(2) span { color: var(--muted); font-size: 10px; }
.demo-assigned-card > div:nth-child(2) strong { color: var(--navy); font-size: 13px; }
.demo-linear-progress { grid-column: 1/-1; height: 6px; overflow: hidden; border-radius: 999px; background: #e9f0f5; }
.demo-linear-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--teal),var(--orange)); }
.demo-assigned-card footer { grid-column: 1/-1; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.demo-assigned-card footer span { color: var(--muted); font-size: 10px; }
.demo-assigned-card footer button { padding: 0; border: 0; color: var(--teal); background: transparent; font-size: 10px; font-weight: 950; cursor: pointer; }
.demo-next-action { padding: 16px; border: 1px solid #ffd3b8; border-radius: 7px; background: #fff8f3; }
.demo-next-action > span { color: var(--orange); font-size: 10px; font-weight: 950; text-transform: uppercase; }
.demo-next-action h3 { margin: 8px 0 4px; color: var(--navy); font-size: 16px; }
.demo-next-action p { margin: 0 0 14px; color: var(--muted); font-size: 11px; }
.demo-documents-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; }
.demo-documents-grid button { min-width: 0; display: grid; gap: 3px; padding: 14px; border: 1px solid #dce5ed; border-radius: 7px; color: inherit; background: #f8fbfd; text-align: left; cursor: pointer; }
.demo-documents-grid button:hover { border-color: var(--teal); background: #f3fbfa; }
.demo-documents-grid span { color: var(--teal); font-size: 9px; font-weight: 950; text-transform: uppercase; }
.demo-documents-grid strong { overflow: hidden; color: var(--navy); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.demo-documents-grid small { color: var(--muted); font-size: 9px; }
.demo-filter { display: grid; grid-template-columns: minmax(150px,1fr) auto minmax(150px,1fr) minmax(150px,1fr) auto; align-items: end; gap: 10px; padding: 15px; border-radius: 8px; box-shadow: 0 8px 22px rgba(5,38,75,.05); }
.demo-filter > span { align-self: center; padding-top: 18px; color: var(--muted); font-size: 10px; }
.demo-filter .field label { font-size: 10px; }
.demo-filter .field input { min-height: 38px; border-radius: 6px; font-size: 11px; }
.demo-filter .btn { min-height: 38px; border-radius: 6px; font-size: 11px; }
.demo-profit-position { display: grid; justify-items: center; }
.demo-profit-position .section-head,.demo-profit-position .portfolio-summary { width: 100%; }
.demo-service-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); overflow: hidden; border: 1px solid #dce5ed; border-radius: 8px; background: #fff; }
.demo-service-summary > span { display: flex; align-items: baseline; justify-content: center; gap: 7px; padding: 16px; border-right: 1px solid #e1e8ee; color: var(--muted); font-size: 11px; }
.demo-service-summary > span:last-child { border-right: 0; }
.demo-service-summary strong { color: var(--navy); font-size: 22px; }
.demo-service-group { display: grid; gap: 2px; scroll-margin-top: 90px; }
.demo-service-group .section-head { margin: 0; padding: 10px 2px; }
.demo-service-group .section-head h2 { margin: 0; color: var(--navy); }
.demo-service-catalogue { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 11px; }
.demo-service-card { min-height: 210px; display: grid; grid-template-rows: auto 1fr auto; gap: 14px; padding: 17px; border-radius: 8px; box-shadow: 0 8px 22px rgba(5,38,75,.05); }
.demo-service-number { color: #bfd0dc; font-size: 25px; font-weight: 950; }
.demo-service-card h3 { margin: 11px 0 5px; color: var(--navy); font-size: 16px; }
.demo-service-card p { margin: 0; color: var(--muted); font-size: 11px; }
.demo-service-card .btn { min-height: 36px; border-radius: 6px; font-size: 10px; }
.demo-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px; border-top: 1px solid #dce5ed; }
.demo-footer > div { display: grid; }
.demo-footer strong { color: var(--navy); font-size: 13px; }
.demo-footer span { color: var(--muted); font-size: 10px; }
.demo-footer .btn { border-radius: 6px; font-size: 11px; }
.demo-modal[hidden],.demo-toast[hidden] { display: none; }
.demo-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.demo-modal-backdrop { position: absolute; inset: 0; border: 0; background: rgba(3,18,34,.72); backdrop-filter: blur(4px); }
.demo-modal-window { width: min(680px,100%); max-height: calc(100svh - 40px); position: relative; display: grid; overflow: auto; border: 1px solid #dce5ed; border-radius: 8px; background: #fff; box-shadow: 0 30px 90px rgba(0,10,24,.32); }
.demo-modal-window > header,.demo-modal-window > footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 15px 18px; border-bottom: 1px solid #e1e8ee; }
.demo-modal-window > footer { justify-content: flex-end; border-top: 1px solid #e1e8ee; border-bottom: 0; }
.demo-modal-window h2 { margin: 2px 0 0; color: var(--navy); font-size: 20px; }
.demo-modal-content { display: grid; gap: 15px; padding: 18px; }
.icon-close { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid #dce5ed; border-radius: 6px; color: var(--navy); background: #fff; font-size: 22px; cursor: pointer; }
.demo-modal-profile { display: grid; grid-template-columns: 44px minmax(0,1fr) auto; align-items: center; gap: 11px; }
.demo-modal-profile > div { display: grid; }
.demo-modal-profile small { color: var(--muted); font-size: 10px; }
.demo-modal-tabs { display: flex; gap: 6px; overflow-x: auto; border-bottom: 1px solid #e1e8ee; }
.demo-modal-tabs span { flex: 0 0 auto; padding: 8px 10px; color: var(--muted); font-size: 10px; font-weight: 900; }
.demo-modal-tabs span.active { color: var(--teal); box-shadow: inset 0 -2px var(--teal); }
.demo-modal-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.demo-modal-grid article { display: grid; gap: 4px; padding: 11px; border: 1px solid #e1e8ee; border-radius: 6px; background: #f8fbfd; }
.demo-modal-grid span { color: var(--muted); font-size: 9px; }
.demo-modal-grid strong { color: var(--navy); font-size: 11px; }
.demo-file-preview { min-height: 145px; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 18px; border: 1px dashed #b9c8d5; border-radius: 7px; background: #f5f8fa; }
.demo-file-preview > span { width: 46px; height: 52px; display: grid; place-items: center; border-radius: 5px; color: #fff; background: var(--red); font-size: 9px; font-weight: 950; }
.demo-file-preview > div { display: grid; }
.demo-file-preview small { color: var(--muted); font-size: 10px; }
.demo-toast { max-width: min(390px,calc(100vw - 28px)); position: fixed; right: 18px; bottom: 18px; z-index: 120; padding: 12px 14px; border-radius: 7px; color: #fff; background: #0a304b; box-shadow: 0 16px 42px rgba(5,38,75,.25); font-size: 11px; font-weight: 800; }

@media (max-width: 1120px) {
  .demo-topbar { grid-template-columns: 190px minmax(0,1fr); }
  .demo-top-actions { display: none; }
  .demo-layout { grid-template-columns: 208px minmax(0,1fr); }
  .demo-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .demo-service-catalogue { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 820px) {
  .demo-topbar { min-height: 116px; position: relative; grid-template-columns: 1fr auto; gap: 9px; padding: 10px 12px 8px; }
  .demo-safe-pill { display: inline-flex; }
  .demo-top-actions { display: flex; }
  .demo-top-actions .btn { display: none; }
  .demo-role-switch { grid-column: 1/-1; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .demo-role-switch::-webkit-scrollbar { display: none; }
  .demo-layout { min-height: calc(100svh - 116px); grid-template-columns: 1fr; }
  .demo-sidebar { display: none; }
  .demo-main { padding: 14px; }
  .demo-hero,.demo-client-hero { min-height: 0; padding: 23px 20px; }
  .demo-hero h1,.demo-client-hero h1 { font-size: 31px; }
  .demo-dashboard-grid { grid-template-columns: 1fr; }
  .demo-documents-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .demo-filter { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .demo-filter > span { display: none; }
  .demo-filter .btn { grid-column: 1/-1; }
}
@media (max-width: 560px) {
  .demo-brand img { width: 36px; height: 36px; }
  .demo-brand strong { font-size: 14px; }
  .demo-brand small { display: none; }
  .demo-notice { display: grid; }
  .demo-notice > span:last-child { display: none; }
  .demo-hero,.demo-client-hero { align-items: flex-start; flex-direction: column; gap: 20px; }
  .demo-hero h1,.demo-client-hero h1 { font-size: 28px; }
  .demo-hero-stat { width: 100%; justify-items: start; padding: 14px 0 0; border-top: 1px solid rgba(255,255,255,.2); border-left: 0; }
  .demo-progress-ring { width: 122px; }
  .demo-progress-ring::before { width: 92px; }
  .demo-metrics,.demo-services-assigned,.demo-service-catalogue { grid-template-columns: 1fr; }
  .demo-client-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .demo-client-summary article:nth-child(2) { border-right: 0; }
  .demo-client-summary article:nth-child(-n+2) { border-bottom: 1px solid #e1e8ee; }
  .demo-payment-grid,.demo-service-summary { grid-template-columns: 1fr; }
  .demo-payment-grid article { min-height: 94px; }
  .demo-service-summary > span { border-right: 0; border-bottom: 1px solid #e1e8ee; }
  .demo-service-summary > span:last-child { border-bottom: 0; }
  .demo-filter { grid-template-columns: 1fr; }
  .demo-filter .btn { grid-column: 1; }
  .demo-modal { padding: 0; }
  .demo-modal-window { width: 100vw; max-height: 100svh; min-height: 100svh; border: 0; border-radius: 0; }
  .demo-modal-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .demo-modal-profile { grid-template-columns: 42px minmax(0,1fr); }
  .demo-modal-profile .badge { grid-column: 1/-1; justify-self: start; }
  .demo-modal-window > footer .btn { flex: 1; }
  .demo-footer { align-items: stretch; flex-direction: column; }
  .demo-footer .btn { width: 100%; }
}

@media (max-width: 860px) {
  .client-directory-table,.client-directory-table table,.client-directory-table tbody { display: block; width: 100%; }
  .client-directory-table thead { display: none; }
  .client-directory-table tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 18px; margin-bottom: 10px; padding: 11px 13px; border: 1px solid #dce5ed; border-radius: 7px; background: #fff; }
  .client-directory-table tr:last-child { margin-bottom: 0; }
  .client-directory-table td { width: auto !important; min-width: 0; display: grid; grid-template-columns: 96px minmax(0,1fr); align-content: start; gap: 8px; padding: 8px 3px; border-bottom: 1px solid #edf1f5; }
  .client-directory-table td::before { content: attr(data-label); color: #738092; font-size: 10px; font-weight: 950; text-transform: uppercase; }
  .client-directory-table td:nth-last-child(-n+2) { border-bottom: 0; }
  .client-directory-table td[colspan] { grid-column: 1/-1; display: block; border: 0; }
  .client-directory-table td[colspan]::before { display: none; }
  .client-directory-table .client-alert-stack { display: flex; flex-wrap: wrap; }
  .client-directory-table .client-open-button { width: fit-content; }
}
@media (max-width: 900px) {
  .client-command-bar { align-items: stretch; flex-direction: column; }
  .client-command-actions { width: 100%; }
  .client-command-actions .btn { flex: 1; }
  .operations-alert-strip { flex-wrap: wrap; }
  .operations-alert { flex: 1 1 250px; }
  .operations-alert-link { width: 100%; margin-left: 0; justify-content: flex-start; }
  .client-documents-layout .table-wrap,.client-documents-layout table,.client-documents-layout tbody { display: block; width: 100%; }
  .client-documents-layout .table-wrap { overflow: visible; }
  .client-documents-layout table { min-width: 0; }
  .client-documents-layout thead { display: none; }
  .client-documents-layout tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 15px; margin-bottom: 10px; padding: 11px; border: 1px solid #dce5ed; border-radius: 7px; background: #fff; }
  .client-documents-layout td { min-width: 0; display: grid; grid-template-columns: 76px minmax(0,1fr); gap: 8px; padding: 8px 2px; overflow-wrap: anywhere; }
  .client-documents-layout td::before { content: attr(data-label); color: #738092; font-size: 10px; font-weight: 950; text-transform: uppercase; }
  .client-documents-layout td .row-actions { min-width: 0; }
}
@media (max-width: 640px) {
  .client-command-bar { padding: 16px; }
  .client-command-actions { display: grid; }
  .client-command-actions .btn { width: 100%; }
  .client-directory-card { padding: 14px; }
  .client-directory-table tr,.client-documents-layout tr { grid-template-columns: 1fr; }
  .client-directory-table td,.client-documents-layout td { grid-template-columns: 82px minmax(0,1fr); }
  .client-directory-table td:nth-last-child(2) { border-bottom: 1px solid #edf1f5; }
  .client-directory-table .client-open-button { width: 100%; }
  .workflow-modal { padding: 0; }
  .workflow-modal-window,.workflow-modal-window.workflow-modal-wide { width: 100vw; max-height: 100svh; min-height: 100svh; border: 0; border-radius: 0; }
  .workflow-modal-window > header,.workflow-modal-body { padding: 14px; }
  .workflow-modal-body .form-grid { grid-template-columns: 1fr; }
  .workflow-modal-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .workflow-modal-actions .btn { width: 100%; }
  .fab-account-card > div { align-items: flex-start; flex-direction: column; }
  .fab-account-card > div strong { text-align: left; }
  .fab-account-card dl { grid-template-columns: 1fr; }
  .client-documents-layout .section-head { align-items: flex-start; flex-direction: column; }
}

/* V12 mobile application shell and admin cashbook. */
html,body { max-width: 100%; overflow-x: hidden; }
.shell main,.content,.content > * { min-width: 0; }
.sidebar-brand-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sidebar-close,.mobile-nav-backdrop,.mobile-bottom-nav,.mobile-sidebar-actions { display: none; }
.dashboard-command-header { min-height: 148px; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 14px; padding: 24px 26px; border: 1px solid #cbd9e6; border-left: 5px solid var(--teal); background: #fff; box-shadow: 0 10px 30px rgba(5,38,75,.07); }
.dashboard-command-header h2,.cashbook-header h2 { margin: 4px 0 7px; color: var(--navy); font-size: 30px; line-height: 1.12; }
.dashboard-command-header p,.cashbook-header p { max-width: 720px; margin: 0; color: var(--muted); }
.dashboard-command-actions,.cashbook-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dashboard-today-strip { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin-bottom: 22px; border: 1px solid #cbd9e6; background: #fff; box-shadow: 0 8px 24px rgba(5,38,75,.05); }
.dashboard-today-strip a { min-width: 0; display: grid; gap: 5px; padding: 15px 18px; border-right: 1px solid var(--line); }
.dashboard-today-strip a:last-child { border-right: 0; }
.dashboard-today-strip span { color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.dashboard-today-strip strong { color: var(--navy); font-size: 20px; overflow-wrap: anywhere; }
.dashboard-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 25px 0 11px; padding-bottom: 9px; border-bottom: 1px solid #cfdbe6; }
.dashboard-section-heading h2 { margin: 2px 0 0; color: var(--navy); font-size: 20px; }
.dashboard-operations-metrics .metric,.dashboard-finance-metrics .metric { min-height: 108px; border-radius: 7px; box-shadow: 0 7px 22px rgba(5,38,75,.055); }
.dashboard-operations-metrics .metric strong,.dashboard-finance-metrics .metric strong { font-size: 23px; }
.cashbook-shell { display: grid; gap: 16px; }
.cashbook-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 23px 25px; border: 1px solid #cbd9e6; border-left: 5px solid var(--orange); background: #fff; box-shadow: 0 10px 30px rgba(5,38,75,.07); }
.range-switch { width: fit-content; display: flex; gap: 3px; padding: 4px; border: 1px solid #d6e1ea; border-radius: 7px; background: #eaf0f5; }
.range-switch a { min-height: 36px; display: inline-flex; align-items: center; padding: 7px 13px; border-radius: 5px; color: #5f7081; font-size: 12px; font-weight: 900; }
.range-switch a.active { color: #fff; background: var(--navy); }
.cashbook-filter { display: grid; grid-template-columns: minmax(160px,220px) minmax(160px,220px) auto 1fr; align-items: end; gap: 12px; padding: 15px 17px; border-radius: 7px; box-shadow: none; }
.cashbook-period { justify-self: end; display: grid; text-align: right; }
.cashbook-period small { color: var(--muted); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.cashbook-period strong { color: var(--navy); }
.cashbook-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.cashbook-metrics article { min-width: 0; min-height: 118px; display: grid; align-content: space-between; gap: 8px; padding: 17px; border: 1px solid #d4dfe8; border-top: 4px solid var(--navy); border-radius: 7px; background: #fff; box-shadow: 0 8px 24px rgba(5,38,75,.055); }
.cashbook-metrics article.positive { border-top-color: var(--green); }
.cashbook-metrics article.negative { border-top-color: var(--orange); }
.cashbook-metrics span { color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.cashbook-metrics strong { color: var(--navy); font-size: 24px; line-height: 1.1; overflow-wrap: anywhere; }
.cashbook-metrics small { color: #798696; }
.account-position-card,.cashbook-ledger-card { border-radius: 7px; }
.account-card-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.account-card { min-width: 0; padding: 17px; border: 1px solid #cfdce7; border-radius: 7px; background: #f9fbfd; }
.account-card.inactive { opacity: .62; }
.account-card-head,.account-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.account-card-head > span { color: var(--teal); font-size: 10px; font-weight: 950; text-transform: uppercase; }
.account-card h3 { margin: 13px 0 3px; color: var(--navy); font-size: 18px; }
.account-card p { min-height: 38px; margin: 0 0 13px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.account-card > strong { display: block; margin-bottom: 14px; color: var(--navy); font-size: 25px; overflow-wrap: anywhere; }
.account-card-foot { padding-top: 10px; border-top: 1px solid var(--line); }
.account-card-foot small { color: var(--muted); }
.text-button { padding: 0; border: 0; background: transparent; color: var(--navy); font-weight: 900; cursor: pointer; }
.cashbook-empty { display: grid; justify-items: start; gap: 8px; padding: 18px; border: 1px dashed #b9c9d7; background: #f8fbfd; }
.cashbook-empty strong { color: var(--navy); font-size: 18px; }
.cashbook-empty span { color: var(--muted); }
.cashbook-insights { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; }
.daily-cash-row { display: grid; grid-template-columns: 58px minmax(80px,1fr) 150px; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #e5ebf0; }
.daily-cash-row time { color: var(--navy); font-size: 12px; font-weight: 900; }
.daily-cash-row > div { display: grid; gap: 4px; }
.daily-cash-row i { display: block; max-width: 100%; height: 6px; border-radius: 0 4px 4px 0; }
.daily-cash-row .cash-in { background: var(--green); }
.daily-cash-row .cash-out { background: var(--orange); }
.daily-cash-row > span,.category-cash-row > span:last-child { display: flex; justify-content: flex-end; gap: 10px; font-size: 11px; font-style: normal; }
.daily-cash-row b,.category-cash-row b,.money-inward { color: var(--green); }
.daily-cash-row em,.category-cash-row em,.money-outward { color: #b34d29; font-style: normal; }
.category-cash-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid #e5ebf0; }
.category-cash-row > span:first-child { display: grid; }
.category-cash-row strong { color: var(--navy); font-size: 13px; }
.category-cash-row small { color: var(--muted); }
.cashbook-ledger-card table { min-width: 1060px; }
.cashbook-ledger-card td small { display: block; max-width: 220px; margin-top: 4px; color: var(--muted); overflow-wrap: anywhere; }
.reversed-row { opacity: .58; background: #f4f5f6; text-decoration: line-through; }
.reversed-row .btn,.reversed-row .badge { text-decoration: none; }

@media (max-width: 1100px) {
  .dashboard-today-strip,.cashbook-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-today-strip a:nth-child(2) { border-right: 0; }
  .dashboard-today-strip a:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .account-card-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .cashbook-insights { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .app-body { padding: 0; }
  .app-body.mobile-nav-open { overflow: hidden; }
  .app-body .shell,.app-body .shell > main { min-height: 100dvh; }
  .app-body .sidebar { width: min(330px,88vw); height: 100dvh; position: fixed; inset: 0 auto 0 0; z-index: 60; display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top,0px) + 16px) 16px calc(env(safe-area-inset-bottom,0px) + 16px); overflow-y: auto; transform: translateX(-105%); transition: transform .22s ease; border: 0; box-shadow: 18px 0 45px rgba(0,18,36,.28); background: linear-gradient(180deg,#06182d,#092544); }
  .app-body.mobile-nav-open .sidebar { transform: translateX(0); }
  .app-body .sidebar-brand-row { align-items: center; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,.13); }
  .app-body .brand { width: auto; margin: 0; padding: 0; }
  .app-body .brand img { width: 40px; height: 40px; }
  .app-body .brand small { display: block; color: rgba(255,255,255,.58); }
  .sidebar-close { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.18); border-radius: 6px; background: rgba(255,255,255,.07); color: #fff; font-size: 24px; cursor: pointer; }
  .app-body .nav-label { display: block; margin: 18px 8px 8px; }
  .app-body .nav { min-height: 0; display: grid; align-content: start; gap: 5px; overflow: visible; padding: 0; margin: 0; }
  .app-body .nav a { min-height: 42px; display: flex; align-items: center; padding: 9px 11px; border-radius: 6px; background: transparent; white-space: normal; }
  .app-body .nav a.active { color: #fff; background: rgba(255,255,255,.12); box-shadow: inset 3px 0 var(--teal); }
  .app-body .sidebar-user { display: flex; margin-top: auto; }
  .mobile-sidebar-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 9px; }
  .mobile-sidebar-actions a { min-height: 38px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.14); border-radius: 6px; color: rgba(255,255,255,.8); font-size: 12px; font-weight: 900; }
  .mobile-nav-backdrop { position: fixed; inset: 0; z-index: 55; border: 0; background: rgba(0,16,31,.55); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .app-body.mobile-nav-open .mobile-nav-backdrop { display: block; opacity: 1; pointer-events: auto; }
  .mobile-bottom-nav { min-height: calc(64px + env(safe-area-inset-bottom,0px)); position: fixed; inset: auto 0 0; z-index: 45; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); padding: 6px 7px calc(6px + env(safe-area-inset-bottom,0px)); border-top: 1px solid #cdd9e3; background: rgba(255,255,255,.98); box-shadow: 0 -8px 24px rgba(5,38,75,.1); }
  .role-customer .mobile-bottom-nav { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .mobile-bottom-nav a,.mobile-bottom-nav button { min-width: 0; min-height: 50px; display: grid; place-items: center; align-content: center; gap: 1px; padding: 4px; border: 0; border-radius: 6px; background: transparent; color: #687789; font-size: 10px; font-weight: 900; cursor: pointer; }
  .mobile-bottom-nav span { color: #94a1ae; font-size: 10px; font-weight: 950; }
  .mobile-bottom-nav a.active { color: var(--navy); background: #eaf3f6; }
  .mobile-bottom-nav a.active span { color: var(--teal); }
  .app-body .topbar { min-height: 68px; position: sticky; top: 0; z-index: 35; flex-direction: row; align-items: center; padding: calc(env(safe-area-inset-top,0px) + 10px) 14px 10px; border-bottom: 1px solid #d6e0e8; background: rgba(255,255,255,.97); }
  .app-body .topbar h1 { font-size: 22px; }
  .app-body .page-kicker { font-size: 9px; }
  .app-body .page-heading > .muted { display: none; }
  .app-body .topbar-right,.app-body .top-actions { width: auto; }
  .app-body .top-actions { display: flex; }
  .app-body .top-actions .btn:not(.notification-button) { display: none; }
  .app-body .top-actions .notification-button { width: auto; min-height: 38px; padding: 7px 9px; font-size: 0; }
  .app-body .top-actions .notification-button::before { content: "Alerts"; font-size: 11px; }
  .app-body .top-actions .notification-button span { font-size: 10px; }
  .app-body .content { padding: 14px 13px calc(82px + env(safe-area-inset-bottom,0px)); }
  .app-body .content::before { display: none; }
  .whatsapp-float { right: 12px; bottom: calc(76px + env(safe-area-inset-bottom,0px)); padding: 9px 12px; border-radius: 6px; font-size: 11px; }
  .install-app-btn { right: 12px; bottom: calc(119px + env(safe-area-inset-bottom,0px)); border-radius: 6px; }
  .dashboard-command-header,.cashbook-header { min-height: 0; align-items: flex-start; flex-direction: column; padding: 19px; }
  .dashboard-command-header h2,.cashbook-header h2 { font-size: 25px; }
  .dashboard-command-actions,.cashbook-actions { width: 100%; }
  .dashboard-command-actions .btn,.cashbook-actions .btn { flex: 1 1 140px; }
  .cashbook-filter { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .cashbook-filter .btn { align-self: stretch; }
  .cashbook-period { justify-self: start; text-align: left; }
  .mobile-record-table,.mobile-record-table table,.mobile-record-table tbody { width: 100%; display: block; }
  .mobile-record-table { overflow: visible; }
  .mobile-record-table table { min-width: 0 !important; }
  .mobile-record-table thead { display: none; }
  .mobile-record-table tr { width: 100%; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 14px; margin-bottom: 10px; padding: 12px; border: 1px solid #d6e1ea; border-radius: 7px; background: #fff; }
  .mobile-record-table td { min-width: 0; display: grid; grid-template-columns: 82px minmax(0,1fr); gap: 8px; align-content: start; padding: 8px 2px; border-bottom: 1px solid #e8edf2; overflow-wrap: anywhere; }
  .mobile-record-table td::before { content: attr(data-label); color: #748193; font-size: 9px; font-weight: 950; text-transform: uppercase; }
  .mobile-record-table td[colspan] { grid-column: 1/-1; display: block; }
  .mobile-record-table td[colspan]::before { display: none; }
  .mobile-record-table .row-actions { min-width: 0; }
}

@media (max-width: 640px) {
  .app-body .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .app-body .form-grid { grid-template-columns: 1fr; }
  .app-body .metric { min-height: 88px; padding: 12px; border-radius: 7px; }
  .app-body .metric strong,.dashboard-operations-metrics .metric strong,.dashboard-finance-metrics .metric strong { font-size: 18px; }
  .app-body .metric span { font-size: 11px; }
  .app-body .card { max-width: 100%; padding: 14px; border-radius: 7px; }
  .app-body .section-head { align-items: flex-start; flex-direction: column; gap: 8px; }
  .app-body .section-head .row-actions { width: 100%; }
  .app-body .section-head .row-actions .btn { flex: 1; }
  .tabs { width: 100%; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; overflow: visible; }
  .tabs a { min-width: 0; display: grid; place-items: center; padding: 8px 6px; border-radius: 6px; text-align: center; white-space: normal; }
  .table-wrap { max-width: 100%; }
  .dashboard-today-strip,.cashbook-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; border: 0; background: transparent; box-shadow: none; }
  .dashboard-today-strip a { min-height: 84px; padding: 12px; border: 1px solid #d6e1ea !important; border-radius: 7px; background: #fff; }
  .dashboard-today-strip strong { font-size: 17px; }
  .dashboard-section-heading { align-items: flex-start; margin-top: 20px; }
  .dashboard-section-heading h2 { font-size: 18px; }
  .account-card-grid { grid-template-columns: 1fr; }
  .account-card > strong { font-size: 22px; }
  .range-switch { width: 100%; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); }
  .range-switch a { min-width: 0; justify-content: center; padding: 6px 3px; text-align: center; }
  .cashbook-filter { grid-template-columns: 1fr 1fr; padding: 12px; }
  .cashbook-filter .btn,.cashbook-period { grid-column: 1/-1; }
  .cashbook-metrics article { min-height: 102px; padding: 13px; }
  .cashbook-metrics strong { font-size: 18px; }
  .daily-cash-row { grid-template-columns: 48px minmax(60px,1fr); }
  .daily-cash-row > span { grid-column: 2; justify-content: flex-start; }
  .category-cash-row { align-items: flex-start; flex-direction: column; }
  .category-cash-row > span:last-child { justify-content: flex-start; }
  .mobile-record-table tr { grid-template-columns: 1fr; }
  .mobile-record-table td { grid-template-columns: 78px minmax(0,1fr); }
  .mobile-record-table td[data-label="Action"] .row-actions,.mobile-record-table td[data-label="Action"] form,.mobile-record-table td[data-label="Action"] .btn { width: 100%; }
  .pipeline-row { grid-template-columns: minmax(98px,1.25fr) minmax(54px,1fr) 25px; }
}

@media print {
  .mobile-bottom-nav,.mobile-nav-backdrop,.sidebar-close { display: none !important; }
}

/* V13 premium admin and partner workspace. */
.ui-icon,.nav-icon,.mobile-nav-icon,.quick-action-icon,.button-icon,.position-icon,.inline-icon {
  width: 20px;
  height: 20px;
  display: block;
  flex: 0 0 auto;
}
.button-icon { width: 17px; height: 17px; margin-right: 7px; }
.inline-icon { width: 15px; height: 15px; }
.app-body .nav a { display: flex; align-items: center; gap: 11px; }
.app-body .nav .nav-icon { width: 19px; height: 19px; }
.nav-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (min-width: 981px) {
  .app-body { background: #f2f5f8; }
  .app-body .shell { min-height: 100dvh; display: block; background: #f2f5f8; }
  .app-body .sidebar {
    width: 252px;
    height: 100dvh;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    padding: 18px 14px;
    overflow: hidden;
    border-right: 1px solid #dbe2e9;
    background: #fff;
    color: var(--navy);
    box-shadow: 10px 0 34px rgba(18,42,66,.055);
  }
  .app-body .sidebar-brand-row { flex: 0 0 auto; }
  .app-body .brand {
    width: 100%;
    margin-bottom: 20px;
    padding: 10px;
    border: 1px solid #dde5ec;
    background: #f8fafc;
    color: var(--navy);
    box-shadow: none;
  }
  .app-body .brand small { color: #738092; }
  .app-body .nav-label { color: #8b96a3; letter-spacing: 0; }
  .app-body .nav {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #cbd5df transparent;
    padding-right: 3px;
  }
  .app-body .nav a {
    min-height: 42px;
    padding: 9px 11px;
    color: #536273;
    font-weight: 780;
  }
  .app-body .nav a::before { display: none; }
  .app-body .nav a:hover { border-color: #dce5ec; background: #f3f7fa; color: var(--navy); transform: translateX(2px); }
  .app-body .nav a.active {
    border-color: #cce2e0;
    background: #eaf6f5;
    color: #087972;
    box-shadow: inset 3px 0 #168b86;
  }
  .app-body .nav a.active .nav-icon { color: #087972; }
  .app-body .sidebar-user {
    flex: 0 0 auto;
    margin-top: 13px;
    padding: 13px 9px 4px;
    border-top-color: #dde5ec;
    color: var(--navy);
  }
  .app-body .sidebar-user small { color: #7a8795; }
  .app-body .sidebar-user .user-avatar { border-color: #cbd8e3; background: var(--navy); color: #fff; }
  .app-body .shell > main { min-width: 0; min-height: 100dvh; margin-left: 252px; background: #f2f5f8; }
  .app-body .topbar {
    min-height: 78px;
    padding: 12px clamp(20px,2.5vw,38px);
    border-bottom-color: #dce3ea;
    background: rgba(255,255,255,.94);
    box-shadow: 0 8px 26px rgba(19,43,67,.04);
  }
  .app-body .content { width: min(1580px,100%); padding: 24px clamp(20px,2.5vw,38px) 40px; }
}

.premium-dashboard { display: grid; gap: 18px; }
.premium-dashboard-hero {
  min-height: 246px;
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(300px,390px);
  align-items: stretch;
  gap: 28px;
  overflow: hidden;
  position: relative;
  padding: 28px;
  border: 1px solid #123c5b;
  border-radius: 8px;
  background: linear-gradient(118deg,#062844 0%,#0a4859 62%,#695260 100%);
  color: #fff;
  box-shadow: 0 18px 42px rgba(4,31,54,.16);
}
.premium-dashboard-hero::after {
  content: "";
  width: 260px;
  height: 340px;
  position: absolute;
  inset: -90px -110px auto auto;
  border: 1px solid rgba(255,255,255,.13);
  transform: rotate(24deg);
  pointer-events: none;
}
.premium-dashboard-copy { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; position: relative; z-index: 1; }
.dashboard-greeting { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 19px; color: rgba(255,255,255,.72); font-size: 12px; font-weight: 800; }
.dashboard-greeting time { color: rgba(255,255,255,.58); font-weight: 650; }
.dashboard-live { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 9px; color: #b8ebe6; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.dashboard-live i { width: 7px; height: 7px; border-radius: 50%; background: #5ce0a4; box-shadow: 0 0 0 4px rgba(92,224,164,.14); }
.premium-dashboard-hero h2 { max-width: 680px; margin: 0; font-size: clamp(27px,3vw,42px); line-height: 1.07; letter-spacing: 0; }
.premium-dashboard-hero p { max-width: 650px; margin: 11px 0 0; color: rgba(255,255,255,.74); font-size: 14px; }
.dashboard-hero-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 23px; }
.dashboard-hero-actions .btn { min-height: 42px; border-radius: 6px; }
.btn-light { background: #fff; color: var(--navy); }
.btn-glass { border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.08); color: #fff; }
.dashboard-position-card {
  min-width: 0;
  display: grid;
  align-content: center;
  position: relative;
  z-index: 1;
  padding: 22px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 8px;
  background: rgba(255,255,255,.1);
  backdrop-filter: blur(16px);
}
.dashboard-position-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: rgba(255,255,255,.68); font-size: 11px; font-weight: 850; text-transform: uppercase; }
.position-icon { width: 22px; height: 22px; color: #efb85c; }
.dashboard-position-card > strong { margin-top: 17px; font-size: clamp(25px,3vw,38px); line-height: 1; overflow-wrap: anywhere; }
.dashboard-position-card > small { margin-top: 8px; color: rgba(255,255,255,.6); }
.dashboard-position-meta { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 22px; padding-top: 15px; border-top: 1px solid rgba(255,255,255,.15); }
.admin-dashboard .dashboard-position-meta { grid-template-columns: repeat(3,minmax(0,1fr)); }
.dashboard-position-meta span { display: grid; gap: 2px; color: rgba(255,255,255,.56); font-size: 10px; text-transform: uppercase; }
.dashboard-position-meta b { color: #fff; font-size: 14px; text-transform: none; overflow-wrap: anywhere; }

.dashboard-quick-actions {
  display: grid;
  grid-template-columns: repeat(6,minmax(0,1fr));
  gap: 10px;
  padding: 14px;
  border: 1px solid #dce3ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(16,43,69,.055);
}
.dashboard-quick-actions a { min-width: 0; min-height: 96px; display: grid; grid-template-columns: 42px minmax(0,1fr); grid-template-rows: auto auto; align-content: center; column-gap: 10px; padding: 12px; border: 1px solid transparent; border-radius: 7px; transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease; }
.dashboard-quick-actions a:hover { border-color: #d8e2e9; background: #f8fafc; box-shadow: 0 8px 20px rgba(10,38,64,.06); transform: translateY(-2px); }
.dashboard-quick-actions a > span { width: 42px; height: 42px; grid-row: 1/3; display: grid; place-items: center; border-radius: 50%; background: #edf6f5; color: #11877f; }
.dashboard-quick-actions a:nth-child(2) > span,.dashboard-quick-actions a:nth-child(5) > span { background: #fff2e9; color: #de642e; }
.dashboard-quick-actions a:nth-child(3) > span,.dashboard-quick-actions a:nth-child(6) > span { background: #eef1fb; color: #5268aa; }
.quick-action-icon { width: 20px; height: 20px; }
.dashboard-quick-actions strong { min-width: 0; align-self: end; color: var(--navy); font-size: 13px; line-height: 1.2; }
.dashboard-quick-actions small { min-width: 0; align-self: start; margin-top: 3px; color: #7a8795; font-size: 10px; line-height: 1.25; }

.dashboard-cashflow-strip { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); overflow: hidden; border: 1px solid #dce3ea; border-radius: 8px; background: #fff; box-shadow: 0 8px 24px rgba(16,43,69,.045); }
.dashboard-cashflow-strip a { min-width: 0; display: grid; gap: 5px; padding: 15px 17px; border-right: 1px solid #e3e9ee; }
.dashboard-cashflow-strip a:last-child { border-right: 0; }
.dashboard-cashflow-strip span { color: #778493; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.dashboard-cashflow-strip strong { color: var(--navy); font-size: 18px; overflow-wrap: anywhere; }
.dashboard-cashflow-strip .positive-value { color: #257e52; }
.dashboard-cashflow-strip .negative-value { color: #bf4a3e; }

.premium-section-heading { min-height: 48px; display: flex; align-items: end; justify-content: space-between; gap: 16px; padding: 0 2px 9px; border-bottom: 1px solid #dce3ea; }
.premium-section-heading h2 { margin: 2px 0 0; color: var(--navy); font-size: 20px; }
.premium-section-heading > a { display: inline-flex; align-items: center; gap: 5px; color: #536678; font-size: 12px; font-weight: 850; }
.dashboard-kpi-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.dashboard-kpi {
  min-width: 0;
  min-height: 146px;
  display: grid;
  grid-template-columns: minmax(0,1fr) 36px;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  padding: 17px;
  border: 1px solid #dce3ea;
  border-top: 3px solid var(--kpi-color,#168b86);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(16,43,69,.045);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.dashboard-kpi:hover { transform: translateY(-3px); box-shadow: 0 15px 32px rgba(16,43,69,.09); }
.dashboard-kpi.needs-attention { background: #fffdf9; }
.dashboard-kpi-label { min-width: 0; color: #697787; font-size: 11px; font-weight: 900; text-transform: uppercase; }
.dashboard-kpi-icon { width: 36px; height: 36px; grid-column: 2; grid-row: 1/3; display: grid; place-items: center; border-radius: 50%; background: #edf4f5; background: color-mix(in srgb,var(--kpi-color) 11%,#fff); color: var(--kpi-color); }
.dashboard-kpi-icon .ui-icon { width: 18px; height: 18px; }
.dashboard-kpi > strong { min-width: 0; align-self: end; color: var(--navy); font-size: 24px; line-height: 1.1; overflow-wrap: anywhere; }
.dashboard-kpi > small { grid-column: 1/3; color: #85909c; font-size: 10px; }
.dashboard-kpi.tone-teal { --kpi-color:#168b86; }
.dashboard-kpi.tone-blue { --kpi-color:#377fc0; }
.dashboard-kpi.tone-orange { --kpi-color:#e77638; }
.dashboard-kpi.tone-navy { --kpi-color:#173d62; }
.dashboard-kpi.tone-green { --kpi-color:#3a945d; }
.dashboard-kpi.tone-gold { --kpi-color:#c68a26; }
.dashboard-kpi.tone-red { --kpi-color:#cf4d50; }
.dashboard-kpi.tone-violet { --kpi-color:#735da8; }

.dashboard-finance-panel { display: grid; gap: 12px; }
.dashboard-finance-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); overflow: hidden; border: 1px solid #dce3ea; border-radius: 8px; background: #fff; box-shadow: 0 8px 24px rgba(16,43,69,.045); }
.dashboard-finance-grid a { min-width: 0; position: relative; display: grid; gap: 7px; padding: 18px; border-right: 1px solid #e3e9ee; }
.dashboard-finance-grid a:last-child { border-right: 0; }
.dashboard-finance-grid span { color: #748190; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.dashboard-finance-grid strong { color: var(--navy); font-size: 20px; overflow-wrap: anywhere; }
.finance-marker { width: 36px; height: 4px; margin-top: 4px; border-radius: 4px; }
.orange-marker { background: #e77638; }
.green-marker { background: #3a945d; }
.blue-marker { background: #377fc0; }
.navy-marker { background: #173d62; }

.premium-dashboard-charts { margin-top: 0; grid-template-columns: minmax(300px,.72fr) minmax(0,1.28fr); }
.premium-dashboard .chart-card { min-height: 330px; padding: 20px; border-radius: 8px; background: #fff; box-shadow: 0 8px 26px rgba(16,43,69,.05); }
.premium-dashboard .chart-card .section-head h2,.premium-dashboard .dashboard-list-card h2 { margin: 2px 0 0; font-size: 19px; }
.premium-dashboard .donut { width: 154px; height: 154px; background: conic-gradient(#168b86 var(--value),#edf1f4 0); }
.premium-dashboard .donut::after { inset: 17px; }
.premium-dashboard .donut span { font-size: 27px; }
.premium-dashboard .pipeline-row { min-height: 34px; grid-template-columns: minmax(155px,220px) minmax(90px,1fr) 34px; border-radius: 6px; }
.premium-dashboard .pipeline-row div { height: 8px; background: #edf1f4; }
.premium-dashboard .pipeline-row i { background: linear-gradient(90deg,#168b86,#56b9a8 72%,#e7793e); }
.dashboard-lists-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.premium-dashboard .dashboard-list-card { min-height: 280px; padding: 20px; border-radius: 8px; background: #fff; box-shadow: 0 8px 26px rgba(16,43,69,.05); }
.premium-dashboard .leader-row,.premium-dashboard .work-row { min-width: 0; border: 0; border-bottom: 1px solid #e7ecf0; border-radius: 0; padding: 13px 4px; background: transparent; }
.premium-dashboard .leader-row:hover,.premium-dashboard .work-row:hover { background: #f7fafc; }
.premium-dashboard .work-row > span,.premium-dashboard .leader-row > span { min-width: 0; }
.premium-dashboard .work-row strong,.premium-dashboard .leader-row strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.premium-dashboard .work-row em { color: #d65e32; font-weight: 900; white-space: nowrap; }
.dashboard-empty-row { padding: 24px 4px; color: #7a8795; font-size: 13px; }

@media (max-width: 1180px) {
  .dashboard-quick-actions { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .dashboard-kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .premium-dashboard-hero { grid-template-columns: minmax(0,1fr) 330px; }
}

@media (max-width: 980px) {
  .app-body .nav a { gap: 10px; }
  .app-body .nav .nav-icon { color: rgba(255,255,255,.78); }
  .app-body .nav a.active .nav-icon { color: #fff; }
  .mobile-bottom-nav a,.mobile-bottom-nav button { grid-template-rows: 25px auto; gap: 2px; }
  .mobile-bottom-nav .mobile-nav-icon { width: 21px; height: 21px; color: #748291; }
  .mobile-bottom-nav a.active .mobile-nav-icon { color: var(--teal); }
  .mobile-bottom-nav span { color: inherit; font-size: 10px; }
  .app-body .notification-button::before { display: none; }
  .app-body .notification-button .button-icon { width: 20px; height: 20px; margin: 0; }
  .app-body .notification-button .top-action-label { display: none; }
  .app-body .notification-button .notification-count { min-width: 17px; height: 17px; position: absolute; inset: 1px 1px auto auto; margin: 0; padding: 0 4px; font-size: 9px; }
  .premium-dashboard { gap: 13px; }
  .premium-dashboard-hero { grid-template-columns: 1fr; gap: 18px; padding: 21px; }
  .premium-dashboard-hero h2 { font-size: 30px; }
  .dashboard-position-card { min-height: 150px; }
  .premium-dashboard-charts { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .premium-dashboard-hero { min-height: 0; padding: 19px 17px; }
  .dashboard-greeting { margin-bottom: 16px; }
  .dashboard-greeting time { display: none; }
  .premium-dashboard-hero h2 { font-size: 27px; }
  .dashboard-hero-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); width: 100%; }
  .dashboard-hero-actions .btn { width: 100%; padding: 8px 9px; font-size: 12px; }
  .dashboard-position-card { padding: 17px; }
  .admin-dashboard .dashboard-position-meta { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .admin-dashboard .dashboard-position-meta span:last-child { grid-column: 1/-1; }
  .dashboard-position-card > strong { font-size: 27px; }
  .dashboard-quick-actions { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; padding: 9px; }
  .dashboard-quick-actions a { min-height: 105px; grid-template-columns: 1fr; grid-template-rows: 42px auto auto; justify-items: center; align-content: center; gap: 3px; padding: 8px 4px; text-align: center; }
  .dashboard-quick-actions a > span { grid-row: auto; width: 40px; height: 40px; }
  .dashboard-quick-actions strong { align-self: auto; font-size: 11px; }
  .dashboard-quick-actions small { display: none; }
  .dashboard-cashflow-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-cashflow-strip a:nth-child(2) { border-right: 0; }
  .dashboard-cashflow-strip a:nth-child(-n+2) { border-bottom: 1px solid #e3e9ee; }
  .dashboard-cashflow-strip strong { font-size: 15px; }
  .premium-section-heading { align-items: flex-end; }
  .premium-section-heading h2 { font-size: 18px; }
  .premium-section-heading > a { font-size: 0; }
  .premium-section-heading > a .inline-icon { width: 18px; height: 18px; }
  .dashboard-kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .dashboard-kpi { min-height: 130px; padding: 13px; grid-template-columns: minmax(0,1fr) 30px; }
  .dashboard-kpi-icon { width: 30px; height: 30px; }
  .dashboard-kpi > strong { font-size: 19px; }
  .dashboard-kpi-label { font-size: 9px; }
  .dashboard-kpi > small { font-size: 9px; }
  .dashboard-finance-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-finance-grid a:nth-child(2) { border-right: 0; }
  .dashboard-finance-grid a:nth-child(-n+2) { border-bottom: 1px solid #e3e9ee; }
  .dashboard-finance-grid strong { font-size: 16px; }
  .dashboard-lists-grid { grid-template-columns: 1fr; }
  .premium-dashboard .chart-card,.premium-dashboard .dashboard-list-card { min-height: 0; padding: 15px; }
  .premium-dashboard .donut-wrap { min-height: 0; align-items: center; flex-direction: row; gap: 18px; }
  .premium-dashboard .donut { width: 118px; height: 118px; }
  .premium-dashboard .donut::after { inset: 14px; }
  .premium-dashboard .donut span { font-size: 22px; }
  .premium-dashboard .pipeline-row { grid-template-columns: minmax(92px,1.2fr) minmax(52px,1fr) 24px; gap: 7px; padding: 7px 2px; }
  .premium-dashboard .pipeline-row span { font-size: 10px; overflow-wrap: anywhere; }
  .premium-dashboard .work-row { align-items: flex-start; }
  .premium-dashboard .work-row strong { white-space: normal; }
  .premium-dashboard .work-row em { font-size: 12px; }
}

@media (max-width: 390px) {
  .dashboard-hero-actions { grid-template-columns: 1fr; }
  .dashboard-position-meta { gap: 6px; }
  .dashboard-position-meta b { font-size: 12px; }
  .dashboard-kpi { min-height: 122px; padding: 11px; }
  .dashboard-kpi > strong { font-size: 17px; }
}

@media print {
  .app-body .shell > main { margin-left: 0 !important; }
  .premium-dashboard-hero,.dashboard-quick-actions { box-shadow: none !important; }
}

/* V14: aligned document uploads and a persistent portal appearance switch. */
.theme-toggle { flex: 0 0 auto; gap: 7px; }
.theme-toggle .theme-icon { width: 18px; height: 18px; margin: 0; }
.theme-toggle .theme-icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .theme-icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .theme-icon-sun { display: block; }

.document-upload-group { border-radius: 8px; }
.document-upload-group > .section-head { align-items: flex-start; }
.document-upload-row {
  grid-template-columns: minmax(180px,.78fr) minmax(0,1.22fr) auto;
  align-items: start;
  gap: 12px;
  padding: 14px;
}
.document-upload-row .field { min-width: 0; grid-template-rows: 22px 48px; align-content: start; gap: 0; }
.document-upload-row .field label { min-height: 22px; align-self: start; margin: 0; line-height: 20px; }
.document-upload-row .field select,
.document-upload-row .field input[type="file"] { height: 48px; min-height: 48px; margin: 0; }
.document-upload-row .field input[type="file"] { min-width: 0; max-width: 100%; overflow: hidden; padding: 5px 7px; line-height: 36px; }
.document-upload-row .field input[type="file"]::file-selector-button {
  height: 36px;
  margin: 0 10px 0 0;
  padding: 0 13px;
  border: 0;
  border-right: 1px solid #cdd8e5;
  background: #eef3f7;
  color: #173755;
  font-weight: 850;
  cursor: pointer;
}
.document-upload-row .file-limit { display: none; }
.document-upload-row .file-error { grid-row: 3; margin-top: 5px; }
.document-upload-row .remove-document-row { height: 48px; min-height: 48px; margin-top: 22px; }

html[data-theme="dark"] body.app-body {
  --ink: #dce5ef;
  --muted: #98a7b8;
  --line: #2c3b4d;
  --mist: #0e1622;
  --white: #151f2c;
  --teal: #43b9af;
  --orange: #ff8950;
  --green: #67c786;
  --red: #ff7478;
  --shadow: 0 14px 40px rgba(0,0,0,.26);
  --soft-shadow: 0 14px 38px rgba(0,0,0,.18);
  background: #0b121c;
  color: #dce5ef;
  color-scheme: dark;
}
html[data-theme="dark"] .app-body .shell,
html[data-theme="dark"] .app-body .shell > main { background: #0b121c; }
html[data-theme="dark"] .app-body .sidebar {
  border-right-color: #253548;
  background: #101a27;
  color: #e7edf5;
}
html[data-theme="dark"] .app-body .brand {
  border-color: #2b3c4e;
  background: #162331;
  box-shadow: none;
}
html[data-theme="dark"] .app-body .brand,
html[data-theme="dark"] .app-body .sidebar-user strong { color: #f4f7fb; }
html[data-theme="dark"] .app-body .brand small,
html[data-theme="dark"] .app-body .sidebar-user small,
html[data-theme="dark"] .app-body .nav-label { color: #8393a5; }
html[data-theme="dark"] .app-body .sidebar .nav a { color: #a9b6c4; }
html[data-theme="dark"] .app-body .sidebar .nav a:hover { border-color: #304156; background: #172434; color: #f2f6fb; }
html[data-theme="dark"] .app-body .sidebar .nav a.active { border-color: #37605f; background: #183334; color: #e9fffc; }
html[data-theme="dark"] .app-body .sidebar .nav a.active .nav-icon { color: #57c9be; }
html[data-theme="dark"] .app-body .sidebar-user { border-top-color: #26374a; }

html[data-theme="dark"] .app-body .topbar {
  border-bottom-color: #28384a;
  background: rgba(15,24,36,.95);
  box-shadow: 0 8px 24px rgba(0,0,0,.16);
}
html[data-theme="dark"] .app-body .topbar h1,
html[data-theme="dark"] .app-body .page-heading h1,
html[data-theme="dark"] .app-body .topbar-user strong { color: #edf3fa; }
html[data-theme="dark"] .app-body .page-kicker { color: #5fc8be; }
html[data-theme="dark"] .app-body .topbar-user small { color: #8f9eaf; }
html[data-theme="dark"] .app-body .user-avatar { border-color: #34506a; background: #17314b; color: #eef6ff; }
html[data-theme="dark"] .app-body .content::before { background: linear-gradient(90deg,rgba(48,172,163,.07),rgba(255,126,71,.04),transparent); }

html[data-theme="dark"] .app-body .btn-ghost,
html[data-theme="dark"] .app-body .tabs a,
html[data-theme="dark"] .app-body .icon-close {
  border-color: #334458;
  background: #172231;
  color: #dce8f5;
}
html[data-theme="dark"] .app-body .btn-ghost:hover,
html[data-theme="dark"] .app-body .tabs a:hover { border-color: #4a6179; background: #1d2b3b; }
html[data-theme="dark"] .app-body .tabs a.active { border-color: #38a89f; background: #238d86; color: #fff; }
html[data-theme="dark"] .app-body .btn-dark,
html[data-theme="dark"] .app-body .fab-account-card > div { background: #062a4f; color: #fff; }
html[data-theme="dark"] .app-body .btn-light { background: #f6f8fb; color: #102a44; }

html[data-theme="dark"] .app-body :is(
  .card,.term-card,.terms-strip,.empty-state,.profile-card,.detail-grid div,
  .workflow-modal-window,.document-preview-window,.document-preview-fallback,
  .document-upload-row,.dashboard-quick-actions,.dashboard-cashflow-strip,
  .dashboard-kpi,.dashboard-finance-grid,.chart-card,.dashboard-list-card,
  .client-command-bar,.operations-alert,.dashboard-command-header,.dashboard-today-strip,
  .cashbook-header,.cashbook-metrics article,.account-card,.cashbook-empty,
  .demo-client-summary,.demo-service-summary
) {
  border-color: #2c3b4d;
  background: #151f2c;
  color: #dce5ef;
  box-shadow: 0 10px 28px rgba(0,0,0,.15);
}
html[data-theme="dark"] .app-body .card:hover { border-color: #3d5268; box-shadow: 0 15px 36px rgba(0,0,0,.24); }
html[data-theme="dark"] .app-body :is(
  .field label,.section-head h2,.card > h2,.workflow-modal-window h2,.document-preview-window h2,
  .document-upload-group h3,.term-card h3,.cost-schedule h3,.client-command-bar h2,
  .dashboard-command-header h2,.cashbook-header h2,.dashboard-section-heading h2,.account-card h3,
  .account-card > strong,.cashbook-empty strong,.cashbook-period strong,.cashbook-metrics strong,
  .daily-cash-row time,.category-cash-row strong,.service-workspace-card h3,.service-progress strong,
  .service-card-meta strong,.summary-list strong,.service-balance-line strong,.quiet-complete,
  .workspace-admin-row b,.next-action-banner strong,.service-documents strong,.operations-alert strong,
  .document-preview-fallback strong,.portfolio-ring strong,.portfolio-summary strong,.metric strong,
  .detail-grid strong,.cost-schedule strong,.bar-row span,.pipeline-row span,.pipeline-row strong,
  .client-link,.fab-account-card dd,.premium-section-heading h2,.dashboard-kpi > strong,
  .dashboard-finance-grid strong,.dashboard-quick-actions strong
) { color: #e8f1fa; }
html[data-theme="dark"] .app-body :is(.muted,.metric span,.detail-grid span,.cost-schedule span,.legend,.dashboard-kpi-label,.dashboard-kpi > small,.dashboard-finance-grid span,.dashboard-quick-actions small,.dashboard-empty-row) { color: #94a4b6; }

html[data-theme="dark"] .app-body :is(input,select,textarea,.toolbar input,.toolbar select,.stage-inline-form select,.stage-inline-form input) {
  border-color: #34465a;
  background: #101a27;
  color: #e3ebf4;
}
html[data-theme="dark"] .app-body :is(input,select,textarea)::placeholder { color: #6f8092; }
html[data-theme="dark"] .app-body :is(input,select,textarea):focus { border-color: #4abcb3; outline-color: rgba(74,188,179,.24); }
html[data-theme="dark"] .app-body option { background: #101a27; color: #e3ebf4; }
html[data-theme="dark"] .app-body .field input[type="file"]::file-selector-button { border-right-color: #34465a; background: #213043; color: #e5eef7; }

html[data-theme="dark"] .app-body .workflow-modal-window > header,
html[data-theme="dark"] .app-body .document-preview-window > header,
html[data-theme="dark"] .app-body .document-preview-window > footer { border-color: #2c3b4d; background: #111b28; }
html[data-theme="dark"] .app-body .workflow-modal-backdrop,
html[data-theme="dark"] .app-body .document-preview-modal { background: rgba(1,6,12,.76); }
html[data-theme="dark"] .app-body .document-upload-group { border-color: #314258; background: #111b28; }
html[data-theme="dark"] .app-body .document-upload-row { border-color: #314258; background: #172331; }
html[data-theme="dark"] .app-body .document-preview-body { background: #0d1622; }
html[data-theme="dark"] .app-body .document-preview-body iframe { background: #fff; }

html[data-theme="dark"] .app-body th { border-color: #2d3d50; color: #91a1b3; }
html[data-theme="dark"] .app-body td { border-color: #29394b; }
html[data-theme="dark"] .app-body tbody tr:hover { background: #172432; }
html[data-theme="dark"] .app-body .mobile-record-table tr { border-color: #2d3e51; background: #151f2c; }
html[data-theme="dark"] .app-body .mobile-record-table td { border-bottom-color: #273749; }
html[data-theme="dark"] .app-body .badge { background: #223347; color: #dbe8f5; }
html[data-theme="dark"] .app-body .badge.green,
html[data-theme="dark"] .app-body .green { background: #173326; color: #82dda0; }
html[data-theme="dark"] .app-body .badge.orange,
html[data-theme="dark"] .app-body .orange { background: #35251d; color: #ffad80; }
html[data-theme="dark"] .app-body .badge.red,
html[data-theme="dark"] .app-body .red { background: #351e22; color: #ff9598; }
html[data-theme="dark"] .app-body .badge.teal,
html[data-theme="dark"] .app-body .teal { background: #163331; color: #75d7ce; }

html[data-theme="dark"] .app-body :is(.leader-row,.work-row,.doc-row,.payment-pill,.cost-schedule div,.service-balance-summary span,.next-action-list a,.service-note,.hr-letter-history a,.reversed-row) { border-color: #2d3d4f; background: #111b28; }
html[data-theme="dark"] .app-body :is(.leader-row,.work-row,.next-action-list a,.hr-letter-history a):hover { background: #192634; }
html[data-theme="dark"] .app-body :is(.stage,.service-stage) { border-color: #2d3d4f; background: #151f2c; }
html[data-theme="dark"] .app-body .stage-no,
html[data-theme="dark"] .app-body .stage-marker { background: #223347; color: #dce9f5; }
html[data-theme="dark"] .app-body .stage.current { border-color: #a85b37; background: #2a201c; }
html[data-theme="dark"] .app-body .service-stage.completed { border-color: #316049; background: #14281f; }
html[data-theme="dark"] .app-body .service-stage.in-progress { border-color: #30605e; background: #142625; }
html[data-theme="dark"] .app-body .service-stage.blocked { border-color: #765031; background: #292018; }

html[data-theme="dark"] .app-body .dashboard-quick-actions a:hover,
html[data-theme="dark"] .app-body .premium-dashboard .leader-row:hover,
html[data-theme="dark"] .app-body .premium-dashboard .work-row:hover,
html[data-theme="dark"] .app-body .pipeline-row:hover { border-color: #35495e; background: #192634; }
html[data-theme="dark"] .app-body .dashboard-quick-actions a > span { background: #173433; }
html[data-theme="dark"] .app-body .dashboard-quick-actions a:nth-child(2) > span,
html[data-theme="dark"] .app-body .dashboard-quick-actions a:nth-child(5) > span { background: #34251d; }
html[data-theme="dark"] .app-body .dashboard-quick-actions a:nth-child(3) > span,
html[data-theme="dark"] .app-body .dashboard-quick-actions a:nth-child(6) > span { background: #20283c; }
html[data-theme="dark"] .app-body :is(.dashboard-cashflow-strip a,.dashboard-finance-grid a) { border-color: #2d3d4f; }
html[data-theme="dark"] .app-body .premium-section-heading { border-bottom-color: #2d3d4f; }
html[data-theme="dark"] .app-body .dashboard-kpi.needs-attention { background: #211e19; }
html[data-theme="dark"] .app-body .dashboard-kpi-icon { background: #1c2e35; }
html[data-theme="dark"] .app-body .premium-dashboard .donut { background: conic-gradient(#43b9af var(--value),#293747 0); }
html[data-theme="dark"] .app-body .donut::after,
html[data-theme="dark"] .app-body .portfolio-ring::after { background: #151f2c; }
html[data-theme="dark"] .app-body :is(.premium-dashboard .pipeline-row div,.bar,.demo-linear-progress) { background: #293747; }

html[data-theme="dark"] .app-body .fab-account-card { border-color: #33495e; background: #111b28; }
html[data-theme="dark"] .app-body .fab-account-card dl div { border-color: #2c3b4d; }
html[data-theme="dark"] .app-body .notice { border-color: #745d2d; background: #292315; color: #f0cc79; }
html[data-theme="dark"] .app-body .error { border-color: #754044; background: #2b1b1e; color: #ff9da0; }
html[data-theme="dark"] .app-body .success { border-color: #326044; background: #14251b; color: #8ed9a2; }
html[data-theme="dark"] .app-body .special-note { border-color: #69482f; background: #292019; }
html[data-theme="dark"] .app-body .status-banner { border-color: #37615f; background: #15302e; color: #dcefed; }
html[data-theme="dark"] .app-body .status-banner.overdue,
html[data-theme="dark"] .app-body .deadline-chip.pending { border-color: #79532e; background: #2c2117; color: #efbe79; }
html[data-theme="dark"] .app-body .status-banner.completed-balance,
html[data-theme="dark"] .app-body .metric-alert,
html[data-theme="dark"] .app-body .work-row.balance-alert { border-color: #7b3d42 !important; background: #2b1a1d !important; }

html[data-theme="dark"] .app-body .range-switch { border-color: #314257; background: #101a27; }
html[data-theme="dark"] .app-body .daily-cash-row,
html[data-theme="dark"] .app-body .category-cash-row { border-bottom-color: #29394b; }
html[data-theme="dark"] .app-body .mobile-bottom-nav { border-top-color: #2b3a4d; background: rgba(15,24,36,.97); color: #9baabc; }
html[data-theme="dark"] .app-body .mobile-bottom-nav a.active { color: #54c1b8; }
html[data-theme="dark"] .app-body .invoice,
html[data-theme="dark"] .app-body .hr-letter-sheet { background: #fff; color: #172233; color-scheme: light; }
html[data-theme="dark"] .app-body .invoice :is(h1,h2,h3,strong,.invoice-company,.invoice-brand,.invoice-total,.summary-box strong,.terms h3),
html[data-theme="dark"] .app-body .hr-letter-sheet :is(h1,h2,h3,strong) { color: #0b2d49; }

/* V15: cohesive soft-dark workspace with explicit table contrast. */
html[data-theme="dark"] body.app-body {
  --ink: #e7edf4;
  --muted: #9baabd;
  --line: #344657;
  --mist: #131d28;
  --white: #1c2835;
  --teal: #4cc1b7;
  --orange: #ff9a62;
  --green: #72cf91;
  --red: #ff8388;
  background: #131d28;
  color: #e7edf4;
}
html[data-theme="dark"] .app-body .shell,
html[data-theme="dark"] .app-body .shell > main { background: #131d28; }
html[data-theme="dark"] .app-body .sidebar { border-right-color: #2b3a49; background: #111b26; }
html[data-theme="dark"] .app-body .topbar { border-bottom-color: #334454; background: rgba(23,34,46,.97); box-shadow: 0 7px 22px rgba(0,0,0,.12); }
html[data-theme="dark"] .app-body .content { background: #131d28; }

html[data-theme="dark"] .app-body :is(
  .card,.term-card,.terms-strip,.empty-state,.profile-card,.detail-grid div,
  .dashboard-quick-actions,.dashboard-cashflow-strip,.dashboard-kpi,.dashboard-finance-grid,
  .chart-card,.dashboard-list-card,.client-command-bar,.dashboard-command-header,
  .dashboard-today-strip,.cashbook-header,.cashbook-metrics article,.account-card,.cashbook-empty,
  .notification-item,.email-event,.issue-card,.hr-document-toolbar,.service-workspace-card,
  .relationship-card,.workspace-control-card,.form-card,.journey-rail
) {
  border-color: #344657;
  background: #1c2835;
  color: #e7edf4;
  box-shadow: 0 9px 24px rgba(0,0,0,.14);
}
html[data-theme="dark"] .app-body .card:hover { border-color: #42596e; box-shadow: 0 12px 30px rgba(0,0,0,.18); }
html[data-theme="dark"] .app-body .client-command-bar { border-left: 4px solid #3ba99f; background: #1b2937; }
html[data-theme="dark"] .app-body .client-command-bar > div:first-child > span { color: #a5b3c3; }

html[data-theme="dark"] .app-body .btn-primary { border-color: #25928a; background: #23867f; color: #fff; box-shadow: 0 6px 16px rgba(20,112,105,.2); }
html[data-theme="dark"] .app-body .btn-primary:hover { border-color: #35aaa1; background: #2c9a92; }
html[data-theme="dark"] .app-body .btn-dark { border: 1px solid #3d5368; background: #26394c; color: #edf4fa; }
html[data-theme="dark"] .app-body .btn-dark:hover { border-color: #536c84; background: #30475d; }
html[data-theme="dark"] .app-body .btn-ghost { border-color: #3a4d60; background: #202e3d; color: #dfe8f1; }
html[data-theme="dark"] .app-body .btn-ghost:hover { border-color: #526a80; background: #293a4b; }
html[data-theme="dark"] .app-body .theme-toggle { background: #223244; }

html[data-theme="dark"] .app-body :is(input,select,textarea,.toolbar input,.toolbar select,.stage-inline-form select,.stage-inline-form input) {
  border-color: #405367;
  background: #172330;
  color: #edf3f8;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.16);
}
html[data-theme="dark"] .app-body :is(input,select,textarea)::placeholder { color: #8494a7; opacity: 1; }
html[data-theme="dark"] .app-body :is(input,select,textarea):focus { border-color: #55bcb4; outline: 3px solid rgba(76,193,183,.13); }
html[data-theme="dark"] .app-body option { background: #172330; color: #edf3f8; }
html[data-theme="dark"] .app-body .field label { color: #dfe8f1; }

html[data-theme="dark"] .app-body .table-wrap { border-color: #3a4c5e; background: #17232f; }
html[data-theme="dark"] .app-body table { color: #dce6ef; }
html[data-theme="dark"] .app-body thead th { border-bottom-color: #42566a; background: #223140; color: #aebed0; }
html[data-theme="dark"] .app-body tbody td { border-bottom-color: #304252; background: #182431; color: #dce6ef; }
html[data-theme="dark"] .app-body tbody tr:nth-child(even) td { background: #1a2734; }
html[data-theme="dark"] .app-body tbody tr:hover td { background: #223442; }
html[data-theme="dark"] .app-body tbody td strong { color: #f0f5f9; }
html[data-theme="dark"] .app-body tbody td .muted { color: #97a8ba; }
html[data-theme="dark"] .app-body .client-link { color: #e8f4fb; border-bottom-color: rgba(86,196,186,.42); }
html[data-theme="dark"] .app-body .client-link:hover { color: #73d1c8; border-bottom-color: #73d1c8; }
html[data-theme="dark"] .app-body .payment-alert-row:not(.completed-balance-row) td { background: #211f29; }
html[data-theme="dark"] .app-body .stalled-client-row td:first-child { box-shadow: inset 4px 0 #d89a42; }
html[data-theme="dark"] .app-body .completed-balance-row td { border-bottom-color: #613b44; background: #271d24; }
html[data-theme="dark"] .app-body .client-open-button { border-color: #466078; background: #26394c; color: #f0f5f9; }

html[data-theme="dark"] .app-body .operations-alert { box-shadow: none; }
html[data-theme="dark"] .app-body .operations-alert.warning { border-color: #67522f; background: #2a241a; }
html[data-theme="dark"] .app-body .operations-alert.warning strong { color: #f1b65f; }
html[data-theme="dark"] .app-body .operations-alert.warning span { color: #d2c09c; }
html[data-theme="dark"] .app-body .operations-alert.urgent { border-color: #6f3f48; background: #2b1f24; }
html[data-theme="dark"] .app-body .operations-alert.urgent strong { color: #ff8188; }
html[data-theme="dark"] .app-body .operations-alert.urgent span { color: #d8afb5; }
html[data-theme="dark"] .app-body .operations-alert.clear { border-color: #365b4b; background: #182a23; }
html[data-theme="dark"] .app-body .operations-alert.clear span { color: #acd2bf; }
html[data-theme="dark"] .app-body .operations-alert-link { min-height: 44px; margin-left: auto; padding: 9px 13px; border: 1px solid #3c5666; border-radius: 6px; background: #1c2d3a; color: #75d1c9; }
html[data-theme="dark"] .app-body .operations-alert-link:hover { border-color: #4d746f; background: #213b40; color: #a5ece6; }
html[data-theme="dark"] .app-body .client-alert-tag.warning { border-color: #725933; background: #302718; color: #efb65f; }
html[data-theme="dark"] .app-body .client-alert-tag.urgent { border-color: #713f48; background: #301d23; color: #ff8d92; }
html[data-theme="dark"] .app-body .client-alert-tag.clear { border-color: #37604e; background: #182b23; color: #84d3a4; }
html[data-theme="dark"] .app-body .service-credit { color: #76d2b3; }

html[data-theme="dark"] .app-body .notification-item h3,
html[data-theme="dark"] .app-body .email-event h3,
html[data-theme="dark"] .app-body .issue-card h3 { color: #eef4f9; }
html[data-theme="dark"] .app-body .notification-item p,
html[data-theme="dark"] .app-body .email-event p,
html[data-theme="dark"] .app-body .issue-card p { color: #9eafc0; }
html[data-theme="dark"] .app-body .notification-item.read { opacity: .78; }

html[data-theme="dark"] .app-body .tabs { border-color: #344657; background: #172330; }
html[data-theme="dark"] .app-body .tabs a { color: #aebdcd; }
html[data-theme="dark"] .app-body .tabs a.active { background: #23867f; color: #fff; }
html[data-theme="dark"] .app-body .workflow-modal-window,
html[data-theme="dark"] .app-body .document-preview-window { border-color: #405367; background: #1b2734; box-shadow: 0 30px 80px rgba(0,0,0,.42); }
html[data-theme="dark"] .app-body .workflow-modal-window > header,
html[data-theme="dark"] .app-body .document-preview-window > header,
html[data-theme="dark"] .app-body .document-preview-window > footer { border-color: #344657; background: #172330; }
html[data-theme="dark"] .app-body .document-upload-group { border-color: #3a4d60; background: #172330; }
html[data-theme="dark"] .app-body .document-upload-row { border-color: #3b4e62; background: #1d2b39; }

#clientSearch { width: min(680px,100%); flex-wrap: nowrap; margin-bottom: 0; }
#clientSearch input[name="q"] { min-width: 260px; flex: 1 1 auto; }

@media (min-width: 861px) and (max-width: 1350px) {
  .client-directory-table th:nth-child(4),
  .client-directory-table td:nth-child(4) { display: none; }
  .client-directory-table th:nth-child(1) { width: 17%; }
  .client-directory-table th:nth-child(2) { width: 11%; }
  .client-directory-table th:nth-child(3) { width: 15%; }
  .client-directory-table th:nth-child(5) { width: 18%; }
  .client-directory-table th:nth-child(6) { width: 16%; }
  .client-directory-table th:nth-child(7) { width: 16%; }
  .client-directory-table th:nth-child(8) { width: 7%; }
  .client-directory-table th,
  .client-directory-table td { padding-inline: 7px; font-size: 12px; }
  .client-directory-table .client-open-button { min-width: 54px; padding-inline: 7px; white-space: nowrap; }
}

@media (max-width: 720px) {
  #clientSearch { display: grid; grid-template-columns: minmax(0,1fr) auto; width: 100%; }
  #clientSearch input[name="q"] { min-width: 0; }
  #clientSearch .btn { min-width: 84px; }
  #clientSearch .btn:last-child:nth-child(4) { grid-column: 1/-1; }
  html[data-theme="dark"] .app-body .client-directory-table tr,
  html[data-theme="dark"] .app-body .mobile-record-table tr { border-color: #3a4c5e; background: #182431; }
  html[data-theme="dark"] .app-body .client-directory-table td,
  html[data-theme="dark"] .app-body .mobile-record-table td { border-bottom-color: #304252; background: transparent; }
}

@media (max-width: 860px) {
  html[data-theme="dark"] .app-body .client-directory-table {
    overflow: visible;
    border: 0;
    background: transparent;
  }
  html[data-theme="dark"] .app-body .client-directory-table tr {
    border-color: #3a4c5e;
    background: #182431;
    box-shadow: 0 8px 22px rgba(0,0,0,.12);
  }
  html[data-theme="dark"] .app-body .client-directory-table td,
  html[data-theme="dark"] .app-body .client-directory-table tr:nth-child(even) td,
  html[data-theme="dark"] .app-body .client-directory-table tr:hover td {
    border-bottom-color: #304252;
    background: transparent;
  }
  html[data-theme="dark"] .app-body .client-directory-table td::before { color: #7f92a5; }
}

@media (max-width: 980px) {
  .app-body .top-actions .theme-toggle { width: 42px; min-width: 42px; height: 42px; display: inline-grid !important; place-items: center; padding: 0; }
  .app-body .theme-toggle .top-action-label { display: none; }
  html[data-theme="dark"] .app-body .topbar { background: rgba(15,24,36,.97); }
}

@media (max-width: 700px) {
  .document-upload-group > .section-head { display: grid; grid-template-columns: 1fr; }
  .document-upload-row { grid-template-columns: 1fr; gap: 11px; padding: 12px; }
  .document-upload-row .field { grid-template-rows: auto 48px; gap: 5px; }
  .document-upload-row .field label { min-height: 0; }
  .document-upload-row .remove-document-row { width: 100%; margin-top: 0; }
}

@media print {
  html[data-theme="dark"] body.app-body { background: #fff !important; color: #142033 !important; color-scheme: light; }
  .theme-toggle { display: none !important; }
  .invoice,.hr-letter-sheet { background: #fff !important; color: #172233 !important; }
}
