:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-soft: #eef3f7;
  --ink: #17212b;
  --muted: #5f6e7d;
  --line: #dbe2ea;
  --brand: #0f766e;
  --brand-strong: #115e59;
  --accent: #c2410c;
  --success: #15803d;
  --warning: #b45309;
  --danger: #b91c1c;
  --shadow: 0 18px 45px rgba(22, 33, 43, 0.11);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.08), transparent 340px),
    var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 18px;
  align-items: center;
  padding: 16px clamp(18px, 3vw, 36px);
  background: rgba(246, 247, 249, 0.88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(219, 226, 234, 0.78);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  color: white;
  background: var(--brand);
  border-radius: 8px;
  font-weight: 800;
  letter-spacing: 0;
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: white;
}

.brand-mark.small-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  font-size: 0.78rem;
}

.brand-mark.company-logo {
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
}

.brand h1 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.1;
}

.brand p,
.small,
.muted {
  color: var(--muted);
}

.brand p {
  margin: 3px 0 0;
  font-size: 0.86rem;
}

.powered-by {
  display: block;
  margin-top: 2px;
  color: #6b7a8a;
  font-size: 0.76rem;
  font-weight: 700;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
}

.tab.active {
  color: var(--button-text, white);
  background: var(--brand);
}

.mobile-menu-button {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  color: #213142;
  background: #e9eef4;
  border-radius: 8px;
  font-weight: 800;
}

.mobile-menu-button:hover {
  background: #dde6ef;
}

.workspace-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 4px;
  margin-bottom: 18px;
  background: #eef3f7;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.workspace-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  color: #435363;
  background: transparent;
  border-radius: 7px;
  font-weight: 700;
}

.workspace-tab.active {
  color: var(--button-text, white);
  background: var(--brand);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

.profile-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 2px 6px 2px 2px;
  color: inherit;
  background: transparent;
  border-radius: 10px;
  text-align: left;
}

.profile-button:hover {
  background: #e8eef4;
}

.profile-button strong {
  color: var(--ink);
}

.profile-button .small {
  color: var(--muted);
}

.company-switcher {
  min-height: 38px;
  max-width: 220px;
  padding: 0 10px;
  border: 1px solid #cbd5df;
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

.company-preview {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: white;
  background: #334155;
  font-weight: 700;
}

.profile-modal {
  width: min(620px, 100%);
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.profile-head strong,
.profile-head span:not(.avatar) {
  display: block;
}

.profile-avatar {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  font-size: 1rem;
}

.readonly-field input {
  color: #475569;
  background: #f8fafc;
}

.container {
  width: min(1240px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 26px 0 42px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 440px);
  align-items: center;
  gap: clamp(28px, 6vw, 82px);
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.login-intro h1 {
  margin: 0 0 18px;
  max-width: 780px;
  font-size: clamp(2.4rem, 6vw, 5.4rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.login-intro p {
  max-width: 640px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.login-panel,
.panel,
.modal-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-panel {
  padding: 24px;
}

.login-panel h2,
.panel h2,
.modal-panel h2 {
  margin: 0;
  font-size: 1.15rem;
}

.panel h3 {
  margin: 0;
  font-size: 0.98rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.modal-entry-form {
  gap: 12px;
}

.form-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.form-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.form-section-header h3 {
  margin: 0;
  font-size: 0.95rem;
}

.form-section-header p {
  margin: 0;
  font-size: 0.8rem;
}

.form-section-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}

.work-schedule-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(58px, 1fr));
  gap: 8px;
}

.work-schedule-section .form-section-header strong {
  white-space: nowrap;
  color: var(--brand);
  font-size: 0.9rem;
}

.work-schedule-grid .field {
  gap: 5px;
}

.work-schedule-grid .field label {
  text-align: center;
}

.work-schedule-grid .field input {
  min-height: 38px;
  padding: 7px 8px;
  text-align: right;
}

.field {
  display: grid;
  gap: 7px;
}

.field label,
.field-label {
  color: #3d4a58;
  font-size: 0.82rem;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cbd5df;
  border-radius: 8px;
  outline: none;
}

.field input[readonly] {
  color: #344455;
  background: #eef3f7;
}

.field textarea {
  min-height: 86px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}

.time-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: center;
}

.time-control .icon-btn {
  width: 38px;
  height: 42px;
}

.col-2 {
  grid-column: span 2;
}

.col-3 {
  grid-column: span 3;
}

.col-4 {
  grid-column: span 4;
}

.col-5 {
  grid-column: span 5;
}

.col-6 {
  grid-column: span 6;
}

.col-7 {
  grid-column: span 7;
}

.col-8 {
  grid-column: span 8;
}

.col-12 {
  grid-column: span 12;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.actions .hint {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 13px;
  border-radius: 8px;
  color: var(--button-text, white);
  background: var(--brand);
  font-weight: 700;
}

.btn:hover {
  background: var(--brand-strong);
}

.btn.secondary {
  color: var(--ink);
  background: #e9eef4;
}

.btn.secondary:hover {
  background: #dde6ef;
}

.btn.ghost {
  color: var(--brand-strong);
  background: transparent;
}

.btn.danger {
  background: var(--danger);
}

.btn.warning {
  background: var(--warning);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.day-layout {
  display: flex;
  flex-direction: column;
}

.day-summary-grid {
  order: 1;
}

.day-workflow {
  order: 2;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.55fr);
  gap: 18px;
  align-items: start;
}

.planning-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 18px;
  align-items: start;
}

.relations-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.72fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 18px;
}

.edit-panel {
  position: sticky;
  top: 92px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-header.compact {
  margin-top: 18px;
}

.panel-header p {
  margin: 5px 0 0;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  padding: 15px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 1.7rem;
}

.entry-plan-field select {
  font-weight: 750;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
  background: white;
}

.review-table {
  min-width: 0;
  table-layout: fixed;
  font-size: 0.84rem;
  line-height: 1.24;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: #465564;
  background: #f0f4f8;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sort-head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
}

.sort-head:hover {
  color: var(--brand);
}

.sort-indicator {
  font-size: 0.68rem;
  line-height: 1;
}

.check-select {
  position: relative;
}

.check-select summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: #213142;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: default;
  list-style: none;
}

.check-select summary::-webkit-details-marker {
  display: none;
}

.check-select summary svg {
  flex: 0 0 auto;
  transform: rotate(90deg);
  color: #64748b;
}

.check-select[open] summary {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.check-select[open] summary svg {
  transform: rotate(-90deg);
}

.check-select summary.disabled {
  color: #64748b;
  background: #f8fafc;
  cursor: not-allowed;
}

.check-select-menu {
  position: absolute;
  z-index: 35;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  max-height: 260px;
  overflow: hidden;
  padding: 5px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.check-select-options {
  display: grid;
  gap: 1px;
  min-height: 0;
  max-height: 210px;
  overflow: auto;
  padding-right: 2px;
}

.check-option {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 23px;
  padding: 2px 6px;
  border-radius: 6px;
  color: #213142;
  font-size: 0.78rem;
  font-weight: 650;
}

.check-option:hover {
  background: #f1f5f9;
}

.check-option input {
  width: 13px;
  height: 13px;
  accent-color: var(--brand);
}

.check-select-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 4px;
  padding: 6px 2px 0;
  background: white;
  border-top: 1px solid var(--line);
}

.check-select-actions .btn {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 0.76rem;
}

.select-col {
  width: 44px;
  text-align: center;
}

.selectable-table input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--brand);
}

.selected-row {
  background: #f0fdfa;
}

.workorder-group-row td {
  padding: 7px 8px;
  background: #eef6f5;
  border-top: 1px solid rgba(15, 118, 110, 0.22);
  border-bottom: 1px solid rgba(15, 118, 110, 0.22);
}

.workorder-group-end-row td {
  height: 10px;
  padding: 0;
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.12), rgba(248, 250, 252, 0.9));
  border-top: 2px solid rgba(15, 118, 110, 0.34);
  border-bottom: 1px solid var(--line);
}

.workorder-group-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.workorder-group-toggle {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 7px 8px;
  color: #17212b;
  text-align: left;
  background: transparent;
  border: 0;
}

.workorder-group-toggle:hover {
  background: rgba(15, 118, 110, 0.08);
}

.group-open-btn {
  background: white;
  border-color: rgba(15, 118, 110, 0.28);
}

.group-arrow {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: var(--brand);
  transition: transform 0.16s ease;
}

.group-arrow.open {
  transform: rotate(90deg);
}

.group-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.group-main strong,
.group-main span,
.group-meta,
.group-status {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-main span,
.group-status {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.group-meta {
  color: #213142;
  font-size: 0.82rem;
  font-weight: 800;
}

.group-status {
  text-align: right;
}

.review-table th,
.review-table td {
  padding: 6px 7px;
  overflow-wrap: anywhere;
}

.review-table th {
  font-size: 0.7rem;
  letter-spacing: 0.03em;
}

.review-table th:last-child,
.review-table td:last-child {
  width: 126px;
}

.review-table .select-col {
  width: 38px;
}

.datetime-cell {
  white-space: nowrap;
}

.datetime-cell strong {
  font-size: 0.84rem;
}

.review-table .small {
  font-size: 0.73rem;
  line-height: 1.2;
}

.overview-table {
  min-width: 920px;
  table-layout: fixed;
}

.overview-table th,
.overview-table td {
  overflow-wrap: anywhere;
}

.overview-table th:nth-child(1),
.overview-table td:nth-child(1) {
  width: 104px;
}

.overview-table th:nth-child(2),
.overview-table td:nth-child(2) {
  width: 188px;
}

.overview-table th:nth-child(6),
.overview-table td:nth-child(6) {
  width: 72px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.overview-table th:nth-child(6) .sort-head,
.employee-day-table th:nth-child(n + 3) .sort-head {
  justify-content: flex-end;
  width: 100%;
}

.overview-table th:last-child,
.overview-table td:last-child {
  width: 70px;
}

.employee-day-overview {
  margin: 12px 0 18px;
}

.report-panel {
  display: grid;
  gap: 16px;
}

.report-summary-grid {
  margin-bottom: 2px;
}

.employee-day-table {
  min-width: 1040px;
  table-layout: fixed;
}

.employee-day-table th:nth-child(1),
.employee-day-table td:nth-child(1) {
  width: 132px;
}

.employee-day-table th:nth-child(2),
.employee-day-table td:nth-child(2) {
  width: 170px;
}

.employee-day-table th:nth-child(n + 3),
.employee-day-table td:nth-child(n + 3) {
  width: 96px;
  text-align: right;
}

.employee-day-table th:nth-child(5),
.employee-day-table td:nth-child(5) {
  width: 132px;
}

.numeric-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.overtime-cell {
  color: var(--warning);
  font-weight: 800;
}

.planning-list-table {
  min-width: 900px;
  table-layout: fixed;
}

.planning-list-table th:nth-child(1),
.planning-list-table td:nth-child(1) {
  width: 104px;
}

.planning-list-table th:nth-child(2),
.planning-list-table td:nth-child(2) {
  width: 188px;
}

.planning-list-table th:nth-child(5),
.planning-list-table td:nth-child(5) {
  width: 72px;
}

.planning-list-table th:last-child,
.planning-list-table td:last-child {
  width: 132px;
}

.workorder-table th:nth-child(6),
.workorder-table td:nth-child(6),
.workorder-table th:nth-child(7),
.workorder-table td:nth-child(7) {
  text-align: right;
  white-space: nowrap;
}

.workorder-table th:nth-child(6) .sort-head,
.workorder-table th:nth-child(7) .sort-head {
  justify-content: flex-end;
  width: 100%;
}

.workorder-table th:last-child,
.workorder-table td:last-child {
  width: 166px;
}

.trips-table {
  min-width: 940px;
}

.trips-table .trip-time-cell,
.trips-table .trip-distance-cell,
.trips-table .trip-source-cell {
  white-space: nowrap;
}

.trips-table th:last-child,
.trips-table td:last-child {
  width: 92px;
}

.overview-table .datetime-cell,
.planning-list-table .datetime-cell {
  white-space: normal;
}

.overview-table .datetime-cell strong,
.planning-list-table .datetime-cell strong {
  white-space: nowrap;
}

.overview-kind {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.overview-kind.planned {
  color: #854d0e;
  background: #fef3c7;
}

.overview-kind.executed {
  color: #166534;
  background: #dcfce7;
}

.relation-total-overview {
  margin-top: 18px;
  padding-top: 2px;
  border-top: 1px solid var(--line);
}

.mini-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.mini-metrics span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 0 9px;
  color: #334155;
  background: #f1f5f9;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.82rem;
}

.relations-table {
  min-width: 0;
  table-layout: fixed;
}

.management-table {
  min-width: 860px;
  table-layout: fixed;
}

.users-table th:nth-child(1),
.users-table td:nth-child(1) {
  width: 24%;
}

.users-table th:nth-child(2),
.users-table td:nth-child(2) {
  width: 24%;
}

.users-table th:nth-child(5),
.users-table td:nth-child(5) {
  width: 18%;
}

.companies-table th:nth-child(1),
.companies-table td:nth-child(1),
.hour-types-table th:nth-child(2),
.hour-types-table td:nth-child(2),
.statuses-table th:nth-child(1),
.statuses-table td:nth-child(1) {
  width: 26%;
}

.assignments-table th:nth-child(1),
.assignments-table td:nth-child(1) {
  width: 28%;
}

.assignments-table th:nth-child(2),
.assignments-table td:nth-child(2) {
  width: 22%;
}

.management-table .type-meta {
  min-width: 0;
}

.compact-cell {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.compact-cell strong,
.compact-cell span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-cell span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.relations-table th:nth-child(1),
.relations-table td:nth-child(1) {
  width: 22%;
}

.relations-table th:nth-child(4),
.relations-table td:nth-child(4) {
  width: 112px;
  white-space: nowrap;
}

.relations-table th:nth-child(5),
.relations-table td:nth-child(5) {
  width: 116px;
}

.relations-table th:nth-child(6),
.relations-table td:nth-child(6) {
  width: 86px;
}

.relations-table th:last-child,
.relations-table td:last-child {
  width: 92px;
  white-space: nowrap;
}

.editable-list-row,
.type-item[data-edit-action] {
  cursor: default;
}

.editable-list-row:hover,
.type-item[data-edit-action]:hover {
  background: #f8fbff;
}

.relations-table .compact-actions {
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 8px;
}

.relation-list-view {
  display: grid;
  gap: 14px;
}

.relation-list-panel.wide .field {
  max-width: 560px;
}

.relation-card-view {
  display: grid;
  gap: 16px;
}

.relation-card-header {
  align-items: flex-start;
}

.relation-card-sections {
  display: grid;
  gap: 18px;
}

.relation-card-section {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.review-table .status,
.review-table .type-pill {
  min-height: 22px;
  gap: 5px;
  padding: 0 6px;
  font-size: 0.72rem;
}

.review-table .type-dot {
  width: 7px;
  height: 7px;
}

.actions-cell {
  width: 138px;
}

tbody tr:hover {
  background: #fafcff;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.status,
.type-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}

.status.draft {
  color: #475569;
  background: #e2e8f0;
}

.status.submitted {
  color: #854d0e;
  background: #fef3c7;
}

.status.validated {
  color: #166534;
  background: #dcfce7;
}

.status.returned {
  color: #991b1b;
  background: #fee2e2;
}

.status.billed {
  color: #1e3a8a;
  background: #dbeafe;
}

.type-pill {
  color: #20303f;
  background: #e9eef4;
}

.type-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
}

.row-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.compact-actions {
  flex-wrap: wrap;
  gap: 4px;
}

.compact-actions .icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.bulk-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bulk-actions select {
  min-height: 38px;
  min-width: 170px;
}

.status-flow {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin: 0 0 14px;
  overflow-x: auto;
  padding: 2px 0 6px;
}

.status-flow-step {
  display: grid;
  gap: 4px;
  min-width: 130px;
  padding: 9px 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.status-flow-step.current {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
  background: #eef6f5;
}

.status-flow-step.done {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.status-flow-step.upcoming {
  opacity: 0.72;
}

.status-flow-step strong {
  font-size: 1.25rem;
  line-height: 1;
}

.status-flow-step small {
  color: var(--muted);
  font-size: 0.72rem;
}

.status-flow-arrow {
  display: grid;
  place-items: center;
  color: #64748b;
  min-width: 22px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #334155;
  background: #edf2f7;
}

.icon-btn:hover {
  background: #dce6ef;
}

.icon-btn.danger-icon {
  color: #7f1d1d;
  background: #fee2e2;
}

.icon-btn.danger-icon:hover {
  background: #fecaca;
}

.hint {
  padding: 12px;
  color: #3d4a58;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  line-height: 1.55;
}

.planned-strip {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.signature-field {
  gap: 10px;
}

.signature-pad {
  width: 100%;
  height: 150px;
  display: block;
  background: #fff;
  border: 1px solid #cbd5df;
  border-radius: 8px;
  touch-action: none;
}

.notice {
  display: none;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.notice.show {
  display: block;
}

.notice.error {
  color: #7f1d1d;
  background: #fee2e2;
  border-color: #fecaca;
}

.notice.ok {
  color: #14532d;
  background: #dcfce7;
  border-color: #bbf7d0;
}

#noticeHost {
  position: fixed;
  z-index: 90;
  top: 18px;
  right: 18px;
  width: min(420px, calc(100vw - 36px));
  pointer-events: none;
}

#noticeHost .notice {
  margin-bottom: 0;
  pointer-events: auto;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14);
}

.empty-state {
  padding: 30px 18px;
  text-align: center;
  color: var(--muted);
}

.map-panel {
  min-height: 260px;
  display: grid;
  place-items: center;
  padding: 18px;
  color: #24313f;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.12) 1px, transparent 1px),
    linear-gradient(0deg, rgba(15, 118, 110, 0.12) 1px, transparent 1px),
    #eef7f6;
  background-size: 32px 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.route-card {
  width: min(420px, 100%);
  padding: 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(203, 213, 225, 0.8);
  border-radius: 8px;
}

.route-card strong {
  display: block;
  font-size: 2rem;
  margin: 8px 0;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.45);
}

.modal.show {
  display: grid;
}

.modal-panel {
  width: min(820px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 18px;
}

.management-modal {
  width: min(940px, 100%);
}

.workorder-modal {
  width: min(1180px, 100%);
}

.relation-modal {
  width: min(1180px, 100%);
}

.modal-card-view .relation-card-sections {
  gap: 16px;
}

.receipt-modal {
  width: min(900px, 100%);
}

.workorder-card {
  display: grid;
  gap: 16px;
}

.workorder-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.workorder-section .panel-header {
  margin-bottom: 0;
}

.workorder-context {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #eef6f5;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 8px;
}

.workorder-context strong,
.workorder-context span:not(.status) {
  display: block;
}

.workorder-execution-context {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.workorder-execution-context h3 {
  margin: 2px 0 4px;
  font-size: 1.05rem;
}

.workorder-execution-context p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.context-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.compact-link {
  min-height: 34px;
  padding: 7px 10px;
}

.workorder-execution-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.workorder-execution-actions span {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.inline-check-field label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
  color: #213142;
}

.signature-toggle-field label {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 9px 11px;
  color: #213142;
  background: #fff;
  border: 1px solid #cbd5df;
  border-radius: 8px;
  cursor: pointer;
}

.signature-toggle-field label:hover {
  border-color: color-mix(in srgb, var(--brand) 34%, #cbd5df);
  background: #f8fafc;
}

.signature-toggle-icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--brand);
  background: #eef6f5;
  border-radius: 8px;
}

.signature-toggle-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.signature-toggle-copy strong {
  overflow: hidden;
  font-size: 0.84rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signature-toggle-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signature-toggle-field input[type="checkbox"] {
  appearance: none;
  position: relative;
  width: 42px;
  height: 24px;
  min-height: 24px;
  margin: 0;
  padding: 0;
  background: #cbd5df;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s ease;
}

.signature-toggle-field input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.24);
  transition: transform 0.18s ease;
}

.signature-toggle-field input[type="checkbox"]:checked {
  background: var(--brand);
}

.signature-toggle-field input[type="checkbox"]:checked::after {
  transform: translateX(18px);
}

.signature-toggle-field input[type="checkbox"]:focus-visible {
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}

.entry-workorder-field select {
  font-weight: 750;
}

.workorder-ribbons {
  display: grid;
  gap: 10px;
}

.workorder-ribbon {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.workorder-ribbon summary {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(120px, auto);
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
  background: #f8fafc;
}

.workorder-ribbon summary::-webkit-details-marker,
.compact-checklist summary::-webkit-details-marker {
  display: none;
}

.workorder-ribbon summary span,
.workorder-ribbon summary strong,
.workorder-ribbon summary small {
  min-width: 0;
}

.workorder-ribbon summary span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #213142;
  font-weight: 800;
}

.workorder-ribbon summary strong {
  color: #17212b;
  font-size: 0.9rem;
  text-align: right;
}

.workorder-ribbon summary small {
  color: var(--muted);
  font-weight: 700;
  text-align: right;
}

.workorder-ribbon-body,
.workorder-ribbon > .form-section-grid,
.workorder-ribbon > form {
  padding: 12px;
}

.workorder-inline-form {
  margin-bottom: 10px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.execution-entry-form {
  gap: 12px;
  background: #ffffff;
  border-color: rgba(15, 118, 110, 0.28);
}

.execution-entry-intro {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  color: #213142;
  background: #eef6f5;
  border: 1px solid rgba(15, 118, 110, 0.2);
  border-radius: 8px;
}

.execution-entry-intro strong,
.entry-form-timer-panel strong {
  font-size: 0.94rem;
}

.execution-entry-intro span,
.entry-form-timer-panel span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.entry-form-timer-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: #f1f5f9;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.entry-form-timer-panel.running {
  color: #064e3b;
  background: #ecfdf5;
  border-color: rgba(21, 128, 61, 0.26);
}

.entry-form-timer-panel .actions {
  justify-content: flex-end;
}

.execution-product-count {
  display: none;
}

.execution-entry-ribbon summary small {
  display: none;
}

.execution-product-ribbon summary > strong:not(.execution-product-count) {
  display: none;
}

.execution-product-ribbon .execution-product-count {
  display: block;
}

.product-total-field {
  display: grid;
  align-content: center;
  min-height: 42px;
  padding: 7px 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.product-total-field strong {
  color: #17212b;
  font-size: 1rem;
}

.compact-status-field select {
  min-height: 38px;
  font-size: 0.86rem;
  font-weight: 800;
}

.form-check-select-wrap {
  min-width: 0;
}

.form-check-select-wrap,
.form-check-select {
  width: 100%;
}

.form-check-select .check-select-menu {
  z-index: 60;
}

.compact-checklist {
  position: relative;
}

.compact-checklist summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #213142;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.compact-checklist[open] summary {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.compact-checklist .employee-check-grid {
  margin-top: 6px;
}

.compact-tabs {
  margin-bottom: 14px;
}

.day-workorder-list {
  display: grid;
  gap: 10px;
}

.day-workorder-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.day-workorder-card h3 {
  margin: 6px 0 2px;
  font-size: 1rem;
}

.day-workorder-card p {
  margin: 0 0 4px;
  color: #334155;
  font-size: 0.9rem;
  font-weight: 700;
}

.day-workorder-meta {
  display: grid;
  justify-items: center;
  min-width: 74px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.day-workorder-card .actions {
  grid-column: 1 / -1;
  justify-content: flex-start;
}

.day-pending-workorders {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.mini-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #213142;
  font-size: 0.82rem;
  font-weight: 800;
}

.mini-section-title span {
  display: inline-grid;
  min-width: 26px;
  height: 24px;
  place-items: center;
  color: var(--brand);
  background: #eef6f5;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 999px;
}

.day-pending-workorder-list {
  display: grid;
  gap: 7px;
}

.day-pending-workorder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 9px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.day-pending-workorder > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.day-pending-workorder strong,
.day-pending-workorder span:not(.status) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-pending-workorder span:not(.status) {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.employee-check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 42px;
  align-items: center;
  padding: 6px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.inline-check {
  min-height: 26px;
  padding: 3px 7px;
}

.compact-form {
  gap: 10px;
}

.receipt-paper-preview {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.receipt-paper-head,
.receipt-company,
.receipt-bottom-grid,
.receipt-signature-meta {
  display: flex;
  align-items: center;
}

.receipt-paper-head {
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.receipt-company {
  gap: 12px;
  min-width: 0;
}

.receipt-company strong,
.receipt-company span,
.receipt-paper-title strong,
.receipt-paper-title small,
.receipt-card-grid span,
.receipt-line-items span {
  display: block;
}

.receipt-logo {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  color: var(--button-text, white);
  background: var(--brand);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  font-weight: 900;
}

.receipt-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: white;
}

.receipt-paper-title {
  text-align: right;
}

.receipt-paper-title span {
  color: var(--brand);
  font-weight: 900;
  text-transform: uppercase;
}

.receipt-card-grid,
.receipt-line-items {
  display: grid;
  gap: 10px;
}

.receipt-card-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.receipt-line-items {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.receipt-card-grid > div,
.receipt-line-items > div,
.receipt-note-box,
.receipt-signature-box {
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.receipt-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.72fr);
  gap: 10px;
  align-items: stretch;
}

.receipt-note-box p {
  margin: 6px 0 0;
  line-height: 1.55;
}

.receipt-signature-box {
  display: grid;
  gap: 8px;
}

.receipt-signature-frame {
  display: grid;
  place-items: center;
  min-height: 104px;
  background: white;
  border: 1px dashed #cbd5df;
  border-radius: 8px;
}

.receipt-signature-frame img {
  width: 100%;
  max-height: 96px;
  object-fit: contain;
}

.receipt-signature-meta {
  justify-content: space-between;
  gap: 8px;
}

.receipt-summary,
.receipt-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.receipt-summary > div,
.receipt-preview > div {
  padding: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.receipt-summary strong,
.receipt-preview strong {
  display: block;
  margin-top: 4px;
}

.receipt-status .notice {
  display: block;
  margin: 0;
}

.right {
  text-align: right;
}

.login-shortcuts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.shortcut {
  padding: 10px;
  min-height: 54px;
  text-align: left;
  color: #213142;
  background: #eef3f7;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.shortcut strong {
  display: block;
}

.password-reset-panel {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.password-reset-panel summary {
  cursor: pointer;
  color: var(--brand);
  font-weight: 800;
}

.password-reset-panel .form-grid {
  margin-top: 12px;
}

.small {
  font-size: 0.84rem;
}

.inline-edit {
  min-width: 96px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
  align-items: end;
}

.planning-filters {
  margin-bottom: 14px;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 14px;
}

.calendar-toolbar strong {
  min-width: 190px;
  text-align: center;
  text-transform: capitalize;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: white;
}

.calendar-weekday {
  min-height: 36px;
  padding: 10px;
  color: #465564;
  background: #f0f4f8;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.calendar-weekday:nth-child(7) {
  border-right: 0;
}

.calendar-day {
  position: relative;
  min-height: 112px;
  padding: 6px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.calendar-day:hover,
.calendar-day:focus,
.calendar-day.drag-over {
  background: #f0fdfa;
  box-shadow: inset 0 0 0 2px rgba(15, 118, 110, 0.28);
  outline: none;
}

.calendar-day::after {
  content: "+ Planning";
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 3;
  padding: 3px 6px;
  color: var(--brand);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 118, 110, 0.2);
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
}

.calendar-day:hover::after,
.calendar-day:focus::after,
.calendar-day.drag-over::after {
  opacity: 1;
}

.calendar-day.drag-over::after {
  content: "Verplaats hier";
}

.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-day.outside-month {
  background: #f8fafc;
  color: #94a3b8;
}

.calendar-day.today {
  box-shadow: inset 0 0 0 2px var(--brand);
}

.calendar-date {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-weight: 800;
}

.calendar-items {
  display: grid;
  gap: 6px;
  padding-bottom: 24px;
}

.calendar-item-wrap {
  position: relative;
  display: grid;
}

.calendar-item {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 6px;
  border-radius: 7px;
  text-align: left;
  line-height: 1.25;
  border: 1px solid transparent;
}

.calendar-item span {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.calendar-item strong {
  font-size: 0.8rem;
}

.calendar-item small {
  font-size: 0.72rem;
}

.calendar-item strong,
.calendar-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-item.planned {
  color: #134e4a;
  background: #ccfbf1;
  border-color: #99f6e4;
}

.calendar-item.done {
  color: #166534;
  background: #dcfce7;
  border-color: #bbf7d0;
}

.calendar-item.cancelled {
  color: #64748b;
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.calendar-item.draggable {
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.calendar-item.draggable:active,
.calendar-item.dragging,
.calendar-dragging .calendar-item.draggable {
  cursor: grabbing;
}

.calendar-item.dragging {
  opacity: 0.55;
}

.calendar-item.executed {
  color: #1e3a8a;
  background: #dbeafe;
  border-color: #bfdbfe;
}

.calendar-item.workorder {
  color: #713f12;
  background: #fef3c7;
  border-color: #fde68a;
}

.calendar-item-wrap .calendar-item.workorder {
  padding-right: 34px;
}

.calendar-copy-btn {
  position: absolute;
  z-index: 2;
  top: 5px;
  right: 5px;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: #713f12;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(113, 63, 18, 0.18);
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(113, 63, 18, 0.12);
}

.calendar-copy-btn:hover {
  background: #fff7ed;
  border-color: rgba(113, 63, 18, 0.34);
}

.calendar-copy-btn svg {
  width: 14px;
  height: 14px;
}

.week-input {
  max-width: 150px;
}

.week-planner {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.week-backlog,
.week-board {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.week-backlog {
  display: grid;
  gap: 10px;
  padding: 12px;
  min-height: 360px;
}

.week-backlog.drag-over,
.week-drop-cell.drag-over {
  background: #f0fdfa;
  box-shadow: inset 0 0 0 2px rgba(15, 118, 110, 0.32);
}

.week-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.week-section-head h3 {
  margin: 0 0 4px;
  font-size: 0.98rem;
}

.week-section-head p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
}

.week-section-head > span {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 28px;
  color: var(--brand);
  background: #eef6f5;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 999px;
  font-weight: 900;
}

.week-backlog-list {
  display: grid;
  align-content: start;
  gap: 8px;
}

.compact-empty {
  padding: 18px 10px;
}

.week-board {
  overflow: auto;
}

.week-board-grid {
  display: grid;
  grid-template-columns: 150px repeat(7, minmax(104px, 1fr));
  min-width: 878px;
}

.week-board-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f0f4f8;
  border-bottom: 1px solid var(--line);
}

.week-employee-head,
.week-day-head,
.week-employee-name,
.week-drop-cell {
  border-right: 1px solid var(--line);
}

.week-employee-head,
.week-day-head {
  min-height: 46px;
  padding: 9px;
  color: #465564;
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.week-day-head {
  display: grid;
  gap: 2px;
}

.week-day-head span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.week-employee-row {
  border-bottom: 1px solid var(--line);
}

.week-employee-row:last-child {
  border-bottom: 0;
}

.week-employee-name {
  display: grid;
  align-content: start;
  gap: 3px;
  padding: 9px;
  background: #f8fafc;
}

.week-employee-name span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.week-drop-cell {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 112px;
  padding: 6px;
  background: #fff;
}

.week-empty-slot {
  display: grid;
  place-items: center;
  min-height: 52px;
  color: #94a3b8;
  border: 1px dashed #cbd5df;
  border-radius: 7px;
  font-size: 0.72rem;
  font-weight: 800;
}

.week-workorder-card {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 8px;
  color: #24313f;
  text-align: left;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 7px;
  line-height: 1.25;
}

.week-workorder-card strong,
.week-workorder-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.week-workorder-card strong {
  font-size: 0.78rem;
}

.week-workorder-card small {
  color: #6b5b35;
  font-size: 0.7rem;
  font-weight: 700;
}

.week-workorder-card.backlog-card {
  background: #f8fafc;
  border-color: #dbe3ea;
}

.week-workorder-card.draggable {
  cursor: grab;
}

.week-workorder-card.draggable:active,
.week-workorder-card.dragging {
  cursor: grabbing;
  opacity: 0.58;
}

.week-workorder-card.locked {
  opacity: 0.72;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.day-picker {
  display: grid;
  grid-template-columns: 34px minmax(160px, 1fr) 34px auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 14px;
}

.day-entry-actions {
  justify-content: flex-start;
  flex-wrap: nowrap;
}

.day-compact-list {
  display: grid;
  gap: 7px;
}

.day-compact-row {
  display: grid;
  grid-template-columns: minmax(74px, 0.6fr) minmax(0, 1fr) auto auto auto;
  grid-template-areas: "time work total status actions";
  gap: 4px 8px;
  align-items: center;
  padding: 8px 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.84rem;
}

.day-compact-time {
  grid-area: time;
}

.day-compact-time strong,
.day-compact-total strong {
  display: block;
  font-size: 0.88rem;
}

.day-compact-time span,
.day-compact-total span {
  color: var(--muted);
  font-size: 0.74rem;
}

.day-compact-work {
  grid-area: work;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  min-width: 0;
}

.day-compact-work strong,
.day-compact-work .small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-compact-work br,
.review-work br {
  display: none;
}

.day-compact-total {
  grid-area: total;
  white-space: nowrap;
}

.day-compact-row > .status {
  grid-area: status;
  justify-self: start;
  min-height: 22px;
  padding: 0 7px;
  font-size: 0.72rem;
}

.day-compact-row > .day-entry-actions {
  grid-area: actions;
  justify-self: end;
  align-self: center;
  gap: 4px;
}

.day-compact-row .icon-btn {
  width: 29px;
  height: 29px;
  border-radius: 7px;
}

.review-work {
  margin-top: 4px;
}

.review-work strong,
.review-work .small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-subvalue {
  margin-top: 3px;
  color: var(--muted);
}

.review-subvalue strong {
  font-size: 0.86rem;
}

.type-list {
  display: grid;
  gap: 10px;
}

.type-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.type-item.selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.relation-list-panel .type-list,
.relation-detail-panel .type-list {
  max-height: 520px;
  overflow: auto;
  padding-right: 3px;
}

.relation-assignments {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 2px;
}

.swatch {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid rgba(15, 23, 42, 0.2);
}

.type-meta {
  display: flex;
  gap: 10px;
  align-items: center;
}

.mobile-only {
  display: none;
}

@media (max-width: 920px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
  }

  .login-page,
  .split,
  .planning-grid,
  .relations-grid,
  .workorder-detail-grid {
    grid-template-columns: 1fr;
  }

  .mobile-menu-button {
    display: inline-flex;
  }

  .tabs {
    display: none;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    justify-content: stretch;
    padding: 8px;
    background: #eef3f7;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .tabs.open {
    display: grid;
  }

  .tab {
    justify-content: flex-start;
    width: 100%;
    background: #fff;
  }

  .edit-panel {
    position: static;
  }

  .user-chip {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-day {
    min-height: 96px;
  }

  .week-planner {
    grid-template-columns: 1fr;
  }

  .week-backlog {
    min-height: 0;
  }

  .day-picker {
    grid-template-columns: 34px minmax(0, 1fr) 34px;
  }

  .day-entry-actions {
    justify-content: flex-start;
  }

  .day-picker .btn {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100vw - 20px, 1240px);
    padding-top: 14px;
  }

  .login-page {
    width: min(100vw - 20px, 1120px);
    padding: 20px 0;
  }

  .login-intro h1 {
    font-size: 2.35rem;
  }

  .tabs.open {
    grid-template-columns: 1fr;
  }

  .panel,
  .login-panel {
    padding: 14px;
  }

  .day-summary-grid {
    display: none;
  }

  .day-workflow {
    order: 1;
  }

  .day-summary-grid .metric {
    padding: 10px;
  }

  .day-summary-grid .metric strong {
    margin-top: 4px;
    font-size: 1.15rem;
  }

  .day-input-panel .panel-header {
    margin-bottom: 12px;
  }

  .day-input-panel .panel-header p {
    display: none;
  }

  .form-grid,
  .form-section-grid,
  .filters,
  .day-picker,
  .summary-grid,
  .login-shortcuts {
    grid-template-columns: 1fr;
  }

  .day-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .day-picker .icon-btn,
  .day-picker .btn {
    width: 100%;
  }

  .bulk-toolbar,
  .calendar-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .receipt-paper-head,
  .receipt-bottom-grid,
  .receipt-card-grid,
  .receipt-line-items {
    grid-template-columns: 1fr;
  }

  .work-schedule-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .receipt-paper-head {
    display: grid;
  }

  .receipt-paper-title {
    text-align: left;
  }

  .bulk-actions {
    align-items: stretch;
  }

  .day-compact-row {
    grid-template-columns: minmax(72px, auto) minmax(0, 1fr) auto;
    grid-template-areas:
      "time work actions"
      "time total actions"
      "status status actions";
  }

  .workorder-group-toggle {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .workorder-execution-context,
  .workorder-execution-actions,
  .entry-form-timer-panel {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .group-meta,
  .group-status {
    grid-column: 2;
    text-align: left;
  }

  .bulk-actions .btn,
  .bulk-actions select,
  .calendar-toolbar .btn,
  .calendar-toolbar .icon-btn {
    width: 100%;
  }

  .col-2,
  .col-3,
  .col-4,
  .col-5,
  .col-6,
  .col-7,
  .col-8,
  .col-12 {
    grid-column: span 1;
  }

  .topbar {
    padding: 12px;
  }

  .tab {
    flex: 1 1 auto;
  }

  .desktop-only {
    display: none;
  }

  .mobile-only {
    display: inline;
  }
}
