/* ÉpítRend UI/UX redesign v1 — visible mobile-first system layer.
   Presentation-only overrides; preserves existing application behavior and data flows. */
:root {
  --ui-on-accent: #ffffff;
  --er-redesign-bg: #f3f6f8;
  --er-redesign-surface: #ffffff;
  --er-redesign-ink: #172b3a;
  --er-redesign-muted: #627584;
  --er-redesign-line: #dce5e9;
  --er-redesign-accent: #087f75;
  --er-redesign-accent-ink: #087f75;
  --er-redesign-accent-soft: #e5f4f1;
  --er-redesign-radius: 18px;
  --er-redesign-shadow: 0 8px 24px rgb(20 44 58 / 6%);
}
/* Semantic surfaces follow the same theme contract as the existing modules. */
:root[data-theme=dark], body.theme-dark {
  --ui-on-accent: #102c29;
  --er-redesign-bg: #0e1722;
  --er-redesign-surface: #151f2b;
  --er-redesign-ink: #e8f0f5;
  --er-redesign-muted: #a8b8c6;
  --er-redesign-line: #2d3b4b;
  --er-redesign-accent-ink: #7bd8c9;
  --er-redesign-accent-soft: #193a36;
  --er-redesign-shadow: none;
  /* Legacy neutral names resolve to the same V3 palette. */
  --card: var(--er-redesign-surface);
  --surface: var(--er-redesign-surface);
  --surface-2: var(--er-redesign-bg);
  --surface-muted: var(--er-redesign-bg);
  --er-surface: var(--er-redesign-surface);
  --er-surface-soft: var(--er-redesign-bg);
  --er-text: var(--er-redesign-ink);
  --er-muted: var(--er-redesign-muted);
  --er3-bg: var(--er-redesign-bg);
  --er3-surface: var(--er-redesign-surface);
  --er3-surface-soft: var(--er-redesign-bg);
  --er3-text: var(--er-redesign-ink);
  --er3-muted: var(--er-redesign-muted);
  --er3-border: var(--er-redesign-line);
  --uiux-warning-surface: #342b19;
  --uiux-warning-ink: #ecd5a0;

}
html { scroll-padding-top: 76px; }
body { background: var(--er-redesign-bg); color: var(--er-redesign-ink); }
#appView .main { min-width: 0; }
#appView .page-view { animation: er-redesign-enter .18s ease-out both; }
@keyframes er-redesign-enter { from { opacity: .75; transform: translateY(3px); } to { opacity: 1; transform: none; } }
#appView .page-header {
  align-items: center; gap: 18px; padding: 4px 0 20px;
  border-bottom: 1px solid var(--er-redesign-line); margin-bottom: 20px;
}
#appView .page-header h1 { letter-spacing: -.035em; font-size: clamp(1.55rem, 2.2vw, 2.15rem); line-height: 1.12; }
#appView .page-header .eyebrow { color: var(--er-redesign-accent-ink); font-weight: 850; letter-spacing: .09em; }
#appView .muted { color: var(--er-redesign-muted); }
#appView .toolbar {
  display: flex; align-items: end; flex-wrap: wrap; gap: 10px;
  padding: 14px; margin: 0 0 18px; border: 1px solid var(--er-redesign-line);
  border-radius: var(--er-redesign-radius); background: var(--er-redesign-surface);
  box-shadow: var(--er-redesign-shadow);
}
#appView .toolbar label { flex: 1 1 165px; min-width: 0; gap: 7px; font-size: 12px; font-weight: 800; color: var(--er-redesign-muted); }
#appView .toolbar input:not([type=checkbox]), #appView .toolbar select {
  min-height: 46px; border-radius: 12px; border: 1px solid #d5e0e5; background: #f9fbfc;
  color: var(--er-redesign-ink); padding: 10px 13px; box-shadow: none;
}
#appView .toolbar input:focus, #appView .toolbar select:focus { border-color: var(--er-redesign-accent); box-shadow: 0 0 0 3px rgb(8 127 117 / 12%); }
#appView .table-card, #appView .settings-card, #appView .section-box, #appView .finance-page-card,
#appView .quote-list-card, #appView .survey-list-card, #appView .widget {
  border: 1px solid var(--er-redesign-line); border-radius: var(--er-redesign-radius);
  box-shadow: var(--er-redesign-shadow); background: var(--er-redesign-surface);
}
#appView .modern-table thead th { color: #5c6f7b; background: #f5f8f9; font-size: 11px; letter-spacing: .055em; text-transform: uppercase; }
#appView .modern-table tbody tr { transition: background .15s ease, box-shadow .15s ease; }
#appView .modern-table tbody tr:hover { background: #f4faf9; }
#appView button, #appView .primary-btn, #appView .secondary-btn, #appView .small-btn {
  border-radius: 12px; font-weight: 750; transition: transform .14s ease, box-shadow .14s ease, background .14s ease;
}
#appView button:active { transform: scale(.985); }
#appView .primary-btn { background: var(--er-redesign-accent); box-shadow: 0 4px 10px rgb(8 127 117 / 15%); }
#appView .primary-btn:hover { background: #066b63; }
#appView .secondary-btn, #appView .small-btn { border-color: var(--er-redesign-line); }
#appView .status-pill { border-radius: 9px; font-weight: 800; }
#appView .modal, #appView .detail-modal { border-radius: 20px; box-shadow: 0 24px 80px rgb(8 25 37 / 24%); }
#appView .modal-head { padding: 18px 20px; }
#appView .modal-actions { gap: 10px; }
#appView input:focus-visible, #appView select:focus-visible, #appView textarea:focus-visible,
#appView button:focus-visible, #appView a:focus-visible { outline: 3px solid rgb(8 127 117 / 42%); outline-offset: 2px; }

/* Worker directory: a deliberately new, scannable card hierarchy on phones. */
#workersView > .toolbar { position: relative; }
#workersView #workerSearch { flex: 2 1 260px; }
#workersView #workersTable { min-width: 0; }
@media (min-width: 801px) {
  :is(#workersTable, #projectsTable) { overflow-x: auto; }
  :is(#workersTable, #projectsTable) :is(.worker-list-table, .project-list-table) { border-collapse: collapse; border-spacing: 0; }
  :is(#workersTable, #projectsTable) :is(.worker-list-table, .project-list-table) thead { display: table-header-group; }
  :is(#workersTable, #projectsTable) :is(.worker-list-table, .project-list-table) tbody td {
    padding: 6px 12px;
    border: 0;
    border-bottom: 1px solid var(--er-redesign-line);
    border-radius: 0;
    background: var(--er3-surface);
    color: var(--er3-text);
  }
  :is(#workersTable, #projectsTable) :is(.worker-list-table, .project-list-table) td[data-label="Szünet"] {
    text-align: end;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  :is(#workersTable, #projectsTable) :is(.worker-list-table, .project-list-table) .entity-link { overflow-wrap: anywhere; }
}
#workersView .worker-list-table .entity-link { display: grid; gap: 4px; }
#workersView .worker-list-table .entity-link strong { color: #08776f; font-size: 15px; letter-spacing: -.01em; }
#workersView .worker-list-table .entity-link span { color: var(--er-redesign-muted); font-size: 12px; }
#workersView .worker-list-table td[data-label]::before { color: #71818b; font-size: 10px; letter-spacing: .08em; font-weight: 850; }
#workersView .worker-list-table .table-actions { display: flex; flex-wrap: wrap; gap: 7px; }
#workersView .worker-list-table .table-actions .small-btn { min-height: 40px; padding: 8px 12px; background: #f5faf9; }
.mobile-bottom-nav {
  padding-bottom: max(6px, env(safe-area-inset-bottom));
  min-height: calc(72px + env(safe-area-inset-bottom));
  background: rgb(19 35 52 / 97%); border-top: 1px solid rgb(255 255 255 / 10%);
  box-shadow: 0 -8px 28px rgb(14 32 46 / 14%); backdrop-filter: blur(18px);
}
.mobile-bottom-nav .mobile-bottom-item { min-height: 60px; }
.mobile-bottom-nav .mobile-bottom-plus span { width: 46px; height: 46px; background: var(--er-redesign-accent); box-shadow: 0 7px 20px rgb(8 127 117 / 28%); }
.mobile-bottom-nav .mobile-bottom-item[aria-current=page], .mobile-bottom-nav .mobile-bottom-item.active { color: #8ce1d4; }
.mobile-topbar { padding-top: max(8px, env(safe-area-inset-top)); }
@media (max-width: 800px) {
  #appView .main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  #appView .page-view { padding-left: 0; padding-right: 0; }
  #appView .page-header { align-items: stretch; flex-direction: column; gap: 12px; padding-bottom: 16px; margin-bottom: 15px; }
  #appView .page-header .header-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; }
  #appView .page-header .header-actions > button { min-width: 0; width: 100%; min-height: 44px; }
  #appView .toolbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 9px; padding: 12px; margin-bottom: 14px; }
  #appView .toolbar > *, #appView .toolbar label { width: 100%; min-width: 0; box-sizing: border-box; }
  #appView .toolbar input:not([type=checkbox]), #appView .toolbar select { width: 100%; min-width: 0; min-height: 48px; font-size: 16px; }
  #appView .table-card { overflow: visible; }
  /* Keep legacy per-module mobile table layouts: global grid overrides broke project and inventory cards. */
  #workersView .worker-list-table { display: block; width: 100%; border-spacing: 0 10px; }
  #workersView .worker-list-table thead { display: none !important; }
  #workersView .worker-list-table tbody { display: block; }
  #workersView .worker-list-table tbody tr {
    display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 4px 12px; padding: 13px; margin-bottom: 12px; border: 1px solid var(--er-redesign-line);
    border-radius: 16px; background: var(--er-redesign-surface); box-shadow: var(--er-redesign-shadow);
  }
  #workersView .worker-list-table tbody td {
    display: flex !important; flex-direction: column; gap: 5px; min-width: 0; width: auto !important;
    padding: 9px 0; border: 0 !important; border-bottom: 1px solid #edf1f3 !important;
    background: transparent !important; overflow-wrap: anywhere; font-size: 13px; line-height: 1.4;
  }
  #workersView .worker-list-table tbody td::before {
    content: attr(data-label); display: block; color: #71818b; font-size: 10px;
    font-weight: 850; letter-spacing: .08em; text-transform: uppercase;
  }
  #workersView .worker-list-table tbody td:first-child { grid-column: 1 / -1; }
  #workersView .worker-list-table tbody td:last-child { grid-column: 1 / -1; border-bottom: 0 !important; }
  #workersView .worker-list-table .table-actions { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 8px; }
  #workersView .worker-list-table .table-actions > button { min-width: 0; min-height: 44px; width: 100%; }
  /* Project cards: force each grid row to grow to its full content height.
     Earlier module-specific rules leave the row height dependent on table defaults,
     which can place the next project over the action buttons on iPhone widths. */
  #projectsTable .project-list-table { display: block !important; width: 100% !important; height: auto !important; }
  #projectsTable .project-list-table tbody {
    display: grid !important; grid-auto-flow: row !important; grid-auto-rows: max-content !important;
    align-content: start !important; align-items: stretch !important; gap: 14px !important;
    width: 100% !important; height: auto !important;
  }
  #projectsTable .project-list-table tbody tr {
    display: grid !important; position: relative !important; float: none !important;
    height: auto !important; min-height: 0 !important; max-height: none !important;
    grid-auto-rows: max-content !important; align-content: start !important; align-items: start !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 10px 12px !important; width: 100% !important; min-width: 0 !important;
    box-sizing: border-box !important; margin: 0 !important; padding: 14px !important;
    overflow: visible !important;
  }
  #projectsTable .project-list-table tbody td {
    position: static !important; float: none !important; height: auto !important;
    min-height: 0 !important; max-height: none !important; align-self: start !important;
    box-sizing: border-box !important; min-width: 0 !important; width: auto !important;
    margin: 0 !important; padding: 8px 0 !important; line-height: 1.4 !important;
    overflow: visible !important; overflow-wrap: anywhere !important;
  }
  #projectsTable .project-list-table tbody td:first-child { grid-column: 1 / -1 !important; padding-top: 0 !important; }
  #projectsTable .project-list-table tbody td:nth-child(2) { grid-column: 1 !important; }
  #projectsTable .project-list-table tbody td:nth-child(3) { grid-column: 2 !important; }
  #projectsTable .project-list-table tbody td:nth-child(4) { grid-column: 1 / -1 !important; }
  #projectsTable .project-list-table tbody td:nth-child(5) { grid-column: 1 !important; }
  #projectsTable .project-list-table tbody td:nth-child(6) { grid-column: 2 !important; }
  #projectsTable .project-list-table tbody td:nth-child(7) {
    grid-column: 1 / -1 !important; padding-top: 12px !important;
    border-top: 1px solid var(--er-redesign-line) !important;
  }
  #projectsTable .project-list-table tbody td:nth-child(7) .table-actions {
    position: static !important; display: grid !important; grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important; width: 100% !important; height: auto !important;
  }
  #projectsTable .project-list-table tbody td:nth-child(7) .table-actions > button {
    position: static !important; display: block !important; width: 100% !important;
    height: auto !important; min-height: 44px !important; max-height: none !important;
    margin: 0 !important; box-sizing: border-box !important; white-space: normal !important;
    line-height: 1.3 !important;
  }
  #appView .modal, #appView .detail-modal { width: calc(100vw - 16px); max-width: calc(100vw - 16px); max-height: calc(100dvh - 20px - env(safe-area-inset-top)); border-radius: 18px; }
}
@media (max-width: 420px) {
  #appView .page-header .header-actions { grid-template-columns: minmax(0, 1fr); }
  #workersView .worker-list-table tbody tr { padding: 12px; }
  #workersView .worker-list-table tbody td { font-size: 13px; }
}
:root[data-theme=dark] body, body.theme-dark { background: #0e1722; color: #e8f0f5; }
:root[data-theme=dark] #appView .toolbar, body.theme-dark #appView .toolbar,
:root[data-theme=dark] #appView .table-card, body.theme-dark #appView .table-card,
:root[data-theme=dark] #appView .settings-card, body.theme-dark #appView .settings-card,
:root[data-theme=dark] #appView .section-box, body.theme-dark #appView .section-box { background: #151f2b; border-color: #2d3b4b; }
:root[data-theme=dark] #appView .toolbar input, :root[data-theme=dark] #appView .toolbar select,
body.theme-dark #appView .toolbar input, body.theme-dark #appView .toolbar select { background: #101923; color: #e8f0f5; border-color: #354657; }
:root[data-theme=dark] #workersView .worker-list-table tbody tr,
body.theme-dark #workersView .worker-list-table tbody tr,
:root[data-theme=dark] #projectsTable .project-list-table tbody tr,
body.theme-dark #projectsTable .project-list-table tbody tr,
:root[data-theme=dark] .modern-table.mobile-card-table tbody tr,
body.theme-dark .modern-table.mobile-card-table tbody tr { background: #151f2b !important; border-color: #2d3b4b; }
:root[data-theme=dark] .modern-table.mobile-card-table tbody td,
body.theme-dark .modern-table.mobile-card-table tbody td { border-bottom-color: #293746 !important; color: #e8f0f5; }
@media (prefers-reduced-motion: reduce) { #appView .page-view, #appView button { animation: none !important; transition: none !important; } }


/* ÉpítRend ERP — Dashboard visual polish v2, 2026-10-19.
   Presentation-only. Scoped to the dashboard; no business logic or interactions changed. */
#appView #dashboardView {
  --dash-ink: var(--er-redesign-ink);
  --dash-muted: var(--er-redesign-muted);
  --dash-line: var(--er-redesign-line);
  --dash-accent: #087f75;
  --dash-surface: var(--er-redesign-surface);
}
#appView #dashboardView > .dashboard-header {
  position: relative;
  align-items: center;
  gap: 20px;
  margin: 0 0 24px;
  padding: 6px 0 22px;
  border-bottom: 1px solid var(--dash-line);
}
#appView #dashboardView > .dashboard-header > div:first-child {
  display: grid;
  gap: 7px;
}
#appView #dashboardView > .dashboard-header .eyebrow {
  font-size: 11px;
  letter-spacing: .12em;
  font-weight: 850;
  color: var(--dash-accent);
}
#appView #dashboardView > .dashboard-header h1 {
  margin: 0;
  color: var(--dash-ink);
  font-size: clamp(1.8rem, 2.8vw, 2.35rem);
  line-height: 1.08;
  letter-spacing: -.045em;
}
#appView #dashboardView > .dashboard-header #welcomeText {
  margin: 0;
  color: var(--dash-muted);
  font-size: 13px;
  line-height: 1.5;
}
#appView #dashboardView .dashboard-command-center {
  gap: 22px;
  padding: clamp(18px, 2.2vw, 28px);
  border: 1px solid var(--dash-line);
  border-radius: 16px;
  background: var(--dash-surface);
  box-shadow: 0 8px 26px rgb(23 43 58 / 5%);
}
#appView #dashboardView .dashboard-command-head {
  padding: 0 0 15px;
  border-bottom: 1px solid #eaf0f2;
}
#appView #dashboardView .dashboard-command-head .eyebrow {
  margin-bottom: 7px;
  color: var(--dash-accent);
  font-size: 10px;
  letter-spacing: .14em;
  font-weight: 900;
}
#appView #dashboardView .dashboard-command-head h2 {
  margin: 0 0 7px;
  color: var(--dash-ink);
  font-size: clamp(1.2rem, 1.8vw, 1.5rem);
  line-height: 1.2;
  letter-spacing: -.03em;
}
#appView #dashboardView .dashboard-command-head p {
  color: var(--dash-muted);
  font-size: 13px;
  line-height: 1.5;
}
#appView #dashboardView .dashboard-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
#appView #dashboardView .dashboard-kpi {
  position: relative;
  min-height: 102px;
  align-content: center;
  gap: 6px;
  padding: 16px 17px;
  border: 1px solid var(--dash-line);
  border-radius: 12px;
  background: #f8fafb;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
#appView #dashboardView .dashboard-kpi:hover {
  border-color: #b9d6d1;
  box-shadow: 0 5px 16px rgb(23 43 58 / 6%);
  transform: translateY(-1px);
}
#appView #dashboardView .dashboard-kpi span {
  color: #647786;
  font-size: 11px;
  letter-spacing: .015em;
}
#appView #dashboardView .dashboard-kpi strong {
  color: var(--dash-ink);
  font-size: clamp(25px, 2vw, 30px);
  line-height: 1.05;
  font-weight: 800;
}
#appView #dashboardView .dashboard-kpi small {
  color: #788894;
  font-size: 11px;
}
#appView #dashboardView .dashboard-v3-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
  gap: 16px;
}
#appView #dashboardView .dashboard-brief-grid {
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  grid-template-areas: "planning events";
  align-items: start;
}
#appView #dashboardView .dashboard-brief-grid .dashboard-planning-column { grid-area: planning; display: grid; gap: 16px; min-width: 0; }
#appView #dashboardView .dashboard-brief-grid .dashboard-events-card { grid-area: events; }
#appView #dashboardView .dashboard-outlook-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#appView #dashboardView .dashboard-outlook-grid:has(> :only-child) { grid-template-columns: minmax(0, 1fr); }
#appView #dashboardView .dashboard-priority-list { margin-bottom: 8px; }
#appView #dashboardView .dashboard-project-more summary {
  border-color: var(--dash-line);
  color: var(--dash-ink);
}
@media (max-width: 1000px) {
  #appView #dashboardView .dashboard-brief-grid { grid-template-areas: "events" "planning"; }
  #appView #dashboardView .dashboard-outlook-grid { grid-template-columns: minmax(0, 1fr); }
}
#appView #dashboardView .dashboard-v3-card,
#appView #dashboardView .dashboard-focus,
#appView #dashboardView .dashboard-today,
#appView #dashboardView .dashboard-finance-watch,
#appView #dashboardView #dashboardCashflow,
#appView #dashboardView .dashboard-quick-notes {
  min-width: 0;
  padding: 19px;
  border: 1px solid var(--dash-line);
  border-radius: 14px;
  background: var(--dash-surface);
  box-shadow: 0 4px 16px rgb(23 43 58 / 3%);
}
#appView #dashboardView .dashboard-v3-card .section-title-line,
#appView #dashboardView .dashboard-focus .section-title-line,
#appView #dashboardView .dashboard-today .section-title-line,
#appView #dashboardView .dashboard-finance-watch .section-title-line,
#appView #dashboardView #dashboardCashflow .section-title-line,
#appView #dashboardView .dashboard-quick-notes .section-title-line {
  min-height: 36px;
  margin-bottom: 12px;
  padding-bottom: 11px;
  border-bottom: 1px solid #eaf0f2;
  color: var(--dash-ink);
  font-size: 13px;
  letter-spacing: -.01em;
}
#appView #dashboardView .section-title-line small {
  color: #7a8a96;
  font-size: 10px;
  text-align: right;
}
#appView #dashboardView .dashboard-focus-action,
#appView #dashboardView .dashboard-section-link {
  min-height: 44px;
  border-radius: 9px;
  font-size: 12px;
}
#appView #dashboardView .dashboard-focus-action {
  border-color: #dbe5e8;
  background: #f7fafb;
  color: #294453;
}
#appView #dashboardView .dashboard-focus-action:hover {
  border-color: #a9cec8;
  background: #edf7f5;
}
#appView #dashboardView .dashboard-section-link {
  color: var(--dash-accent);
  font-weight: 800;
}
#appView #dashboardView .dashboard-project-row,
#appView #dashboardView .dashboard-watch-row,
#appView #dashboardView .dashboard-event-row {
  transition: background-color .14s ease, border-color .14s ease;
}
#appView #dashboardView .dashboard-project-row:hover,
#appView #dashboardView .dashboard-watch-row:hover,
#appView #dashboardView .dashboard-event-row:hover {
  background-color: #f5faf9;
}
#appView #dashboardView #dashboardCashflow {
  margin-top: 18px;
}
#appView #dashboardView .dashboard-quick-notes {
  margin-top: 18px;
}
#appView #dashboardView .dashboard-finance-summary-grid > div {
  border-radius: 10px;
  border-color: #dfe7eb;
  background: #f7fafb;
}
#appView #dashboardView .dashboard-empty-focus {
  border-radius: 9px;
  background: #f8fafb;
}
body.theme-dark #appView #dashboardView > .dashboard-header h1,
body.theme-dark #appView #dashboardView .dashboard-command-head h2,
body.theme-dark #appView #dashboardView .dashboard-v3-card .section-title-line,
body.theme-dark #appView #dashboardView .dashboard-focus .section-title-line,
body.theme-dark #appView #dashboardView .dashboard-today .section-title-line,
body.theme-dark #appView #dashboardView .dashboard-finance-watch .section-title-line {
  color: #edf3f8 !important;
}
body.theme-dark #appView #dashboardView > .dashboard-header,
body.theme-dark #appView #dashboardView .dashboard-command-head,
body.theme-dark #appView #dashboardView .dashboard-v3-card .section-title-line,
body.theme-dark #appView #dashboardView .dashboard-focus .section-title-line,
body.theme-dark #appView #dashboardView .dashboard-today .section-title-line,
body.theme-dark #appView #dashboardView .dashboard-finance-watch .section-title-line {
  border-color: #2b3a49 !important;
}
body.theme-dark #appView #dashboardView .dashboard-kpi,
body.theme-dark #appView #dashboardView .dashboard-empty-focus,
body.theme-dark #appView #dashboardView .dashboard-finance-summary-grid > div {
  background: #192536 !important;
  border-color: #324256 !important;
}
body.theme-dark #appView #dashboardView .dashboard-kpi span,
body.theme-dark #appView #dashboardView .dashboard-kpi small,
body.theme-dark #appView #dashboardView .section-title-line small {
  color: #a6b5c4 !important;
}
body.theme-dark #appView #dashboardView .dashboard-focus-action {
  background: #192536 !important;
  color: #d9e5ef !important;
  border-color: #324256 !important;
}
@media (max-width: 1000px) {
  #appView #dashboardView .dashboard-v3-main-grid { grid-template-columns: minmax(0, 1fr); }
  #appView #dashboardView .dashboard-kpi { min-height: 94px; }
}
@media (max-width: 700px) {
  #appView #dashboardView > .dashboard-header { padding: 2px 14px 17px; margin-bottom: 15px; }
  #appView #dashboardView .dashboard-command-center { padding: 17px 13px; border-radius: 0; border-left: 0; border-right: 0; gap: 17px; }
  #appView #dashboardView .dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  #appView #dashboardView .dashboard-kpi { min-height: 88px; padding: 12px; }
  #appView #dashboardView .dashboard-kpi strong { font-size: 24px; }
  #appView #dashboardView .dashboard-v3-card,
  #appView #dashboardView .dashboard-focus,
  #appView #dashboardView .dashboard-today,
  #appView #dashboardView .dashboard-finance-watch,
  #appView #dashboardView #dashboardCashflow,
  #appView #dashboardView .dashboard-quick-notes { padding: 14px; }
  #appView #dashboardView #dashboardCashflow,
  #appView #dashboardView .dashboard-quick-notes { margin-top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  #appView #dashboardView .dashboard-kpi,
  #appView #dashboardView .dashboard-project-row,
  #appView #dashboardView .dashboard-watch-row,
  #appView #dashboardView .dashboard-event-row { transition: none !important; }
}


/* ÉpítRend ERP — visible dashboard hierarchy v3, 2026-10-19.
   Presentation-only; preserves existing actions, data and business rules. */
#appView #dashboardView > .dashboard-header {
  padding-bottom: 24px;
  border-bottom: 2px solid #d6e3e7;
}
#appView #dashboardView > .dashboard-header .eyebrow {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 6px 10px;
  border-radius: 5px;
  background: #e3f3f0;
  color: #08766d;
  letter-spacing: .09em;
}
#appView #dashboardView .dashboard-command-center {
  border: 1px solid #cddde2;
  border-top: 4px solid #16877d;
  border-radius: 16px;
  background: linear-gradient(145deg, #f4f8fa 0%, #edf4f5 100%);
  box-shadow: 0 10px 28px rgb(24 54 68 / 9%);
}
#appView #dashboardView .dashboard-command-head {
  padding-bottom: 17px;
  border-bottom: 2px solid #d8e5e8;
}
#appView #dashboardView .dashboard-kpis {
  gap: 14px;
}
#appView #dashboardView .dashboard-kpi {
  min-height: 116px;
  padding: 18px 18px 17px;
  border: 1px solid #d3e0e5;
  border-top: 4px solid #16877d;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 3px 9px rgb(24 54 68 / 5%);
}
#appView #dashboardView .dashboard-kpi:nth-child(2) {
  border-top-color: #4779a8;
}
#appView #dashboardView .dashboard-kpi:nth-child(3) {
  border-top-color: #c28a2b;
}
#appView #dashboardView .dashboard-kpi:nth-child(4) {
  border-top-color: #7c69ad;
}
#appView #dashboardView .dashboard-kpi.attention {
  background: #fffaf0;
  border-color: #e8d7a8;
  border-top-color: #c28a2b;
}
#appView #dashboardView .dashboard-kpi.active {
  background: #f1f8fc;
  border-top-color: #4779a8;
}
#appView #dashboardView .dashboard-kpi span {
  color: #4c6271;
  font-size: 12px;
  font-weight: 800;
}
#appView #dashboardView .dashboard-kpi strong {
  font-size: clamp(29px, 2.3vw, 35px);
  letter-spacing: -.045em;
}
#appView #dashboardView .dashboard-kpi:hover {
  border-color: #8ebeb7;
  border-top-color: #08766d;
  box-shadow: 0 9px 20px rgb(24 54 68 / 12%);
  transform: translateY(-3px);
}
#appView #dashboardView .dashboard-v3-card,
#appView #dashboardView .dashboard-focus,
#appView #dashboardView .dashboard-today,
#appView #dashboardView .dashboard-finance-watch,
#appView #dashboardView #dashboardCashflow,
#appView #dashboardView .dashboard-quick-notes {
  border-color: #d3dfe4;
  border-radius: 13px;
  box-shadow: 0 5px 16px rgb(24 54 68 / 6%);
}
#appView #dashboardView .dashboard-v3-card .section-title-line,
#appView #dashboardView .dashboard-focus .section-title-line,
#appView #dashboardView .dashboard-today .section-title-line,
#appView #dashboardView .dashboard-finance-watch .section-title-line,
#appView #dashboardView #dashboardCashflow .section-title-line,
#appView #dashboardView .dashboard-quick-notes .section-title-line {
  border-bottom: 2px solid #e0e9ec;
  font-size: 14px;
  font-weight: 850;
}
#appView #dashboardView .dashboard-focus-action {
  min-height: 46px;
  border: 1px solid #d1dfe4;
  border-left: 3px solid #16877d;
  border-radius: 8px;
  background: #fff;
}
#appView #dashboardView .dashboard-focus-action:hover {
  border-color: #91bfb9;
  border-left-color: #08766d;
  background: #edf7f5;
  box-shadow: 0 4px 10px rgb(24 54 68 / 7%);
}
@media (max-width: 700px) {
  #appView #dashboardView .dashboard-command-center {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    padding: 17px 13px;
  }
  #appView #dashboardView .dashboard-kpis { gap: 10px; }
  #appView #dashboardView .dashboard-kpi {
    min-height: 100px;
    padding: 13px 12px;
  }
  #appView #dashboardView .dashboard-kpi strong { font-size: 27px; }
}
:root[data-theme="dark"] #appView #dashboardView .dashboard-command-center,
body.theme-dark #appView #dashboardView .dashboard-command-center {
  background: linear-gradient(145deg, #182535 0%, #1b2b3a 100%) !important;
  border-color: #344a5b !important;
  border-top-color: #36a99d !important;
}
:root[data-theme="dark"] #appView #dashboardView .dashboard-kpi,
body.theme-dark #appView #dashboardView .dashboard-kpi {
  background: #192536 !important;
  border-color: #324256 !important;
  border-top-color: #36a99d !important;
}
:root[data-theme="dark"] #appView #dashboardView .dashboard-kpi:nth-child(2) { border-top-color: #75a9d7 !important; }
:root[data-theme="dark"] #appView #dashboardView .dashboard-kpi:nth-child(3) { border-top-color: #d6aa5c !important; }
:root[data-theme="dark"] #appView #dashboardView .dashboard-kpi:nth-child(4) { border-top-color: #aa9ad8 !important; }
:root[data-theme="dark"] #appView #dashboardView .dashboard-kpi.attention { background: #2d281c !important; }
:root[data-theme="dark"] #appView #dashboardView .dashboard-kpi.active { background: #1d2b35 !important; }
:root[data-theme="dark"] #appView #dashboardView .dashboard-focus-action,
body.theme-dark #appView #dashboardView .dashboard-focus-action {
  background: #192536 !important;
  border-color: #324256 !important;
  border-left-color: #36a99d !important;
}


/* ÉpítRend ERP — accessible, keyboard-safe dialogs and mobile modal sizing. */
dialog.modal[open] {
  max-height: 90vh;
  max-height: min(90dvh, calc(100dvh - 24px));
  overflow: auto;
  overscroll-behavior: contain;
}
dialog.modal[open] .modal-head h2,
dialog.modal[open] .modal-head h3 {
  overflow-wrap: anywhere;
}
@media (max-width: 700px) {
  dialog.modal[open] {
    width: calc(100vw - 16px);
    max-width: none;
    max-height: calc(100dvh - 16px);
    border-radius: 14px;
    margin: auto;
  }
  dialog.modal[open] > form {
    min-width: 0;
    padding: 16px;
  }
  dialog.modal[open] .modal-head {
    gap: 10px;
    align-items: flex-start;
  }
  dialog.modal[open] .modal-head .icon-btn {
    flex: 0 0 36px;
  }
  dialog.modal[open] .modal-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  dialog.modal[open] .modal-actions > * {
    width: 100%;
    min-width: 0;
    min-height: 44px;
  }
}


/* Dashboard refresh and KPI refinement — compact, neutral, mobile-first. */
#appView #dashboardView .dashboard-pull-refresh {
  --pull-distance: 0px;
  height: 0;
  margin: 0 auto;
  max-width: 520px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--er3-muted, #64748b);
  font-size: 13px;
  font-weight: 650;
  opacity: 0;
  transform: translateY(-4px);
  transition: height .16s ease, opacity .16s ease, transform .16s ease;
  pointer-events: none;
}
#appView #dashboardView .dashboard-pull-refresh.is-pulling,
#appView #dashboardView .dashboard-pull-refresh.is-refreshing {
  height: var(--pull-distance);
  opacity: 1;
  transform: translateY(0);
}
#appView #dashboardView .dashboard-pull-refresh.is-ready { color: var(--er3-accent, #087f72); }
#appView #dashboardView .dashboard-pull-refresh-icon {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
}
#appView #dashboardView .dashboard-pull-refresh.is-refreshing .dashboard-pull-refresh-icon {
  animation: dashboard-pull-spin .8s linear infinite;
}
@keyframes dashboard-pull-spin { to { transform: rotate(360deg); } }

/* The dashboard is an operational workspace, not a branded introduction card. */
#appView #dashboardView .dashboard-command-center {
  padding-top: 16px;
  background: var(--er3-surface, #fff);
  border: 1px solid var(--er3-border, #dbe4e8);
  border-top: 1px solid var(--er3-border, #dbe4e8);
  border-radius: 14px;
  box-shadow: none;
  gap: 16px;
}
#appView #dashboardView .dashboard-kpis { gap: 10px; }
#appView #dashboardView .dashboard-kpi {
  min-height: 94px;
  padding: 13px 15px;
  gap: 6px;
  border: 1px solid var(--er3-border, #dbe4e8);
  border-top: 1px solid var(--er3-border, #dbe4e8);
  border-radius: 12px;
  background: var(--er3-surface, #fff);
  box-shadow: none;
  transform: none;
}
#appView #dashboardView .dashboard-kpi:nth-child(2),
#appView #dashboardView .dashboard-kpi:nth-child(3),
#appView #dashboardView .dashboard-kpi:nth-child(4) {
  border-top-color: var(--er3-border, #dbe4e8);
}
#appView #dashboardView .dashboard-kpi span {
  color: var(--er3-muted, #64748b);
  font-size: 13px;
  font-weight: 650;
}
#appView #dashboardView .dashboard-kpi strong {
  color: var(--er3-text, #182b3a);
  font-size: clamp(27px, 2.3vw, 34px);
  line-height: 1.05;
}
#appView #dashboardView .dashboard-kpi small {
  color: var(--er3-muted, #64748b);
  font-size: 12px;
}
#appView #dashboardView .dashboard-kpi.attention {
  background: #fffaf0;
  border-color: #e8d7a8;
}
#appView #dashboardView .dashboard-kpi.active {
  background: var(--er3-surface, #fff);
  border-color: var(--er3-border, #dbe4e8);
}
#appView #dashboardView .dashboard-kpi:hover {
  border-color: var(--er3-border, #dbe4e8);
  border-top-color: var(--er3-border, #dbe4e8);
  box-shadow: 0 3px 10px rgb(24 54 68 / 6%);
  transform: none;
}
@media (max-width: 700px) {
  #appView #dashboardView .dashboard-command-center {
    padding: 12px 0 0;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    background: transparent;
  }
  #appView #dashboardView .dashboard-kpis { gap: 8px; }
  #appView #dashboardView .dashboard-kpi {
    min-height: 86px;
    padding: 11px 12px;
    border-radius: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #appView #dashboardView .dashboard-pull-refresh { transition: none; }
  #appView #dashboardView .dashboard-pull-refresh.is-refreshing .dashboard-pull-refresh-icon { animation: none; }
}

/* Mobile project detail: keep the entire dialog and its cards within the viewport. */
@media (max-width: 700px) {
  #detailDialog.detail-modal {
    box-sizing: border-box !important;
    width: calc(100vw - 12px) !important;
    max-width: calc(100vw - 12px) !important;
    min-width: 0 !important;
    max-height: calc(100dvh - 12px) !important;
    margin: auto !important;
    padding: 14px 10px 84px !important;
    overflow-x: hidden !important;
  }
  #detailDialog .modal-head,
  #detailDialog #detailBody,
  #detailDialog .detail-body,
  #detailDialog .project-detail-panel,
  #detailDialog .project-detail-card,
  #detailDialog .project-detail-overview-grid,
  #detailDialog .project-overview-kpis,
  #detailDialog .project-detail-hero {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  #detailDialog #detailBody { overflow-x: hidden !important; }
  #detailDialog .project-detail-tabs {
    display: flex !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: visible !important;
    white-space: normal !important;
    gap: 5px !important;
  }
  #detailDialog .project-detail-tab {
    min-width: 0 !important;
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    flex: 0 1 auto !important;
  }
  #detailDialog .project-detail-row,
  #detailDialog .project-detail-row > span,
  #detailDialog .project-detail-row strong,
  #detailDialog .project-detail-row small {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
  }
  #detailDialog .project-overview-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* Root cause fix: the stage track had a fixed 820px minimum width and the dialog body uses an implicit grid. */
@media (max-width: 700px) {
  #detailDialog,
  #detailDialog * { box-sizing: border-box !important; }
  #detailDialog {
    width: calc(100vw - 12px) !important;
    max-width: calc(100vw - 12px) !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
  }
  #detailDialog .detail-body {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
  #detailDialog .detail-body > * {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  #detailDialog .detail-metrics {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  #detailDialog .detail-metrics > * { min-width: 0 !important; max-width: 100% !important; overflow-wrap: anywhere !important; }
  #detailDialog .project-stage-flow {
    display: block !important;
    visibility: visible !important;
    position: relative !important;
    z-index: 1 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 14px 0 18px !important;
    padding: 14px 10px !important;
    overflow: visible !important;
    opacity: 1 !important;
  }
  #detailDialog .project-stage-head {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 0 12px !important;
    overflow: visible !important;
  }
  #detailDialog .project-stage-head > div,
  #detailDialog .project-stage-head .eyebrow,
  #detailDialog .project-stage-head strong { display: block !important; visibility: visible !important; height: auto !important; max-width: 100% !important; }
  #detailDialog .project-stage-head .project-stage-current { display: none !important; }
  #detailDialog .project-stage-scroll {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    padding: 2px 0 8px !important;
  }
  /* Flow-root + flex wrapping guarantees the card encloses all three rows. */
  #detailDialog .project-stage-flow {
    display: flow-root !important;
    height: auto !important;
    min-height: 0 !important;
    padding-bottom: 18px !important;
    overflow: visible !important;
  }
  #detailDialog .project-stage-track {
    display: flex !important;
    flex-flow: row wrap !important;
    align-content: flex-start !important;
    align-items: stretch !important;
    position: relative !important;
    height: auto !important;
    min-height: 0 !important;
    grid-template-columns: none !important;
    grid-template-rows: none !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: visible !important;
    gap: 14px 0 !important;
  }
  #detailDialog .project-stage-track:before {
    content: none !important;
    display: none !important;
  }
  #detailDialog .project-stage {
    display: flex !important;
    flex: 0 0 33.333333% !important;
    box-sizing: border-box !important;
    width: 33.333333% !important;
    min-width: 0 !important;
    max-width: 33.333333% !important;
    min-height: 62px !important;
    padding: 0 2px !important;
    position: relative !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    font-size: 10px !important;
    line-height: 1.25 !important;
  }
  #detailDialog .project-stage:not(:nth-child(3n))::after {
    content: '→' !important;
    display: block !important;
    position: absolute !important;
    right: -5px !important;
    top: 6px !important;
    color: #98a2b3 !important;
    font-size: 17px !important;
    line-height: 1 !important;
    font-weight: 800 !important;
  }
  #detailDialog .project-stage:nth-child(3n):not(:last-child)::after {
    content: '↙' !important;
    display: block !important;
    position: absolute !important;
    right: 10px !important;
    bottom: -13px !important;
    color: #98a2b3 !important;
    font-size: 15px !important;
    line-height: 1 !important;
    font-weight: 800 !important;
  }
  #detailDialog .project-detail-tabs {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: visible !important;
    white-space: normal !important;
  }
  #detailDialog .project-detail-tab {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 8px 3px !important;
    white-space: normal !important;
    text-align: center !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: auto !important;
    font-size: 10px !important;
    line-height: 1.25 !important;
  }
  /* Readable text wrapping without mid-word fragmentation. */
  #detailDialog .project-detail-row { align-items: flex-start !important; flex-wrap: wrap !important; gap: 5px 10px !important; }
  #detailDialog .project-detail-row > span { flex: 1 1 100% !important; overflow-wrap: break-word !important; word-break: normal !important; }
  #detailDialog .project-detail-row > strong { flex: 0 1 auto !important; max-width: 100% !important; text-align: left !important; overflow-wrap: break-word !important; word-break: normal !important; }
  #detailDialog .project-detail-note,
  #detailDialog .project-detail-card,
  #detailDialog .project-detail-card * { overflow-wrap: break-word !important; word-break: normal !important; }
  #detailDialog .project-detail-card .section-title-line { display: flex !important; flex-wrap: wrap !important; align-items: center !important; gap: 8px !important; }
  #detailDialog .project-detail-card .section-title-line > * { min-width: 0 !important; max-width: 100% !important; }
  /* Native dialog stays hidden while closed; flex layout applies only while open. */
  #detailDialog[open] { display: flex !important; flex-direction: column !important; }
  #detailDialog .detail-body { flex: 1 1 auto !important; min-height: 0 !important; max-height: none !important; overflow-y: auto !important; overflow-x: hidden !important; }
  #detailDialog .modal-actions { position: relative !important; inset: auto !important; flex: 0 0 auto !important; margin: 10px 0 0 !important; padding: 10px 0 max(8px, env(safe-area-inset-bottom)) !important; background: #fff !important; z-index: 5 !important; }
  #detailDialog .modal-actions > button { width: 100% !important; flex: 1 1 100% !important; }
}

/* Mobile worker-hours dialog: show each workday as a readable card, never a wide table. */
@media (max-width: 700px) {
  #workerHoursDialog {
    box-sizing: border-box !important;
    width: calc(100vw - 12px) !important;
    max-width: calc(100vw - 12px) !important;
    min-width: 0 !important;
    max-height: calc(100dvh - 16px) !important;
    padding: 12px !important;
    overflow-x: hidden !important;
  }
  #workerHoursDialog .modal-head,
  #workerHoursDialog .toolbar,
  #workerHoursDialog #workerHoursContent { min-width: 0 !important; max-width: 100% !important; }
  #workerHoursDialog .toolbar { display: grid !important; grid-template-columns: minmax(0,1fr) auto !important; align-items: end !important; gap: 8px !important; }
  #workerHoursDialog .toolbar label { min-width: 0 !important; }
  #workerHoursDialog .toolbar input,
  #workerHoursDialog .toolbar button { min-width: 0 !important; width: 100% !important; }
  #workerHoursDialog .worker-hours-summary { display: grid !important; grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 8px !important; }
  #workerHoursDialog .worker-hours-summary > div { min-width: 0 !important; padding: 12px !important; overflow-wrap: anywhere !important; }
  #workerHoursDialog .worker-hours-summary strong { font-size: clamp(18px,5vw,26px) !important; line-height: 1.2 !important; overflow-wrap: anywhere !important; }
  #workerHoursDialog .worker-hours-table-wrap { width: 100% !important; max-width: 100% !important; overflow: visible !important; }
  #workerHoursDialog .worker-hours-table,
  #workerHoursDialog .worker-hours-table tbody { display: block !important; width: 100% !important; min-width: 0 !important; }
  #workerHoursDialog .worker-hours-table thead { display: none !important; }
  #workerHoursDialog .worker-hours-table tr { display: grid !important; grid-template-columns: minmax(0,1fr) minmax(0,1fr) !important; gap: 0 12px !important; width: 100% !important; margin: 12px 0 !important; padding: 8px 12px !important; border: 1px solid #dfe5eb !important; border-radius: 14px !important; background: #fff !important; box-shadow: 0 2px 8px rgba(20,40,60,.04) !important; }
  #workerHoursDialog .worker-hours-table td { height: auto !important; display: flex !important; flex-direction: column !important; align-items: flex-start !important; justify-content: flex-start !important; gap: 4px !important; min-width: 0 !important; width: auto !important; padding: 9px 0 !important; border: 0 !important; font-size: 14px !important; line-height: 1.35 !important; overflow-wrap: anywhere !important; word-break: normal !important; }
  #workerHoursDialog .worker-hours-actions [data-close-workday] { grid-column: 1 / -1 !important; flex-basis: 100% !important; }
  #workerHoursDialog .worker-hours-table td::before { content: attr(data-label); color: #64748b; font-size: 11px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
  #workerHoursDialog .worker-hours-table td[data-label="Projekt"] { grid-column: 1 / -1 !important; }
  #workerHoursDialog .worker-hours-table td[data-label="Művelet"] { grid-column: 1 / -1 !important; }
  #workerHoursDialog .worker-hours-actions { display: flex !important; flex-wrap: wrap !important; gap: 8px !important; width: 100% !important; }
  #workerHoursDialog .worker-hours-actions button { flex: 1 1 110px !important; min-width: 0 !important; }
}
@media(max-width:650px){
  #workerHoursDialog .worker-hours-table tr{box-sizing:border-box!important;align-content:start!important;padding:12px 12px 18px!important;overflow:visible!important}
  #workerHoursDialog .worker-hours-table td[data-label="Művelet"]{box-sizing:border-box!important;min-width:0!important;padding:12px 0 8px!important;margin:0!important;align-self:stretch!important}
  #workerHoursDialog .worker-hours-actions{box-sizing:border-box!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;align-items:stretch!important;gap:10px!important;width:100%!important;min-width:0!important;margin:0!important}
  #workerHoursDialog .worker-hours-actions button{box-sizing:border-box!important;display:flex!important;align-items:center!important;justify-content:center!important;min-width:0!important;width:100%!important;min-height:48px!important;margin:0!important;padding:10px 8px!important;position:static!important;white-space:normal!important;overflow-wrap:anywhere!important}
}


/* Finance workflows reuse the central modal/grid styles; contain dynamic controls on narrow displays. */
.finance-workflow-dialog,
.finance-workflow-dialog form,
.finance-workflow-dialog fieldset {
  min-inline-size: 0;
  box-sizing: border-box;
}
.finance-workflow-dialog fieldset { max-inline-size: 100%; }
.finance-workflow-dialog legend,
.finance-workflow-dialog h2,
.finance-workflow-dialog small { overflow-wrap: anywhere; }
.finance-workflow-dialog legend { max-inline-size: 100%; }
.finance-workflow-dialog [hidden] { display: none; }
.finance-workflow-dialog [data-completion-payment] { border: 0; padding-inline: 0; }
.finance-workflow-dialog .section-box small { display: block; }

.finance-workflow-dialog .modal-actions > button {
  min-inline-size: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.bank-import-review td small {
  display: block;
  line-height: 1.45;
  margin-block-start: .25rem;
  overflow-wrap: anywhere;
}

/* Month close: contained names, separate money values and one shared category.
   Reuse the existing light/dark tokens; other finance dialogs keep their layouts. */
.salary-month-close-dialog .salary-close-workers { display: grid; gap: 14px; min-width: 0; }
.salary-month-close-dialog .salary-close-common { margin-block: 10px 16px; }
.salary-month-close-dialog .salary-close-common label { display: grid; min-width: 0; }
.salary-month-close-dialog .salary-close-worker { min-width: 0; max-width: 100%; margin: 0; padding: 14px; box-sizing: border-box; background: var(--uiux-surface); border: 1px solid var(--uiux-border); border-radius: var(--uiux-control-radius); }
.salary-month-close-dialog .salary-close-worker-header { display: grid; gap: 12px; min-width: 0; padding-bottom: 12px; border-bottom: 1px solid var(--uiux-border); }
.salary-month-close-dialog .salary-close-worker h3 { min-width: 0; max-width: 100%; margin: 0; font-size: 1.05rem; line-height: 1.4; overflow-wrap: anywhere; }
.salary-month-close-dialog .salary-close-payable { display: grid; gap: 4px; min-width: 0; }
.salary-month-close-dialog .salary-close-payable span { font-size: .85rem; }
.salary-month-close-dialog .salary-close-payable strong { font-size: 1.4rem; line-height: 1.25; overflow-wrap: anywhere; }
.salary-month-close-dialog .salary-close-amounts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 14px 0; }
.salary-month-close-dialog .salary-close-amounts > div { min-width: 0; }
.salary-month-close-dialog .salary-close-amounts dt { margin: 0 0 4px; font-size: .8rem; line-height: 1.4; overflow-wrap: anywhere; }
.salary-month-close-dialog .salary-close-amounts dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.salary-month-close-dialog .salary-close-payment-fields { display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; min-width: 0; margin-top: 12px; }
.salary-month-close-dialog .salary-close-worker label { min-width: 0; max-width: 100%; white-space: normal; }
.salary-month-close-dialog .salary-close-worker input,
.salary-month-close-dialog .salary-close-worker select { min-width: 0; max-width: 100%; box-sizing: border-box; }
@media(min-width:700px) {
 .salary-month-close-dialog .salary-close-worker-header { grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: start; }
 .salary-month-close-dialog .salary-close-payment-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

/* The long payroll-default action must not force the nested worker form wider on mobile. */
#workerDialog #workerTaxBenefitBtn { min-inline-size: 0; max-inline-size: 100%; white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }

/* Munkaóráim */
#workerHoursView {max-width:980px;margin-inline:auto;color:var(--er-redesign-ink);}
#workerHoursView .page-header {align-items:center;gap:12px;margin-bottom:12px;}
#workerHoursView .page-header h1 {margin:0;font-size:clamp(1.4rem,4vw,1.85rem);}
#workerHoursView :is(button,input,summary) {min-height:44px;}
#workerHoursPageStatus {margin:0 0 8px;}
#workerHoursPageStatus:empty {display:none;}
#workerHoursPageContent {display:grid;min-width:0;gap:10px;}
#workerHoursPageContent :is(.worker-hours-overview,.worker-hours-week,.worker-month-notice) {
  min-width:0;border:1px solid var(--er-redesign-line);border-radius:11px;background:var(--er-redesign-surface);
}
.worker-hours-overview {padding:12px 14px;}
.worker-hours-month-picker-row {display:flex;align-items:end;justify-content:space-between;gap:8px 12px;flex-wrap:wrap;}
.worker-hours-month-picker-row label {display:grid;gap:4px;min-width:0;color:var(--er-redesign-muted);font-size:.8125rem;}
#workerHoursMonthSelect {min-width:0;width:100%;max-width:100%;font-size:1rem;background:var(--er-redesign-bg);color:var(--er-redesign-ink);color-scheme:light;}
:root[data-theme="dark"] #workerHoursMonthSelect {color-scheme:dark;}
.worker-hours-month-picker-row button {display:inline-flex;align-items:center;gap:6px;max-width:100%;white-space:normal;}
.worker-hours-month-picker-row svg {width:18px;height:18px;flex:none;}
.worker-hours-metrics {display:grid;grid-template-columns:repeat(auto-fit,minmax(125px,1fr));gap:7px;margin:12px 0 6px;}
.worker-hours-metrics > div {display:grid;gap:3px;padding:8px 9px;border-radius:7px;background:var(--er-redesign-bg);}
.worker-hours-metrics .worker-hours-month-total {background:var(--er-redesign-accent-soft);color:var(--er-redesign-accent-ink);}
.worker-hours-metrics dt,.worker-hours-summary-note {margin:0;font-size:.8125rem;}
.worker-hours-metrics dd {margin:0;font-weight:700;font-variant-numeric:tabular-nums;}
.worker-hours-metrics strong {font-size:1.125rem;}
.worker-month-notice {display:grid;gap:6px;padding:10px 12px;color:var(--er-redesign-ink);border-inline-start:3px solid var(--uiux-warning-ink,#80551b)!important;}
#workerHoursPageContent .worker-hours-unclosed-block {margin:0;}
#workerHoursPageContent .worker-hours-missing-dates {display:flex;flex-wrap:wrap;gap:6px;margin:0;}
#workerHoursPageContent .worker-hours-missing-dates button {padding:4px 9px;font-size:.8125rem;}
#workerHoursPageContent .worker-hours-unclosed-detail :is(span,small) {color:var(--er-redesign-muted);}
#workerHoursPageContent :is(.worker-hours-week,.worker-hours-day) > summary {
  display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;align-items:center;gap:7px 10px;
  min-height:51px;padding:8px 11px;cursor:pointer;list-style:none;
}
#workerHoursPageContent :is(.worker-hours-week,.worker-hours-day) > summary::-webkit-details-marker {display:none;}
#workerHoursPageContent :is(.worker-hours-week,.worker-hours-day) > summary:focus-visible {outline:2px solid var(--er-redesign-accent-ink);outline-offset:-2px;border-radius:8px;}
#workerHoursPageContent :is(.worker-hours-week,.worker-hours-day) > summary span {min-width:0;overflow-wrap:anywhere;}
.worker-hours-week > summary :is(strong,time),.worker-hours-day > summary :is(strong,time) {display:block;font-weight:700;}
.worker-hours-week > summary small,.worker-hours-day > summary small {display:block;color:var(--er-redesign-muted);font-size:.75rem;line-height:1.3;}
.worker-hours-week-total,.worker-hours-day-state {text-align:right;font-variant-numeric:tabular-nums;}
.worker-hours-week-total strong {color:var(--er-redesign-accent-ink);}
.worker-hours-chevron {width:7px;height:7px;margin:0 3px 4px 2px;border:solid var(--er-redesign-muted);border-width:0 1.5px 1.5px 0;transform:rotate(45deg);}
:is(.worker-hours-week,.worker-hours-day)[open] > summary .worker-hours-chevron {margin-bottom:0;transform:rotate(225deg);}
.worker-hours-day {margin:0;border-top:1px solid var(--er-redesign-line);}
.worker-hours-day > summary {font-size:.875rem;}
.worker-hours-segments {list-style:none;display:grid;gap:6px;margin:0;padding:2px 10px 8px;}
.worker-hours-segment {display:grid;gap:6px;padding:7px 9px;border:1px solid var(--er-redesign-line);border-radius:7px;background:var(--er-redesign-bg);overflow-wrap:anywhere;}
.worker-hours-segment-head {display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:4px 10px;}
.worker-hours-segment-details,.worker-hours-request-preview {min-width:0;display:grid;gap:2px;}
.worker-hours-segment :is(span,small,p) {font-size:.8125rem;}
.worker-hours-state {color:var(--er-redesign-ink);font-weight:600;}
.worker-hours-note {margin:0;white-space:pre-wrap;color:var(--er-redesign-muted);}
.worker-hours-request-preview {border-inline-start:2px solid var(--uiux-warning-ink,#80551b);padding-inline-start:8px;}
.worker-hours-request-preview small,.worker-hours-pending .worker-hours-state {color:var(--uiux-warning-ink,#80551b);}
.worker-hours-segment > button {justify-self:start;}
@media(max-width:800px) {
  #appView #workerHoursView {padding-inline:max(12px,env(safe-area-inset-left)) max(12px,env(safe-area-inset-right));}
  #workerHoursView :is(summary,button,input) {scroll-margin-block-end:calc(76px + env(safe-area-inset-bottom));}
}
@media(max-width:360px) {
  .worker-hours-metrics {grid-template-columns:repeat(2,minmax(0,1fr));}
  .worker-hours-metrics > div {padding:6px 7px;}
}


/* Dashboard work planning and status summaries */
#appView #dashboardView {
  --dash-ink: #172b3a;
  --dash-muted: #647581;
  --dash-accent: #0f6f67;
  --dash-line: #dce3e8;
  --dash-surface: #fff;
  --dash-base: #f3f6f8;
  --dash-overdue: #fbeef0;
  --dash-overdue-ink: #942e39;
  --dash-due: #fff4db;
  --dash-due-ink: #80551b;
  --dash-positive: #146247;
  --dash-blue: #245b8a;
  background: var(--dash-base);
  color: var(--dash-ink);
  padding: 0 24px 24px;
}
body.theme-dark #appView #dashboardView,
:root[data-theme="dark"] #appView #dashboardView {
  --dash-ink: #e8f0f5;
  --dash-muted: #a8b8c5;
  --dash-accent: #81cfc1;
  --dash-line: #30404e;
  --dash-surface: #172331;
  --dash-base: #0e1722;
  --dash-overdue: #3b232b;
  --dash-overdue-ink: #ffadb2;
  --dash-due: #392e1c;
  --dash-due-ink: #f2d296;
  --dash-positive: #a1dbb9;
  --dash-blue: #a7ccf4;
}
#appView #dashboardView > .dashboard-header { min-height: 72px; margin: 0 0 16px; padding: 8px 0; border: 0; }
#appView #dashboardView > .dashboard-header h1 { font-size: 28px; font-weight: 700; }
#appView #dashboardView #dashboardCurrentDate { font-size: 14px; color: var(--dash-muted); }
@media (min-width: 801px) {
  #appView .main:has(#dashboardView:not([hidden])) { position: relative; }
  #appView .main:has(#dashboardView:not([hidden])) > #sidebarAccountBar { position: absolute; z-index: 9; top: 26px; right: 48px; margin: 0; }
  #appView .main:has(#dashboardView:not([hidden])) > #sidebarAccountBar summary { color: var(--er3-text); background: var(--er3-surface); }
  #appView .main:has(#dashboardView:not([hidden])) > #sidebarAccountBar summary span { color: inherit; }
}
#appView #dashboardView .dashboard-command-center { gap: 16px; padding: 0; border: 0; box-shadow: none; background: transparent; }
#appView #dashboardView .dashboard-kpis { gap: 12px; grid-template-columns: repeat(4,minmax(0,1fr)); }
#appView #dashboardView .dashboard-kpi { min-height: 104px; padding: 12px 16px; color: var(--dash-ink); background: var(--dash-surface); }
#appView #dashboardView .dashboard-kpi strong { font-size: 29px; font-weight: 700; }
#appView #dashboardView .dashboard-kpi-label { display: flex; align-items: center; gap: 8px; font-size: 14px; }
#appView #dashboardView .dashboard-kpi-label i, #appView #dashboardView .dashboard-agenda-icon { display: grid; place-items: center; color: var(--dash-accent); }
#dashboardView :is(.dashboard-kpi-label,.dashboard-agenda-icon) svg { width: 19px; height: 19px; }
#appView #dashboardView .dashboard-kpi small { color: var(--dash-muted); font-size: 12px; }
#appView #dashboardView .dashboard-kpi.attention { border-color: var(--dash-due-ink); }
#appView #dashboardView :is(.dashboard-v3-card,.dashboard-today,.dashboard-finance-watch,.owner-wall-card) {
  min-width: 0; padding: 16px; border: 1px solid var(--dash-line); border-radius: 12px; background: var(--dash-surface); box-shadow: none;
}
#appView #dashboardView :is(.dashboard-v3-card,.dashboard-today,.dashboard-finance-watch,.owner-wall-card) .section-title-line {
  border-color: var(--dash-line); font-size: 16px; font-weight: 600; color: var(--dash-ink);
}
#appView #dashboardView .dashboard-planning-card .section-title-line small { color: var(--dash-muted); font-size: 12px; }
#appView #dashboardView .dashboard-planning-card .section-title-line > div { display: grid; gap: 3px; }
#appView #dashboardView .dashboard-today { margin: 0; }
#appView #dashboardView .dashboard-action-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
#appView #dashboardView .dashboard-focus-action { min-height: 44px; border-color: var(--dash-line); border-left-width: 1px; background: var(--dash-surface); color: var(--dash-ink); }
#appView #dashboardView .dashboard-agenda-row {
  display: grid; grid-template-columns: minmax(48px, auto) 20px minmax(0,1fr) 12px;
  align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 8px;
  border: 0; border-bottom: 1px solid var(--dash-line); border-radius: 8px;
  background: var(--dash-surface); color: var(--dash-ink); text-align: left; box-shadow: none;
}
#appView #dashboardView .dashboard-agenda-row:hover { outline: 1px solid var(--dash-accent); outline-offset: -1px; }
#appView #dashboardView :is(button,summary,input):focus-visible { outline: 2px solid var(--dash-accent); outline-offset: 2px; }
#appView #dashboardView .dashboard-agenda-row strong { font-weight: 650; overflow-wrap: anywhere; }
#appView #dashboardView .dashboard-agenda-row small, #appView #dashboardView .dashboard-empty-focus small { display: block; font-size: 12px; color: var(--dash-muted); }
#appView #dashboardView .dashboard-agenda-date { font-size: 12px; color: var(--dash-muted); max-width: 65px; }
#appView #dashboardView .dashboard-agenda-row.is-overdue { background: var(--dash-overdue); }
#appView #dashboardView .dashboard-agenda-row.is-due { background: var(--dash-due); }
#appView #dashboardView .is-overdue .dashboard-agenda-icon { color: var(--dash-overdue-ink); }
#appView #dashboardView .is-due .dashboard-agenda-icon { color: var(--dash-due-ink); }
#appView #dashboardView .dashboard-agenda-more summary { min-height: 44px; padding: 10px 8px; color: var(--dash-accent); cursor: pointer; }
#appView #dashboardView .dashboard-agenda-ok { color: var(--dash-positive); }
#appView #dashboardView .dashboard-agenda-links { display: flex; flex-wrap: wrap; gap: 8px; }
#appView #dashboardView .dashboard-agenda-links button { min-height: 44px; color: var(--dash-accent); }
#appView #dashboardView .dashboard-planning-counts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; margin-bottom: 8px; }
#appView #dashboardView .dashboard-planning-counts:empty { display: none; }
#appView #dashboardView .dashboard-planning-counts > div { padding: 8px; border-radius: 8px; background: var(--dash-base); font-size: 12px; overflow-wrap: anywhere; }
#appView #dashboardView .dashboard-planning-counts strong { display: block; font-size: 19px; }
#appView #dashboardView .dashboard-quote-count { grid-template-columns: 22px minmax(0,1fr) auto 12px; }
#appView #dashboardView .quote-count-all { font-weight: 700; background: var(--dash-base); }
#appView #dashboardView .quote-count-ACCEPTED .dashboard-agenda-icon { color: var(--dash-positive); }
#appView #dashboardView .quote-count-OPENED .dashboard-agenda-icon { color: var(--dash-blue); }
#appView #dashboardView .quote-count-DRAFT .dashboard-agenda-icon { color: var(--dash-muted); }
#appView #dashboardView .quote-count-CANCELLED .dashboard-agenda-icon { color: var(--dash-overdue-ink); }
#appView #dashboardView #dashboardCashflow { margin: 0; }
#appView #dashboardView .dashboard-cashflow-toolbar :is(button,input) { min-height: 40px; }
#appView #dashboardView .dashboard-cashflow-total strong { font-size: 28px; font-weight: 700; color: var(--dash-accent); }
#appView #dashboardView .dashboard-finance-summary-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
#appView #dashboardView .dashboard-finance-summary-grid strong { font-size: clamp(17px,2vw,25px); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; white-space: normal; }
#appView #dashboardView .dashboard-finance-summary-grid .finance-income strong { color: var(--dash-accent); }
#appView #dashboardView .dashboard-finance-summary-grid :is(.finance-expense,.negative) strong { color: var(--dash-overdue-ink); }
#appView #dashboardView .dashboard-finance-summary-grid .positive strong { color: var(--dash-positive); }
#appView #dashboardView .dashboard-quick-notes { margin-top: 16px; padding: 0; border: 0; background: transparent; box-shadow: none; }
#appView #dashboardView .owner-wall-note { border: 0; border-bottom: 1px solid var(--dash-line); border-radius: 0; background: transparent; box-shadow: none; }
@media (max-width: 1000px) {
  #appView #dashboardView { padding: 0 12px calc(20px + env(safe-area-inset-bottom)); }
  #appView #dashboardView .dashboard-brief-grid { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 700px) {
  #appView #dashboardView > .dashboard-header { min-height: 0; padding: 4px 0; }
  #appView #dashboardView > .dashboard-header h1 { font-size: 24px; }
  #appView #dashboardView :is(.dashboard-kpis,.dashboard-finance-summary-grid) { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  #appView #dashboardView .dashboard-kpi { min-height: 90px; padding: 10px; }
  #appView #dashboardView .dashboard-kpi-label { gap: 5px; }
}

/* Payroll overview and its settlement dialogs */
:is(#salaryView,#salarySettlementDialog,.salary-month-close-dialog) {
  --salary-bg: #f3f6f8; --salary-surface: #fff; --salary-soft: #edf3f6; --salary-line: #dce3e8;
  --salary-ink: #172b3a; --salary-muted: #526774; --salary-accent: #0f6f67; --salary-amber: #795116; --salary-amber-bg: #fff4de;
}
:root[data-theme="dark"] :is(#salaryView,#salarySettlementDialog,.salary-month-close-dialog),
body.theme-dark :is(#salaryView,#salarySettlementDialog,.salary-month-close-dialog) {
  --salary-bg: #0e1722; --salary-surface: #172331; --salary-soft: #202e3b; --salary-line: #30404e;
  --salary-ink: #e8f0f5; --salary-muted: #a8b8c5; --salary-accent: #81cfc1; --salary-amber: #f3ca85; --salary-amber-bg: #382d1d;
}
#appView #salaryView { padding: 0 24px 24px; background: var(--salary-bg); color: var(--salary-ink); }
#appView #salaryView > .page-header { min-height: 72px; border: 0; align-items: center; margin: 0 0 16px; padding: 8px 0; }
#appView #salaryView > .page-header h1 { margin: 0; font-size: 28px; font-weight: 700; color: var(--salary-ink); }
#appView #salaryView > .page-header p { margin: 4px 0 0; font-size: 14px; color: var(--salary-muted); }
#appView #salaryView > .page-header button { min-height: 44px; }
#appView #salaryView .salary-workcenter-tabs { display: flex; width: auto; justify-content: flex-start; gap: 8px; margin: 0 0 16px; padding: 0; background: transparent; border: 0; box-shadow: none; }
#appView #salaryView .salary-workcenter-tabs .workcenter-tab {
  flex: 0 1 auto; width: auto; min-height: 44px; padding: 6px 12px; border: 0; border-bottom: 3px solid transparent;
  border-radius: 0; background: transparent; color: var(--salary-muted); box-shadow: none; font-size: 14px;
}
#appView #salaryView .salary-workcenter-tabs .active { color: var(--salary-accent); border-bottom-color: currentColor; }
#salaryView .salary-tab-short { display: none; }
#salaryView .salary-shared-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: start; }
#appView #salaryView .salary-worker-name-toolbar { display: grid; gap: 5px; width: min(320px,100%); margin: 0; }
#appView #salaryView .salary-worker-name-toolbar input { min-height: 40px; width: 100%; }
#appView #salaryView .salary-worker-name-note { font-size: 12px; color: var(--salary-muted); }
#appView #salaryView #salaryOverviewFilters:not([hidden]) { display: flex; flex-wrap: wrap; gap: 10px; align-items: start; margin: 0; padding: 0; }
#appView #salaryView #salaryOverviewFilters .er-salary-month-field { flex: 0 0 318px; }
#appView #salaryView #salaryOverviewFilters .er-salary-month-picker { margin-top: 1px; }
#appView #salaryView #salaryOverviewFilters .er-salary-month-picker :is(button,select), #salaryView #salaryOverviewCategory { min-height: 40px; }
#salaryView #salaryFilterFields { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; }
#salaryView #salaryFilterFields label { display: grid; gap: 5px; width: min(210px,100%); }
#salaryView #salaryFilterToggle, #salaryView .salary-mobile-sort { display: none; }
#salaryView .salary-overview-scope, #salaryView #salaryOverviewHeadingInfo { color: var(--salary-muted); margin: 8px 0; font-size: 13px; overflow-wrap: anywhere; }
#appView #salaryView #salaryOverviewSummary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-block: 12px; }
#salaryView #salaryOverviewSummary:empty, #salaryView .salary-overview-scope:empty, #salaryView #salaryOverviewHeadingInfo:empty { display: none; }
#appView #salaryView .salary-overview-total-card {
  min-width: 0; min-height: 90px; padding: 12px 16px; border: 1px solid var(--salary-line); border-radius: 12px;
  background: var(--salary-surface); color: var(--salary-ink); box-shadow: none;
}
#appView #salaryView .salary-overview-total-card span { display: flex; gap: 8px; align-items: start; color: var(--salary-muted); font-size: 13px; }
#salaryView .salary-overview-total-card svg, #salaryView .salary-command-icon { width: 19px; height: 19px; flex: 0 0 19px; }
#appView #salaryView .salary-overview-total-card strong { display: block; font-size: clamp(20px,2vw,27px); font-weight: 700; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
#salaryView .salary-overview-extras { margin: 0 0 12px; padding: 6px 0; color: var(--salary-muted); font-size: 13px; }
#salaryView .salary-overview-extras summary { cursor: pointer; padding: 5px 0; color: var(--salary-accent); }
#salaryView .salary-overview-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin: 16px 0 8px; }
#salaryView .salary-overview-heading h2 { margin: 0; font-size: 18px; font-weight: 650; }
#salaryView .salary-month-actions { display: flex; gap: 8px; flex-wrap: wrap; }
#salaryView .salary-month-actions button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
#salaryView #salaryMonthCloseBtn { background: var(--salary-amber-bg); border-color: var(--salary-amber); color: var(--salary-amber); }
#appView #salaryView #salaryOverviewTable { overflow: auto; max-height: 72vh; padding: 0; border: 1px solid var(--salary-line); border-radius: 12px; background: var(--salary-surface); box-shadow: none; }
#salaryView .salary-payroll-table { table-layout: fixed; border-collapse: separate; border-spacing: 0; width: 100%; min-width: 1050px; font-size: 13px; }
#salaryView .salary-payroll-table th { position: sticky; top: 0; z-index: 1; background: var(--salary-soft); font-size: 12px; font-weight: 600; text-align: right; }
#salaryView .salary-payroll-table :is(th,td) { padding: 8px 10px; border-bottom: 1px solid var(--salary-line); vertical-align: middle; }
#salaryView .salary-payroll-table td { min-height: 56px; min-width: 0; text-align: right; }
#salaryView .salary-payroll-table tr:hover td { background: var(--salary-soft); }
#salaryView .salary-payroll-table :is(th,td):first-child { width: 19%; text-align: left; }
#salaryView .salary-payroll-table :is(th,td):nth-child(5) { width: 14%; }
#salaryView .salary-payroll-table :is(th,td):last-child { width: 9%; }
#salaryView .salary-payroll-table th button { border: 0; background: transparent; padding: 0; box-shadow: none; color: var(--salary-ink); font: inherit; text-align: right; }
#salaryView .salary-advance-sort { display: flex; flex-direction: column; gap: 3px; color: var(--salary-muted); font-size: 11px; }
#salaryView .salary-payroll-table dl, #salaryView .salary-mobile-cards dl { display: grid; gap: 5px; margin: 0; }
#salaryView :is(.salary-payroll-table,.salary-mobile-cards) dl > div { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-gap: 5px; }
#salaryView :is(.salary-payroll-table,.salary-mobile-cards) dl dd { margin: 0; margin-inline-start: auto; }
#salaryView .salary-payroll-table dl dt { font-size: 11px; color: var(--salary-muted); }
#salaryView .salary-number { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
#salaryView .salary-number[data-salary-field="payable"] { font-size: 17px; font-weight: 700; }
:is(#salaryView,#salarySettlementDialog) .salary-due, #appView #salaryView .salary-overview-total-card .salary-due { color: var(--salary-accent); }
:is(#salaryView,#salarySettlementDialog) .salary-debt, #appView #salaryView .salary-overview-total-card .salary-debt { color: var(--salary-amber); }
#salaryView .salary-worker-head { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 8px; }
#salaryView .salary-person-link { padding: 0; min-width: 0; text-align: left; overflow-wrap: anywhere; color: var(--salary-accent); font-size: 15px; font-weight: 600; }
#salaryView .salary-person-link strong { color: inherit; }
:is(#salaryView,#salarySettlementDialog) .salary-state-open { background: var(--salary-soft); color: var(--salary-ink); }
:is(#salaryView,#salarySettlementDialog) .salary-state-closed { background: var(--salary-soft); color: var(--salary-accent); }
#salaryView .salary-mobile-cards { display: none; }
#salarySettlementDialog.modal[open] {
  display: grid; grid-template-rows: auto minmax(0,1fr) auto; width: min(1020px,calc(100% - 20px)); max-width: none; max-height: 90dvh;
  padding: 24px; overflow: hidden; color: var(--salary-ink); background: var(--salary-surface); border-color: var(--salary-line); border-radius: 16px;
}
#salarySettlementDialog .modal-head h2 { margin: 0; font-size: 22px; }
#salarySettlementDialog #salarySettlementPeriod { margin: 4px 0; color: var(--salary-muted); overflow-wrap: anywhere; }
#salarySettlementDialog .salary-settlement-body { min-width: 0; overflow: auto; overscroll-behavior: contain; margin-inline: -8px; padding: 4px 8px; }
#salarySettlementDialog .salary-settlement-toolbar { align-items: end; margin: 0 0 12px; }
#salarySettlementDialog .salary-detail-group { background: var(--salary-surface); border-color: var(--salary-line); }
#salarySettlementDialog .salary-detail-group h3 { color: var(--salary-ink); font-size: 16px; font-weight: 600; }
#salarySettlementDialog .salary-settlement-card :is(span,small) { color: var(--salary-muted); overflow-wrap: anywhere; }
#salarySettlementDialog .salary-settlement-card strong { font-size: 15px; }
#salarySettlementDialog :is([data-salary-total],[data-salary-base]) { font-size: 19px; }
#salarySettlementDialog .salary-final-values { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
#salarySettlementDialog .salary-detail-payable { display: grid; gap: 2px; background: var(--salary-soft); border: 1px solid var(--salary-line); color: var(--salary-ink); }
#salarySettlementDialog .salary-detail-payable.salary-due strong { color: var(--salary-accent); }
#salarySettlementDialog .salary-detail-payable.salary-debt { background: var(--salary-amber-bg); }
#salarySettlementDialog .salary-detail-payable.salary-debt strong { color: var(--salary-amber); }
#salarySettlementDialog .salary-detail-payable strong { text-align: left; font-size: clamp(22px,2.5vw,28px); white-space: normal; overflow-wrap: anywhere; }
#salarySettlementDialog .salary-settlement-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-top: 8px; border-color: var(--salary-line); }
#salarySettlementDialog .salary-footer-group { display: flex; gap: 8px; flex-wrap: wrap; }
#salarySettlementDialog .salary-footer-group:last-child { margin-inline-start: auto; }
:is(#salaryView,#salarySettlementDialog,.salary-month-close-dialog) [hidden] { display: none !important; }
:is(#salaryView,#salarySettlementDialog,.salary-month-close-dialog) :is(button,summary,select,input):focus-visible { outline: 2px solid var(--salary-accent); outline-offset: 2px; }
:where(#salaryView,#salarySettlementDialog) :is(.secondary-btn,.small-btn,.er-salary-month-arrow,select,input[type=search]) {
  background: var(--salary-soft); color: var(--salary-ink); border-color: var(--salary-line); box-shadow: none;
}
.salary-month-close-dialog .salary-close-scope { color: var(--salary-amber); background: var(--salary-amber-bg); border-color: var(--salary-amber); }
.salary-close-scope p { margin: 4px 0 0; }
#salarySettlementDialog .salary-settlement-footer button { min-height: 44px; }
@media (max-width: 900px) {
  #appView #salaryView { padding: 0 12px calc(16px + env(safe-area-inset-bottom)); }
  #appView #salaryView > .page-header { min-height: 0; margin-bottom: 8px; padding: 4px 0; }
  #appView #salaryView > .page-header h1 { font-size: 24px; }
  #appView #salaryView > .page-header p { display: none; }
  #appView #salaryView .salary-workcenter-tabs { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px; }
  #appView #salaryView .salary-workcenter-tabs .workcenter-tab { display: flex; justify-content: center; align-items: center; min-width: 0; padding: 4px; font-size: 12px; gap: 4px; }
  #appView #salaryView > .page-header { display: flex; justify-content: space-between; gap: 8px; }
  #appView #salaryView > .page-header .header-actions { width: auto; }
  #appView #salaryView .salary-tab-icon { width: 22px; height: 22px; flex-basis: 22px; border-radius: 6px; }
  #appView #salaryView .salary-tab-icon svg { width: 16px; height: 16px; }
  #appView #salaryView .salary-month-actions { width: auto; }
  #appView #salaryView .salary-month-actions button { width: auto; }
  #salaryView :is([data-salary-tab="benefits"],[data-salary-tab="manager-hours"]) .salary-tab-label { display: none; }
  #salaryView .salary-tab-short { display: inline; }
  #salaryView .salary-shared-filters { display: grid; grid-template-columns: minmax(0,1fr) auto; }
  #salaryView .salary-worker-name-toolbar { grid-row: 2; grid-column: 1; }
  #appView #salaryView #salaryOverviewFilters:not([hidden]) { display: contents; }
  #salaryOverviewFilters .er-salary-month-field { grid-area: 1/1/2/-1; min-width: 0; }
  #salaryView #salaryFilterToggle { display: inline-flex; grid-area: 2/2; align-self: start; margin-top: 25px; min-height: 44px; }
  #salaryView #salaryFilterToggle.has-filters { border-color: var(--salary-accent); color: var(--salary-accent); }
  #salaryView #salaryFilterFields { display: none; }
  #salaryView #salaryFilterToggle[aria-expanded="true"] + #salaryFilterFields { grid-column: 1/-1; display: flex; }
  #appView #salaryView #salaryOverviewFilters .er-salary-month-picker :is(button,select) { min-height: 44px; }
  :is(#salaryView #salaryOverviewFilters,#salarySettlementDialog) .er-salary-month-picker { grid-template-columns: 44px minmax(0,1fr) minmax(0,1.35fr) 44px; }
  :is(#salaryView #salaryOverviewFilters,#salarySettlementDialog) .er-salary-month-arrow { width: 44px; min-height: 44px; }
  #appView #salaryView #salaryOverviewSummary { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  #appView #salaryView .salary-overview-total-card { min-height: 90px; padding: 10px; }
  #appView #salaryView .salary-overview-total-card strong { font-size: clamp(17px,5vw,22px); }
  #salaryView .salary-mobile-sort { display: grid; width: min(100%,270px); gap: 4px; margin-bottom: 8px; }
  #salaryView .salary-mobile-sort select { min-height: 44px; }
  #salaryView .salary-payroll-table { display: none; }
  #appView #salaryView #salaryOverviewTable { border: 0; background: transparent; max-height: none; overflow: visible; }
  #salaryView .salary-mobile-cards { display: grid; gap: 10px; }
  #salaryView .salary-mobile-cards article { display: grid; gap: 8px; min-width: 0; padding: 12px; border: 1px solid var(--salary-line); border-radius: 12px; background: var(--salary-surface); font-size: 13px; }
  #salaryView .salary-card-totals { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #salaryView .salary-card-totals > div { display: grid; align-content: start; justify-content: stretch; gap: 4px; padding: 8px; min-width: 0; border-radius: 8px; background: var(--salary-soft); }
  #salaryView .salary-card-totals > div:has(.salary-debt) { background: var(--salary-amber-bg); }
  #salaryView .salary-card-totals dd { margin: 0; }
  #salaryView .salary-card-totals .salary-number { white-space: normal; overflow-wrap: anywhere; }
  #salaryView .salary-mobile-cards :is(summary,.small-btn) { min-height: 44px; }
  #salaryView .salary-mobile-cards summary { cursor: pointer; padding: 10px 0; color: var(--salary-accent); }
  #salarySettlementDialog.modal[open] { padding: 16px; }
  #salarySettlementDialog .modal-head h2 { font-size: 20px; }
  #salarySettlementDialog .salary-settlement-footer { display: grid; grid-template-columns: minmax(0,1fr); }
  #salarySettlementDialog .salary-footer-group, #salarySettlementDialog .salary-footer-group:last-child { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); margin: 0; }
  #salarySettlementDialog .salary-footer-group button { padding: 6px; font-size: 13px; white-space: normal; }
  #salarySettlementDialog .salary-settlement-card strong { white-space: normal; overflow-wrap: anywhere; }
}
@media (max-width: 359px) { #salarySettlementDialog .salary-final-values { grid-template-columns: minmax(0,1fr); } }

/* Ügyfelek */
#customersView { padding: 24px; }
#customersView > .customer-page-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 0 16px; padding: 0; min-height: 64px; border: 0; background: none; box-shadow: none;
}
#customersView .customer-page-header h1 { font-size: 28px; margin: 0; }
#customersView .customer-page-header p { font-size: 14px; margin: 4px 0 0; }
#customersView .customer-page-header button { min-height: 44px; flex: none; }
.customer-toolbar, #customerFilters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.customer-toolbar { margin-bottom: 14px; }
#customersView #customerSearch { flex: 0 1 320px; min-width: 0; }
#customersView .customer-toolbar :is(input, select, button) { min-height: 40px; border-radius: 8px; }
#customersView .customer-toolbar select { width: 180px; }
#customerResultCount { font-size: 12px; }
#customerFilterToggle, .customer-cards { display: none; }
#customersView #customersTable { min-width: 0; box-shadow: none; border-radius: 12px; }
.customer-table-scroll { overflow-x: auto; }
#customersView .customer-table { table-layout: fixed; min-width: 900px; }
.customer-table col:nth-child(1) { width: 19%; }
.customer-table col:nth-child(2) { width: 10%; }
.customer-table col:nth-child(3) { width: 18%; }
.customer-table col:nth-child(4) { width: 15%; }
.customer-table col:nth-child(5) { width: 8%; }
.customer-table col:nth-child(6), .customer-table col:nth-child(7) { width: 15%; }
#customersView .customer-table :is(th,td) { padding: 10px 12px; vertical-align: middle; overflow-wrap: anywhere; }
#customersView .customer-table th { font-size: 12px; font-weight: 600; }
#customersView .customer-table td { font-size: 13px; height: 52px; }
#customersView .customer-table tbody tr:hover { background: var(--er-redesign-bg); }
#customersView .customer-name { font-size: 15px; font-weight: 650; white-space: normal; overflow-wrap: anywhere; text-align: start; }
#customersView :is(.entity-link,a), .is-customer-detail a, #customerDuplicate .entity-link { color: var(--er-redesign-accent-ink); }
#customersView a, .is-customer-detail a { text-underline-offset: 2px; }
.customer-secondary { display: block; color: var(--er-redesign-muted); font-size: 12px; }
.customer-tag {
  display: inline-flex; padding: 3px 7px; align-items: center; border-radius: 6px;
  background: var(--er-redesign-bg); color: var(--er-redesign-ink); font-size: 12px; font-weight: 600;
}
.customer-tag-company { background: var(--er-redesign-accent-soft); color: var(--er-redesign-accent-ink); }
.customer-tag-warning { background: #fff0cc; color: #704411; }
.customer-actions { display: flex; align-items: start; flex-wrap: wrap; gap: 6px; }
.customer-actions :is(.small-btn,summary), #customerDeleteDialog button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px;
  border: 1px solid var(--er-redesign-line); border-radius: 8px;
  background: var(--er-redesign-surface); color: var(--er-redesign-ink); box-shadow: none;
}
.customer-actions :is(.small-btn,summary):hover { background: var(--er-redesign-bg); }
.customer-actions :is(.small-btn,summary):focus-visible, .customer-related-row:focus-visible {
  outline: 2px solid var(--er-redesign-accent-ink); outline-offset: 2px;
}
.customer-actions svg, .customer-related-row svg { width: 16px; height: 16px; color: var(--er-redesign-accent-ink); flex: none; }
.customer-actions .customer-danger svg { color: currentColor; }
.customer-menu { max-width: 100%; }
.customer-menu summary { min-width: 36px; cursor: pointer; list-style: none; font-weight: 700; }
.customer-menu summary::-webkit-details-marker { display: none; }
.customer-menu[open] > button { display: flex; margin-top: 4px; }
#customersView .customer-danger, #customerDeleteDialog .customer-danger { color: #a92533; }
:root[data-theme=dark] .customer-tag-warning, body.theme-dark .customer-tag-warning { background: #48341d; color: #ffdb98; }
:root[data-theme=dark] :is(#customersView,#customerDeleteDialog) .customer-danger,
body.theme-dark :is(#customersView,#customerDeleteDialog) .customer-danger { color: #ffadb4; }
#customerDialog, #detailDialog.is-customer-detail, #customerDeleteDialog {
  width: min(880px, calc(100% - 24px)); max-height: 90dvh; border-radius: 16px;
  background: var(--er-redesign-surface); color: var(--er-redesign-ink); border-color: var(--er-redesign-line);
}
#customerDeleteDialog { width: min(510px, calc(100% - 24px)); }
#customerDialog .ui-scroll-dialog-body { display: grid; gap: 14px; }
#customerDialog fieldset { margin: 0; min-width: 0; }
#customerDialog fieldset legend { padding: 0 6px; font-weight: 650; }
#customerDialog .customer-address-fields { grid-template-columns: minmax(88px,1fr) minmax(0,2fr) minmax(0,3fr) minmax(80px,1fr); }
#customerDeleteSummary > strong { display: block; margin-bottom: 8px; }
#customerDeleteSummary .detail-kv { overflow-wrap: anywhere; }
#customerDialog :is(input,select,textarea) { min-width: 0; border-radius: 8px; }
#customerDialog :is(input,select) { min-height: 42px; }
#customerDuplicate ul { margin: 6px 0; padding-inline-start: 20px; }
#customerDuplicate p { margin: 6px 0; }
#detailDialog.is-customer-detail[open] { display: grid; grid-template-rows: auto minmax(0,1fr) auto; overflow: hidden; }
#detailDialog.is-customer-detail #detailBody { overflow: auto; overscroll-behavior: contain; overflow-wrap: anywhere; }
.is-customer-detail .detail-grid { margin-bottom: 12px; }
.is-customer-detail .detail-section, #customerDialog .ui-form-section {
  background: var(--er-redesign-surface); border-color: var(--er-redesign-line);
}
.is-customer-detail .detail-section-title { color: var(--er-redesign-ink); }
.customer-note { white-space: pre-wrap; }
.customer-related-row {
  display: grid; grid-template-columns: minmax(0,1fr) auto 12px; align-items: center; gap: 10px; width: 100%;
  min-height: 44px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--er-redesign-line);
  background: var(--er-redesign-bg); color: var(--er-redesign-ink); text-align: start; margin-bottom: 6px;
}
.customer-related-row > span:first-child { display: flex; align-items: center; gap: 8px; }
button.customer-related-row { color: var(--er-redesign-accent-ink); cursor: pointer; }
button.customer-related-row:hover { background: var(--er-redesign-accent-soft); }
.customer-document-links { padding: 8px 0; }
.customer-document-links > summary { cursor: pointer; color: var(--er-redesign-accent-ink); }
.customer-scope:not([hidden]) {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; width: fit-content; max-width: 100%;
  margin: 0 0 12px; padding: 4px 8px; border-radius: 8px;
  background: var(--er-redesign-accent-soft); color: var(--er-redesign-accent-ink);
}
.customer-scope select { max-width: min(290px,65vw); min-height: 36px; }
@media (max-width: 800px) {
  #customersView { padding: 12px; }
  #customersView > .customer-page-header { min-height: 0; }
  #customersView .customer-page-header h1 { font-size: 24px; }
  #customersView .customer-page-header p, .customer-table-scroll { display: none; }
  .customer-toolbar { display: grid; grid-template-columns: minmax(0,1fr) auto; }
  #customersView #customerSearch { width: 100%; }
  #customerFilterToggle { display: inline-flex; align-items: center; min-height: 44px; }
  #customerFilters { grid-column: 1/-1; }
  #customerFilterToggle[aria-expanded=false] + #customerFilters { display: none; }
  #customersView .customer-toolbar select { width: auto; max-width: 100%; }
  #customerResultCount { grid-column: 1/-1; }
  #customersView #customersTable:has(.customer-cards) { border: 0; background: none; overflow: visible; }
  .customer-cards { display: grid; gap: 10px; }
  .customer-card {
    display: grid; gap: 8px; padding: 12px; border: 1px solid var(--er-redesign-line); border-radius: 12px;
    background: var(--er-redesign-surface); color: var(--er-redesign-ink); font-size: 13px; overflow-wrap: anywhere;
  }
  .customer-card-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  .customer-card > details > summary { min-height: 44px; padding-block: 12px; cursor: pointer; }
  .customer-card .customer-actions :is(button,summary) { min-height: 44px; min-width: 44px; }
  #customerDialog, #detailDialog.is-customer-detail, #customerDeleteDialog {
    width: calc(100% - max(8px,env(safe-area-inset-left)) - max(8px,env(safe-area-inset-right)));
    max-height: min(90dvh,calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px));
  }
  #customerDialog .customer-address-fields { grid-template-columns: minmax(0,1fr); }
  #customerDialog :is(input,select,textarea) { font-size: 16px; min-height: 44px; }
}

/* Projektek */
#projectsView, #projectWorkspaceView { padding: 24px; min-width: 0; }
#projectsView .project-page-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; margin: 0 0 16px; padding: 0; background: none; border: 0; box-shadow: none; }
#projectsView h1, #projectWorkspaceTitle { font-size: 28px; margin: 0; }
#projectsView .project-page-header p { margin: 4px 0 0; font-size: 14px; }
#projectsView .project-page-header .primary-btn { min-height: 44px; flex: none; }
#projectsView .toolbar, #projectExtraFilters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
#projectsView .toolbar { margin-bottom: 14px; }
#projectsView #projectSearch { flex: 0 1 320px; min-width: 0; }
#projectsView .toolbar :is(select,input,button) { min-height: 40px; border-radius: 8px; }
#projectsView #projectStatusFilter { width: 150px; }
#projectsView #projectTypeFilter { width: 180px; }
#projectsView #projectSort { width: 190px; }
#projectResultCount { font-size: 12px; }
#projectFilterToggle, .project-list-cards { display: none; }
#projectsTable { border-radius: 12px; box-shadow: none; min-width: 0; }
.project-list-scroll { overflow-x: auto; }
#projectsView .project-list-table { min-width: 880px; }
#projectsView .project-list-table :is(th,td) { padding: 9px 12px; vertical-align: middle; overflow-wrap: anywhere; }
#projectsView .project-list-table th { font-size: 12px; font-weight: 600; }
#projectsView .project-list-table td { font-size: 13px; height: 52px; }
#projectsView .project-name { font-size: 15px; font-weight: 650; color: var(--er-redesign-accent-ink); text-align: start; white-space: normal; }
.project-list-dates small { display: block; color: var(--er-redesign-muted); }
.project-list-actions, .project-workspace-actions, .project-workspace-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.project-list-actions button { min-height: 36px; }
.project-status-badge, .project-work-chip {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 6px; padding: 4px 8px; font-size: 12px;
  font-weight: 650; background: var(--er-redesign-bg); color: var(--er-redesign-ink); border: 1px solid var(--er-redesign-line);
}
.project-status-badge i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.project-status-badge.status-active { color: #155f49; background: #e4f5ed; border-color: #cae9db; }
.project-status-badge.status-planned { color: #275581; background: #e7f0fb; border-color: #d3e1f2; }
.project-status-badge.status-completed { color: var(--er-redesign-accent-ink); background: var(--er-redesign-accent-soft); }
.project-status-badge.status-paused, .project-close-action { color: #704411; background: #fff3d9; border-color: #e7ca8b; }
.project-status-badge.status-rejected { color: #942a3d; background: #fae8eb; border-color: #f0c6ce; }
.project-work-chip { margin: 2px 4px 2px 0; font-weight: 500; overflow-wrap: anywhere; }
:is(:root[data-theme=dark],body.theme-dark) .project-status-badge.status-active { color: #a8e6c9; background: #1b3a31; border-color: #33574b; }
:is(:root[data-theme=dark],body.theme-dark) .project-status-badge.status-planned { color: #b4d8ff; background: #233950; border-color: #365471; }
:is(:root[data-theme=dark],body.theme-dark) .project-status-badge.status-rejected { color: #ffbbc5; background: #452833; border-color: #694453; }
:is(:root[data-theme=dark],body.theme-dark) :is(.project-status-badge.status-paused,.project-close-action) { color: #ffdb98; background: #48341d; border-color: #715631; }
#projectDialog, dialog.project-closure-dialog {
  width: min(1200px,calc(100% - 24px)); max-width: none; max-height: 93dvh; border-radius: 16px;
  color: var(--er-redesign-ink); background: var(--er-redesign-surface); border-color: var(--er-redesign-line);
}
dialog.project-closure-dialog { width: min(1000px,calc(100% - 24px)); max-height: 90dvh; }
#projectForm > input[type=hidden] { display: none; }
#projectForm { grid-template-rows: auto auto minmax(0,1fr) auto; }
#projectForm .ui-scroll-dialog-body > section:not([hidden]) { display: grid; gap: 14px; }
#projectForm :is(input:not([type=radio],[type=checkbox]),select,button):not([hidden]) { min-height: 42px; }
#projectForm textarea { min-height: 160px; }
#projectForm .project-editor-tabs { margin: 0; padding-inline: 24px; }
#projectForm .project-editor-tabs button { padding: 0 12px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--er-redesign-muted); font-weight: 650; white-space: nowrap; }
#projectForm .project-editor-tabs button[aria-selected=true] { color: var(--er-redesign-accent-ink); border-bottom-color: currentColor; }
#projectForm .project-status-field { padding: 12px; min-width: 0; border: 1px solid var(--er-redesign-line); border-radius: 10px; }
#projectStatusChoices { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; }
#projectStatusChoices .project-status-choice {
  display: flex; align-items: flex-start; gap: 5px; min-height: 52px; padding: 8px; border: 1px solid var(--er-redesign-line);
  border-radius: 8px; cursor: pointer; color: var(--er-redesign-ink); background: var(--er-redesign-surface);
}
#projectStatusChoices .project-status-choice:has(:checked) { border-color: var(--er-redesign-accent-ink); background: var(--er-redesign-accent-soft); }
#projectStatusChoices input { width: 16px; height: 16px; margin-top: 6px; accent-color: var(--er-redesign-accent); }
#projectStatusChoices small { display: block; margin-top: 4px; font-size: 12px; }
#projectDialog #projectWorkdayEstimatePanel:not([hidden]) { display: grid; justify-items: start; gap: 8px; }
#projectForm .modal-actions > .muted { margin-inline-end: auto; }
#projectWorkspaceView .project-workspace-head { margin-bottom: 16px; }
.project-workspace-head header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-block: 12px; }
.project-workspace-meta { margin-top: 5px; color: var(--er-redesign-muted); font-size: 13px; }
.project-workspace-actions { flex: none; }
.project-workspace-head .project-detail-tabs, #projectForm .project-editor-tabs { display: flex; overflow-x: auto; gap: 4px; flex-wrap: nowrap; }
.project-workspace-head .project-detail-tab {
  flex: none; min-height: 44px; border: 0; border-radius: 0; border-bottom: 3px solid transparent; padding-inline: 12px;
  color: var(--er-redesign-muted); background: none; box-shadow: none; white-space: nowrap;
}
.project-workspace-head .project-detail-tab[aria-selected=true] { color: var(--er-redesign-accent-ink); border-bottom-color: currentColor; }
#projectWorkspaceView .project-detail-panel { display: grid; gap: 12px; width: 100%; max-width: none; min-width: 0; }
#projectWorkspaceView :is(.project-detail-card,.project-preparation-block,.project-workflow-engine) {
  width: 100%; max-width: none; min-width: 0; margin: 0; padding: 16px; border-radius: 12px;
  color: var(--er-redesign-ink); background: var(--er-redesign-surface); border: 1px solid var(--er-redesign-line); box-shadow: none;
}
#projectWorkspaceView .project-preparation-grid { grid-template-columns: minmax(0,1fr); }
#projectWorkspaceView .project-main-kpis { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
#projectWorkspaceView :is(.detail-metric,.project-worker-hours-kpi,.project-detail-row,.project-prep-item,.project-receivable-row) {
  color: var(--er-redesign-ink); background: var(--er-redesign-bg); border-color: var(--er-redesign-line);
  overflow-wrap: anywhere;
}
.project-activity-card > summary { cursor: pointer; font-weight: 650; }
.project-closure-section { margin-bottom: 12px; padding: 16px; border: 1px solid var(--er-redesign-line); border-radius: 12px; }
.project-closure-section h3 { margin: 0 0 12px; }
.project-closure-section [data-difference] { font-weight: 700; }
.project-closure-dialog .modal-actions [data-closure-footer-status] { margin-inline-end: auto; font-size: 13px; color: var(--er-redesign-muted); }
@media (max-width:800px) {
  #projectsView, #projectWorkspaceView { padding: 12px; }
  #projectsView h1, #projectWorkspaceTitle { font-size: 24px; }
  #projectsView .project-page-header { min-height: 0; }
  #projectsView .project-page-header p, .project-list-scroll { display: none; }
  #projectsView .toolbar { display: grid; grid-template-columns: minmax(0,1fr) auto; }
  #projectsView #projectSearch { width: 100%; }
  #projectFilterToggle { display: inline-flex; align-items: center; min-height: 44px; }
  #projectExtraFilters, #projectResultCount { grid-column: 1/-1; }
  #projectFilterToggle[aria-expanded=false] + #projectExtraFilters { display: none; }
  #projectsTable:has(.project-list-cards) { border: 0; background: none; overflow: visible; }
  .project-list-cards { display: grid; gap: 10px; }
  .project-list-card { display: grid; gap: 8px; border-radius: 12px; padding: 12px; background: var(--er-redesign-surface); border: 1px solid var(--er-redesign-line); font-size: 13px; }
  .project-list-card header, .project-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .project-list-card .project-list-actions button { min-height: 44px; }
  #projectDialog, dialog.project-closure-dialog {
    width: calc(100% - max(8px,env(safe-area-inset-left)) - max(8px,env(safe-area-inset-right)));
    max-height: min(93dvh,calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px));
  }
  #projectForm .project-editor-tabs { padding-inline: 12px; }
  #projectForm :is(input:not([type=radio],[type=checkbox]),select,textarea), .project-closure-dialog input { font-size: 16px; }
  #projectStatusChoices { grid-template-columns: minmax(0,1fr); }
  #projectForm .modal-actions > .muted, .project-closure-dialog .modal-actions [data-closure-footer-status] { flex-basis: 100%; }
  .project-workspace-head header { align-items: flex-start; flex-direction: column; }
  .project-workspace-actions :is(button), .project-workspace-head > button { min-height: 44px; }
  #projectWorkspaceView .project-main-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

#projectWorkspaceView .project-detail-files { display: block; }
#projectWorkspaceView .project-file-group > div { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(248px,100%),1fr)); gap: 8px; }

.project-workspace-picker { display: none; }
#projectForm .project-editor-address { border: 1px solid var(--er-redesign-line); border-radius: 8px; padding: 10px; }
#projectForm .project-work-type-picker { grid-template-columns: repeat(auto-fit,minmax(min(190px,100%),1fr)); }
#projectForm .project-work-type-option { padding: 6px 8px; background: var(--er-redesign-surface); border-color: var(--er-redesign-line); }
#projectForm .project-work-type-option:has(:checked) { background: var(--er-redesign-accent-soft); border-color: var(--er-redesign-accent-ink); }
#projectWorkspaceView .project-file-group-document > div { grid-template-columns: minmax(0,1fr); }
#projectWorkspaceView .project-detail-file { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; }
#projectWorkspaceView .project-detail-file .project-file-actions { display: flex; flex-wrap: wrap; gap: 6px; }
#projectWorkspaceView .project-file-filter { display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 800px) {
  #projectWorkspaceView .project-detail-tabs { display: none; }
  .project-workspace-picker { display: grid; gap: 4px; color: var(--er-redesign-muted); font-size: 13px; }
  .project-workspace-picker select { min-height: 44px; font-size: 16px; }
  .project-closure-dialog input { min-height: 44px; }
}

#projectWorkspaceView .project-file-group-photo > div { grid-template-columns: repeat(auto-fit,minmax(min(210px,100%),1fr)); }
#projectWorkspaceView .project-file-group-photo .project-detail-file { display: grid; align-content: start; gap: 8px; }
.project-file-placeholder { display: grid; place-items: center; min-height: 56px; color: var(--er-redesign-muted); background: var(--er-redesign-bg); border-radius: 8px; }
.project-file-placeholder svg { width: 24px; height: 24px; }
@media (max-width: 800px) {
  #projectWorkspaceView .project-file-group-photo > div { grid-template-columns: repeat(auto-fit,minmax(min(136px,100%),1fr)); }
  #projectWorkspaceView .project-detail-file .project-file-actions > * { min-height: 44px; }
}

/* Projektnaptár */
#projectCalendarView {
  --calendar-surface: var(--er-redesign-surface);
  --calendar-head: #edf2f4;
  --calendar-divider: #bccad2;
  --calendar-closed: #687b88;
  padding: 24px;
  min-width: 0;
}
:is(:root[data-theme=dark],body.theme-dark) #projectCalendarView {
  --calendar-surface: #172331;
  --calendar-head: #202e3b;
  --calendar-divider: #405464;
  --calendar-closed: #80919e;
}
#projectCalendarView .project-calendar-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 0 12px; min-height: 64px; padding: 0; border: 0; box-shadow: none; background: none;
}
.project-calendar-header h1 { margin: 0; font-size: 28px; }
.project-calendar-header p { margin: 4px 0 0; font-size: 14px; }
.project-calendar-modes, .project-calendar-period, .project-calendar-toolbar, #projectCalendarFilters {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.project-calendar-period, .project-calendar-toolbar { margin: 0 0 12px; }
#projectCalendarView #projectCalendarLabel { margin: 0 0 0 4px; font-size: 21px; font-weight: 650; }
#projectCalendarView :is(.project-calendar-header,.project-calendar-period,.project-calendar-toolbar) :is(button,select,input[type=search]) { min-height: 40px; border-radius: 8px; }
.project-calendar-period button { min-width: 40px; }
#projectCalendarView .project-calendar-modes .active {
  color: var(--er-redesign-accent-ink); background: var(--er-redesign-accent-soft); border-color: var(--er-redesign-accent-ink);
}
#projectCalendarFiltersToggle { display: none; }
#projectCalendarStatusFilter { width: 210px; }
.project-calendar-weekend { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; cursor: pointer; }
.project-calendar-weekend input { accent-color: var(--er-redesign-accent); }
.project-calendar-search { position: relative; flex: 0 1 340px; min-width: 0; }
#projectCalendarSearch { width: 100%; padding-inline-end: 44px; }
#projectCalendarSearch::-webkit-search-cancel-button { display: none; }
#projectCalendarSearchClear { position: absolute; inset: 0 0 0 auto; width: 40px; border: 0; background: none; color: var(--er-redesign-muted); font-size: 20px; }
#projectCalendarCount { font-size: 12px; }
#projectCalendarView #projectCalendar { padding: 0; border: 0; background: transparent; box-shadow: none; overflow: visible; min-width: 0; }
#projectCalendar .project-calendar-layout { --calendar-side: 260px; --calendar-day-min: 84px; }
#projectCalendar .calendar-month { --calendar-day-min: 30px; }
.project-calendar-scroll {
  max-block-size: max(340px,calc(100dvh - 248px)); overflow: auto; isolation: isolate;
  background: var(--calendar-surface); border: 1px solid var(--er-redesign-line); border-radius: 12px;
}
.project-calendar-grid {
  min-inline-size: calc(var(--calendar-side) + var(--calendar-days) * var(--calendar-day-min));
}
.calendar-grid-line {
  display: grid; grid-template-columns: var(--calendar-side) repeat(var(--calendar-days),minmax(var(--calendar-day-min),1fr));
}
.project-calendar-grid-head { position: sticky; top: 0; z-index: 4; color: var(--er-redesign-ink); background: var(--calendar-head); }
.calendar-fixed-label {
  grid-column: 1; grid-row: 1; position: sticky; left: 0; z-index: 2;
  min-width: 0; padding: 6px 10px; border-right: 1px solid var(--calendar-divider); background: var(--calendar-surface);
}
.project-calendar-grid-head .calendar-fixed-label { background: var(--calendar-head); font-weight: 650; }
.calendar-week-labels { min-height: 27px; font-size: 12px; }
.calendar-week-labels span:not(.calendar-fixed-label) { padding: 5px 6px; border-left: 1px solid var(--calendar-divider); white-space: nowrap; overflow: hidden; }
.calendar-day-labels { min-height: 54px; border-bottom: 1px solid var(--calendar-divider); }
.calendar-month .calendar-day-labels { min-height: 30px; }
.calendar-day { grid-row: 1; border-left: 1px solid var(--er-redesign-line); min-width: 0; }
.calendar-day-labels .calendar-day, .calendar-mobile-week-head .calendar-day {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px;
}
.calendar-day-labels .calendar-day strong { font-size: 13px; }
.calendar-day span { font-variant-numeric: tabular-nums; }
.calendar-day.calendar-week-start { border-left-color: var(--calendar-divider); }
.calendar-day.calendar-weekend { background: color-mix(in srgb,var(--calendar-divider) 16%,transparent); }
.calendar-day.calendar-today {
  border-left: 2px solid var(--er-redesign-accent-ink); background: var(--er-redesign-accent-soft); color: var(--er-redesign-accent-ink); font-weight: 700;
}
.calendar-project-row { min-height: 62px; border-bottom: 1px solid var(--er-redesign-line); }
.calendar-month .calendar-project-row { min-height: 54px; }
.calendar-project-row:last-child { border-bottom: 0; }
#projectCalendar .calendar-project-name {
  display: block; max-width: 100%; padding: 0; border: 0; background: none; color: var(--er-redesign-accent-ink);
  text-align: start; font-size: 14px; font-weight: 650; overflow-wrap: anywhere; cursor: pointer;
}
.calendar-project-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 3px 7px; margin-block: 2px; }
.calendar-project-meta .project-status-badge { padding: 1px 5px; font-size: 11px; }
.calendar-category { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--er-redesign-ink); }
.calendar-category i { width: 8px; height: 8px; border-radius: 50%; background: var(--category-color); border: 1px solid var(--calendar-divider); flex: none; }
.calendar-project-period { display: block; color: var(--er-redesign-muted); font-size: 11px; }
#projectCalendar .calendar-project-bar {
  display: flex; align-items: center; gap: 2px; justify-content: space-between; grid-row: 1; align-self: center; z-index: 1;
  min-width: 0; height: 36px; margin-inline: 1px; padding: 0 3px; border: 1px solid #18212b66; border-radius: 6px;
  background: var(--project-color); box-shadow: none; cursor: pointer;
}
#projectCalendar .calendar-project-bar.calendar-completed { background: var(--calendar-closed); }
#projectCalendar .calendar-month .calendar-project-bar { height: 28px; border-radius: 5px; }
#projectCalendar .calendar-project-bar span { background: #172b3a; color: white; border-radius: 3px; padding: 0 3px; }
#projectCalendar .calendar-project-bar .calendar-continues-after { margin-inline-start: auto; }
#projectCalendar :is(.calendar-project-bar,.calendar-project-name,.project-calendar-scroll):focus-visible {
  outline: 2px solid var(--er-redesign-accent-ink); outline-offset: -2px;
}
#projectCalendar .calendar-mobile-list { display: none; }
.project-calendar-legend { margin-top: 12px; color: var(--er-redesign-ink); }
.project-calendar-legend summary { cursor: pointer; font-size: 13px; }
#projectCalendarLegendItems { display: flex; gap: 8px 14px; flex-wrap: wrap; padding-top: 6px; }
.project-calendar-legend p { margin: 4px 0 0; font-size: 12px; }
@media (max-width: 800px) {
  #projectCalendarView { padding: 12px 12px max(16px,env(safe-area-inset-bottom)); }
  #projectCalendarView .project-calendar-header { display: grid; grid-template-columns: minmax(0,1fr) auto; min-height: 0; gap: 6px; }
  .project-calendar-header h1 { font-size: 24px; }
  .project-calendar-header p { display: none; }
  .project-calendar-modes { grid-column: 1/-1; }
  #projectCalendarFiltersToggle { display: inline-flex; align-items: center; min-width: 44px; }
  #projectCalendarFiltersToggle[aria-expanded=false] { border-color: var(--er-redesign-line); }
  #projectCalendarView:not(:has(#projectCalendarFiltersToggle[aria-expanded=true])) #projectCalendarFilters { display: none; }
  #projectCalendarView :is(.project-calendar-header,.project-calendar-period,.project-calendar-toolbar) :is(button,select,input[type=search]) { min-height: 44px; }
  .project-calendar-period button { min-width: 44px; }
  #projectCalendarView #projectCalendarLabel { flex: 1 1 150px; font-size: 16px; }
  .project-calendar-toolbar { display: grid; gap: 6px; }
  #projectCalendarSearch { font-size: 16px; }
  #projectCalendar .project-calendar-scroll { display: none; }
  #projectCalendar .calendar-mobile-list { display: grid; gap: 8px; }
  .calendar-mobile-project { padding: 10px 12px; border: 1px solid var(--er-redesign-line); border-radius: 12px; background: var(--calendar-surface); }
  #projectCalendar .calendar-mobile-project .calendar-project-name { min-height: 34px; }
  .calendar-mini-grid { display: grid; grid-template-columns: repeat(var(--calendar-days),minmax(0,1fr)); min-height: 20px; margin-top: 5px; }
  .calendar-mobile-week-head { min-height: 36px; margin: 0 12px; border-radius: 6px; background: var(--calendar-head); }
  .calendar-mobile-month-axis { display: flex; justify-content: space-between; color: var(--er-redesign-muted); font-size: 12px; margin-inline: 12px; }
  #projectCalendar .calendar-mobile-project .calendar-project-bar { height: 16px; padding: 0; }
  #projectCalendar .calendar-mobile-project .calendar-project-bar:only-of-type { margin-inline: 0; }
  .calendar-coverage { display: grid; gap: 4px; margin-top: 6px; color: var(--er-redesign-muted); font-size: 11px; }
  .calendar-coverage-track { height: 4px; border-radius: 3px; background: var(--calendar-head); }
  .calendar-coverage-track i { display: block; height: 100%; border-radius: inherit; background: var(--er-redesign-accent-ink); }
}
#projectCalendarAssignmentMode { width: min(220px,100%); }
#projectCalendarAssignmentStatus { margin: 0 0 8px; font-size: 13px; }
#projectCalendar .calendar-planned-muted { opacity: .42; }
#projectCalendar .calendar-assigned-day {
  grid-row: 1; z-index: 2; align-self: center; justify-self: center; display: grid; place-items: center;
  width: min(24px,100%); min-width: 0; height: 24px; padding: 0; line-height: 1; border: 1px solid var(--calendar-divider);
  border-radius: 5px; background: var(--project-color); color: #fff; text-shadow: 0 1px 2px #000,0 0 5px #000;
  font-size: 13px; font-weight: 800; cursor: pointer;
}
#projectCalendar .calendar-assigned-day:focus-visible { outline: 2px solid var(--er-redesign-accent-ink); outline-offset: 2px; }
@media (max-width: 800px) {
  #projectCalendar .calendar-mini-grid .calendar-assigned-day { height: 16px; font-size: 10px; }
}

/* Beosztás */
#scheduleView {
  --schedule-surface: var(--er-redesign-surface);
  --schedule-subtle: var(--er-redesign-bg);
  --schedule-line: var(--er-redesign-line);
  --schedule-danger: #b42332;
  --schedule-warning: #815711;
  --schedule-warning-bg: #fff2dc;
  padding: 24px; min-width: 0;
}
:is(:root[data-theme=dark],body.theme-dark) #scheduleView,
:is(:root[data-theme=dark],body.theme-dark) :is(.schedule-new-add-dialog,.schedule-cell-dialog) {
  --schedule-surface: #172331;
  --schedule-subtle: #202e3b;
  --schedule-line: #30404e;
  --schedule-danger: #ffadb4;
  --schedule-warning: #f3ca85;
  --schedule-warning-bg: #382d1d;
}
#appView #scheduleView > .schedule-compact-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 64px; margin: 0 0 12px; padding: 0!important; border: 0; background: none; box-shadow: none;
}
#appView #scheduleView .schedule-compact-header h1 { font-size: 28px!important; margin: 0; }
.schedule-compact-header .header-actions { display: flex; align-items: center; gap: 6px; }
#appView #scheduleView .schedule-unified-toolbar {
  display: grid; gap: 8px; margin: 0 0 12px; padding: 0; border: 0; box-shadow: none; background: none;
}
.schedule-navigation-row, .schedule-period-nav, .schedule-day-nav, .schedule-view-switch, #scheduleWeekFilters {
  display: flex; align-items: center; gap: 6px; min-width: 0;
}
.schedule-navigation-row, #scheduleWeekFilters { flex-wrap: wrap; }
.schedule-view-switch { margin-inline-start: auto; }
#scheduleView .schedule-period-nav button { min-width: 40px; }
#scheduleView #scheduleWeekLabel { color: var(--er-redesign-ink); font-weight: 650; font-size: 18px; }
#scheduleView #scheduleJumpDate { min-height: 40px; width: 148px; border-radius: 8px; }
#scheduleView .schedule-view-switch .active { background: var(--er-redesign-accent-soft); color: var(--er-redesign-accent-ink); border-color: currentColor; }
#scheduleView #scheduleWeekFilters { gap: 12px; }
#scheduleView #scheduleWeekFilters label { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
#scheduleView #scheduleWeekFilters input { accent-color: var(--er-redesign-accent); }
#scheduleLoadStatus { margin-bottom: 10px; color: var(--er-redesign-muted); font-size: 13px; }
#scheduleView .schedule-daily-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin-bottom: 12px; border: 1px solid var(--schedule-line); border-radius: 10px; background: var(--schedule-surface); }
.schedule-daily-summary > * {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 9px 12px; text-align: start;
  border: 0; border-radius: 0; background: none; color: var(--er-redesign-ink);
}
.schedule-daily-summary > :not(:first-child) { border-inline-start: 1px solid var(--schedule-line); }
.schedule-daily-summary strong { font-size: 17px; }
.schedule-daily-summary span { font-size: 12px; }
.schedule-daily-summary button { color: var(--er-redesign-accent-ink); cursor: pointer; }
#scheduleView #scheduleBoard { overflow: visible; min-width: 0; }
#appView #scheduleView .schedule-daily-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-items: start; gap: 12px; }
#appView #scheduleView .schedule-daily-project-card {
  min-width: 0; min-height: 0; padding: 10px 12px; border-radius: 12px; box-shadow: none;
  border: 1px solid var(--schedule-line); border-inline-start: 4px solid var(--schedule-project-color);
}
.schedule-card-header { display: flex; align-items: center; gap: 6px; min-width: 0; }
:is(#scheduleView,.schedule-cell-dialog) .schedule-project-link { flex: 1; min-width: 0; padding: 0; text-align: start; font-size: 14px; font-weight: 650; white-space: normal; overflow-wrap: anywhere; color: var(--er-redesign-accent-ink); }
:is(#scheduleView,.schedule-cell-dialog) .schedule-project-count { flex: none; position: static; width: auto; margin: 0; white-space: nowrap; font-size: 12px; }
#scheduleView .schedule-project-fold { padding: 0; min-width: 32px; min-height: 32px; color: var(--er-redesign-ink); }
:is(#scheduleView,.schedule-cell-dialog) .schedule-menu { position: relative; flex: none; }
:is(#scheduleView,.schedule-cell-dialog) .schedule-menu > summary { display: grid; place-items: center; min-width: 34px; min-height: 34px; padding: 0; list-style: none; border: 1px solid var(--schedule-line,var(--er-redesign-line)); border-radius: 8px; font-size: 20px; cursor: pointer; }
:is(#scheduleView,.schedule-cell-dialog) .schedule-menu > summary::-webkit-details-marker { display: none; }
:is(#scheduleView,.schedule-cell-dialog) .schedule-menu-items { position: absolute; inset: 100% 0 auto auto; z-index: 10; width: 210px; max-width: calc(100vw - 36px); padding: 6px; border: 1px solid var(--schedule-line,var(--er-redesign-line)); border-radius: 8px; background: var(--schedule-surface,var(--er-redesign-surface)); }
:is(#scheduleView,.schedule-cell-dialog) .schedule-menu[open] .schedule-menu-items { display: grid; gap: 4px; }
:is(#scheduleView,.schedule-cell-dialog) .schedule-menu.opens-up .schedule-menu-items { top: auto; bottom: 100%; }
.schedule-card-categories { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.schedule-card-categories span { padding: 2px 6px; border: 1px solid var(--schedule-line,var(--er-redesign-line)); border-radius: 5px; font-size: 11px; }
.schedule-card-activity { padding-block: 4px; font-size: 12px; overflow-wrap: anywhere; }
.schedule-card-activity > strong, .schedule-card-activity small { color: var(--er-redesign-muted); }
.schedule-card-activity > strong { display: block; font-weight: 600; }
.schedule-person-row {
  display: grid; grid-template-columns: 8px minmax(0,1fr) auto auto; align-items: center; gap: 6px; min-height: 45px;
  border-bottom: 1px solid var(--schedule-line,var(--er-redesign-line)); color: var(--er-redesign-ink);
}
.schedule-role-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--schedule-role-color,#4f89bb); }
.schedule-person-row.role-student { --schedule-role-color: #c49a29; }
.schedule-person-row.role-leader { --schedule-role-color: #c67535; }
.schedule-person-row.role-owner { --schedule-role-color: #8c65bd; }
.schedule-person-identity { overflow-wrap: anywhere; min-width: 0; font-size: 14px; font-weight: 600; }
.schedule-person-identity small, .schedule-person-time { display: block; color: var(--er-redesign-muted); font-size: 12px; font-weight: 400; }
.schedule-person-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
:is(#scheduleView,.schedule-cell-dialog) .schedule-person-row .schedule-worker-name { display: block; padding: 0; text-align: start; border: 0; background: none; color: var(--er-redesign-ink); font-size: inherit; }
:is(#scheduleView,.schedule-cell-dialog) .schedule-person-row .schedule-worker-remove { position: static; padding: 0; min-width: 32px; min-height: 32px; border-radius: 8px; color: var(--schedule-danger,#b42332); background: none; border: 1px solid var(--schedule-line,var(--er-redesign-line)); }
.schedule-project-direct { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.schedule-project-direct button { min-height: 36px; padding-inline: 8px; font-size: 12px; border-radius: 8px; }
#scheduleView .schedule-group-handle { color: var(--er-redesign-muted); padding: 0 4px; font-size: 14px; line-height: 1; width: auto; min-height: 0; }
#scheduleView .schedule-matrix-cell .schedule-group-handle { position: absolute; top: 4px; right: 4px; opacity: 0; }
#scheduleView .schedule-matrix-cell:hover .schedule-group-handle, #scheduleView .schedule-matrix-cell:focus-within .schedule-group-handle { opacity: 1; }
.schedule-matrix-scroll { overflow: auto; max-height: max(340px,calc(100dvh - 245px)); isolation: isolate; border: 1px solid var(--schedule-line); border-radius: 12px; background: var(--schedule-surface); }
.schedule-matrix-grid { min-width: calc(250px + 90px * var(--schedule-week-days)); }
.schedule-matrix-head, .schedule-matrix-row { display: grid; grid-template-columns: 250px repeat(var(--schedule-week-days),minmax(90px,1fr)); }
.schedule-matrix-head { position: sticky; top: 0; z-index: 4; min-height: 48px; background: var(--schedule-subtle); }
.schedule-matrix-head > div { display: flex; align-items: center; justify-content: center; padding: 6px; font-size: 12px; font-weight: 650; }
.schedule-matrix-head > .schedule-matrix-project { justify-content: flex-start; background: var(--schedule-subtle); }
.schedule-matrix-project { position: sticky; left: 0; z-index: 2; display: flex; align-items: center; padding: 6px 10px; border-inline-start: 3px solid var(--schedule-project-color,transparent); border-inline-end: 1px solid var(--schedule-line); background: var(--schedule-surface); }
.schedule-matrix-row { min-height: 52px; border-top: 1px solid var(--schedule-line); }
.schedule-matrix-cell { position: relative; min-width: 0; padding: 4px; border-inline-start: 1px solid var(--schedule-line); }
.schedule-matrix-cell.drop-target, .schedule-daily-project-card.drop-target { outline: 2px solid var(--er-redesign-accent-ink); outline-offset: -2px; }
.schedule-matrix-head .is-today, .schedule-matrix-cell.is-today { background: var(--er-redesign-accent-soft); color: var(--er-redesign-accent-ink); }
.schedule-matrix-button { display: grid; place-content: center; width: 100%; min-height: 42px; padding: 3px; border: 1px solid var(--schedule-line); border-radius: 7px; background: var(--schedule-surface); color: var(--er-redesign-ink); text-align: center; }
button.schedule-matrix-button { cursor: pointer; }
button.schedule-matrix-button:hover { border-color: var(--er-redesign-accent-ink); }
.schedule-matrix-button small { display: none; }
.schedule-matrix-button strong { font-size: 14px; }
.schedule-matrix-names { list-style: none; padding: 3px 4px; margin: 0; font-size: 12px; overflow-wrap: anywhere; }
.schedule-matrix-names > li { padding: 2px 0; }
#scheduleView #schedulePool { border: 1px solid var(--schedule-line); border-radius: 12px; background: var(--schedule-surface); margin-top: 12px; box-shadow: none; }
.schedule-pool-list,.schedule-pool-away { padding: 0 12px 10px; }
.schedule-pool-row,.schedule-pool-absence { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--schedule-line); }
.schedule-pool-row small,.schedule-pool-absence small { display: block; color: var(--er-redesign-muted); }
.schedule-pool-absence { font-size: 12px; }
.schedule-pool-away h3 { margin: 4px 0; font-size: 13px; }
dialog.schedule-new-add-dialog, dialog.schedule-cell-dialog {
  width: min(960px,calc(100% - 24px)); max-width: none; max-height: 90dvh;
  border-radius: 14px; background: var(--schedule-surface,var(--er-redesign-surface)); color: var(--er-redesign-ink);
}
dialog.schedule-cell-dialog { width: min(620px,calc(100% - 24px)); }
.schedule-cell-dialog .ui-scroll-dialog-body { min-height: 240px; }
.schedule-new-add-dialog .ui-scroll-dialog-body { display: grid; gap: 14px; }
.schedule-worker-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; margin-top: 8px; }
.schedule-new-add-dialog .schedule-worker-option { display: grid; grid-template-columns: 20px minmax(0,1fr); border-color: var(--schedule-line,var(--er-redesign-line)); background: var(--schedule-subtle,var(--er-redesign-bg)); min-height: 44px; }
.schedule-new-add-dialog .schedule-worker-option:has(input:checked) { border-color: var(--er-redesign-accent-ink); background: var(--er-redesign-accent-soft); }
.schedule-new-add-dialog .schedule-worker-option input { accent-color: var(--er-redesign-accent); }
.schedule-new-add-dialog .schedule-worker-option small { display: block; color: var(--er-redesign-muted); }
.schedule-new-add-dialog .schedule-worker-option.is-blocked { opacity: 1; background: var(--schedule-warning-bg,#fff2dc); cursor: default; }
.schedule-new-add-dialog .schedule-worker-option .schedule-worker-reason { color: var(--schedule-warning,#815711); }
.schedule-worker-picker-head h3 { margin: 0 0 6px; font-size: 15px; }
.schedule-new-add-dialog [data-worker-filter],.schedule-activity-field input { width: 100%; }
.schedule-new-add-dialog :is(input:not([type=checkbox]),select) { min-height: 42px; border-radius: 8px; }
.schedule-activity-field small,[data-schedule-add-summary] { font-size: 12px; }
[data-schedule-add-summary] { margin-inline-end: auto; }
@media (min-width:1650px) { #appView #scheduleView .schedule-daily-grid { grid-template-columns: repeat(4,minmax(0,1fr)); } }
@media (max-width:1100px) { #appView #scheduleView .schedule-daily-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width:700px) {
  #scheduleView { padding: 12px 12px max(16px,env(safe-area-inset-bottom)); }
  #appView #scheduleView .schedule-compact-header h1 { font-size: 24px!important; }
  #scheduleView .schedule-navigation-row { display: grid; grid-template-columns: minmax(0,1fr) auto; }
  #scheduleView #scheduleWeekLabel { grid-row: 1; grid-column: 1/-1; font-size: 16px; }
  #scheduleView #scheduleJumpDate { width: min(100%,150px); font-size: 16px; }
  #scheduleView .schedule-view-switch { grid-column: 1/-1; margin: 0; }
  #scheduleView :is(.schedule-project-fold,.schedule-period-nav button,.schedule-view-switch button,.schedule-menu>summary,.schedule-project-direct button,.schedule-pool-row button), #appView #scheduleView #addScheduleBtn { min-height: 44px; }
  #scheduleView .schedule-project-fold,#scheduleView .schedule-menu>summary { min-width: 44px; }
  #appView #scheduleView .schedule-daily-grid { grid-template-columns: minmax(0,1fr); gap: 9px; }
  .schedule-daily-summary > * { display: grid; padding: 6px 8px; }
  #scheduleView .schedule-person-row .schedule-worker-remove,.schedule-cell-dialog .schedule-person-row .schedule-worker-remove { min-height: 44px; min-width: 44px; }
  .schedule-matrix-scroll { overflow: visible; max-height: none; border: 0; background: transparent; }
  .schedule-matrix-grid { display: grid; min-width: 0; gap: 8px; }
  .schedule-matrix-head { display: none; }
  .schedule-matrix-row { grid-template-columns: repeat(var(--schedule-week-days),minmax(0,1fr)); border: 1px solid var(--schedule-line); border-radius: 10px; overflow: hidden; background: var(--schedule-surface); }
  .schedule-matrix-project { grid-column: 1/-1; position: static; min-height: 44px; border-inline-end: 0; }
  .schedule-matrix-cell { padding: 2px; }
  .schedule-matrix-button { min-height: 44px; }
  .schedule-matrix-button small { display: block; font-size: 10px; }
  .schedule-matrix-button strong { font-size: 12px; }
  .schedule-matrix-names { padding: 2px 0; font-size: 10px; }
  .schedule-worker-list, .schedule-add-context { grid-template-columns: minmax(0,1fr); }
  dialog.schedule-new-add-dialog, dialog.schedule-cell-dialog { width: calc(100% - max(8px,env(safe-area-inset-left)) - max(8px,env(safe-area-inset-right))); max-height: min(94dvh,calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px)); }
  .schedule-new-add-dialog :is(input:not([type=checkbox]),select) { font-size: 16px; min-height: 44px; }
  [data-schedule-add-summary] { flex-basis: 100%; }
  .schedule-new-add-dialog .modal-actions > button { flex: 1; min-height: 44px; }
}

/* ÉpítRend AI */
#aiAssistantView {
  --ai-surface: var(--er-redesign-surface);
  --ai-subtle: var(--er-redesign-bg);
  --ai-border: var(--er-redesign-line);
  padding: 24px;
  min-width: 0;
}
:is(:root[data-theme=dark],body.theme-dark) #aiAssistantView {
  --ai-surface: #172331;
  --ai-subtle: #202e3b;
  --ai-border: #30404e;
}
#aiAssistantView :is(.ai-page-header,.ai-global-shell) { max-width: 1000px; margin-inline: auto; }
#aiAssistantView .ai-page-header { margin-bottom: 16px; }
#aiAssistantView .ai-page-header h1 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 28px; font-weight: 700; }
#aiAssistantView .ai-page-header p { margin: 4px 0 0; font-size: 14px; }
#aiGlobalOrb { position: relative; display: inline-flex; color: var(--er-redesign-accent-ink); }
#aiGlobalOrb svg { width: 24px; height: 24px; }
#aiGlobalOrb.is-live::after {
  content: ""; position: absolute; inset: auto -2px -2px auto; width: 8px; height: 8px;
  border: 1px solid var(--ai-surface); border-radius: 50%; background: currentColor;
}
#aiAssistantView .ai-global-shell { border-radius: 12px; border: 1px solid var(--ai-border); background: var(--ai-surface); color: var(--er-redesign-ink); }
#aiAssistantView .ai-global-transcript {
  display: grid; gap: 8px; padding: 16px;
  max-height: clamp(4rem,calc(var(--ai-viewport-height,100dvh) - 23rem),28rem); overflow-y: auto;
}
#aiAssistantView .ai-global-empty h2 { font-size: 20px; font-weight: 650; margin: 0 0 4px; }
#aiAssistantView .ai-global-empty p { font-size: 14px; color: var(--er-redesign-muted); margin: 0; }
#aiAssistantView .ai-global-msg {
  width: fit-content; max-width: min(85%,65ch); padding: 8px 12px; border: 1px solid var(--ai-border);
  border-radius: 10px; background: var(--ai-subtle); font-size: 14px; line-height: 1.45;
}
#aiAssistantView .ai-global-msg.is-user { justify-self: end; background: var(--er-redesign-accent-soft); }
#aiAssistantView .ai-global-msg > span { display: block; margin-bottom: 2px; color: var(--er-redesign-muted); font-size: 12px; font-weight: 650; }
#aiAssistantView .ai-global-quickbar { display: grid; gap: 8px; padding: 0 16px 14px; }
#aiAssistantView :is(.ai-global-controls,.ai-global-examples) { display: flex; gap: 8px; flex-wrap: wrap; }
#aiAssistantView .ai-global-controls button, #aiAssistantView .ai-global-examples button { min-height: 44px; border-radius: 8px; }
#aiAssistantView :is(.ai-global-controls,.ai-global-examples) .secondary-btn { background: var(--ai-subtle); color: var(--er-redesign-ink); border-color: var(--ai-border); }
#aiGlobalQuickForm { display: grid; gap: 8px; scroll-margin: 8px; }
#aiGlobalQuickInput { width: 100%; min-height: 64px; font-size: 16px; background: var(--ai-subtle); color: var(--er-redesign-ink); border-color: var(--ai-border); border-radius: 8px; }
#aiGlobalQuickInput::placeholder { color: var(--er-redesign-muted); }
#aiAssistantView :is(button,textarea,[role=log]):focus-visible { outline: 2px solid var(--er-redesign-accent-ink); outline-offset: 2px; }
#aiAssistantView :is(.ai-global-status,.ai-global-policy) { margin: 0; color: var(--er-redesign-muted); font-size: 12px; line-height: 1.4; }
#aiAssistantView .ai-global-status { font-weight: 650; }
@media (max-width:800px) {
  #aiAssistantView { padding: 12px 12px max(16px,env(safe-area-inset-bottom)); }
  #aiAssistantView .ai-page-header { margin-bottom: 10px; }
  #aiAssistantView .ai-page-header h1 { font-size: 24px; }
  #aiAssistantView .ai-global-transcript { padding: 12px; }
  #aiAssistantView .ai-global-quickbar { padding: 0 12px 12px; }
  #aiAssistantView .ai-global-controls button { flex: 1 0 auto; font-size: 13px; }
}

/* Tasks workcenter */
#appView #tasksView .page-header {min-height:64px;margin:0 0 12px;padding:0;align-items:center;gap:12px}
#tasksView .page-header h1 {margin:0;font-size:28px;font-weight:700}
#tasksView .page-header p {margin:2px 0 0;font-size:13px;color:var(--ui-muted)}
#tasksView .header-actions {display:flex;align-items:center;gap:8px}
#tasksView .header-actions > button {min-height:44px}
#taskFilterToggle, #taskMobileSort, #tasksView .task-tab-short, #tasksView .task-cards {display:none}
#tasksView .workcenter-tabs {
  display:flex;flex-wrap:nowrap;gap:5px;overflow:auto;margin:0 0 12px;padding:0 0 5px;
  border:0;border-bottom:1px solid var(--ui-border);border-radius:0;background:transparent
}
#tasksView .workcenter-tab {
  flex:0 0 auto;width:auto;min-height:44px;padding:8px 16px;white-space:nowrap;
  background:transparent;color:var(--ui-muted);box-shadow:none;border-radius:8px
}
#tasksView .workcenter-tab.active {color:var(--ui-accent-text,#0f6f67);border-color:currentColor;background:var(--ui-accent-soft,#e7f4f1)}
#tasksView .workcenter-tab[hidden], #tasksView [hidden] {display:none}
#tasksView .task-filters {
  display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;margin:0 0 12px;padding:0;border:0;box-shadow:none;background:transparent
}
#taskSearch {width:min(100%,380px);min-width:0}
#taskFilterFields {display:flex;flex-wrap:wrap;gap:8px}
#taskProjectFilter {width:235px}
#taskStatusFilter {width:175px}
#tasksView .task-filters :is(input,select) {min-height:42px;max-width:100%;border-radius:8px}
#taskResultCount {white-space:nowrap;font-size:13px}
#tasksTable {min-width:0;border-radius:12px}
.task-table-scroll {max-width:100%;overflow:auto}
#tasksView .task-list-table {width:100%;min-width:730px;font-size:14px}
#tasksView .task-list-table th {font-size:12px;font-weight:600;color:var(--ui-text);background:var(--ui-surface-muted,var(--ui-surface))}
.task-list-table th button {border:0;padding:0;background:transparent;color:inherit;font:inherit;cursor:pointer;white-space:nowrap}
.task-list-table th[aria-sort] button {color:var(--ui-accent-text,#0f6f67)}
#tasksView .task-list-table td {height:48px;padding:8px 10px;border-color:var(--ui-border);background:var(--ui-surface);color:var(--ui-text);vertical-align:middle;overflow-wrap:anywhere}
#tasksView .task-list-table tbody tr:hover td {background:var(--ui-surface-muted,var(--ui-surface))}
#tasksView .task-list-table td:last-child {width:1%;white-space:nowrap}
#tasksView .task-list-table small,#tasksView .task-card small {display:block;margin-top:2px;font-size:12px;color:var(--ui-muted)}
#tasksView .task-status-open {color:#315e91;background:#e5eff8;border-color:transparent}
#tasksView .task-status-done {color:#247447;background:#e6f3eb;border-color:transparent}
#tasksView :is(.task-card,.task-list-table) .task-overdue {color:#b42332;font-weight:600}
.task-project-link {border:0;padding:0;background:none;color:var(--ui-accent-text,#0f6f67);text-align:left;font:inherit;font-weight:600;cursor:pointer;overflow-wrap:anywhere}
.task-project-link:hover,.task-project-link:focus-visible {text-decoration:underline}
#tasksView .task-actions {display:flex;justify-content:flex-end;gap:5px;align-items:center;white-space:nowrap}
#tasksView .task-actions > .small-btn {flex:0 0 auto}
#tasksView .task-actions .customer-menu > div {
  min-width:max-content;padding:4px;display:grid;gap:3px;
  border:1px solid var(--ui-border);border-radius:8px;background:var(--ui-surface);box-shadow:0 4px 16px #0e172224
}
#tasksView .task-actions .customer-menu > div > button {position:static;text-align:left;box-shadow:none}
.task-editor[open], .task-delete-dialog[open] {
  box-sizing:border-box;width:min(1000px,calc(100vw - 32px));max-width:none;max-height:90dvh;overflow:hidden;
  padding:0;color:var(--ui-text);background:var(--ui-surface);border:1px solid var(--ui-border);border-radius:12px
}
.task-delete-dialog[open] {width:min(500px,calc(100vw - 32px))}
.task-editor > form,.task-delete-dialog > form {display:flex;flex-direction:column;min-height:0;max-height:inherit;overflow:hidden}
.task-editor :is(.modal-head,.modal-actions),.task-delete-dialog :is(.modal-head,.modal-actions) {flex:none;margin:0;padding:14px 24px;border-color:var(--ui-border)}
.task-editor .modal-head h2, .task-delete-dialog .modal-head h2,.task-editor .modal-head p {margin:0}
.task-editor .ui-scroll-dialog-body,.task-delete-dialog .ui-scroll-dialog-body {
  flex:1;min-height:0;width:100%;max-width:100%;overflow:auto;overscroll-behavior:contain;padding:12px 24px;margin:0;box-sizing:border-box
}
.task-editor .task-entry-row {
  display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1.45fr) minmax(0,1.45fr) minmax(126px,1fr) auto;
  align-items:start;gap:10px;padding:10px 0;border:0;border-bottom:1px solid var(--ui-border)
}
.task-editor .task-entry-row > * {min-width:0;max-width:100%}
.task-editor .task-entry-row > label {display:grid;gap:4px;font-size:13px}
.task-editor .task-entry-row :is(input,select) {min-height:44px;max-width:100%;width:100%;font-size:14px;box-sizing:border-box}
.task-editor .task-entry-row :is([data-remove-row],.person-combobox-input) {min-height:44px}
.task-editor [data-remove-row] {margin-top:23px}
.task-editor .task-linked-note {grid-column:1/-1;margin:0;font-size:12px}
.task-editor .task-linked-note[hidden] {display:none}
.task-editor #taskAddRow {margin-top:12px}
.task-editor .modal-actions [data-task-row-count] {margin-inline-end:auto}
.task-editor .modal-actions button,.task-delete-dialog .modal-actions button {min-height:44px}
.task-delete-dialog dl {display:grid;gap:9px;margin:0}
.task-delete-dialog dl div {display:grid;grid-template-columns:minmax(0,100px) minmax(0,1fr);gap:8px}
.task-delete-dialog dt {color:var(--ui-muted)}
.task-delete-dialog dd {margin:0;font-weight:600;overflow-wrap:anywhere}
:root[data-theme="dark"] #tasksView .task-project-link,:root[data-theme="dark"] #tasksView th[aria-sort] button {color:#81cfc1}
:root[data-theme="dark"] #tasksView .workcenter-tab.active {color:#81cfc1;background:#202e3b}
:root[data-theme="dark"] #tasksView .task-status-open {color:#9bbce6;background:#233345}
:root[data-theme="dark"] #tasksView .task-status-done {color:#85d4a0;background:#20382c}
:root[data-theme="dark"] #tasksView :is(.task-card,.task-list-table) .task-overdue {color:#f3a5a5}
@media(max-width:800px) {
  #appView #tasksView {max-width:none;padding-bottom:calc(80px + env(safe-area-inset-bottom))}
  #appView #tasksView .page-header {min-height:0;align-items:center;flex-wrap:wrap;margin-bottom:10px}
  #tasksView .page-header h1 {font-size:24px}
  #tasksView .page-header p,#tasksView .task-tab-full {display:none}
  #tasksView .task-tab-short {display:inline}
  #tasksView .header-actions {width:auto}
  #tasksView .header-actions > button {width:auto;padding-inline:10px}
  #tasksView .workcenter-tabs {margin-bottom:8px}
  #tasksView .workcenter-tab {padding-inline:11px;font-size:13px}
  #taskFilterToggle {display:inline-flex}
  #taskFilterToggle.has-filters {border-color:currentColor;color:var(--ui-accent-text,#0f6f67)}
  #taskSearch {width:100%}
  #taskFilterFields {display:none}
  #taskFilterFields.is-open {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%}
  #taskFilterFields.is-open > select {width:100%;min-width:0}
  #taskMobileSort {display:block;grid-column:1/-1}
  #tasksView .task-filters :is(input,select) {font-size:16px;min-height:44px}
  #tasksView .task-table-scroll {display:none}
  #tasksView .task-cards {display:grid;gap:8px}
  #tasksView .task-cards .task-card {
    display:grid;gap:4px;padding:10px 12px;min-width:0;border:1px solid var(--ui-border);
    border-radius:12px;background:var(--ui-surface);color:var(--ui-text);overflow-wrap:anywhere
  }
  .task-card > header,.task-card-footer {display:flex;justify-content:space-between;align-items:center;gap:6px}
  .task-card > header strong {font-size:15px}
  .task-card-detail,.task-card-footer {font-size:13px}
  .task-card-detail {display:flex;flex-wrap:wrap;align-items:center;gap:4px 12px}
  .task-card-detail span {color:var(--ui-muted)}
  .task-card-footer {flex-wrap:wrap}
  .task-card .task-project-link,.task-card .task-actions :is(.small-btn,summary) {min-height:44px;min-width:44px}
  .task-card .task-actions .customer-menu {min-width:44px}
  .task-card .task-actions .customer-menu > div {min-width:0;max-width:100%;white-space:normal}
  .task-card .task-project-link {padding-block:4px}
  .task-editor[open] {
    position:fixed;inset:0;margin:0;width:100%;height:100dvh;max-height:100dvh;border-radius:0;
    padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)
  }
  .task-editor > form {height:100%}
  .task-editor :is(.modal-head,.modal-actions,.ui-scroll-dialog-body),.task-delete-dialog :is(.modal-head,.modal-actions,.ui-scroll-dialog-body) {padding-inline:16px}
  .task-editor .task-entry-row {grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 8px;padding:12px 0}
  .task-editor .task-entry-row :is(label:first-child,label:nth-child(3),.task-linked-note) {grid-column:1/-1}
  .task-editor [data-remove-row] {margin-top:0}
  .task-editor .task-entry-row :is(input,select) {font-size:16px}
  .task-editor .modal-actions {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .task-editor .modal-actions button {width:100%}
  .task-editor .modal-actions [data-task-row-count] {grid-column:1/-1}
  .task-editor .modal-actions [data-task-row-count]:empty {display:none}
}

/* Contract workspace */
#appView #contractsView {width:100%;max-width:none;min-width:0;align-self:stretch;box-sizing:border-box}
#appView #contractsView .page-header {min-height:64px;margin:0 0 12px;padding:0;align-items:center;gap:12px}
#contractsView .page-header h1 {margin:0;font-size:28px;font-weight:700}
#contractsView .header-actions {display:flex;gap:8px;flex-wrap:wrap}
#contractsView .header-actions > button {min-height:44px}
#contractsView .contract-kpis {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-bottom:12px}
.contract-kpi {display:grid;gap:3px;padding:10px 12px;text-align:left;font:inherit;background:var(--ui-surface);color:var(--ui-text);border:1px solid var(--ui-border);border-radius:12px;cursor:pointer}
.contract-kpi span {color:var(--ui-muted);font-size:12px}
.contract-kpi strong {font-size:19px}
.contract-kpi[aria-pressed=true] {border-color:var(--ui-accent-text,#0f6f67)}
#contractsView .quote-toolbar {display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;padding:0;margin:0 0 12px}
#contractsView .quote-search-wrap {flex:1 1 320px;min-width:0;max-width:440px}
#contractsView .quote-search-wrap input {min-width:0;width:100%;min-height:42px}
.contract-list-filters > summary {display:none}
.contract-list-filters > div {display:flex;gap:8px;align-items:center}
#contractStatusFilter {min-height:42px}
#contractMobileSort {display:none}
#contractsTable {min-width:0}
.contract-table-scroll {max-width:100%;overflow:auto}
.contract-table {width:100%;min-width:1040px;font-size:14px}
#contractsView .contract-table :is(th,td) {padding:8px 10px;overflow-wrap:anywhere;vertical-align:middle}
#contractsView .contract-table th {background:var(--ui-surface-muted,var(--ui-surface));color:var(--ui-text);font-size:12px}
.contract-table th button {border:0;background:none;padding:0;color:inherit;font:inherit;font-weight:650;cursor:pointer}
.contract-table th[aria-sort] button,.contract-link {color:var(--ui-accent-text,#0f6f67)}
#contractsView .contract-table td {height:56px;background:var(--ui-surface);color:var(--ui-text);border-color:var(--ui-border)}
#contractsView .contract-table tr:hover td {background:var(--ui-surface-muted,var(--ui-surface))}
.contract-number {white-space:nowrap;text-align:right!important;font-variant-numeric:tabular-nums}
.contract-link {border:0;background:none;padding:0;font:inherit;text-align:left;font-weight:600;cursor:pointer;overflow-wrap:anywhere}
.contract-link small {display:block;color:var(--ui-muted);font-weight:500}
.contract-link:hover {text-decoration:underline}
.contract-list-actions {display:flex;align-items:center;flex-wrap:wrap;gap:5px;white-space:nowrap}
.contract-list-actions > a {min-height:34px;padding:4px 10px}
.contract-list-actions .customer-menu > div {display:grid;gap:3px;padding:4px}
.contract-list-actions .customer-menu > div button {text-align:left}
.contract-mobile-cards {display:none}
:is(#contractsView,.contract-record,.contract-editor) .quote-status-pill {
  background:var(--ui-surface-muted,#edf0f3);color:var(--ui-muted,#526571);border-color:transparent
}
:is(#contractsView,.contract-record,.contract-editor) .quote-status-pill:is(.quote-status-pending_approval,.quote-status-pending_close) {background:#fff3db;color:#85570e}
:is(#contractsView,.contract-record,.contract-editor) .quote-status-pill:is(.quote-status-pending_signature,.quote-status-approved) {background:#e5eff8;color:#315e91}
:is(#contractsView,.contract-record,.contract-editor) .quote-status-pill.quote-status-in_progress {background:#dff0ed;color:#0f6f67}
:is(#contractsView,.contract-record,.contract-editor) .quote-status-pill:is(.quote-status-signed,.quote-status-closed) {background:#e6f3eb;color:#247447}
:is(#contractsView,.contract-record,.contract-editor) .quote-status-pill:is(.quote-status-rejected,.quote-status-terminated) {background:#fce8e8;color:#b42332}
dialog:is(.contract-editor,.contract-record,.contract-template-dialog)[open] {
  box-sizing:border-box;display:flex;flex-direction:column;width:min(1360px,calc(100vw - 32px));max-width:none;
  height:92dvh;max-height:92dvh;min-height:0;margin:auto;padding:0;overflow:hidden;color:var(--ui-text);
  background:var(--ui-surface);border:1px solid var(--ui-border);border-radius:12px
}
dialog.contract-record[open] {width:min(1200px,calc(100vw - 32px))}
dialog.contract-template-dialog[open] {width:min(850px,calc(100vw - 32px));height:auto}
dialog:is(.contract-editor,.contract-template-dialog)[open] > form {
  display:flex;flex-direction:column;flex:1;min-width:0;min-height:0;max-height:inherit;overflow:hidden
}
:is(.contract-record,.contract-editor,.contract-template-dialog) :is(.modal-head,.modal-actions,.contract-tabs) {flex:none;min-width:0;margin:0}
:is(.contract-record,.contract-editor,.contract-template-dialog) :is(.modal-head,.modal-actions) {padding:12px 20px;border-color:var(--ui-border)}
:is(.contract-record,.contract-editor,.contract-template-dialog) .modal-head h2 {margin:0 0 4px;overflow-wrap:anywhere}
:is(.contract-record,.contract-editor,.contract-template-dialog) .contract-scroll {
  min-height:0;min-width:0;width:100%;max-width:100%;box-sizing:border-box;flex:1;margin:0;padding:16px 20px;
  overflow:auto;overscroll-behavior:contain
}
.contract-tabs {display:flex;flex-wrap:nowrap;overflow:auto;gap:5px;padding:0 20px 6px}
.contract-tabs > .tab {flex:0 0 auto;min-height:44px;padding:7px 12px;white-space:nowrap}
.contract-tabs > .tab.active {color:var(--ui-accent-text,#0f6f67);border-color:currentColor;background:var(--ui-accent-soft,#e7f4f1)}
.contract-group + .contract-group {margin-top:16px}
.contract-group h3,.contract-panel-head h3 {margin:0 0 8px;font-size:15px}
.contract-group .form-grid {gap:10px 16px}
.contract-group :is(input,select) {min-height:42px;min-width:0;width:100%;max-width:100%;box-sizing:border-box}
.contract-date-fields {grid-template-columns:repeat(3,minmax(0,1fr))}
.contract-group :is(label,p) {min-width:0}
.contract-group .form-grid > [hidden],.contract-scroll > [hidden],.contract-editor [data-contract-editor-error][hidden] {display:none}
.contract-editor [data-contract-editor-error] {margin:4px 20px}
.contract-editor [data-contract-editor-gross] {margin-inline-end:auto}
.contract-item-table {min-width:780px}
.contract-item-table td {padding:6px;vertical-align:middle}
.contract-item-table input {min-height:44px;box-sizing:border-box;width:100%;min-width:0}
.contract-item-table td:first-child {width:32%}
.contract-item-table td:nth-child(2) {width:10%}
.contract-item-table td:nth-child(3) {width:9%}
.contract-item-table td:nth-child(4) {width:15%}
.contract-item-table td:nth-child(5) {width:9%}
.contract-item-table td:nth-child(6) {text-align:right;white-space:nowrap}
.contract-editor .contract-section-editor {padding:10px}
.contract-editor .contract-section-editor textarea,.contract-template-dialog textarea {width:100%;min-height:92px}
.contract-metrics {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(166px,100%),1fr));gap:8px;margin:0 0 12px}
.contract-metrics > div {min-width:0;padding:8px 12px;border:1px solid var(--ui-border);border-radius:8px}
.contract-metrics dt {color:var(--ui-muted);font-size:12px}
.contract-metrics dd {margin:2px 0 0;font-weight:650;overflow-wrap:anywhere}
.contract-reading {max-width:84ch;color:var(--ui-text);line-height:1.55}
.contract-reading :is(h3,p),.contract-long-text {white-space:pre-wrap;overflow-wrap:anywhere}
.contract-reading h3 {margin:0 0 4px;font-size:16px}
.contract-reading p {margin:0 0 14px}
.contract-history-row,.contract-template-row {display:flex;align-items:center;flex-wrap:wrap;gap:4px 12px;padding:8px 0;border-bottom:1px solid var(--ui-border);overflow-wrap:anywhere}
.contract-history-row small,.contract-template-row small {color:var(--ui-muted)}
.contract-template-row button {margin-inline-start:auto}
.contract-inline,.contract-panel-head {display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px}
.contract-panel-head {justify-content:space-between;margin-bottom:8px}
:root[data-theme=dark] :is(#contractsView,.contract-record,.contract-editor) .quote-status-pill:is(.quote-status-pending_approval,.quote-status-pending_close) {background:#382d1d;color:#f3ca85}
:root[data-theme=dark] :is(#contractsView,.contract-record,.contract-editor) .quote-status-pill:is(.quote-status-pending_signature,.quote-status-approved) {background:#223449;color:#9bbce6}
:root[data-theme=dark] :is(#contractsView,.contract-record,.contract-editor) .quote-status-pill.quote-status-in_progress {background:#223a37;color:#81cfc1}
:root[data-theme=dark] :is(#contractsView,.contract-record,.contract-editor) .quote-status-pill:is(.quote-status-signed,.quote-status-closed) {background:#20382c;color:#85d4a0}
:root[data-theme=dark] :is(#contractsView,.contract-record,.contract-editor) .quote-status-pill:is(.quote-status-rejected,.quote-status-terminated) {background:#40242a;color:#f3a5a5}
:root[data-theme=dark] :is(.contract-link,.contract-tabs > .tab.active) {color:#81cfc1}
@media(max-width:800px) {
  #appView #contractsView .page-header {min-height:0;flex-wrap:wrap}
  #contractsView .page-header h1 {font-size:24px}
  #contractsView .contract-kpis {grid-template-columns:repeat(2,minmax(0,1fr))}
  #contractsView .quote-search-wrap {flex:1 1 100%;max-width:none}
  .contract-list-filters > summary {display:list-item;cursor:pointer;line-height:44px}
  .contract-list-filters > div {display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .contract-list-filters :is(select,#contractMobileSort) {display:block;min-width:0;width:100%;font-size:16px}
  #contractsView .contract-table-scroll {display:none}
  .contract-mobile-cards {display:grid;gap:8px}
  .contract-mobile-card {padding:10px 12px;border:1px solid var(--ui-border);border-radius:12px;background:var(--ui-surface);color:var(--ui-text);overflow-wrap:anywhere}
  .contract-mobile-card :is(header,.contract-mobile-values) {display:flex;justify-content:space-between;align-items:center;gap:6px}
  .contract-mobile-meta,.contract-mobile-values {font-size:13px;color:var(--ui-muted);margin:2px 0}
  .contract-list-actions :is(.small-btn,a,summary) {min-height:44px;min-width:44px}
  dialog:is(.contract-editor,.contract-record)[open] {
    position:fixed;inset:0;width:100%;height:100dvh;max-height:100dvh;margin:0;border-radius:0;
    padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)
  }
  dialog:is(.contract-editor,.contract-record) :is(.modal-head,.modal-actions,.contract-scroll) {padding:10px 14px}
  .contract-tabs {padding-inline:10px}
  .contract-tabs > .tab {font-size:13px;padding-inline:9px}
  :is(.contract-editor,.contract-template-dialog) :is(input,select,textarea) {font-size:16px;min-height:44px}
  .contract-editor .form-grid {grid-template-columns:minmax(0,1fr)}
  .contract-editor .contract-date-fields {grid-template-columns:repeat(2,minmax(0,1fr))}
  .contract-date-fields > label:first-child {grid-column:1/-1}
  .contract-editor .modal-actions {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
  .contract-editor [data-contract-editor-gross],.contract-editor .modal-actions > a {grid-column:1/-1}
  .contract-editor [data-contract-editor-gross] {margin:0}
  .contract-editor .modal-actions :is(button,a),.contract-record .modal-actions :is(button,a) {min-height:44px}
  .contract-item-table,.contract-item-table tbody {display:block;min-width:0;width:100%}
  .contract-item-table thead {display:none}
  .contract-item-table tr {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 8px;border-block-end:1px solid var(--ui-border);padding:8px 0}
  .contract-item-table tr td {width:auto!important;min-width:0;border:0;padding:0}
  .contract-item-table tr td:first-child {grid-column:1/-1}
  .contract-item-table tr td:not(:last-child)::before {display:block;color:var(--ui-muted);font-size:12px;content:attr(data-label)}
}

/* Approval workspace */
#appView #approvalsView {width:100%;max-width:none;min-width:0;box-sizing:border-box}
#appView #approvalsView .page-header {min-height:64px;padding:0;margin:0 0 12px;align-items:center;gap:10px}
#approvalsView .page-header h1 {margin:0;font-size:28px;font-weight:700}
#approvalsView .header-actions {display:flex;align-items:center;gap:8px;flex-wrap:wrap}
#approvalPendingCount {font-size:13px;font-weight:650}
#approvalsView .approval-workspace-tabs,.approval-type-chips {display:flex;flex-wrap:nowrap;overflow:auto;gap:5px;margin:0 0 10px}
#approvalsView .approval-workspace-tabs .tab,.approval-type-chips button {min-height:42px;flex:none;white-space:nowrap}
#approvalsView .approval-workspace-tabs .tab.active,.approval-type-chips button[aria-pressed=true] {color:var(--ui-accent-text,#0f6f67);border-color:currentColor;background:var(--ui-accent-soft,#e7f4f1)}
.approval-workspace-filters,.approval-extra-filters > div,.approval-list-tools {display:flex;flex-wrap:wrap;gap:8px 12px;align-items:end;margin-bottom:8px;min-width:0}
.approval-workspace-filters > input {min-width:0;width:min(100%,340px)}
.approval-extra-filters > summary,#approvalMobileSort,.approval-mobile-list {display:none}
.approval-extra-filters > div {margin:0}
.approval-extra-filters label {display:grid;gap:3px;font-size:12px;min-width:0}
.approval-workspace-filters :is(input,select) {min-height:42px;min-width:0;max-width:100%}
.approval-list-tools {align-items:center}
#approvalResultCount,#approvalHistoryScope {color:var(--ui-muted);font-size:13px}
#approvalsView [hidden],.approval-batch-dialog [hidden],.approval-decision-dialog [hidden] {display:none}
.approval-table-scroll {max-width:100%;overflow:auto}
#approvalsView .approval-compact-table {width:100%;min-width:890px;font-size:14px}
#approvalsView .approval-compact-table th {background:var(--ui-surface-muted,var(--ui-surface));color:var(--ui-text);font-size:12px}
.approval-compact-table th button {border:0;padding:0;background:none;color:inherit;font:inherit;font-weight:650;cursor:pointer}
.approval-compact-table th[aria-sort] button {color:var(--ui-accent-text,#0f6f67)}
#approvalsView .approval-compact-table td {height:44px;vertical-align:middle;background:var(--ui-surface);color:var(--ui-text);border-color:var(--ui-border);padding:6px 9px}
.approval-compact-table td:nth-child(1) {width:44px}
.approval-compact-table td:nth-child(6) {white-space:nowrap}
.approval-compact-table td:last-child {width:1%;white-space:nowrap}
.approval-brief {display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere}
.approval-selection-hit {display:inline-grid;place-items:center;min-width:36px;min-height:36px;cursor:pointer;margin:0}
.approval-selection-hit input[type=checkbox] {appearance:auto;width:18px;height:18px;min-height:0;max-width:none;margin:0;accent-color:#0f6f67}
.approval-mobile-row.is-selected,#approvalsView .approval-compact-table tr.is-selected td {background:color-mix(in srgb,#0f6f67 9%,var(--ui-surface))}
.approval-expanded-content {display:grid;gap:6px;min-width:0;padding:8px 4px;color:var(--ui-text);font-size:13px}
.approval-expanded-content > p,.approval-note {margin:0}
.approval-note {white-space:pre-wrap;overflow-wrap:anywhere}
.approval-expanded-content .approval-work-segments {display:grid;gap:0}
.approval-expanded-content .approval-work-segment {min-width:0;padding:6px 0;background:transparent;border:0;border-bottom:1px solid var(--ui-border);border-radius:0}
.approval-work-place,.approval-related-link {overflow-wrap:anywhere}
.approval-related-link {padding:0;border:0;background:transparent;color:var(--ui-accent-text,#0f6f67);font:inherit;text-align:left;cursor:pointer}
.approval-related-link:hover {text-decoration:underline}
.approval-inline-actions {display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:4px 0}
.approval-inline-actions button {min-height:44px}
#approvalsView .approval-status-pending {color:#85570e;background:#fff3db}
#approvalsView .approval-status-approved {color:#247447;background:#e6f3eb}
#approvalsView .approval-status-rejected {color:#b42332;background:#fce8e8}
.approval-bulk-bar {
  position:fixed;inset:auto 24px 12px auto;z-index:38;display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px;
  margin-top:12px;padding:10px;border:1px solid var(--ui-border);border-radius:12px;background:var(--ui-surface);color:var(--ui-text);
  box-shadow:0 4px 18px #0e17222e
}
.approval-bulk-bar[hidden],body:not(:has(#appView:not([hidden]) #approvalsView:not([hidden]))) .approval-bulk-bar {display:none}
#approvalsView.has-approval-selection {padding-bottom:88px}
.approval-bulk-bar strong {margin-inline-end:auto}
.approval-bulk-bar button {min-height:44px}
.approval-batch-report {padding:8px 12px;margin:6px 0 10px;border:1px solid var(--ui-border);border-radius:8px;background:var(--ui-surface)}
.approval-batch-report ul {margin:6px 0 0;padding-inline-start:20px}
dialog:is(.approval-batch-dialog,.approval-decision-dialog)[open] {
  box-sizing:border-box;width:min(610px,calc(100vw - 24px));max-width:none;max-height:90dvh;overflow:hidden;padding:0;color:var(--ui-text);background:var(--ui-surface)
}
dialog:is(.approval-batch-dialog,.approval-decision-dialog)[open] > form {display:flex;flex-direction:column;max-height:inherit;overflow:hidden}
:is(.approval-batch-dialog,.approval-decision-dialog) :is(.modal-head,.ui-scroll-dialog-body,.modal-actions) {margin:0;padding:12px 16px;box-sizing:border-box}
:is(.approval-batch-dialog,.approval-decision-dialog) :is(.modal-head,.modal-actions) {flex:none}
:is(.approval-batch-dialog,.approval-decision-dialog) .ui-scroll-dialog-body {min-height:0;overflow:auto}
:is(.approval-batch-dialog,.approval-decision-dialog) .modal-actions button {min-height:44px}
:root[data-theme=dark] #approvalsView .approval-status-pending {color:#f3ca85;background:#382d1d}
:root[data-theme=dark] #approvalsView .approval-status-approved {color:#85d4a0;background:#20382c}
:root[data-theme=dark] #approvalsView .approval-status-rejected {color:#f3a5a5;background:#40242a}
:root[data-theme=dark] :is(.approval-related-link,.approval-type-chips button[aria-pressed=true],#approvalsView .approval-workspace-tabs .tab.active) {color:#81cfc1}
@media(max-width:800px) {
  #appView #approvalsView .page-header {min-height:0}
  #approvalsView .page-header h1 {font-size:24px}
  #approvalsView .header-actions button {min-height:44px}
  #approvalPendingCount {font-size:12px}
  .approval-workspace-filters > input {width:100%;font-size:16px}
  .approval-extra-filters {width:100%}
  .approval-extra-filters > summary {display:list-item;min-height:44px;line-height:44px;cursor:pointer}
  .approval-extra-filters > div {display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .approval-workspace-filters :is(input,select),#approvalMobileSort {font-size:16px}
  #approvalMobileSort {display:block}
  #approvalsView .approval-table-scroll {display:none}
  .approval-mobile-list {display:grid;gap:7px}
  .approval-mobile-row {padding:7px 10px;border:1px solid var(--ui-border);border-radius:12px;background:var(--ui-surface);color:var(--ui-text);min-width:0}
  .approval-mobile-row > header,.approval-mobile-meta,.approval-mobile-footer {display:flex;align-items:center;gap:6px 8px;min-width:0}
  .approval-mobile-row > header > strong:not(.approval-time) {min-width:0;overflow-wrap:anywhere}
  .approval-mobile-row > header > :last-child {margin-inline-start:auto;flex:none}
  .approval-mobile-meta,.approval-mobile-footer {font-size:12px;color:var(--ui-muted)}
  .approval-mobile-meta {justify-content:space-between}
  .approval-mobile-footer {justify-content:space-between}
  .approval-mobile-footer .approval-expand {min-height:44px;flex:none}
  .approval-selection-hit {min-width:44px;min-height:44px}
  .approval-expanded-content .approval-work-segment {display:grid;grid-template-columns:minmax(0,1fr);gap:3px}
  #approvalsView.has-approval-selection {padding-bottom:calc(148px + env(safe-area-inset-bottom))}
  .approval-bulk-bar {position:fixed;z-index:38;inset:auto 0 calc(76px + env(safe-area-inset-bottom));margin:0;border-radius:0;box-shadow:0 -3px 14px #0e172224}
  .approval-bulk-bar strong {width:100%;font-size:12px}
  .approval-bulk-bar button {flex:1;min-width:0;padding-inline:5px}
  :is(.approval-batch-dialog,.approval-decision-dialog) :is(input,select,textarea) {font-size:16px}
}
/* Notifications workspace */
#appView #notificationsView {max-width:none;min-width:0;color:var(--er-redesign-ink);}
#notificationsView .page-header {margin-bottom:12px;}
#notificationsUnreadCount {font-size:.875rem;}
#notificationsView .notification-device,
#notificationsView .notification-tools,
#notificationCategories:not([hidden]) {display:flex;align-items:center;gap:8px;flex-wrap:wrap;min-width:0;}
#notificationsView .notification-device {padding:8px 12px;margin-bottom:12px;border:1px solid var(--er-redesign-line);border-radius:12px;background:var(--er-redesign-surface);font-size:.875rem;}
#notificationDeviceIcon {display:inline-flex;}
#notificationDeviceIcon svg {width:18px;height:18px;}
#notificationsPushStatus, #notificationsPushHelp p {color:var(--er-redesign-muted);}
#notificationsPushStatus[data-tone="warning"] {color:var(--uiux-warning-ink);}
#notificationsPushStatus[data-tone="success"] {color:var(--er-redesign-accent-ink);}
#notificationsPushHelp p {margin:0 0 6px;max-width:62ch;}
#notificationsView summary {cursor:pointer;min-height:36px;align-content:center;color:var(--er-redesign-accent-ink);font-size:.8125rem;}
#notificationsView .notification-tools {margin-bottom:4px;}
#notificationsView .notification-tools button {width:auto;min-height:36px;padding:5px 10px;border-radius:8px;}
#notificationsView .notification-tools button[aria-pressed="true"] {background:var(--er-redesign-accent-soft);color:var(--er-redesign-accent-ink);border-color:var(--er-redesign-accent-ink);}
#notificationsView .notification-bulk {display:flex;justify-content:flex-end;margin-bottom:4px;}
#notificationsList {min-width:0;overflow-anchor:none;}
#notificationsView .notification-day {margin-bottom:12px;}
#notificationsView .notification-day h2 {font-size:.8125rem;font-weight:650;color:var(--er-redesign-muted);margin:0 0 5px;padding-inline:4px;}
#notificationsView .notification-row {border:1px solid var(--er-redesign-line);background:var(--er-redesign-surface);color:var(--er-redesign-ink);}
#notificationsView .notification-row:first-of-type {border-radius:12px 12px 0 0;}
#notificationsView .notification-row:last-of-type {border-radius:0 0 12px 12px;}
#notificationsView .notification-row:only-of-type {border-radius:12px;}
#notificationsView .notification-row + .notification-row {border-top:0;}
#notificationsView .notification-row.is-unread {box-shadow:inset 3px 0 var(--er-redesign-accent-ink);}
#notificationsView .notification-row-open {
  display:grid;grid-template-columns:32px minmax(0,1fr) auto;align-items:start;gap:8px;
  width:100%;min-height:44px;padding:8px 12px;background:transparent;border:0;border-radius:inherit;
  text-align:left;font:inherit;color:inherit;cursor:pointer;
}
#notificationsView .notification-row-open:hover,
#workerHomeView .worker-notification-preview-row:hover {background:var(--er-redesign-accent-soft);}
#notificationsView .notification-row-open:focus-visible,
#workerHomeView .worker-notification-preview-row:focus-visible {outline:2px solid var(--er-redesign-accent-ink);outline-offset:-3px;}
#notificationsView .notification-row > details {padding:0 12px 2px 52px;overflow-wrap:anywhere;}
#notificationsView .notification-summary {display:grid;min-width:0;gap:2px;overflow-wrap:anywhere;}
#notificationsView .notification-summary strong {font-size:.9375rem;font-weight:620;}
#notificationsView .notification-row.is-unread .notification-summary strong {font-weight:750;}
#notificationsView .notification-event-icon {display:grid;place-items:center;width:32px;height:32px;border-radius:8px;background:var(--er-redesign-accent-soft);color:var(--er-redesign-accent-ink);}
#notificationsView .notification-event-icon svg {width:18px;height:18px;}
#notificationsView .notification-state-line {display:flex;gap:8px;flex-wrap:wrap;font-size:.75rem;}
#notificationsView .notification-state-line:empty {display:none;}
#notificationsView .notification-unread {color:var(--er-redesign-accent-ink);font-weight:650;}
#notificationsView .notification-urgency {color:var(--uiux-warning-ink);}
#notificationsView [data-priority="urgent"] .notification-event-icon {background:var(--uiux-danger-surface);color:var(--uiux-danger-ink);}
#notificationsView [data-priority="urgent"] .notification-urgency {color:var(--uiux-danger-ink);font-weight:750;}
:is(#notificationsView,#workerHomeView) .notification-excerpt {
  display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;
  color:var(--er-redesign-muted);font-size:.875rem;overflow-wrap:anywhere;white-space:pre-wrap;
}
:is(#notificationsView,#workerHomeView) time {color:var(--er-redesign-muted);font-size:.75rem;}
#notificationsView .notification-original {margin-top:6px;padding:8px 10px;background:var(--er-redesign-bg);border-radius:8px;font-size:.8125rem;}
#notificationsView .notification-original :is(time,span) {margin-inline-start:8px;}
#notificationsView .notification-empty {margin:0;padding:16px;background:var(--er-redesign-surface);border:1px solid var(--er-redesign-line);border-radius:12px;}
#workerHomeView .worker-notification-heading {display:flex;align-items:center;justify-content:space-between;gap:8px;}
#workerHomeView .worker-notification-heading h2, #workerHomeUnread {margin:0;}
#workerHomeView .worker-notification-heading button {min-height:44px;width:auto;}
#workerHomeView .worker-notification-preview-row {
  width:100%;display:grid;gap:3px;min-height:44px;padding:8px;background:transparent;
  border:0;border-block-start:1px solid var(--er-redesign-line);text-align:left;font:inherit;
  color:var(--er-redesign-ink);overflow-wrap:anywhere;cursor:pointer;
}
dialog.notification-target-dialog {
  width:min(520px,calc(100vw - 24px));max-height:min(720px,calc(100dvh - max(24px,env(safe-area-inset-top) + env(safe-area-inset-bottom) + 16px)));
  padding:0;background:var(--er-redesign-surface);color:var(--er-redesign-ink);border:1px solid var(--er-redesign-line);
  border-radius:16px;overflow:hidden;
}
dialog.notification-target-dialog[open] {display:flex;flex-direction:column;}
.notification-target-dialog :is(.modal-head,.modal-actions) {margin:0;padding:8px 16px;flex:none;gap:8px;}
.notification-target-dialog .modal-head {border-bottom:1px solid var(--er-redesign-line);}
.notification-target-dialog .modal-head h2 {margin:0;overflow-wrap:anywhere;font-size:1.125rem;}
.notification-target-dialog :is(.icon-btn,.secondary-btn,.primary-btn) {min-height:44px;}
.notification-target-dialog .modal-head .icon-btn {min-width:44px;}
.notification-target-dialog .modal-actions {border-top:1px solid var(--er-redesign-line);}
.notification-target-dialog .notification-detail-body {padding:12px 16px;overflow:auto;overscroll-behavior:contain;overflow-wrap:anywhere;}
.notification-target-dialog .notification-detail-body p {margin:4px 0 0;white-space:pre-wrap;}
.notification-target-dialog .notification-event-copy time {font-size:.8125rem;color:var(--er-redesign-muted);}
.notification-target-dialog .notification-detail-fields {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 16px;margin:12px 0 0;}
.notification-target-dialog .notification-detail-fields dt {color:var(--er-redesign-muted);font-size:.8125rem;}
.notification-target-dialog .notification-detail-fields dd {margin:2px 0 0;font-weight:620;}
.notification-target-dialog .notification-detail-note, .notification-target-dialog .notification-material-list {margin:12px 0 0;}
.notification-target-dialog .notification-material-list {padding:0;list-style:none;}
.notification-target-dialog .notification-material-list li {display:flex;justify-content:space-between;gap:8px;padding:6px 0;border-bottom:1px solid var(--er-redesign-line);}
@media(max-width:700px){
  #appView #notificationsView {padding:0 max(12px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));}
  #notificationsView .notification-tools button,#notificationsView summary,#notificationsReadAll,#notificationsPushEnableBtn {min-height:44px;}
  #notificationsView .notification-row-open {grid-template-columns:32px minmax(0,1fr);}
  #notificationsView .notification-row-open time {grid-column:2;}
}
/* Settings workspace and company appearance */
:root[data-company-theme] {--er-redesign-bg:var(--company-light-background);--er-redesign-accent:var(--company-accent);--er-redesign-accent-ink:var(--company-accent);--er-redesign-accent-soft:color-mix(in srgb,var(--company-accent) 10%,white);--ui-on-accent:#fff;}
:root[data-company-theme][data-theme="dark"] {--er-redesign-bg:color-mix(in srgb,var(--company-sidebar) 25%,#0e1722);}
:root[data-company-theme][data-theme="dark"] body {--er-redesign-bg:color-mix(in srgb,var(--company-sidebar) 25%,#0e1722);--er-redesign-accent-ink:color-mix(in srgb,var(--company-accent) 40%,white);--er-redesign-accent-soft:color-mix(in srgb,var(--company-accent) 30%,#202e3b);--ui-on-accent:#fff;}
:root[data-company-theme] #appView :is(.sidebar,.mobile-nav,.mobile-bottom-nav,.mobile-topbar) {background:var(--company-sidebar);}
:root[data-company-theme] #appView .primary-btn {color:#fff;background:var(--company-accent);border-color:var(--company-accent);}
:root[data-company-theme] #appView .primary-btn:hover {background:color-mix(in srgb,var(--company-accent) 85%,black);}
:root[data-company-theme] #appView :is(input,select,textarea,button,a):focus-visible {outline-color:var(--er-redesign-accent-ink);}
:root[data-company-theme] #appView :is(.sidebar,.mobile-nav,.mobile-bottom-nav) .nav-item.active {color:#fff;background:var(--company-accent);}
[data-company-brand-mark] {object-fit:contain;}
#appView #settingsView,
#appView #settingsView > .page-header {width:100%;max-width:none;min-width:0;}
#settingsView > .page-header {margin-bottom:12px;padding-bottom:12px;}
#settingsView .settings-workspace {display:grid;grid-template-columns:minmax(200px,245px) minmax(0,1fr);gap:18px;align-items:start;}
#settingsView .settings-section-nav {display:block;padding:12px;border:1px solid var(--er-redesign-line);border-radius:12px;background:var(--er-redesign-surface);margin:0;min-width:0;}
#settingsView .settings-section-nav label {font-size:.8125rem;font-weight:650;}
#settingsSectionSearch {width:100%;margin-bottom:8px;}
#settingsView .settings-nav-group {padding:6px 0;border-top:1px solid var(--er-redesign-line);margin-top:4px;}
#settingsView .settings-nav-group h2 {font-size:.75rem;color:var(--er-redesign-muted);font-weight:700;margin:0 0 4px;padding:0 7px;}
#settingsView .settings-nav-group .settings-section-btn {width:100%;text-align:start;border:1px solid transparent;min-height:35px;padding:6px 7px;color:var(--er-redesign-ink);background:none;font-size:.875rem;font-weight:600;box-shadow:none;white-space:normal;}
#settingsView .settings-nav-group .settings-section-btn.active {background:var(--er-redesign-accent-soft);color:var(--er-redesign-accent-ink);border-color:var(--er-redesign-line);}
#settingsView .settings-workspace-content,
#settingsView .settings-section-panel {width:100%;min-width:0;max-width:none;margin:0;}
#settingsView .settings-section-panel > h2 {margin:0 0 12px;font-size:1.3rem;}
#settingsView .settings-section-panel > [data-settings-load-failure] {margin-bottom:10px;}
#settingsView .settings-section-panel[aria-busy="true"]::before {content:'Beállítások betöltése…';display:block;color:var(--er-redesign-muted);font-size:.875rem;margin-bottom:8px;}
#settingsView .settings-section-panel[data-settings-unsaved]::after {content:'Nem mentett módosítás';display:block;color:var(--uiux-warning-ink,#94630f);font-size:.8125rem;margin:8px 0;}
#settingsView .settings-section-panel :is(.settings-card,.section-box) {padding:14px;border-radius:12px;box-shadow:none;max-width:none;margin-bottom:12px;}
#settingsView .settings-section-panel h3 {font-size:1rem;margin:0 0 8px;}
#settingsView .settings-section-panel :is(.settings-category-intro,.section-title) {color:var(--er-redesign-ink);}
#settingsView .settings-section-panel :is(input,select,textarea,button) {max-width:100%;min-width:0;}
#settingsView .settings-section-panel :is(input:not([type="checkbox"],[type="radio"]),select) {min-height:40px;}
#settingsView :is(.settings-check,.settings-theme-choice) {display:flex;align-items:center;gap:8px;}
#settingsView :is(.settings-check,.settings-theme-choice) input {width:auto;min-height:0;}
#settingsView [data-settings-result] {min-height:20px;margin:6px 0 0;font-size:.8125rem;}
#settingsView .settings-error {color:var(--uiux-danger-ink,#bc3945);}
#settingsView .settings-logo-preview {display:grid;place-items:center;min-height:88px;max-width:240px;padding:8px;border:1px solid var(--er-redesign-line);border-radius:8px;margin-bottom:12px;background:var(--er-redesign-bg);}
#settingsView .settings-logo-preview img {width:100%;height:72px;object-fit:contain;}
#settingsView .settings-admin-row {display:flex;justify-content:space-between;align-items:center;gap:12px;border-bottom:1px solid var(--er-redesign-line);padding:10px 0;}
#settingsView .settings-admin-row .muted {display:block;font-size:.8125rem;}
#settingsView .settings-quote-tabs,
#settingsView .settings-preview-switch {display:flex;flex-wrap:wrap;gap:6px;margin:0 0 12px;}
#settingsView [aria-selected=true][role=tab],
#settingsView [data-theme-preview][aria-pressed=true] {color:var(--er-redesign-accent-ink);background:var(--er-redesign-accent-soft);}
#settingsView .settings-metrics {display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:8px;}
#settingsView .settings-metrics > div {border:1px solid var(--er-redesign-line);border-radius:8px;padding:10px;}
#settingsView .settings-metrics dt {font-size:.8125rem;color:var(--er-redesign-muted);}
#settingsView .settings-metrics dd {margin:3px 0 0;font-weight:700;}
#settingsView .settings-theme-preview {display:grid;grid-template-columns:clamp(90px,24%,170px) minmax(0,1fr);border-radius:10px;overflow:hidden;border:1px solid var(--er-redesign-line);background:var(--sample-background,#f3f6f8);color:#172b3a;}
#settingsView .settings-theme-preview[data-mode=dark] {background:#172331;color:#e8f0f5;}
#settingsView .settings-theme-preview > div {color:#fff;background:var(--sample-sidebar,#132334);padding:12px;min-width:0;overflow-wrap:anywhere;}
#settingsView .settings-theme-preview > div span {display:block;padding:5px;margin-top:8px;border-radius:4px;background:var(--sample-accent,#087f75);font-size:.75rem;}
#settingsView .settings-theme-preview > section {padding:12px;min-width:0;}
#settingsView .settings-theme-preview :is(.settings-theme-preview-row,.settings-theme-preview-card,.settings-theme-preview-field) {padding:6px 8px;margin-bottom:6px;border:1px solid color-mix(in srgb,currentColor 24%,transparent);border-radius:6px;}
#settingsView .settings-theme-preview-row {display:flex;align-items:center;justify-content:space-between;gap:6px;flex-wrap:wrap;}
#settingsView .settings-theme-preview-button {display:inline-block;color:#fff;background:var(--sample-accent,#087f75);border-radius:6px;padding:6px 10px;}
#companyThemeOptions {display:grid;grid-template-columns:repeat(auto-fit,minmax(144px,1fr));gap:6px;}
#settingsView .settings-theme-choice {padding:7px;border:1px solid var(--er-redesign-line);border-radius:8px;}
#settingsView .settings-theme-choice > span {width:12px;height:12px;border-radius:100%;flex:none;}
#settingsBack {display:none;}
#settingsView .settings-quote-tabs button {white-space:normal;}
#settingsView :is(.settings-card,.section-box) :is(h2,h3) {overflow-wrap:anywhere;}
#settingsView :is(.menu-custom-editor,.menu-custom-group-editor,.menu-edit-row,.notification-pref-row) {min-width:0;}
#settingsView .settings-backup-history {overflow-x:auto;}
#settingsView .settings-backup-history table {min-width:580px;}
#settingsView .settings-backup-history-details {overflow-wrap:anywhere;white-space:pre-wrap;}
@media(max-width:760px) {
  #appView #settingsView {padding:0 max(10px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));}
  #settingsView .settings-workspace {grid-template-columns:minmax(0,1fr);gap:8px;}
  #settingsView.has-settings-panel .settings-section-nav,
  #settingsView:not(.has-settings-panel) .settings-workspace-content {display:none;}
  #settingsView.has-settings-panel #settingsBack {display:inline-flex;margin-bottom:8px;}
  #settingsView .settings-nav-group .settings-section-btn,
  #settingsView .settings-section-panel :is(button,input:not([type=checkbox],[type=radio]),select) {min-height:44px;}
  #settingsView :is(input,select,textarea) {font-size:16px;}
  #settingsView .form-grid {grid-template-columns:minmax(0,1fr);}
  #settingsView .settings-quote-tabs {flex-wrap:nowrap;overflow-x:auto;}
  #settingsView .settings-quote-tabs button {flex:none;}
  #settingsView .quote-settings-layout {grid-template-columns:minmax(0,1fr);}
}
/* Worker home uses the shared theme and the fixed worker navigation. */
#appView #workerHomeView {width:100%;max-width:1180px;min-width:0;margin-inline:auto;color:var(--er-redesign-ink);}
#appView #workerHomeView .worker-home-header {margin:0 0 14px;padding:4px 0 12px;}
#workerHomeDate {display:block;margin-top:4px;color:var(--er-redesign-muted);font-size:.875rem;}
#workerHomeDate:empty {display:none;}
#workerHomeView .worker-home-layout {display:grid;grid-template-columns:minmax(0,1.08fr) minmax(0,1fr);align-items:start;gap:16px;}
#workerHomeView .worker-home-column {display:grid;gap:12px;min-width:0;}
#workerHomeView .worker-home-column > .worker-home-card {grid-area:auto;height:auto;min-height:0;align-self:start;}
#workerHomeView .worker-home-card,
#workerHomeView .worker-home-feedback {min-width:0;margin:0;padding:14px 16px;border:1px solid var(--er-redesign-line);border-radius:12px;background:var(--er-redesign-surface);color:var(--er-redesign-ink);box-shadow:none;}
#workerHomeView .worker-home-card h2 {margin:0;font-size:1.125rem;line-height:1.3;letter-spacing:-.01em;}
#workerHomeView .worker-home-card-head {display:flex;align-items:baseline;justify-content:space-between;flex-wrap:wrap;gap:4px 12px;}
#workerHomeView :is(.worker-home-card time,.worker-home-card-head > span) {font-size:.8125rem;color:var(--er-redesign-muted);}
#workerHomeView .worker-home-card p {margin:5px 0 0;}
#workerHomeView .worker-home-card :is(button,a) {min-height:44px;max-width:100%;white-space:normal;}
#workerHomeView .worker-home-layout p {overflow-wrap:anywhere;}
#workerHomeView .worker-home-entry {width:100%;margin-top:10px;}
#workerHomeView .worker-home-today {border-top:3px solid var(--er-redesign-accent);}
#workerHomeView .worker-home-assignment {display:grid;gap:3px;padding:8px 0;overflow-wrap:anywhere;}
#workerHomeView .worker-home-assignment + .worker-home-assignment {border-top:1px solid var(--er-redesign-line);}
#workerHomeView .worker-home-assignment p {white-space:pre-wrap;}
#workerHomeView .worker-home-assignment span {font-size:.875rem;color:var(--er-redesign-muted);}
#workerHomeView .worker-home-work-pattern {display:grid;gap:3px;padding:9px 0;}
#workerHomeView .worker-home-work-pattern span {font-size:.8125rem;color:var(--er-redesign-muted);}
#workerHomeView .worker-home-day-state {padding:9px 11px;margin-top:8px;border:1px solid var(--er-redesign-line);border-radius:8px;background:var(--er-redesign-bg);}
#workerHomeView .worker-home-day-state p {font-size:.875rem;}
#workerHomeView .worker-home-day-state[data-tone="done"] {background:var(--er-redesign-accent-soft);color:var(--er-redesign-ink);}
#workerHomeView .worker-home-day-state[data-tone="pending"] {border-inline-start:3px solid var(--uiux-warning-ink,#94630f);}
#workerHomeView .worker-home-metrics {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin:8px 0;}
#workerHomeView .worker-home-metrics dt {font-size:.8125rem;color:var(--er-redesign-muted);}
#workerHomeView .worker-home-metrics dd {margin:1px 0;font-size:1rem;font-weight:700;}
#workerHomeView .worker-home-metrics .worker-home-total {grid-column:1/-1;padding:7px 0;border-bottom:1px solid var(--er-redesign-line);}
#workerHomeView .worker-home-total dd {font-size:clamp(1.5rem,5vw,2rem);color:var(--er-redesign-accent-ink);line-height:1.2;}
#workerHomeView .worker-home-month > button,
#workerHomeView .worker-home-notices > button,
#workerHomeView .worker-home-feedback > button {margin-top:7px;}
#workerHomeView .worker-home-notes {margin-top:8px;}
#workerHomeView .worker-home-note {padding:8px 0;border-top:1px solid var(--er-redesign-line);overflow-wrap:anywhere;}
#workerHomeView .worker-home-note p {margin:3px 0;color:var(--er-redesign-ink);white-space:pre-wrap;}
#workerHomeView .worker-home-note small {display:block;margin-top:4px;color:var(--er-redesign-muted);}
#workerHomeView .worker-home-note summary span {display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:.875rem;color:var(--er-redesign-muted);font-weight:400;}
#workerHomeView .worker-home-note[open] summary span {display:none;}
#workerHomeView summary {min-height:44px;cursor:pointer;}
#workerHomeView .worker-home-notification-preview > summary {color:var(--er-redesign-accent-ink);align-content:center;}
#workerHomeView .worker-home-card > .worker-compact-summary {min-height:44px;padding:0;margin:0;background:none;color:var(--er-redesign-ink);}
#workerHomeView .worker-home-card .worker-compact-summary-main small {color:var(--er-redesign-muted);}
#workerHomeView .worker-home-card :is(.worker-task,.worker-material-item,.worker-project-prep-item) {min-width:0;background:var(--er-redesign-bg);border-color:var(--er-redesign-line);color:var(--er-redesign-ink);}
#workerHomeView .worker-home-card :is(.worker-task-copy strong,.worker-material-title,.worker-project-prep-item strong) {color:var(--er-redesign-ink);}
#workerHomeView .worker-home-card :is(.worker-task-copy span,.worker-material-item-main span,.worker-material-item-main small) {color:var(--er-redesign-muted);}
#workerHomeView .worker-home-card :is(.worker-task-action,.worker-prep-head-actions) button {width:auto;}
#workerBottomNav button {min-width:0;min-height:44px;color:#e8f0f5;}
#workerBottomNav button[aria-current="page"] {color:#fff;background:color-mix(in srgb,var(--er-redesign-accent) 62%,transparent);box-shadow:inset 0 2px var(--er-redesign-accent-ink);}
#workerBottomNav button > span {display:grid;place-items:center;}
#workerBottomNav button svg {width:21px;height:21px;}
#workerBottomNav small {line-height:1.2;white-space:normal;overflow-wrap:anywhere;font-size:.6875rem;}
@media(max-width:800px) {
  #appView #workerHomeView {padding:0 max(12px,env(safe-area-inset-right)) 12px max(12px,env(safe-area-inset-left));}
  #workerHomeView .worker-home-layout {grid-template-columns:minmax(0,1fr);gap:12px;}
  #workerHomeView .worker-home-card {padding:12px;}
  #workerHomeView :is(summary,button,a) {scroll-margin-block-end:calc(76px + env(safe-area-inset-bottom));}
  #workerBottomNav:not([hidden]) {height:auto;min-height:calc(66px + env(safe-area-inset-bottom));padding-inline:max(2px,env(safe-area-inset-left)) max(2px,env(safe-area-inset-right));padding-bottom:max(6px,env(safe-area-inset-bottom));}
}

/* Work-hour editor, its confirmed receipt and the existing break wheels. */
#workerSegmentEditor.modal {
  box-sizing:border-box;width:min(800px,calc(100% - 32px));max-width:none;
  max-height:calc(var(--worker-editor-viewport,100dvh) - 32px);
  padding:0;overflow:hidden;border:1px solid var(--er-redesign-line);border-radius:14px;
  background:var(--er-redesign-surface);color:var(--er-redesign-ink);
}
#workerSegmentEditor[open] {display:flex;}
:root[data-theme="dark"] #workerSegmentEditor.modal,
:root[data-theme="dark"] #erBreakDurationPicker.modal {background:var(--er-redesign-surface)!important;color:var(--er-redesign-ink)!important;}
:root[data-theme="dark"] #workerSegmentEditor #retroCalendar .retro-calendar-day.none {background:var(--er-redesign-bg)!important;color:var(--er-redesign-ink)!important;border-color:var(--er-redesign-line)!important;}
:root[data-theme="dark"] #workerSegmentEditor #retroCalendar .retro-calendar-day.selected {outline-color:var(--er-redesign-accent-ink)!important;}
#workerSegmentEditor > form {
  display:flex;flex-direction:column;width:100%;min-height:0;margin:0;
  max-height:inherit;background:var(--er-redesign-surface);
}
#workerSegmentEditor :is(.modal-head,.modal-actions,.ui-scroll-dialog-body) {margin:0;padding:12px 18px;}
#workerSegmentEditor .modal-head {flex:none;border-bottom:1px solid var(--er-redesign-line);}
#workerSegmentEditor .modal-head h2 {font-size:1.125rem;margin:0;}
#workerSegmentEditor .modal-head button {width:44px;}
#workerSegmentEditor .ui-scroll-dialog-body {display:grid;gap:9px;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;}
#workerSegmentEditor .modal-actions {flex:none;display:flex;gap:8px;justify-content:flex-end;border-top:1px solid var(--er-redesign-line);background:var(--er-redesign-surface);}
#workerSegmentEditor :is(button,input,select,summary) {min-height:44px;}
#workerSegmentEditor :is(button,input,select,textarea) {max-width:100%;min-width:0;}
#workerSegmentEditor :is(button,input,select,textarea,summary):focus-visible {outline:2px solid var(--er-redesign-accent-ink);outline-offset:2px;}
#workerSegmentEditor [hidden] {display:none!important;}
#workerSegmentEditor .primary-btn {background:var(--er-redesign-accent);color:var(--ui-on-accent,#fff);}
#workerSegmentEditor .worker-editor-day {font-weight:700;font-variant-numeric:tabular-nums;}
#workerSegmentEditor .worker-editor-entry-step {display:grid;min-width:0;gap:9px;}
#workerSegmentEditor .worker-editor-day {display:flex;gap:6px 12px;align-items:center;justify-content:space-between;flex-wrap:wrap;}
#workerSegmentEditor .worker-editor-rules {border:1px solid var(--er-redesign-line);border-radius:8px;padding:0 9px;}
#workerSegmentEditor .worker-editor-rules > summary {align-content:center;font-weight:600;color:var(--er-redesign-accent-ink);cursor:pointer;}
#workerSegmentEditor .retro-calendar-legend {
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px 10px;margin:0 0 10px;padding:0;list-style:none;color:var(--er-redesign-ink);
}
#workerSegmentEditor .retro-calendar-legend li {display:flex;align-items:center;gap:6px;min-width:0;font-size:.75rem;}
#workerSegmentEditor .retro-calendar-legend li > span {
  display:grid;place-items:center;flex:none;width:18px;height:18px;margin:0;padding:0;border:0;border-radius:4px;color:#fff;
}
#workerSegmentEditor .retro-calendar-legend svg {width:13px;height:13px;}
#workerSegmentEditor .retro-calendar-legend .recorded {background:#126e50;}
#workerSegmentEditor .retro-calendar-legend .missing {background:#a94c0d;}
#workerSegmentEditor .retro-calendar-legend .pending {background:#7040c4;}
#workerSegmentEditor .retro-calendar-legend .none {background:var(--er-redesign-bg);color:var(--er-redesign-ink);border:1px solid var(--er-redesign-line);}
#workerSegmentEditor .worker-editor-rules p {margin:0 0 9px;color:var(--er-redesign-muted);font-size:.875rem;}
#workerSegmentEditor .retro-calendar-wrap {margin:0 0 8px;min-width:0;}
#workerSegmentEditor [data-editor-status]:empty {display:none;}
#workerSegmentEditor [data-editor-status],
#workerSegmentEditor [data-row-error] {padding:7px 9px;border-radius:8px;background:var(--er-redesign-bg);color:var(--er-redesign-ink);font-size:.875rem;}
#workerSegmentEditor [data-editor-status][data-tone="pending"] {color:var(--uiux-warning-ink,#94630f);}
#workerSegmentEditor [data-editor-status][data-tone="done"] {color:var(--er-redesign-accent-ink);}
#workerSegmentEditor [data-editor-status][data-tone="error"],
#workerSegmentEditor [data-row-error] {color:var(--ui-danger,#b42332);}
#workerSegmentEditor [aria-invalid="true"] {border-color:var(--ui-danger,#b42332);}
#workerSegmentEditor [data-day-total] {padding:10px 12px;background:var(--er-redesign-accent-soft);border-radius:9px;}
#workerSegmentEditor [data-day-total] > div {display:flex;align-items:baseline;justify-content:space-between;flex-wrap:wrap;gap:4px 8px;}
#workerSegmentEditor [data-day-total] strong {font-size:1.45rem;color:var(--er-redesign-accent-ink);white-space:nowrap;}
#workerSegmentEditor [data-day-total] p {margin:1px 0 0;color:var(--er-redesign-muted);font-size:.8125rem;}
#workerSegmentEditor :is([data-existing-segments],[data-new-segments]) {display:grid;gap:8px;min-width:0;}
#workerSegmentEditor :is([data-existing-segments],[data-new-segments]):empty {display:none;}
#workerSegmentEditor .worker-editor-segment {min-width:0;margin:0;padding:0;border:1px solid var(--er-redesign-line);border-radius:9px;background:var(--er-redesign-surface);color:var(--er-redesign-ink);}
#workerSegmentEditor .worker-editor-segment > summary {display:flex;justify-content:space-between;align-items:flex-start;flex-wrap:wrap;gap:4px 8px;padding:9px 12px;cursor:pointer;}
#workerSegmentEditor .worker-editor-segment > summary::after {content:"";flex:none;width:7px;height:7px;margin:4px 3px 0 0;border:solid var(--er-redesign-muted);border-width:0 1.5px 1.5px 0;transform:rotate(45deg);}
#workerSegmentEditor .worker-editor-segment[open] > summary::after {transform:rotate(225deg);margin-top:8px;}
#workerSegmentEditor .worker-editor-segment > summary > span {display:flex;align-items:baseline;gap:3px 8px;flex-wrap:wrap;min-width:0;flex:1;}
#workerSegmentEditor :is([data-segment-project],[data-segment-preview]) {width:100%;overflow-wrap:anywhere;}
#workerSegmentEditor :is([data-segment-state],[data-segment-preview]) {font-size:.8125rem;color:var(--er-redesign-muted);}
#workerSegmentEditor [data-segment-net] {font-size:.875rem;color:var(--er-redesign-accent-ink);}
#workerSegmentEditor .worker-editor-segment[open] > summary {border-bottom:1px solid var(--er-redesign-line);}
#workerSegmentEditor .worker-editor-segment-body {padding:10px 12px;}
#workerSegmentEditor .worker-editor-segment-fields {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;min-width:0;}
#workerSegmentEditor .worker-editor-segment-fields label {min-width:0;font-size:.875rem;}
#workerSegmentEditor .worker-editor-segment-fields .full {grid-column:1/-1;}
#workerSegmentEditor .worker-editor-segment-fields :is(input,textarea,select) {width:100%;background:var(--er-redesign-bg);border-color:var(--er-redesign-line);color:var(--er-redesign-ink);}
#workerSegmentEditor .worker-editor-segment-fields input[type="time"] {min-inline-size:0;inline-size:100%;font-variant-numeric:tabular-nums;}
#workerSegmentEditor .worker-editor-segment-fields input::-webkit-date-and-time-value {text-align:start;}
#workerSegmentEditor .worker-editor-saved-note {margin:7px 0 0;font-size:.875rem;white-space:pre-wrap;overflow-wrap:anywhere;}
#workerSegmentEditor .worker-editor-segment-actions {display:flex;justify-content:flex-end;gap:6px;margin-top:5px;}
#workerSegmentEditor :is([data-add],[data-check-save]) {justify-self:start;}
#workerTimeEntryView .worker-time-entry-header {margin-bottom:12px;padding-block:4px 10px;}
#workerTimeEntryCard.worker-entry-page {display:grid;gap:10px;}
#workerTimeEntryCard.worker-entry-page header :is(h2,p) {margin:3px 0 0;}
#workerTimeEntryCard.worker-entry-page time {color:var(--er-redesign-muted);font-size:.875rem;}
.worker-entry-links {display:flex;flex-wrap:wrap;gap:8px;}
.worker-entry-links button {min-height:44px;}
.worker-closed-receipt {display:grid;gap:10px;min-width:0;color:var(--er-redesign-ink);}
.worker-closed-receipt header {display:flex;gap:10px;align-items:flex-start;}
.worker-closed-receipt header h2 {margin:2px 0;font-size:1.25rem;}
.worker-closed-receipt p,.worker-closed-receipt ol {margin:0;}
.worker-closed-receipt :is(time,li span,.worker-closed-total span) {color:var(--er-redesign-muted);font-size:.875rem;}
.worker-closed-icon {display:grid;place-items:center;flex:none;width:36px;height:36px;border-radius:50%;background:var(--er-redesign-accent-soft);color:var(--er-redesign-accent-ink);}
.worker-closed-icon svg {width:21px;height:21px;}
.worker-closed-total {display:grid;gap:1px;background:var(--er-redesign-accent-soft);padding:10px 12px;border-radius:9px;}
.worker-closed-total strong {font-size:1.75rem;color:var(--er-redesign-accent-ink);}
.worker-closed-segments {padding:0;list-style:none;}
.worker-closed-segments li {display:grid;gap:2px;padding:6px 0;border-bottom:1px solid var(--er-redesign-line);overflow-wrap:anywhere;}
#erBreakDurationPicker {background:var(--er-redesign-surface);color:var(--er-redesign-ink);border-color:var(--er-redesign-line);}
#erBreakDurationPicker :is(.er-break-picker-help,.er-break-wheel-group > label) {color:var(--er-redesign-muted);}
#erBreakDurationPicker :is(.er-break-picker-current,.er-break-wheel-option.is-selected) {color:var(--er-redesign-accent-ink);}
#erBreakDurationPicker .er-break-wheel {background:var(--er-redesign-bg);border-color:var(--er-redesign-line);overscroll-behavior:contain;}
#erBreakDurationPicker .er-break-wheel-option {color:var(--er-redesign-muted);}
#erBreakDurationPicker .er-break-wheel-option.is-selected {background:var(--er-redesign-accent-soft)!important;}
#erBreakDurationPicker .primary-btn {background:var(--er-redesign-accent);color:var(--ui-on-accent,#fff);}
#erBreakDurationPicker button:focus-visible {outline:2px solid var(--er-redesign-accent-ink);}
@media(max-width:760px) {
  #workerSegmentEditor.modal {position:fixed;inset:calc(var(--worker-editor-viewport-top,0px) + max(6px,env(safe-area-inset-top))) 0 auto;margin:0 auto;
    width:calc(100% - max(8px,env(safe-area-inset-left)) - max(8px,env(safe-area-inset-right)));
    max-height:calc(var(--worker-editor-viewport,100dvh) - max(6px,env(safe-area-inset-top)) - max(8px,env(safe-area-inset-bottom)));
  }
  #workerSegmentEditor :is(.modal-head,.modal-actions,.ui-scroll-dialog-body) {padding:8px 11px;}
  #workerSegmentEditor .modal-actions > button {flex:0 1 auto;white-space:normal;}
  #workerSegmentEditor .worker-editor-segment-fields {grid-template-columns:repeat(2,minmax(0,1fr));}
  #workerSegmentEditor :is(input,select,textarea) {font-size:16px;}
}

/* Documentation and the photo category inside the shared approvals workspace. */
#documentationView .page-header {display:flex;align-items:center;justify-content:space-between;gap:12px;padding-block:8px;margin-bottom:12px;}
#documentationView .page-header h1 {margin:0;}
#documentationView .page-header button {width:auto;min-height:44px;}
.documentation-columns {display:grid;grid-template-columns:minmax(0,1.45fr) minmax(280px,1fr);gap:16px;align-items:start;}
.documentation-columns:has(> :only-child) {grid-template-columns:minmax(0,720px);}
.documentation-panel,.approval-photo-batch {min-width:0;padding:16px;border:1px solid var(--er-redesign-line);border-radius:12px;background:var(--er-redesign-surface);color:var(--er-redesign-ink);}
.documentation-panel,.documentation-panel form {display:grid;gap:10px;margin:0;}
.documentation-panel :is(h2,p) {margin:0;}
.documentation-panel :is(label,textarea,select,button) {min-width:0;max-width:100%;}
.documentation-panel :is(select,textarea) {width:100%;min-height:44px;background:var(--er-redesign-bg);color:var(--er-redesign-ink);border-color:var(--er-redesign-line);}
.documentation-panel button {min-height:44px;white-space:normal;}
.documentation-panel [data-documentation-status]:empty,.documentation-grid:empty {display:none;}
.documentation-buttons {display:flex;flex-wrap:wrap;gap:8px;}
.documentation-panel :is([data-documentation-submit],[data-documentation-task] button) {justify-self:start;}
.documentation-grid,.approval-photo-grid {display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,156px),1fr));gap:8px;}
.documentation-preview,.project-photo-review {min-width:0;display:grid;gap:5px;align-content:start;padding:7px;border:1px solid var(--er-redesign-line);border-radius:8px;background:var(--er-redesign-bg);}
.documentation-preview :is(span,small),.project-photo-review :is(strong,small) {overflow-wrap:anywhere;font-size:.86rem;}
.documentation-preview img,.project-photo-thumbnail img {display:block;width:100%;aspect-ratio:4/3;object-fit:cover;border-radius:6px;background:var(--er-redesign-surface);}
.documentation-preview button {justify-self:start;padding-inline:4px;}
.approval-photo-batches {display:grid;gap:10px;}
.approval-photo-batch header {display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;}
.approval-photo-batch header :is(h3,p) {margin:0;overflow-wrap:anywhere;}
.approval-photo-batch header p,.project-photo-sync {color:var(--er-redesign-muted);}
.approval-photo-batch :is(header button,[data-photo-batch-select]) {min-height:44px;}
.approval-photo-grid {margin-top:8px;grid-template-columns:repeat(auto-fill,minmax(min(100%,185px),1fr));}
.project-photo-review.is-selected {border-color:var(--er-redesign-accent-ink);}
.project-photo-review .approval-inline-actions {display:grid;gap:5px;margin:0;}
.project-photo-review .approval-inline-actions button {min-width:0;min-height:44px;white-space:normal;}
.project-photo-meta {display:flex;align-items:center;gap:6px;min-width:0;}
.project-photo-meta label {flex:none;}
.project-photo-note {white-space:pre-wrap;overflow-wrap:anywhere;}
.project-photo-thumbnail {display:block;width:min(100%,250px);padding:0;border:1px solid var(--er-redesign-line);border-radius:7px;cursor:zoom-in;}
.project-photo-review .project-photo-thumbnail {width:100%;}
#approvalPhotoViewer.modal {width:min(960px,calc(100% - 20px));max-width:none;max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 20px);background:var(--er-redesign-surface);color:var(--er-redesign-ink);}
#approvalPhotoViewer img {width:100%;max-height:72dvh;object-fit:contain;}
#approvalPhotoViewer :is(h2,button,a) {overflow-wrap:anywhere;}
#approvalsView .project-photo-thumbnail:focus-visible,#documentationView button:focus-visible {outline:2px solid var(--er-redesign-accent-ink);outline-offset:2px;}
@media(max-width:760px) {
  .documentation-columns,.documentation-columns:has(> :only-child) {grid-template-columns:minmax(0,1fr);gap:10px;}
  .documentation-panel,.approval-photo-batch {padding:10px;}
  .documentation-buttons button {flex:1 1 130px;}
  .documentation-panel :is(select,textarea) {font-size:16px;}
  .documentation-grid,.approval-photo-grid {grid-template-columns:repeat(2,minmax(0,1fr));}
  #approvalBulkBar:has([data-project-photo-bulk-reject]:not([hidden])) {flex-wrap:wrap;}
  #approvalBulkBar [data-project-photo-bulk-reject] {min-height:44px;white-space:normal;}
}

/* Material shortage submission and the existing project procurement and approval views. */
#materialShortageDialog.modal {width:min(540px,calc(100% - 20px));max-width:none;max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px);background:var(--er-redesign-surface);color:var(--er-redesign-ink);}
#materialShortageDialog .modal-head :is(h2,p) {margin:0;}
#materialShortageDialog .ui-scroll-dialog-body {display:grid;gap:10px;overflow-y:auto;overscroll-behavior:contain;}
#materialShortageDialog .ui-scroll-dialog-body p {margin:0;}
#materialShortageDialog .modal-actions,.material-decision-dialog .modal-actions {background:var(--er-redesign-surface);border-color:var(--er-redesign-line);}
#materialShortageDialog :is(input,select,textarea),.material-decision-dialog :is(input,select,textarea) {min-width:0;max-width:100%;background:var(--er-redesign-bg);color:var(--er-redesign-ink);border-color:var(--er-redesign-line);}
#materialShortageDialog :is(button,input,select,summary),.material-decision-dialog :is(button,input,select,summary) {min-height:44px;}
#materialShortageDialog [data-shortage-status]:empty {display:none;}
.material-original {min-width:0;overflow-wrap:anywhere;}
.material-original summary {align-content:center;cursor:pointer;color:var(--er-redesign-accent-ink);}
.material-original p {margin:4px 0;white-space:pre-wrap;overflow-wrap:anywhere;}
.material-approval-detail {display:grid;gap:5px;min-width:0;margin-block:6px;}
.material-approval-detail > strong {overflow-wrap:anywhere;}
.material-approval-detail p {margin:0;}
.material-approval-items,.project-procurement-list {list-style:none;margin:0;padding:0;}
.material-approval-items li {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;padding:5px 0;border-bottom:1px solid var(--er-redesign-line);overflow-wrap:anywhere;}
.material-review-editor {min-width:0;border:1px solid var(--er-redesign-line);border-radius:8px;padding:8px;}
.material-review-editor legend {padding-inline:4px;font-weight:650;}
.material-edit-row {display:grid;grid-template-columns:minmax(0,2fr) minmax(65px,1fr) minmax(65px,1fr) auto;gap:6px;align-items:end;margin-bottom:8px;}
.material-edit-row label {min-width:0;overflow-wrap:anywhere;}
.material-edit-row input {width:100%;min-width:0;}
.material-decision-dialog .approval-decision-preview {display:flex;gap:4px 12px;align-items:baseline;flex-wrap:wrap;}
.material-decision-dialog .approval-decision-preview span,.project-procurement-row small {color:var(--er-redesign-muted);}
.project-procurement-row {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 8px;align-items:start;padding:8px 0;border-bottom:1px solid var(--er-redesign-line);overflow-wrap:anywhere;}
.project-procurement-row > div {display:grid;gap:2px;min-width:0;}
.project-procurement-row details {grid-column:1/-1;}
#projectWorkspaceView[data-active-tab="procurement"] .project-workspace-actions {background:transparent;color:var(--er-redesign-ink);}
#projectWorkspaceView [data-detail-edit-project] svg {width:17px;height:17px;vertical-align:middle;margin-inline-end:4px;}
@media(max-width:600px){
  #materialShortageDialog :is(input,textarea,select),.material-decision-dialog :is(input,textarea,select) {font-size:16px;}
  .material-edit-row {grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;}
  .material-edit-row label:first-child {grid-column:1/-1;}
}

/* Personal settings */
#appView #workerSettingsView {width:100%;max-width:880px;min-width:0;margin-inline:auto;color:var(--er-redesign-ink);}
#workerSettingsView .page-header {margin-bottom:16px;}
#workerSettingsView .page-header p {margin:4px 0 0;}
.personal-settings-list {display:grid;gap:8px;min-width:0;}
.personal-setting {
  min-width:0;border:1px solid var(--er-redesign-line);border-radius:12px;
  background:var(--er-redesign-surface);color:var(--er-redesign-ink);
}
.personal-setting>summary {
  display:grid;grid-template-columns:24px minmax(0,1fr) auto 10px;gap:8px;align-items:center;min-height:56px;
  padding:8px 16px;list-style:none;cursor:pointer;overflow-wrap:anywhere;
}
.personal-setting>summary::-webkit-details-marker {display:none;}
.personal-setting>summary::after,.personal-document-chevron {
  content:"";width:8px;height:8px;border:solid var(--er-redesign-muted);border-width:0 2px 2px 0;transform:rotate(45deg);
}
.personal-setting>summary::after {grid-column:4;grid-row:1;align-self:center;}
.personal-setting[open]>summary::after {transform:rotate(225deg);}
.personal-setting>summary>.muted {font-size:.8125rem;text-align:right;max-width:22ch;}
.personal-setting [data-personal-icon] {display:inline-flex;color:var(--er-redesign-accent-ink);}
.personal-setting [data-personal-icon] svg {width:20px;height:20px;}
.personal-setting-body {min-width:0;padding:12px 16px 16px;border-top:1px solid var(--er-redesign-line);}
.personal-form,.personal-password-pair {display:grid;gap:12px;min-width:0;}
.personal-form>label:not(.personal-check),.personal-password-pair>label {display:grid;gap:4px;min-width:0;}
.personal-form input:not([type="checkbox"]) {width:100%;min-width:0;min-height:44px;color:var(--er-redesign-ink);}
.personal-form p,.personal-setting-body>p,#personalPrivacyVersion {margin:0;}
.personal-setting-body>:not(form)+p {margin-top:8px;}
.personal-form .muted,.personal-setting-body>.muted,.personal-device-state dt,.personal-switch small,
.personal-document-row small {font-size:.875rem;color:var(--er-redesign-muted);}
.personal-password-pair {grid-template-columns:repeat(2,minmax(0,1fr));}
.personal-actions {display:flex;flex-wrap:wrap;align-items:center;gap:8px;min-width:0;}
.personal-actions button {min-height:44px;max-width:100%;white-space:normal;}
.personal-actions button svg,.theme-toggle-btn svg,.mobile-nav-theme svg {vertical-align:middle;}
.personal-check,.personal-switch {display:flex;gap:8px;min-height:44px;align-items:center;cursor:pointer;}
.personal-check input,.personal-switch input {accent-color:var(--er-redesign-accent);flex:none;}
.personal-switch {justify-content:space-between;gap:16px;}
.personal-switch small {display:block;margin-top:4px;}
.personal-switch input[type="checkbox"] {width:22px;height:22px;}
.personal-feedback {font-size:.875rem;margin:8px 0 0;}
.personal-feedback[data-tone="success"],#workerPushStatus[data-tone="success"] {color:var(--er-redesign-accent-ink);}
.personal-feedback[data-tone="warning"],#workerPushStatus[data-tone="warning"] {color:var(--uiux-warning-ink);}
.personal-theme-options {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;min-width:0;margin:0;padding:0;border:0;}
.personal-theme-options legend {margin-bottom:8px;font-size:.875rem;color:var(--er-redesign-muted);}
.personal-theme-options label {
  display:grid;grid-template-columns:auto 1fr;gap:4px 8px;place-items:center;min-width:0;min-height:52px;padding:8px;
  border:1px solid var(--er-redesign-line);border-radius:8px;text-align:center;cursor:pointer;overflow-wrap:anywhere;
}
.personal-theme-options label>span:last-child {grid-column:1/-1;font-size:.875rem;}
.personal-theme-options input {accent-color:var(--er-redesign-accent);}
.personal-theme-options label:has(input:checked) {background:var(--er-redesign-accent-soft);border-color:var(--er-redesign-accent-ink);font-weight:650;}
.personal-theme-options label:has(input:focus-visible),.personal-setting>summary:focus-visible,.personal-document-row:focus-visible {
  outline:2px solid var(--er-redesign-accent-ink);outline-offset:-2px;
}
.personal-device-state {margin:12px 0;overflow-wrap:anywhere;}
.personal-device-state>div {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr);gap:8px;padding:8px 0;border-top:1px solid var(--er-redesign-line);}
.personal-device-state dd {margin:0;text-align:right;}
#workerPushHelp {margin:0 0 8px;}
.personal-document-row {
  display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:52px;padding:8px 0;
  border:0;border-bottom:1px solid var(--er-redesign-line);background:transparent;text-align:left;font:inherit;color:inherit;cursor:pointer;
}
.personal-document-row:last-child {border-bottom:0;}
.personal-document-row small {display:block;margin-top:4px;overflow-wrap:anywhere;}
.personal-document-chevron {transform:rotate(-45deg);flex:none;margin-inline-end:4px;}
#personalPrivacyDialog.modal {
  width:min(740px,calc(100% - 24px));max-height:min(90dvh,calc(100dvh - max(8px,env(safe-area-inset-top)) - max(8px,env(safe-area-inset-bottom))));
  padding:0;border-radius:16px;border:1px solid var(--er-redesign-line);background:var(--er-redesign-surface);color:var(--er-redesign-ink);overflow:hidden;
}
#personalPrivacyDialog[open] {display:flex;flex-direction:column;}
#personalPrivacyDialog .modal-head,#personalPrivacyDialog .personal-privacy-actions {padding:8px 16px;margin:0;flex:none;}
#personalPrivacyDialog .modal-head {border-bottom:1px solid var(--er-redesign-line);}
#personalPrivacyDialog .modal-head h2 {margin:0;overflow-wrap:anywhere;}
#personalPrivacyDialog .modal-head .icon-btn {min-width:44px;min-height:44px;}
#personalPrivacyBody {min-height:0;overflow:auto;overscroll-behavior:contain;padding:12px 16px;overflow-wrap:anywhere;}
#personalPrivacyBody :is(.table-card,.modern-table tr,.modern-table td) {max-width:100%;overflow-wrap:anywhere;}
#personalPrivacyBody .table-card {overflow:visible;}
#personalPrivacyBody table {table-layout:fixed;width:100%;}
#personalPrivacyBody code {white-space:normal;overflow-wrap:anywhere;}
#personalPrivacyDialog .personal-privacy-actions {
  display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;
  border-top:1px solid var(--er-redesign-line);
}
#personalPrivacyStatus {font-size:.875rem;color:var(--er-redesign-muted);}
@media(max-width:700px) {
  #appView #workerSettingsView {
    padding-inline:max(12px,env(safe-area-inset-left)) max(12px,env(safe-area-inset-right));
    padding-bottom:max(16px,env(safe-area-inset-bottom));
  }
  .personal-password-pair {grid-template-columns:minmax(0,1fr);}
  .personal-setting>summary,.personal-setting-body {padding-inline:12px;}
  .personal-setting>summary>.muted {max-width:16ch;}
  .personal-form input:not([type="checkbox"]) {font-size:16px;}
  #personalPrivacyDialog .modal-head,#personalPrivacyDialog .personal-privacy-actions,#personalPrivacyBody {padding-inline:12px;}
}
@media(max-width:360px) {
  .personal-setting>summary {grid-template-columns:24px minmax(0,1fr) 10px;}
  .personal-setting>summary>.muted {grid-column:2;text-align:left;max-width:none;}
  .personal-setting>summary::after {grid-column:3;}
}

/* Worker help */
#appView #workerHelpView {
  width:100%;max-width:880px;min-width:0;margin-inline:auto;color:var(--er-redesign-ink);
}
#workerHelpView .page-header {margin-bottom:12px;}
#workerHelpView h2 {font-size:1.0625rem;margin:0 0 8px;}
#workerHelpView p {margin:0;line-height:1.55;overflow-wrap:anywhere;}
#workerHelpView :is(button,summary,input) {min-height:44px;}
#workerHelpView svg {display:block;width:20px;height:20px;flex:none;}
#workerHelpView :is(summary,button,input):focus-visible {outline:2px solid var(--er-redesign-accent-ink);outline-offset:2px;}
#workerHelpSearchForm>label {display:block;margin-bottom:4px;font-size:.875rem;}
.worker-help-search-row {
  display:flex;align-items:center;gap:8px;padding-inline:12px;min-width:0;border:1px solid var(--er-redesign-line);
  border-radius:10px;background:var(--er-redesign-surface);
}
.worker-help-search-row:focus-within {border-color:var(--er-redesign-accent-ink);}
.worker-help-search-row>span {color:var(--er-redesign-muted);}
#workerHelpSearch {flex:1;min-width:0;margin:0;padding:0 4px;border:0;background:transparent;color:var(--er-redesign-ink);}
#workerHelpSearch::-webkit-search-cancel-button {display:none;}
#workerHelpSearchStatus {padding:12px 0;color:var(--er-redesign-muted);}
#workerHelpBrowse {display:grid;gap:16px;margin-top:16px;}
#workerHelpBrowse[hidden] {display:none;}
#workerHelpStart {
  display:grid;grid-template-columns:36px minmax(0,1fr) auto;align-items:center;gap:12px;
  padding:12px 16px;border:1px solid var(--er-redesign-line);border-radius:12px;
  background:var(--er-redesign-accent-soft);color:var(--er-redesign-ink);
}
#workerHelpStart>span {display:grid;place-items:center;min-height:36px;color:var(--er-redesign-accent-ink);}
#workerHelpStart p {font-size:.9375rem;}
#workerHelpStart h2 {margin-bottom:4px;}
#workerHelpStart button {justify-self:start;white-space:normal;text-align:left;}
#workerHelpTopics,#workerHelpResults {min-width:0;}
#workerHelpTopics,.help-topic>div,#workerHelpResults:not([hidden]) {display:grid;gap:8px;}
.help-disclosure,.help-article {
  min-width:0;border:1px solid var(--er-redesign-line);border-radius:10px;background:var(--er-redesign-surface);
}
.help-disclosure>summary,.help-article>summary {
  display:grid;grid-template-columns:20px minmax(0,1fr) 10px;align-items:center;gap:10px;
  padding:8px 12px;min-width:0;list-style:none;cursor:pointer;overflow-wrap:anywhere;
}
.help-article>summary {grid-template-columns:minmax(0,1fr) 10px;scroll-margin-top:12px;}
.help-disclosure>summary::-webkit-details-marker,.help-article>summary::-webkit-details-marker {display:none;}
.help-disclosure>summary::after,.help-article>summary::after {
  content:"";width:8px;height:8px;border:solid var(--er-redesign-muted);border-width:0 2px 2px 0;transform:rotate(45deg);
}
.help-disclosure[open]>summary::after,.help-article[open]>summary::after {transform:rotate(225deg);}
.help-disclosure>summary>span,#workerHelpNavItems>li>span {color:var(--er-redesign-accent-ink);}
.help-topic>div {padding:0 8px 8px;}
.help-topic .help-article {background:var(--er-redesign-bg);}
.help-article-body {padding:8px 12px 12px;border-top:1px solid var(--er-redesign-line);}
.help-article-body>*+* {margin-top:8px!important;}
.help-article-body ol {padding-inline-start:1.4em;margin-bottom:0;}
.help-article-body li {padding-inline-start:4px;margin:4px 0;line-height:1.5;}
.help-article-body li::marker {color:var(--er-redesign-accent-ink);font-weight:650;}
.help-article-body button {max-width:100%;white-space:normal;text-align:left;}
.help-result-topic,.help-result-excerpt {display:block;color:var(--er-redesign-muted);font-size:.875rem;}
.help-result-excerpt {display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;}
.help-article[open]>summary .help-result-excerpt {display:none;}
.help-example {
  max-width:42ch;margin-inline:0;margin-bottom:0;padding:8px 12px;border:1px solid var(--er-redesign-line);
  border-radius:8px;background:var(--er-redesign-surface);
}
.help-example figcaption {font-weight:650;}
.help-example dl {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 12px;margin:8px 0;}
.help-example dl>div {display:flex;flex-wrap:wrap;justify-content:space-between;gap:4px;}
.help-example dd {margin:0;font-variant-numeric:tabular-nums;font-weight:650;}
#workerHelpNavItems,#workerHelpFeaturedItems {margin:0;padding:0;list-style:none;}
#workerHelpNavItems {padding:0 12px;}
#workerHelpNavItems>li {display:grid;grid-template-columns:20px minmax(0,1fr);align-items:start;gap:10px;padding:8px 0;border-top:1px solid var(--er-redesign-line);}
#workerHelpNavItems>li>div>span {display:block;color:var(--er-redesign-muted);}
#workerHelpDocNote {padding:0 12px 8px;}
#workerHelpFeaturedItems {
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 12px;
  padding:0 8px;border:1px solid var(--er-redesign-line);border-radius:10px;background:var(--er-redesign-surface);
}
#workerHelpFeaturedItems li {min-width:0;}
#workerHelpFeaturedItems button {width:100%;justify-content:flex-start;padding-inline:4px;white-space:normal;text-align:left;font-weight:550;}
#workerHelpFooter {display:grid;gap:4px;margin-top:16px;color:var(--er-redesign-muted);}
#workerHelpFooter>div {display:flex;gap:8px;flex-wrap:wrap;}
#workerHelpFooter button {max-width:100%;white-space:normal;}
@media(max-width:700px) {
  #appView #workerHelpView {padding-inline:max(12px,env(safe-area-inset-left)) max(12px,env(safe-area-inset-right));padding-bottom:max(16px,env(safe-area-inset-bottom));}
  #workerHelpStart {grid-template-columns:28px minmax(0,1fr);gap:8px;padding:12px;}
  #workerHelpStart button {grid-column:2;}
  #workerHelpSearch {font-size:16px;}
  #workerHelpFeaturedItems {grid-template-columns:minmax(0,1fr);}
  #workerHelpFeaturedItems li+li {border-top:1px solid var(--er-redesign-line);}
}
@media print {
  body:has(#workerHelpView:not([hidden])) :is(#workerBottomNav,#managerBottomNav,.sidebar,.mobile-topbar,#workerHelpSearchForm,#workerHelpResults,#workerHelpSearchStatus,#workerHelpFeatured,#workerHelpView button) {display:none!important;}
  #appView:has(#workerHelpView:not([hidden])),#appView:has(#workerHelpView:not([hidden])) main {display:block!important;overflow:visible!important;height:auto!important;}
  #appView #workerHelpView {max-width:none;margin:0;padding:0;overflow:visible;}
  #workerHelpView,#workerHelpView * {color:#111!important;background:white!important;box-shadow:none!important;}
  #workerHelpView :is(summary,#workerHelpStart) {break-after:avoid;}
  #workerHelpView :is(.help-disclosure,.help-article) {border-color:#bbb;}
}
