:root {
  --blue: #0f4c81;
  --turquoise: #1dcad3;
  --dark: #1b2430;
  --sidebar: #102033;
  --light: #f5f7fa;
  --success: #2eaf62;
  --warning: #ffb703;
  --line: #e2e8f0;
  --text: #1b2430;
  --muted: #5c6b7a;
  --font: Inter, Arial, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--light);
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 8px;
  background: var(--turquoise);
  color: #08343a;
  font: 600 0.95rem/1 var(--font);
  padding: 0.65rem 1rem;
  cursor: pointer;
  text-decoration: none;
}
button:hover, .button:hover { filter: brightness(0.96); text-decoration: none; }
.button-quiet { background: #fff; color: var(--blue); border: 1px solid var(--line); }
.button-icon {
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.button-icon svg { display: block; }

.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-button { display: none; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 240px;
  background: var(--sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 1.1rem 0.8rem 1rem;
  z-index: 20;
}
.brand { display: block; padding: 0.35rem 0.75rem 1.1rem; text-decoration: none; }
.wordmark {
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.wordmark span { color: var(--turquoise); }
.sidebar nav { display: flex; flex-direction: column; gap: 0.15rem; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: #d5deea;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  text-decoration: none;
}
.sidebar nav a img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.92;
}
.sidebar nav a.is-active,
.sidebar nav a:hover {
  background: #1d6fa8;
  color: #fff;
  text-decoration: none;
}
.sidebar-user {
  margin-top: auto;
  padding: 0.9rem 0.7rem 0.3rem;
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  color: #b7c3d1;
  font-size: 0.82rem;
}
.sidebar-user strong { display: block; color: #fff; font-size: 0.92rem; }
.sidebar-account { min-width: 0; flex: 1; }
.sidebar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.75rem;
  align-items: center;
  margin-top: 0.35rem;
}
.sidebar-actions form { margin: 0; }
.sidebar-actions a,
.sidebar-actions button {
  background: none;
  border: 0;
  padding: 0;
  width: auto;
  color: #d5e4f2;
  font: 600 0.78rem/1.2 var(--font);
  cursor: pointer;
}
.sidebar-actions a:hover,
.sidebar-actions button:hover { color: #fff; text-decoration: underline; }
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: #3d5f86;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  flex: none;
  object-fit: cover;
}
img.avatar { display: inline-block; }
.avatar-sm { width: 22px; height: 22px; font-size: 0.62rem; }
.person-cell { display: inline-flex; align-items: center; gap: 0.45rem; }
.person-stack { display: flex; flex-wrap: wrap; gap: 0.45rem 0.8rem; }
#id_assigned_employees { list-style: none; margin: 0; padding: 0; }
#id_assigned_employees li { margin: 0.3rem 0; }
#id_assigned_employees input { width: auto; max-width: none; margin-right: 0.45rem; }
#id_assigned_employees label.is-unavailable { color: #9d1c1c; }
.photo-preview {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1rem;
}
.photo-preview img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
}
.employee-form { padding: 1.2rem 1.3rem 1.4rem; }
.employee-layout {
  display: grid;
  grid-template-columns: minmax(0, 11rem) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}
.employee-photo {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.7rem;
  min-width: 0;
  overflow: hidden;
}
.employee-photo img,
.avatar-lg {
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 50%;
  object-fit: cover;
  font-size: 1.8rem;
  align-self: center;
}
.photo-pick input {
  margin-top: 0.3rem;
  width: 100%;
  max-width: 100%;
  font-size: 0;
}
.photo-pick input::file-selector-button {
  font: 600 0.8rem/1 var(--font);
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--blue);
}
.field-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.2rem 1rem;
}
.field-pair input,
.field-pair select { max-width: none; }
.employee-form .address-grid { max-width: none; margin-top: 0.4rem; }
.employee-overview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  margin-top: 0.9rem;
}
.employee-overview .qual-title h2 a { color: inherit; text-decoration: none; }
.employee-overview .qual-title h2 a:hover { color: var(--blue); }
.overview-lead { margin: 0.2rem 1.1rem 0.2rem; font-weight: 600; }
.employee-overview .hint,
.employee-overview .empty { margin: 0.2rem 1.1rem 1rem; }
.employee-overview table { margin-top: 0.2rem; }

.shell { margin-left: 240px; min-height: 100vh; }
.topbar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 1.4rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.topbar h1 { margin: 0; font-size: 1.35rem; flex: 1; }
.topbar-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
main { padding: 1.2rem 1.4rem 2rem; }

.messages { list-style: none; margin: 0; padding: 0.8rem 1.4rem 0; }
.messages li {
  background: #e7f8f4;
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.4rem;
}
.messages .error { background: #fde8e8; }

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}
.health-hero { padding: 1rem 1.1rem 1.1rem; margin-bottom: 1rem; }
.health-hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.health-checked { margin: 0; font-weight: 700; }
.health-warnings { margin: 0.8rem 0 0; padding-left: 1.1rem; }
.health-cards { grid-template-columns: 1fr 1fr; }
.health-card-head { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; }
.health-card-head h2 { color: var(--text); }
.health-cards .card p { margin: 0.55rem 0 0; }
.health-rows { margin: 0.7rem 0 0; }
.health-rows div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0;
  border-top: 1px solid var(--line);
}
.health-rows dt { color: var(--muted); }
.health-rows dd { margin: 0; text-align: right; }
.health-link { margin-top: 0.7rem; }
.card, .panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.card { padding: 1rem 1.1rem; }
.card h2, .panel h2 { margin: 0; font-size: 0.92rem; color: var(--muted); font-weight: 600; }
.metric { margin: 0.35rem 0 0; font-size: 2rem; font-weight: 700; color: var(--text); }
.hint, .empty, .week-label { color: var(--muted); }
.hint { margin: 0.2rem 0 0; }
.panel { overflow: auto; }
.panel-head, .detail { padding: 1rem 1.1rem 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.75rem 1rem; border-top: 1px solid var(--line); vertical-align: top; }
.panel td form { display: inline-block; margin-left: 0.75rem; }
.due-over { color: #9d1c1c; font-weight: 700; }
.due-soon { color: #8a5a00; font-weight: 700; }
.qual-title { padding: 1rem 1.1rem 0.35rem; }
.qual-title h2 { color: var(--text); font-size: 1.05rem; }
.qual-title .hint { margin-top: 0.2rem; }
.report-photos { display: flex; flex-wrap: wrap; gap: 0.75rem; padding: 0.9rem 1.1rem 1rem; }
.report-photos figure { margin: 0; width: 8rem; }
.report-photos img { width: 8rem; height: 8rem; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.report-photos figcaption { font-size: 0.8rem; color: var(--muted); margin-top: 0.25rem; }
.report-photos form { margin-top: 0.35rem; }
.report-photos .button { width: 100%; }
.signature-saved { margin: 0.9rem 1.1rem 0; }
.signature-saved img { display: block; max-width: 24rem; width: 100%; height: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.signature-saved figcaption { font-size: 0.8rem; color: var(--muted); margin-top: 0.35rem; }
.signature-form { padding: 0.9rem 1.1rem 1rem; }
.signature-form label { display: block; font-size: 0.8rem; font-weight: 700; color: var(--muted); margin-bottom: 0.35rem; }
.signature-pad { display: block; width: 100%; max-width: 36rem; height: 180px; background: #fff; border: 1px solid var(--line); border-radius: 12px; touch-action: none; cursor: crosshair; }
.signature-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.qual-bar {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) auto auto;
  gap: 0.75rem 1rem;
  align-items: end;
  margin: 0;
  padding: 0.9rem 1.1rem 1rem;
  background: #f8fafc;
  border-top: 1px solid var(--line);
}
.qual-bar.is-assign { grid-template-columns: 1.2fr 1.2fr 0.9fr auto; }
.qual-bar.is-portal { grid-template-columns: 1.3fr 1fr 1.3fr 1fr auto; }
.qual-bar.is-portal-ticket {
  grid-template-columns: minmax(8rem, 1.1fr) minmax(10rem, 1.6fr) 9rem auto;
}
.qual-bar.is-portal-ticket label.is-wide { grid-column: 1 / -1; }
.qual-bar.is-portal-ticket input,
.qual-bar.is-portal-ticket select { height: 2.6rem; min-height: 0; }
.qual-bar.is-portal-ticket textarea {
  height: 4.2rem;
  min-height: 4.2rem;
  max-width: none;
  resize: vertical;
}
.qual-bar.is-portal-ticket button { height: 2.6rem; }
.qual-bar.is-absence { grid-template-columns: 1.3fr 0.8fr 0.8fr 0.8fr 1.1fr auto; }
.qual-bar.is-name { grid-template-columns: minmax(12rem, 24rem) auto; justify-content: start; }
.qual-bar.is-check { grid-template-columns: minmax(12rem, 22rem) 11rem auto; justify-content: start; }
.qual-bar.is-check-area {
  grid-template-columns: minmax(10rem, 1.4fr) minmax(12rem, 1.6fr) auto;
  justify-content: start;
}
.qual-bar.is-area {
  grid-template-columns: minmax(10rem, 1.4fr) minmax(8rem, 1fr) 7rem 9rem 7rem auto;
  justify-content: start;
}
.qual-bar.is-article { grid-template-columns: minmax(10rem, 1.4fr) 7rem 8rem auto auto; justify-content: start; }
.building-block { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--line); }
.building-block:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.building-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.4rem;
}
.area-sums { margin: 0.75rem 0 0; }
.qual-bar.is-material { grid-template-columns: minmax(10rem, 1.4fr) minmax(8rem, 1fr) 7rem auto; justify-content: start; }
.qual-bar.is-user { grid-template-columns: minmax(8rem, 1fr) minmax(11rem, 1.4fr) minmax(8rem, 1fr) auto; }
.qual-bar.is-firm { grid-template-columns: minmax(12rem, 1.6fr) 8rem; }
.qual-bar.is-support { grid-template-columns: minmax(12rem, 1.6fr) 11rem auto; }
.qual-bar.is-abo { grid-template-columns: minmax(9rem, 1fr) minmax(8rem, 0.8fr) 11rem auto; }
.qual-bar.is-firm-register { grid-template-columns: minmax(10rem, 1.4fr) minmax(8rem, 1fr) minmax(8rem, 1fr) auto; }
.qual-bar.is-platform-invoice { grid-template-columns: minmax(10rem, 1.2fr) minmax(10rem, 1.4fr) 7rem 9rem auto; }
.qual-bar.is-billing-address { grid-template-columns: minmax(10rem, 1.4fr) minmax(10rem, 1.4fr) 6rem minmax(8rem, 1fr); }
.qual-bar.is-billing-iban { grid-template-columns: minmax(14rem, 24rem) auto; justify-content: start; }
.qual-bar.is-invoice-line { grid-template-columns: minmax(10rem, 1.6fr) 6.5rem 9.5rem auto auto; }
.invoice-table-wrap { overflow-x: auto; }
.invoice-table { width: 100%; border-collapse: collapse; }
.invoice-table th,
.invoice-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.invoice-table th { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.invoice-table td:nth-child(n+3),
.invoice-table th:nth-child(n+3) { text-align: right; white-space: nowrap; }
.invoice-table td:first-child,
.invoice-table th:first-child,
.invoice-table td:nth-child(2),
.invoice-table th:nth-child(2) { text-align: left; white-space: normal; }
.invoice-table input { max-width: none; text-align: right; }
.invoice-table td:nth-child(2) input { text-align: left; }
.invoice-table tfoot td { font-weight: 600; }
.invoice-table tfoot tr:last-child td { border-bottom: 0; font-weight: 700; }
.invoice-positions { margin: 0.5rem 0 1rem; }
.invoice-positions h2 { margin: 0 0 0.75rem; font-size: 1rem; }
.invoice-positions .invoice-report-lines + .invoice-report-lines { margin-top: 0.75rem; }
.qual-bar.is-reminder { grid-template-columns: minmax(10rem, 1.2fr) minmax(10rem, 1fr) auto auto; }
.qual-bar.is-ticket-template { grid-template-columns: minmax(10rem, 1.2fr) 9rem minmax(12rem, 1.6fr) auto; }
.qual-bar.is-sla { grid-template-columns: repeat(4, 7rem) auto; }
.qual-bar.is-notice-template { grid-template-columns: minmax(16rem, 36rem) auto; justify-content: start; }
.qual-bar.is-message { grid-template-columns: minmax(16rem, 36rem) auto; justify-content: start; }
.employee-message { margin-top: 0.9rem; }
.employee-message .hint,
.employee-message .empty { margin: 0.2rem 1.1rem 1rem; }
.qual-bar.is-notice-pref { grid-template-columns: auto auto auto; justify-content: start; }
.qual-bar.is-quiet { grid-template-columns: 8rem 8rem auto; justify-content: start; }
.qual-bar.is-recur {
  grid-template-columns: minmax(8rem, 1.2fr) minmax(8rem, 1fr) minmax(8rem, 1.1fr) 8rem 7rem 4.5rem;
}
.qual-bar.is-recur-when {
  grid-template-columns: 6.5rem 6.5rem 8rem 8rem minmax(7rem, 1fr) auto auto;
}
.stack.series-page { gap: 1rem; }
.series-card > .series-body {
  padding: 0.75rem 1.1rem 0.15rem;
}
.series-card > .series-body .task-meta { margin: 0; line-height: 1.45; }
.series-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem 0.95rem;
}
.series-date {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.series-date:hover {
  border-color: var(--turquoise);
  background: #fff;
  color: var(--blue);
  text-decoration: none;
}
.series-date .series-time {
  color: var(--muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.series-date .badge {
  font-size: 0.72rem;
  padding: 0.15rem 0.4rem;
}
.series-empty {
  margin: 0;
  padding: 0.35rem 1.1rem 0.95rem;
  color: var(--muted);
}
.series-fold {
  margin: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: #f8fafc;
}
.series-fold > summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  list-style: none;
  padding: 0.7rem 1.1rem;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--blue);
}
.series-fold > summary::-webkit-details-marker { display: none; }
.series-fold > summary::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  margin-top: -0.12rem;
}
.series-fold[open] > summary::before {
  transform: rotate(45deg);
  margin-top: 0.05rem;
}
.series-fold[open] > summary {
  border-bottom: 1px solid var(--line);
  background: #eef3f8;
}
.series-fold .qual-bar { border-top: 0; }
.series-fold .qual-bar + .qual-bar { border-top: 1px solid var(--line); }
.series-fold .checklist-field { margin: 0.75rem 1.1rem 1rem; }
.series-fold.is-nested {
  margin: 0.35rem 1.1rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.series-fold.is-nested > summary {
  padding: 0.55rem 0.85rem;
  font-size: 0.86rem;
}
.series-fold.is-nested[open] > summary { background: #f8fafc; }
.series-delete {
  display: flex;
  justify-content: flex-end;
  padding: 0 1.1rem 1rem;
  background: #f8fafc;
}
.series-create .series-fold { background: #fff; }
.qual-bar.is-sla button { justify-self: start; }
.qual-bar.is-reminder-default { grid-template-columns: minmax(12rem, 20rem) auto; justify-content: start; }
.qual-bar.is-generate { grid-template-columns: auto; justify-content: start; }
.qual-bar.is-invoice-edit { grid-template-columns: minmax(10rem, 1.4fr) 7rem 9rem 9rem auto; }
.qual-bar.is-invoice-mail { grid-template-columns: minmax(14rem, 24rem) auto; justify-content: start; }
.invoice-preview-wrap { padding: 1rem 1.1rem 1.1rem; }
.invoice-preview { width: 100%; height: 40rem; border: 0; background: #fff; }
.billing-nav { padding: 0 0 0.8rem; }
.billing-payer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding: 1rem 1.1rem;
}
.billing-payer h2 { color: var(--text); font-size: 1.15rem; margin: 0.15rem 0; }
.billing-payer .hint { margin: 0; }
.billing-iban {
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.billing-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}
.billing-action .qual-title { flex: 1; padding-bottom: 1rem; }
.billing-action form { margin: 0; padding: 1rem 1.1rem 1rem 0; }
.firm-line { padding: 0.9rem 1.1rem 1rem; }
.task-customer + .task-customer,
.panel + .task-customer,
.panel + .panel { margin-top: 1rem; }
.support-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin: 0 1.25rem;
  padding: 0.7rem 1rem;
  background: #fff4d6;
  border: 1px solid #e6d39a;
  border-radius: 12px;
}
.support-banner p { margin: 0; flex: 1; min-width: 12rem; }
.support-banner form { margin: 0; }
.support-banner button {
  border: 0;
  background: transparent;
  color: var(--blue, #0f4c81);
  font-weight: 700;
  cursor: pointer;
}
.user-head { display: flex; align-items: center; gap: 0.75rem; }
.user-head .avatar { background: var(--blue); }
.role-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(9rem, 1fr));
  gap: 0.7rem 1.25rem;
  padding: 0.95rem 1.1rem 1rem;
}
.role-grid label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-weight: 500;
}
.role-grid input { width: auto; max-width: none; }
.role-matrix-scroll { overflow-x: auto; }
.role-matrix-table { min-width: 52rem; }
.role-matrix-head,
.role-matrix-row {
  display: grid;
  grid-template-columns: minmax(11rem, 1.2fr) repeat(6, minmax(6.6rem, 1fr));
  align-items: center;
}
.role-matrix-head {
  padding: 0.7rem 0.6rem 0.7rem 0;
  background: #f8fafc;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
}
.role-matrix-head span:first-child,
.role-matrix-row .user-head {
  position: sticky;
  left: 0;
  z-index: 1;
  padding-left: 1.1rem;
  background: #fff;
}
.role-matrix-head span:first-child { background: #f8fafc; align-self: stretch; }
.role-matrix-row {
  margin: 0;
  padding: 0.55rem 0.6rem 0.55rem 0;
  border-top: 1px solid var(--line);
}
.role-matrix-row:first-of-type { border-top: 0; }
.role-matrix-row label { display: flex; justify-content: center; margin: 0; }
.role-matrix-row input { width: 1.15rem; height: 1.15rem; }
.qual-bar.is-mail { grid-template-columns: minmax(12rem, 1.5fr) 6.5rem minmax(9rem, 1fr) minmax(9rem, 1fr); }
.qual-bar.is-mail-send { grid-template-columns: minmax(12rem, 24rem) 7rem 7rem auto; justify-content: start; }
.check-head-actions { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.check-index {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  flex-shrink: 0;
}
.qual-bar.is-doc { grid-template-columns: minmax(10rem, 1.3fr) minmax(8rem, 0.9fr) minmax(9rem, 1fr) minmax(11rem, 1.3fr); }
.qual-bar.is-obj { grid-template-columns: minmax(10rem, 1.4fr) minmax(8rem, 0.9fr) minmax(12rem, 1.5fr); }
.qual-bar.is-doc-file { grid-template-columns: 11rem minmax(14rem, 24rem) auto; justify-content: start; }
.qual-bar input[type="file"] {
  font-size: 0.85rem;
  padding: 0.2rem 0.45rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 2.6rem;
}
.qual-bar input[type="file"]::file-selector-button {
  font: 600 0.85rem/1 var(--font);
  margin-right: 0.65rem;
  padding: 0.4rem 0.7rem;
  border: 0;
  border-right: 1px solid var(--line);
  background: #f8fafc;
  color: var(--text);
  cursor: pointer;
}
.absence-nav { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.qual-bar label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}
.qual-bar input,
.qual-bar select { width: 100%; max-width: none; min-width: 0; }
.qual-check,
.qual-bar label.qual-check {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  min-height: 2.6rem;
  color: var(--text);
  font-size: 0.95rem;
  white-space: nowrap;
}
.qual-check input { width: 1rem; height: 1rem; }
.qual-bar button { min-height: 2.6rem; }
.qual-action { width: 1%; text-align: right; white-space: nowrap; }
.qual-action form { display: inline; margin: 0; }
.qual-delete {
  background: transparent;
  color: var(--muted);
  padding: 0.2rem 0;
  font-size: 0.9rem;
}
.qual-delete:hover { color: #9d1c1c; background: transparent; }
.time-person {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem 0.2rem;
}
.time-person h2 { margin: 0; color: var(--text); font-size: 1.05rem; }
th { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.empty { padding: 1rem 1.1rem; }

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  background: #e8eef5;
  color: var(--blue);
}
.badge-planned { background: #e7f1fb; color: var(--blue); }
.badge-progress { background: #e5f8fa; color: #0c7c86; }
.badge-done { background: #e5f6ec; color: #1d7a43; }
.badge-open { background: #fff4d6; color: #8a6200; }
.badge-critical { background: #fde8e8; color: #9b2331; }
.badge-muted { background: #eef1f4; color: var(--muted); }

.filters { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.filters a {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  color: var(--text);
  text-decoration: none;
}
.filters a.is-active { background: var(--blue); color: #fff; border-color: var(--blue); }

.section-nav {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  padding: 0.7rem 1.4rem 0;
}
.section-nav a {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.86rem;
}
.section-nav a.is-active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.placeholder-panel { padding: 1.2rem 1.1rem; margin-bottom: 0.8rem; }
.panel-inline-title {
  margin: 0;
  padding: 0.9rem 1.1rem 0;
  font-size: 0.95rem;
  color: var(--muted);
}
.stack, .task-groups { display: flex; flex-direction: column; gap: 0.8rem; }
.portal-block { padding: 0 1.1rem 1rem; }
.portal-block h3 {
  margin: 0 0 0.55rem;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.portal-list { padding: 0.2rem 1.1rem 0.45rem; }
.portal-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.2rem 1rem;
  align-items: start;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}
.portal-entry:first-child { border-top: 0; }
.portal-entry:hover { text-decoration: none; }
.portal-entry strong {
  display: block;
  color: var(--blue);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}
.portal-entry:hover strong { text-decoration: underline; }
.portal-entry.is-static { cursor: default; }
.portal-entry.is-static strong { color: var(--dark); }
.portal-entry.is-static:hover strong { text-decoration: none; }
.portal-entry .task-meta {
  display: block;
  margin-top: 0.2rem;
  color: #3e5163;
  font-size: 0.9rem;
  line-height: 1.45;
}
.portal-entry > .task-meta {
  margin-top: 0.15rem;
  white-space: nowrap;
}
.portal-entry .badge { margin-top: 0.15rem; }
.portal-note {
  display: block;
  margin: 0.4rem 0 0;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-wrap;
}
.portal-detail { padding: 1.15rem 1.25rem 1.3rem; }
.portal-detail h2 { margin: 0.7rem 0 1rem; color: var(--text); font-size: 1.35rem; line-height: 1.3; }
.portal-detail dd { font-size: 1rem; line-height: 1.45; }
.portal-detail-body {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 1rem;
  line-height: 1.55;
}
.portal-board { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.object-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.85rem 1.1rem 1rem; }
.object-pill {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
}
.object-pill small { color: var(--muted); font-size: 0.78rem; }
a.object-pill { color: inherit; text-decoration: none; }
a.object-pill:hover strong { text-decoration: underline; }
.message-list { list-style: none; margin: 0; padding: 0; }
.message-card { padding: 0.95rem 1.15rem 1.05rem; border-top: 1px solid var(--line); }
.message-card:first-child { border-top: 0; }
.message-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.65rem 1rem;
}
.message-head > div { flex: 1 1 12rem; min-width: 0; }
.message-head strong {
  display: block;
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.35;
}
.message-head a strong { color: var(--blue); }
.message-head a:hover strong { text-decoration: underline; }
.message-head .task-meta { margin-top: 0.2rem; font-size: 0.88rem; line-height: 1.4; }
.message-head .badge { flex-shrink: 0; margin-top: 0.1rem; }
.check-list { list-style: none; margin: 0; padding: 0; }
.check-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.15rem;
  border-top: 1px solid var(--line);
}
.check-row:first-child { border-top: 0; }
.check-row label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.35;
}
.check-row input[type="checkbox"] { width: 1.35rem; height: 1.35rem; flex-shrink: 0; }
.check-row-side { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }
.check-source { margin: 0.75rem 1.15rem 0; }
.doc-hint { margin: 0.35rem 1.1rem 0; }
.check-save { margin: 0; padding: 0.85rem 1.15rem 1rem; }
.task-counts form { display: inline; margin: 0; }
.message-body {
  margin: 0.7rem 0 0;
  padding: 0.75rem 0.85rem;
  background: #f8fafc;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.55;
  white-space: pre-wrap;
}
.access-list { list-style: none; margin: 0; padding: 0; }
.access-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  border-top: 1px solid var(--line);
}
.access-row .task-meta { flex-shrink: 0; }
.access-row form { margin-left: 0; }
.access-row form:last-child { margin-left: auto; }
.access-row .user-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.access-row .user-actions form { margin-left: 0; }
.access-row:has(.check-item-actions),
.access-row:has(.role-row-form) { flex-wrap: wrap; }
.check-item-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  max-width: 100%;
}
.access-row .check-item-actions form { margin-left: 0; }
.access-row .avatar { background: var(--blue); }
.user-main { flex: 1; min-width: 0; }
.access-row > input[type="checkbox"] {
  flex-shrink: 0;
  margin: 0.2rem 0 0;
  align-self: flex-start;
}
.access-row > .badge,
.access-row > a.button { flex-shrink: 0; }
.user-role-list { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.user-roles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.9rem;
  padding: 0.85rem 1.1rem 1rem;
  border-top: 1px solid var(--line);
}
.user-roles-label { font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.role-form select { max-width: 14rem; }
.user-action-buttons { display: flex; align-items: center; gap: 0.4rem; }
.user-action-buttons form { margin: 0; }
.task-customer {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.task-customer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  padding: 0.85rem 1.1rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}
.task-customer-head h2 { margin: 0; font-size: 1.05rem; color: var(--text); font-weight: 700; }
.checklist-field { margin: 1.3rem 0 1.1rem; }
.checklist-field h2 { margin: 0; font-size: 1.05rem; color: var(--text); }
.checklist-field > .hint { margin: 0.2rem 0 0.7rem; }
.checklist-chooser, .checklist-board { display: flex; flex-direction: column; gap: 0.75rem; }
.checklist-chooser > .checklist-card:nth-child(4n+1),
.checklist-board > .edge-card:nth-child(4n+1) { --edge: #2563eb; }
.checklist-chooser > .checklist-card:nth-child(4n+2),
.checklist-board > .edge-card:nth-child(4n+2) { --edge: #16a34a; }
.checklist-chooser > .checklist-card:nth-child(4n+3),
.checklist-board > .edge-card:nth-child(4n+3) { --edge: #ea580c; }
.checklist-chooser > .checklist-card:nth-child(4n+4),
.checklist-board > .edge-card:nth-child(4n+4) { --edge: #7c3aed; }
.form-panel:has(.checklist-chooser) { overflow: visible; }
.edge-card {
  border: 1px solid #e7edf4;
  border-left: 4px solid var(--edge, #2563eb);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(15, 36, 64, 0.06);
}
.edge-card .task-customer-head {
  background: transparent;
  border-bottom: 0;
  padding-bottom: 0.15rem;
}
.checklist-card {
  display: block;
  background: #fff;
  border: 1px solid #e7edf4;
  border-left: 4px solid var(--edge, #2563eb);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(15, 36, 64, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.checklist-card-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.15rem 0.85rem;
  background: transparent;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  cursor: pointer;
}
.checklist-fold summary {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0 1.15rem 0.9rem;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.checklist-fold summary::-webkit-details-marker { display: none; }
.checklist-fold summary::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  margin-top: -0.15rem;
}
.checklist-fold[open] summary::before {
  transform: rotate(45deg);
  margin-top: 0.05rem;
}
.checklist-card .check-list { padding: 0 0 0.7rem; }
.checklist-card .check-row { border-top: 0; padding: 0.4rem 1.15rem; }
.checklist-card input {
  width: 1.2rem;
  height: 1.2rem;
  margin: 0;
  accent-color: var(--edge, #2563eb);
  flex-shrink: 0;
}
.checklist-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(15, 36, 64, 0.09);
}
.checklist-card:focus-within { outline: 2px solid var(--turquoise); outline-offset: 3px; }
.checklist-card:has(input:checked) {
  background: color-mix(in srgb, var(--edge, #2563eb) 8%, #fff);
  border-color: color-mix(in srgb, var(--edge, #2563eb) 22%, #e7edf4);
  border-left-color: var(--edge, #2563eb);
  box-shadow: 0 14px 32px color-mix(in srgb, var(--edge, #2563eb) 18%, transparent);
}
.checklist-card .empty { margin: 0; padding: 0.9rem 1.15rem; }
.checklist-none { margin: 0; }
.checklist-chooser:has(input:checked) .checklist-none { display: none; }
.task-counts { display: flex; gap: 0.4rem; margin: 0; }
.task-counts span {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}
.task-split { display: grid; grid-template-columns: 1fr 1fr; }
.task-col { padding: 0.9rem 1.1rem 1rem; min-width: 0; }
.task-col + .task-col { border-left: 1px solid var(--line); }
.task-col h3 {
  margin: 0 0 0.65rem;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.status-log { list-style: none; margin: 0; padding: 0; }
.status-log li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.75rem 1.15rem;
}
.status-log li + li { border-top: 1px solid var(--line); }
.status-log-move {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
}
.status-log-arrow { color: var(--muted); font-size: 0.85rem; line-height: 1; }
.status-log .person-cell { margin-left: auto; }
.status-log-who {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}
.status-log-who strong { font-size: 0.92rem; }
.status-log-who .task-meta { display: block; }
.task-item { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; }
.task-item > div { min-width: 0; }
.task-item a { font-weight: 600; }
.task-item .badge { flex-shrink: 0; }
.task-meta { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.82rem; }
.task-meta.is-conflict { color: #9b2331; font-weight: 700; }
.task-none { margin: 0; padding: 0; }
.analytics-cards { margin-bottom: 0; }
.card .metric a { color: inherit; text-decoration: none; }
.card .metric a:hover { color: var(--blue); }
.analytics-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.15rem;
  margin: 0;
  padding: 0.85rem 1.15rem 1rem;
}
.analytics-stats > span { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 600; }
.more-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.more-list li {
  border-top: 1px solid var(--line);
  padding: 0.9rem 1.1rem;
}
.more-list li:first-child { border-top: 0; }
.more-list a, .more-list span { display: block; color: var(--text); font-weight: 600; }
.more-list small { display: block; color: var(--muted); margin-top: 0.25rem; font-weight: 400; }
.mobile-nav { display: none; }
.mobile-only { display: none; }
.desktop-only { display: flex; }
.sidebar.desktop-only { display: flex; }

.week {
  display: grid;
  grid-template-columns: repeat(7, minmax(220px, 1fr));
  gap: 0.6rem;
  overflow-x: auto;
  --hour-count: 11;
}
.week.is-employees {
  grid-template-columns: repeat(var(--column-count), minmax(200px, 1fr));
}
.day {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.day h2 { margin: 0 0 0.45rem; font-size: 0.85rem; }
.day-away {
  list-style: none;
  margin: 0 0 0.4rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.day-away li {
  background: #fff4d6;
  border-radius: 6px;
  padding: 0.15rem 0.35rem;
}
.day-away li.is-sick { background: #fde8ea; }
.day-away a {
  display: block;
  color: hsl(var(--person-hue, 210) 58% 26%);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
}
.day-away a:hover { text-decoration: underline; }
.day-away li.is-sick a { color: #9b2331; }
.day-away span {
  display: block;
  color: var(--muted);
  font-weight: 400;
}
.day-away span.is-conflict,
.plan-card span.plan-conflict {
  color: #9b2331;
  font-weight: 700;
}
.plan-card.is-conflict {
  box-shadow: 0 0 0 2px #9b2331;
}
.day.is-today {
  border: 2px solid #0e8f96;
  background: #e7f8f9;
}
.day.is-today .day-track { background: #f3fbfb; }
.day-body {
  display: grid;
  grid-template-columns: 2.6rem 1fr;
  flex: 1;
  min-height: calc(var(--hour-count) * 2.35rem);
}
.day-hours {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin: 0;
  padding-right: 0.3rem;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1;
  text-align: right;
  user-select: none;
}
.day-hours span { transform: translateY(-50%); }
.day-hours span:first-child { transform: none; }
.day-hours span:last-child { transform: translateY(-100%); }
.day-track {
  position: relative;
  min-height: calc(var(--hour-count) * 2.35rem);
  border-radius: 8px;
  background: #fafcfd;
  overflow: hidden;
}
.day-hour-lines {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
  z-index: 0;
}
.day-hour-line {
  border-top: 1px solid #e8eef5;
  height: 0;
}
.day-hour-line:first-child { border-top-color: #d7e0ea; }
.plan-card {
  position: absolute;
  left: var(--lane-left, 0.25rem);
  right: var(--lane-right, 0.25rem);
  width: var(--lane-width, auto);
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.35rem;
  background: hsl(var(--order-hue, 198) 68% 88%);
  border-left: 4px solid hsl(var(--order-hue, 198) 62% 34%);
  border-radius: 8px;
  padding: 0.15rem 0.35rem;
  margin: 0;
  color: var(--text);
  text-decoration: none;
  font-size: 0.78rem;
  box-sizing: border-box;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(15, 76, 129, 0.04);
}
.plan-card span:not(.plan-resize) { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.plan-card span.plan-face {
  display: inline-flex;
  flex: none;
  border-radius: 50%;
  box-shadow: 0 0 0 2px hsl(var(--person-hue, 210) 62% 36%);
}
.plan-card span.plan-crew { display: block; }
.plan-card span.plan-person {
  display: inline;
  color: hsl(var(--person-hue, 210) 58% 26%);
  font-weight: 600;
}
.plan-card span.badge {
  display: inline-block;
  align-self: flex-start;
  width: auto;
  font-size: 0.68rem;
  padding: 0.05rem 0.4rem;
}
.avatar.is-hue { background: hsl(var(--person-hue, 210) 48% 38%); }
.plan-card:hover { text-decoration: none; background: hsl(var(--order-hue, 198) 68% 82%); }
.plan-card { cursor: grab; touch-action: none; }
.week .plan-card { cursor: pointer; touch-action: auto; }
.unplanned-tray { margin-top: 1rem; }
.unplanned-card { cursor: grab; touch-action: none; user-select: none; }
.unplanned-card.is-dragging { cursor: grabbing; opacity: 0.55; }
.plan-card.is-dragging { cursor: grabbing; z-index: 3; opacity: 0.92; }
.capacity td { min-width: 7rem; }
.capacity td strong, .capacity td span { display: block; }
.capacity td span { color: var(--muted); font-size: 0.78rem; }
.capacity td.is-load {
  background: hsl(calc((100 - var(--load)) * 1.2) 62% 86%);
}
.capacity td.is-over {
  background: hsl(0 68% 78%);
}
.capacity td.is-absent {
  background: repeating-linear-gradient(-45deg, #e7ebf0, #e7ebf0 6px, #f7f8fa 6px, #f7f8fa 12px);
}
.plan-resize {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 8px;
  cursor: ns-resize;
}

.form-panel, .detail { padding: 1.1rem; }
form p { margin: 0 0 0.8rem; }
.address-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) 5.5rem 6rem minmax(0, 1.4fr);
  gap: 0.6rem;
  max-width: 40rem;
  margin-bottom: 0.8rem;
}
.address-grid p { margin: 0; }
.address-grid input { max-width: none; }
label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
input, select, textarea {
  width: 100%;
  max-width: 32rem;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  font: 1rem/1.4 var(--font);
  background: #fff;
}
textarea { min-height: 7rem; }
.errorlist { color: #9b2331; padding-left: 1.1rem; }
.status-form, .logout-form, .form-actions { display: flex; gap: 0.6rem; align-items: end; flex-wrap: wrap; margin-top: 1rem; }
.status-form select, .role-form select { width: auto; }
.role-form { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; margin: 0; }
.role-checks { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; border: 0; margin: 0; padding: 0; }
.role-checks legend { font-weight: 600; width: 100%; margin-bottom: 0.25rem; }
.role-checks label { display: flex; align-items: center; gap: 0.35rem; font-weight: 500; margin: 0; }
.role-checks input { width: auto; max-width: none; }
#id_roles { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; }
#id_roles li { margin: 0; }
#id_roles label { display: flex; align-items: center; gap: 0.35rem; font-weight: 500; margin: 0; }
#id_roles input { width: auto; max-width: none; }
dl { display: grid; gap: 0.55rem; }
dt { font-size: 0.8rem; color: var(--muted); }
dd { margin: 0; }

.auth-layout {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(circle at top right, rgba(29, 202, 211, 0.18), transparent 28rem),
    var(--light);
}
.auth-stack { width: min(420px, 100%); }
.legal-card { width: min(40rem, 100%); }
.auth-stack:has(.legal-card) { width: min(40rem, 100%); }
.auth-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 1.6rem;
  border: 1px solid var(--line);
}
.auth-mark { border-radius: 16px; }
.auth-logo { display: block; width: 200px; height: auto; margin: 0.8rem 0; }
.auth-object { margin: 0.4rem 0 0; font-size: 1.35rem; color: var(--dark); }
.lede { color: var(--muted); margin-top: 0; }
.auth-foot { margin-bottom: 0; }
.public-defect p { margin: 0.75rem 0 0; }
.public-defect label { display: block; margin-bottom: 0.3rem; color: var(--muted); font-weight: 700; font-size: 0.85rem; }
.public-defect input,
.public-defect textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font: inherit;
}
.public-defect textarea { min-height: 6rem; resize: vertical; }
.public-defect .errorlist { color: var(--danger); margin: 0.3rem 0 0; padding: 0; list-style: none; font-size: 0.9rem; }
.reporter-photo { margin: 0.6rem 0 0; }
.reporter-photo img {
  display: block;
  max-width: min(100%, 20rem);
  border-radius: 10px;
  border: 1px solid var(--line);
}
.legal-footer {
  margin: 0;
  padding: 0.2rem 1.4rem 1.4rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.legal-footer a { color: inherit; }
.auth-stack .legal-footer { padding: 0.9rem 0 0; text-align: center; }
.legal-doc { padding: 1.2rem 1.3rem 1.4rem; }
.legal-doc h1 { margin: 0 0 0.6rem; font-size: 1.35rem; }
.legal-doc h2 { margin: 1.15rem 0 0.35rem; color: var(--text); font-size: 1.02rem; }
.legal-doc p { max-width: 40rem; }
.auth-card button { margin-top: 0.4rem; }

.dash-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 1.4rem 0.2rem;
}
.dash-head h1 { margin: 0; font-size: 1.7rem; flex: 1; }
.dash-head-actions { display: flex; align-items: center; gap: 0.8rem; }
.bell { color: var(--muted); display: inline-flex; }
.hint-critical { color: #d64545; font-weight: 700; }
.identify-row {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  gap: 1.15rem;
  align-items: center;
  padding: 1rem 1.15rem 1.05rem;
}
.identify-qr {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem;
}
.identify-qr svg { width: 100%; height: auto; display: block; }
.identify-copy { min-width: 0; }
.identify-copy .hint { margin: 0; }
.identify-url { margin: 0.4rem 0 0; color: var(--muted); font-size: 0.82rem; overflow-wrap: anywhere; }
.identify-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.75rem 0 0; }
.identify-actions form { margin: 0; }
.identify-qr img { display: block; width: 100%; height: auto; }
.recovery-codes {
  list-style: none;
  margin: 0;
  padding: 0.35rem 1.15rem 1.1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 12rem));
  gap: 0.45rem 1rem;
}
.recovery-codes code {
  display: block;
  font: 700 0.98rem/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.04em;
  padding: 0.55rem 0.7rem;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.task-customer > .empty,
.task-customer > .hint { margin: 0; padding: 0.9rem 1.15rem; }
.qual-bar.is-object { grid-template-columns: minmax(12rem, 1.2fr) minmax(12rem, 1.6fr); }
.qual-bar.is-address { grid-template-columns: minmax(10rem, 1.6fr) 5rem 6.5rem minmax(8rem, 1.1fr); }
.qual-bar.is-object-save { grid-template-columns: minmax(12rem, 1.5fr) minmax(12rem, 1fr) auto; }
.qual-bar.is-object-save textarea { height: 4.2rem; min-height: 0; }
.qual-bar.is-object-save .photo-thumb { margin-bottom: 0.35rem; }
.qual-bar.is-contact { grid-template-columns: minmax(8rem, 1.2fr) minmax(7rem, 0.8fr) minmax(10rem, 1.2fr); }
.qual-bar.is-asset { grid-template-columns: minmax(10rem, 1.1fr) minmax(12rem, 1.4fr) minmax(8rem, 0.8fr); }
.qual-bar.is-asset-place { grid-template-columns: minmax(12rem, 1.4fr) minmax(8rem, 0.7fr); }
.qual-bar.is-notes { grid-template-columns: 1fr; }
.qual-bar.is-notes textarea { height: 4.2rem; min-height: 0; }
.qual-bar.is-asset-plan { grid-template-columns: minmax(7rem, 0.8fr) minmax(8rem, 1fr) minmax(7rem, 0.8fr) minmax(8rem, 1fr) auto; }
.portal-board .empty, .portal-board .hint { margin: 0; padding: 0 1.1rem 1rem; }
#scan-video { width: calc(100% - 2.3rem); max-height: 16rem; margin: 0 1.15rem 1rem; background: #0f172a; border-radius: 8px; }
#scan-video:not([hidden]) { display: block; }
#scan-status { margin: 0 1.15rem 1rem; }
#nfc-status { margin: 0.55rem 0 0; }
.task-customer > .identify-actions { padding: 0 1.15rem 1rem; }
a.card { display: block; color: inherit; text-decoration: none; }
a.card-body { display: block; color: inherit; text-decoration: none; }
a.card:hover, .card:has(a.card-body:hover) { border-color: var(--blue); }
a.hint-critical:hover { text-decoration: underline; }
.card-spark { position: relative; }
.spark { position: absolute; right: 0.8rem; bottom: 0.7rem; width: 7.5rem; height: 2.2rem; }
.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 0.9rem;
}
.dash-panel { display: flex; flex-direction: column; min-height: 320px; }
.panel-head h2 { color: var(--text); font-size: 1rem; }
.week-nav { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.week-nav a { margin: 0 0.45rem; }
.absence-board { margin-bottom: 0.9rem; padding-bottom: 0.9rem; }
.absence-cal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0 1rem 0.2rem;
}
.absence-day .week-no {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  color: #9b2331;
}
.absence-head { font-size: 0.75rem; color: var(--muted); font-weight: 700; padding: 0 0.2rem; }
.absence-day {
  min-height: 4.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.3rem 0.35rem;
  background: #fff;
  font-size: 0.72rem;
}
.absence-day strong { display: block; margin-bottom: 0.15rem; }
.absence-day span, .absence-day a { display: block; line-height: 1.25; text-decoration: none; }
.absence-day a { color: var(--blue); }
.absence-person {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
}
.absence-person span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.absence-day a.is-sick { color: #9b2331; }
.person-cell { display: flex; align-items: center; gap: 0.55rem; }
.absence-day.is-muted { background: #f7f9fb; color: #9aa6b2; }
.absence-day.is-today {
  border: 2px solid #0e8f96;
  background: #e7f8f9;
}
.today-mark {
  font-size: 0.68rem;
  font-weight: 700;
  color: #0e8f96;
  vertical-align: middle;
}
.absence-day .today-mark { display: inline; }
.absence-day.is-busy { background: #fff4d6; border-color: #e0a000; }
.order-list { list-style: none; margin: 0; padding: 0.2rem 0 0; }
.order-list a,
.order-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem 1.1rem;
  border-top: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}
.order-list a:hover { background: #f8fbfd; text-decoration: none; }
.order-copy { flex: 1; min-width: 0; }
.order-list strong, .chip strong, .order-copy strong, .plan-card strong { display: block; }
.order-list small, .chip small, .order-copy small { display: block; color: var(--muted); font-size: 0.78rem; }
.panel-foot { margin-top: auto; padding: 0.8rem 1.1rem 1rem; }
.panel-foot a { font-weight: 600; }
.mini-week {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.2rem 0.7rem 0.4rem;
}
.mini-day h3 { margin: 0 0 0.35rem; font-size: 0.75rem; color: var(--muted); font-weight: 600; }
.chip {
  display: flex;
  gap: 0.35rem;
  align-items: flex-start;
  border-radius: 8px;
  padding: 0.35rem;
  margin-bottom: 0.35rem;
  text-decoration: none;
  color: inherit;
  font-size: 0.72rem;
}
.chip:hover { text-decoration: none; filter: brightness(0.97); }
.chip-mint { background: #e5f6ec; }
.chip-sand { background: #fff4d6; }
.chip-lilac { background: #efe7fb; }
.chip-sky { background: #e7f1fb; }

.photo-thumb {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  background: #e8eef5;
}
.photo-cell { width: 3rem; }

@media (max-width: 1100px) {
  .cards, .dash-grid, .analytics-cards { grid-template-columns: 1fr 1fr; }
  .mini-week { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .desktop-only,
  .sidebar.desktop-only { display: none !important; }
  .mobile-only { display: flex; }
  .shell { margin-left: 0; padding-bottom: 4.5rem; }
  .cards, .health-cards, .dash-grid, .mini-week, .address-grid, .analytics-cards, .field-pair, .employee-layout, .employee-overview, .task-split, .portal-board, .qual-bar.is-portal, .qual-bar.is-portal-ticket, .qual-bar.is-name, .qual-bar.is-check, .qual-bar.is-check-area, .qual-bar.is-area, .qual-bar.is-article, .qual-bar.is-material, .qual-bar.is-doc, .qual-bar.is-doc-file, .qual-bar.is-obj, .qual-bar.is-mail, .qual-bar.is-mail-send, .qual-bar.is-user, .qual-bar.is-firm, .qual-bar.is-object, .qual-bar.is-address, .qual-bar.is-object-save, .qual-bar.is-contact, .qual-bar.is-asset, .qual-bar.is-asset-place, .qual-bar.is-asset-plan, .qual-bar.is-support, .qual-bar.is-abo, .qual-bar.is-firm-register, .qual-bar.is-platform-invoice, .qual-bar.is-billing-address, .qual-bar.is-billing-iban, .qual-bar.is-generate, .qual-bar.is-invoice-edit, .qual-bar.is-invoice-mail, .qual-bar.is-reminder, .qual-bar.is-reminder-default, .qual-bar.is-ticket-template, .qual-bar.is-sla, .qual-bar.is-recur, .qual-bar.is-recur-when, .qual-bar.is-notice-template, .qual-bar.is-notice-pref, .qual-bar.is-quiet, .qual-bar.is-invoice-line, .qual-bar.is-message { grid-template-columns: 1fr; }
  .identify-row { grid-template-columns: 1fr; justify-items: start; }
  .recovery-codes { grid-template-columns: 1fr; }
  .task-col + .task-col { border-left: 0; border-top: 1px solid var(--line); }
  .status-log li { align-items: flex-start; flex-direction: column; }
  .status-log .person-cell { margin-left: 0; }
  .billing-payer, .billing-action { flex-direction: column; align-items: stretch; }
  .billing-iban { white-space: normal; }
  .billing-action form { padding: 0 1.1rem 1rem; }
  .access-row .user-actions { width: 100%; margin-left: 0; flex-wrap: wrap; }
  .role-grid { grid-template-columns: 1fr 1fr; }
  .role-matrix-row .user-head { box-shadow: 2.75rem 0 0 #fff; }
  .role-matrix-head span:first-child { box-shadow: 2.75rem 0 0 #f8fafc; }
  .access-row .user-actions .role-form { flex: 1 1 100%; min-width: 0; }
  .access-row .user-actions .role-form select { width: 100%; max-width: none; }
  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    background: #102033;
    border-top: 1px solid #1d3654;
    padding: 0.35rem 0.2rem calc(0.35rem + env(safe-area-inset-bottom));
  }
  .mobile-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #b7c3d1;
    text-decoration: none;
    font-size: 0.68rem;
    line-height: 1.15;
    padding: 0.45rem 0.2rem;
    border-radius: 8px;
  }
  .mobile-nav.is-portal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mobile-nav a.is-active {
    color: #fff;
    background: #1d6fa8;
  }
  .section-nav.mobile-only {
    display: flex;
    overflow-x: auto;
    padding-bottom: 0.2rem;
  }
}
