

@font-face {
  font-family: Inter;
  src: url("fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #171717;
  --muted: #6b6b6b;
  --line: #e7e7e7;
  --paper: #fff;
  --soft: #f7f7f7;
  --red: #FF453A;
  --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 {
  font-weight: 700;
  letter-spacing: .02em;
}
.app {
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-columns: 210px 1fr;
}
.sidebar {
  padding: 30px 18px;
  border-right: 1px solid var(--line);
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.brand { font-weight: 800; letter-spacing: .19em; font-size: 15px; margin: 5px 10px 42px; }
.brand span { color: var(--red); }
.nav { display: grid; gap: 6px; }
.nav-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #6b6b6b;
  margin: 14px 10px 4px;
  padding: 0;
}
.nav-label:first-child { margin-top: 0; }
.nav button {
  font: inherit;
  font-weight: 400;
  text-align: left;
  border: 0;
  border-left: 3px solid transparent;
  background: transparent;
  border-radius: 0 9px 9px 0;
  padding: 12px 13px 12px 10px;
  color: #555;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
}
.nav button .nav-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: #555;
  overflow: hidden;
}
.nav button .nav-ico svg {
  width: 18px;
  height: 18px;
  max-width: 18px;
  max-height: 18px;
  stroke: currentColor;
  fill: none !important;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
  display: block;
}
.nav-ico svg * {
  fill: none !important;
  stroke: currentColor;
}
.nav button:hover .nav-ico,
.nav button.active .nav-ico {
  color: var(--ink);
}
.nav button:hover {
  color: var(--ink);
  background: var(--soft);
  font-weight: 500;
}
.nav button.active,
.nav button.active:hover {
  color: var(--ink);
  background: #f0f0f0;
  font-weight: 700;
  border-left-color: var(--red);
}
/* Night precision active plate handled in body.night */
.side-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  padding: 10px;
}
.sidebar-foot {
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  flex-direction: column;
}
.app-version { color: var(--muted); font-size: 11px; font-weight: 700; padding: 10px; }
.main {
  height: 100vh;
  overflow-y: auto;
  padding: 54px clamp(24px, 5vw, 76px);
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
}
.view { display: none; }
.view.active { display: block; }
.eyebrow {
  font-size: 11px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin: 0 0 12px;
}
h1 { font-size: clamp(29px, 4vw, 44px); line-height: 1.05; letter-spacing: -.04em; margin: 0 0 9px; }
h2 { font-size: 20px; letter-spacing: -.02em; margin: 0; }
p.sub { color: var(--muted); margin: 0 0 36px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 16px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.task-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
}
.task-card .date { font-size: 12px; color: var(--muted); margin-bottom: 22px; }
.task-card h3 { font-size: 17px; line-height: 1.3; margin: 0 0 12px; }
.task-card .meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.overview-card .eyebrow { margin-bottom: 14px; }
.overview-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: auto;
}
.overview-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.overview-stat b {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.1;
}
.overview-stat span {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.25;
}
.overview-stat--overdue b { color: #FF453A; }
.overview-stat--overdue .status {
  margin-top: 2px;
  align-self: flex-start;
}
body.night .overview-stat--overdue b { color: #FF453A; }
.overview-lop-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.overview-lop-list li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.overview-lop-link {
  font-weight: 650;
  text-align: left;
  padding: 0;
}
.overview-lop-due {
  font-size: 12px;
  color: var(--muted);
}
.overview-defect-name {
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
  margin: 0 0 8px;
}
.overview-defect-count {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.1;
}
.overview-defect-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
.overview-empty {
  color: var(--muted);
  font-size: 13px;
  margin-top: auto;
}
.overview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.empty {
  border: 1px dashed #cfcfcf;
  border-radius: var(--radius);
  padding: 31px;
  color: var(--muted);
  text-align: center;
  grid-column: 1 / -1;
}
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 25px 0 18px; }
.toolbar .spacer { flex: 1; }
.button, button { font: inherit; }
.button {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  cursor: pointer;
}
.button:hover { opacity: .82; }
.button.secondary { background: white; color: var(--ink); border-color: #cfcfcf; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.filter {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 10px 11px;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
}
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 850px; }
th {
  text-align: left;
  background: var(--soft);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  padding: 13px 15px;
  white-space: nowrap;
}
td { padding: 13px 15px; border-top: 1px solid var(--line); vertical-align: middle; }
tr.overdue td { background: #fff7f7; }
tr:hover td { background: #fafafa; }
.status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 5px;
  background: transparent;
  border: 1px solid #A1A1A6;
  color: #A1A1A6;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.status.complete,
.status.closed {
  background: transparent;
  border-color: #30D158;
  color: #30D158;
}
.status.overdue {
  background: transparent;
  border-color: #FF453A;
  color: #FF453A;
}
.status.canceled,
.status.in-progress,
.status.open {
  background: transparent;
  border-color: #A1A1A6;
  color: #A1A1A6;
}
.status.rejected {
  background: transparent;
  border-color: #FF6961;
  color: #FF6961;
}
.title-overdue { color: #FF453A; }
.row-actions { display: flex; gap: 8px; }
.link-btn {
  border: 0;
  background: transparent;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  color: var(--ink);
  font-size: 12px;
}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .36);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 5;
}
.modal.open { display: flex; }
.dialog {
  width: min(680px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 26px;
  box-shadow: 0 14px 50px rgba(0, 0, 0, .15);
}
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 19px; }
.icon-btn { border: 0; background: transparent; font-size: 23px; cursor: pointer; padding: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid label { font-size: 12px; font-weight: 600; display: grid; gap: 6px; }
.form-grid input,
.form-grid select,
.form-grid textarea {
  font: inherit;
  border: 1px solid #cfcfcf;
  border-radius: 8px;
  padding: 10px;
  background: white;
}
.form-grid textarea { resize: vertical; min-height: 86px; }
.form-grid .wide { grid-column: 1 / -1; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.attendance-top { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 25px 0 18px; }
.month-label { font-size: 18px; font-weight: 650; min-width: 150px; text-align: center; }
.hours-total { margin-left: auto; font-size: 13px; color: var(--muted); }
.hours-total strong { color: var(--ink); font-size: 18px; margin-left: 6px; }
.attendance-table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
}
.attendance-table th {
  white-space: normal;
  vertical-align: middle;
}
.attendance-table th:nth-child(1),
.attendance-table td:nth-child(1) { width: 118px; }
.attendance-table th:nth-child(2),
.attendance-table td:nth-child(2) { width: 96px; max-width: 96px; }
.attendance-table th:nth-child(3),
.attendance-table th:nth-child(4),
.attendance-table th:nth-child(5),
.attendance-table td:nth-child(3),
.attendance-table td:nth-child(4),
.attendance-table td:nth-child(5) {
  width: 100px;
  text-align: center;
}
.attendance-table th:nth-child(6),
.attendance-table td:nth-child(6) { width: 118px; }
.attendance-table td { height: 48px; box-sizing: border-box; }
.attendance-table input {
  border: 1px solid transparent;
  background: transparent;
  font: inherit;
  padding: 7px;
  width: 100%;
  border-radius: 6px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.attendance-table input:focus { outline: 0; border-color: #aaa; background: white; }
.weekend td { background: #fafafa; color: #999; }
.day-name {
  color: var(--muted);
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attendance-table tr:hover td.week-total { background: #f4f7f9; }
.notice { font-size: 12px; color: var(--muted); margin: 0 0 13px; }
.hidden-input { display: none; }
.priority {
  display: inline-grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}
.p1 { background: #fde7e7; color: #a82020; }
.p2 { background: #fff1d6; color: #9b6500; }
.p3 { background: #e9eef3; color: #476070; }
.complete-btn {
  border: 1px solid #b9d8c0;
  background: #fff;
  color: #26653a;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 11px;
  cursor: pointer;
}
.complete-btn:hover { background: #e9f4ec; }
.free-day { color: #148aa1; font-weight: 650; }
.week-total {
  background: #f4f7f9;
  font-weight: 750;
  text-align: center;
  vertical-align: middle;
  color: #263c4a;
  font-variant-numeric: tabular-nums;
  border-left: 1px solid var(--line);
}
.theme-row { display: flex; gap: 8px; margin: 0 8px 6px; }
.theme-toggle {
  margin: 0;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--ink);
  border-radius: 99px;
  width: 42px;
  height: 42px;
  font-size: 19px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.theme-toggle svg { display: block; }
.skin-toggle.is-on { border-color: #ff8a18; color: #ff8a18; }
.theme-toggle:hover { transform: scale(1.04); }
.sort-btn {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  padding: 0;
  cursor: pointer;
}
.sort-btn:hover { text-decoration: underline; }
.subtask-row td { background: #fafafa; padding: 0 15px; }
.subtasks { padding: 10px 0 10px 16px; margin: 0; display: grid; gap: 7px; }
.subtasks li { list-style: none; color: var(--muted); }
.subtasks input { margin-right: 8px; }
.subtask-editor { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 14px; }
.subtask-editor h3 { font-size: 13px; margin: 0 0 9px; }
.subtask-item { display: flex; gap: 8px; margin: 6px 0; }
.subtask-item input[type="text"] { flex: 1; }
.subtask-item input[type="checkbox"] { width: auto; }
.subtask-add { margin-top: 6px; padding: 7px 10px; }
.corrective-table { min-width: 720px; }
.corrective-table td.ca-action-cell {
  white-space: normal;
  word-break: break-word;
  min-width: 160px;
  max-width: 420px;
}

body.night {
  --ink: #F5F5F7;
  --muted: #A1A1A6;
  --line: #2A2A2A;
  --paper: #111111;
  --soft: #1A1A1A;
  --red: #FF453A;
  color-scheme: dark;
}
body.night .sidebar { border-color: var(--line); background: #111111; }
body.night .nav-label { color: var(--muted); }
body.night .nav button { color: var(--muted); }
body.night .nav button .nav-ico { color: var(--muted); }
body.night .nav button:hover {
  color: var(--ink);
  background: #2C2C2E;
  font-weight: 500;
}
body.night .nav button:hover .nav-ico { color: var(--ink); }
body.night .nav button.active,
body.night .nav button.active:hover {
  color: var(--ink);
  background: #2C2C2E;
  font-weight: 700;
  border-left-color: var(--red);
}
body.night .nav button.active .nav-ico { color: var(--ink); }
body.night .button {
  background: #F5F5F7;
  color: #111111;
  border-color: #F5F5F7;
}
body.night .button.secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
body.night .filter,
body.night .form-grid input,
body.night .form-grid select,
body.night .form-grid textarea {
  background: #1A1A1A;
  color: var(--ink);
  border-color: var(--line);
}
body.night .table-wrap {
  border-color: var(--line);
  background: #1A1A1A;
}
body.night th {
  background: #1A1A1A;
  color: var(--muted);
}
body.night tr:hover td,
body.night .subtask-row td { background: #2C2C2E; }
body.night .weekend td { background: #141414; }
body.night .week-total,
body.night .attendance-table tr:hover td.week-total {
  background: #2C2C2E;
  color: var(--ink);
}
body.night .dialog { background: #1A1A1A; border-color: var(--line); }
body.night .link-btn { color: var(--ink); }
body.night .link-btn.export-btn { color: #F5F5F7; }
body.night .complete-btn {
  background: #1A1A1A;
  color: #b7e6c3;
  border-color: #3d5c45;
}
body.night .status {
  background: transparent;
  border-color: #A1A1A6;
  color: #A1A1A6;
}
body.night .status.complete,
body.night .status.closed {
  background: transparent;
  border-color: #30D158;
  color: #30D158;
}
body.night .status.overdue {
  background: transparent;
  border-color: #FF453A;
  color: #FF453A;
}
body.night .status.canceled,
body.night .status.in-progress,
body.night .status.open {
  background: transparent;
  border-color: #A1A1A6;
  color: #A1A1A6;
}
body.night .status.rejected {
  background: transparent;
  border-color: #FF6961;
  color: #FF6961;
}
body.night .title-overdue { color: #FF453A; }
body.night .task-card { background: #1A1A1A; border-color: var(--line); }
body.night .empty { border-color: var(--line); color: var(--muted); }
body.night .theme-toggle { background: #2C2C2E; color: var(--ink); border-color: var(--line); }
body.night .user-chip,
body.night .login-card {
  background: #1A1A1A;
  border-color: var(--line);
}
body.night .login-card { box-shadow: none; }
body.night .login-card input,
body.night .provider-btn {
  background: #111111;
  color: var(--ink);
  border-color: var(--line);
}
body.night .role-badge {
  background: transparent;
  border: 1px solid #A1A1A6;
  color: #A1A1A6;
  padding: 1px 7px;
}
body.night .role-badge.admin { background: transparent; border-color: #FF6961; color: #FF6961; }
body.night .role-badge.editor { background: transparent; border-color: #30D158; color: #30D158; }
body.night .role-badge.viewer { background: transparent; border-color: #A1A1A6; color: #A1A1A6; }
body.night tr.overdue td { background: #3a1a1e; }
body.night .perm-chip { background: #2C2C2E; color: #F5F5F7; }
body.night .perm-chip.edit { background: #1d5036; color: #d8f3df; }
body.night .perm-chip.view { background: #2C2C2E; color: #F5F5F7; }
body.night .perm-row select {
  background: #111111;
  color: var(--ink);
  border-color: var(--line);
}
body.night .perm-hint { color: var(--muted); }
body.night .icon-btn { color: var(--ink); }
body.night .attendance-table input { color: var(--ink); }
body.night .attendance-table input:focus {
  background: #111111;
  border-color: #A1A1A6;
}
body.night #quality-root {
  --qi: #F5F5F7;
  --qm: #A1A1A6;
  --ql: #2A2A2A;
  --qp: #111111;
  --qc: #1A1A1A;
  --qb: #2C2C2E;
  --qr: #FF453A;
  color: var(--qi);
}
body.night #quality-root .q-hero {
  background: #1A1A1A;
  color: var(--qi);
  border: 1px solid var(--line);
}
body.night #quality-root h2 { color: var(--qi); }
body.night #quality-root .q-hero p { color: var(--qm); }
body.night #quality-root .q-upload {
  background: #F5F5F7;
  color: #111111;
}
body.night #quality-root button:not(.date-pop-day):not(.date-pop-nav) {
  background: #2C2C2E;
  color: #F5F5F7;
  border: 1px solid var(--line);
}
body.night #quality-root button.q-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
body.night #quality-root .q-status {
  background: #1A1A1A;
  color: var(--qm);
  border-left-color: var(--red);
}
body.night #quality-root .q-filters,
body.night #quality-root .q-kpi,
body.night #quality-root .q-card,
body.night #quality-root .q-top {
  background: #1A1A1A;
  border-color: var(--line);
}
body.night #quality-root select,
body.night #quality-root input,
body.night #quality-root textarea {
  background: #111111;
  color: var(--qi);
  border-color: var(--line);
}
body.night #quality-root th {
  background: #1A1A1A;
  color: var(--muted);
}
body.night #quality-root td { border-top-color: var(--line); }
body.night #quality-root ul,
body.night #quality-root li { border-color: var(--line); }
body.night input[type="date"] { color-scheme: dark; }
body.night .status-dot.on { color: #8ee0a8; }
body.night .status-dot.off { color: #ffb4b8; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 8px;
  margin: 12px 4px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}
.user-chip .who { display: grid; min-width: 0; }
.user-chip .who strong {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-chip .who span { font-size: 11px; color: var(--muted); }
.role-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: #e9eef3;
  color: #476070;
}
.role-badge.admin { background: #fde7e7; color: #a82020; }
.role-badge.editor { background: #e9f4ec; color: #26653a; }
.role-badge.viewer { background: #e9eef3; color: #476070; }
.sign-out-btn {
  border: 0;
  background: transparent;
  text-decoration: underline;
  font-size: 11px;
  color: var(--muted);
  padding: 0;
  cursor: pointer;
  text-align: left;
}
.download-pack {
  margin: 10px 8px 0;
  width: calc(100% - 16px);
  text-align: center;
}
.app-alert {
  margin: 0 0 18px;
  padding: 11px 14px;
  border-radius: 8px;
  background: #fff4f4;
  color: #af2525;
  font-size: 13px;
}
.app-ok {
  margin: 0 0 18px;
  padding: 11px 14px;
  border-radius: 8px;
  background: #e9f4ec;
  color: #26653a;
  font-size: 13px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background: var(--paper);
}
.login-card {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px 28px;
  background: #fff;
  box-shadow: 0 14px 50px rgba(0, 0, 0, .06);
}
.login-logo {
  display: block;
  width: 86px;
  height: auto;
  object-fit: contain;
  margin: 0 auto 18px;
  background: transparent;
}
.login-card .brand { margin: 0 0 28px; text-align: center; }
.login-card h1 { font-size: 28px; margin-bottom: 22px; }
.login-card .sub { margin-bottom: 22px; }
.login-card form { display: grid; gap: 12px; }
.login-linkedin {
  display: flex;
  justify-content: center;
  margin-top: 22px;
}
.login-linkedin a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  opacity: .92;
}
.login-linkedin a:hover { opacity: 1; }
.login-card label { font-size: 12px; font-weight: 600; display: grid; gap: 6px; }
.login-card input {
  font: inherit;
  border: 1px solid #cfcfcf;
  border-radius: 8px;
  padding: 10px;
  background: white;
}
.login-card .error { color: #af2525; font-size: 13px; margin: 0; }
.login-forgot-wrap { text-align: center; margin: 8px 0 0; }
.login-forgot { margin-top: 12px; display: grid; gap: 10px; }
.login-forgot[hidden] { display: none !important; }
.login-split {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  margin: 18px 0 12px;
}
.login-split::before,
.login-split::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.provider-btn {
  width: 100%;
  border: 1px solid #cfcfcf;
  background: white;
  color: var(--ink);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 8px;
  cursor: pointer;
}
.provider-btn:hover { background: var(--soft); }
.login-switch { font-size: 13px; color: var(--muted); text-align: center; margin-top: 16px; }
.login-switch button { color: var(--ink); }

.skeleton-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 210px 1fr;
}
.skeleton-side { border-right: 1px solid var(--line); padding: 30px 18px; }
.skel {
  background: var(--soft);
  border-radius: 8px;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: .55; }
  50% { opacity: 1; }
}

#quality-root { --qi: #172033; --qm: #657189; --ql: #dfe5ee; --qp: #f4f6fa; --qc: #fff; --qb: #1867db; --qr: #e85454; color: var(--qi); font: 14px/1.45 Inter, ui-sans-serif, system-ui, sans-serif; }
#quality-root * { box-sizing: border-box; }
#quality-root .q-hero { background: #1A1A1A; color: #F5F5F7; border: 1px solid #2A2A2A; border-radius: 18px; padding: 24px 27px; display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; }
#quality-root .q-kicker, #quality-root label { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
#quality-root h2 { font-size: 27px; margin: 3px 0; letter-spacing: -.04em; color: #F5F5F7; }
#quality-root .q-hero p { margin: 0; color: #A1A1A6; }
#quality-root .q-upload { background: #fff; color: #0d1d35; border-radius: 10px; padding: 10px 13px; cursor: pointer; font-weight: 750; white-space: nowrap; text-transform: none; letter-spacing: 0; font-size: 14px; }
#quality-root .q-upload input { display: none; }
#quality-root .q-status { margin: 16px 0; padding: 11px 14px; background: #eaf2ff; color: #285188; border-left: 4px solid var(--qb); border-radius: 8px; }
#quality-root .q-hide { display: none !important; }
#quality-root .q-filters { background: #fff; border: 1px solid var(--ql); border-radius: 15px; padding: 17px; display: grid; grid-template-columns: repeat(6, minmax(135px, 1fr)); gap: 13px; align-items: start; overflow: visible; }
#quality-root .q-filter label { display: block; color: var(--qm); min-height: 16px; margin-bottom: 5px; }
#quality-root select, #quality-root input, #quality-root textarea { width: 100%; font: inherit; color: var(--qi); background: #fff; border: 1px solid #cfd8e5; border-radius: 8px; padding: 8px; }
#quality-root select[multiple] { height: 76px; }
#quality-root .q-project-box { max-width: 168px; }
#quality-root .q-project-box select[multiple] { height: calc(5 * 1.45em + 20px); width: 150px; }
#quality-root .q-rates { max-width: 150px; display: flex; flex-direction: column; gap: 6px; }
#quality-root .q-rates input { width: 110px; }
#quality-root .q-rates label { margin-bottom: 0; min-height: 0; }
#quality-root .q-search {
  margin-bottom: 6px;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
}
#quality-root .q-wide { grid-column: span 2; }
#quality-root .q-buttons { display: flex; gap: 7px; align-self: end; padding-top: 21px; }
#quality-root button { border: 0; border-radius: 8px; padding: 10px 13px; font: inherit; font-weight: 750; cursor: pointer; background: var(--qb); color: #fff; }
#quality-root button.q-secondary { background: #edf2f9; color: #2c4365; }
#quality-root .q-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin: 17px 0; }
#quality-root .q-kpi, #quality-root .q-card, #quality-root .q-top { background: #fff; border: 1px solid var(--ql); border-radius: 14px; }
#quality-root .q-kpi { padding: 15px; }
#quality-root .q-kpi b { display: block; font-size: 28px; letter-spacing: -.05em; color: var(--qi); }
#quality-root .q-kpi span, #quality-root .q-note { color: var(--qm); font-size: 12px; }
#quality-root .q-card { padding: 20px; border: 1px solid var(--line); border-radius: 14px; }
#quality-root .q-cardhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
#quality-root .q-cardhead h3, #quality-root .q-tophead h3 { margin: 0; font-size: 18px; color: var(--qi); }
#quality-root .q-cardhead p, #quality-root .q-chart-note { color: var(--qm); font-size: 12px; margin: 4px 0 0; }
#quality-root .q-chart-tabs {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}
#quality-root .q-chart-tab {
  border: 0;
  background: transparent !important;
  color: var(--qm) !important;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 12px !important;
  cursor: pointer;
  border-radius: 0 !important;
}
#quality-root .q-chart-tab + .q-chart-tab { border-left: 1px solid var(--line); }
#quality-root .q-chart-tab.active {
  background: var(--ink) !important;
  color: var(--paper) !important;
}
#quality-root .q-chart-meta { margin: 0 0 8px; }
#quality-root .q-chart { height: 440px; min-height: 440px; max-height: 720px; position: relative; overflow: visible; }
body.night #quality-root .q-chart-tab.active {
  background: var(--ink) !important;
  color: var(--paper) !important;
}
#quality-root .q-tophead { margin: 23px 0 10px; }
#quality-root .q-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 11px; width: 100%; min-width: 0; }
#quality-root .q-top { padding: 14px; border-top: 4px solid var(--qr); }
#quality-root .q-rank { color: var(--qr); font-size: 11px; font-weight: 850; letter-spacing: .06em; }
#quality-root .q-part { font-weight: 800; margin: 5px 0; white-space: normal; overflow-wrap: anywhere; word-break: break-word; color: var(--qi); }
#quality-root .q-rate { font-size: 24px; font-weight: 850; letter-spacing: -.04em; color: var(--qi); }
#quality-root .q-counts { color: var(--qm); font-size: 12px; margin-bottom: 9px; }
#quality-root ul { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ql); }
#quality-root li { border-bottom: 1px solid var(--ql); font-size: 12px; padding: 5px 0; display: flex; justify-content: space-between; gap: 6px; color: var(--qi); min-width: 0; }
#quality-root li span { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
#quality-root li b { flex-shrink: 0; }
#quality-root .q-dashboard, #quality-root .q-card, #quality-root .q-top { min-width: 0; max-width: 100%; }
#quality-root .q-plan { margin-top: 23px; overflow: auto; }
#quality-root table { width: 100%; border-collapse: collapse; min-width: 1050px; }
#quality-root th { padding: 9px 7px; background: #f5f7fb; color: #52627b; font-size: 10px; text-align: left; text-transform: uppercase; }
#quality-root td { padding: 8px 7px; border-top: 1px solid var(--ql); font-size: 12px; vertical-align: top; }
#quality-root textarea { height: 54px; min-width: 125px; resize: vertical; padding: 6px; }
#quality-root td input { min-width: 90px; padding: 6px; }
#quality-root .q-history { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
@media (max-width: 1100px) {
  #quality-root .q-filters { grid-template-columns: repeat(3, 1fr); }
  #quality-root .q-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 780px) {
  .app, .skeleton-app {
    height: auto;
    overflow: visible;
    grid-template-columns: 1fr;
  }
  .sidebar {
    height: auto;
    overflow: visible;
    position: static;
    padding: 17px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand { margin: 0 8px 16px; }
  .nav { grid-template-columns: repeat(2, 1fr); gap: 4px; }
  .nav-label { grid-column: 1 / -1; margin: 10px 4px 2px; }
  .nav button {
    text-align: center;
    justify-content: center;
    padding: 10px 4px;
    font-size: 12px;
    border-left-width: 0;
    border-radius: 9px;
    gap: 6px;
  }
  .nav button .nav-ico { width: 18px; height: 18px; }
  .nav button .nav-ico svg { width: 18px; height: 18px; max-width: 18px; max-height: 18px; }
  .nav button.active,
  .nav button.active:hover {
    border-left-color: transparent;
    box-shadow: inset 3px 0 0 var(--red);
  }
  .sidebar-foot { margin-top: 14px; padding-top: 8px; }
  .side-note, .app-version { display: none; }
  .main {
    height: auto;
    overflow: visible;
    padding: 34px 18px;
  }
  .cards { grid-template-columns: 1fr; }
  .toolbar .spacer { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .attendance-top { justify-content: center; }
  .hours-total { margin-left: 0; width: 100%; text-align: center; }
  #quality-root .q-hero { display: block; }
  #quality-root .q-upload { display: inline-block; margin-top: 12px; }
  #quality-root .q-filters, #quality-root .q-kpis, #quality-root .q-grid { grid-template-columns: repeat(2, 1fr); }
  #quality-root .q-wide { grid-column: span 2; }
  #quality-root .q-chart { height: 240px; }
}

.dialog-wide { width: min(760px, 100%); }
.perm-box { margin-top: 18px; }
.perm-box h3 { margin: 0 0 6px; font-size: 14px; }
.perm-hint { margin: 0 0 12px; color: #666; font-size: 12px; }
.perm-grid { display: grid; gap: 8px; }
.perm-row { display: grid; grid-template-columns: 1fr 160px; gap: 10px; align-items: center; font-size: 13px; }
.perm-row select { font: inherit; border: 1px solid #cfcfcf; border-radius: 8px; padding: 8px; }
.perm-cell { max-width: 280px; }
.perm-chip { display: inline-block; margin: 0 4px 4px 0; padding: 2px 7px; border-radius: 999px; font-size: 11px; background: #f1f1f1; }
.perm-chip.edit { background: #e8f4ee; }
.perm-chip.view { background: #eef2f8; }
.status-dot { font-size: 12px; font-weight: 650; }
.status-dot.on { color: #26653a; }
.status-dot.off { color: #af2525; }
.user-off td { opacity: .55; }
.link-btn.danger {
  color: #af2525;
  text-decoration: none;
}
.link-btn.danger:hover { text-decoration: underline; }
.link-btn.export-btn { color: #1867db; font-weight: 750; }
body.night .link-btn.danger { color: #ffb4b8; }
#complaints > .sub {
  margin-bottom: 18px;
}
.c-charts {
  margin: 0 0 18px;
}
.c-chart-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  background: var(--paper);
}
.c-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.c-chart-head h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -.02em;
  color: var(--ink);
}
.c-chart-note {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.c-chart-tabs {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}
.c-chart-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 12px;
  cursor: pointer;
}
.c-chart-tab + .c-chart-tab {
  border-left: 1px solid var(--line);
}
.c-chart-tab.active {
  background: var(--ink);
  color: var(--paper);
}
.c-chart-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.c-chart-filters .filter {
  min-width: 120px;
}
.c-chart-canvas {
  height: 280px;
  min-height: 280px;
  max-height: 720px;
  position: relative;
  overflow: auto;
}
.c-chart-meta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
body.night .c-chart-tab.active {
  background: var(--ink);
  color: var(--paper);
}
#complaints .table-wrap {
  overflow: visible;
}
table.complaint-table {
  width: 100%;
  table-layout: fixed;
  min-width: 0;
}
.complaint-table th,
.complaint-table td {
  padding: 10px 10px;
  vertical-align: top;
}
.complaint-table th:nth-child(1),
.complaint-table td:nth-child(1) { width: 14%; }
.complaint-table th:nth-child(2),
.complaint-table td:nth-child(2) { width: 9%; }
.complaint-table th:nth-child(3),
.complaint-table td:nth-child(3) { width: 22%; }
.complaint-table th:nth-child(4),
.complaint-table td:nth-child(4) { width: 16%; }
.complaint-table th:nth-child(5),
.complaint-table td:nth-child(5) { width: 9%; }
.complaint-table th:nth-child(6),
.complaint-table td:nth-child(6) { width: 9%; }
.complaint-table th:nth-child(7),
.complaint-table td:nth-child(7) { width: 200px; }
.complaint-table .c-report {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.complaint-table .c-date {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.complaint-table .c-defect {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  line-height: 1.35;
}
.complaint-table .c-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.complaint-table .c-muted {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.complaint-table .c-part-desc {
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.complaint-table .c-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.complaint-table .c-days {
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.complaint-table .c-actions-head,
.complaint-table td.c-actions {
  position: sticky;
  right: 0;
  background: var(--paper);
  z-index: 1;
  white-space: nowrap;
  box-shadow: -8px 0 10px -10px rgba(0, 0, 0, .18);
}
.complaint-table th.c-actions-head {
  background: var(--soft);
  z-index: 2;
}
.complaint-table .row-actions {
  flex-wrap: nowrap;
  white-space: nowrap;
  justify-content: flex-start;
  gap: 6px;
}
.complaint-table td.c-actions .link-btn {
  font-size: 11px;
}
tr.row-due-soon td { background: #fff6d8; }
tr.row-due-now td { background: #ffe4e4; }
tr.row-due-soon td.c-actions { background: #fff6d8; }
tr.row-due-now td.c-actions { background: #ffe4e4; }
tr:hover td.c-actions { background: #fafafa; }
body.night tr.row-due-soon td { background: #3a3420; }
body.night tr.row-due-now td { background: #3a1a1e; }
body.night tr.row-due-soon td.c-actions { background: #3a3420; }
body.night tr.row-due-now td.c-actions { background: #3a1a1e; }
body.night tr:hover td.c-actions { background: #2C2C2E; }
body.night .complaint-table th.c-actions-head { background: var(--soft); color: var(--muted); }
.date-eu { font-variant-numeric: tabular-nums; }
.doc-meta { color: var(--muted); font-size: 12px; }
.q-part-name { font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 2px; line-height: 1.25; overflow-wrap: anywhere; word-break: break-word; }
.ca-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.ca-thumb-lg { max-width: 220px; max-height: 160px; object-fit: contain; border-radius: 8px; border: 1px solid var(--line); }
.ca-preview { min-height: 0; }
.notes-list { display: grid; gap: 12px; }
.note-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--paper); }
.note-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.note-head h3 { margin: 0; font-size: 16px; }
.note-body { margin: 10px 0 8px; white-space: pre-wrap; line-height: 1.45; }
textarea { width: 100%; min-height: 120px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: var(--paper); color: var(--ink); resize: vertical; }
.changelog-box { margin-top: 36px; max-width: 720px; }
.changelog-box h3 { margin: 0 0 6px; font-size: 16px; }
.changelog-list { margin: 14px 0 0; padding-left: 18px; color: var(--ink); }
.changelog-list li { margin: 6px 0; line-height: 1.4; }
#activity-list { max-height: 8.6rem; overflow-y: auto; overscroll-behavior: contain; padding-right: 8px; }
input.date-eu { min-width: 130px; }
.date-wrap { position: relative; display: block; width: 100%; }
.date-wrap input.date-eu { width: 100%; padding-right: 2.6em; box-sizing: border-box; }
.date-wrap input.date-cal {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: 0;
  border: 0;
  overflow: hidden;
}
.date-pop {
  position: absolute;
  z-index: 240;
  right: 0;
  top: calc(100% + 6px);
  width: 292px;
  min-width: 292px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(18, 26, 36, 0.96);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
  backdrop-filter: blur(20px);
  color: #f5f5f7;
  overflow: hidden;
}
.date-pop button {
  min-width: 0;
  box-sizing: border-box;
}
.date-pop-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px; font-size: 13px; font-weight: 600;
}
.date-pop-nav {
  width: 28px; height: 28px; border: 0; border-radius: 8px;
  background: rgba(255,255,255,.08); color: inherit; cursor: pointer;
}
.date-pop-dow, .date-pop-grid {
  display: grid; grid-template-columns: 34px repeat(7, 1fr); gap: 2px; text-align: center;
}
.date-pop-cw { font-size: 9px; color: #8e8e93; display: flex; align-items: center; justify-content: center; }
.date-pop-dow { font-size: 10px; color: #8e8e93; margin-bottom: 4px; }
.date-pop-day {
  width: 100%;
  height: 28px;
  min-width: 0;
  padding: 0 !important;
  border: 0;
  border-radius: 8px !important;
  background: transparent !important;
  color: inherit;
  cursor: pointer;
  font-size: 12px;
  line-height: 28px;
}
.date-pop-day:hover { background: rgba(255,255,255,.12); }
.date-pop-day.is-today {
  color: #4da3ff;
  font-weight: 700;
  box-shadow: inset 0 0 0 1.5px #4da3ff;
}
.date-pop-day.is-on { background: rgba(77,163,255,.35); font-weight: 700; color: #fff; }
.date-pop-day.is-on.is-today { box-shadow: none; }
body.apple2040.day .date-pop { background: rgba(255,255,255,.94); color: #1d1d1f; }
body.night .date-pop,
body.apple2040.night .date-pop {
  background: #1a2330 !important;
  color: #f5f5f7 !important;
}
body.night .date-pop-day,
body.night .date-pop-nav,
body.night #quality-root .date-pop-day,
body.night #quality-root .date-pop-nav,
body.apple2040.night .date-pop-day,
body.apple2040.night .date-pop-nav {
  background: transparent !important;
  color: #f5f5f7 !important;
  border: 0 !important;
  box-shadow: none !important;
}
body.day .date-pop-day,
body.day #quality-root .date-pop-day,
body.apple2040.day .date-pop-day,
body.apple2040.day .date-pop-nav {
  background: transparent !important;
  color: #1d1d1f !important;
  border: 0 !important;
}
.date-wrap .date-cal-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 1.7em;
  height: 1.7em;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.date-wrap .date-cal-btn:hover { color: var(--ink); background: var(--soft); }
.date-wrap .date-cal-btn svg { display: block; }
#quality-root .q-filters { overflow: visible; }
#quality-root .date-wrap { width: 100%; overflow: visible; }
#quality-root .date-wrap input.date-eu { width: 100%; }
#quality-root .date-wrap .date-cal-btn,
body.apple2040 #quality-root .date-cal-btn {
  color: inherit !important;
  background: transparent !important;
  border-radius: 6px !important;
  width: 1.7em !important;
  height: 1.7em !important;
  padding: 0 !important;
  min-width: 0 !important;
  box-shadow: none !important;
}
#quality-root .date-wrap .date-cal-btn svg { display: block !important; width: 16px; height: 16px; stroke: currentColor; }
#quality-root .date-pop,
#quality-root .date-pop button {
  border-radius: 8px !important;
  clip-path: none !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}
body.night #quality-root .date-wrap .date-cal-btn { color: #A1A1A6; }
body.night .date-wrap .date-cal-btn:hover { background: #2C2C2E; }


body.night .app-alert { background: #3a1a1e; color: #ffb4b8; }
body.night .app-ok { background: #1d5036; color: #d8f3df; }
body.night .c-chart-card { background: #1A1A1A; }

/* ===== One pager — Version 38 BMW Supplier Quality sheet ===== */
#onepager .hidden { display: none !important; }
.op-list-pane .op-defect {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.op-meta { font-size: 11px; color: var(--muted); margin-left: 8px; }
.op-state-none { color: var(--muted); font-weight: 600; }
.op-state-draft {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 5px;
  border: 1px solid #FF9F0A;
  color: #FF9F0A;
  background: transparent;
  font-size: 11px;
  font-weight: 700;
}
.op-editor-chrome {
  position: relative;
  top: auto;
  z-index: 2;
  background: rgba(18, 22, 28, 0.94);
  color: #f5f5f7;
  padding: 6px 0 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  gap: 8px;
}
.op-editor-chrome .button { padding: 5px 10px; font-size: 12px; }
.op-editor-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.op-editor-title strong { font-size: 14px; color: inherit; }
body.apple2040.day .op-editor-chrome,
body.day .op-editor-chrome {
  background: rgba(255, 255, 255, 0.94);
  color: #1d1d1f;
}
body.apple2040.day #op-editor-report,
body.apple2040.day .op-editor-title strong,
body.day #op-editor-report,
body.day .op-meta {
  color: #1d1d1f !important;
}
.fc-filter-lab { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); margin: 8px 0 14px; max-width: 280px; }
.fc-filter-lab select { min-height: 120px; }
.fc-grid-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.fc-card { display: grid; grid-template-columns: 112px 1fr; gap: 12px; border: 1px solid var(--line); border-radius: 16px; padding: 12px; background: var(--paper); }
.fc-thumb { position: relative; overflow: hidden; height: 88px; border-radius: 10px; background: #e8edf3; }
.fc-thumb img { object-fit: cover; }
.fc-dialog.dialog {
  width: min(860px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  overflow: auto;
  box-sizing: border-box;
}
.fc-editor { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; min-width: 0; }
.fc-dialog .form-grid { min-width: 0; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.fc-dialog .form-grid > label { min-width: 0; }
.fc-dialog input,
.fc-dialog textarea,
.fc-dialog select { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; }
.fc-pick { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.fc-suggest {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px);
  max-height: 280px; overflow: auto;
  background: var(--paper, #1a2433); color: var(--ink, #f5f5f7);
  border: 1px solid var(--line, rgba(255,255,255,.14)); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.28);
}
.fc-suggest button {
  display: block; width: 100%; text-align: left; background: transparent; border: 0;
  padding: 8px 12px; color: inherit; cursor: pointer; font: inherit;
}
.fc-suggest button:hover,
.fc-suggest button.active { background: rgba(77, 163, 255, 0.14); }
.fc-suggest small { display: block; color: var(--muted, #8b93a7); font-size: 12px; }
.fc-stage { position: relative; height: 220px; border-radius: 12px; overflow: hidden; background: #dfe5ee; }
.fc-stage img { width: 100%; height: 100%; object-fit: contain; background: #111; }
.fc-ph { position: absolute; inset: 0; display: grid; place-items: center; color: #6b7280; }
.fc-crop { position: absolute; border: 2px solid #0E3A5F; box-shadow: 0 0 0 999px rgba(0,0,0,.35); cursor: move; touch-action: none; }
.fc-crop span { position: absolute; right: -6px; bottom: -6px; width: 14px; height: 14px; background: #0E3A5F; border-radius: 2px; cursor: nwse-resize; }
.fc-sheet {
  width: 1280px; height: 905px; box-sizing: border-box; padding: 36px 48px 40px;
  background: #f4f6f8; color: #1a1d21;
  font-family: "Segoe UI", Helvetica, Arial, sans-serif;
  display: flex; flex-direction: column;
}
.fc-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid #1d4e89; padding-bottom: 12px; }
.fc-head h2 {
  margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0; color: #1a1d21;
  background: #fff; border-radius: 6px; padding: 8px 16px;
  box-shadow: 0 1px 0 rgba(0,0,0,.04);
}
.fc-head .fc-date { font-size: 16px; color: #4b5563; padding-bottom: 6px; }
.fc-body { flex: 1; display: grid; grid-template-columns: 1.35fr 0.85fr; gap: 36px; padding-top: 22px; min-height: 0; }
.fc-photo { position: relative; overflow: hidden; border-radius: 10px; background: #e6ebf1; min-height: 0; }
.fc-photo img { object-fit: cover; }
.fc-empty { display: grid; place-items: center; color: #6b7280; }
.fc-facts { display: flex; flex-direction: column; gap: 0; padding-top: 8px; }
.fc-facts div { border-bottom: 1px solid #d5dbe3; padding: 10px 0 12px; }
.fc-facts span { display: block; font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; color: #6b7280; }
.fc-facts b { display: block; margin-top: 3px; font-size: 20px; font-weight: 750; white-space: pre-wrap; color: #111; }
@media (max-width: 800px) { .fc-editor { grid-template-columns: 1fr; } .fc-dialog .form-grid { grid-template-columns: 1fr; } }
.note-file {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 12px;
  background: var(--soft); color: inherit; text-decoration: none;
}
.op-export-host {
  position: fixed;
  left: -4000px;
  top: 0;
  width: 1280px;
  height: 905px;
  overflow: hidden;
  background: #f3f5f8;
  transform: none !important;
  perspective: none !important;
  z-index: 1;
  pointer-events: none;
}
body.apple2040 .op-export-host,
body.apple2040 .op-export-host #onepager.view,
body.apple2040 .op-export-host #onepager.view.active,
body.apple2040 .op-export-host #op-slide {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}
.op-export-host #onepager,
.op-export-host #op-slide,
.op-export-host .op-slide.op-sheet {
  display: block !important;
  transform: none !important;
  animation: none !important;
  perspective: none !important;
  margin: 0 !important;
  max-width: none !important;
}
.op-export-host #op-slide.op-sheet {
  width: 1280px !important;
  height: 905px !important;
  min-height: 0 !important;
  aspect-ratio: auto !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}
.op-export-host .op-mini,
.op-export-host .date-cal,
.op-export-host .date-cal-btn,
.op-export-host .op-photo-fab,
.op-export-host .op-eff-pills,
.op-export-host .link-btn { display: none !important; }

:root { --op-navy: #0E3A5F; --op-ink: #16181c; --op-muted: #6b7280; --op-line: #d7dde5; --op-paper: #f3f5f8; }

#onepager .op-slide.op-sheet {
  --op-navy: #0E3A5F;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 1280px;
  max-width: none;
  height: 905px;
  min-height: 905px;
  aspect-ratio: auto;
  box-sizing: border-box;
  padding: 18px 22px 16px;
  display: flex;
  flex-direction: column;
  border-radius: 4px;
  color: var(--op-ink);
  background:
    radial-gradient(900px 420px at 88% 8%, rgba(255,255,255,.95) 0%, transparent 55%),
    linear-gradient(180deg, #f7f8fb 0%, #eef1f5 100%);
  font-family: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
body.night #onepager .op-slide.op-sheet {
  color: #16181c;
  background:
    radial-gradient(900px 420px at 88% 8%, rgba(255,255,255,.95) 0%, transparent 55%),
    linear-gradient(180deg, #f7f8fb 0%, #eef1f5 100%);
}
body.night #onepager .op-slide.op-sheet input,
body.night #onepager .op-slide.op-sheet textarea {
  color: #16181c !important;
  background: transparent !important;
  caret-color: #16181c;
}

#onepager .op-slide .op-val,
#onepager .op-slide input.op-val,
#onepager .op-slide textarea.op-val,
#onepager .op-slide .date-eu {
  font: inherit;
  color: #16181c !important;
  background: transparent !important;
  border: 0 !important;
  outline: none;
  padding: 0 !important;
  margin: 0;
  width: 100%;
  min-width: 0;
  min-height: 0 !important;
  max-height: none;
  resize: none !important;
  field-sizing: content;
  box-shadow: none !important;
  border-radius: 0 !important;
  line-height: 1.25;
}
#onepager .op-slide .op-val:hover,
#onepager .op-slide textarea.op-val:hover {
  background: rgba(14,58,95,.05) !important;
}
#onepager .op-slide .op-val:focus {
  background: rgba(14,58,95,.07) !important;
}
#onepager .op-slide .op-val::placeholder { color: #9aa3ae; }
#onepager .op-slide .date-wrap {
  display: inline-flex;
  align-items: baseline;
  position: relative;
  width: auto;
  min-width: 0;
  flex: 1 1 auto;
}
#onepager .op-slide .date-wrap input.date-eu {
  min-width: 0;
  padding-right: 0 !important;
  color: #16181c !important;
  background: transparent !important;
  border: 0 !important;
}
#onepager .op-slide .date-cal-btn {
  color: #8b93a0;
  background: transparent !important;
  width: 1.25em;
  height: 1.25em;
  opacity: 0;
}
#onepager .op-slide .date-wrap:hover .date-cal-btn,
#onepager .op-slide .date-cal-btn:focus { opacity: 1; color: var(--op-navy); }

.op-head {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-bottom: 8px;
}
.op-wordmark {
  margin: 0;
  font-size: 42px;
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1;
  color: #111;
  text-align: center;
}

.op-strip {
  display: grid;
  grid-template-columns: 1.85fr 0.7fr 1.05fr 1.15fr 1.65fr 0.95fr 0.7fr;
  gap: 0;
  border-top: 1px solid var(--op-line);
  border-bottom: 1px solid var(--op-line);
  margin: 0 0 12px;
}
.op-strip-cell {
  padding: 8px 10px 8px 12px;
  min-width: 0;
  border-left: 1px solid var(--op-line);
}
.op-strip-cell:first-child { border-left: 0; padding-left: 0; }
.op-lab {
  display: block;
  font-size: 10px;
  font-weight: 650;
  color: #6b7280;
  margin-bottom: 4px;
  letter-spacing: .01em;
}
.op-strip-cell .op-val {
  font-size: 13px;
  font-weight: 750;
  color: #111 !important;
  white-space: nowrap;
  overflow: visible;
}
.op-strip-wide .op-val {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.25;
}
#onepager .op-slide .op-strip .date-wrap,
#onepager .op-slide .op-strip input.date-eu {
  min-width: 0;
  width: 100%;
}
.op-val-ico {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}
.op-val-ico > svg {
  width: 13px; height: 13px; flex: 0 0 auto; margin-top: 2px;
  stroke: #6b7280; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

.op-status-wrap { position: relative; display: inline-flex; align-items: center; min-height: 22px; }
.op-status-select {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; z-index: 2;
}
.op-status-pill {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 2px 12px; border-radius: 999px;
  border: 1.6px solid var(--op-navy);
  color: var(--op-navy);
  background: #fff;
  font-size: 12px; font-weight: 750; pointer-events: none; letter-spacing: .02em;
}
.op-status-pill.open, .op-status-pill.Open, .op-status-pill.overdue { border-color: var(--op-navy); color: var(--op-navy); }
.op-status-pill.closed { border-color: #1f7a45; color: #1f7a45; }
.op-status-pill.rejected { border-color: #9b1c2c; color: #9b1c2c; }
.op-status-pill.in-process { border-color: #6b7280; color: #6b7280; }

.op-body {
  display: grid;
  grid-template-columns: 0.92fr 1.2fr 1.2fr;
  grid-template-rows: auto minmax(150px, 1fr);
  gap: 10px 16px;
  min-height: 0;
  flex: 1 1 auto;
  align-items: stretch;
}
.op-col { min-width: 0; display: flex; flex-direction: column; }
.op-col-d2 { grid-column: 1; grid-row: 1; }
.op-pic-col { grid-column: 1; grid-row: 2; min-height: 0; }
.op-col-mid { grid-column: 2; grid-row: 1 / span 2; gap: 8px; }
.op-col-right { grid-column: 3; grid-row: 1 / span 2; gap: 8px; }
.op-d-block { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.op-sec {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 6px;
  font-size: 12.5px; font-weight: 800; letter-spacing: .05em;
  color: #111; text-transform: none;
}
.op-sec-pic { margin-top: 0; }
.op-sec-ico {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--op-navy); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.op-sec-ico svg {
  width: 15px; height: 15px;
  stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.op-4w { display: flex; flex-direction: column; gap: 8px; padding-left: 2px; }
.op-4w-row {
  display: grid;
  grid-template-columns: 18px 58px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}
.op-4w-ico svg {
  width: 16px; height: 16px; stroke: #6b7280; fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.op-k { font-size: 12.5px; font-weight: 650; color: #6b7280; padding-top: 1px; }
.op-4w-row .op-val { font-size: 13.5px; font-weight: 650; }

.op-tagline {
  margin-top: auto;
  padding-top: 18px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .22em;
  color: #8b93a0;
  line-height: 1.45;
}
.op-tagline span { display: block; width: 42px; height: 2px; background: #111; margin-top: 8px; }

.op-d3-card {
  background: #fff;
  border-radius: 12px;
  padding: 8px 10px 6px;
  box-shadow: 0 1px 0 rgba(16,24,40,.04), 0 8px 24px rgba(16,24,40,.06);
  border: 1px solid #e7ebf0;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.op-d3-list { display: flex; flex-direction: column; gap: 4px; }
.op-d3-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 88px auto;
  gap: 6px;
  align-items: start;
  padding: 2px 0;
}
.op-d3-row.op-has-owner {
  grid-template-columns: minmax(0, 1.4fr) minmax(76px, 0.75fr) 88px auto;
}
.op-d3-row .op-action-text {
  font-size: 12.5px;
  font-weight: 650;
  color: #1a1a1a;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow: visible;
  min-height: 1.4em;
  height: auto;
  field-sizing: content;
  resize: none !important;
}
.op-d3-row .op-action-owner {
  font-size: 11px;
  font-weight: 600;
  color: #4b5563;
  min-width: 0;
}
.op-check { position: relative; width: 20px; height: 20px; margin: 0; }
.op-check input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.op-check-mark {
  display: block; width: 20px; height: 20px; border-radius: 50%;
  background: var(--op-navy); color: #fff;
  font-size: 11px; font-weight: 800; line-height: 20px; text-align: center;
  box-sizing: border-box;
}
.op-check input:not(:checked) + .op-check-mark {
  background: #fff; color: transparent;
  border: 2px solid var(--op-navy);
}
.op-d3-row .op-action-text { font-size: 12.5px; font-weight: 650; color: #1a1a1a; }
.op-d3-row .op-action-date { font-size: 12px; color: #4b5563; text-align: right; font-weight: 600; white-space: nowrap; }
.op-d3-row .link-btn.danger {
  opacity: 0; color: #9b1c2c; background: none; border: 0; cursor: pointer;
}
.op-d3-row:hover .link-btn.danger { opacity: 1; }
.op-mini {
  margin-top: 6px; padding: 3px 10px; font-size: 11px; font-weight: 700;
  color: var(--op-navy); background: transparent;
  border: 1px solid color-mix(in srgb, var(--op-navy) 35%, #fff); border-radius: 999px; cursor: pointer;
}
.op-eff {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 10px;
  align-items: center;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e7ebf0;
}
.op-eff .op-k { font-size: 12px; font-weight: 700; color: #374151; }
.op-eff .op-val { font-size: 12.5px; font-weight: 650; }

.op-picture.is-drop { outline: 2px dashed var(--op-navy); outline-offset: -4px; }
.op-picture {
  position: relative;
  flex: 1 1 auto;
  min-height: 120px;
  height: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: #dfe3e9;
  border: 1px solid #d3d9e2;
}
.op-d8 { flex: 0 0 auto; }
.op-d8-val {
  background: #fff !important;
  border: 1px solid #e7ebf0 !important;
  border-radius: 10px !important;
  padding: 6px 8px !important;
  min-height: 2.4em !important;
  font-size: 12px !important;
}
.op-picture img {
  width: 100%; height: 100%; object-fit: contain; object-position: center; display: block;
}
.op-drop-hint {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 650; color: #6b7280;
  cursor: pointer; text-align: center; padding: 12px;
}
.op-photo-fab {
  position: absolute; right: 10px; bottom: 10px;
  font-size: 11px; font-weight: 700; color: #fff;
  background: rgba(14,58,95,.78); padding: 4px 10px; border-radius: 999px;
  cursor: pointer;
}
.op-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

.op-tl { position: relative; display: flex; flex-direction: column; gap: 0; padding-left: 2px; }
.op-tl::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 28px;
  bottom: 28px;
  width: 2px;
  background: var(--op-navy);
}
.op-tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 10px;
}
.op-tl-item .op-sec-ico { z-index: 1; }
.op-tl-h {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 4px;
}
.op-tl-h h3 {
  margin: 0; font-size: 13px; font-weight: 800; letter-spacing: .06em; color: #111;
}
.op-tl-date {
  display: inline-flex; align-items: center; gap: 4px;
  color: #6b7280; min-width: 0;
}
.op-tl-date svg {
  width: 13px; height: 13px; stroke: #6b7280; fill: none; stroke-width: 1.8; flex: 0 0 auto;
}
.op-tl-date input { width: 92px; text-align: right; font-size: 12px; font-weight: 650; color: #374151 !important; }
.op-tl-pair { display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 6px; align-items: start; margin: 2px 0; }
.op-tl-pair .op-k { font-size: 12px; }
.op-tl-pair .op-val { font-size: 12.5px; font-weight: 550; min-height: 1.2em !important; }

@media (max-width: 1100px) {
  #onepager .op-slide.op-sheet { width: 1280px; height: 905px; min-height: 905px; aspect-ratio: auto; }
}

@media print {
  @page { size: A4 landscape; margin: 0; }
  html, body { margin: 0 !important; padding: 0 !important; background: #fff !important; overflow: hidden !important; }
  body.op-printing .sidebar,
  body.op-printing .op-editor-chrome,
  body.op-printing .op-list-pane,
  body.op-printing .modal,
  body.op-printing .op-mini,
  body.op-printing [data-op-add],
  body.op-printing .op-photo-fab,
  body.op-printing .op-file-input,
  body.op-printing .op-eff-pills,
  body.op-printing .op-status-select,
  body.op-printing .op-drop-hint,
  body.op-printing .date-cal,
  body.op-printing .date-cal-btn,
  #op-slide .op-photo-fab,
  #op-slide .op-mini,
  #op-slide .date-cal-btn,
  #op-slide .op-eff-pills,
  body.op-printing .link-btn,
  body.op-printing #onepager > .eyebrow,
  body.op-printing #onepager > h1,
  body.op-printing #onepager > .sub { display: none !important; }
  body.op-printing input::-webkit-calendar-picker-indicator { display: none !important; }
  body.op-printing .app { display: block !important; grid-template-columns: 1fr !important; background: #fff !important; }
  body.op-printing .main { padding: 0 !important; margin: 0 !important; }
  body.op-printing .view { display: none !important; }
  body.op-printing #onepager.view,
  body.op-printing #onepager,
  body.op-printing #op-editor-pane {
    display: block !important; padding: 0 !important; margin: 0 !important;
    background: #fff !important; overflow: hidden !important;
  }
  body.op-printing #op-slide.op-sheet {
    width: 297mm !important; height: 210mm !important;
    max-width: 297mm !important; max-height: 210mm !important;
    min-height: 0 !important; aspect-ratio: auto !important;
    display: flex !important; flex-direction: column !important;
    border-radius: 0 !important; overflow: hidden !important;
    padding: 8mm 10mm 7mm !important;
    break-inside: avoid !important; page-break-after: avoid !important;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  body.op-printing .op-body {
    grid-template-columns: 0.92fr 1.2fr 1.2fr !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    gap: 8px 12px !important;
  }
  body.op-printing .op-d3-row .link-btn { display: none !important; }
  body.op-printing .op-wordmark { font-size: 28px !important; }
  body.op-printing .date-wrap { display: block !important; width: 100% !important; position: static !important; }
  label.op-photo-fab,
  button.op-mini,
  [data-op-add] { display: none !important; }
}

/* ===== v45 Tony Stark hologram UI (does not restyle #op-slide / print exports) ===== */
html body.holo,
html body.holo.night {
  --deep: #020814;
  --panel: rgba(6, 22, 38, 0.88);
  --panel-soft: rgba(6, 22, 38, 0.55);
  --cyan: #3EE8FF;
  --cyan-hot: #7AF6FF;
  --cyan-dim: rgba(62, 232, 255, 0.45);
  --cyan-faint: rgba(62, 232, 255, 0.14);
  --amber: #FFB238;
  --ink: #E8FBFF;
  --muted: #7EC8D8;
  --line: rgba(62, 232, 255, 0.55);
  --paper: #020814;
  --soft: rgba(7, 26, 44, 0.9);
  --red: #FFB238;
  --radius: 2px;
  --hud-cut: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  color-scheme: dark;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(62, 232, 255, 0.14), transparent 46%),
    radial-gradient(ellipse at 92% 8%, rgba(62, 232, 255, 0.10), transparent 42%),
    radial-gradient(ellipse at 80% 100%, rgba(20, 90, 120, 0.18), transparent 50%),
    #020814;
  color: var(--ink);
  font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: .02em;
}
html body.holo::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(62, 232, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(62, 232, 255, 0.045) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse at 50% 30%, black 40%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, black 40%, transparent 85%);
}
.holo-scan {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  height: 110px;
  z-index: 40;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(62, 232, 255, 0.045), transparent);
  animation: holo-scan 14s linear infinite;
}
html body.holo:has(.app) .holo-scan {
  left: 210px;
}
@keyframes holo-scan {
  0% { transform: translateY(-160px); }
  100% { transform: translateY(110vh); }
}
@keyframes holo-breathe {
  0%, 100% { box-shadow: 0 0 0 1px var(--cyan-dim), 0 0 30px rgba(87, 240, 255, 0.08) inset, 0 0 28px rgba(87, 240, 255, 0.07); }
  50% { box-shadow: 0 0 0 1px var(--cyan-dim), 0 0 46px rgba(87, 240, 255, 0.16) inset, 0 0 50px rgba(87, 240, 255, 0.12); }
}
@keyframes holo-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.42; }
}
html body.holo .app,
html body.holo .login-page,
html body.holo .main { position: relative; z-index: 1; }
html body.holo h1, html body.holo h2, html body.holo h3 {
  font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-weight: 700;
  text-shadow: 0 0 8px var(--cyan-dim);
}
html body.holo .brand {
  font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: .22em;
  font-weight: 800;
  color: var(--cyan);
  text-shadow: 0 0 10px var(--cyan-dim);
}
html body.holo .brand span { color: var(--cyan); }
html body.holo .view > .eyebrow,
html body.holo .task-card .eyebrow,
html body.holo .nav-label {
  display: flex;
  align-items: center;
  gap: 10px;
}
html body.holo .view > .eyebrow::before,
html body.holo .task-card .eyebrow::before,
html body.holo .nav-label::before {
  content: "";
  width: 6px;
  height: 18px;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  flex: 0 0 auto;
}
html body.holo .task-card .eyebrow::after {
  content: "///";
  margin-left: auto;
  color: var(--cyan);
  opacity: .35;
  letter-spacing: .28em;
  font-size: 10px;
  font-weight: 700;
}
html body.holo .overview-card .overview-stats {
  margin: 2px 8px 12px;
  padding: 12px 14px;
  border: 1px solid var(--cyan-dim);
  background: rgba(2, 10, 20, 0.45);
}
html body.holo .sidebar {
  z-index: 50;
  background: linear-gradient(180deg, rgba(4, 16, 30, 0.94), rgba(2, 8, 20, 0.96));
  border-right: 1px solid var(--cyan);
  box-shadow: 8px 0 28px rgba(62, 232, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
html body.holo .nav button {
  color: var(--muted);
  border-left: 2px solid transparent;
  border-radius: 0;
}
html body.holo .nav button .nav-ico { color: var(--cyan-dim); }
html body.holo .nav button:hover {
  background: var(--cyan-faint);
  color: var(--ink);
}
html body.holo .nav button:hover .nav-ico,
html body.holo .nav button.active .nav-ico { color: var(--cyan); }
html body.holo .nav button.active,
html body.holo .nav button.active:hover {
  background: rgba(87, 240, 255, 0.10);
  color: var(--ink);
  border-left-color: var(--cyan);
  box-shadow: 0 0 16px rgba(87, 240, 255, 0.12);
}
html body.holo .button,
html body.holo .button:hover {
  background: var(--cyan);
  color: #021018;
  border: 1px solid var(--cyan);
  border-radius: 2px;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  box-shadow: 0 0 16px rgba(62, 232, 255, 0.4);
}
html body.holo .button.secondary,
html body.holo .button.secondary:hover {
  background: transparent;
  color: var(--cyan);
  border: 1px solid var(--cyan-dim);
  box-shadow: none;
}
html body.holo .filter,
html body.holo input,
html body.holo select,
html body.holo textarea,
html body.holo .form-grid input,
html body.holo .form-grid select,
html body.holo .form-grid textarea {
  background: rgba(2, 10, 20, 0.78);
  color: var(--ink);
  border: 1px solid var(--cyan-dim);
  border-radius: 2px;
  font-family: inherit;
}
html body.holo th {
  background: rgba(9, 26, 45, 0.8);
  color: var(--muted);
  font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
html body.holo td { border-top-color: var(--cyan-faint); color: var(--ink); }
html body.holo tr:hover td,
html body.holo .subtask-row td { background: rgba(87, 240, 255, 0.06); }
html body.holo .status,
html body.holo .status.open,
html body.holo .status.in-progress,
html body.holo .status.canceled {
  border: 1.6px solid var(--cyan);
  color: var(--cyan-hot);
  background: rgba(62, 232, 255, 0.10);
  border-radius: 999px;
  font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: .12em;
  text-shadow: 0 0 8px var(--cyan-dim);
  box-shadow: 0 0 12px rgba(62, 232, 255, 0.28);
}
html body.holo .status.complete,
html body.holo .status.closed {
  border-color: var(--cyan);
  color: var(--cyan);
}
html body.holo .status.overdue,
html body.holo .status.rejected,
html body.holo .title-overdue,
html body.holo .overview-stat--overdue b {
  border-color: var(--amber);
  color: var(--amber);
  text-shadow: 0 0 8px rgba(255, 178, 56, 0.7);
}
html body.holo .status.overdue,
html body.holo .status.open.holo-alert,
html body.holo .overview-stat--overdue .status {
  animation: holo-pulse 2.4s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(255, 178, 56, 0.35);
}
html body.holo tr.overdue td,
html body.holo tr.row-due-now td,
html body.holo tr.row-due-now td.c-actions {
  background: rgba(255, 178, 56, 0.10);
  animation: holo-pulse 2.4s ease-in-out infinite;
}
html body.holo tr.row-due-soon td,
html body.holo tr.row-due-soon td.c-actions {
  background: rgba(87, 240, 255, 0.08);
  animation: holo-pulse 3.2s ease-in-out infinite;
}
html body.holo .link-btn,
html body.holo .link-btn.export-btn,
html body.holo .sign-out-btn,
html body.holo .icon-btn { color: var(--cyan); text-shadow: 0 0 6px var(--cyan-dim); }
html body.holo .link-btn.danger { color: var(--amber); }
html body.holo .user-chip,
html body.holo .theme-toggle {
  background: var(--panel-soft);
  border: 1px solid var(--cyan-dim);
  border-radius: 0;
  color: var(--ink);
}
html body.holo .role-badge {
  background: transparent;
  border: 1px solid var(--cyan-dim);
  color: var(--cyan);
  border-radius: 0;
}
html body.holo .role-badge.admin { border-color: var(--amber); color: var(--amber); }
html body.holo .perm-chip { background: var(--panel-soft); color: var(--ink); border: 1px solid var(--cyan-dim); }
html body.holo .perm-chip.edit { background: rgba(87, 240, 255, 0.12); color: var(--cyan); }
html body.holo .login-page {
  background: transparent;
}
html body.holo .login-frame {
  position: relative;
  width: min(460px, 100%);
  padding: 14px;
}
html body.holo .login-card {
  background: linear-gradient(180deg, rgba(10, 36, 58, 0.92), rgba(4, 16, 30, 0.96));
  border: 1px solid var(--cyan);
  border-radius: 2px;
  box-shadow:
    0 0 0 1px rgba(62, 232, 255, 0.2),
    0 0 28px rgba(62, 232, 255, 0.2),
    inset 0 0 40px rgba(62, 232, 255, 0.06);
  animation: holo-breathe 5s ease-in-out infinite;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  clip-path: var(--hud-cut);
}
html body.holo .login-card h1 { font-size: 28px; }
html body.holo .login-card input {
  background: rgba(3, 7, 17, 0.75);
  border: 1px solid var(--cyan-dim);
  color: var(--ink);
  border-radius: 0;
}
html body.holo .login-logo {
  filter: brightness(0) invert(1) sepia(1) hue-rotate(140deg) saturate(6) drop-shadow(0 0 8px rgba(87, 240, 255, 0.7));
}
html body.holo .corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2px solid var(--cyan);
  opacity: .9;
  filter: drop-shadow(0 0 6px var(--cyan));
  pointer-events: none;
}
html body.holo .corner.tl { top: 0; left: 0; border-right: none; border-bottom: none; }
html body.holo .corner.tr { top: 0; right: 0; border-left: none; border-bottom: none; }
html body.holo .corner.bl { bottom: 0; left: 0; border-right: none; border-top: none; }
html body.holo .corner.br { bottom: 0; right: 0; border-left: none; border-top: none; }
html body.holo .sub { color: var(--muted); }
html body.holo .app-version { color: var(--cyan); font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif; letter-spacing: .12em; }
html body.holo .app-alert { background: rgba(255, 178, 56, 0.12); color: var(--amber); border: 1px solid var(--amber); }
html body.holo .app-ok { background: rgba(87, 240, 255, 0.10); color: var(--cyan); border: 1px solid var(--cyan-dim); }
html body.holo #quality-root {
  --qi: #DFF8FF;
  --qm: #7FA4B4;
  --ql: rgba(87, 240, 255, 0.28);
  --qp: #030711;
  --qc: rgba(9, 26, 45, 0.55);
  --qb: #57F0FF;
  --qr: #FFB238;
  color: var(--qi);
  font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
}
html body.holo #quality-root .q-hero,
html body.holo #quality-root .q-filters,
html body.holo #quality-root .q-kpi,
html body.holo #quality-root .q-card,
html body.holo #quality-root .q-top {
  background: linear-gradient(180deg, rgba(10, 36, 58, 0.92), rgba(4, 16, 30, 0.94));
  border: 1px solid var(--cyan);
  border-radius: 2px;
  color: var(--ink);
  clip-path: var(--hud-cut);
  box-shadow: 0 0 18px rgba(62, 232, 255, 0.12);
}
html body.holo #quality-root h2 { font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif; color: var(--ink); }
html body.holo #quality-root .q-upload,
html body.holo #quality-root button {
  background: var(--cyan);
  color: var(--deep);
  border-radius: 0;
  font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}
html body.holo #quality-root button.q-secondary {
  background: transparent;
  color: var(--cyan);
  border: 1px solid var(--cyan-dim);
}
html body.holo #quality-root select,
html body.holo #quality-root input,
html body.holo #quality-root textarea {
  background: rgba(3, 7, 17, 0.75);
  color: var(--ink);
  border: 1px solid var(--cyan-dim);
  border-radius: 0;
}
html body.holo #quality-root .q-status {
  background: rgba(87, 240, 255, 0.08);
  color: var(--cyan);
  border-left: 3px solid var(--cyan);
}
html body.holo .complaint-table th.c-actions-head,
html body.holo .complaint-table td.c-actions { background: rgba(9, 26, 45, 0.92); }
html body.holo .complete-btn {
  background: transparent;
  color: var(--cyan);
  border: 1px solid var(--cyan);
}
html body.holo .weekend td { background: rgba(3, 7, 17, 0.45); }
html body.holo .week-total { background: rgba(87, 240, 255, 0.08); color: var(--ink); }
html body.holo .modal { background: rgba(3, 7, 17, 0.72); }
html body.holo .sort-btn { color: var(--muted); background: transparent; border: 0; }
html body.holo .overview-stat--soon b {
  color: var(--amber);
  animation: holo-pulse 3.2s ease-in-out infinite;
  text-shadow: 0 0 8px rgba(255, 178, 56, 0.7);
}
html body.holo .holo-due-card {
  border-color: var(--amber);
  box-shadow: 0 0 18px rgba(255, 178, 56, 0.18);
}

/* One pager stays the original light sheet — not HUD */
html body.holo #onepager .op-slide,
html body.holo.night #onepager .op-slide.op-sheet,
html body.holo #op-slide,
html body.holo #op-slide.op-sheet {
  --op-navy: #0E3A5F;
  --op-ink: #16181c;
  --op-muted: #6b7280;
  --op-line: #d7dde5;
  --op-paper: #f3f5f8;
  animation: none !important;
  font-family: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif !important;
  text-shadow: none !important;
  letter-spacing: normal !important;
  text-transform: none;
  color: #16181c;
  background:
    radial-gradient(900px 420px at 88% 8%, rgba(255,255,255,.95) 0%, transparent 55%),
    linear-gradient(180deg, #f7f8fb 0%, #eef1f5 100%);
  border: 0;
  border-radius: 4px;
  box-shadow: none;
  clip-path: none;
}
html body.holo #onepager .op-slide h1,
html body.holo #onepager .op-slide h2,
html body.holo #onepager .op-slide h3,
html body.holo #onepager .op-wordmark {
  font-family: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif !important;
  text-transform: none !important;
  text-shadow: none !important;
  letter-spacing: .04em;
  color: #111 !important;
}
html body.holo #onepager .op-wordmark {
  font-size: 42px;
  text-align: center;
}
html body.holo #onepager .op-slide .op-val,
html body.holo #onepager .op-slide input.op-val,
html body.holo #onepager .op-slide textarea.op-val,
html body.holo.night #onepager .op-slide.op-sheet input,
html body.holo.night #onepager .op-slide.op-sheet textarea {
  color: #111 !important;
  background: transparent !important;
  caret-color: #16181c;
  font-family: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
html body.holo #onepager .op-lab,
html body.holo #onepager .op-k { color: #6b7280; letter-spacing: .01em; text-transform: none; font-size: 10px; }
html body.holo #onepager .op-strip {
  border: 0;
  border-top: 1px solid #d7dde5;
  border-bottom: 1px solid #d7dde5;
  background: transparent;
  clip-path: none;
  box-shadow: none;
}
html body.holo #onepager .op-strip-cell { border-left-color: #d7dde5; }
html body.holo #onepager .op-status-pill {
  background: #fff;
  border: 1.6px solid #0E3A5F;
  color: #0E3A5F;
  border-radius: 999px;
  box-shadow: none;
  animation: none;
  font-family: "Segoe UI", sans-serif;
}
html body.holo #onepager .op-status-pill.open,
html body.holo #onepager .op-status-pill.Open,
html body.holo #onepager .op-status-pill.overdue { border-color: #0E3A5F; color: #0E3A5F; }
html body.holo #onepager .op-status-pill.closed { border-color: #1f7a45; color: #1f7a45; animation: none; }
html body.holo #onepager .op-status-pill.rejected { border-color: #9b1c2c; color: #9b1c2c; }
html body.holo #onepager .op-d3-card,
html body.holo #onepager .op-4w,
html body.holo #onepager .op-picture,
html body.holo #onepager .op-d8,
html body.holo #onepager .op-d-block {
  background: #fff;
  border: 1px solid #e7ebf0;
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(16,24,40,.04), 0 8px 24px rgba(16,24,40,.06);
  clip-path: none;
}
html body.holo #onepager .op-4w { background: transparent; border: 0; box-shadow: none; border-radius: 0; }
html body.holo #onepager .op-d8 { background: transparent; border: 0; box-shadow: none; clip-path: none; }
html body.holo #onepager .op-d-block { background: transparent; border: 0; box-shadow: none; clip-path: none; }
html body.holo #onepager .op-sec {
  color: #111;
  letter-spacing: .05em;
  text-transform: none;
  text-shadow: none;
  font-family: "Segoe UI", sans-serif;
}
html body.holo #onepager .op-sec-ico {
  background: #0E3A5F;
  color: #fff;
  border-radius: 50%;
  box-shadow: none;
}
html body.holo #onepager .op-sec-ico svg { stroke: #fff; }
html body.holo #onepager .op-4w-ico svg { stroke: #6b7280; }
html body.holo #onepager .op-check-mark {
  background: #0E3A5F;
  color: #fff;
  border: 0;
  border-radius: 50%;
  box-shadow: none;
}
html body.holo #onepager .op-check input:not(:checked) + .op-check-mark {
  background: #fff;
  color: transparent;
  border: 2px solid #0E3A5F;
}
html body.holo #onepager .op-d3-row .op-action-text { color: #1a1a1a; font-family: "Segoe UI", sans-serif; }
html body.holo #onepager .op-d3-row .op-action-date { color: #4b5563; font-family: "Segoe UI", sans-serif; }
html body.holo #onepager .op-picture {
  background: #fff;
  border: 1px dashed #c5ced8;
}
html body.holo #onepager .op-drop-hint { color: #6b7280; font-family: "Segoe UI", sans-serif; }
html body.holo #onepager .op-mini {
  color: #0E3A5F;
  border: 1px solid #0E3A5F;
  background: transparent;
  border-radius: 8px;
  clip-path: none;
  font-family: "Segoe UI", sans-serif;
}
html body.holo #onepager .op-tagline { color: #8b93a0; }
html body.holo #onepager .op-tagline span { background: #111; }

@media print {
  .holo-scan, html body.holo::before { display: none !important; }
  html body.holo.op-printing,
  html body.holo.op-printing .app,
  html body.holo.op-printing .main,
  html body.holo.op-printing #onepager,
  html body.holo.op-printing #op-editor-pane {
    background: #fff !important;
    color: #111 !important;
  }
  html body.holo.op-printing #op-slide.op-sheet {
    background: linear-gradient(180deg, #f7f8fb 0%, #eef1f5 100%) !important;
    color: #16181c !important;
    border: 0 !important;
    box-shadow: none !important;
    clip-path: none !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  .holo-scan, html body.holo .status.overdue,
  html body.holo tr.overdue td,
  html body.holo tr.row-due-now td,
  html body.holo tr.row-due-soon td,
  html body.holo .login-card { animation: none !important; }
}

#activity-list { max-height: 11rem; }

.cost-hero, .wk-hero { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin: 8px 0 14px; }
.cost-filters, .wk-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.cost-filters label, .wk-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.cost-card, .wk-block { background: var(--paper, #fff); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 0 0 16px; min-width: 0; max-width: 100%; }
.cost-chart { position: relative; height: 420px; }
.cost-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; margin: 0 0 8px; }
.cost-legend i { display: inline-block; width: 14px; height: 10px; margin-right: 6px; vertical-align: -1px; }
.cost-foot, .wk-note { color: var(--muted); font-size: 12px; margin: 8px 0 0; }
.cost-grid, .wk-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 11px; width: 100%; min-width: 0; }
.cost-top { min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; border-top: 4px solid #1b3a5f; }
.cost-top b { display: block; font-size: 22px; letter-spacing: -.03em; margin: 4px 0; }
.cost-top .sub { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
body.night .cost-card,
body.apple2040.night .cost-card,
body.night .cost-top,
body.apple2040.night .cost-top {
  background: #1a1a1a;
  color: #f5f5f7;
  border-color: rgba(255,255,255,.14);
}
body.night .cost-card h3,
body.night .cost-top .q-part,
body.night .cost-top b,
body.apple2040.night .cost-card h3,
body.apple2040.night .cost-top .q-part,
body.apple2040.night .cost-top b { color: #f5f5f7; }
body.night .cost-top .sub,
body.night .cost-note,
body.night #cost-foot,
body.night .cost-card .q-note,
body.night .cost-card .q-chart-note,
body.apple2040.night .cost-top .sub { color: #c5cdd6; }
body.night .cost-top .q-rank,
body.apple2040.night .cost-top .q-rank { color: #ff8a7a; }
.wk-top { min-width: 0; background: #fff; border: 1px solid #e6e8ee; border-radius: 16px; padding: 16px 16px 8px; border-top: 4px solid #e23d3d; }
.wk-top .q-rank { color: #e23d3d; font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.wk-top .q-part { font-weight: 800; font-size: 16px; margin: 8px 0 2px; overflow-wrap: anywhere; word-break: break-word; color: #1a2330; }
.wk-top .q-part-name { color: #8b95a5; font-size: 13px; }
.wk-top .q-rate { font-size: 28px; font-weight: 850; letter-spacing: -.04em; margin: 8px 0 2px; color: #1a2330; }
.wk-top .q-counts { color: #8b95a5; font-size: 13px; margin-bottom: 8px; }
.wk-top ul { list-style: none; margin: 0; padding: 8px 0 0; border-top: 1px solid #eceff3; }
.wk-top li { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid #f2f4f7; font-size: 13px; color: #1a2330; }
.wk-top li span { min-width: 0; overflow-wrap: anywhere; }
.wk-top li b { flex-shrink: 0; }
.wk-tophead h4 { margin: 0; font-size: 22px; }
.wk-tophead p { margin: 2px 0 10px; color: #8b95a5; font-size: 14px; }
.wk-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 12px; }
.wk-kpis div { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.wk-kpis strong { display: block; font-size: 22px; }
.wk-kpis span { color: var(--muted); font-size: 12px; }
.wk-chart { position: relative; height: 560px; width: auto; max-width: none; }
.wk-chart-scroll { overflow-x: auto; overflow-y: hidden; max-width: 100%; width: 100%; }
.wk-slide { background: #fff; color: #1a2330; border-radius: 16px; padding: 16px 16px 20px; margin: 0 0 18px; width: 100%; box-sizing: border-box; }
body.night .wk-slide,
body.apple2040.night .wk-slide { background: #16181d; color: #f5f5f7; }
body.night .wk-slide h3,
body.night .wk-slide h4,
body.night .wk-kpis strong,
body.apple2040.night .wk-slide h3,
body.apple2040.night .wk-slide h4,
body.apple2040.night .wk-kpis strong { color: #f5f5f7; }
body.night .wk-kpis div,
body.apple2040.night .wk-kpis div { background: #1e2128; border-color: rgba(255,255,255,.12); }
body.night .wk-note,
body.night .wk-kpis span,
body.night .wk-tophead p,
body.night .wk-top .q-part-name,
body.night .wk-top .q-counts,
body.apple2040.night .wk-note { color: #c5cdd6; }
body.night .wk-top,
body.apple2040.night .wk-top { background: #1e2128; border-color: rgba(255,255,255,.14); color: #f5f5f7; }
body.night .wk-top .q-part,
body.night .wk-top .q-rate,
body.night .wk-top li,
body.apple2040.night .wk-top .q-part,
body.apple2040.night .wk-top .q-rate,
body.apple2040.night .wk-top li { color: #f5f5f7; }
body.night .wk-top ul,
body.apple2040.night .wk-top ul { border-top-color: rgba(255,255,255,.12); }
body.night .wk-top li,
body.apple2040.night .wk-top li { border-bottom-color: rgba(255,255,255,.08); }
body.night .wk-pdf-cards,
body.night .wk-pdf-cards .wk-top,
body.apple2040.night .wk-pdf-cards,
body.apple2040.night .wk-pdf-cards .wk-top { background: #fff !important; color: #1a2330 !important; }
body.night .wk-pdf-cards h4,
body.night .wk-pdf-cards .q-part,
body.night .wk-pdf-cards .q-rate,
body.night .wk-pdf-cards li,
body.apple2040.night .wk-pdf-cards h4,
body.apple2040.night .wk-pdf-cards .q-part,
body.apple2040.night .wk-pdf-cards .q-rate,
body.apple2040.night .wk-pdf-cards li { color: #1a2330 !important; }
body.night .wk-pdf-cards .wk-tophead p,
body.night .wk-pdf-cards .q-part-name,
body.night .wk-pdf-cards .q-counts { color: #5c6b7a !important; }
#weekly.view { max-width: none; width: 100%; }
body.apple2040 #weekly.view { max-width: none; }
.wk-slide h3, .wk-slide h4 { color: #1a2330; }
.wk-exports { display: flex; gap: 8px; align-items: center; }
#weekly-root .q-hide { display: none !important; }
.wk-project { margin: 22px 0 8px; }
@media (max-width: 1100px) {
  .cost-grid, .wk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wk-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}






/* v1.23 — file inputs: readable in Night + styled button (Import Excel, Documents, notes, photos…) */
input[type="file"] { font: inherit; font-size: 13px; color: var(--muted); max-width: 100%; }
input[type="file"]::file-selector-button {
  font: inherit; font-weight: 600; font-size: 12px;
  margin-right: 10px; padding: 6px 12px; border-radius: 980px;
  border: 1px solid var(--line, #d2d2d7); background: #f5f5f7; color: #1d1d1f; cursor: pointer;
}
body.night input[type="file"] { color-scheme: dark; color: #A1A1A6; }
body.night input[type="file"]::file-selector-button { background: #2C2C2E; color: #F5F5F7; border-color: #48484A; }
body.night input[type="file"]::file-selector-button:hover { background: #3A3A3C; }
/* v1.23 — due tone must stay readable in Day */
body.day .due-halo, body.day .due-tone { color: hsl(var(--due-h, 210) 80% 38%); }
/* v1.23 — TOP 5: part name under PN, muted, max 2 lines */
.q-top .q-part-name, .wk-top .q-part-name {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  overflow: hidden; text-overflow: ellipsis; font-size: 12px; line-height: 1.3; margin-top: 2px;
}
/* v1.23 — Complaints period segmented control */
.c-period { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.c-period .c-chart-tabs { display: inline-flex; }
.c-period .date-wrap { min-width: 140px; }
/* Apple System 2040 — design tokens + spatial environment.
   Holo CSS in app.css stays as unused fallback (body.holo). */

:root {
  --apple-bg: #07111d;
  --apple-surface: rgba(255, 255, 255, 0.10);
  --apple-surface-hover: rgba(255, 255, 255, 0.12);
  --apple-border: rgba(255, 255, 255, 0.14);
  --apple-text: rgba(255, 255, 255, 0.96);
  --apple-secondary: rgba(255, 255, 255, 0.68);
  --apple-muted: rgba(255, 255, 255, 0.42);
  --apple-blue: #4da3ff;
  --apple-cyan: #6ddcff;
  --apple-warning: #ffb84d;
  --apple-danger: #ff5f57;
  --apple-success: #52d273;
  --glass-blur: 28px;
  --radius-card: 22px;
  --radius-large: 28px;
  --shadow-spatial: 0 20px 60px rgba(0, 0, 0, 0.25);
  --transition-fast: 180ms;
  --transition-normal: 280ms;
}

body.apple2040 {
  --ink: var(--apple-text);
  --muted: var(--apple-secondary);
  --line: var(--apple-border);
  --paper: transparent;
  --soft: var(--apple-surface);
  --red: var(--apple-danger);
  --radius: 16px;
  color: var(--apple-text);
  font-family: Inter, "SF Pro Text", "SF Pro Display", system-ui, -apple-system, sans-serif;
  letter-spacing: 0;
  background:
    radial-gradient(1200px 700px at 16% -8%, rgba(77, 163, 255, 0.16), transparent 55%),
    radial-gradient(900px 640px at 92% 92%, rgba(109, 220, 255, 0.08), transparent 52%),
    linear-gradient(180deg, #0b1726 0%, #07111d 48%, #060e18 100%);
  color-scheme: dark;
  perspective: 1680px;
  perspective-origin: 50% 42%;
  overflow: hidden;
  transition: background var(--transition-normal) ease, color var(--transition-normal) ease;
}
body.apple2040::before {
  content: "";
  position: fixed;
  inset: -25%;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.07), transparent 34%);
  animation: appleAmbient 16s ease-in-out infinite;
}
@keyframes appleAmbient {
  0%, 100% { transform: translate3d(0, 0, 0); opacity: .5; }
  50% { transform: translate3d(3%, 2%, 0); opacity: .8; }
}
body.apple2040 .app,
body.apple2040 .login-page,
body.apple2040 .main { position: relative; z-index: 1; }
body.apple2040 .holo-scan { display: none !important; }

body.apple2040.day {
  --apple-bg: #e8eef4;
  --apple-surface: rgba(255, 255, 255, 0.62);
  --apple-surface-hover: rgba(255, 255, 255, 0.82);
  --apple-border: rgba(15, 22, 32, 0.08);
  --apple-text: #1d1d1f;
  --apple-secondary: #6e6e73;
  --apple-muted: #8e8e93;
  --shadow-spatial: 0 18px 46px rgba(30, 40, 55, 0.12);
  color-scheme: light;
  background:
    radial-gradient(1000px 640px at 12% 0%, rgba(180, 210, 235, 0.55), transparent 55%),
    linear-gradient(180deg, #eef3f8 0%, #e4ebf2 100%);
}
body.apple2040.day .view > h1,
body.apple2040.day h1,
body.apple2040.day h2,
body.apple2040.day h3 {
  color: #1d1d1f;
}
body.apple2040.day .view > .eyebrow,
body.apple2040.day .view > .sub {
  color: #6e6e73;
}
body.apple2040.day #quality-root .q-hero,
body.apple2040.day #quality-root h2,
body.apple2040.day #onepager > h1,
body.apple2040.day #quality > h1 {
  color: #1d1d1f !important;
}
body.apple2040.day #quality-root .q-hero p,
body.apple2040.day #quality-root .q-kicker {
  color: #6e6e73 !important;
}
body.apple2040.day .app::before {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.06) 0%, transparent 16%, transparent 84%, rgba(0, 0, 0, 0.06) 100%);
  box-shadow: none;
}

body.apple2040 .app {
  position: relative;
  height: calc(100vh - 28px);
  margin: 14px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 20px;
  padding: 16px 18px 16px 16px;
  background: transparent;
  border-radius: 28px;
  transform: none;
  transform-origin: 50% 50%;
  transform-style: flat;
  box-shadow:
    0 40px 90px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
body.apple2040 .app::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  border-radius: 32px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.28) 0%, transparent 16%, transparent 84%, rgba(0, 0, 0, 0.28) 100%);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.12);
}
body.apple2040 .app::after {
  content: "";
  position: absolute;
  inset: 10% 18% auto;
  height: 28%;
  pointer-events: none;
  z-index: 7;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.08), transparent 70%);
}
body.apple2040 .main {
  height: calc(100vh - 64px);
  overflow: auto;
  padding: 8px 6px 32px 2px;
  transform: none;
  transform-origin: 50% 50%;
}
body.apple2040 .main:has(#onepager.view.active) {
  transform: none;
}
body.apple2040 .view { max-width: 1280px; display: none; }
body.apple2040 .view.active {
  display: block;
  animation: appleViewIn 300ms ease;
}
@keyframes appleViewIn {
  from { opacity: 0; transform: translate3d(0, 10px, 0); }
  to { opacity: 1; transform: none; }
}
body.apple2040 h1, body.apple2040 h2, body.apple2040 h3 {
  font-family: inherit;
  text-transform: none;
  text-shadow: none;
  letter-spacing: -0.04em;
  font-weight: 500;
}
body.apple2040 .view > h1 {
  font-size: clamp(40px, 5vw, 58px);
  font-weight: 400;
  line-height: 1.05;
  margin: 0 0 10px;
}
body.apple2040 .view > .eyebrow {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--apple-muted);
}
body.apple2040 .view > .eyebrow::before,
body.apple2040 .view > .eyebrow::after { content: none; }
body.apple2040 .sub {
  color: var(--apple-secondary);
  font-size: 17px;
  font-weight: 400;
  max-width: 34rem;
  line-height: 1.45;
}

body.apple2040 .button,
body.apple2040 .button:hover {
  clip-path: none;
  border-radius: 980px;
  border: 1px solid var(--apple-border);
  background: var(--apple-surface);
  color: var(--apple-text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  box-shadow: none;
  padding: 9px 16px;
  transition: background var(--transition-fast) ease, transform var(--transition-fast) ease;
}
body.apple2040 .button:hover { background: var(--apple-surface-hover); transform: scale(1.02); }
body.apple2040 .button.secondary,
body.apple2040 .button.secondary:hover {
  background: transparent;
  box-shadow: none;
}
body.apple2040 .link-btn { color: var(--apple-blue); font-weight: 600; text-decoration: none; text-shadow: none; }
body.apple2040 .link-btn.danger { color: var(--apple-danger); }
body.apple2040 .sign-out-btn { color: var(--apple-secondary); }
body.apple2040 .app-version { color: var(--apple-muted); font-family: inherit; letter-spacing: 0.04em; font-size: 11px; }
body.apple2040 .user-chip,
body.apple2040 .theme-toggle {
  clip-path: none;
  border-radius: 16px;
  background: var(--apple-surface);
  border: 1px solid var(--apple-border);
  color: var(--apple-text);
}

body.apple2040 .login-page { background: transparent; }
body.apple2040 .login-frame { padding: 0; width: min(420px, 100%); }
body.apple2040 .corner { display: none; }
body.apple2040 .login-card {
  clip-path: none;
  animation: none;
  border-radius: var(--radius-large);
  background: var(--apple-surface);
  border: 1px solid var(--apple-border);
  box-shadow: var(--shadow-spatial);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.25);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.25);
}
body.apple2040 .login-card h1 {
  font-size: 36px;
  font-weight: 400;
  letter-spacing: -0.04em;
  text-transform: none;
}
body.apple2040.night .login-logo { filter: brightness(0) invert(1); }

body.apple2040 .sys-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
}
body.apple2040 .sys-time { text-align: right; color: var(--apple-muted); font-variant-numeric: tabular-nums; }
body.apple2040 .sys-time strong {
  display: block;
  color: var(--apple-text);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.03em;
}
body.apple2040 .overview-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

@media (max-width: 860px) {
  body.apple2040 { perspective: none; overflow: auto; }
  body.apple2040 .app {
    grid-template-columns: 1fr;
    padding: 10px 10px 96px;
    height: auto;
    min-height: 100vh;
    overflow: auto;
    margin: 0;
    transform: none;
    border-radius: 0;
    box-shadow: none;
  }
  body.apple2040 .app::before,
  body.apple2040 .app::after { display: none; }
  body.apple2040 .main { height: auto; transform: none; }
  body.apple2040 .sys-top { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  body.apple2040 { perspective: none; }
  body.apple2040::before,
  body.apple2040 .view.active { animation: none !important; }
  body.apple2040 .app,
  body.apple2040 .main { transform: none; }
}
body.apple2040 .sidebar {
  height: calc(100vh - 64px);
  margin: 0;
  padding: 22px 12px 14px;
  border: 1px solid var(--apple-border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(40px) saturate(1.45);
  -webkit-backdrop-filter: blur(40px) saturate(1.45);
  box-shadow:
    var(--shadow-spatial),
    inset 1px 0 0 rgba(255, 255, 255, 0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  transform: none;
  transform-origin: 50% 50%;
}
body.apple2040 .brand {
  margin: 2px 12px 26px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--apple-text);
  text-shadow: none;
}
body.apple2040 .brand span { color: var(--apple-muted); font-weight: 400; }
body.apple2040 .nav {
  gap: 3px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
}
body.apple2040 .nav-label {
  display: block;
  margin: 16px 12px 6px;
  padding: 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--apple-muted);
}
body.apple2040 .nav-label::before { display: none; }
body.apple2040 .nav button {
  border: 0;
  border-left: 0;
  border-radius: 14px;
  padding: 10px 12px;
  color: var(--apple-secondary);
  font-weight: 500;
  background: transparent;
  transition: background var(--transition-fast) ease, color var(--transition-fast) ease, transform var(--transition-fast) ease;
}
body.apple2040 .nav button .nav-ico { color: inherit; }
body.apple2040 .nav button:hover {
  background: var(--apple-surface-hover);
  color: var(--apple-text);
  font-weight: 500;
}
body.apple2040 .nav button.active,
body.apple2040 .nav button.active:hover {
  background: rgba(77, 163, 255, 0.18);
  color: var(--apple-text);
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 18px rgba(77, 163, 255, 0.12);
  transform: scale(1.01);
}
body.apple2040.day .nav button.active { background: rgba(77, 163, 255, 0.16); }

@media (max-width: 860px) {
  body.apple2040 .sidebar {
    position: fixed;
    z-index: 40;
    left: 10px; right: 10px; bottom: 10px;
    top: auto;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 8px 10px;
    border-radius: 22px;
    transform: none;
  }
  body.apple2040 .brand,
  body.apple2040 .nav-label,
  body.apple2040 .sign-out-btn,
  body.apple2040 .app-version,
  body.apple2040 .user-chip .who span { display: none; }
  body.apple2040 .nav { display: flex; flex-direction: row; overflow-x: auto; flex: 1; }
  body.apple2040 .nav-label-text { display: none; }
  body.apple2040 .sidebar-foot { display: flex; flex-direction: row; align-items: center; gap: 8px; margin: 0; }
}
body.apple2040 .spatial-canvas {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr 1fr;
  grid-auto-rows: minmax(168px, auto);
  gap: 16px;
  margin-top: 26px;
  transform-style: preserve-3d;
}
body.apple2040 .spatial-card,
body.apple2040 #overview .overview-card {
  margin: 0;
  padding: 22px 22px 18px;
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(36px) saturate(1.35);
  -webkit-backdrop-filter: blur(36px) saturate(1.35);
  transition: transform 200ms ease, background 200ms ease, box-shadow 200ms ease;
}
body.apple2040 .card-week { grid-column: 1; grid-row: 1 / span 2; transform: none; }
body.apple2040 .card-bmw { grid-column: 2; grid-row: 1; transform: translateZ(32px); }
body.apple2040 .card-lop { grid-column: 3; grid-row: 1; transform: none; }
body.apple2040 .card-defect { grid-column: 2; grid-row: 2; transform: translateZ(22px); }
body.apple2040 .card-insight { grid-column: 3; grid-row: 2; transform: none; }
body.apple2040 #overview .overview-card:hover {
  transform: translateZ(44px) scale(1.015);
  background: var(--apple-surface-hover);
}
body.apple2040 .spatial-canvas .eyebrow,
body.apple2040 #overview .overview-card .eyebrow {
  display: block;
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--apple-muted);
  letter-spacing: 0.04em;
  text-transform: none;
}
body.apple2040 #overview .overview-card .eyebrow::before,
body.apple2040 #overview .overview-card .eyebrow::after { content: none; }

body.apple2040 .bmw-stack { display: grid; gap: 10px; }
body.apple2040 .bmw-stat { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
body.apple2040 .bmw-stat b {
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
body.apple2040 .bmw-stat span { color: var(--apple-muted); font-size: 12px; font-weight: 600; }
body.apple2040 .bmw-overdue b,
body.apple2040 .bmw-stat-hero b {
  font-size: 52px;
  font-weight: 600;
  line-height: 1;
}
body.apple2040 .bmw-overdue .due-halo,
body.apple2040 .bmw-stat-hero .due-halo {
  font-size: inherit;
  font-weight: inherit;
}
body.apple2040 .spatial-row-due .due-halo {
  font-size: 13px;
  font-weight: 700;
}
body.apple2040 .bmw-stat-hero span { color: var(--apple-secondary); }

body.apple2040 .spatial-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 8px;
  margin: 0 -8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition-fast) ease;
}
body.apple2040 .spatial-row-title { flex: 1; font-weight: 500; font-size: 14px; }
body.apple2040 .spatial-row-sub { display: block; margin-top: 2px; font-size: 11px; font-weight: 400; color: var(--apple-muted); }
body.apple2040 .spatial-row.is-overdue .spatial-row-title .due-halo,
body.apple2040 .spatial-row.is-overdue .spatial-row-due .due-halo,
body.apple2040 .spatial-row-sub.is-overdue .due-halo { color: hsl(8 90% 58%); }
body.apple2040 .spatial-row-due { color: var(--apple-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
body.apple2040 .spatial-row-arrow {
  opacity: 0;
  color: var(--apple-blue);
  transform: translateX(-4px);
  transition: opacity 200ms ease, transform 200ms ease;
}
body.apple2040 .spatial-row:hover { background: var(--apple-surface-hover); }
body.apple2040 .spatial-row:hover .spatial-row-arrow { opacity: 1; transform: none; }

body.apple2040 .overview-defect-name { font-size: 22px; font-weight: 500; letter-spacing: -0.03em; }
body.apple2040 .overview-defect-count { font-size: 40px; font-weight: 400; letter-spacing: -0.04em; margin-top: 4px; }
body.apple2040 .overview-defect-sub { color: var(--apple-muted); font-size: 12px; margin-top: 4px; }
body.apple2040 .spark { width: 100%; height: 36px; margin-top: 12px; color: var(--apple-blue); opacity: .85; }
body.apple2040 .insight-kicker { font-size: 11px; font-weight: 600; color: var(--apple-blue); margin-bottom: 8px; }
body.apple2040 .insight-body { font-size: 20px; line-height: 1.35; letter-spacing: -0.03em; font-weight: 400; }
body.apple2040 .insight-more { margin-top: 14px; display: inline-block; }

body.apple2040 .note-card,
body.apple2040 .c-chart-card,
body.apple2040 .mr-card,
body.apple2040 .changelog-box {
  clip-path: none;
  border-radius: var(--radius-card);
  background: var(--apple-surface);
  border: 1px solid var(--apple-border);
  box-shadow: none;
  backdrop-filter: none;
}
body.apple2040 .c-chart-card:hover,
body.apple2040 .note-card:hover {
  transform: none;
  background: var(--apple-surface-hover);
}

@media (max-width: 1180px) {
  body.apple2040 .spatial-canvas { grid-template-columns: 1fr 1fr; }
  body.apple2040 .card-week { grid-column: 1 / -1; grid-row: auto; }
  body.apple2040 .card-bmw, body.apple2040 .card-lop, body.apple2040 .card-defect, body.apple2040 .card-insight {
    grid-column: auto; grid-row: auto;
  }
}
@media (max-width: 860px) {
  body.apple2040 .spatial-canvas { grid-template-columns: 1fr; }
}
@media (max-width: 860px), (prefers-reduced-motion: reduce) {
  body.apple2040 .card-week,
  body.apple2040 .card-bmw,
  body.apple2040 .card-lop,
  body.apple2040 .card-defect,
  body.apple2040 .card-insight,
  body.apple2040 #overview .overview-card:hover { transform: none; }
}
body.apple2040 .modal {
  background: rgba(7, 17, 29, 0.42);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
}
body.apple2040 .dialog {
  clip-path: none;
  border-radius: var(--radius-large);
  background: rgba(18, 28, 40, 0.82);
  border: 1px solid var(--apple-border);
  box-shadow: var(--shadow-spatial);
  backdrop-filter: blur(30px) saturate(1.2);
  -webkit-backdrop-filter: blur(30px) saturate(1.2);
  color: var(--apple-text);
  transform: scale(0.96);
  animation: appleModalIn 320ms ease forwards;
}
body.apple2040.day .dialog { background: rgba(255, 255, 255, 0.86); }
@keyframes appleModalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  body.apple2040 .dialog { animation: none; transform: none; }
}
.due-halo, .due-tone {
  color: hsl(var(--due-h, 210) 85% 68%);
  font-weight: 700;
}
.due-halo {
  animation: duePulse 1.6s ease-in-out infinite;
}
@keyframes duePulse {
  0%, 100% { opacity: 1; text-shadow: 0 0 14px hsl(var(--due-h, 210) 95% 62% / 0.95); }
  50% { opacity: 0.15; text-shadow: none; }
}

body.apple2040 .status {
  border-radius: 980px;
  background: var(--apple-surface);
  border: 0;
  color: var(--apple-secondary);
  font-family: inherit;
  letter-spacing: 0;
  text-shadow: none;
  box-shadow: none;
  padding: 4px 10px;
  font-weight: 600;
  animation: none;
}
body.apple2040 .status.overdue,
body.apple2040 .status.rejected { color: var(--apple-danger); background: rgba(255, 95, 87, 0.14); }
body.apple2040 .status.closed,
body.apple2040 .status.complete { color: var(--apple-success); background: rgba(82, 210, 115, 0.14); }
body.apple2040 .status.open { color: var(--apple-blue); background: rgba(77, 163, 255, 0.14); }

body.apple2040 .filter,
body.apple2040 input,
body.apple2040 select,
body.apple2040 textarea,
body.apple2040 .form-grid input,
body.apple2040 .form-grid select,
body.apple2040 .form-grid textarea {
  background: var(--apple-surface);
  border: 1px solid var(--apple-border);
  border-radius: 12px;
  color: var(--apple-text);
  transition: box-shadow var(--transition-fast) ease, border-color var(--transition-fast) ease;
}
body.apple2040 .filter:focus,
body.apple2040 input:focus,
body.apple2040 select:focus,
body.apple2040 textarea:focus {
  outline: none;
  border-color: rgba(77, 163, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(77, 163, 255, 0.16);
}
body.apple2040 .toolbar .filter { min-height: 38px; }

body.apple2040 .table-wrap {
  clip-path: none;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--apple-border);
  box-shadow: none;
  backdrop-filter: none;
}
body.apple2040.day .table-wrap { background: rgba(255, 255, 255, 0.72); }
body.apple2040 th {
  background: transparent;
  color: var(--apple-muted);
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: none;
  font-weight: 600;
}
body.apple2040 td { border-top-color: var(--apple-border); font-size: 14px; }
body.apple2040 tr:hover td { background: var(--apple-surface-hover); }
body.apple2040 tr.overdue td,
body.apple2040 tr.row-due-now td,
body.apple2040 tr.row-due-soon td { animation: none; }
body.apple2040 tr.overdue td { background: rgba(255, 95, 87, 0.06); }
body.apple2040 tr.row-due-soon td { background: rgba(77, 163, 255, 0.05); }
body.apple2040 .complaint-table td.c-actions,
body.apple2040 .complaint-table th.c-actions-head { background: transparent; }

body.apple2040 #quality-root {
  --qi: var(--apple-text);
  --qm: var(--apple-secondary);
  --ql: var(--apple-border);
  --qp: transparent;
  --qc: var(--apple-surface);
  --qb: var(--apple-blue);
  color: var(--apple-text);
  font-family: inherit;
}
body.apple2040 #quality-root .q-hero,
body.apple2040 #quality-root .q-filters,
body.apple2040 #quality-root .q-kpi,
body.apple2040 #quality-root .q-card,
body.apple2040 #quality-root .q-top {
  clip-path: none;
  background: var(--apple-surface);
  border: 1px solid var(--apple-border);
  border-radius: 16px;
  box-shadow: none;
  backdrop-filter: none;
}
body.apple2040 #quality-root h2 { font-family: inherit; text-transform: none; letter-spacing: -0.03em; }
body.apple2040 #quality-root button:not(.q-chart-tab):not(.date-cal-btn):not(.date-pop-day):not(.date-pop-nav),
body.apple2040 #quality-root .q-upload {
  background: var(--apple-surface);
  color: var(--apple-text);
  border-radius: 980px;
  font-family: inherit;
  text-transform: none;
  letter-spacing: 0;
}
body.apple2040:not(.day) #quality-root .q-chart-tab,
body.apple2040:not(.day) .c-chart-tab {
  background: rgba(255, 255, 255, 0.08) !important;
  color: rgba(255, 255, 255, 0.92) !important;
  border-radius: 0 !important;
}
body.apple2040:not(.day) #quality-root .q-chart-tab.active,
body.apple2040:not(.day) .c-chart-tab.active {
  background: #ffffff !important;
  color: #1d1d1f !important;
}
body.apple2040.day #quality-root .q-chart-tab,
body.apple2040.day .c-chart-tab {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #1d1d1f !important;
}
body.apple2040.day #quality-root .q-chart-tab.active,
body.apple2040.day .c-chart-tab.active {
  background: #1d1d1f !important;
  color: #ffffff !important;
}

body.apple2040 #onepager .op-slide.op-sheet,
body.apple2040 #op-slide.op-sheet {
  font-family: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif !important;
  text-transform: none !important;
  text-shadow: none !important;
  background:
    radial-gradient(900px 420px at 88% 8%, rgba(255,255,255,.95) 0%, transparent 55%),
    linear-gradient(180deg, #f7f8fb 0%, #eef1f5 100%) !important;
  color: #16181c !important;
  clip-path: none !important;
  border: 0 !important;
  box-shadow: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .due-halo { animation: none !important; }
}
.homeos {
  max-width: 1120px;
}
.homeos-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
}
.homeos-top h1 {
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 400;
  letter-spacing: -0.045em;
  margin: 0;
  color: var(--apple-text, var(--ink));
}
.homeos-greet {
  margin: 4px 0 0;
  color: var(--apple-secondary, var(--muted));
  font-size: 18px;
}
.homeos-clock {
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.homeos-card {
  border: 1px solid var(--apple-border, var(--line));
  background: var(--apple-surface, var(--soft));
  border-radius: 22px;
  padding: 18px 20px;
  backdrop-filter: blur(22px);
}
.homeos-house {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: end;
}
.homeos-house .k {
  display: block;
  font-size: 12px;
  color: var(--apple-muted, var(--muted));
  margin-top: 4px;
}
.homeos-house .v {
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.homeos-status {
  justify-self: end;
  font-size: 12px;
  letter-spacing: 0.08em;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--apple-border, var(--line));
}
.homeos-status.is-on {
  color: var(--apple-success, #52d273);
  border-color: rgba(82, 210, 115, 0.45);
}
.homeos-status.is-off {
  color: var(--apple-warning, #ffb84d);
  border-color: rgba(255, 184, 77, 0.4);
}
.homeos-note {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--apple-muted, var(--muted));
}
.homeos-label {
  margin: 26px 0 10px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--apple-muted, var(--muted));
}
.homeos-rooms {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.homeos-room {
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
  width: 100%;
}
.homeos-room strong {
  display: block;
  font-weight: 500;
  font-size: 16px;
}
.homeos-room .t {
  font-size: 22px;
  letter-spacing: -0.04em;
  margin: 8px 0 2px;
}
.homeos-room .m {
  font-size: 12px;
  color: var(--apple-muted, var(--muted));
}
.homeos-room.is-open {
  border-color: rgba(77, 163, 255, 0.45);
}
.homeos-quick,
.homeos-scenes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.homeos-chip {
  border: 1px solid var(--apple-border, var(--line));
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.homeos-chip:hover,
.homeos-chip.is-on {
  background: var(--apple-surface-hover, rgba(255,255,255,0.12));
}
.homeos-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.homeos-feed li {
  display: grid;
  grid-template-columns: 54px 10px 1fr auto;
  gap: 10px;
  align-items: baseline;
  font-size: 14px;
}
.homeos-feed .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--apple-cyan, #6ddcff);
  align-self: center;
}
.homeos-feed .when {
  color: var(--apple-muted, var(--muted));
  font-variant-numeric: tabular-nums;
}
.homeos-feed .place {
  color: var(--apple-muted, var(--muted));
}
.homeos-detail {
  margin-top: 16px;
}
.homeos-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--apple-border, var(--line));
}
.homeos-row:last-child { border-bottom: 0; }
.homeos-sw {
  width: 46px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--apple-border, var(--line));
  background: rgba(255,255,255,0.08);
  position: relative;
  cursor: pointer;
}
.homeos-sw::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 160ms ease;
}
.homeos-sw.is-on {
  background: #34c759;
  border-color: #34c759;
}
.homeos-sw.is-on::after { transform: translateX(18px); }
.homeos-sw:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.homeos-empty {
  color: var(--apple-muted, var(--muted));
}
@media (max-width: 720px) {
  .homeos-house { grid-template-columns: 1fr 1fr; }
  .homeos-status { justify-self: start; }
}

/* v1.24 — part name under PN everywhere (TOP 5, Defect Analysis, Complaints, One pager) */
.q-part-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; text-overflow: ellipsis; font-size: 12px; line-height: 1.3; color: var(--muted); }
.q-part-name .q-part-ais { font-size: 10.5px; opacity: .75; font-variant-numeric: tabular-nums; }
/* v1.25 — TOP 5 cards always reserve the part-name block (2 lines) so percentages align */
.q-top .q-part-name, .wk-top .q-part-name, .wk-pdf-cards .q-part-name { min-height: 2.6em; }
.q-part-name-empty { visibility: hidden; }
/* v1.26 — TOP 5 title: short key on one line */
.q-top .q-part, .wk-top .q-part { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== v1.27 Budget (personal finance) — site theme only, no app colours ===== */
#budget, .bd-panel { --bd-in: #2f9461; --bd-out: #cf4f46; --bd-accent: var(--apple-blue, #4da3ff); --bd-surface: var(--apple-surface, var(--soft)); --bd-border: var(--apple-border, var(--line)); }
body.apple2040:not(.day) #budget, body.night #budget, body.apple2040:not(.day) .bd-panel, body.night .bd-panel { --bd-in: #58c28a; --bd-out: #ff7a70; }
#budget .bd-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 16px; }
#budget .bd-top .spacer, :is(#budget, .bd-panel) .spacer { flex: 1; }
#budget .bd-top .button { width: auto; flex: 0 0 auto; }
#budget .bd-in { color: var(--bd-in); }
#budget .bd-out { color: var(--bd-out); }
#budget .bd-over { color: var(--bd-out) !important; }
#budget .bd-monthbar { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
#budget .bd-monthbar .month-label { min-width: 150px; text-align: center; font-weight: 700; }
#budget .bd-hero { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: center; margin: 0 0 16px; }
#budget .bd-ring-wrap { position: relative; width: 200px; height: 200px; }
#budget .bd-ring { width: 100%; height: 100%; }
#budget .bd-ring circle { fill: none; stroke-width: 14; }
#budget .bd-ring-bg { stroke: var(--bd-border); }
#budget .bd-ring-fg { stroke: var(--bd-accent); stroke-linecap: round; transition: stroke-dasharray .4s ease; }
#budget .bd-ring.over .bd-ring-fg { stroke: var(--bd-out); }
#budget .bd-ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
#budget .bd-ring-text b { font-size: 34px; line-height: 1.1; }
#budget .bd-ring-text span, #budget .bd-ring-text small { color: var(--muted); font-size: 12px; }
#budget .bd-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
#budget .bd-cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 0 16px; }
#budget .bd-card { background: var(--bd-surface); border: 1px solid var(--bd-border); border-radius: var(--radius-card, 16px); padding: 16px; min-width: 0; }
#budget .bd-card > span { display: block; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
#budget .bd-card > b { display: block; font-size: 24px; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
#budget .bd-card > small { color: var(--muted); font-size: 12px; }
#budget .cost-card { background: var(--bd-surface); border-color: var(--bd-border); border-radius: var(--radius-card, 16px); }
#budget .cost-card h3 { margin: 0 0 10px; font-size: 15px; }
#budget .bd-h3-gap { margin-top: 18px !important; }
:is(#budget, .bd-panel) .q-note { color: var(--muted); font-size: 12px; }
#budget .bd-insights ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
#budget .bd-insights li { display: flex; gap: 10px; align-items: baseline; }
#budget .bd-insights li > span { color: var(--muted); width: 14px; text-align: center; }
#budget .bd-tone-over { color: var(--bd-out); }
#budget .bd-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
#budget .bd-filters #bd-search { min-width: 220px; }
#budget .c-range { display: inline-flex; gap: 6px; }
#budget .c-range[hidden], #budget select[hidden] { display: none; }
#budget .bd-table { width: 100%; border-collapse: collapse; }
#budget .bd-table td, #budget .bd-table th { padding: 9px 10px; border-bottom: 1px solid var(--bd-border); text-align: left; vertical-align: middle; }
#budget .bd-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 700; }
#budget .bd-day th { padding-top: 18px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-bottom-color: transparent; }
#budget .bd-day th.num { font-size: 13px; text-transform: none; letter-spacing: 0; }
#budget .bd-row { cursor: pointer; }
#budget .bd-row:hover td { background: var(--apple-surface-hover, var(--soft)); }
#budget .bd-cat-cell { width: 46px; }
#budget .c-muted { color: var(--muted); font-size: 12px; margin-top: 2px; }
:is(#budget, .bd-panel) .bd-cat-ico { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--bd-surface); border: 1px solid var(--bd-border); color: var(--ink); flex-shrink: 0; }
:is(#budget, .bd-panel) .bd-ico { width: 17px; height: 17px; }
:is(#budget, .bd-panel) .bd-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; opacity: .85; flex-shrink: 0; }
:is(#budget, .bd-panel) .bd-cat-ico .bd-dot { position: absolute; right: -1px; bottom: -1px; box-shadow: 0 0 0 2px var(--apple-bg, var(--paper)); }
:is(#budget, .bd-panel) .bd-receipt-link { text-decoration: none; }
/* side panel */
.bd-panel { visibility: hidden; position: fixed; inset: 0 0 0 auto; width: min(440px, 100vw); z-index: 60; transform: translateX(105%); transition: transform .25s ease, visibility .25s; background: var(--apple-bg, var(--paper)); border-left: 1px solid var(--bd-border); box-shadow: -18px 0 40px rgba(0,0,0,.25); overflow-y: auto; }
.bd-panel.open { transform: none; visibility: visible; }
.bd-panel-inner { display: grid; gap: 12px; padding: 18px; }
.bd-panel label { display: grid; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); }
.bd-panel input:not([type=checkbox]):not([type=file]), .bd-panel select { width: 100%; }
:is(#budget, .bd-panel) .bd-label { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: -6px; }
:is(#budget, .bd-panel) .bd-seg { width: 100%; }
:is(#budget, .bd-panel) .bd-seg .c-chart-tab { flex: 1; padding: 9px 12px; font-size: 13px; }
:is(#budget, .bd-panel) .bd-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
:is(#budget, .bd-panel) .bd-chip { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: 12px; border: 1px solid var(--bd-border); background: transparent; color: var(--ink); font: inherit; font-size: 12px; cursor: pointer; }
:is(#budget, .bd-panel) .bd-chip.active { border-color: var(--ink); background: var(--bd-surface); font-weight: 700; }
:is(#budget, .bd-panel) .bd-inline { display: flex; gap: 6px; align-items: center; }
:is(#budget, .bd-panel) .bd-inline input { flex: 1; }
:is(#budget, .bd-panel) .bd-receipt { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
:is(#budget, .bd-panel) .bd-check[hidden] { display: none !important; }
:is(#budget, .bd-panel) .bd-check { display: inline-flex !important; grid-auto-flow: column; align-items: center; gap: 4px; }
:is(#budget, .bd-panel) .dialog-actions { display: flex; gap: 8px; align-items: center; }
:is(#budget, .bd-panel) .button.danger, #budget .link-btn.danger { color: var(--muted); }
/* reports */
#budget .bd-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
#budget .bd-donut { height: 220px; position: relative; }
#budget .bd-chart { height: 260px; position: relative; }
#budget .bd-legend, #budget .bd-toplist { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
#budget .bd-legend li, #budget .bd-toplist li { display: flex; align-items: center; gap: 10px; }
#budget .bd-legend b, #budget .bd-toplist b { margin-left: auto; font-variant-numeric: tabular-nums; }
#budget .bd-report { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
#budget .bd-report dt { color: var(--muted); }
#budget .bd-report dd { margin: 0; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
/* goals + settings */
#budget .bd-goals { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: 0 0 16px; }
#budget .bd-goal { display: grid; gap: 8px; }
#budget .bd-goal-head { display: flex; align-items: center; gap: 10px; }
#budget .bd-progress { height: 8px; border-radius: 99px; background: var(--bd-border); overflow: hidden; }
#budget .bd-progress i { display: block; height: 100%; background: var(--bd-accent); border-radius: inherit; }
#budget .bd-goal-nums { display: flex; justify-content: space-between; font-size: 13px; font-variant-numeric: tabular-nums; }
#budget .bd-form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; align-items: end; }
#budget .bd-form-grid h3, #budget .bd-form-grid .dialog-actions { grid-column: 1 / -1; }
#budget .bd-form-grid label { display: grid; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); }
#budget .bd-cat-table { width: 100%; border-collapse: collapse; }
#budget .bd-cat-table th, #budget .bd-cat-table td { padding: 6px 8px; border-bottom: 1px solid var(--bd-border); text-align: left; font-size: 13px; }
#budget .bd-cat-table input[type=color] { width: 38px; height: 30px; padding: 0; border: 1px solid var(--bd-border); border-radius: 8px; background: transparent; }
#budget .bd-import { display: grid; gap: 8px; margin-top: 10px; }
#budget .bd-import .button { justify-self: start; }
@media (max-width: 860px) {
  #budget .bd-hero { grid-template-columns: 1fr; justify-items: center; }
  #budget .bd-cards, #budget .bd-grid2 { grid-template-columns: 1fr; }
  #budget .bd-cards { width: 100%; }
}
:is(#budget, .bd-panel) .bd-inline input { min-width: 0; }
:is(#budget, .bd-panel) .bd-inline .button { white-space: nowrap; flex: 0 0 auto; width: auto; }
#budget .bd-form-grid input, #budget .bd-form-grid select { width: 100%; min-width: 0; }


/* v1.30 — Documents origin tags */
.doc-origin-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e8e8ed;
  color: #6e6e73;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
body.night .doc-origin-tag {
  background: #2C2C2E;
  color: #A1A1A6;
}
.wk-source { margin: 0 0 8px; }
