@import url("/workspace.css?v=ui-20261017");
@import url("/workspace-native.css?v=ui-20261017");
@import url("/workspace-refine.css?v=ui-20261017");

/*
  POINTCLOUD OFFICE UI SYSTEM
  This is the authoritative presentation layer for the Office hub.
  Feature styles may describe content, but shell, spacing, surfaces, controls,
  typography and responsive layout are governed here.
*/

:root {
  /* Model inspection uses a neutral white canvas in both screen themes. */
  --ui-model-canvas: #ffffff;
  --ui-model-canvas-muted: #646464;
  --ui-sidebar: 248px;
  --ui-topbar: 72px;
  --ui-page-max: 1440px;
  --ui-content-max: 1240px;
  --ui-gutter: clamp(20px, 3.2vw, 48px);
  --ui-space-1: 4px;
  --ui-space-2: 8px;
  --ui-space-3: 12px;
  --ui-space-4: 16px;
  --ui-space-5: 20px;
  --ui-space-6: 24px;
  --ui-space-8: 32px;
  --ui-space-10: 40px;
  --ui-radius-sm: 8px;
  --ui-radius: 12px;
  --ui-radius-lg: 16px;
  --ui-control: 42px;
  --ui-text-xs: 10px;
  --ui-text-sm: 12px;
  --ui-text: 14px;
  --ui-text-lg: 16px;
  --ui-title: clamp(36px, 4vw, 48px);
  --ui-surface: var(--surface);
  --ui-surface-subtle: color-mix(in srgb, var(--surface) 72%, var(--canvas));
  --ui-border: var(--line);
  --ui-border-strong: var(--line-strong);
  --ui-shadow: 0 12px 34px rgba(43,35,29,.055);
  --ui-focus: #6e675f;
  --ui-destructive: #a34c40;
  --ui-focus-halo: color-mix(in srgb, var(--ui-focus) 22%, transparent);
  --ui-icon-stroke: 1.75;
  --ui-motion-fast: 140ms;
  --ui-motion: 190ms;
  --cal-present-bg: #d3eddd;
  --cal-present-ink: #2f724a;
  --cal-present-border: #aad5b9;
  --cal-paid-bg: #ffe7ad;
  --cal-paid-ink: #9a5a0f;
  --cal-paid-border: #e8c879;
  --cal-unpaid-bg: #f6d0cb;
  --cal-unpaid-ink: #a54539;
  --cal-unpaid-border: #e6aaa2;
  --cal-half-bg: #d3e3f8;
  --cal-half-ink: #3e6799;
  --cal-half-border: #aac6e8;
  --cal-holiday-bg: #e7d8f4;
  --cal-holiday-ink: #70498d;
  --cal-holiday-border: #cdb5e1;
  --cal-unmarked-bg: #e9eef5;
  --cal-unmarked-ink: #66758a;
  --cal-unmarked-border: #d5dce7;
}

/* Revenue is read-only: billing, dated cash, and uncertain dates stay visibly separate. */
.revenue-period{display:flex;align-items:end;gap:var(--ui-space-3);margin-bottom:var(--ui-space-5);padding:var(--ui-space-4);border:1px solid var(--ui-border);border-radius:var(--ui-radius);background:var(--ui-surface)}
.revenue-period label{display:grid;gap:6px;color:var(--muted);font-size:var(--ui-text-xs);font-weight:700}.revenue-period :is(input,select){min-height:var(--ui-control);padding:0 var(--ui-space-3);border:1px solid var(--ui-border);border-radius:var(--ui-radius-sm);background:var(--ui-surface);color:var(--ink)}
.revenue-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:var(--ui-space-3);margin-bottom:var(--ui-space-3)}.revenue-kpis article,.revenue-panel{min-width:0;padding:var(--ui-space-5);border:1px solid var(--ui-border);border-radius:var(--ui-radius-lg);background:var(--ui-surface);box-shadow:var(--ui-shadow)}.revenue-kpis small,.revenue-panel header small{color:var(--muted);font-size:var(--ui-text-xs);font-weight:800;letter-spacing:.08em}.revenue-kpis strong{display:block;margin:10px 0;font-size:clamp(18px,2vw,28px);line-height:1.2}.revenue-kpis p,.revenue-panel header p,.revenue-disclosure{color:var(--muted);font-size:var(--ui-text-sm);line-height:1.5}
.revenue-grid{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(260px,.7fr);gap:var(--ui-space-3);margin-bottom:var(--ui-space-3)}.revenue-panel header{display:flex;align-items:start;justify-content:space-between;gap:var(--ui-space-4);margin-bottom:var(--ui-space-4)}.revenue-panel h3{margin:6px 0 0;font-size:var(--ui-text-lg)}
.revenue-chart{display:flex;min-height:230px;align-items:end;gap:var(--ui-space-3);overflow-x:auto;padding:var(--ui-space-3) 0}.revenue-month{display:grid;min-width:58px;gap:8px;text-align:center}.revenue-month>span{color:var(--muted);font-size:10px}.revenue-bars{display:flex;height:180px;align-items:end;justify-content:center;gap:5px;border-bottom:1px solid var(--ui-border)}.revenue-bars i{display:block;width:14px;min-height:2px;border-radius:5px 5px 0 0}.revenue-bars .income{background:var(--green)}.revenue-bars .outgo{background:var(--red,#9b5142)}
.revenue-quality{display:grid;gap:var(--ui-space-3);margin:0;padding:0;list-style:none}.revenue-quality li{display:grid;grid-template-columns:34px 1fr;align-items:center;gap:var(--ui-space-3);padding:var(--ui-space-3);border-radius:var(--ui-radius-sm);background:var(--ui-surface-subtle)}.revenue-quality b{display:grid;width:34px;height:34px;place-items:center;border-radius:50%;background:var(--ui-surface);color:var(--ink)}.revenue-quality span{color:var(--muted);font-size:var(--ui-text-sm);line-height:1.35}
.revenue-invoices{display:grid}.revenue-invoices>div:not(.empty-state){display:grid;grid-template-columns:minmax(0,1fr) 120px minmax(120px,auto);align-items:center;gap:var(--ui-space-3);padding:var(--ui-space-3) 0;border-top:1px solid var(--ui-border)}.revenue-invoices small{color:var(--muted)}.revenue-invoices b{text-align:right}.revenue-disclosure{margin:var(--ui-space-3) 0 0;padding:var(--ui-space-3);border-left:3px solid var(--ui-border-strong);background:var(--ui-surface-subtle)}
@media(max-width:1050px){.revenue-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.revenue-grid{grid-template-columns:1fr}}
@media(max-width:620px){.revenue-period{align-items:stretch;flex-direction:column}.revenue-kpis{grid-template-columns:1fr}.revenue-panel{padding:var(--ui-space-4)}.revenue-invoices>div:not(.empty-state){grid-template-columns:1fr auto}.revenue-invoices small{grid-column:1}.revenue-invoices b{grid-column:2;grid-row:1 / 3}}
@media(max-width:900px){.project-dashboard-kpis,.portfolio-finance-grid{grid-template-columns:1fr 1fr}.portfolio-progress{grid-template-columns:1fr;gap:16px}.portfolio-legend{flex-wrap:wrap}}

html, body { min-width: 0; overflow-x: clip; }
body { background: var(--canvas); font-size: var(--ui-text); }
button, input, select, textarea { font: inherit; }
button { touch-action: manipulation; }

/* One icon language: local Lucide-compatible stroke symbols. */
.ui-icon { display: block; width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: var(--ui-icon-stroke); stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.nav-icon { display: grid; width: 22px; height: 22px; place-items: center; }
.nav-icon .ui-icon { width: 17px; height: 17px; }
.app-icon .ui-icon { width: 28px; height: 28px; }
.card-icon .ui-icon,.document-icon .ui-icon { width: 19px; height: 19px; }
.theme-toggle .ui-icon,.header-install-action .ui-icon,.month-trigger .ui-icon,.menu-button .ui-icon,.mobile-close .ui-icon { width: 18px; height: 18px; }

/* Shared interaction states adapted from the Product Studio system. */
:where(a,button,input,select,textarea):focus-visible { outline: 2px solid var(--ui-focus); outline-offset: 2px; box-shadow: 0 0 0 4px var(--ui-focus-halo); }
:where(button,input,select,textarea):disabled { cursor: not-allowed; opacity: .52; }
:where(.nav-item,.app-launcher,.primary-action,.secondary-action,.icon-button,.edit-person,.section-tabs button,.attendance-view-tabs button,.preview-tabs button) { transition: color var(--ui-motion-fast) ease, background-color var(--ui-motion-fast) ease, border-color var(--ui-motion-fast) ease, box-shadow var(--ui-motion-fast) ease, transform var(--ui-motion-fast) ease; }
@media (hover:hover) {
  .nav-item:hover { background: var(--ui-surface-subtle); color: var(--ink); }
  .secondary-action:hover,.icon-button:hover,.edit-person:hover { border-color: var(--ui-border-strong); background: var(--ui-surface-subtle); }
  .app-launcher:not(.upcoming):hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(43,35,29,.085); }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Application shell */
.office-shell { grid-template-columns: var(--ui-sidebar) minmax(0,1fr); }
.sidebar { width: var(--ui-sidebar); padding: 24px 16px 18px; }
.workspace { min-width: 0; grid-column: 2; }
.topbar { height: auto; min-height: var(--ui-topbar); flex-wrap: wrap; padding: var(--ui-space-2) var(--ui-gutter); }
.topbar p { font-size: var(--ui-text-xs); }
.topbar h1 { font-size: var(--ui-text-lg); }
.content { width: min(var(--ui-page-max),100%); padding: 42px var(--ui-gutter) 80px; }
.view { min-width: 0; }
.view > * { max-width: 100%; }

.wordmark { font-size: 13px; }
.nav-item { min-height: 42px; font-size: 12px; }
.nav-label { margin-top: 18px; }
.nav-group { display: grid; gap: 3px; }
.icon-button { width: 38px; height: 38px; border-radius: var(--ui-radius-sm); }
.header-install-action { display: inline-flex; height: 38px; align-items: center; justify-content: center; gap: 8px; padding: 0 13px; border: 1px solid var(--line); border-radius: var(--ui-radius-sm); background: rgba(255,255,255,.72); color: var(--muted); font-size: 10px; font-weight: 680; cursor: pointer; transition: color var(--ui-motion-fast) ease, background-color var(--ui-motion-fast) ease, border-color var(--ui-motion-fast) ease; }
.header-install-action:hover { border-color: var(--ui-border-strong); background: var(--ui-surface-subtle); color: var(--ink); }
.header-install-action[hidden] { display: none; }
.account-profile-trigger { width: 100%; min-width: 0; padding: 5px; border: 0; border-radius: var(--ui-radius-sm); background: transparent; color: inherit; text-align: left; cursor: pointer; }
.account-profile-trigger:hover { background: var(--ui-surface-subtle); }
.profile-chip .avatar { overflow: hidden; }
.profile-chip .avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sidebar-attendance-quick { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; margin: 0 8px 14px; padding: 11px 0 14px; }
.sidebar-attendance-quick[hidden] { display: none; }
.sidebar-attendance-quick>div { display: grid; min-width: 0; gap: 4px; }
.sidebar-attendance-status { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-size: 9px; font-weight: 720; }
.sidebar-attendance-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.sidebar-attendance-quick small { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-attendance-quick button { min-height: 32px; padding: 0 11px; border: 1px solid color-mix(in srgb,var(--green) 22%,var(--ui-border)); border-radius: var(--ui-radius-sm); background: var(--green-soft); color: var(--green); font-size: 9px; font-weight: 760; cursor: pointer; }
.sidebar-attendance-quick button:disabled { border-color: var(--ui-border); background: var(--ui-surface-subtle); color: var(--muted); cursor: default; }

/* Page heading contract */
.welcome-row,
.section-heading { min-height: 132px; align-items: flex-end; padding-bottom: 28px; }
.welcome-row h2,
.section-heading h2 { font-family: var(--sans); font-size: var(--ui-title); font-weight: 450; line-height: 1.04; letter-spacing: -.045em; }
.welcome-row>div>p:last-child,
.section-heading>div>p:last-child { margin-top: 12px; font-size: var(--ui-text-sm); line-height: 1.55; }
.eyebrow { margin-bottom: 12px; font-size: 9px; }

/* Overview is intentionally a minimal app index until Projects is live. */
.app-group + .app-group { margin-top: 54px; padding-top: 34px; border-top: 1px solid var(--ui-border); }
.app-group-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 18px; }
.app-group-heading .eyebrow { margin-bottom: 7px; }
.app-group-heading h2 { margin: 0; font-size: 24px; font-weight: 520; letter-spacing: -.025em; }
.app-group-heading>p { max-width: 320px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; text-align: right; }
.app-launchers.app-index { grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); margin: 0; }
.app-index .app-launcher { min-height: 210px; }
.app-index .projects-app { grid-column: auto; }
.app-index .revenue-app .app-icon,
.app-index .reports-app .app-icon { background: var(--green-soft); color: var(--green); }
.app-index .quotation-app .app-icon,
.app-index .documents-app .app-icon { background: var(--accent-soft); color: var(--accent); }
.app-index .invoice-app .app-icon { background: var(--blue-soft); color: var(--blue); }
.app-index .people-app .app-icon { background: var(--accent-soft); color: var(--accent); }

@media (orientation:landscape) and (min-width:768px) and (max-width:1199px) {
  .view[data-view="overview"] .app-launchers.app-index { grid-template-columns: repeat(auto-fit,minmax(100px,116px)); }
  .view[data-view="overview"] .app-launcher[data-app-entry="solar"]:not([hidden]) { display: flex; }
}

/* Every overview uses the same compact, quiet app-launcher system. */
.view[data-view="overview"] .app-launchers.app-index {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(100px,116px));
  justify-content: start;
  gap: 28px 30px;
}
.view[data-view="overview"] .app-group-heading { margin-bottom: 30px; }
.view[data-view="overview"] .app-index .app-launcher {
  --tile-rgb: 92 200 145;
  --tile-ink: var(--green);
  display: flex;
  min-height: 0;
  align-items: center;
  flex-direction: column;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
}
.view[data-view="overview"] .app-index .app-icon {
  display: grid;
  width: 88px;
  height: 88px;
  margin: 0 0 10px;
  place-items: center;
  border: 1px solid rgb(var(--tile-rgb)/.17);
  border-radius: 22px;
  background: rgb(var(--tile-rgb)/.13);
  color: var(--tile-ink);
  box-shadow: 0 4px 12px rgba(54,49,45,.055);
}
.view[data-view="overview"] .app-index .app-icon::before,
.view[data-view="overview"] .app-index .app-icon::after { display: none; }
.view[data-view="overview"] .app-index .projects-app { --tile-rgb: 239 157 101; --tile-ink: var(--accent); }
.view[data-view="overview"] .app-index .payroll-app { --tile-rgb: 84 161 235; --tile-ink: var(--blue); }
.view[data-view="overview"] .app-index .people-app { --tile-rgb: 244 179 93; --tile-ink: #956044; }
.view[data-view="overview"] .app-index .revenue-app { --tile-rgb: 82 193 139; --tile-ink: var(--green); }
.view[data-view="overview"] .app-index .quotation-app { --tile-rgb: 239 124 98; --tile-ink: var(--accent); }
.view[data-view="overview"] .app-index .invoice-app { --tile-rgb: 86 161 239; --tile-ink: var(--blue); }
.view[data-view="overview"] .app-index .documents-app { --tile-rgb: 76 190 218; --tile-ink: var(--blue); }
.view[data-view="overview"] .app-index .reports-app { --tile-rgb: 73 184 158; --tile-ink: var(--green); }
.view[data-view="overview"] .app-index .app-icon .ui-icon { width: 32px; height: 32px; filter: none; }
.view[data-view="overview"] .app-index .app-launcher strong { font: 700 12px/1.25 var(--sans); letter-spacing: -.01em; }
.view[data-view="overview"] .app-index .app-launcher :where(.app-state,small,em) { display: none; }
.view[data-view="overview"] .app-index .app-launcher.upcoming { opacity: .58; }
.view[data-view="overview"] .app-index .app-launcher.app-reorderable { cursor: grab; touch-action: none; user-select: none; }
.view[data-view="overview"] .app-index .app-launcher.app-reorderable.dragging { cursor: grabbing; opacity: .58; transform: scale(.96); outline: 2px solid rgb(var(--tile-rgb)/.32); outline-offset: 4px; }
.view[data-view="overview"] [data-launcher-group="studio"] .revenue-app { grid-column: 1; }
@media (hover:hover) {
  .view[data-view="overview"] .app-index .app-launcher:not(.upcoming):hover { transform: translateY(-1px); box-shadow: none; }
  .view[data-view="overview"] .app-index .app-launcher:not(.upcoming):hover .app-icon { border-color: rgb(var(--tile-rgb)/.28); background: rgb(var(--tile-rgb)/.17); box-shadow: 0 6px 14px rgba(54,49,45,.07); }
}
html[data-theme="dark"] .view[data-view="overview"] .app-index .app-icon {
  border-color: rgb(var(--tile-rgb)/.18);
  background: rgb(var(--tile-rgb)/.12);
  box-shadow: 0 4px 12px rgba(0,0,0,.16);
}

/* Shared surfaces */
:where(.app-launcher,.overview-strip,.panel,.people-table,.request-card,.settings-card,.settings-panel,.native-form-card,.native-history article,.staff-document-grid article,.attendance-person,.attendance-calendar,.attendance-log-detail,.check-card,.month-card,.office-dialog,.person-photo-editor,.person-access-editor) {
  border-color: var(--ui-border);
  background: var(--ui-surface);
}
:where(.app-launcher,.panel,.people-table,.request-card,.settings-panel,.native-form-card,.native-preview-card,.attendance-person,.attendance-calendar,.attendance-log-detail,.check-card,.month-card) {
  border-radius: var(--ui-radius-lg);
  box-shadow: var(--ui-shadow);
}

/* Buttons and controls */
.primary-action,
.secondary-action { min-height: var(--ui-control); padding-inline: 16px; border-radius: var(--ui-radius-sm); font-size: var(--ui-text); }
:is(.search-field input,.form-grid input,.form-grid select,.compact-grid input,.compact-grid select,.compact-grid textarea,.native-incentive input,.checkout-note input,.checkout-note textarea,.settings-subform input,.smtp-details input,.dialog-select select,.log-controls select,.month-trigger) {
  min-width: 0;
  min-height: var(--ui-control);
  border-color: var(--ui-border-strong);
  border-radius: var(--ui-radius-sm);
  background-color: var(--ui-surface);
  color: var(--ink);
  font-size: var(--ui-text);
}
:is(.compact-grid label,.checkout-note label,.settings-subform>label,.smtp-details label,.form-grid label,.search-field,.log-controls label,.module-toolbar label,.dialog-select) {
  gap: 7px;
  color: var(--muted);
  font-size: var(--ui-text-sm);
  font-weight: 720;
  letter-spacing: .075em;
  text-transform: uppercase;
}

/* One tab pattern everywhere */
.section-tabs,
.attendance-view-tabs,
.preview-tabs { display: inline-flex; width: max-content; gap: 4px; padding: 4px; border: 1px solid var(--ui-border); border-radius: 10px; background: var(--ui-surface-subtle); }
.section-tabs button,
.attendance-view-tabs button,
.preview-tabs button { min-height: var(--ui-control-compact,34px); padding: 0 14px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: var(--ui-text-sm); font-weight: 600; white-space: nowrap; }
@media(max-width:600px){
  .native-incentive{grid-template-columns:minmax(0,1fr) minmax(0,1fr) var(--ui-control-compact,34px);gap:var(--ui-space-2);padding-block:var(--ui-space-3);border-bottom:1px solid var(--line)}
  .native-incentive .incentive-code{grid-column:1;grid-row:1}
  .native-incentive .incentive-amount{grid-column:2;grid-row:1}
  .native-incentive .incentive-description{grid-column:1/-1;grid-row:2}
  .native-incentive button{grid-column:3;grid-row:1;min-height:var(--ui-control)}
}
.section-tabs button.active,
.attendance-view-tabs button.active,
.preview-tabs button.active { background: var(--ui-surface); color: var(--ink); box-shadow: 0 1px 5px rgba(0,0,0,.08); }

/* Standard page widths and toolbars */
.attendance-controls-row,
.attendance-split { width: min(100%,var(--ui-content-max)); }
.attendance-controls-row { min-height: 48px; align-items: flex-end; gap: var(--ui-space-4); margin: 20px auto 14px; }
.module-toolbar { min-width: 0; }
.month-picker { min-width: 200px; }
.directory-tools { margin: 24px 0 14px; }

/* Master/detail contract */
.attendance-split { grid-template-columns: minmax(360px, .9fr) minmax(520px, 1.1fr); gap: var(--ui-space-5); align-items: stretch; }
.attendance-calendar-host { height: clamp(440px, 37vw, 500px); }
.attendance-detail-pane { min-width: 0; }
.attendance-people-pane .attendance-summary-grid { gap: 10px; }
.attendance-people-pane .attendance-person { min-width: 0; padding: 18px 20px; }
.attendance-people-pane .attendance-person>div b { font-size: 12px; }
.attendance-people-pane .attendance-person>div small { font-size: 9px; }
.attendance-people-pane .attendance-person dt { font-size: 19px; }
.attendance-people-pane .attendance-person dd { font-size: 7px; }
.calendar-head { min-height: 78px; padding: 18px 22px; }
.calendar-head b { font-family: var(--sans); font-size: 20px; font-weight: 450; }
.calendar-head-with-legend { flex-shrink: 0; gap: var(--ui-space-4); }
.calendar-head-with-legend>span { flex: 0 0 auto; }
.calendar-legend { display: flex; max-width: 72%; flex-wrap: wrap; justify-content: flex-end; gap: 7px 12px; }
.calendar-legend>span { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 7.5px; font-weight: 750; white-space: nowrap; }
.calendar-legend i { display: block; width: 10px; height: 10px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(55,48,42,.06); }
.calendar-legend .legend-present i { background: var(--cal-present-bg); }
.calendar-legend .legend-paid_leave i { background: var(--cal-paid-bg); }
.calendar-legend .legend-unpaid_leave i { background: var(--cal-unpaid-bg); }
.calendar-legend .legend-half_day i { background: var(--cal-half-bg); }
.calendar-legend .legend-holiday i { background: var(--cal-holiday-bg); }
.calendar-legend .legend-upcoming i { background: var(--cal-unmarked-bg); }
.calendar-grid>button { background: var(--cal-unmarked-bg); color: var(--cal-unmarked-ink); }
.calendar-grid .present { background: var(--cal-present-bg); color: var(--cal-present-ink); }
.calendar-grid .paid_leave { background: var(--cal-paid-bg); color: var(--cal-paid-ink); }
.calendar-grid .unpaid_leave { background: var(--cal-unpaid-bg); color: var(--cal-unpaid-ink); }
.calendar-grid .half_day { background: var(--cal-half-bg); color: var(--cal-half-ink); }
.calendar-grid .holiday { background: var(--cal-holiday-bg); color: var(--cal-holiday-ink); }
.calendar-grid .upcoming { background: var(--cal-unmarked-bg); color: var(--cal-unmarked-ink); }
.status-options button.present,.day-detail .day-status.present { border-color: var(--cal-present-border); background: var(--cal-present-bg); color: var(--cal-present-ink); }
.status-options button.paid_leave,.day-detail .day-status.paid_leave { border-color: var(--cal-paid-border); background: var(--cal-paid-bg); color: var(--cal-paid-ink); }
.status-options button.unpaid_leave,.day-detail .day-status.unpaid_leave { border-color: var(--cal-unpaid-border); background: var(--cal-unpaid-bg); color: var(--cal-unpaid-ink); }
.status-options button.half_day,.day-detail .day-status.half_day { border-color: var(--cal-half-border); background: var(--cal-half-bg); color: var(--cal-half-ink); }
.status-options button.holiday,.day-detail .day-status.holiday { border-color: var(--cal-holiday-border); background: var(--cal-holiday-bg); color: var(--cal-holiday-ink); }
.day-detail .day-status.upcoming { border-color: var(--cal-unmarked-border); background: var(--cal-unmarked-bg); color: var(--cal-unmarked-ink); }
.day-detail .day-status b { color: inherit; }
.status-options button { font-weight: 720; transition: box-shadow .15s ease, transform .15s ease; }
.status-options button:hover { transform: translateY(-1px); }
.status-options button.is-current { box-shadow: 0 0 0 2px var(--ui-surface),0 0 0 4px currentColor; font-weight: 820; }

/* Directory contract */
.people-row { min-width: 0; padding: 16px 18px; }
.people-primary,
.people-cell { min-width: 0; }
.people-primary b { font-size: 12px; }
.people-primary small,
.people-cell small { font-size: 9px; }
.edit-person { min-height: 34px; padding: 0 10px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius-sm); background: transparent; }

/* Forms and settings */
.compact-grid { gap: 14px; }
.settings-panel { padding: 22px; }
.settings-panel-head h3 { font-family: var(--sans); font-size: 18px; font-weight: 500; }
.settings-panel-head p { font-size: 10px; }
.studio-profile-layout { gap: var(--ui-space-4); }
.settings-panel.compact.studio-calendar-connection { display: block; min-height: 0; }
.studio-calendar-connection .settings-panel-head { display: grid; grid-template-columns: 44px minmax(0,1fr); align-items: start; gap: 14px; }
.studio-calendar-connection .card-icon { width: 44px; height: 44px; }
.studio-calendar-connection .settings-panel-head>div { min-width: 0; }
.studio-calendar-connection .settings-panel-head h3 { margin-top: 0; line-height: 1.2; }
.studio-calendar-connection .settings-panel-head p { overflow-wrap: anywhere; font-size: 10px; line-height: 1.65; }
.studio-calendar-connection .settings-panel-head>.record-badge { grid-column: 2; justify-self: start; margin: 2px 0 0; }
.studio-calendar-actions { display: grid; gap: 14px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--ui-border); }
.studio-calendar-actions .secondary-action { width: max-content; max-width: 100%; }
.studio-calendar-actions small { max-width: 52ch; color: var(--muted); font-size: 9px; line-height: 1.65; }

/* Central app permissions */
.app-access-list { display: grid; gap: 14px; margin-top: 24px; container-type: inline-size; }
.app-order-panel { display: grid; grid-template-columns: minmax(220px,.7fr) minmax(320px,1.3fr); gap: 26px; margin-top: 24px; padding: 22px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius-lg); background: var(--ui-surface); box-shadow: var(--ui-shadow); }
.app-order-panel h3 { margin: 4px 0 7px; font-size: 1.18rem; }
.app-order-panel p { margin: 0; color: var(--ui-muted); line-height: 1.55; }
.app-order-list { display: grid; gap: 7px; }
.app-order-row { display: grid; grid-template-columns: 24px 34px minmax(0,1fr); align-items: center; gap: 9px; min-height: 48px; padding: 7px 12px 7px 9px; border: 1px solid var(--ui-border); border-radius: 12px; background: var(--ui-soft); cursor: grab; touch-action: none; user-select: none; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease; }
.app-order-row:hover { border-color: var(--ui-accent); }
.app-order-row.dragging { z-index: 3; cursor: grabbing; border-color: var(--ui-accent); background: var(--ui-surface); box-shadow: 0 12px 28px rgba(30,25,20,.18); transform: scale(1.015); }
.app-order-list.is-dragging .app-order-row:not(.dragging) { transition: transform .2s ease; }
.app-order-list.saving { pointer-events: none; opacity: .7; }
.app-order-grip { color: var(--ui-muted); font-size: 1.15rem; line-height: 1; }
.app-order-position { color: var(--ui-muted); font-size: .72rem; letter-spacing: .08em; }
.app-access-card { display: grid; grid-template-columns: minmax(250px,1fr) minmax(210px,280px); align-items: start; gap: 18px 28px; padding: 22px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius-lg); background: var(--ui-surface); box-shadow: var(--ui-shadow); }
.app-access-identity { display: flex; align-items: center; gap: 14px; min-width: 0; }
.app-access-identity>span:last-child { display: grid; min-width: 0; gap: 4px; }
.app-access-identity b { font-size: 14px; }
.app-access-identity small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.app-access-icon { display: grid; width: 44px; height: 44px; flex: 0 0 auto; place-items: center; border-radius: 11px; background: var(--accent-soft); color: var(--accent); }
.app-access-mode { display: grid; gap: 7px; color: var(--muted); font-size: 9px; font-weight: 720; letter-spacing: .075em; text-transform: uppercase; }
.app-access-mode select { width: 100%; min-height: var(--ui-control); border: 1px solid var(--ui-border-strong); border-radius: var(--ui-radius-sm); background: var(--ui-surface); padding: 0 38px 0 12px; color: var(--ink); font-size: 12px; font-weight: 650; text-transform: none; }
.app-access-mode select:disabled { opacity: .72; cursor: not-allowed; }
.app-access-people { display: flex; grid-column: 1 / -1; flex-wrap: wrap; gap: 8px; padding: 16px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius); background: var(--ui-surface-subtle); }
.app-access-people[hidden] { display: none; }
.app-access-people label { display: inline-flex; align-items: center; gap: 7px; padding: 8px 10px; border: 1px solid var(--ui-border); border-radius: 999px; background: var(--ui-surface); color: var(--ink); font-size: 10px; cursor: pointer; }
.app-access-people input { accent-color: var(--accent); }
.app-access-people p { margin: 0; color: var(--muted); font-size: 10px; }
.app-access-footer { display: flex; grid-column: 1 / -1; align-items: center; justify-content: space-between; gap: 18px; padding-top: 16px; border-top: 1px solid var(--ui-border); }
.app-access-footer small { max-width: 62ch; color: var(--muted); font-size: 9px; line-height: 1.55; }
[data-app-entry][hidden] { display: none !important; }
:where([hidden]) { display: none !important; }

/* Staff overview: a stable rail and square calendar, using the shared card system. */
.staff-overview-layout { display: grid; grid-template-columns: minmax(330px,.78fr) minmax(460px,1fr); align-items: start; gap: var(--ui-space-5); margin-bottom: var(--ui-space-6); }
.staff-overview-rail { display: grid; align-content: start; gap: var(--ui-space-4); }
.staff-profile-card { display: grid; grid-template-columns: 76px minmax(0,1fr); align-items: center; gap: var(--ui-space-4); padding: var(--ui-space-5); border: 1px solid var(--ui-border); border-radius: var(--ui-radius-lg); background: var(--ui-surface); box-shadow: var(--ui-shadow); }
.staff-profile-photo,.staff-profile-photo img,.staff-profile-photo .person-initial { width: 76px; height: 76px; }
.staff-profile-photo { display: grid; overflow: hidden; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.staff-profile-photo img { display: block; object-fit: cover; }
.staff-profile-card h2 { margin: 0; font-size: clamp(24px,3vw,38px); font-weight: 500; letter-spacing: -.035em; }
.staff-profile-card small,.staff-profile-card em { display: block; color: var(--muted); font-size: 10px; font-style: normal; }
.staff-profile-card em { margin-top: 8px; }
.staff-overview-rail .check-card { margin: 0; }
.staff-home-calendar { width: min(100%,560px); justify-self: end; }
.staff-home-calendar .attendance-calendar { width: 100%; aspect-ratio: 1; margin: 0; }
.staff-home-calendar .calendar-grid { min-height: 0; aspect-ratio: auto; }
.staff-home-calendar .calendar-grid>button:disabled { cursor: default; opacity: 1; }
.check-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.check-card-heading .eyebrow { margin-bottom: 8px; }
.network-status { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; padding: 6px 9px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 8px; font-weight: 760; }
.network-status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.network-status.away { background: var(--ui-surface-subtle); color: var(--muted); }
.staff-check-card .check-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.attendance-action { display: grid; min-height: 68px; align-content: center; gap: 3px; padding: 10px 14px; border: 1px solid transparent; border-radius: var(--ui-radius); text-align: left; cursor: pointer; }
.attendance-action b { font-size: 12px; }
.attendance-action small { font-size: 8px; font-weight: 620; opacity: .75; }
.attendance-action.checkin { border-color: color-mix(in srgb,var(--green) 18%,transparent); background: var(--green-soft); color: var(--green); }
.attendance-action.checkout { border-color: color-mix(in srgb,#a54e43 18%,transparent); background: color-mix(in srgb,#a54e43 12%,var(--ui-surface)); color: #a54e43; }
.attendance-action:disabled { border-color: var(--ui-border); background: var(--ui-surface-subtle); color: var(--muted); opacity: .62; }
html[data-theme="dark"] .calendar-grid .present { background: var(--cal-present-bg); color: var(--cal-present-ink); }
html[data-theme="dark"] .calendar-grid .paid_leave { background: var(--cal-paid-bg); color: var(--cal-paid-ink); }
html[data-theme="dark"] .calendar-grid .unpaid_leave { background: var(--cal-unpaid-bg); color: var(--cal-unpaid-ink); }
html[data-theme="dark"] .calendar-grid .half_day { background: var(--cal-half-bg); color: var(--cal-half-ink); }
html[data-theme="dark"] .calendar-grid .holiday { background: var(--cal-holiday-bg); color: var(--cal-holiday-ink); }
html[data-theme="dark"] .calendar-grid .upcoming { background: var(--cal-unmarked-bg); color: var(--cal-unmarked-ink); }
.staff-attendance-workspace { display: grid; width: min(100%,var(--ui-content-max)); grid-template-columns: repeat(2,minmax(0,1fr)); align-items: stretch; gap: var(--ui-space-5); margin-inline: auto; }
.admin-hidden .attendance-controls-row { width: min(100%,var(--ui-content-max)); }
.staff-attendance-rail { display: grid; height: 100%; grid-template-rows: minmax(0,1.06fr) minmax(0,.94fr); gap: var(--ui-space-4); }
.staff-attendance-rail :where(.check-card,.month-card) { height: 100%; margin-top: 0; }
.staff-attendance-rail .check-card { display: flex; flex-direction: column; }
.staff-attendance-rail .check-actions { margin-top: auto; padding-top: var(--ui-space-4); }
.staff-attendance-rail .month-card { display: flex; flex-direction: column; }
.staff-attendance-rail .month-tallies { flex: 1; grid-auto-rows: minmax(0,1fr); }
.staff-attendance-main { width: 100%; min-width: 0; justify-self: stretch; }
.staff-attendance-tabs { width: 100%; margin: 0 0 var(--ui-space-3); }
.staff-attendance-detail { width: 100%; min-height: 0; aspect-ratio: 1; }
.staff-attendance-detail :where(.attendance-calendar,.attendance-log-detail) { height: 100%; min-height: 0; margin-top: 0; }
.staff-attendance-detail .monthly-log-list { overflow: auto; }
@media (min-width: 1200px) {
  .admin-hidden .staff-attendance-workspace { --staff-attendance-height: clamp(360px,calc(100dvh - 406px),580px); }
  .admin-hidden .staff-attendance-detail { height: var(--staff-attendance-height); aspect-ratio: auto; }
}
.month-tallies span:nth-child(1) { background: var(--cal-present-bg); color: var(--cal-present-ink); }
.month-tallies span:nth-child(2) { background: var(--cal-paid-bg); color: var(--cal-paid-ink); }
.month-tallies span:nth-child(3) { background: var(--cal-unpaid-bg); color: var(--cal-unpaid-ink); }
.month-tallies span:nth-child(4) { background: var(--cal-half-bg); color: var(--cal-half-ink); }
.month-tallies small { color: currentColor; opacity: .76; }
html[data-theme="dark"] .month-tallies span:nth-child(1) { background: var(--cal-present-bg); color: var(--cal-present-ink); }
html[data-theme="dark"] .month-tallies span:nth-child(2) { background: var(--cal-paid-bg); color: var(--cal-paid-ink); }
html[data-theme="dark"] .month-tallies span:nth-child(3) { background: var(--cal-unpaid-bg); color: var(--cal-unpaid-ink); }
html[data-theme="dark"] .month-tallies span:nth-child(4) { background: var(--cal-half-bg); color: var(--cal-half-ink); }
.checkout-note select { width: 100%; min-height: var(--ui-control); border: 1px solid var(--ui-border-strong); border-radius: var(--ui-radius-sm); background: var(--ui-surface); padding: 0 38px 0 12px; color: var(--ink); font-size: 11px; }
.staff-work-entries { display: grid; gap: var(--ui-space-4); min-width: 0; }
.staff-work-entries .staff-work-entry { margin: 0; padding-top: var(--ui-space-4); gap: var(--ui-space-3); min-width: 0; }
.staff-work-entry :is(select,textarea) { min-width: 0; width: 100%; background: var(--ui-surface); color: var(--ink); border-color: var(--ui-border-strong); }
.staff-work-entry .secondary-action { justify-self: start; }

/* Account profile and security */
.account-dialog { width: min(620px,calc(100% - 28px)); max-height: min(850px,calc(100dvh - 28px)); overflow: auto; }
.account-dialog>form:first-child { padding-bottom: 20px; }
.account-dialog header p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 10px; }
.account-identity-card { display: grid; grid-template-columns: 76px minmax(0,1fr); align-items: center; gap: 16px; padding: 16px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius); background: var(--ui-surface-subtle); }
.account-photo-button { position: relative; width: 76px; height: 76px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.account-photo { display: grid; width: 76px; height: 76px; overflow: hidden; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 20px; }
.account-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.account-photo-edit { position: absolute; right: -2px; bottom: -2px; display: grid; width: 26px; height: 26px; place-items: center; border: 2px solid var(--ui-surface); border-radius: 50%; background: var(--ink); color: var(--ui-surface); }
.account-photo-edit .ui-icon { width: 13px; height: 13px; }
.account-identity-card>div { min-width: 0; }
.account-identity-card b,.account-identity-card p { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-identity-card b { font-size: 14px; }
.account-identity-card p { margin: 4px 0 9px; color: var(--muted); font-size: 10px; }
.text-action { padding: 0; border: 0; background: transparent; color: var(--accent); font-size: 9px; font-weight: 720; cursor: pointer; }
.account-fields { margin-top: 16px; }
.account-fields [hidden] { display: none !important; }
.account-fields label>span small { margin-left: 5px; color: var(--faint); font-size: 8px; font-weight: 520; letter-spacing: 0; text-transform: none; }
.account-save-profile { margin-top: 14px; }
.account-personal-section { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--ui-border); }
.account-section-heading { margin-bottom: 14px; }
.account-section-heading h3 { margin: 0 0 5px; font-size: 14px; }
.account-section-heading p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.account-dialog .account-security-section { margin: 0 27px; padding: 20px 0 27px; border-top: 1px solid var(--ui-border); }
.account-security-heading { display: grid; grid-template-columns: 38px minmax(0,1fr); align-items: start; gap: 12px; margin-bottom: 14px; }
.account-security-heading h3 { margin: 2px 0 5px; font-size: 14px; }
.account-security-heading p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.account-password-submit { margin-top: 14px; }
.account-security-status { min-height: 15px; margin: 12px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.account-recovery-link { display: inline-block; margin-top: 7px; color: var(--muted); font-size: 9px; text-underline-offset: 3px; }

/* Payroll uses the same split contract; issued artefacts stay isolated below. */
.native-payroll-layout { grid-template-columns: minmax(390px,.82fr) minmax(460px,1.18fr); gap: var(--ui-space-4); align-items: stretch; }
.native-form-card { padding: 22px; }
.native-preview-card { padding: 18px; }
.native-slip,
.native-email-preview .email-card { color-scheme: light; }

/* Desktop / wide */
@media (min-width: 1200px) {
  .attendance-detail-pane,
  .native-preview-card { position: sticky; top: calc(var(--ui-topbar) + 18px); }
}

/* Quotations use the shared form/preview split and protected print-white pages. */
.quotation-layout { display: grid; grid-template-columns: minmax(390px,.82fr) minmax(470px,1.18fr); gap: var(--ui-space-4); align-items: stretch; }
.quotation-form-card,.quotation-preview-card,.quotation-storage-card { border: 1px solid var(--ui-border); border-radius: var(--ui-radius-lg); background: var(--ui-surface); box-shadow: var(--ui-shadow); }
.quotation-form-card { display: grid; align-content: start; gap: var(--ui-space-4); padding: var(--ui-space-5); }
.quotation-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--ui-space-3); }
.quotation-form-grid label,.quotation-storage-card label { display: grid; gap: 7px; color: var(--muted); font-size: 9px; font-weight: 720; letter-spacing: .07em; text-transform: uppercase; }
.quotation-form-grid .span-2 { grid-column: span 2; }
.quotation-form-grid input,.quotation-form-grid textarea,.quotation-storage-card input { width: 100%; min-height: var(--ui-control); border: 1px solid var(--ui-border-strong); border-radius: var(--ui-radius-sm); outline: 0; background: var(--ui-surface); padding: 10px 12px; color: var(--ink); font: 600 11px/1.45 var(--sans); letter-spacing: 0; text-transform: none; }
.quotation-form-grid textarea { resize: vertical; }
.quotation-form-grid input:focus,.quotation-form-grid textarea:focus,.quotation-form-grid select:focus,.quotation-storage-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ui-focus-halo); }
.quotation-items { display: grid; gap: 9px; padding-top: var(--ui-space-3); border-top: 1px solid var(--ui-border); }
.quotation-items-head { display: flex; align-items: center; justify-content: space-between; gap: var(--ui-space-3); }
.quotation-items-head b { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.quotation-item { display: grid; grid-template-columns: minmax(0,1fr) 64px 94px 32px; gap: 8px; align-items: center; }
.quotation-item input { min-width: 0; min-height: var(--ui-control); border: 1px solid var(--ui-border-strong); border-radius: var(--ui-radius-sm); background: var(--ui-surface); padding: 0 11px; color: var(--ink); font-size: 11px; }
.quotation-item button { display: grid; width: 32px; height: 32px; place-items: center; border: 0; border-radius: var(--ui-radius-sm); background: transparent; color: var(--muted); cursor: pointer; }
.quotation-item button:hover { background: var(--ui-surface-subtle); color: var(--ink); }
.quotation-form-footer { display: flex; align-items: end; justify-content: space-between; gap: var(--ui-space-3); padding-top: var(--ui-space-4); border-top: 1px solid var(--ui-border); }
.quotation-total { display: grid; gap: 4px; }
.quotation-total small { color: var(--muted); font-size: 9px; }
.quotation-total strong { font: 400 25px/1 var(--serif); }
.quotation-actions { display: flex; gap: 8px; }
.quotation-preview-card { position: relative; display: grid; grid-template-rows: auto 1fr; min-height: 820px; padding: var(--ui-space-4); background: var(--surface-soft); }
.quotation-preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: var(--ui-space-3); }
.quotation-preview-bar>span { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 9px; }
.quotation-preview-bar button { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid var(--ui-border-strong); border-radius: var(--ui-radius-sm); background: var(--ui-surface); color: var(--ink); cursor: pointer; }
.quotation-preview-bar button:disabled { opacity: .35; cursor: default; }
.quotation-preview-bar #quotation-prev,
.quotation-preview-bar #quotation-next { position: absolute; z-index: 3; top: 50%; width: 38px; height: 38px; transform: translateY(-50%); border-radius: 50%; box-shadow: 0 8px 22px rgba(35,30,25,.12); }
.quotation-preview-bar #quotation-prev { left: 14px; }
.quotation-preview-bar #quotation-next { right: 14px; }
.quotation-page-stage { display: grid; min-height: 0; place-items: center; overflow: hidden; }
.quotation-page { position: relative; width: min(100%,610px); aspect-ratio: 210/297; overflow: hidden; padding: 8.5% 8.5% 7%; background: #fff; color: #1c1b19; box-shadow: 0 15px 36px rgba(35,30,25,.12); font-family: Inter,"Avenir Next",Arial,sans-serif; }
.quotation-page-no { position: absolute; top: 5.5%; right: 8.5%; color: #999; font-size: 7px; }
.quotation-doc-brand { font-size: 8px; font-weight: 750; letter-spacing: .1em; }
.quotation-doc-title { margin: 13% 0 7%; color: #bd4c2f; font: 400 clamp(26px,3.1vw,42px)/1 Georgia,serif; letter-spacing: -.04em; }
.quotation-doc-title small { color: #777; font: 8px var(--sans); }
.quotation-doc-meta { display: grid; grid-template-columns: 1.4fr 1fr; gap: 9%; padding-bottom: 3.5%; border-bottom: 1px solid #bbb; }
.quotation-doc-meta>div:last-child { text-align: right; }
.quotation-doc-meta small,.quotation-doc-project small { display: block; color: #777; font-size: 7px; line-height: 1.45; }
.quotation-doc-meta b { display: block; font-size: 10px; }
.quotation-doc-project { margin: 6% 0 3.5%; }
.quotation-doc-project h3 { margin: 1% 0 0; font: 400 17px Georgia,serif; }
.quotation-doc-row { display: grid; grid-template-columns: 24px minmax(0,1fr) 42px 68px 74px; gap: 7px; padding: 1.8% 0; border-bottom: 1px solid #ebe8e4; font-size: 8px; line-height: 1.35; }
.quotation-doc-row.head { color: #777; font-size: 6.5px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.quotation-doc-row span:nth-last-child(-n+3) { text-align: right; }
.quotation-doc-summary { width: 48%; margin: 5.5% 0 0 auto; }
.quotation-doc-summary div { display: flex; justify-content: space-between; padding: 2.3% 0; font-size: 8px; }
.quotation-doc-summary .total { margin-top: 2%; padding: 7%; background: #eeeae3; font-size: 11px; }
.quotation-doc-terms { margin-top: 5%; padding-top: 3%; border-top: 1px solid #ddd; }
.quotation-doc-terms h4 { margin: 0 0 1.5%; font-size: 7px; letter-spacing: .08em; text-transform: uppercase; }
.quotation-doc-terms p { margin: 0; color: #555; font-size: 7px; line-height: 1.45; white-space: pre-line; }
.quotation-doc-footer { position: absolute; right: 8.5%; bottom: 5%; left: 8.5%; display: flex; justify-content: space-between; padding-top: 2%; border-top: 1px solid #ddd; color: #777; font-size: 5.5px; line-height: 1.4; }
.quotation-doc-footer span:last-child { text-align: right; }
.quotation-history { display: grid; gap: 10px; margin-top: var(--ui-space-4); }
.quotation-history article { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(140px,.7fr) auto auto; align-items: center; gap: var(--ui-space-3); padding: 16px 18px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius); background: var(--ui-surface); }
.quotation-history b,.quotation-history small { display: block; }
.quotation-history b { font-size: 11px; }.quotation-history small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.quotation-history a,.quotation-history button { color: var(--accent); font-size: 9px; font-weight: 700; text-decoration: none; }
.quotation-storage-card { display: grid; max-width: 760px; gap: var(--ui-space-4); margin-top: var(--ui-space-4); padding: var(--ui-space-5); }
.quotation-storage-head { display: grid; grid-template-columns: 44px minmax(0,1fr); gap: 14px; }
.quotation-storage-head h3 { margin: 0 0 6px; font: 400 21px var(--serif); }.quotation-storage-head p,.quotation-storage-note { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }

.project-register { margin-top: var(--ui-space-4); }
.project-dashboard { display:grid; gap:12px; margin:0 0 28px; }
.archived-project-note { margin:-14px 0 22px; color:var(--muted); font-size:9px; }
.portfolio-overview { display:grid; gap:20px; padding:22px 24px; border:1px solid var(--ui-border); border-radius:14px; background:var(--ui-surface); box-shadow:0 8px 28px rgba(40,33,28,.035); }
.portfolio-heading { display:flex; align-items:center; justify-content:space-between; gap:20px; }.portfolio-heading>span { display:grid; grid-template-columns:auto auto; align-items:end; column-gap:10px; }.portfolio-heading small { grid-column:1/-1; color:var(--muted); font-size:8px; font-weight:750; letter-spacing:.1em; }.portfolio-heading strong { margin-top:7px; font-size:32px; line-height:1; }.portfolio-heading p { margin:0 0 2px; color:var(--muted); font-size:10px; }
.portfolio-finance-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr)); gap:10px; padding-top:18px; border-top:1px solid var(--ui-border); }
.portfolio-finance-card { display:grid; grid-template-columns:62px minmax(0,1fr); align-items:center; gap:13px; min-height:98px; padding:14px; border:1px solid var(--ui-border); border-radius:12px; background:var(--ui-surface-subtle); }
.portfolio-finance-card>div { min-width:0; }.portfolio-finance-card small { display:block; color:var(--muted); font-size:8px; font-weight:720; letter-spacing:.04em; text-transform:uppercase; }.portfolio-finance-card strong { display:block; margin:6px 0 4px; overflow:hidden; font-size:18px; line-height:1.1; text-overflow:ellipsis; white-space:nowrap; }.portfolio-finance-card p { margin:0; color:var(--muted); font-size:8px; line-height:1.4; }
.portfolio-ring { --ring:0%; display:grid; width:58px; height:58px; place-items:center; border-radius:50%; background:conic-gradient(var(--ring-color,#759486) var(--ring),#e8e5e0 0); }.portfolio-ring::before { content:""; grid-area:1/1; width:44px; height:44px; border-radius:50%; background:var(--ui-surface); }.portfolio-ring i { position:relative; grid-area:1/1; color:var(--ink); font-size:9px; font-style:normal; font-weight:750; }.portfolio-finance-card.invoiced { --ring-color:#8b8077; }.portfolio-finance-card.received { --ring-color:#5f8d7c; }.portfolio-finance-card.balance { --ring-color:#d59a51; }
.portfolio-finance-card.expenses{--ring-color:#d59a51;background:#fff8ee}.portfolio-finance-card.expenses strong{color:#a96a2d}.portfolio-finance-card.net-revenue{--ring-color:#5f8d7c;background:#f1f7f3;border-color:#c9ddd4}.portfolio-finance-card.net-revenue strong{color:#386b59}
.portfolio-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border-top:1px solid var(--ui-border); }.portfolio-metrics span { display:grid; gap:6px; padding:16px 18px 0 0; }.portfolio-metrics span+span { padding-left:18px; border-left:1px solid var(--ui-border); }.portfolio-metrics small { color:var(--muted); font-size:9px; }.portfolio-metrics b { font-size:18px; font-weight:680; }
.portfolio-progress { display:grid; grid-template-columns:220px 1fr; align-items:center; gap:30px; padding:22px 24px; border:1px solid var(--ui-border); border-radius:14px; background:var(--ui-surface); box-shadow:0 8px 28px rgba(40,33,28,.035); }
.portfolio-progress small { color:var(--muted); font-size:8px; font-weight:750; letter-spacing:.09em; }.portfolio-progress strong { display:block; margin:6px 0; font-size:30px; }.portfolio-progress p { margin:0; color:var(--muted); font-size:9px; line-height:1.5; }
.portfolio-chart { display:grid; gap:12px; }.portfolio-track { display:flex; height:13px; overflow:hidden; border-radius:999px; background:#ece9e5; }.portfolio-track i { display:block; height:100%; }.portfolio-track .live,.portfolio-legend i.live { background:#5f8d7c; }.portfolio-track .hold,.portfolio-legend i.hold { background:#d59a51; }.portfolio-track .complete,.portfolio-legend i.complete { background:#9eb5aa; }
.portfolio-legend { display:flex; gap:22px; color:var(--muted); font-size:9px; }.portfolio-legend span { display:flex; align-items:center; gap:6px; }.portfolio-legend i { width:8px; height:8px; border-radius:50%; }.portfolio-legend b { color:var(--ink); }
.project-register-grid { display: grid; gap: 8px; }
.project-register-grid article { display: grid; grid-template-columns: 76px minmax(220px,1fr) minmax(150px,.45fr) auto; align-items: center; gap: var(--ui-space-3); padding: 15px 17px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius); background: var(--ui-surface); }
.project-register-grid b,.project-register-grid small { display: block; }.project-register-grid b { font-size: 11px; }.project-register-grid small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.project-section { display: grid; gap: 10px; padding-top: var(--ui-space-4); }
.project-status-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:20px 0 4px;padding:5px;border:1px solid var(--ui-border);border-radius:12px;background:var(--ui-surface-subtle)}.project-status-tabs button{display:flex;align-items:center;justify-content:space-between;min-height:42px;padding:0 13px;border:0;border-radius:8px;background:transparent;color:var(--muted);font:650 10px var(--sans);cursor:pointer}.project-status-tabs button.active{background:var(--ui-surface);color:var(--ink);box-shadow:0 3px 12px rgba(40,33,28,.07)}.project-status-tabs b{display:grid;min-width:23px;height:23px;place-items:center;border-radius:99px;background:var(--ui-surface);font-size:8px}.project-status-tabs button.active b{background:var(--success-soft);color:var(--success)}
.project-section + .project-section { margin-top: var(--ui-space-5); padding-top: var(--ui-space-5); border-top: 1px solid var(--ui-border); }
.archived-projects-drawer { margin-top:var(--ui-space-5); padding-top:var(--ui-space-4); border-top:1px solid var(--ui-border); }.archived-projects-drawer>summary { display:flex; align-items:center; justify-content:space-between; padding:14px 16px; border:1px solid var(--ui-border); border-radius:var(--ui-radius); background:var(--ui-surface); cursor:pointer; list-style:none; }.archived-projects-drawer>summary span { font-size:12px; font-weight:700; }.archived-projects-drawer>summary small { color:var(--muted); font-size:9px; }.archived-projects-drawer[open]>summary { border-color:var(--ui-border-strong); }.archived-projects-drawer>.project-section { padding-inline:4px; }
.project-section>header { display: flex; align-items: end; justify-content: space-between; gap: var(--ui-space-4); }
.project-section>header h3 { margin: 0; font-size: 15px; font-weight: 650; }.project-section>header p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.project-section .project-register-grid article { grid-template-columns:22px 76px minmax(190px,1fr) minmax(100px,.42fr) 120px 104px minmax(140px,.5fr) 156px; gap:12px; }
.project-section .project-register-grid .staff-project-row { grid-template-columns: 76px minmax(220px,1fr) minmax(118px,.3fr) auto; }
.project-state-stack { display: grid; justify-items: start; gap: 4px; }
.project-stage { display: inline-flex; align-items: center; min-height: 24px; padding: 4px 8px; border-radius: 999px; background: var(--ui-surface-subtle); color: var(--accent); font-size: 8px; font-weight: 760; text-transform: capitalize; }
.project-stage.complete { background: var(--success-soft); color: var(--success); }
.project-state-stack { display:grid; width:100%; min-width:0; grid-template-columns:minmax(72px,1fr) auto; align-items:center; gap:9px; justify-items:stretch; }.project-row-progress { display:block; width:100%; min-width:72px; height:7px; overflow:hidden; border-radius:999px; background:#ebe8e3; }.project-row-progress i { display:block; min-width:0; height:100%; border-radius:inherit; background:#668f80; transition:width .2s ease; }.project-state-stack>small { margin:0; white-space:nowrap; font-weight:700; }
.project-value-cell,.project-assignee-cell{display:grid;min-width:0;gap:5px}.project-value-cell>small,.project-assignee-cell>small{margin:0;font-size:7px;font-weight:700;letter-spacing:.07em;text-transform:uppercase}.project-value-cell>b{font-size:12px;white-space:nowrap}.project-value-cell.project-value-configured>b{color:var(--green)}.project-value-cell.project-value-unset>b{color:var(--red,#9b5142)}.project-assignee-cell select{width:100%;min-height:34px;padding:0 28px 0 10px;border:1px solid var(--ui-border);border-radius:8px;background:var(--ui-surface);color:var(--ink);font-size:9px}
.project-status-select{min-height:30px;padding:0 28px 0 9px;border:1px solid var(--ui-border);border-radius:8px;background:var(--ui-surface);color:var(--ink);font:650 9px var(--sans)}
.project-status-select.status-active{border-color:#bdd8ca;background:#edf6f1;color:#356b55}.project-status-select.status-on_hold{border-color:#ead1a9;background:#fff6e8;color:#966127}.project-status-select.status-completed{border-color:#c7d9d0;background:#edf4f0;color:#567366}.project-status-select.status-archived{border-color:var(--ui-border-strong);background:var(--ui-surface-subtle);color:var(--muted)}.project-select{display:grid;place-items:center}.project-select input,.project-bulk-actions input{width:15px;height:15px;accent-color:var(--accent)}.project-bulk-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;margin:10px 2px;overflow-x:auto;padding:2px 0}.project-bulk-actions label{display:flex;align-items:center;gap:7px;color:var(--muted);font-size:9px;white-space:nowrap}.project-bulk-actions>span{margin-right:auto;color:var(--muted);font-size:10px;white-space:nowrap}.project-bulk-actions button{min-height:34px;padding:0 12px;border:1px solid var(--ui-border-strong);border-radius:8px;background:var(--ui-surface);color:var(--accent);font:700 9px var(--sans);cursor:pointer;white-space:nowrap}.project-bulk-actions #delete-selected-projects{border-color:#d9b8ae;color:#9b5142}.project-bulk-actions button:disabled{opacity:.4;cursor:not-allowed}.archived-project-row{border-color:var(--ui-border)!important;background:var(--ui-surface-subtle)!important}.archived-project-row .project-number,.archived-project-row .project-name-link,.archived-project-row .project-identity-cell small,.archived-project-row .project-value-cell{color:var(--muted)}.archived-project-row .project-name-link{text-decoration-color:var(--ui-border-strong)}
.project-status-select.status-non_profit{border-color:color-mix(in srgb,var(--accent) 32%,var(--ui-border));background:color-mix(in srgb,var(--accent) 10%,var(--ui-surface));color:var(--accent)}

.financial-visibility-toggle svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.top-actions .financial-visibility-toggle{display:grid!important;flex:0 0 auto}.financial-values-hidden .financial-display-value{user-select:none}.financial-values-hidden .project-value-cell>.financial-display-value{color:var(--ink)}.financial-values-hidden .financial-input-value{color:transparent!important;caret-color:transparent!important;text-shadow:none!important}.financial-mask-host{position:relative!important}.financial-input-mask{position:absolute;z-index:2;display:flex;align-items:center;padding:0 12px;border-radius:8px;background:var(--ui-surface);color:var(--ink);font:750 13px/1 var(--sans);letter-spacing:.12em;pointer-events:none}.financial-values-hidden .financial-eye-slash{display:block}.financial-eye-slash{display:none}
.project-service-tabs{display:flex;align-items:center;gap:8px;margin-top:18px;overflow-x:auto;padding:2px 0}.project-service-tabs>span{margin-right:4px;color:var(--muted);font-size:10px;font-weight:700;white-space:nowrap}.project-service-tabs button{display:inline-flex;min-height:36px;align-items:center;gap:8px;padding:0 12px;border:1px solid var(--ui-border);border-radius:999px;background:var(--ui-surface);color:var(--muted);font:700 10px var(--sans);white-space:nowrap;cursor:pointer}.project-service-tabs button b{display:grid;min-width:20px;height:20px;place-items:center;border-radius:999px;background:var(--ui-surface-subtle);font-size:9px}.project-service-tabs button.active{border-color:var(--accent);background:var(--accent);color:#fff}.project-service-tabs button.active b{background:rgba(255,255,255,.18);color:#fff}@media(max-width:520px){.project-service-tabs{margin-inline:-2px}.project-service-tabs>span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}}
.project-row-actions { display: flex; min-width:0; align-items: center; justify-content: flex-end; gap: 6px; }
.project-row-actions button{flex:0 0 auto;white-space:nowrap}
html[data-theme="dark"] .archived-project-row :is(.project-number,.project-name-link,.project-identity-cell small,.project-value-cell){color:color-mix(in srgb,var(--ink) 72%,var(--ui-surface-subtle))}
@media (min-width:768px) and (max-width:1366px){
  .project-section .project-register-grid article{grid-template-columns:22px 76px minmax(0,1fr) 128px;gap:10px 12px}
  .project-section .project-select{grid-column:1;grid-row:1 / 4}
  .project-section .project-number{grid-column:2;grid-row:1}
  .project-section .project-identity-cell{grid-column:3;grid-row:1}
  .project-section .project-value-cell{grid-column:2;grid-row:2}
  .project-section .project-assignee-cell{grid-column:3;grid-row:2}
  .project-section .project-status-select{grid-column:2;grid-row:3;width:100%}
  .project-section .project-state-stack{grid-column:3;grid-row:3}
  .project-section .project-row-actions{grid-column:4;grid-row:1 / 4;align-self:center;flex-direction:column}
}
.project-entry-link,.project-name-link { display:inline-flex; width:max-content; max-width:100%; align-items:center; min-height:28px; margin:-5px -8px; padding:5px 8px; border-radius:7px; color:inherit; text-decoration:none; transition:background-color .16s ease,color .16s ease,transform .16s ease; }.project-name-link { font-size:11px; font-weight:700; }.project-entry-link:hover,.project-name-link:hover { background:var(--ui-surface-subtle); color:var(--ink); text-decoration:none; transform:translateX(2px); }.project-entry-link:focus-visible,.project-name-link:focus-visible{outline:2px solid color-mix(in srgb,var(--accent) 45%,transparent);outline-offset:2px}
.open-staff-project { white-space: nowrap; }
.staff-project-dialog>section { padding: 26px; }
.staff-project-dialog header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--ui-space-4); }
.staff-project-dialog header h2 { margin: 5px 0; font-size: 26px; font-weight: 500; letter-spacing: -.035em; }
.staff-project-dialog header p:last-child { margin: 0; color: var(--muted); font-size: 10px; }
.staff-project-tasks { display: grid; gap: 9px; margin-top: var(--ui-space-5); padding-top: var(--ui-space-5); border-top: 1px solid var(--ui-border); }
.staff-project-tasks h3 { margin: 4px 0 3px; font-size: 16px; }
.staff-project-tasks article { display: grid; grid-template-columns: minmax(0,1fr) 150px; align-items: center; gap: var(--ui-space-3); padding: 13px 14px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius-sm); }
.staff-project-tasks article b,.staff-project-tasks article small { display: block; }.staff-project-tasks article b { font-size: 11px; }.staff-project-tasks article small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.staff-project-tasks label span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.staff-project-tasks select { width: 100%; min-height: 42px; padding: 0 34px 0 11px; border: 1px solid var(--ui-border-strong); border-radius: var(--ui-radius-sm); background: var(--ui-surface); color: var(--text); font: inherit; }
.edit-project,.archive-project,.restore-project,.delete-project,.open-staff-project { min-height: 34px; padding: 0 12px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius-sm); background: var(--ui-surface); color: var(--muted); font: 700 9px var(--sans); cursor: pointer; }
.archive-project { color: var(--accent); }
.restore-project { color:var(--success); border-color:color-mix(in srgb,var(--success) 32%,var(--ui-border)); }
.delete-project { color: #a44335; border-color: color-mix(in srgb,#a44335 32%,var(--ui-border)); }
.project-number,.invoice-sequence { color: var(--accent); font-size: 11px; font-weight: 780; letter-spacing: .04em; }
#client-table { container-type: inline-size; }
.client-row { grid-template-columns: minmax(220px,1fr) minmax(150px,.55fr) minmax(190px,.75fr) auto; }
.client-group { display: grid; gap: 8px; margin-bottom: var(--ui-space-4); }.client-group-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }.client-group-head h3 { margin: 0; font: 400 18px var(--serif); }.client-group-head span { color: var(--muted); font-size: 9px; }
.client-group .client-row { grid-template-columns: minmax(210px,1fr) minmax(130px,.45fr) minmax(180px,.7fr) auto auto; }
.client-quoted { color: #9a6719; background: #fbf0d8; }.client-onboarded { color: #2f7550; background: #e6f2ea; }.client-lead { color: #527096; background: #e9eef6; }
.quotation-guided { display: grid; gap: 7px; padding: 14px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius); background: var(--ui-surface-subtle); }.quotation-guided label { display: grid; gap: 7px; color: var(--muted); font-size: 9px; font-weight: 720; letter-spacing: .07em; text-transform: uppercase; }.quotation-guided select { width: 100%; min-height: var(--ui-control); border: 1px solid var(--ui-border-strong); border-radius: var(--ui-radius-sm); background: var(--ui-surface); padding: 10px 34px 10px 12px; color: var(--ink); font: 600 11px var(--sans); }.quotation-guided p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.scope-presets { display: grid; gap: 12px; padding: 15px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius); background: var(--ui-surface-subtle); }.scope-presets>div:first-child b,.scope-presets>div:first-child small { display: block; }.scope-presets>div:first-child b { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }.scope-presets>div:first-child small { margin-top: 4px; color: var(--muted); font-size: 9px; }.scope-presets>div:last-child { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }.scope-presets label { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 7px 9px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius-sm); background: var(--ui-surface); font-size: 9px; cursor: pointer; }.scope-presets input { accent-color: var(--accent); }

.invoice-create-layout { display: grid; grid-template-columns: minmax(390px,.82fr) minmax(470px,1.18fr); gap: var(--ui-space-4); align-items: stretch; }
.invoice-form-card,.invoice-preview-card,.invoice-archive-list,.invoice-pdf-viewer { border: 1px solid var(--ui-border); border-radius: var(--ui-radius-lg); background: var(--ui-surface); box-shadow: var(--ui-shadow); }
.invoice-form-card { display: grid; align-content: start; gap: var(--ui-space-4); padding: var(--ui-space-5); }
.quotation-form-grid select { width: 100%; min-height: var(--ui-control); border: 1px solid var(--ui-border-strong); border-radius: var(--ui-radius-sm); outline: 0; background: var(--ui-surface); padding: 10px 34px 10px 12px; color: var(--ink); font: 600 11px/1.45 var(--sans); }
.invoice-item { display: grid; grid-template-columns: minmax(0,1fr) 76px 112px 32px; gap: 8px; align-items: center; }
.invoice-item input { min-width: 0; min-height: var(--ui-control); border: 1px solid var(--ui-border-strong); border-radius: var(--ui-radius-sm); background: var(--ui-surface); padding: 0 11px; color: var(--ink); font-size: 11px; }
.invoice-item button { display: grid; width: 32px; height: 32px; place-items: center; border: 0; border-radius: var(--ui-radius-sm); background: transparent; color: var(--muted); cursor: pointer; }
.invoice-preview-card { display: grid; grid-template-rows: auto 1fr; min-height: 820px; padding: var(--ui-space-4); background: var(--surface-soft); }
#invoice-preview { display: grid; place-items: center; min-height: 0; overflow: hidden; }
.invoice-document { position: relative; width: min(100%,610px); aspect-ratio: 210/297; overflow: hidden; padding: 9% 9% 7%; background: #fff; color: #222; box-shadow: 0 15px 36px rgba(35,30,25,.12); font-family: Arial,sans-serif; }
.invoice-document>header { display: flex; align-items: flex-start; justify-content: space-between; }.invoice-document>header h3 { margin: 0; color: #696969; font-size: clamp(24px,3vw,40px); }
.invoice-brand { display: flex; align-items: center; gap: 7px; color: #777; font-size: 8px; }.invoice-brand i { display: block; width: 12px; height: 17px; border-left: 1px solid #666; }
.invoice-document-meta { display: grid; grid-template-columns: 1.25fr .75fr; gap: 10%; margin-top: 6%; padding-bottom: 3.5%; border-bottom: 1px solid #777; font-size: 7px; line-height: 1.45; }.invoice-document-meta p { margin: 0; }.invoice-document-meta dl { display: grid; grid-template-columns: auto auto; justify-content: end; gap: 2px 12px; margin: 0; }.invoice-document-meta dd { margin: 0; font-weight: 700; }
.invoice-billed { margin: 3.5% 0 6%; font-size: 7px; line-height: 1.55; }.invoice-billed p { margin: 3% 0 0; }
.invoice-document-table { border: 1px solid #444; font-size: 7px; }.invoice-document-row { display: grid; grid-template-columns: 9% minmax(0,1fr) 17% 23%; min-height: 22px; border-bottom: 1px solid #555; }.invoice-document-row:last-child { border-bottom: 0; }.invoice-document-row>* { display: flex; align-items: center; padding: 4px 6px; border-right: 1px solid #555; }.invoice-document-row>*:last-child { justify-content: flex-end; border-right: 0; }.invoice-document-row.head { min-height: 25px; background: #f2f2f2; font-weight: 750; }
.invoice-payable { display: flex; justify-content: space-between; margin-top: 8%; padding: 7px; border: 1px solid #444; font-size: 8px; }
.invoice-document>footer { position: absolute; right: 9%; bottom: 5%; left: 9%; display: flex; justify-content: space-between; padding-top: 2%; border-top: 1px solid #bbb; color: #777; font-size: 5px; line-height: 1.4; }.invoice-document>footer span:last-child { text-align: right; }
.invoice-sequence-note { position: absolute; right: 9%; bottom: 9%; color: #999; font-size: 5px; }
.invoice-archive-layout { display: grid; grid-template-columns: minmax(360px,.78fr) minmax(480px,1.22fr); gap: var(--ui-space-4); margin-top: var(--ui-space-4); align-items: start; }
.invoice-archive-list { display: grid; overflow: hidden; }
.invoice-archive-row { display: grid; grid-template-columns: 32px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--ui-border); cursor: pointer; }.invoice-archive-row:last-child { border-bottom: 0; }.invoice-archive-row.selected { background: var(--ui-surface-subtle); box-shadow: inset 3px 0 var(--accent); }.invoice-archive-row b,.invoice-archive-row small { display: block; }.invoice-archive-row b { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }.invoice-archive-row small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.invoice-archive-actions { display: flex; align-items: center; gap: 9px; }.invoice-archive-actions button,.invoice-archive-actions a { border: 0; background: transparent; color: var(--accent); font-size: 8px; font-weight: 720; text-decoration: none; cursor: pointer; }
.invoice-pdf-viewer { position: sticky; top: calc(var(--ui-topbar) + 18px); overflow: hidden; }.invoice-viewer-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 15px; border-bottom: 1px solid var(--ui-border); }.invoice-viewer-head b,.invoice-viewer-head small { display: block; }.invoice-viewer-head b { font-size: 10px; }.invoice-viewer-head small { margin-top: 3px; color: var(--muted); font-size: 8px; }.invoice-viewer-head a { color: var(--accent); font-size: 9px; font-weight: 720; text-decoration: none; }
.invoice-pdf-viewer iframe { display: block; width: 100%; aspect-ratio: 4/5; border: 0; background: #2d2d2d; }

/* Invoice document follows the same editorial system as quotations and payroll. */
.invoice-document { padding: 7.2% 7.2% 6.2%; font-family: var(--sans); }
.invoice-doc-brand { font-size: 7px; font-weight: 780; letter-spacing: .1em; }
.invoice-doc-title { margin: 12% 0 6%; color: #bd4c2f; font: 400 clamp(25px,3.1vw,43px)/1 Georgia,serif; letter-spacing: -.04em; }
.invoice-document-meta { grid-template-columns: 1.4fr 1fr; gap: 8%; margin-top: 0; padding-bottom: 3%; border-bottom-color: #bdb8b2; }
.invoice-document-meta>div:last-child { text-align: right; }.invoice-document-meta small,.invoice-document-meta b { display: block; }.invoice-document-meta small { color: #777; }.invoice-document-meta b { margin: 2px 0; font-size: 8px; }
.invoice-billed { margin: 6% 0 3%; }.invoice-billed small { color: #777; }.invoice-billed h3 { margin: 2px 0 0; font: 400 16px Georgia,serif; }
.invoice-document-table { border: 0; }.invoice-document-row { grid-template-columns: 8% minmax(0,1fr) 14% 22%; gap: 5px; min-height: 0; padding: 6px 0; border-bottom-color: #e7e3de; }.invoice-document-row>* { display: block; padding: 0; border: 0; }.invoice-document-row>*:nth-last-child(-n+2) { text-align: right; }.invoice-document-row.head { min-height: 0; background: transparent; color: #777; font-size: 6px; letter-spacing: .06em; text-transform: uppercase; }
.invoice-summary { width: 48%; margin: 6% 0 0 auto; }.invoice-summary>div { display: flex; justify-content: space-between; padding: 4px 0; font-size: 7px; }.invoice-summary .total { margin-top: 2px; padding: 8px; background: #eeeae3; font-size: 9px; }
.invoice-payment { display: grid; grid-template-columns: 1fr 58px; gap: 12px; align-items: center; margin-top: 6%; padding: 9px 0; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; }.invoice-payment b { font-size: 6px; letter-spacing: .08em; text-transform: uppercase; }.invoice-payment p { margin: 4px 0 0; color: #555; font-size: 6px; line-height: 1.55; }.invoice-payment img { display: block; width: 58px; height: 58px; }.invoice-payment small { display: block; margin-top: 2px; color: #777; font-size: 5px; text-align: center; }
.invoice-pay-now { display: inline-flex; align-items: center; min-height: 24px; margin-top: 7px; padding: 5px 9px; border-radius: 6px; background: #302925; color: #fff; font-size: 6px; font-weight: 760; text-decoration: none; }
.invoice-document>footer { right: 7.2%; bottom: 4.5%; left: 7.2%; }.invoice-sequence-note { right: 7.2%; bottom: 8.5%; }
.studio-profile-main { display: grid; min-width: 0; align-content: start; gap: var(--ui-space-4); }
.studio-bank-card { display: grid; gap: var(--ui-space-4); }.studio-bank-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--ui-space-3); }.studio-bank-fields label { display: grid; gap: 6px; color: var(--muted); font-size: 9px; font-weight: 720; letter-spacing: .05em; }.studio-bank-fields input { width: 100%; min-width: 0; min-height: var(--ui-control); border: 1px solid var(--ui-border-strong); border-radius: var(--ui-radius-sm); background: var(--ui-surface); padding: 0 11px; color: var(--ink); font: 600 10px var(--sans); }.studio-bank-fields .span-2 { grid-column: 1/-1; }.studio-bank-card>.secondary-action { justify-self: start; }
.settings-edit-toggle { flex: 0 0 auto; margin-left: auto; }
.settings-panel.is-readonly :where(input,select,textarea):disabled { opacity: 1; border-color: var(--ui-border); background: var(--ui-surface-subtle); color: var(--muted); -webkit-text-fill-color: var(--muted); }
.settings-panel.is-readonly label { color: var(--muted); }

/* Compact desktop and tablet: every split layout becomes a clean stack. */
@media (max-width: 1199px) {
  .content { padding-top: 34px; }
  .staff-overview-layout { grid-template-columns: minmax(0,1fr); }
  .staff-home-calendar { width: min(100%,620px); justify-self: stretch; }
  .staff-attendance-workspace { grid-template-columns: minmax(0,1fr); }
  .staff-attendance-rail { width: 100%; height: auto; grid-template-columns: repeat(2,minmax(0,1fr)); grid-template-rows: none; }
  .staff-attendance-main { width: 100%; justify-self: stretch; }
  .staff-attendance-detail { min-height: 520px; aspect-ratio: auto; }
  .staff-attendance-detail :where(.attendance-calendar,.attendance-log-detail) { height: auto; min-height: 520px; }
  .attendance-split,
  .native-payroll-layout,
  .studio-profile-layout,
  .payroll-settings,
  .quotation-layout,
  .invoice-create-layout,
  .invoice-archive-layout { grid-template-columns: minmax(0,1fr); }
  .attendance-detail-pane,
  .native-preview-card { position: static; }
  .attendance-people-pane .attendance-summary-grid { height: auto; grid-template-columns: repeat(3,minmax(0,1fr)); grid-template-rows: none; }
  .attendance-people-pane .attendance-person { grid-template-columns: 48px minmax(0,1fr); align-content: start; }
  .attendance-people-pane .attendance-person>img,
  .attendance-people-pane .attendance-person>.person-initial { grid-row: auto; width: 48px; height: 48px; }
  .attendance-people-pane .attendance-person dl { grid-column: 1 / -1; }
  .attendance-calendar-host { height: auto; min-height: 460px; }
  .attendance-calendar { min-height: 460px; }
  .calendar-grid { min-height: 370px; }
  .studio-profile-aside { grid-template-columns: 1fr 1fr; }
  .quotation-preview-card { min-height: 760px; }
  .invoice-preview-card { min-height: 760px; }
  .invoice-pdf-viewer { position: static; }
}

/* Mobile: one linear reading order, no compressed side-by-side UI. */
@media (max-width: 767px) {
  :root { --ui-gutter: 16px; --ui-topbar: 68px; }
  .office-shell { display: block; }
  .workspace { grid-column: auto; }
  .content { padding: 28px var(--ui-gutter) 60px; }
  .topbar { padding-inline: var(--ui-gutter); }
  .welcome-row,
  .section-heading { min-height: 0; align-items: flex-start; gap: 18px; padding-bottom: 24px; }
  .app-group-heading { align-items: flex-start; flex-direction: column; gap: 6px; }
  .app-group-heading>p { max-width: none; text-align: left; }
  .staff-overview-layout,.staff-overview-rail { gap: var(--ui-space-3); }
  .staff-profile-card { grid-template-columns: 60px minmax(0,1fr); padding: var(--ui-space-4); }
  .staff-profile-photo,.staff-profile-photo img,.staff-profile-photo .person-initial { width: 60px; height: 60px; }
  .staff-profile-card h2 { font-size: 26px; }
  .staff-home-calendar { width: 100%; }
  .staff-home-calendar .attendance-calendar { min-height: 0; }
  .staff-home-calendar .calendar-grid { min-height: 0; }
  .check-card-heading { align-items: flex-start; flex-direction: column; }
  .welcome-row h2,
  .section-heading h2 { font-size: 38px; }
  .section-heading .status-chip { align-self: flex-start; }
  .attendance-controls-row { align-items: stretch; flex-direction: column; gap: 12px; }
  .staff-attendance-rail { width: 100%; grid-template-columns: minmax(0,1fr); grid-template-rows: none; gap: var(--ui-space-3); }
  .staff-attendance-main { width: 100%; }
  .staff-attendance-detail { min-height: 0; aspect-ratio: 1; }
  .staff-attendance-detail :where(.attendance-calendar,.attendance-log-detail) { height: 100%; min-height: 0; }
  .attendance-view-tabs { display: grid; width: 100%; grid-template-columns: repeat(3,minmax(0,1fr)); }
  .attendance-view-tabs button { padding-inline: 8px; }
  .module-toolbar { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; }
  .month-picker { width: 100%; min-width: 0; }
  .attendance-people-pane .attendance-summary-grid { display: grid; grid-auto-columns: 100%; grid-auto-flow: column; grid-template-columns: none; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
  .attendance-people-pane .attendance-person { min-height: 142px; scroll-snap-align: start; }
  .attendance-calendar-host,
  .attendance-calendar { min-height: 420px; }
  .calendar-grid { min-height: 330px; }
  .calendar-head-with-legend { align-items: flex-start; flex-direction: column; }
  .calendar-legend { max-width: none; justify-content: flex-start; line-height: 1.5; }
  .view[data-view="overview"] .app-launchers.app-index { grid-template-columns: repeat(3,minmax(0,1fr)); gap: var(--ui-space-5) var(--ui-space-3); }
  .view[data-view="overview"] .app-index .app-icon { width: min(88px,100%); height: auto; aspect-ratio: 1; }
  .directory-tools { align-items: stretch; gap: 16px; }
  .people-row { grid-template-columns: minmax(0,1fr) auto auto; gap: 10px; }
  .client-group .client-row { grid-template-columns: minmax(0,1fr) auto auto; }.client-group .client-row .people-cell { display: none; }
  .native-payroll-layout { display: grid; }
  .native-preview-card { margin-top: 0; }
  .compact-grid { grid-template-columns: minmax(0,1fr); }
  .compact-grid .span-2 { grid-column: auto; }
  .studio-profile-aside { grid-template-columns: 1fr; }
  .studio-bank-fields { grid-template-columns: minmax(0,1fr); }.studio-bank-fields .span-2 { grid-column: auto; }
  .studio-profile-main .settings-panel-head { display: grid; grid-template-columns: 44px minmax(0,1fr); align-items: start; }
  .studio-profile-main .settings-panel-head>.card-icon { grid-column: 1; grid-row: 1 / 4; }
  .studio-profile-main .settings-panel-head>div { grid-column: 2; min-width: 0; }
  .studio-profile-main .settings-panel-head>.record-badge { grid-column: 2; justify-self: start; margin: 8px 0 0; }
  .studio-profile-main .settings-panel-head>.settings-edit-toggle { grid-column: 2; justify-self: start; margin: 9px 0 0; }
  .app-access-card { grid-template-columns: minmax(0,1fr); }
  .app-order-panel { grid-template-columns: minmax(0,1fr); }
  .app-access-people,.app-access-footer { grid-column: 1; }
  .app-access-footer { align-items: stretch; flex-direction: column; }
  .app-access-footer .primary-action { width: 100%; }
  .studio-form-footer { align-items: stretch; flex-direction: column; }
  .quotation-form-grid { grid-template-columns: minmax(0,1fr); }
  .quotation-form-grid .span-2 { grid-column: auto; }
  .quotation-item { grid-template-columns: minmax(0,1fr) 56px 80px 32px; }
  .quotation-form-footer { align-items: stretch; flex-direction: column; }
  .quotation-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .quotation-preview-card { min-height: 620px; padding: 14px; }
  .quotation-history article { grid-template-columns: minmax(0,1fr) auto; }
  .quotation-history article>span:nth-child(2) { display: none; }
  .project-register-grid article { grid-template-columns: 62px minmax(0,1fr) auto; }.project-register-grid article>span:nth-child(3) { display: none; }
  .project-section .project-register-grid article { grid-template-columns: 22px 56px minmax(0,1fr) auto; }
  .project-section .project-number { grid-row: 1 / 3; }
  .project-section .project-state-stack { grid-column: 2; }
  .project-section .project-row-actions { grid-column: 3; grid-row: 1 / 3; align-items: stretch; flex-direction: column; }
  .staff-project-dialog>section { padding: 22px; }.staff-project-tasks article { grid-template-columns: 1fr; }
  .invoice-preview-card { min-height: 620px; padding: 14px; }
  .invoice-item { grid-template-columns: minmax(0,1fr) 62px 88px 32px; }
  .invoice-archive-row { grid-template-columns: 30px minmax(0,1fr); }.invoice-archive-actions { grid-column: 2; }
  .scope-presets>div:last-child { grid-template-columns: minmax(0,1fr); }
  .office-dialog form { padding: 22px; }
  .account-dialog .account-security-section { margin-inline: 22px; }
}

@media (max-width: 420px) {
  :root { --ui-gutter: 14px; }
  .welcome-row h2,
  .section-heading h2 { font-size: 34px; }
  .primary-action,
  .secondary-action { padding-inline: 13px; }
  .people-row { padding-inline: 12px; }
  .people-primary { gap: 9px; }
  .record-badge { font-size: 7px; }
  .edit-person { padding-inline: 8px; }
  .quotation-item,
  .invoice-item { grid-template-columns: minmax(0,1fr) minmax(0,1fr) 32px; }
  .quotation-item > input:first-child,
  .invoice-item > input:first-child { grid-column: 1 / -1; }
}

/* Theme overrides use tokens, while document previews remain print-white. */
html[data-theme="dark"] {
  --ui-shadow: 0 14px 38px rgba(0,0,0,.24);
  --cal-present-bg: #263b2d;
  --cal-present-ink: #9bc9aa;
  --cal-present-border: #42634d;
  --cal-paid-bg: #403521;
  --cal-paid-ink: #e0b66e;
  --cal-paid-border: #6b5731;
  --cal-unpaid-bg: #422a28;
  --cal-unpaid-ink: #dfa19a;
  --cal-unpaid-border: #70423e;
  --cal-half-bg: #283342;
  --cal-half-ink: #aac1df;
  --cal-half-border: #41546d;
  --cal-holiday-bg: #372d43;
  --cal-holiday-ink: #c7aadf;
  --cal-holiday-border: #5a476d;
  --cal-unmarked-bg: #292d34;
  --cal-unmarked-ink: #a6afbd;
  --cal-unmarked-border: #444a54;
}
html[data-theme="dark"] .projects-app .app-icon { background: var(--accent-soft); color: var(--accent); }
html[data-theme="dark"] .header-install-action { border-color: var(--line); background: #292724; color: var(--muted); }
html[data-theme="dark"] .header-install-action:hover { border-color: var(--line-strong); background: #312e2a; color: var(--ink); }
html[data-theme="dark"] :where(.native-slip,.native-email-preview,.native-email-preview .email-card) { background: #fff; color: #191c1b; }
html[data-theme="dark"] :where(.quotation-page,.invoice-document) { background: #fff; color: #191c1b; }

.quotation-terms-page { padding-bottom: 15%; }
.quotation-terms-page .quotation-doc-title { margin-bottom: 8%; font-size: clamp(22px,2.7vw,38px); }
.quotation-doc-terms-page { margin: 0; padding: 0 0 12%; border: 0; }
.quotation-doc-terms-page p { margin: 0; white-space: pre-wrap; font-size: 7.2px; line-height: 1.72; }
.invoice-history-only { width: 100%; }
.invoice-history-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: var(--ui-space-5); border-bottom: 1px solid var(--ui-border); }
.invoice-history-head h3 { margin: 3px 0 0; }
.quotation-terms-editor textarea { min-height: 180px; overflow: hidden; resize: none; field-sizing: content; }

/* Standard document-register actions: quotations, invoices and agreements. */
:where(.quotation-history,.invoice-archive-list,.contract-register) :where(.history-actions,.invoice-archive-actions) { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--ui-space-2); }
:where(.quotation-history,.invoice-archive-list,.contract-register) :where(.history-actions,.invoice-archive-actions) :is(a,button) { display: inline-flex; min-height: var(--ui-control); align-items: center; justify-content: center; padding: 0 var(--ui-space-3); border: 1px solid var(--ui-border); border-radius: var(--ui-radius-sm); background: var(--ui-surface); color: var(--ink); font: 600 var(--ui-text-xs) var(--sans); line-height: 1; text-decoration: none; white-space: nowrap; cursor: pointer; }
:where(.quotation-history,.invoice-archive-list,.contract-register) :where(.history-actions,.invoice-archive-actions) :is(a,button):hover { border-color: var(--ui-border-strong); background: var(--ui-surface-subtle); }
:where(.quotation-history,.invoice-archive-list,.contract-register) :where(.history-actions,.invoice-archive-actions) :is(a,button):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html[data-theme="dark"] { --ui-destructive: #e7a097; }
.secondary-action.danger { border-color: color-mix(in srgb,var(--ui-destructive) 34%,var(--ui-border)); color: var(--ui-destructive); }
:where(.quotation-history,.invoice-archive-list,.contract-register) :where(.history-actions,.invoice-archive-actions) .danger { border-color: color-mix(in srgb,var(--red,#a34c40) 34%,var(--ui-border)); color: var(--red,#a34c40); }

/* Quotation actions use the same visibly outlined controls as agreement actions. */
.quotation-history .history-actions :is(a,button) { display: inline-flex; min-height: var(--ui-control); align-items: center; justify-content: center; padding: 0 var(--ui-space-3); border: 1px solid var(--ui-border); border-radius: var(--ui-radius-sm); background: var(--ui-surface); color: var(--ink); font: 600 var(--ui-text-xs) var(--sans); line-height: 1; text-decoration: none; white-space: nowrap; cursor: pointer; }
.quotation-history .history-actions :is(a,button):hover { border-color: var(--ui-border-strong); background: var(--ui-surface-subtle); }
.quotation-history .history-actions .danger { border-color: color-mix(in srgb,var(--red,#a34c40) 34%,var(--ui-border)); color: var(--red,#a34c40); }

@media (max-width: 440px) {
  .header-install-action { width: 38px; padding: 0; }
  .header-install-action span { display: none; }
}
:is(#office-storage,#office-server-stats){display:flex;align-items:center;flex-wrap:wrap;gap:var(--ui-space-3);font-size:var(--ui-text-xs);font-weight:400;color:var(--muted);line-height:1.4;font-variant-numeric:tabular-nums;border:0;box-shadow:none;background:transparent}.office-metric{display:inline-flex;align-items:center;gap:var(--ui-space-1)}.office-metric svg{width:12px;height:12px;flex-shrink:0;opacity:.65}
#office-storage{padding:var(--ui-space-2) 0 var(--ui-space-1);margin-top:auto}#office-server-stats{padding:0 0 var(--ui-space-2)}

/* Respond to usable content width, including the persistent tablet sidebar. */
@container (max-width: 650px) {
  .client-row,.client-group .client-row { grid-template-columns: minmax(0,1fr) auto; }
  .client-row .people-primary { grid-column: 1; }
  .client-row>.edit-person,.client-row>.client-agreement-actions { grid-column: 2; grid-row: 1; }
  .client-row .people-cell,.client-group .client-row .people-cell { display: block; grid-column: 1/-1; overflow-wrap: anywhere; }
  .client-row .record-badge { grid-column: 1; justify-self: start; }
}
@container (max-width: 600px) {
  .app-access-card { grid-template-columns: minmax(0,1fr); }
  .app-access-mode { min-width: 0; }
  .app-access-footer { align-items: stretch; flex-direction: column; }
  .app-access-footer .primary-action { width: 100%; }
}

/* Never display prototype project content while record/access checks are pending. */
.project-data-pending main>:not(.topbar):not(.project-load-status),
.project-access-pending .project-office-sidebar .side-nav { display: none; }
.project-load-status { margin: var(--ui-space-5); }
body.workspace-access-pending .view { display: none !important; }
.workspace-access-pending .side-nav { visibility: hidden; }

/* Status filters retain every action when the available reading width shrinks. */
.project-status-tabs { flex-wrap: wrap; grid-template-columns: repeat(auto-fit,minmax(min(100%,8rem),1fr)); }
.section-heading { flex-wrap: wrap; }
.section-heading>div { min-width: 0; max-width: 100%; }
.section-heading>.header-actions { flex-wrap: wrap; }

#people-table { container: people-directory / inline-size; }
@container people-directory (max-width:800px) {
  #people-table .people-row { grid-template-columns: minmax(0,1fr) auto; gap: var(--ui-space-3); }
  #people-table .people-primary { grid-column: 1; grid-row: 1; min-width: 0; }
  #people-table .people-primary>span { min-width: 0; overflow-wrap: anywhere; }
  #people-table .people-cell { display: block; grid-column: 1/-1; overflow-wrap: anywhere; }
  #people-table .record-badge { grid-column: 1; justify-self: start; }
  #people-table .edit-person { grid-column: 2; grid-row: 1; }
}

/* Authenticated in-app PDF viewer for installed and mobile Office clients. */
body.secure-pdf-open{overflow:hidden}
.secure-pdf-viewer{position:fixed;inset:0;z-index:10000;display:grid;grid-template-rows:auto minmax(0,1fr) auto;background:var(--background,#f7f6f2);color:var(--foreground,#191c1b);overscroll-behavior:contain}
.secure-pdf-header{display:flex;align-items:center;gap:14px;min-height:72px;padding:calc(10px + env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) 10px max(16px,env(safe-area-inset-left));border-bottom:1px solid var(--border,#d9d6cf);background:var(--card,#fff)}
.secure-pdf-header>div{min-width:0}.secure-pdf-header h2{margin:0;overflow:hidden;font-size:16px;line-height:1.35;text-overflow:ellipsis;white-space:nowrap}.secure-pdf-header p{margin:2px 0 0;color:var(--muted-foreground,#6d6a65);font-size:12px}
.secure-pdf-close,.secure-pdf-toolbar button{min-height:42px;border:1px solid var(--border,#d9d6cf);border-radius:10px;background:var(--card,#fff);color:inherit;font:600 13px/1 inherit;cursor:pointer}.secure-pdf-close{display:inline-flex;align-items:center;gap:7px;padding:0 13px}.secure-pdf-close span:first-child{font-size:20px}.secure-pdf-toolbar button:disabled{cursor:not-allowed;opacity:.45}
.secure-pdf-stage{position:relative;display:grid;place-items:start center;min-height:0;padding:16px;overflow:auto;background:#262626;-webkit-overflow-scrolling:touch}.secure-pdf-canvas{display:block;max-width:100%;background:#fff;box-shadow:0 14px 40px #0008}.secure-pdf-loading{position:absolute;inset:0;display:grid;place-items:center}.secure-pdf-loading[hidden]{display:none}.secure-pdf-loading span{width:36px;height:36px;border:3px solid #ffffff38;border-top-color:#fff;border-radius:50%;animation:secure-pdf-spin .8s linear infinite}.secure-pdf-error{align-self:center;max-width:480px;margin:auto;padding:18px;border-radius:12px;background:#fff;color:#7a2e1f;text-align:center}
.secure-pdf-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:10px max(16px,env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));border-top:1px solid var(--border,#d9d6cf);background:var(--card,#fff)}.secure-pdf-pages,.secure-pdf-actions{display:flex;align-items:center;gap:9px}.secure-pdf-pages strong{min-width:92px;text-align:center;font-size:12px}.secure-pdf-toolbar button{padding:0 14px}.secure-pdf-actions .primary-action{border-color:var(--primary,#27211e);background:var(--primary,#27211e);color:var(--primary-foreground,#fff)}
@keyframes secure-pdf-spin{to{transform:rotate(360deg)}}
@media(max-width:700px){.secure-pdf-viewer{grid-template-rows:auto minmax(0,1fr) auto}.secure-pdf-stage{padding:10px}.secure-pdf-toolbar{align-items:stretch;flex-direction:column}.secure-pdf-pages,.secure-pdf-actions{display:grid;grid-template-columns:1fr auto 1fr}.secure-pdf-actions{grid-template-columns:1fr 1fr}.secure-pdf-toolbar button{width:100%}.secure-pdf-header{min-height:64px}.secure-pdf-header h2{font-size:15px}}
@media(prefers-reduced-motion:reduce){.secure-pdf-loading span{animation-duration:1.8s}}

/* Isolated Fees & Billing review candidate. */
#project-dialog:has(.project-fees-panel){width:min(980px,calc(100% - 24px))}.project-fees-panel{display:grid;gap:18px;margin:20px 0;padding:20px;border:1px solid var(--border);border-radius:14px;background:var(--muted)}.project-fees-panel>header,.project-fee-section-head,.project-fee-summary{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}.project-fees-panel h3{margin:2px 0 3px;font-size:18px}.project-fees-panel header p,.project-fee-section-head small{margin:0;color:var(--muted-foreground);font-size:12px}.project-fee-basis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.project-fee-basis label,.project-fee-scope label,.project-fee-stage label{display:grid;gap:5px}.project-fee-basis span,.project-fee-scope span,.project-fee-stage label span{font-size:11px;font-weight:650;color:var(--muted-foreground)}.project-fee-basis input,.project-fee-basis select,.project-fee-scope input,.project-fee-scope select,.project-fee-stage input{width:100%;min-height:40px}.project-fee-scopes,.project-fee-stages{display:grid;gap:10px;padding-top:14px;border-top:1px solid var(--border)}.project-fee-section-head{align-items:end}.project-fee-section-head>div{display:grid;gap:3px}.project-fee-section-head>label{margin-left:auto}.project-fee-section-head button,.project-fee-row-actions button,.project-fee-scope>button{min-height:36px;border:1px solid var(--border);border-radius:8px;background:var(--card);color:inherit}.project-fee-scope{display:grid;grid-template-columns:minmax(180px,1.5fr) minmax(120px,.7fr) minmax(170px,1fr) 38px;gap:9px;align-items:end;margin-top:8px}.project-fee-stage{display:grid;grid-template-columns:22px minmax(180px,1.4fr) 100px 110px minmax(150px,.8fr) auto;gap:9px;align-items:center;padding:10px;border:1px solid var(--border);border-radius:10px;background:var(--card)}.project-fee-drag{color:var(--muted-foreground)}.project-fee-stage output{font-weight:700;text-align:right}.project-fee-stage details summary{cursor:pointer;font-size:12px;font-weight:650}.project-fee-stage details>div{position:absolute;z-index:3;display:grid;grid-template-columns:1fr 1fr;gap:8px;width:min(380px,calc(100vw - 40px));padding:12px;border:1px solid var(--border);border-radius:10px;background:var(--card);box-shadow:var(--shadow-lg)}.project-fee-stage details .wide{grid-column:1/-1}.project-fee-row-actions{display:flex;gap:4px}.project-fee-row-actions button{width:32px;padding:0}.project-fee-summary{display:grid;grid-template-columns:repeat(4,1fr);align-items:stretch;padding-top:14px;border-top:1px solid var(--border)}.project-fee-summary span{display:grid;gap:4px;padding:10px}.project-fee-summary small{color:var(--muted-foreground)}.project-fee-summary b{font-size:16px}.project-fee-summary .total{border-radius:10px;background:var(--primary);color:var(--primary-foreground)}.project-fee-summary .total small{color:inherit;opacity:.75}.project-fee-summary p{grid-column:1/-1;margin:0;text-align:right;color:var(--muted-foreground);font-size:12px}.project-fee-summary p.invalid{color:var(--destructive,#a33)}
@media(max-width:760px){.project-fee-basis{grid-template-columns:1fr 1fr}.project-fee-stage{grid-template-columns:18px 1fr 84px}.project-fee-stage output{grid-column:2}.project-fee-stage details{grid-column:2/-1}.project-fee-row-actions{grid-column:3;grid-row:2}.project-fee-scope{grid-template-columns:1fr 1fr}.project-fee-scope>label:nth-of-type(2){grid-column:1/-1}.project-fee-summary{grid-template-columns:1fr 1fr}.project-fee-section-head{align-items:flex-start;flex-wrap:wrap}.project-fee-section-head>label{margin-left:0}}

/* Review correction: bind the candidate to the established Office tokens. */
.project-fees-panel{border-color:var(--ui-border);background:var(--ui-surface-subtle);color:var(--ink)}
.project-fees-panel header p,.project-fee-section-head small,.project-fee-basis span,.project-fee-scope span,.project-fee-stage label span,.project-fee-drag,.project-fee-summary small,.project-fee-summary p{color:var(--muted)}
.project-fee-scopes,.project-fee-stages,.project-fee-summary{border-color:var(--ui-border)}
.project-fee-section-head button,.project-fee-row-actions button,.project-fee-scope>button,.project-fee-stage,.project-fee-stage details>div{border-color:var(--ui-border);background:var(--ui-surface)}
.project-fee-stage details>div{box-shadow:var(--ui-shadow)}
.project-fee-summary .total{background:var(--ink);color:var(--surface)}

/* Keep fee controls aligned and leave native select text clear of its arrow. */
.project-fee-basis{grid-template-columns:minmax(170px,1.2fr) repeat(3,minmax(130px,1fr));align-items:start}
.project-fee-basis>label{grid-template-rows:auto 42px auto;align-content:start;min-width:0}
.project-fee-basis input,.project-fee-basis select{height:42px;min-height:42px;margin:0}
.project-fee-input-unit{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;height:42px;overflow:hidden;border:1px solid var(--ui-border);border-radius:10px;background:var(--ui-surface)}
.project-fee-input-unit input{height:40px!important;min-height:40px!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important}
.project-fee-input-unit small{padding:0 12px 0 8px;color:var(--muted);font-size:11px;font-weight:650}
.project-fee-basis select,.project-fee-section-head select{min-width:0;padding-right:36px;line-height:1.2;text-overflow:ellipsis}
.project-fee-section-head{display:grid;grid-template-columns:minmax(0,1fr) minmax(170px,190px) auto;align-items:end}
.project-fee-section-head>div{min-width:0}
.project-fee-section-head>label{display:grid;gap:6px;min-width:0;margin:0;color:var(--muted);font-size:11px;font-weight:650}
.project-fee-section-head>label select{width:100%;height:40px;margin:0}
.project-fee-section-head>button{white-space:nowrap}
.project-fee-stage-head,.project-fee-stage{display:grid;grid-template-columns:22px minmax(210px,1fr) 92px 118px minmax(140px,.75fr) 112px;gap:10px;align-items:center}
.project-fee-allocation{display:grid;grid-template-columns:auto 1fr;gap:4px 16px;align-items:center;padding:12px 14px;border:1px solid var(--ui-border);border-radius:10px;background:var(--ui-surface)}
.project-fee-allocation>span:first-child{display:flex;align-items:baseline;gap:7px}.project-fee-allocation b{font-size:18px}.project-fee-allocation small{color:var(--muted);font-size:11px}.project-fee-allocation>[data-fee-balance]{justify-self:end;color:var(--success);font-size:12px;font-weight:750}.project-fee-allocation>i{grid-column:1/-1;height:6px;overflow:hidden;border-radius:999px;background:var(--ui-border)}.project-fee-allocation>i b{display:block;height:100%;border-radius:inherit;background:var(--success);transition:width .15s ease}.project-fee-allocation[data-allocation-state="under"]>[data-fee-balance]{color:#996515}.project-fee-allocation[data-allocation-state="under"]>i b{background:#c08a32}.project-fee-allocation[data-allocation-state="over"]{border-color:#dfb3a9;background:#fff8f6}.project-fee-allocation[data-allocation-state="over"]>[data-fee-balance]{color:#a33}.project-fee-allocation[data-allocation-state="over"]>i b{background:#b84f3b}
.project-fee-stage-head{padding:0 10px;color:var(--muted);font-size:10px;font-weight:750;letter-spacing:.06em;text-transform:uppercase}
.project-fee-stage{margin-top:8px;padding:11px 10px}
.project-fee-stage>input[name="fee_stage_name"]{height:40px;min-height:40px}
.project-fee-stage>label{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:5px;min-width:0}
.project-fee-stage>label input{height:40px;min-height:40px;margin:0;text-align:right}
.project-fee-stage>label i{color:var(--muted);font-size:12px;font-style:normal;font-weight:700}
.project-fee-stage output{min-width:0;text-align:left;white-space:normal;line-height:1.25}
.project-fee-stage details{position:relative;min-width:0}
.project-fee-stage details summary{width:100%;padding:9px 10px;border:1px solid var(--ui-border);border-radius:8px;background:var(--ui-surface-subtle);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.project-fee-stage details>div{right:0}
.project-fee-row-actions{display:grid;grid-template-columns:repeat(3,34px);gap:4px;padding:3px;border:1px solid var(--ui-border);border-radius:9px;background:var(--ui-surface-subtle)}
.project-fee-row-actions button{width:34px;min-height:34px;padding:0;border:0;background:transparent}
.project-fee-row-actions button:hover{background:var(--ui-surface)}
.project-fees-panel>.project-fee-summary{display:grid;width:100%;grid-template-columns:repeat(4,minmax(0,1fr));align-items:stretch;justify-content:normal;gap:10px;background:transparent}
.project-fee-summary>span{min-width:0;min-height:84px;padding:13px 14px!important;border:1px solid var(--ui-border);border-radius:10px;background:var(--ui-surface);align-content:center}
.project-fee-summary>span:nth-child(1){border-top:3px solid #7c9d90;background:color-mix(in srgb,#7c9d90 8%,var(--ui-surface))}.project-fee-summary>span:nth-child(2){border-top:3px solid #b88a52;background:color-mix(in srgb,#b88a52 8%,var(--ui-surface))}.project-fee-summary>span:nth-child(3){border-top:3px solid #8d84a7;background:color-mix(in srgb,#8d84a7 8%,var(--ui-surface))}
.project-fee-summary>span small{min-height:2.6em;font-size:10px;line-height:1.3;overflow-wrap:anywhere}.project-fee-summary>span b{font-size:18px;line-height:1.2;overflow-wrap:anywhere}.project-fee-summary>.total{border-color:var(--ink);background:var(--ink);color:var(--surface);box-shadow:0 8px 18px color-mix(in srgb,var(--ink) 16%,transparent)}.project-fee-summary>.total b{font-size:20px}
.project-fee-summary>p{grid-column:1/-1;width:100%;min-width:0;margin:0;padding:6px 4px 0;text-align:left;line-height:1.45;overflow-wrap:anywhere}
@media(max-width:900px){.project-fees-panel>.project-fee-summary{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.project-fee-section-head{grid-template-columns:minmax(0,1fr) auto}.project-fee-section-head>div{grid-column:1/-1}.project-fee-section-head>label{width:100%;min-width:0}.project-fee-section-head>button{align-self:end}}
@media(max-width:520px){.project-fee-basis{grid-template-columns:1fr}.project-fee-section-head{grid-template-columns:1fr}.project-fee-section-head>div,.project-fee-section-head>label,.project-fee-section-head>button{grid-column:1}.project-fee-section-head>button{width:100%}}
@media(max-width:760px){.project-fee-stage-head{display:none}.project-fee-stage{grid-template-columns:minmax(0,1fr) 112px;gap:10px 12px;padding:14px}.project-fee-stage>.project-fee-drag{display:none}.project-fee-stage>input[name="fee_stage_name"]{grid-column:1/-1}.project-fee-stage>label{grid-column:1}.project-fee-stage>output{grid-column:2;text-align:right}.project-fee-stage>details{grid-column:1}.project-fee-row-actions{grid-column:2;grid-row:auto}.project-fee-stage details>div{right:auto;left:-52px;width:min(380px,calc(100vw - 40px))}.project-fee-summary{gap:8px}.project-fee-summary>span{min-height:70px;padding:11px!important}}
@media(max-width:520px){.project-fee-allocation{grid-template-columns:1fr}.project-fee-allocation>[data-fee-balance]{justify-self:start}.project-fee-allocation>i{grid-column:1}.project-fees-panel>.project-fee-summary{grid-template-columns:1fr}.project-fee-summary>.total{grid-row:auto}}

/* Dashboard readability release 2026-11-06. */
.portfolio-heading small,.portfolio-finance-card small,.portfolio-progress small{font-size:11px;line-height:1.35}
.portfolio-heading p,.portfolio-finance-card p,.portfolio-progress p,.portfolio-legend{font-size:10px;line-height:1.5}
.portfolio-finance-card strong{overflow:visible;font-size:17px;text-overflow:clip;white-space:normal;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
@media (min-width:761px) and (max-width:900px){.portfolio-progress{grid-template-columns:minmax(150px,190px) minmax(0,1fr);gap:20px}.portfolio-chart{min-width:0}.portfolio-legend{flex-wrap:wrap;gap:10px 18px}}
@media (max-width:760px){.portfolio-heading small,.portfolio-finance-card small,.portfolio-progress small{font-size:10px}.portfolio-finance-card p,.portfolio-progress p,.portfolio-legend{font-size:10px}}


/* Project register responsive readability: 2026-11-06 */
.project-section>header p,
.quotation-history small,
.quotation-history a,
.quotation-history button { font-size: 11px; }
.project-value-cell>small,
.project-assignee-cell>small,
.project-stage,
.project-bulk-actions label,
.staff-project-tasks label span { font-size: 10px; }
.project-assignee-cell select,
.project-status-select,
.staff-project-tasks article small,
.attendance-people-pane .attendance-person>div small,
.attendance-people-pane .attendance-person dd,
.people-cell small { font-size: 11px; }
.quotation-form-grid label,
.quotation-storage-card label,
.quotation-guided label { font-size: 11px; }
@media (min-width:1201px) and (max-width:1300px) {
  .project-section .project-register-grid article { grid-template-columns:22px 76px minmax(0,1fr) 128px; gap:10px 12px; }
  .project-section .project-select { grid-column:1; grid-row:1 / 4; }
  .project-section .project-number { grid-column:2; grid-row:1; }
  .project-section .project-identity-cell { grid-column:3; grid-row:1; }
  .project-section .project-value-cell { grid-column:2; grid-row:2; }
  .project-section .project-assignee-cell { grid-column:3; grid-row:2; }
  .project-section .project-status-select { grid-column:2; grid-row:3; width:100%; }
  .project-section .project-state-stack { grid-column:3; grid-row:3; }
}
@media (max-width:767px) {
  .project-section .project-register-grid article>.project-identity-cell {
    display:block;
    grid-column:2 / -1;
  }
}


/* Project register medium-width column refinement: 2026-11-06 */
@media (min-width:768px) and (max-width:1366px) {
  .project-section .project-register-grid article {
    grid-template-columns:22px 118px minmax(0,1fr) 144px;
  }
  .project-section .project-assignee-cell{width:min(220px,100%);justify-self:start}
  .project-section .project-status-select{width:110px!important;justify-self:start}
  .project-section .project-row-actions{grid-column:4;grid-row:1 / 4;align-self:center;flex-direction:column}
  .project-section .project-row-actions button{box-sizing:border-box;width:100%}
}
/* Project identifiers keep historical imports explicit without crowding the main form. */
.project-number-fields{border:0;margin:0;padding:0;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}.project-number-fields legend{grid-column:1/-1;margin:0 0 6px;font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase}.project-number-fields label{margin:0}.project-number-fields>[data-number-preview]{grid-column:1/-1}@media(max-width:520px){.project-number-fields{grid-template-columns:1fr}}
.project-progress-overlay{position:relative}.project-progress-overlay>i{position:absolute;inset:0 auto 0 0;min-width:0;height:100%;border-radius:inherit;transition:width .2s ease}.project-progress-overlay>.project-work-fill{z-index:1;background:#a64f43}.project-progress-overlay>.project-payment-fill{z-index:2;background:#668f80;border:0;outline:0;box-shadow:none}.project-progress-legend{display:flex;align-items:center;gap:6px;color:var(--muted);font-size:10px;font-weight:700;white-space:nowrap}.project-progress-legend i{width:14px;height:6px;border-radius:999px}.project-progress-legend .work{background:#a64f43}.project-progress-legend .received{margin-left:6px;background:#668f80}.financial-values-hidden .project-payment-fill{display:none!important}
.project-state-stack:has(.project-progress-overlay){grid-template-columns:minmax(72px,1fr);row-gap:4px}.project-state-stack>small{position:static;justify-self:end;min-height:12px;color:var(--ink);font-size:10px;line-height:12px;font-variant-numeric:tabular-nums}.staff-project-row .project-state-stack{row-gap:4px}.staff-project-row .project-state-stack>.project-stage{grid-row:1 / 3}.staff-project-row .project-state-stack>.project-row-progress{grid-column:2;grid-row:1}.staff-project-row .project-state-stack>small{grid-column:2;grid-row:2}.project-progress-overlay>.project-payment-fill[hidden]{display:none}
.revenue-kpis-six{grid-template-columns:repeat(3,minmax(0,1fr))}.revenue-chart-legend{display:flex;flex-wrap:wrap;gap:14px;margin-bottom:12px;color:var(--muted);font-size:var(--ui-text-xs)}.revenue-chart-legend span{display:flex;align-items:center;gap:6px}.revenue-chart-legend i{display:block;width:16px;height:7px;border-radius:99px}.revenue-chart-legend .income,.revenue-bars .income{background:var(--green)}.revenue-chart-legend .outgo,.revenue-bars .outgo{background:var(--red,#9b5142)}.revenue-chart-legend .net,.revenue-bars .net{background:#58708d}.revenue-bars .net.negative{background:#b57b32}.revenue-chart-shell{position:relative;padding-left:58px}.revenue-axis{position:absolute;left:0;color:var(--muted);font-size:10px}.revenue-axis.top{top:6px}.revenue-axis.zero{bottom:25px}.revenue-month small{min-height:15px;color:var(--muted);font-size:9px}.revenue-month-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px;margin-top:14px}.revenue-month-summary>div{display:grid;grid-template-columns:1fr auto;gap:4px 8px;padding:10px;border-radius:var(--ui-radius-sm);background:var(--ui-surface-subtle);font-size:10px}.revenue-month-summary b{grid-column:1/-1}.revenue-mix{display:grid;gap:12px}.revenue-mix>div{display:grid;grid-template-columns:minmax(140px,.9fr) minmax(100px,1.2fr) auto;gap:12px;align-items:center}.revenue-mix span{display:grid}.revenue-mix small{color:var(--muted);font-size:10px}.revenue-mix i{display:block;height:8px;overflow:hidden;border-radius:99px;background:var(--ui-surface-subtle)}.revenue-mix em{display:block;height:100%;border-radius:inherit;background:var(--green)}.revenue-mix strong{font-size:12px}.revenue-averages{display:grid;gap:12px}.revenue-averages>div{display:grid;gap:6px;padding:14px;border-radius:var(--ui-radius-sm);background:var(--ui-surface-subtle)}.revenue-averages span,.revenue-averages small{color:var(--muted);font-size:var(--ui-text-xs)}.revenue-averages strong{font-size:20px}@media(max-width:1050px){.revenue-kpis-six{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:620px){.revenue-kpis-six{grid-template-columns:1fr}.revenue-chart-shell{padding-left:42px}.revenue-mix>div{grid-template-columns:1fr auto}.revenue-mix i{grid-column:1/-1}.revenue-month-summary{grid-template-columns:1fr}}
.revenue-preview-banner{margin:0 0 12px;padding:10px 14px;border:1px solid var(--ui-border);border-radius:var(--ui-radius-sm);background:var(--ui-surface-subtle);color:var(--muted);font-size:var(--ui-text-xs);font-weight:750;letter-spacing:.04em;text-transform:uppercase}
.revenue-invoice-ledger>div{grid-template-columns:minmax(220px,1.4fr) repeat(3,minmax(110px,.65fr)) auto!important;align-items:center}.revenue-invoice-ledger>div>span{display:grid;gap:3px}.revenue-invoice-ledger>div>span:first-child>b{text-align:left}.invoice-payment-status{justify-self:end;padding:6px 9px;border-radius:999px;background:var(--ui-surface-subtle);color:var(--muted);font-size:10px;font-style:normal;font-weight:750;text-transform:capitalize}.invoice-payment-status.paid{background:color-mix(in srgb,var(--green) 14%,var(--ui-surface));color:var(--green)}.invoice-payment-status.part_paid{background:color-mix(in srgb,#b57b32 14%,var(--ui-surface));color:#8a5b21}.invoice-payment-status.unpaid{background:color-mix(in srgb,#a64f43 12%,var(--ui-surface));color:#8f4036}@media(max-width:760px){.revenue-invoice-ledger>div{grid-template-columns:1fr 1fr!important}.revenue-invoice-ledger>div>span:first-child{grid-column:1/-1}.revenue-invoice-ledger>div>span:first-child>b{grid-column:auto;grid-row:auto}.invoice-payment-status{justify-self:start}}
.invoice-history-view{display:grid;gap:var(--ui-space-4)}.invoice-history-head{display:flex;justify-content:space-between;align-items:end;gap:var(--ui-space-4)}.invoice-history-head h3{margin:2px 0 4px}.invoice-history-head p{margin:0;color:var(--muted)}.invoice-history-tools{display:flex;align-items:center;justify-content:space-between;gap:12px}.invoice-history-filter{display:flex;padding:3px;border:1px solid var(--ui-border);border-radius:999px;background:var(--ui-surface-subtle)}.invoice-history-filter button{min-height:34px;padding:0 12px;border:0;border-radius:999px;background:transparent;color:var(--muted);font-weight:750}.invoice-history-filter button.active{background:var(--ui-surface);color:var(--ink);box-shadow:var(--ui-shadow-sm)}.invoice-history-filter b{margin-left:5px}.invoice-history-search input{width:min(320px,42vw);min-height:40px}.invoice-history-cards{display:grid;gap:10px}.invoice-history-card{display:grid;grid-template-columns:minmax(240px,1.35fr) minmax(110px,.55fr) minmax(125px,.6fr) minmax(105px,.5fr) auto;align-items:center;gap:16px;padding:14px 16px;border:1px solid var(--ui-border);border-radius:var(--ui-radius-lg);background:var(--ui-surface);box-shadow:var(--ui-shadow-sm)}.invoice-history-card>span{min-width:0}.invoice-history-id,.invoice-history-date,.invoice-history-amount{display:grid;gap:4px}.invoice-history-id b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.invoice-history-id small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--muted)}.invoice-history-date small,.invoice-history-amount small{color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.06em}.invoice-payment-state{justify-self:start;padding:6px 9px;border-radius:999px;background:var(--ui-surface-subtle);color:var(--muted);font-size:10px;font-weight:800}.invoice-payment-state.paid{background:color-mix(in srgb,var(--green) 14%,var(--ui-surface));color:var(--green)}.invoice-payment-state.part_paid{background:color-mix(in srgb,#b57b32 14%,var(--ui-surface));color:#8a5b21}.invoice-payment-state.unpaid{background:color-mix(in srgb,var(--ui-destructive) 12%,var(--ui-surface));color:var(--ui-destructive)}.invoice-history-actions{position:relative;display:flex;align-items:center;justify-content:end;gap:7px}.invoice-preview-action,.invoice-more-action{display:inline-flex;align-items:center;justify-content:center;min-height:38px;padding:0 11px;border:1px solid var(--ui-border);border-radius:var(--ui-radius-sm);background:var(--ui-surface);color:var(--ink);font-weight:750;text-decoration:none}.invoice-preview-action:focus-visible,.invoice-more-action:focus-visible,.invoice-more-menu :focus-visible{outline:2px solid var(--ui-accent);outline-offset:2px}.invoice-more-menu{position:absolute;z-index:20;right:0;top:calc(100% + 6px);display:grid;min-width:190px;padding:6px;border:1px solid var(--ui-border);border-radius:var(--ui-radius-sm);background:var(--ui-surface);box-shadow:var(--ui-shadow-lg)}.invoice-more-menu[hidden]{display:none}.invoice-more-menu button,.invoice-more-menu a{min-height:38px;padding:8px 10px;border:0;border-radius:7px;background:transparent;color:var(--ink);text-align:left;text-decoration:none}.invoice-more-menu button:hover,.invoice-more-menu a:hover{background:var(--ui-surface-subtle)}@media(max-width:980px){.invoice-history-card{grid-template-columns:minmax(220px,1fr) repeat(2,minmax(110px,.55fr)) auto}.invoice-payment-state{grid-column:2}.invoice-history-actions{grid-column:4;grid-row:1/3}}@media(max-width:650px){.invoice-history-head,.invoice-history-tools{align-items:stretch;flex-direction:column}.invoice-history-search input{width:100%}.invoice-history-card{grid-template-columns:1fr 1fr;gap:12px}.invoice-history-id{grid-column:1/-1}.invoice-history-actions{grid-column:1/-1;grid-row:auto;justify-content:stretch}.invoice-preview-action,.invoice-more-action{flex:1;min-height:44px}.invoice-payment-state{grid-column:auto}.invoice-more-menu{left:0;right:0}.invoice-history-filter{align-self:start}}
/* Invoice-history controls: scoped Office treatment and dark-theme contrast. */
.invoice-history-search input{padding:0 13px;border:1px solid var(--ui-border);border-radius:var(--ui-radius-sm);background:var(--ui-surface);color:var(--ink);font:inherit;box-shadow:var(--ui-shadow-sm);appearance:none;-webkit-appearance:none}
.invoice-history-search input::placeholder{color:var(--muted);opacity:1}
.invoice-history-search input:focus-visible{outline:2px solid var(--ui-accent);outline-offset:2px}
[data-theme="dark"] .invoice-history-search input::placeholder{color:#bec4ce}
[data-theme="dark"] .invoice-payment-state{background:#30343a;color:#e5e7eb}
[data-theme="dark"] .invoice-payment-state.paid{background:#173c2c;color:#a7e9bf}
[data-theme="dark"] .invoice-payment-state.part_paid{background:#4a351f;color:#ffd6a1}
[data-theme="dark"] .invoice-payment-state.unpaid,[data-theme="dark"] .invoice-payment-state.cancelled,[data-theme="dark"] .invoice-payment-state.void{background:#482a2a;color:#ffb8b2}
.invoice-more-menu.opens-up{top:auto;bottom:calc(100% + 6px)}

/* Project summary: disjoint status groups; labels remain readable without color. */
.portfolio-track .non-profit,.portfolio-legend i.non-profit { background:#786695; }
.portfolio-track .other,.portfolio-legend i.other { background:#77716c; }
.portfolio-legend { flex-wrap:wrap; row-gap:10px; }

/* The view controls change display only, not assignments or project records. */
.project-view-controls{display:flex;flex-wrap:wrap;align-items:end;gap:10px 16px;margin:12px 0 14px}
.project-view-controls label{display:grid;gap:5px;min-inline-size:0;max-inline-size:100%}
.project-view-controls label span{color:var(--muted);font-size:.72rem;font-weight:700}
.project-view-controls select{box-sizing:border-box;min-height:38px;max-inline-size:100%;padding:7px 10px;border:1px solid var(--ui-border);border-radius:8px;background:var(--ui-surface);color:inherit;font:inherit;font-size:.82rem}
.project-view-controls select:focus-visible{outline:2px solid currentColor;outline-offset:2px}
.project-assignee-groups{display:grid;gap:12px;min-width:0}
@media(max-width:520px){.project-view-controls label{flex:1 1 135px}.project-view-controls select{width:100%}}

/* Projects views: the same rows and controls, with no financial cells. */
#project-register .project-assignee-cell:not([data-unassigned="true"]) select {
  --person-color:hsl(var(--assignee-hue) 59% 45%);
  border-color:color-mix(in srgb,var(--person-color) 44%,var(--ui-border));
  background:color-mix(in srgb,var(--person-color) 11%,var(--ui-surface));
  box-shadow:inset 3px 0 var(--person-color);
  padding-inline-start:12px;
}
#project-register .project-person-group:not([data-unassigned="true"]) h3:before {
  content:"";display:inline-block;width:.62em;height:.62em;margin-inline-end:.55em;border-radius:50%;
  background:hsl(var(--assignee-hue) 59% 45%);
}
#project-register .project-admin-row {
  grid-template-columns:22px 76px minmax(140px,1fr) minmax(112px,.55fr) 104px minmax(106px,.6fr) 126px;
  grid-template-areas:"check code identity assignee status progress actions";gap:10px;
}
#project-register .project-admin-row .project-select{grid-area:check}
#project-register .project-admin-row .project-number{grid-area:code}
#project-register .project-admin-row .project-identity-cell{grid-area:identity;display:grid}
#project-register .project-admin-row .project-assignee-cell{grid-area:assignee}
#project-register .project-admin-row .project-status-select{grid-area:status}
#project-register .project-admin-row .project-state-stack{grid-area:progress}
#project-register .project-admin-row .project-row-actions{grid-area:actions;flex-direction:row}
#project-register .project-admin-row :is(.project-status-select,.project-state-stack,.project-assignee-cell select){min-width:0;width:100%}
@media(max-width:1200px){
  #project-register .project-admin-row {
    grid-template-columns:22px 76px minmax(0,1fr) 120px;
    grid-template-areas:"check code identity actions" ". assignee assignee actions" ". status progress actions";
  }
}
@media(max-width:650px){
  #project-register .project-admin-row {
    grid-template-columns:22px minmax(0,1fr) minmax(0,1fr);
    grid-template-areas:"check code status" "identity identity identity" "assignee assignee progress" "actions actions actions";
  }
}
#project-register:is([data-project-layout="cards"],[data-project-layout="gallery"]) .project-register-grid{
  grid-template-columns:repeat(auto-fill,minmax(min(100%,265px),1fr));align-items:stretch;gap:12px;
}
#project-register:is([data-project-layout="cards"],[data-project-layout="gallery"]) .project-admin-row {
  grid-template-columns:22px minmax(0,1fr) minmax(0,1fr);
  grid-template-areas:"check code status" "identity identity identity" "assignee assignee assignee" "progress progress progress" "actions actions actions";
  align-content:start;min-width:0;
}
#project-register[data-project-layout="gallery"] .project-admin-row {
  grid-template-areas:"cover cover cover" "check code status" "identity identity identity" "assignee assignee assignee" "progress progress progress" "actions actions actions";
}
#project-register .project-gallery-cover{
  grid-area:cover;min-block-size:125px;display:flex;flex-direction:column;justify-content:end;align-items:start;gap:2px;
  border-radius:8px;padding:12px;text-decoration:none;color:var(--ink);
  background:linear-gradient(140deg,color-mix(in srgb,hsl(var(--assignee-hue) 49% 50%) 28%,var(--ui-surface)),var(--ui-surface-subtle) 85%);
}
#project-register .project-gallery-cover[data-unassigned="true"]{background:var(--ui-surface-subtle)}
#project-register .project-gallery-cover>span{font-size:2rem;line-height:1;font-weight:720}
#project-register .project-gallery-cover>small{font-size:.72rem;letter-spacing:.05em}
#revenue-portfolio:not(:empty){display:grid;gap:12px;margin:0 0 24px}
#revenue-portfolio .revenue-portfolio{margin:0}
#revenue-portfolio .portfolio-heading h3{margin:.3rem 0 0}
.revenue-project-finance summary{cursor:pointer;font-weight:700}
.revenue-project-finance summary>span{float:right;color:var(--muted);font-size:.75rem}
.revenue-project-finance .revenue-invoices{margin-top:12px}
.revenue-project-finance .revenue-invoices>div{grid-template-columns:repeat(3,minmax(0,1fr));column-gap:10px}
@media(max-width:590px){.revenue-project-finance .revenue-invoices>div{grid-template-columns:1fr}}

/* Optional grouping preset beside the existing Projects status tabs. */
.project-status-row{display:flex;align-items:flex-end;gap:12px;min-width:0}
.project-status-row>.project-status-tabs{flex:1 1 620px;min-width:0;margin-right:0}
.project-group-assignee-chip{flex:0 0 auto;min-height:42px;margin:20px 0 4px;padding:0 14px;border:1px solid var(--ui-border);border-radius:999px;background:var(--ui-surface);color:var(--muted);font:700 10px var(--sans);cursor:pointer;white-space:nowrap}
.project-group-assignee-chip[aria-pressed="true"]{border-color:var(--accent);background:var(--accent);color:#fff}
.project-group-assignee-chip:focus-visible{outline:2px solid currentColor;outline-offset:2px}
@media(max-width:720px){.project-status-row{align-items:stretch;flex-direction:column;gap:8px}.project-status-row>.project-status-tabs{flex-basis:auto;width:100%;margin-bottom:0}.project-group-assignee-chip{align-self:flex-end;margin:0 0 4px}}
.revenue-project-finance .revenue-invoices>div>span:first-child{display:grid;gap:3px}
