/* Prateck Web - Base styles extracted from html/app/index.html. */
/* Keep order to preserve the exact visual rendering. */

/* Theme variables shared by all modules. */
:root {
  color-scheme: dark;
  --bg: #05060b;
  --bg2: #0f1324;
  --panel: rgba(10, 16, 34, 0.88);
  --line: rgba(173, 191, 255, 0.3);
  --text: #f7fbff;
  --muted: #c4d0f7;
  --accent: #4f9cff;
  --accent2: #5ef0b1;
  --danger: #ff6f7c;
  --warn: #ffc866;
  --ok: #62f2b5;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f7ff;
  --bg2: #dfe9ff;
  --panel: rgba(255, 255, 255, 0.84);
  --line: rgba(67, 96, 145, 0.24);
  --text: #081427;
  --muted: #465d7f;
  --accent: #2f84ff;
  --accent2: #12b886;
  --danger: #df4b65;
  --warn: #d49a2c;
  --ok: #11b981;
  --shadow: 0 24px 54px rgba(78, 103, 145, 0.2);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(980px 540px at 8% -4%, rgba(79, 156, 255, 0.25), transparent 66%),
    radial-gradient(920px 560px at 96% 10%, rgba(94, 240, 177, 0.16), transparent 63%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  padding: 12px;
}

:root[data-theme="light"] body {
  background:
    radial-gradient(980px 540px at 8% -4%, rgba(47, 132, 255, 0.18), transparent 66%),
    radial-gradient(920px 560px at 96% 10%, rgba(18, 184, 134, 0.12), transparent 63%),
    linear-gradient(180deg, var(--bg), var(--bg2));
}

/* Main page layout containers. */
.app {
  width: 100%;
  max-width: none;
  margin: 0;
  display: grid;
  gap: 16px;
}

@media (max-width: 720px) {
  body {
    padding: 8px;
  }
}

.glass {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
}

.brand img {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.brand h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-sync-progress {
  flex: 1 0 100%;
  display: grid;
  gap: 7px;
  padding: 9px 10px;
  border: 1px solid rgba(154, 174, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.header-sync-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
}

.header-sync-progress-head span {
  color: var(--muted);
  text-align: right;
}

.header-sync-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(154, 174, 255, 0.16);
}

.header-sync-progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 180ms ease;
}

.header-sync-progress.is-done .header-sync-progress-fill {
  background: linear-gradient(90deg, #36d399, #75f0c0);
}

.header-sync-progress.is-error .header-sync-progress-fill {
  background: linear-gradient(90deg, #ff6f7c, #ff9aa4);
}

.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;
}

.theme-toggle {
  position: relative;
  width: 42px;
  height: 42px;
  min-width: 42px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(
      135deg,
      rgba(79, 156, 255, 0.16),
      rgba(94, 240, 177, 0.18)
    );
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.theme-toggle .theme-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.theme-toggle .theme-icon-sun {
  display: none;
}

:root[data-theme="light"] .theme-toggle .theme-icon-sun {
  display: inline-flex;
}

:root[data-theme="light"] .theme-toggle .theme-icon-moon {
  display: none;
}

.upcoming-read-box {
  white-space: pre-wrap;
  line-height: 1.45;
  max-height: 320px;
  overflow: auto;
}

.pill {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 5px 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 12px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}

.btn:hover { transform: translateY(-1px); filter: brightness(1.06); }

:root[data-theme="light"] .btn:hover {
  filter: brightness(0.99);
}

.btn.btn-detail-compact {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.1;
  letter-spacing: 0.01em;
  background: rgba(110, 179, 255, 0.12);
  border-color: rgba(154, 174, 255, 0.42);
  color: #d7e9ff;
}

.btn.btn-detail-compact:hover {
  transform: translateY(0);
  filter: brightness(1.1);
  border-color: rgba(198, 213, 255, 0.65);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #6eb3ff);
  color: #081427;
  border-color: rgba(255, 255, 255, 0.26);
  font-weight: 700;
}

.btn-danger {
  background: linear-gradient(135deg, #ff7e88, var(--danger));
  border-color: rgba(255, 255, 255, 0.2);
  color: #2a0510;
  font-weight: 700;
}

.btn-success {
  background: linear-gradient(135deg, #7ff4c5, var(--accent2));
  border-color: rgba(255, 255, 255, 0.2);
  color: #02291b;
  font-weight: 700;
}

/* Core two-column grid used by main panels. */
.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1.1fr 1fr;
}

.panel { padding: 16px; }

.panel h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.panel p.sub {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}

/* Compact mode: hide descriptive subtitles placed directly under titles. */
h2 + p.sub,
h3 + p.sub {
  display: none !important;
}

.detail-source-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.field-source-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 2px 8px;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.01em;
  width: fit-content;
  justify-self: start;
  white-space: nowrap;
}

.field-source-chip.source-dot {
  width: 9px;
  height: 9px;
  min-width: 9px;
  min-height: 9px;
  border-radius: 50%;
  padding: 0;
  font-size: 0;
  line-height: 0;
  vertical-align: middle;
  margin: 0;
}

.field-source-chip.source-dot.binsa {
  background: #11c5ff;
  border-color: #79e3ff;
  box-shadow: 0 0 0 1px rgba(6, 16, 34, 0.62), 0 0 7px rgba(17, 197, 255, 0.6);
}

.field-source-chip.source-dot.legacy {
  background: #ffbd2e;
  border-color: #ffe08f;
  box-shadow: 0 0 0 1px rgba(6, 16, 34, 0.62), 0 0 7px rgba(255, 189, 46, 0.56);
}

.field-label-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
}

.field-label-note {
  margin-top: -2px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}

.field-source-chip.binsa {
  color: #9fd4ff;
  background: rgba(79, 156, 255, 0.18);
}

.field-source-chip.legacy {
  color: #ffd28a;
  background: rgba(255, 200, 102, 0.16);
}

.login-wrap {
  max-width: 420px;
  margin: 40px auto 0;
  padding: 18px;
}

.row {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.row-inline {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 10px;
}

.installation-all-reports-toolbar {
  align-items: center;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
}

.installation-all-reports-filter-summary {
  align-self: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.installation-all-reports-filters {
  display: grid;
  gap: 0;
}

.admin-users-layout {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: stretch;
}

.admin-users-list-wrap {
  flex: 1 1 auto;
  height: 100%;
  min-height: 420px;
  max-height: none;
}

.admin-users-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-start;
  margin-bottom: 10px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 9px 10px;
  font: inherit;
  font-size: 14px;
}
select option,
select optgroup {
  color: #081427;
  background: #edf2ff;
}
select option:checked {
  color: #081427;
  background: #cfddff;
}

textarea { min-height: 100px; resize: vertical; }
input[data-locked="1"], textarea[data-locked="1"] {
  opacity: 0.65;
  cursor: not-allowed;
}

.mono { font-family: "IBM Plex Mono", monospace; }

.stack { display: grid; gap: 10px; }

.stack.admin-users-list-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  height: 100%;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  max-height: 380px;
}

.installation-all-reports-table-wrap {
  max-height: 360px;
}

#installationAllReportsPanel.installation-all-reports-filters-collapsed .installation-all-reports-table-wrap {
  max-height: 640px;
}

.installation-report-sheet-table-wrap {
  width: 100%;
  max-width: 100%;
  height: clamp(360px, calc(100vh - 210px), 1040px);
  max-height: calc(100vh - 120px);
  height: clamp(360px, calc(100dvh - 210px), 1040px);
  max-height: calc(100dvh - 120px);
}

.installation-report-sheet-table-wrap > table {
  width: 100%;
  min-width: 0;
}

.installation-report-sheet-table-wrap > table > thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

#installationReportSheetPanel,
#installationAllReportSheetPanel {
  width: 100%;
  min-width: 0;
}

#installationReportSheetTbody > tr > td,
#installationAllReportSheetTbody > tr > td {
  vertical-align: top;
}

@media (max-width: 760px) {
  .installation-all-reports-toolbar {
    grid-template-columns: 1fr;
  }

  .installation-all-reports-filter-summary {
    white-space: normal;
  }

  .installation-report-sheet-table-wrap {
    height: clamp(320px, calc(100vh - 170px), 760px);
    max-height: calc(100vh - 96px);
    height: clamp(320px, calc(100dvh - 170px), 760px);
    max-height: calc(100dvh - 96px);
  }
}

.table-wrap.admin-users-list-wrap {
  max-height: none;
  height: 100%;
}

.table-wrap.admin-users-list-wrap table.users-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}

.table-wrap.admin-users-list-wrap table.users-table th,
.table-wrap.admin-users-list-wrap table.users-table td {
  padding: 6px 7px;
}

.table-wrap.admin-users-list-wrap table.users-table th:nth-child(1),
.table-wrap.admin-users-list-wrap table.users-table td:nth-child(1) {
  width: 56px;
  white-space: nowrap;
}

.table-wrap.admin-users-list-wrap table.users-table th:nth-child(2),
.table-wrap.admin-users-list-wrap table.users-table td:nth-child(2) {
  width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-wrap.admin-users-list-wrap table.users-table th:nth-child(3),
.table-wrap.admin-users-list-wrap table.users-table td:nth-child(3) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-wrap.admin-users-list-wrap table.users-table th:nth-child(4),
.table-wrap.admin-users-list-wrap table.users-table td:nth-child(4) {
  width: 112px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-wrap.admin-users-list-wrap table.users-table td:nth-child(4) .chip {
  padding: 3px 7px;
  font-size: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  font-size: 13px;
}

th, td {
  border-bottom: 1px solid rgba(154, 174, 255, 0.2);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: #c7d3ff;
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(8, 11, 23, 0.95);
}

tr.active { background: rgba(79, 156, 255, 0.18); }
tr:hover { background: rgba(255, 255, 255, 0.05); }

body,
.glass,
.pill,
.btn,
input,
select,
textarea,
.table-wrap,
th,
tr {
  transition:
    background .18s ease,
    color .18s ease,
    border-color .18s ease,
    box-shadow .18s ease,
    filter .18s ease;
}

:root[data-theme="light"] .brand img {
  border-color: rgba(82, 114, 171, 0.2);
}

:root[data-theme="light"] .pill,
:root[data-theme="light"] .btn,
:root[data-theme="light"] input,
:root[data-theme="light"] select,
:root[data-theme="light"] textarea,
:root[data-theme="light"] .table-wrap {
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 24px rgba(103, 126, 166, 0.08);
}

:root[data-theme="light"] .pill,
:root[data-theme="light"] .btn,
:root[data-theme="light"] input,
:root[data-theme="light"] select,
:root[data-theme="light"] textarea {
  border-color: rgba(82, 114, 171, 0.2);
}

:root[data-theme="light"] .btn.btn-detail-compact {
  background: rgba(47, 132, 255, 0.12);
  border-color: rgba(47, 132, 255, 0.22);
  color: #245fa9;
}

:root[data-theme="light"] th {
  color: #48617f;
  background: rgba(238, 245, 255, 0.97);
}

:root[data-theme="light"] td,
:root[data-theme="light"] th {
  border-bottom-color: rgba(82, 114, 171, 0.14);
}

:root[data-theme="light"] tr.active {
  background: rgba(47, 132, 255, 0.12);
}

:root[data-theme="light"] tr:hover {
  background: rgba(47, 132, 255, 0.07);
}

:root[data-theme="light"] .field-source-chip.binsa {
  color: #1e63c0;
  background: rgba(47, 132, 255, 0.1);
}

:root[data-theme="light"] .field-source-chip.legacy {
  color: #a46a00;
  background: rgba(212, 154, 44, 0.12);
}

#statsLaborDetailTbody tr[data-stats-report-row] {
  cursor: pointer;
}

#installationReportsTbody tr[data-install-report-row],
#installationAllReportsTbody tr[data-install-all-report-row] {
  cursor: pointer;
}

#statsLaborDetailPanel th,
#statsLaborDetailTbody td {
  white-space: nowrap;
}

#statsReportSheetTbody .stats-report-resolution-cell,
#installationReportSheetTbody .stats-report-resolution-cell,
#installationAllReportSheetTbody .stats-report-resolution-cell {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
}

.installation-report-detail {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.installation-report-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.installation-report-detail-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.installation-report-detail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.installation-report-detail-tab {
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.2;
  color: var(--muted);
}

.installation-report-detail-tab.active {
  color: #eef7ff;
  border-color: rgba(110, 179, 255, 0.72);
  background: rgba(110, 179, 255, 0.16);
  font-weight: 700;
}

:root[data-theme="light"] .installation-report-detail-tab.active {
  color: #0b2544;
  background: rgba(47, 132, 255, 0.12);
}

.installation-report-detail-section {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.installation-report-detail-section h4 {
  margin: 0;
  font-size: 13px;
}

.installation-report-detail-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.installation-report-checklist-kind {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.installation-report-checklist-label {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.installation-report-checklist-help-btn {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  min-width: 22px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(110, 179, 255, 0.72);
  background: rgba(110, 179, 255, 0.16);
  color: #d9ecff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.installation-report-checklist-help-btn:hover,
.installation-report-checklist-help-btn:focus-visible {
  border-color: rgba(110, 179, 255, 0.96);
  background: rgba(110, 179, 255, 0.26);
  outline: none;
}

:root[data-theme="light"] .installation-report-checklist-help-btn {
  color: #0b2544;
  background: rgba(47, 132, 255, 0.12);
}

.installation-report-detail-table-wrap .compact-table {
  width: 100%;
}

.installation-report-detail-table-wrap .compact-table th,
.installation-report-detail-table-wrap .compact-table td {
  white-space: normal;
  vertical-align: top;
}

.installation-report-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  min-width: 0;
}

.installation-report-photo-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
}

.installation-report-photo-card img,
.installation-report-photo-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 4px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.18);
}

.installation-report-photo-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.installation-report-photo-card figcaption {
  display: grid;
  gap: 2px;
  min-width: 0;
  font-size: 12px;
}

.installation-report-photo-card figcaption strong,
.installation-report-photo-card figcaption span {
  overflow-wrap: anywhere;
}

.installation-report-photo-card figcaption span {
  color: var(--muted);
}

.installation-report-help-modal {
  position: fixed;
  inset: 0;
  z-index: 3200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(5, 10, 22, 0.72);
  backdrop-filter: blur(10px);
}

.installation-report-help-modal-card {
  width: min(820px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid rgba(154, 174, 255, 0.22);
  background: rgba(11, 18, 35, 0.98);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
}

:root[data-theme="light"] .installation-report-help-modal-card {
  background: #ffffff;
  border-color: rgba(23, 54, 86, 0.12);
}

.installation-report-help-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.installation-report-help-modal-header h3 {
  margin: 0;
  font-size: 16px;
}

.installation-report-help-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.installation-report-help-table {
  width: 100%;
}

.installation-report-help-table th,
.installation-report-help-table td {
  text-align: center;
}

.installation-report-detail-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.installation-report-detail-field {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
}

.installation-report-detail-field strong {
  font-size: 11px;
  color: var(--muted);
}

.installation-report-detail-field span {
  white-space: pre-wrap;
  word-break: break-word;
}

.chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  color: #c8e3ff;
  background: rgba(79, 156, 255, 0.15);
}

.error {
  border: 1px solid rgba(255, 111, 124, 0.5);
  background: rgba(255, 111, 124, 0.14);
  color: #ffd3d8;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
}

.ok {
  border: 1px solid rgba(98, 242, 181, 0.5);
  background: rgba(98, 242, 181, 0.14);
  color: #cbffe9;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
}

.hidden { display: none !important; }

.permission-filter-bar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, 280px);
  gap: 10px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.permission-filter-bar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.permission-layout {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.permission-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  overflow: hidden;
}

.permission-group summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  cursor: pointer;
  color: var(--text);
  list-style: none;
  border-bottom: 1px solid transparent;
}

.permission-group[open] summary {
  border-bottom-color: var(--line);
}

.permission-group summary::-webkit-details-marker {
  display: none;
}

.permission-group summary::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--accent2);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1;
}

.permission-group[open] summary::before {
  content: "-";
}

.permission-group-title {
  font-weight: 700;
}

.permission-group-note {
  color: var(--muted);
  font-size: 12px;
}

.permission-group-body {
  display: grid;
  gap: 10px;
  padding: 10px 12px 12px;
}

.permission-subtitle {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.permission-check,
.perm-grid label {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.perm-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  font-size: 13px;
}

.permission-check input[type="checkbox"],
.perm-grid input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent2);
}

@media (max-width: 760px) {
  .permission-filter-bar {
    grid-template-columns: 1fr;
  }
}

.log-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
  color: #d9e3ff;
}

.schedule-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 8px;
}

.admin-nav {
  display: grid;
  gap: 4px 8px;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  align-items: center;
}

.admin-nav .btn {
  width: 100%;
  text-align: left;
}

.admin-nav .btn.admin-menu-trigger {
  position: relative;
  padding-right: 22px;
}

.admin-nav .btn.admin-menu-trigger::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 8px;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transform: translateY(-35%);
  opacity: 0.82;
}

.admin-nav .btn.admin-menu-trigger[aria-expanded="true"]::after {
  transform: translateY(-60%) rotate(180deg);
}

#adminTabInstallationChanges {
  font-size: 12px;
  line-height: 1.15;
  letter-spacing: 0;
}

.admin-sub-nav-actions {
  display: grid;
  gap: 4px 8px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.admin-nav .btn.has-unread {
  background: rgba(255, 116, 132, 0.08);
  color: var(--text);
}

.technician-intervention-alert {
  border-color: rgba(255, 116, 132, 0.58);
  background: rgba(255, 116, 132, 0.14);
  color: #ffe8ed;
  font-weight: 800;
  white-space: nowrap;
}

.technician-intervention-alert:hover {
  filter: brightness(1.08);
}

.admin-nav .btn,
.admin-sub-nav-actions .btn,
.communication-tabs .btn {
  border: 0;
  background: transparent;
  box-shadow: none;
  min-height: 0;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.15;
  letter-spacing: 0;
  color: var(--muted);
  font-weight: 500;
}

#adminNavPanel,
#installationChangesPanel,
#statsSectionPanel {
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  padding: 0;
}

.admin-dropdown-menu {
  position: fixed;
  z-index: 2600;
  display: grid;
  gap: 4px;
  min-width: 220px;
  max-width: min(320px, calc(100vw - 24px));
  padding: 6px;
  border-radius: 14px;
  background: rgba(7, 14, 28, 0.96);
  border: 1px solid rgba(173, 191, 255, 0.24);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(16px);
}

.admin-dropdown-item {
  width: 100%;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 8px 10px;
  border-radius: 10px;
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  font-weight: 600;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}

.admin-dropdown-item:hover {
  background: rgba(79, 156, 255, 0.12);
  color: var(--text);
}

.admin-dropdown-item.is-selected {
  background: rgba(79, 156, 255, 0.18);
  color: var(--text);
  box-shadow: inset 3px 0 0 rgba(94, 240, 177, 0.9);
}

.admin-dropdown-label {
  display: block;
}

.admin-nav .btn:hover,
.admin-sub-nav-actions .btn:hover,
.communication-tabs .btn:hover {
  background: rgba(79, 156, 255, 0.1);
  color: var(--text);
  transform: none;
  filter: none;
}

.comm-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  margin-left: 8px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ff5e72;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #1f020a;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

@keyframes commUnreadPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.admin-nav .btn.has-unread .comm-unread-badge {
  animation: commUnreadPulse 1.2s ease-in-out infinite;
}

.admin-nav .btn.has-intervention-alert {
  background: rgba(255, 116, 132, 0.1);
  color: var(--text);
}

.admin-nav .btn.has-intervention-alert .comm-unread-badge {
  animation: commUnreadPulse 1.2s ease-in-out infinite;
}

.technician-intervention-banner {
  border: 1px solid rgba(255, 116, 132, 0.34);
  border-radius: 8px;
  background: rgba(255, 116, 132, 0.1);
  color: #ffe8ed;
  padding: 10px;
  font-weight: 700;
}

:root[data-theme="light"] .technician-intervention-alert,
:root[data-theme="light"] .technician-intervention-banner {
  color: #641324;
}

#installationsPanel {
  order: 1;
}

#installationsPanel.installation-all-reports-mode {
  grid-template-columns: minmax(0, 1fr);
}

#installationsPanel.installation-all-reports-mode > article:first-child {
  display: none;
}

#installationsPanel.installation-all-reports-mode > article:last-child {
  min-width: 0;
}

.installation-sheet-tabs {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
}

.installation-sheet-tabs .btn {
  min-height: 38px;
  border-radius: 8px;
  padding: 7px 10px;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
}

.installation-sheet-tab-panel.hidden {
  display: none;
}

.installation-sheet-panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.installation-sheet-panel-toolbar h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.installation-sheet-panel-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.installation-sheet-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.installation-sheet-table-wrap {
  max-height: min(52vh, 480px);
}

.installation-sheet-edit-form {
  border: 1px solid rgba(154, 174, 255, 0.16);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.installation-sheet-edit-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.installation-sheet-edit-actions {
  grid-template-columns: repeat(auto-fit, minmax(120px, max-content));
  justify-content: end;
}

.installation-sheet-edit-form .checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
}

.installation-sheet-contact-edit-table input,
.installation-sheet-contact-edit-table select {
  min-width: 110px;
}

.installation-sheet-contact-edit-table input[type="number"] {
  min-width: 72px;
}

.installation-sheet-theoretical-block h4 {
  margin: 0;
  font-size: 14px;
  line-height: 1.25;
}

.installation-sheet-theoretical-table {
  min-width: 680px;
}

.installation-sheet-theoretical-day-month {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}

.installation-sheet-theoretical-day-month input[type="number"] {
  min-width: 64px;
  width: 72px;
}

.installation-sheet-theoretical-day-month input[type="date"] {
  min-width: 145px;
  width: 155px;
}

.installation-sheet-technical-table td,
.installation-sheet-intervention-table td,
.installation-sheet-theoretical-table td {
  overflow-wrap: anywhere;
}

.installation-sheet-call-link {
  color: #b9d3ff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

:root[data-theme="light"] .installation-sheet-call-link {
  color: #245fa9;
}

.admin-tab-active {
  background: rgba(79, 156, 255, 0.18);
  color: var(--text);
  border-color: transparent;
  box-shadow: inset 0 -2px 0 rgba(94, 240, 177, 0.9);
  font-weight: 700;
}

.admin-sub-nav-actions .btn.admin-tab-active,
.toolbar .btn.admin-tab-active {
  background: rgba(94, 240, 177, 0.16);
  border-color: rgba(94, 240, 177, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(94, 240, 177, 0.45),
    inset 0 -3px 0 rgba(94, 240, 177, 0.95);
}

.database-management-nav {
  display: grid;
  gap: 10px;
}

.database-management-nav-group {
  display: grid;
  gap: 6px;
}

.database-management-nav-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.database-management-nav-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.database-management-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.database-management-section-head h3 {
  margin: 0;
  font-size: 18px;
}

.database-management-section-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.database-management-home-grid,
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.database-management-home-grid {
  margin-top: 12px;
}

.database-management-status-grid {
  margin-top: 12px;
}

.database-management-action-card,
.stat-card {
  min-height: 108px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
}

.database-management-action-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  cursor: pointer;
}

.database-management-action-card:hover {
  border-color: rgba(94, 240, 177, 0.65);
  background: rgba(94, 240, 177, 0.08);
}

.database-management-action-card:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
}

.database-management-action-card.is-ok {
  border-color: rgba(94, 240, 177, 0.4);
}

.database-management-action-card.is-warning {
  border-color: rgba(255, 200, 102, 0.58);
  background: rgba(255, 200, 102, 0.07);
}

.database-management-action-card.is-danger {
  border-color: rgba(255, 111, 124, 0.62);
  background: rgba(255, 111, 124, 0.08);
}

.database-management-action-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.database-management-action-card-top strong {
  font-size: 15px;
}

.database-management-action-value,
.stat-card strong {
  display: block;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
}

.database-management-action-detail,
.stat-card small,
.stat-card span {
  color: var(--muted);
}

.stat-card {
  display: grid;
  align-content: start;
  gap: 8px;
}

.database-management-details {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
}

.database-management-details summary {
  cursor: pointer;
  font-weight: 700;
}

:root[data-theme="light"] .admin-nav .btn:hover,
:root[data-theme="light"] .admin-sub-nav-actions .btn:hover,
:root[data-theme="light"] .communication-tabs .btn:hover {
  background: rgba(47, 132, 255, 0.08);
  color: #102847;
}

:root[data-theme="light"] .admin-nav .btn,
:root[data-theme="light"] .admin-sub-nav-actions .btn,
:root[data-theme="light"] .communication-tabs .btn {
  color: #27405f;
}

:root[data-theme="light"] .admin-dropdown-menu {
  background: rgba(250, 252, 255, 0.97);
  border-color: rgba(39, 64, 95, 0.14);
  box-shadow: 0 18px 40px rgba(16, 40, 71, 0.14);
}

:root[data-theme="light"] .admin-dropdown-item {
  color: #27405f;
}

@media (max-width: 760px) {
  #installationsPanel {
    grid-template-columns: minmax(0, 1fr);
  }

  .installation-sheet-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .installation-sheet-panel-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

:root[data-theme="light"] .admin-dropdown-item:hover {
  background: rgba(47, 132, 255, 0.08);
  color: #102847;
}

:root[data-theme="light"] .admin-dropdown-item.is-selected {
  background: rgba(47, 132, 255, 0.1);
  color: #102847;
  box-shadow: inset 3px 0 0 rgba(18, 184, 134, 0.78);
}

:root[data-theme="light"] .admin-tab-active {
  background: rgba(47, 132, 255, 0.1) !important;
  color: #102847 !important;
  box-shadow: inset 0 -2px 0 rgba(18, 184, 134, 0.78);
}

:root[data-theme="light"] .admin-sub-nav-actions .btn.admin-tab-active,
:root[data-theme="light"] .toolbar .btn.admin-tab-active {
  background: rgba(18, 184, 134, 0.14) !important;
  border-color: rgba(18, 184, 134, 0.62);
  box-shadow:
    inset 0 0 0 1px rgba(18, 184, 134, 0.28),
    inset 0 -3px 0 rgba(18, 184, 134, 0.82);
}

:root[data-theme="light"] .database-management-section-head,
:root[data-theme="light"] .database-management-action-card,
:root[data-theme="light"] .stat-card,
:root[data-theme="light"] .database-management-details {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(82, 114, 171, 0.2);
}

:root[data-theme="light"] .database-management-action-card:hover {
  background: rgba(18, 184, 134, 0.08);
  border-color: rgba(18, 184, 134, 0.5);
}

:root[data-theme="light"] .database-management-action-card.is-warning {
  background: rgba(212, 154, 44, 0.1);
  border-color: rgba(212, 154, 44, 0.42);
}

:root[data-theme="light"] .database-management-action-card.is-danger {
  background: rgba(223, 75, 101, 0.1);
  border-color: rgba(223, 75, 101, 0.42);
}

.pending-compare {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.pending-compare-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pending-sheet {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.pending-sheet h3 {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(154, 174, 255, 0.22);
  background: rgba(79, 156, 255, 0.08);
  font-size: 14px;
}

.pending-detail-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
  font-size: 13px;
}

.pending-detail-table td {
  border-bottom: 1px solid rgba(154, 174, 255, 0.16);
  padding: 8px 10px;
  vertical-align: top;
}

.pending-detail-label {
  width: 34%;
  color: var(--muted);
  font-weight: 600;
}

.pending-detail-row-changed td {
  background: rgba(79, 156, 255, 0.2);
}

.pending-detail-row-changed .pending-detail-label::after {
  content: " *";
  color: var(--accent2);
  font-weight: 700;
}

.pending-empty {
  color: var(--muted);
  font-style: italic;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid transparent;
}

.status-chip.pending {
  color: #ffe9bf;
  background: rgba(255, 200, 102, 0.18);
  border-color: rgba(255, 200, 102, 0.4);
}

.status-chip.approved {
  color: #d2ffe9;
  background: rgba(98, 242, 181, 0.18);
  border-color: rgba(98, 242, 181, 0.4);
}

.status-chip.rejected {
  color: #ffd9de;
  background: rgba(255, 111, 124, 0.18);
  border-color: rgba(255, 111, 124, 0.4);
}

.maintenance-layout {
  display: grid;
  gap: 12px;
  align-items: start;
}

.maintenance-card {
  border: 1px solid rgba(154, 174, 255, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  padding: 12px;
}

.maintenance-card h3 {
  margin: 0 0 10px !important;
  font-size: 15px;
  color: #d7e1ff;
}

.maintenance-card .sub {
  margin-bottom: 10px;
}

.maintenance-card .row-inline {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.maintenance-card .pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
}

.maintenance-transfer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.maintenance-transfer-toolbar {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, auto) repeat(2, minmax(180px, 1fr)) auto;
  align-items: end;
  margin-bottom: 10px;
}

.maintenance-transfer-table-toolbar {
  grid-template-columns: minmax(240px, 1fr) minmax(160px, 220px) auto;
}

#maintenanceTransfersBulkToolbar {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  padding-bottom: 2px;
}

#maintenanceTransfersBulkToolbar .btn,
#maintenanceTransfersBulkToolbar .pill {
  flex: 0 0 auto;
  white-space: nowrap;
}

.maintenance-transfer-installations-wrap {
  max-height: 360px;
}

.maintenance-transfer-filter-row {
  grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(180px, 0.8fr)) auto auto;
  align-items: end;
}

.maintenance-transfer-filter-row .btn {
  align-self: end;
}

.maintenance-transfer-filter-field {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.maintenance-transfer-filter-label {
  font-size: 13px;
  color: var(--muted);
}

.maintenance-transfer-filter-trigger {
  width: 100%;
  min-height: 39px;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.maintenance-transfer-filter-menu {
  position: absolute;
  z-index: 8;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  gap: 4px;
  max-height: 240px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(8, 11, 23, 0.98);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
}

.maintenance-transfer-filter-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
  min-height: 30px;
  padding: 4px 6px;
  border-radius: 8px;
  color: var(--text);
}

.maintenance-transfer-filter-option:hover {
  background: rgba(154, 174, 255, 0.12);
}

.maintenance-transfer-filter-option input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent2);
}

.maintenance-transfer-filter-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 6px;
}

:root[data-theme="light"] .maintenance-transfer-filter-menu {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 42px rgba(78, 103, 145, 0.2);
}

.maintenance-transfer-installations-wrap table,
.maintenance-transfer-selected-wrap table {
  min-width: 940px;
}

.maintenance-transfer-bulk-tools {
  display: grid;
  gap: 10px;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid rgba(154, 174, 255, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.maintenance-transfer-bulk-actions,
.maintenance-transfer-bulk-grid {
  display: grid;
  gap: 10px;
  align-items: end;
}

.maintenance-transfer-bulk-actions {
  grid-template-columns: repeat(2, minmax(120px, auto)) minmax(120px, 1fr);
}

.maintenance-transfer-bulk-grid {
  grid-template-columns: minmax(180px, 1fr) repeat(2, minmax(150px, 0.7fr)) auto;
}

.maintenance-transfer-select-cell {
  width: 96px;
  text-align: center;
}

.maintenance-transfer-select-cell input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent2);
}

.maintenance-transfer-selected-wrap select,
.maintenance-transfer-selected-wrap input {
  min-width: 150px;
}

.maintenance-transfer-form-actions {
  margin-top: 12px;
}

.maintenance-transfer-progress {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid rgba(154, 174, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.maintenance-transfer-progress-head,
.maintenance-transfer-progress-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.maintenance-transfer-progress-head strong {
  color: #d7e1ff;
}

.maintenance-transfer-progress-meta {
  color: var(--muted);
  font-size: 12px;
}

.maintenance-transfer-progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(154, 174, 255, 0.16);
}

.maintenance-transfer-progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 180ms ease;
}

.maintenance-transfer-progress.is-done .maintenance-transfer-progress-fill {
  background: linear-gradient(90deg, #36d399, #75f0c0);
}

.maintenance-transfer-progress.is-warning .maintenance-transfer-progress-fill {
  background: linear-gradient(90deg, #ffc861, #ffdf8a);
}

.maintenance-transfer-progress.is-error .maintenance-transfer-progress-fill {
  background: linear-gradient(90deg, #ff6f7c, #ff9aa4);
}

.maintenance-import-progress {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid rgba(154, 174, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.maintenance-import-progress-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.maintenance-import-progress-head span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.maintenance-import-progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(154, 174, 255, 0.16);
}

.maintenance-import-progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 180ms ease;
}

.maintenance-import-progress.is-done .maintenance-import-progress-fill {
  background: linear-gradient(90deg, #36d399, #75f0c0);
}

.maintenance-import-progress.is-error .maintenance-import-progress-fill {
  background: linear-gradient(90deg, #ff6f7c, #ff9aa4);
}

.maintenance-transfer-progress-errors {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
  color: var(--danger);
  font-size: 12px;
}

tr.selected-row {
  background: rgba(94, 240, 177, 0.12);
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

.danger {
  color: var(--danger);
}

@media (max-width: 940px) {
  .maintenance-transfer-toolbar,
  .maintenance-transfer-filter-row,
  .maintenance-transfer-bulk-actions,
  .maintenance-transfer-bulk-grid {
    grid-template-columns: 1fr;
  }
}

.stock-missing-report-weekdays {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  margin-top: 10px;
}

.stock-missing-report-weekdays label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

:root[data-theme="light"] .stock-missing-report-weekdays label {
  background: rgba(255, 255, 255, 0.78);
}

.stock-missing-report-weekdays input[type="checkbox"] {
  margin: 0;
}

.technician-menu-layout {
  display: grid;
  gap: 12px;
}

.technician-summary-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 10px;
}

.technician-card {
  border: 1px solid rgba(154, 174, 255, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  padding: 12px;
}

.technician-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
  color: #d7e1ff;
}

.technician-card p.sub {
  margin-bottom: 10px;
}

.technician-meta-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.technician-fields-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  display: grid;
  gap: 6px;
}

.technician-fields-list li {
  line-height: 1.4;
}

.technician-skeleton-form {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.technician-skeleton-form .row,
.technician-skeleton-form .row-inline {
  margin-bottom: 0;
}

.technician-preview-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(154, 174, 255, 0.3);
  background: rgba(79, 156, 255, 0.12);
  color: #d9e8ff;
  font-size: 11px;
  font-weight: 700;
}

.technician-preview-badge.is-muted {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.technician-preview-badge.is-done {
  background: rgba(98, 242, 181, 0.14);
  border-color: rgba(98, 242, 181, 0.32);
  color: #d7ffe9;
}

.technician-preview-badge.is-pending {
  background: rgba(255, 200, 102, 0.14);
  border-color: rgba(255, 200, 102, 0.3);
  color: #ffe8b8;
}

.technician-menu-maintenance-table-row {
  cursor: pointer;
}

.technician-menu-maintenance-table-row:hover {
  background: rgba(79, 156, 255, 0.2);
}

.technician-menu-maintenance-table-row:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: -2px;
}

.technician-maintenance-open-btn {
  border: 0;
  padding: 0;
  background: transparent;
  color: #d8e6ff;
  font: inherit;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.technician-maintenance-open-btn:hover {
  color: #ffffff;
}

.technician-maintenance-open-btn:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
  border-radius: 6px;
}

.technician-menu-intervention-table-row {
  cursor: pointer;
}

.technician-menu-intervention-table-row:hover {
  background: rgba(79, 156, 255, 0.18);
}

.technician-menu-safety-study-table-row {
  cursor: pointer;
}

.technician-menu-safety-study-table-row:hover {
  background: rgba(98, 214, 166, 0.14);
}

.technician-intervention-open-btn {
  border: 0;
  padding: 0;
  background: transparent;
  color: #d8e6ff;
  font: inherit;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.technician-safety-study-open-btn {
  border: 0;
  padding: 0;
  background: transparent;
  color: #d8e6ff;
  font: inherit;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.technician-safety-study-open-btn:hover {
  color: #ffffff;
}

.technician-safety-study-detail {
  scroll-margin-top: 12px;
}

.technician-safety-study-checklist {
  display: grid;
  gap: 8px;
}

.technician-safety-study-checklist-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto minmax(180px, 0.65fr);
  gap: 10px;
  align-items: center;
  padding: 9px;
  border: 1px solid rgba(154, 174, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.technician-safety-study-checklist-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.technician-safety-study-checklist-title {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.technician-safety-study-checklist-title strong {
  flex: 1 1 auto;
  min-width: 0;
}

.technician-safety-study-checklist-main strong {
  overflow-wrap: anywhere;
}

.technician-safety-study-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-text);
  font-size: 12px;
  white-space: nowrap;
}

.technician-safety-study-checklist-row input[type="text"] {
  width: 100%;
  min-width: 0;
}

@media (max-width: 820px) {
  .technician-safety-study-checklist-row {
    grid-template-columns: 1fr 1fr;
  }

  .technician-safety-study-checklist-main,
  .technician-safety-study-checklist-row input[type="text"] {
    grid-column: 1 / -1;
  }
}

.technician-intervention-card {
  display: grid;
  gap: 12px;
}

.technician-intervention-toolbar,
.technician-intervention-detail-head,
.technician-intervention-create-head,
.technician-intervention-transfer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.technician-intervention-toolbar h3,
.technician-intervention-detail h3,
.technician-intervention-section h4,
.technician-intervention-create h4,
.technician-intervention-transfer h4 {
  margin: 0;
}

.technician-intervention-toolbar > div {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.technician-intervention-detail {
  display: grid;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(154, 174, 255, 0.18);
}

.technician-intervention-summary-grid,
.technician-intervention-field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.technician-intervention-summary-grid > div,
.technician-intervention-field-grid > div,
.technician-intervention-section,
.technician-intervention-create,
.technician-intervention-transfer {
  border: 1px solid rgba(154, 174, 255, 0.16);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.technician-intervention-summary-grid strong,
.technician-intervention-field-grid strong {
  display: block;
  margin-bottom: 4px;
  color: var(--muted-text);
  font-size: 12px;
}

.technician-intervention-summary-grid span,
.technician-intervention-field-grid span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.technician-intervention-section {
  display: grid;
  gap: 8px;
}

.technician-intervention-create {
  display: grid;
  gap: 10px;
}

.technician-intervention-create-form {
  display: grid;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(94, 234, 212, 0.22);
  background: rgba(15, 23, 42, 0.46);
}

.technician-intervention-create-form-head,
.technician-intervention-create-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.technician-intervention-create-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.technician-intervention-create-form-grid label {
  display: grid;
  gap: 6px;
}

.technician-intervention-create-form-grid label span {
  color: var(--muted-text);
  font-size: 12px;
}

.technician-intervention-create-form-wide {
  grid-column: 1 / -1;
}

.technician-intervention-create-form textarea {
  min-height: 88px;
  resize: vertical;
}

.technician-intervention-create-search input {
  width: min(520px, 100%);
}

.technician-intervention-create-row:hover {
  background: rgba(98, 214, 166, 0.08);
}

.technician-intervention-report-layout,
.technician-intervention-report-subsection {
  display: grid;
  gap: 8px;
}

.technician-intervention-report-subsection h5 {
  margin: 2px 0 0;
  font-size: 13px;
  letter-spacing: 0;
  color: var(--muted-text);
}

.technician-intervention-classification-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.technician-intervention-classification-grid > div {
  border: 1px solid rgba(154, 174, 255, 0.12);
  border-radius: 8px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.025);
  min-width: 0;
}

.technician-intervention-classification-grid strong {
  display: block;
  margin-bottom: 4px;
  color: var(--muted-text);
  font-size: 12px;
}

.technician-intervention-classification-grid span {
  display: block;
  overflow-wrap: anywhere;
}

.technician-intervention-report-form {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(98, 214, 166, 0.24);
  border-radius: 8px;
  background: rgba(98, 214, 166, 0.055);
}

.technician-intervention-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.technician-intervention-form-grid label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted-text);
  font-size: 12px;
}

.technician-intervention-form-grid input,
.technician-intervention-form-grid select,
.technician-intervention-form-grid textarea {
  width: 100%;
  min-width: 0;
}

.technician-intervention-form-grid textarea {
  min-height: 88px;
  resize: vertical;
}

.technician-intervention-form-grid textarea.technician-intervention-autosize {
  overflow: hidden;
  resize: none;
}

.technician-intervention-form-readonly {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted-text);
  font-size: 12px;
}

.technician-intervention-form-readonly strong {
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid rgba(154, 174, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.technician-intervention-form-wide {
  grid-column: 1 / -1;
}

.technician-intervention-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.technician-intervention-report-assets {
  display: grid;
  gap: 10px;
}

.technician-intervention-report-asset-block {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(154, 174, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.technician-intervention-report-asset-block h5 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0;
  color: var(--muted-text);
}

.technician-intervention-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.technician-intervention-transfer {
  display: grid;
  gap: 8px;
}

.technician-intervention-transfer select {
  min-width: min(320px, 100%);
}

:root[data-theme="light"] .technician-menu-maintenance-table-row:hover {
  background: rgba(23, 54, 86, 0.12);
}

:root[data-theme="light"] .technician-menu-intervention-table-row:hover {
  background: rgba(23, 54, 86, 0.12);
}

:root[data-theme="light"] .technician-menu-safety-study-table-row:hover {
  background: rgba(23, 54, 86, 0.12);
}

:root[data-theme="light"] .technician-intervention-open-btn {
  color: #173656;
}

:root[data-theme="light"] .technician-safety-study-open-btn {
  color: #173656;
}

:root[data-theme="light"] .technician-intervention-summary-grid > div,
:root[data-theme="light"] .technician-intervention-field-grid > div,
:root[data-theme="light"] .technician-intervention-classification-grid > div,
:root[data-theme="light"] .technician-intervention-section,
:root[data-theme="light"] .technician-intervention-create,
:root[data-theme="light"] .technician-intervention-transfer {
  border-color: rgba(23, 54, 86, 0.12);
  background: rgba(23, 54, 86, 0.035);
}

:root[data-theme="light"] .technician-intervention-report-form {
  border-color: rgba(22, 121, 91, 0.22);
  background: rgba(22, 121, 91, 0.055);
}

:root[data-theme="light"] .technician-intervention-form-readonly strong {
  border-color: rgba(23, 54, 86, 0.12);
  background: rgba(23, 54, 86, 0.035);
}

:root[data-theme="light"] .technician-intervention-report-asset-block {
  border-color: rgba(23, 54, 86, 0.12);
  background: rgba(23, 54, 86, 0.035);
}

.technician-report-modal {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 10, 22, 0.7);
  backdrop-filter: blur(10px);
}

.installation-technical-modal {
  position: fixed;
  inset: 0;
  z-index: 340;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(5, 10, 22, 0.72);
  backdrop-filter: blur(10px);
}

.installation-technical-modal.hidden {
  display: none;
}

.installation-technical-modal-card {
  width: min(1040px, 100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
  border-radius: 8px;
  border: 1px solid rgba(154, 174, 255, 0.22);
  background: rgba(11, 18, 35, 0.98);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  padding: 16px;
  display: grid;
  gap: 14px;
}

.installation-technical-modal-header,
.installation-technical-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.installation-technical-modal-header h3 {
  margin: 0;
}

.installation-technical-modal-body {
  display: grid;
  gap: 14px;
}

.installation-create-modal-card {
  width: min(1180px, 100%);
}

.installation-create-form {
  display: grid;
  gap: 14px;
}

.installation-create-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.installation-create-grid label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.installation-create-grid input,
.installation-create-grid select,
.installation-create-grid textarea {
  width: 100%;
}

.installation-create-wide {
  grid-column: 1 / -1;
}

.installation-create-check {
  align-content: end;
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 54px;
}

.installation-create-check input {
  width: auto;
}

.installation-create-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.installation-create-section {
  display: grid;
  gap: 10px;
  border-top: 1px solid rgba(154, 174, 255, 0.16);
  padding-top: 12px;
}

.installation-create-section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.installation-create-section-header h4 {
  margin: 0;
}

.installation-create-section-header label {
  display: grid;
  gap: 5px;
  min-width: min(280px, 100%);
}

.installation-create-section-header select,
.installation-create-technical-table input,
.installation-create-technical-table select,
.installation-create-contact-table input,
.installation-create-contact-table select {
  width: 100%;
}

.installation-create-inline-actions {
  display: flex;
  justify-content: flex-end;
}

.installation-technical-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.installation-technical-summary-grid > div {
  border: 1px solid rgba(154, 174, 255, 0.16);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.035);
  min-width: 0;
}

.installation-technical-summary-grid strong {
  display: block;
  margin-bottom: 4px;
  color: var(--muted-text);
  font-size: 12px;
}

.installation-technical-summary-grid span,
.installation-technical-table td {
  overflow-wrap: anywhere;
}

.installation-technical-table-wrap {
  max-height: min(56vh, 520px);
}

.installation-technical-template-section {
  display: grid;
  gap: 8px;
}

.installation-technical-template-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.installation-technical-template-title h4 {
  margin: 0;
  font-size: 15px;
}

.installation-technical-template-wrap {
  max-height: min(48vh, 460px);
}

.installation-technical-template-table td:first-child {
  min-width: 220px;
}

.installation-technical-template-table small {
  display: block;
  margin-top: 4px;
  color: var(--muted-text);
}

.installation-technical-template-table th:last-child,
.installation-technical-template-table td:last-child {
  width: 1%;
  white-space: nowrap;
}

.installation-technical-group-row td {
  background: rgba(154, 174, 255, 0.08);
  color: var(--text);
}

.installation-technical-line-indent {
  display: inline-block;
  width: calc(var(--technical-line-depth, 0) * 16px);
  flex: 0 0 auto;
}

.installation-technical-value {
  white-space: pre-wrap;
}

.installation-technical-edit {
  display: grid;
  gap: 6px;
  min-width: min(320px, 44vw);
}

.installation-technical-edit-input {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(154, 174, 255, 0.22);
  border-radius: 6px;
  background: rgba(7, 12, 24, 0.7);
  color: var(--text);
  padding: 7px 9px;
  font: inherit;
}

.installation-technical-save-cell {
  text-align: right;
}

.installation-technical-data-btn {
  white-space: nowrap;
}

body.installation-technical-modal-open {
  overflow: hidden;
}

.technician-report-modal-card {
  width: min(1120px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: 22px;
  border: 1px solid rgba(154, 174, 255, 0.22);
  background: rgba(11, 18, 35, 0.98);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  padding: 18px;
  display: grid;
  gap: 14px;
}

.technician-report-modal-header,
.technician-report-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.technician-report-modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.technician-report-modal-body {
  display: grid;
  gap: 14px;
}

.technician-report-modal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.technician-report-modal-panels {
  display: grid;
  gap: 14px;
}

.technician-report-modal-panel {
  display: grid;
  gap: 14px;
}

.technician-report-modal-section {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(154, 174, 255, 0.16);
  background: rgba(255, 255, 255, 0.03);
}

.technician-report-modal-batch-banner {
  gap: 8px;
  border-color: rgba(94, 234, 212, 0.22);
  background: linear-gradient(160deg, rgba(27, 66, 70, 0.55), rgba(8, 18, 30, 0.78));
}

.technician-report-modal-batch-picker {
  gap: 8px;
}

.technician-report-modal-batch-picker-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.technician-menu-maintenance-batch-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(154, 174, 255, 0.14);
  background: rgba(7, 14, 28, 0.48);
}

.technician-menu-maintenance-batch-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.technician-menu-maintenance-batch-progress {
  flex: 1 1 100%;
  display: grid;
  gap: 8px;
  min-width: 240px;
  padding-top: 4px;
}

.technician-menu-maintenance-batch-progress-head,
.technician-menu-maintenance-batch-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.technician-menu-maintenance-batch-progress-head span,
.technician-menu-maintenance-batch-progress-meta {
  color: var(--muted-text);
  font-size: 12px;
}

.technician-menu-maintenance-batch-progress-track {
  overflow: hidden;
  height: 10px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.72);
}

.technician-menu-maintenance-batch-progress-fill {
  height: 100%;
  min-width: 8px;
  border-radius: inherit;
  background: linear-gradient(90deg, #14b8a6, #22c55e);
  transition: width 180ms ease;
}

.technician-menu-maintenance-batch-progress.is-error .technician-menu-maintenance-batch-progress-fill {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.technician-menu-maintenance-batch-progress.is-done .technician-menu-maintenance-batch-progress-fill {
  background: linear-gradient(90deg, #22c55e, #84cc16);
}

.technician-menu-maintenance-batch-select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.technician-menu-maintenance-batch-select input {
  width: auto;
}

.technician-report-modal-section h4 {
  margin: 0;
}

.technician-report-modal-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.technician-report-modal-info-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.technician-report-modal-info-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(154, 174, 255, 0.16);
  background: linear-gradient(160deg, rgba(48, 80, 120, 0.2), rgba(10, 18, 36, 0.4));
}

.technician-report-modal-info-card strong {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-text);
}

.technician-report-modal-info-card span {
  line-height: 1.45;
}

.technician-report-modal-field-wide {
  grid-column: 1 / -1;
}

.technician-report-modal-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}

.technician-report-modal-toggle input {
  width: auto;
}

.technician-report-modal-meta {
  max-height: 220px;
  white-space: pre-wrap;
}

.technician-report-modal-checklist {
  display: grid;
  gap: 10px;
}

.technician-report-modal-checklist-item,
.technician-report-modal-collection-item {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(154, 174, 255, 0.14);
  background: rgba(7, 14, 28, 0.5);
}

.technician-report-modal-checklist-head,
.technician-report-modal-collection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.technician-report-modal-checklist-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.technician-report-modal-checklist-toggle input {
  width: auto;
}

.technician-report-modal-checklist-label {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.technician-report-modal-checklist-number {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(154, 174, 255, 0.22);
  color: var(--muted-text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.technician-report-modal-collection {
  display: grid;
  gap: 10px;
}

.technician-report-modal-collection-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.technician-report-modal-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(154, 174, 255, 0.12);
  color: var(--muted-text);
  font-size: 12px;
}

.technician-report-modal-photo-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.technician-report-modal-photo-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(154, 174, 255, 0.14);
  background: rgba(7, 14, 28, 0.5);
}

.technician-report-modal-photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.technician-report-modal-photo-meta {
  display: grid;
  gap: 4px;
}

.technician-report-modal-material-grid {
  align-items: end;
}

.technician-report-modal-footer-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

body.technician-report-modal-open {
  overflow: hidden;
}

:root[data-theme="light"] .technician-maintenance-open-btn {
  color: #173656;
}

:root[data-theme="light"] .technician-maintenance-open-btn:hover {
  color: #0e243a;
}

:root[data-theme="light"] .technician-report-modal {
  background: rgba(225, 232, 242, 0.66);
}

:root[data-theme="light"] .installation-technical-modal {
  background: rgba(225, 232, 242, 0.7);
}

:root[data-theme="light"] .installation-technical-modal-card {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(86, 112, 153, 0.2);
  box-shadow: 0 24px 70px rgba(20, 32, 57, 0.18);
}

:root[data-theme="light"] .installation-technical-summary-grid > div {
  background: rgba(246, 249, 255, 0.9);
  border-color: rgba(86, 112, 153, 0.16);
}

:root[data-theme="light"] .installation-technical-edit-input {
  background: #ffffff;
  border-color: rgba(86, 112, 153, 0.22);
}

:root[data-theme="light"] .technician-report-modal-card {
  background: rgba(255, 255, 255, 0.97);
  border-color: rgba(86, 112, 153, 0.2);
  box-shadow: 0 24px 70px rgba(20, 32, 57, 0.18);
}

:root[data-theme="light"] .technician-report-modal-section,
:root[data-theme="light"] .technician-report-modal-checklist-item,
:root[data-theme="light"] .technician-report-modal-collection-item,
:root[data-theme="light"] .technician-report-modal-photo-card {
  background: rgba(246, 249, 255, 0.9);
  border-color: rgba(86, 112, 153, 0.16);
}

:root[data-theme="light"] .technician-report-modal-info-card {
  background: linear-gradient(160deg, rgba(220, 231, 247, 0.96), rgba(248, 250, 255, 0.98));
  border-color: rgba(86, 112, 153, 0.16);
}

.tech-picker {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px;
  max-height: 210px;
  overflow: auto;
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.tech-picker-item {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
}

.tech-picker input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent2);
}

.tech-picker.is-disabled {
  opacity: 0.65;
  pointer-events: none;
}

.tech-picker-empty {
  color: var(--muted);
  font-style: italic;
  font-size: 13px;
  padding: 4px 2px;
}

/* Ordre visuel demande par le metier */
#maintenanceManualSection { order: 1; }
#maintenanceRunSection { order: 2; }
#maintenanceRunsSection { order: 3; }
#maintenanceTechSection { order: 4; }
#maintenanceMailSection { order: 5; }
#maintenanceScheduleSection { order: 6; }
#maintenanceLogsSection { order: 7; }

#maintenanceRunsSection .table-wrap,
#maintenanceLogsSection .log-box {
  max-height: 320px;
}

.stock-table th,
.stock-table td {
  vertical-align: middle;
}

.stock-editable-row {
  cursor: pointer;
}

.stock-editable-row:hover td {
  background: rgba(154, 174, 255, 0.08);
}

.stock-photo-cell {
  width: 236px;
}

.stock-photo-thumb {
  width: 224px;
  height: 224px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(154, 174, 255, 0.35);
  background: rgba(255, 255, 255, 0.05);
}

.stock-photo-placeholder {
  width: 224px;
  height: 224px;
  border-radius: 12px;
  border: 1px dashed rgba(154, 174, 255, 0.35);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

#stockStoreTabs .btn {
  text-align: left;
}

#stockSubSectionOverviewBtn,
#stockSubSectionMovementsBtn {
  text-align: left;
}

#stockInfoBox {
  white-space: pre-wrap;
}

.stock-overview-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.stock-overview-toolbar-fields {
  min-width: 0;
  margin-top: 10px;
}

#stockItemsWrap {
  max-height: min(68vh, 840px);
  margin-top: 10px;
}

#stockOverviewSection.stock-overview-filters-collapsed #stockItemsWrap {
  max-height: min(78vh, 1040px);
}

.stock-overview-tools-menu-wrap {
  position: relative;
  display: inline-flex;
  justify-content: flex-end;
  align-self: end;
}

.stock-overview-tools-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(12, 18, 34, 0.98);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  display: grid;
  gap: 6px;
  z-index: 140;
}

.stock-overview-tools-menu-btn {
  width: 100%;
  justify-content: flex-start;
}

@media (max-width: 900px) {
  .stock-overview-toolbar {
    grid-template-columns: 1fr;
  }

  .stock-overview-tools-menu-wrap {
    justify-content: flex-start;
  }

  .stock-overview-tools-menu {
    right: auto;
    left: 0;
  }
}

.stock-source-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid rgba(154, 174, 255, 0.35);
  background: rgba(154, 174, 255, 0.12);
  color: #d8e4ff;
}

.stock-source-badge.is-local {
  border-color: rgba(255, 214, 122, 0.46);
  background: rgba(255, 214, 122, 0.16);
  color: #ffeec7;
}

.stock-movement-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid rgba(154, 174, 255, 0.35);
  background: rgba(154, 174, 255, 0.12);
  color: #d8e4ff;
}

.stock-movement-type.is-out {
  border-color: rgba(255, 132, 132, 0.4);
  background: rgba(255, 132, 132, 0.15);
  color: #ffd9d9;
}

.stock-movement-type.is-in {
  border-color: rgba(117, 230, 174, 0.45);
  background: rgba(117, 230, 174, 0.15);
  color: #d7ffe9;
}

.stock-movement-type.is-transfer {
  border-color: rgba(114, 198, 255, 0.45);
  background: rgba(114, 198, 255, 0.16);
  color: #d7f0ff;
}

.stock-movement-context {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid rgba(154, 174, 255, 0.35);
  background: rgba(154, 174, 255, 0.12);
  color: #d8e4ff;
}

.stock-movement-context.is-report {
  border-color: rgba(103, 195, 255, 0.45);
  background: rgba(103, 195, 255, 0.16);
  color: #d9f4ff;
}

.stock-movement-context.is-outside {
  border-color: rgba(255, 214, 122, 0.46);
  background: rgba(255, 214, 122, 0.16);
  color: #ffeec7;
}

.stock-movement-context.is-manual {
  border-color: rgba(166, 173, 255, 0.5);
  background: rgba(166, 173, 255, 0.18);
  color: #e2e6ff;
}

:root[data-theme="light"] .stock-movement-type {
  border-color: rgba(86, 112, 153, 0.22);
  background: rgba(226, 235, 251, 0.92);
  color: #18304f;
}

:root[data-theme="light"] .stock-movement-type.is-out {
  border-color: rgba(214, 90, 90, 0.28);
  background: rgba(255, 231, 231, 0.96);
  color: #8d1f1f;
}

:root[data-theme="light"] .stock-movement-type.is-in {
  border-color: rgba(41, 153, 99, 0.28);
  background: rgba(225, 247, 235, 0.96);
  color: #16613f;
}

:root[data-theme="light"] .stock-movement-type.is-transfer {
  border-color: rgba(41, 126, 189, 0.28);
  background: rgba(228, 242, 252, 0.96);
  color: #18507b;
}

:root[data-theme="light"] .stock-movement-context {
  border-color: rgba(86, 112, 153, 0.22);
  background: rgba(226, 235, 251, 0.92);
  color: #18304f;
}

:root[data-theme="light"] .stock-movement-context.is-report {
  border-color: rgba(41, 126, 189, 0.28);
  background: rgba(228, 242, 252, 0.96);
  color: #18507b;
}

:root[data-theme="light"] .stock-movement-context.is-outside {
  border-color: rgba(190, 140, 39, 0.28);
  background: rgba(255, 244, 220, 0.98);
  color: #7b560f;
}

:root[data-theme="light"] .stock-movement-context.is-manual {
  border-color: rgba(113, 94, 195, 0.24);
  background: rgba(236, 232, 255, 0.96);
  color: #44308f;
}

#stockMovementsInfoBox {
  white-space: pre-wrap;
}

.stock-movement-create-card {
  border-style: dashed;
}

.stock-movement-create-grid {
  margin-bottom: 8px;
}

.stock-photo-button {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.stock-photo-button:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
  border-radius: 10px;
}

.stock-order-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: #b9d3ff;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.stock-order-link:hover {
  color: #e5f0ff;
}

.stock-order-link:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
  border-radius: 4px;
}

.stock-edit-action-btn {
  min-width: 88px;
}

.stock-edit-actions {
  white-space: nowrap;
  text-align: right;
}

.stock-article-actions-menu-wrap {
  position: relative;
  display: inline-flex;
  justify-content: flex-end;
}

.stock-article-actions-toggle {
  min-width: 40px;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
}

.stock-article-actions-toggle-dots {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.stock-article-actions-toggle-dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  display: block;
}

.stock-article-actions-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 190px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(12, 18, 34, 0.98);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  display: grid;
  gap: 6px;
  z-index: 140;
}

.stock-article-actions-menu-btn {
  width: 100%;
  justify-content: flex-start;
}

:root[data-theme="light"] .stock-overview-tools-menu,
:root[data-theme="light"] .stock-article-actions-menu {
  background: rgba(250, 252, 255, 0.98);
  box-shadow: 0 12px 24px rgba(16, 40, 71, 0.14);
}

.stock-article-edit-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  align-items: end;
  margin-bottom: 8px;
}

.stock-article-edit-field {
  min-width: 0;
  grid-column: span 2;
}

.stock-article-edit-field--medium {
  grid-column: span 3;
}

.stock-article-edit-field--wide {
  grid-column: span 4;
}

.stock-article-edit-field--xwide {
  grid-column: span 6;
}

.stock-article-edit-field--full {
  grid-column: 1 / -1;
}

.stock-article-edit-field-label {
  display: block;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

.stock-article-edit-field--inline {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.stock-article-edit-field--inline .stock-article-edit-field-label {
  margin: 0;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.stock-article-edit-field--inline-wide-label {
  grid-template-columns: 132px minmax(0, 1fr);
}

.stock-article-edit-field--inline input {
  min-width: 0;
  width: min(100%, calc(var(--stock-article-edit-input-ch, 8) * 1ch + 26px));
  max-width: 100%;
  justify-self: start;
  field-sizing: content;
}

.stock-article-edit-photos-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.stock-article-edit-photos-heading {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.stock-article-edit-photos-heading--inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.stock-article-edit-photos-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stock-article-edit-photos-actions:empty {
  display: none;
}

.stock-article-edit-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(224px, 224px));
  gap: 12px;
  justify-content: start;
}

.stock-article-edit-photo-card {
  position: relative;
  width: 224px;
  display: grid;
  gap: 8px;
  align-content: start;
}

.stock-article-edit-photo-thumb-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 224px;
  height: 224px;
  padding: 0;
  border: 1px solid rgba(154, 174, 255, 0.22);
  border-radius: 12px;
  background: rgba(6, 12, 26, 0.68);
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.stock-article-edit-photo-thumb-btn .stock-photo-thumb,
.stock-article-edit-photo-thumb-btn .stock-photo-placeholder {
  width: 224px;
  height: 224px;
  border: 0;
  border-radius: 0;
}

.stock-article-edit-photo-thumb-btn:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
}

.stock-article-edit-photo-card--primary .stock-article-edit-photo-thumb-btn {
  border-color: var(--accent2);
  box-shadow: 0 0 0 2px rgba(87, 213, 255, 0.18), 0 10px 24px rgba(0, 0, 0, 0.2);
}

.stock-article-edit-photo-primary-btn {
  width: 224px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid rgba(154, 174, 255, 0.24);
  background: rgba(16, 25, 48, 0.82);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.stock-article-edit-photo-card--primary .stock-article-edit-photo-primary-btn {
  border-color: rgba(87, 213, 255, 0.5);
  background: rgba(25, 70, 88, 0.72);
  color: #e9fbff;
}

.stock-article-edit-photo-primary-btn[disabled] {
  opacity: 0.72;
  cursor: default;
}

.stock-article-edit-photo-delete-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  min-width: 26px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

.stock-article-edit-photo-delete-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.stock-article-edit-field--toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.stock-article-edit-field--toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

.stock-article-edit-toggle-text {
  color: var(--text);
  font-size: 14px;
  line-height: 1.25;
}

@media (max-width: 1180px) {
  .stock-article-edit-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .stock-article-edit-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .stock-article-edit-field--inline,
  .stock-article-edit-field--inline-wide-label {
    display: block;
  }

  .stock-article-edit-field--inline .stock-article-edit-field-label {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .stock-article-edit-field--inline input {
    width: 100%;
    justify-self: stretch;
  }

  .stock-article-edit-photos-actions {
    width: 100%;
  }

  .stock-article-edit-photos-actions input[type="file"] {
    width: 100%;
  }

  .stock-article-edit-field--wide,
  .stock-article-edit-field--xwide {
    grid-column: 1 / -1;
  }

  .stock-article-edit-field--medium {
    grid-column: span 2;
  }
}

@media (max-width: 520px) {
  .stock-article-edit-grid {
    grid-template-columns: 1fr;
  }

  .stock-article-edit-field,
  .stock-article-edit-field--medium,
  .stock-article-edit-field--wide,
  .stock-article-edit-field--xwide,
  .stock-article-edit-field--full {
    grid-column: 1 / -1;
  }

  .stock-article-edit-photo-grid {
    grid-template-columns: repeat(auto-fit, minmax(224px, 224px));
    justify-content: start;
  }
}

#stockArticleEditStatus {
  white-space: pre-wrap;
}

.stock-photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(4, 8, 20, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.stock-photo-lightbox-card {
  width: min(92vw, 1180px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid rgba(154, 174, 255, 0.28);
  border-radius: 16px;
  background: rgba(7, 12, 30, 0.98);
  padding: 14px;
}

.stock-photo-lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.stock-photo-lightbox-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.stock-photo-lightbox-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.stock-photo-lightbox-body {
  margin-top: 12px;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stock-photo-lightbox-image {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 180px);
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid rgba(154, 174, 255, 0.22);
  background: rgba(255, 255, 255, 0.03);
}

body.stock-photo-lightbox-open {
  overflow: hidden;
}

@media (max-width: 720px) {
  .stock-photo-lightbox-header {
    align-items: stretch;
  }

  .stock-photo-lightbox-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

.planning-calendar-wrap {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 640px;
}

.planning-calendar-board {
  --planning-left-width: 240px;
  --planning-row-height: 42px;
  --planning-day-width: 18px;
  --planning-day-count: 31;
  --planning-timeline-width: calc(var(--planning-day-count) * var(--planning-day-width));
  min-width: calc(var(--planning-left-width) + var(--planning-timeline-width));
  display: grid;
  grid-template-columns: var(--planning-left-width) var(--planning-timeline-width);
  grid-auto-rows: min-content;
}

.planning-calendar-corner {
  position: sticky;
  left: 0;
  z-index: 4;
  background: rgba(8, 11, 23, 0.96);
  border-right: 1px solid rgba(154, 174, 255, 0.22);
  border-bottom: 1px solid rgba(154, 174, 255, 0.22);
  min-height: 68px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  font-weight: 700;
  color: #d7e1ff;
}

.planning-calendar-header {
  position: sticky;
  top: 0;
  z-index: 3;
  background: rgba(8, 11, 23, 0.96);
  border-bottom: 1px solid rgba(154, 174, 255, 0.22);
}

.planning-calendar-months {
  position: relative;
  height: 36px;
  border-bottom: 1px solid rgba(154, 174, 255, 0.16);
  overflow: hidden;
}

.planning-calendar-month-segment {
  position: absolute;
  top: 0;
  bottom: 0;
  border-right: 1px solid rgba(154, 174, 255, 0.28);
  border-left: 1px solid rgba(154, 174, 255, 0.12);
  background: linear-gradient(
    180deg,
    rgba(79, 156, 255, 0.18),
    rgba(79, 156, 255, 0.05)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: #d5deff;
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.planning-calendar-month-segment.today {
  background: linear-gradient(
    180deg,
    rgba(255, 209, 102, 0.36),
    rgba(255, 209, 102, 0.14)
  );
  border-right-color: rgba(255, 209, 102, 0.65);
  border-left-color: rgba(255, 209, 102, 0.45);
  color: #fff1cc;
  text-shadow: 0 0 8px rgba(255, 209, 102, 0.25);
}

.planning-calendar-weeks {
  position: relative;
  height: 30px;
  overflow: hidden;
}

.planning-calendar-days {
  position: relative;
  height: 22px;
  overflow: hidden;
  border-top: 1px solid rgba(154, 174, 255, 0.16);
}

.planning-calendar-week-cell {
  position: absolute;
  top: 0;
  bottom: 0;
  border-right: 1px dashed rgba(154, 174, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #afbbeb;
  background: rgba(255, 255, 255, 0.015);
}

.planning-calendar-day-cell {
  position: absolute;
  top: 0;
  bottom: 0;
  border-right: 1px dashed rgba(154, 174, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #9fb0ea;
  background: rgba(255, 255, 255, 0.012);
  font-weight: 600;
}

.planning-calendar-week-cell.today {
  background: linear-gradient(
    180deg,
    rgba(255, 209, 102, 0.32),
    rgba(255, 209, 102, 0.14)
  );
  border-right-style: solid;
  border-right-color: rgba(255, 209, 102, 0.75);
  color: #fff1c7;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255, 209, 102, 0.28);
}

.planning-calendar-day-cell.today {
  background: linear-gradient(
    180deg,
    rgba(255, 209, 102, 0.26),
    rgba(255, 209, 102, 0.12)
  );
  border-right-style: solid;
  border-right-color: rgba(255, 209, 102, 0.75);
  color: #fff1c7;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255, 209, 102, 0.28);
}

.planning-calendar-row-label {
  position: sticky;
  left: 0;
  z-index: 2;
  min-height: var(--planning-row-height);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-right: 1px solid rgba(154, 174, 255, 0.2);
  border-bottom: 1px solid rgba(154, 174, 255, 0.14);
  background: rgba(13, 18, 36, 0.96);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.planning-calendar-row-label .meta {
  font-size: 11px;
  color: #a8b3de;
  font-weight: 500;
  margin-left: auto;
  flex-shrink: 0;
}

.planning-calendar-track {
  position: relative;
  min-height: var(--planning-row-height);
  border-bottom: 1px solid rgba(154, 174, 255, 0.14);
  background-color: rgba(255, 255, 255, 0.01);
  background-image:
    repeating-linear-gradient(
      to right,
      rgba(154, 174, 255, 0.16) 0,
      rgba(154, 174, 255, 0.16) 1px,
      transparent 1px,
      transparent var(--planning-day-width)
    );
}

.planning-calendar-track.alt {
  background-color: rgba(79, 156, 255, 0.05);
}

.planning-calendar-today-band {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid rgba(255, 209, 102, 0.62);
  border-right: 1px solid rgba(255, 209, 102, 0.62);
  background: linear-gradient(
    180deg,
    rgba(255, 209, 102, 0.2),
    rgba(255, 209, 102, 0.08)
  );
  pointer-events: none;
  z-index: 1;
}

.planning-calendar-now-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 2px solid rgba(94, 240, 177, 0.9);
  box-shadow: 0 0 0 1px rgba(94, 240, 177, 0.22);
  pointer-events: none;
  z-index: 3;
}

.planning-calendar-now-label {
  position: absolute;
  top: 4px;
  transform: translateX(-50%);
  background: rgba(94, 240, 177, 0.92);
  color: #032117;
  border: 1px solid rgba(94, 240, 177, 0.95);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
  z-index: 4;
}

.planning-calendar-event {
  position: absolute;
  top: 8px;
  height: calc(var(--planning-row-height) - 16px);
  cursor: pointer;
  border-radius: 7px;
  border: 1px solid rgba(0, 0, 0, 0.22);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.24);
  padding: 3px 6px;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  z-index: 2;
}

.planning-calendar-event.unavailability {
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(255, 70, 89, 0.55) 0,
    rgba(255, 70, 89, 0.55) 4px,
    rgba(255, 255, 255, 0.22) 4px,
    rgba(255, 255, 255, 0.22) 8px
  ) !important;
}

.planning-calendar-empty {
  grid-column: 1 / -1;
  padding: 16px;
  color: #c6d3ff;
  font-size: 13px;
}

.planning-calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.planning-calendar-legend .chip {
  font-size: 10px;
  padding: 3px 7px;
}

.planning-title-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.planning-exported-at {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
}

.planning-controls-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.planning-filters-panel {
  display: grid;
  gap: 10px;
}

.audit-stats-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin: 10px 0 12px;
}

.audit-stat-card {
  border: 1px solid rgba(154, 174, 255, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  padding: 10px 12px;
  min-height: 72px;
}

.audit-stat-card .label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.audit-stat-card .value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  color: #d9e4ff;
}

.audit-chart-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin: 8px 0 14px;
}

.audit-chart-card {
  border: 1px solid rgba(154, 174, 255, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 12px;
}

.audit-chart-card h3 {
  margin: 0 0 8px;
  font-size: 14px;
  color: #dce6ff;
}

.audit-bars {
  display: grid;
  gap: 6px;
}

.audit-bar-row {
  display: grid;
  grid-template-columns: minmax(180px, 2.2fr) minmax(120px, 3fr) 52px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: #cfd9ff;
}

.audit-bar-label {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.25;
  color: var(--muted);
}

#auditDailyChart .audit-bar-row {
  grid-template-columns: 88px 1fr 52px;
}

#auditDailyChart .audit-bar-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audit-bar-track {
  position: relative;
  height: 9px;
  border-radius: 999px;
  border: 1px solid rgba(154, 174, 255, 0.24);
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.audit-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(79, 156, 255, 0.95), rgba(94, 240, 177, 0.88));
}

.audit-bar-value {
  text-align: right;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: #d8e5ff;
}

.audit-empty {
  color: var(--muted);
  font-style: italic;
  font-size: 13px;
  padding: 8px 2px;
}

.audit-details {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  white-space: pre-wrap;
  word-break: break-word;
}

.audit-filters {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin: 0 0 12px;
}

.audit-filter-search {
  grid-column: 1 / -1;
}

.audit-recent-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

#auditRecentMeta {
  margin: 0;
}

.communication-layout {
  display: grid;
  gap: 12px;
  grid-template-columns: 320px minmax(0, 1fr);
  align-items: start;
}

.communication-layout.single-pane {
  grid-template-columns: 1fr;
}

.communication-side,
.communication-main {
  border: 1px solid rgba(154, 174, 255, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  padding: 12px;
}

.communication-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.communication-subtab-active {
  border-color: transparent !important;
  background: rgba(79, 156, 255, 0.18) !important;
  box-shadow: inset 0 -2px 0 rgba(94, 240, 177, 0.9);
  color: var(--text) !important;
  font-weight: 700;
}

:root[data-theme="light"] .communication-subtab-active {
  background: rgba(47, 132, 255, 0.1) !important;
  color: #102847 !important;
  box-shadow: inset 0 -2px 0 rgba(18, 184, 134, 0.78);
}

.communication-thread-list {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  max-height: 360px;
  overflow: auto;
  display: grid;
  gap: 0;
}

.communication-thread-item {
  border: 0;
  border-bottom: 1px solid rgba(154, 174, 255, 0.15);
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 10px;
  cursor: pointer;
  font: inherit;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
}

.communication-thread-item:last-child {
  border-bottom: 0;
}

.communication-thread-item.active {
  background: rgba(79, 156, 255, 0.2);
}

.communication-thread-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #052235;
  background: linear-gradient(
    135deg,
    rgba(79, 156, 255, 0.92),
    rgba(94, 240, 177, 0.78)
  );
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.communication-thread-content {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.communication-thread-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.communication-thread-date {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
}

.communication-thread-item.unread .communication-thread-title {
  font-weight: 800;
}

.communication-thread-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.communication-thread-sub {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.communication-users-list {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  max-height: 360px;
  overflow: auto;
  padding: 8px;
  display: grid;
  gap: 8px;
}

.communication-user-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(154, 174, 255, 0.18);
  border-radius: 10px;
  padding: 8px;
}

.communication-ai-result {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(7, 12, 23, 0.52);
  min-height: 260px;
  max-height: 460px;
  overflow: auto;
  padding: 10px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
}

.communication-messages-box {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.15);
  min-height: 300px;
  max-height: 420px;
  overflow: auto;
  padding: 10px;
  display: grid;
  gap: 10px;
}

.communication-messages-box.menu-overlay-open {
  overflow: visible !important;
}

.communication-message {
  border: 1px solid rgba(154, 174, 255, 0.2);
  border-radius: 16px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.05);
  max-width: min(76%, 680px);
  width: fit-content;
  justify-self: start;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: visible;
  z-index: 1;
}

.communication-message.menu-open {
  z-index: 120;
}

.communication-message.selected {
  outline: 2px solid rgba(79, 156, 255, 0.75);
  outline-offset: 1px;
}

.communication-message.own {
  border-color: rgba(98, 242, 181, 0.5);
  background: linear-gradient(
    165deg,
    rgba(98, 242, 181, 0.24),
    rgba(98, 242, 181, 0.11)
  );
  justify-self: end;
}

.communication-message-meta {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 6px;
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.communication-message-meta-main {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.communication-message-meta-main .time {
  opacity: 0.85;
}

.communication-message-meta-menu {
  margin-left: auto;
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 130;
}

.communication-message.own .communication-message-meta-main {
  margin-left: auto;
  justify-content: flex-end;
  text-align: right;
}

.communication-message.own .communication-message-meta-menu {
  margin-left: 0;
  margin-right: auto;
}

.communication-message-body {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.4;
  font-size: 14px;
}

.communication-message-body.deleted {
  font-style: italic;
  color: var(--muted);
}

.communication-message-status {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}

.communication-message.own .communication-message-status {
  text-align: right;
}

.communication-attachments {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.communication-message.own .communication-attachments {
  justify-content: flex-end;
}

.comm-msg-menu-toggle {
  border: 1px solid rgba(154, 174, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  border-radius: 8px;
  padding: 2px 8px;
  cursor: pointer;
  line-height: 1.2;
  font-size: 14px;
}

.comm-msg-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 99999;
  min-width: 170px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(12, 18, 34, 0.98);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  padding: 6px;
  display: grid;
  gap: 4px;
  max-height: min(60vh, 420px);
  overflow: auto;
}

.comm-msg-menu.comm-msg-menu-up {
  top: auto;
  bottom: calc(100% + 4px);
}

.comm-msg-menu button {
  text-align: left;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.comm-msg-menu button:hover {
  border-color: rgba(154, 174, 255, 0.25);
  background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 760px) {
  .communication-message {
    max-width: 92%;
  }
  .technician-meta-grid,
  .technician-skeleton-form {
    grid-template-columns: 1fr;
  }
  .technician-report-modal {
    padding: 10px;
  }
  .technician-report-modal-card {
    max-height: calc(100vh - 20px);
    padding: 14px;
  }
  .technician-report-modal-header,
  .technician-report-modal-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .technician-report-modal-footer-group,
  .technician-report-modal-actions {
    justify-content: space-between;
  }
  .technician-report-modal-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }
  .technician-report-modal-grid {
    grid-template-columns: 1fr;
  }
  .installation-create-grid {
    grid-template-columns: 1fr;
  }
  .technician-report-modal-info-grid,
  .technician-report-modal-photo-grid {
    grid-template-columns: 1fr;
  }
}

.communication-docs-table th,
.communication-docs-table td {
  white-space: nowrap;
}

.communication-group-members-table th,
.communication-group-members-table td {
  white-space: nowrap;
}

.communication-group-row {
  cursor: pointer;
}

.communication-group-row:hover {
  background: rgba(79, 156, 255, 0.12);
}

.communication-manage-meta {
  padding: 8px 10px;
  border: 1px dashed rgba(154, 174, 255, 0.35);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.customer-portal-toolbar {
  align-items: end;
}

.customer-portal-admin-layout {
  display: grid;
  grid-template-columns: minmax(320px, 45%) minmax(360px, 1fr);
  gap: 14px;
  align-items: start;
}

.customer-portal-admin-list {
  max-height: 620px;
}

.customer-portal-admin-list tr,
.customer-portal-admin-detail tr,
tr[data-cp-account-id] {
  cursor: pointer;
}

.customer-portal-admin-list tr:hover,
tr[data-cp-account-id]:hover,
.selected-row {
  background: rgba(79, 156, 255, 0.14);
}

.customer-portal-admin-detail,
.customer-portal-account-form,
.customer-portal-action-box {
  border: 1px solid rgba(154, 174, 255, 0.22);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.customer-portal-detail-grid,
.customer-portal-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.customer-portal-detail-grid > div {
  border: 1px solid rgba(154, 174, 255, 0.16);
  border-radius: 8px;
  padding: 10px;
}

.customer-portal-detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.customer-portal-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.customer-portal-status-new {
  color: #ffe08a;
  background: rgba(180, 113, 16, 0.22);
}

.customer-portal-status-accepted,
.customer-portal-status-in_progress {
  color: #9ed0ff;
  background: rgba(79, 156, 255, 0.18);
}

.customer-portal-status-resolved,
.customer-portal-status-closed {
  color: #9be3b4;
  background: rgba(58, 160, 103, 0.18);
}

.customer-portal-status-refused,
.customer-portal-status-cancelled {
  color: #ffb4a8;
  background: rgba(220, 70, 55, 0.18);
}

.customer-portal-pre {
  white-space: pre-wrap;
}

.customer-portal-timeline {
  display: grid;
  gap: 10px;
}

.customer-portal-timeline > div {
  border-left: 3px solid rgba(154, 174, 255, 0.35);
  padding-left: 10px;
}

.customer-portal-timeline p {
  margin: 4px 0;
  white-space: pre-wrap;
}

.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.checkbox-line input {
  width: auto;
}

@media (max-width: 980px) {
  .customer-portal-admin-layout,
  .customer-portal-detail-grid,
  .customer-portal-form-grid {
    grid-template-columns: 1fr;
  }
}


