﻿:root {
  --bg: #eef3f9;
  --panel: #ffffff;
  --line: #d8e2ef;
  --line-strong: #b8c8dc;
  --text: #06152b;
  --muted: #5f7089;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --green: #087b25;
  --danger: #dc2626;
  --soft: #e7edf5;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  max-width: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  overflow-x: hidden;
}

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

button {
  border: 0;
  cursor: pointer;
  font-weight: 700;
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.auth-view {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}

.auth-card {
  width: min(520px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .14);
}

.auth-card h1 {
  margin: 0 0 8px;
}

.auth-card h2 {
  margin: 18px 0 8px;
  font-size: 18px;
}

.auth-error {
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: 10px;
  background: #fee2e2;
  color: #991b1b;
  font-weight: 700;
  line-height: 1.35;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.access-form {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.link-button {
  justify-self: start;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 800;
}

.link-button:hover {
  text-decoration: underline;
}

.choice-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, .45);
}

.choice-box {
  width: min(420px, 100%);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .24);
}

.choice-box h3 {
  margin: 0 0 14px;
}

.form-modal-box {
  display: grid;
  gap: 12px;
}

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

.modal-description {
  margin: -4px 0 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #eff6ff;
  color: #1e3a8a;
  line-height: 1.35;
}

.modal-description.warning {
  background: #fffbeb;
  color: #92400e;
}

.modal-description.info {
  background: #eff6ff;
  color: #1e3a8a;
}

.details-modal-box {
  width: min(760px, calc(100vw - 36px));
  max-height: calc(100vh - 44px);
  overflow: auto;
}

.modal-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.details-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.details-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
  vertical-align: top;
}

.details-table td:first-child {
  width: 34%;
  background: #f8fafc;
  color: #475569;
  font-weight: 800;
}

.execution-comments-box {
  width: min(640px, calc(100vw - 36px));
  max-height: calc(100vh - 44px);
  display: flex;
  flex-direction: column;
}

.execution-comment-list {
  display: grid;
  gap: 10px;
  max-height: min(440px, 50vh);
  overflow: auto;
  padding-right: 4px;
}

.execution-comment-item {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}

.execution-comment-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #475569;
  font-size: 12px;
}

.execution-comment-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.execution-comment-input {
  min-height: 82px;
  margin-top: 12px;
}

.readonly-input,
input:disabled.readonly-input {
  background: #eef2f7;
  color: #64748b;
  cursor: not-allowed;
}

.field-hint {
  min-height: 18px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}

.field-hint.info {
  color: #2563eb;
  font-weight: 700;
}

.choice-select {
  width: 100%;
  min-height: 42px;
}

.theme-box .field {
  min-width: 0;
}

.theme-swatches {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin: 12px 0 16px;
}

.theme-swatch {
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

.choice-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

/*
 * Teljes képernyős felugró ablakok, ha a Projektek vagy a Kivitelezés oldalon
 * be van kapcsolva a mobil nézet (body.mobile-fullscreen-modals). Így telefonon
 * könnyebb a szerkesztés: nagyobb mezők, görgethető tartalom, alul mindig
 * elérhető gombok.
 */
body.mobile-fullscreen-modals .choice-modal {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
}

body.mobile-fullscreen-modals .choice-box {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  border: 0;
  border-radius: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
}

/* Nagy, jól olvasható cím és mezőcímkék - a korábbi méret kb. duplája, hogy
   nagy, nagy felbontású telefonon is kényelmesen kezelhető legyen. */
body.mobile-fullscreen-modals .choice-box h3 {
  font-size: 34px;
  margin-bottom: 24px;
}

body.mobile-fullscreen-modals .choice-box .field {
  gap: 10px;
  margin-bottom: 12px;
}

body.mobile-fullscreen-modals .choice-box .field span,
body.mobile-fullscreen-modals .choice-box label > span {
  font-size: 32px;
  font-weight: 700;
}

body.mobile-fullscreen-modals .modal-description {
  font-size: 28px;
  padding: 18px 20px;
}

/* Ujjbarát, magas beviteli mezők, jól olvasható betűmérettel. */
body.mobile-fullscreen-modals .choice-box input,
body.mobile-fullscreen-modals .choice-box select,
body.mobile-fullscreen-modals .choice-box textarea {
  min-height: 78px;
  padding: 16px 18px;
  font-size: 32px;
  border-radius: 12px;
}

body.mobile-fullscreen-modals .choice-box textarea {
  min-height: 200px;
}

body.mobile-fullscreen-modals .choice-box input[type="color"] {
  min-height: 78px;
  padding: 6px;
}

/* A gombok az ablak alján, teljes szélességben, egymás alatt - így a hosszabb
   feliratok sem tördelődnek, és mindegyik kényelmesen nyomható. Alul ragadnak,
   hogy görgetés nélkül is elérhetők legyenek. */
body.mobile-fullscreen-modals .choice-actions {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  flex-direction: column;
  gap: 12px;
  padding: 16px 0 4px;
  background: #fff;
  border-top: 1px solid var(--line);
}

body.mobile-fullscreen-modals .choice-actions button {
  width: 100%;
  min-height: 116px;
  padding: 0 20px;
  font-size: 50px;
  border-radius: 14px;
}

.inline-cell-editor {
  display: grid;
  gap: 6px;
  width: min(140px, 100%);
}

.inline-cell-editor input,
.inline-cell-editor select {
  width: 100%;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.compact-save-button {
  width: 100%;
  min-height: 30px;
  padding: 6px 8px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 100vw;
  min-height: 54px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 248, 252, .96);
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.brand {
  font-size: 20px;
  font-weight: 800;
  white-space: nowrap;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Hamburger gomb: asztali nézetben rejtett, mobil felületen a márkanév mellett
   jelenik meg és lenyitja a menüt. */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 54px;
  height: 48px;
  padding: 0 13px;
  border-radius: 8px;
  background: var(--soft);
}

.nav-toggle span {
  display: block;
  height: 3px;
  border-radius: 2px;
  background: var(--text);
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.nav-button,
.secondary-button,
.select-button {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--text);
}

.nav-button.active,
.primary-button {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
}

.primary-button:hover {
  background: var(--blue-dark);
}

.danger-button {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  background: #fee2e2;
  color: #991b1b;
}

.admin-transfer-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.admin-file-input {
  min-height: 36px;
  max-width: 420px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.user-pill {
  display: grid;
  grid-template-columns: auto minmax(110px, auto) auto auto;
  grid-auto-rows: auto;
  align-items: center;
  column-gap: 8px;
  row-gap: 2px;
  min-width: 0;
  line-height: 1.15;
}

.user-pill span,
.user-pill small {
  display: block;
}

.user-pill small {
  color: var(--muted);
}

.user-pill span,
.user-pill small {
  grid-column: 2;
}

.user-pill #currentUserName {
  grid-row: 1;
}

.user-pill #currentUserRole {
  grid-row: 2;
}

.view-as-wrap {
  grid-column: 1;
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  white-space: nowrap;
}

.view-as-wrap select {
  width: 112px;
  min-width: 112px;
  max-width: 128px;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.user-pill #themeButton,
.user-pill #logoutButton {
  grid-row: 1 / span 2;
}

.user-pill .local-manager-button {
  grid-row: 1 / span 2;
  min-width: 38px;
  min-height: 34px;
  padding: 0 9px;
  font-size: 19px;
  line-height: 1;
}

/*
 * Mobil felület: a fejléc (topbar) a képernyő szélességétől függetlenül
 * mobilbarát elrendezést kap, mert a mobil nézet kézi kapcsoló. A menü és a
 * felhasználói vezérlők nagyobbak és sorokba tördelnek, hogy semmi ne lógjon ki
 * és ujjal könnyen kezelhető legyen.
 */
body.mobile-ui .topbar {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 10px;
  padding: 12px;
}

body.mobile-ui .brand-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

body.mobile-ui .brand {
  white-space: normal;
  font-size: 26px;
}

body.mobile-ui .nav-toggle {
  display: flex;
}

/* Mobil felületen a menü alapból zárva; a hamburger gomb nyitja ki. */
body.mobile-ui .main-nav {
  display: none;
  flex-wrap: wrap;
  width: 100%;
  gap: 8px;
}

body.mobile-ui.nav-open .main-nav {
  display: flex;
}

body.mobile-ui .main-nav .nav-button {
  flex: 1 1 30%;
  min-height: 54px;
  font-size: 20px;
}

body.mobile-ui .user-pill {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
  gap: 8px 10px;
}

body.mobile-ui .user-pill #currentUserName {
  flex: 1 1 auto;
  font-size: 18px;
  font-weight: 700;
}

body.mobile-ui .user-pill #currentUserRole {
  font-size: 14px;
}

body.mobile-ui .view-as-wrap {
  flex: 1 1 100%;
  font-size: 16px;
}

body.mobile-ui .view-as-wrap select {
  flex: 1;
  width: 100%;
  max-width: none;
  min-height: 48px;
  font-size: 18px;
}

body.mobile-ui .user-pill .secondary-button,
body.mobile-ui .user-pill .small-button {
  min-height: 50px;
  padding: 0 16px;
  font-size: 18px;
}

body.mobile-ui .user-pill .local-manager-button {
  min-height: 50px;
  min-width: 56px;
  font-size: 24px;
}

/* A Téma és a Kilépés gomb kitölti a rendelkezésre álló helyet. */
body.mobile-ui .user-pill #themeBtn,
body.mobile-ui .user-pill #logoutBtn {
  flex: 1 1 130px;
}

.small-button {
  min-height: 28px;
  padding: 0 10px;
}

.app-shell {
  padding: 16px;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

.view {
  display: none;
  max-width: 100%;
}

.view.active {
  display: block;
}

.page-head,
.panel {
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  max-width: 100%;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: 26px;
}

h2 {
  margin-bottom: 12px;
  font-size: 18px;
}

p {
  margin-bottom: 0;
  color: var(--muted);
}

.button-row,
.form-actions,
.pager {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.project-editor-actions {
  justify-content: space-between;
  width: 100%;
}

.project-editor-actions .danger-button {
  margin-left: auto;
}

.admin-stack {
  display: grid;
  gap: 14px;
}

.admin-collapsible summary {
  cursor: pointer;
  font-size: 18px;
  font-weight: 800;
}

.admin-collapsible .data-table {
  margin-top: 14px;
}

.admin-panel h3 {
  margin: 14px 0 8px;
  font-size: 15px;
}

.admin-table input[type="text"],
.admin-table input[type="number"],
.admin-table select {
  width: 100%;
  min-width: 130px;
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.permission-matrix {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
}

.permission-matrix th,
.permission-matrix td {
  padding: 8px 10px;
  text-align: center;
  white-space: nowrap;
}

.permission-page-col {
  width: 220px;
}

.permission-check-col {
  width: 92px;
}

.permission-status-col {
  width: 120px;
}

.permission-matrix th:first-child,
.permission-matrix td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 220px;
  max-width: 220px;
  text-align: left;
  background: #fff;
}

.permission-matrix thead th:first-child {
  z-index: 2;
  background: #f6f8fb;
}

.permission-role-head {
  border-left: 2px solid #d7e2ef;
  border-right: 2px solid #d7e2ef;
  background: #eef4fb !important;
  font-weight: 800;
}

.permission-control-head {
  width: 92px;
  background: #f7fafc !important;
  font-size: 11px !important;
}

.permission-page-head,
.permission-page-cell {
  border-right: 2px solid #d7e2ef;
  font-weight: 700;
}

.permission-page-cell {
  overflow: hidden;
  text-overflow: ellipsis;
}

.permission-check-cell {
  width: 92px;
}

.permission-check-cell input[type="checkbox"] {
  display: block;
  margin: 0 auto;
}

.permission-group-end-cell {
  border-right: 2px solid #d7e2ef;
}

.status-permission-matrix .permission-role-head,
.status-permission-matrix .permission-control-head,
.status-permission-matrix .permission-check-cell {
  width: 120px;
}

.inspector-block {
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}

.inspector-block summary {
  padding: 12px 14px;
  font-weight: 800;
  cursor: pointer;
}

.inspector-block .table-shell {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.placeholder-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metric-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  text-align: center;
}

.metric-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.metric-card strong {
  font-size: 24px;
}

.stat-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 8px 18px;
}

.stat-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.stat-bar {
  grid-column: 1 / -1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft);
}

.stat-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-head h2 {
  margin: 0;
}

.section-head input[type="search"] {
  min-width: min(460px, 45vw);
}

.dashboard-task-tools {
  justify-content: flex-end;
  flex: 1;
}

.dashboard-task-tools input[type="search"] {
  flex: 1;
  min-width: 260px;
  max-width: 520px;
}

.filter-row,
.execution-toolbar {
  position: relative;
  display: flex;
  align-items: end;
  gap: 10px;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.execution-toolbar {
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
}

.execution-toolbar .field {
  min-width: 150px;
}

.execution-toolbar .field.mini {
  min-width: 90px;
  width: 120px;
}

.execution-toolbar .field.grow {
  min-width: 240px;
}

.execution-nav-buttons {
  align-self: end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
}

.field.mini {
  min-width: 110px;
}

.field.grow {
  flex: 1;
  min-width: 260px;
}

.field span {
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

textarea {
  min-height: 84px;
  resize: vertical;
}

.check-menu {
  position: absolute;
  z-index: 30;
  min-width: 260px;
  max-height: 320px;
  overflow: auto;
  margin-top: 4px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, .18);
}

.check-menu label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 4px;
  white-space: nowrap;
}

/* A hónapszűrő a gombsor jobb szélén áll, ezért a menü jobbra igazodik,
   hogy ne lógjon ki a képernyőről. */
.month-filter-wrap {
  position: relative;
}

.month-filter-menu {
  right: 0;
  min-width: 220px;
}

.month-filter-menu .check-menu-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.check-menu input {
  width: auto;
  min-height: 0;
}

/* Figyelmeztetés, ha a lista nem a teljes adathalmazt mutatja. */
.list-warning {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid #fcd34d;
  border-radius: 10px;
  background: #fffbeb;
  color: #92400e;
  font-weight: 700;
  line-height: 1.35;
}

.hidden {
  display: none !important;
}

.table-shell {
  overflow: auto;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  background: #f6f8fb;
  font-size: 12px;
}

.data-table.compact th {
  background: var(--green);
  color: #fff;
}

.data-table.compact th:nth-child(2),
.data-table.compact td:nth-child(2),
.data-table.compact th:nth-child(3),
.data-table.compact td:nth-child(3) {
  width: 1%;
  min-width: 56px;
  max-width: 72px;
  text-align: center;
  white-space: nowrap;
}

.data-table.compact th:nth-child(8),
.data-table.compact td:nth-child(8),
.data-table.compact th:nth-child(9),
.data-table.compact td:nth-child(9) {
  text-align: center;
}

.data-table.compact td:nth-child(8) .pill,
.data-table.compact td:nth-child(9) .pill {
  margin-inline: auto;
}

.data-table .fit {
  width: 1%;
  white-space: nowrap;
}

.data-table tbody tr:hover {
  background: #f8fbff;
}

.data-table tbody tr.task-row-overdue {
  background: #fee2e2;
}

.data-table tbody tr.project-row-overdue {
  background: #fecaca !important;
}

.data-table tbody tr.task-row-today {
  background: #fff1cc;
}

.data-table tbody tr.task-row-future {
  background: #eaf4ff;
}

.data-table tbody tr.task-row-neutral {
  background: #f8fafc;
}

.error-text {
  color: #991b1b;
  font-weight: 700;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 7px;
  background: #e0f2fe;
  color: #075985;
  font-weight: 800;
  white-space: nowrap;
}

.clickable-pill {
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
}

.clickable-pill:focus {
  outline: 3px solid rgba(37, 99, 235, .28);
  outline-offset: 2px;
}

.disabled-pill {
  cursor: not-allowed;
  opacity: .65;
  box-shadow: none;
}

.status-pill {
  background: #0ea5e9;
  color: #fff;
}

.comm-pill {
  background: #6366f1;
  color: #fff;
}

.action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--soft);
}

.pager {
  justify-content: center;
  margin-top: 12px;
}

.pager button.active {
  background: var(--blue);
  color: #fff;
}

.pager-summary {
  color: var(--muted);
  font-weight: 700;
  margin-left: 8px;
}

.secondary-button.active {
  background: var(--blue);
  color: #fff;
}

/*
 * Projektek mobil nézetben a szűrők egymás alá kerülnek, a viewport
 * szélességétől függetlenül - így a Státusz gomb sem lóg ki a képernyőről -,
 * és nagyobb, ujjbarát vezérlőkkel.
 */
body.project-mobile-mode #projectsView .filter-row {
  flex-direction: column;
  align-items: stretch;
}

body.project-mobile-mode #projectsView .filter-row .field {
  width: 100%;
  min-width: 0;
}

body.project-mobile-mode #projectsView .filter-row .field span {
  font-size: 18px;
}

body.project-mobile-mode #projectsView .filter-row input,
body.project-mobile-mode #projectsView .filter-row select,
body.project-mobile-mode #projectsView .filter-row .select-button {
  min-height: 56px;
  font-size: 20px;
}

/*
 * Projektek mobil nézet: teljes szélességű, lenyíló kártyalista a táblázat
 * helyett. Összecsukva a VR szám, a projekt neve és a megrendelő látszik; a
 * kártyára koppintva nyílnak le a további adatok, olvasható méretben.
 */
.project-mobile-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.project-mobile-empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}

.project-mobile-card {
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
}

.project-mobile-card.project-row-overdue {
  background: #fde2e2;
}

.project-mobile-head {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "vr caret"
    "name caret"
    "customer caret";
  gap: 3px 10px;
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  background: transparent;
  color: var(--text);
}

.pm-vr {
  grid-area: vr;
  font-size: 18px;
  font-weight: 800;
}

.pm-name {
  grid-area: name;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
}

.pm-customer {
  grid-area: customer;
  font-size: 14px;
  font-weight: 600;
  color: #40506a;
}

.pm-caret {
  grid-area: caret;
  align-self: center;
  font-size: 20px;
  color: #40506a;
  transition: transform .15s ease;
}

.project-mobile-card.open .pm-caret {
  transform: rotate(180deg);
}

.project-mobile-body {
  padding: 4px 16px 16px;
  background: #ffffff;
  border-top: 1px solid var(--line);
}

.pm-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 12px;
  padding-top: 14px;
}

.pm-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.pm-field-wide {
  grid-column: 1 / -1;
}

.pm-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.pm-value {
  font-size: 16px;
  overflow-wrap: anywhere;
}

.pm-value-button {
  min-height: 48px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  text-align: left;
  overflow-wrap: anywhere;
}

/* A verzió és a nettó érték gombnak nincs saját színe, ezért semleges hátteret
   kapnak (a státusz/kommunikáció pill színeit szándékosan nem írjuk felül). */
.pm-value-button.version-pill,
.pm-value-button.value-pill {
  background: var(--soft);
  color: var(--text);
}

.pm-value-button:disabled {
  opacity: 1;
  cursor: default;
}

.pm-actions {
  margin-top: 16px;
}

.pm-actions .primary-button {
  width: 100%;
  min-height: 52px;
  font-size: 17px;
  border-radius: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 980px;
  margin: 0 auto 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.wide-form {
  max-width: min(1180px, 100%);
}

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

.document-panel {
  max-width: min(1240px, 100%);
  margin: 0 auto;
}

.document-form {
  display: grid;
  grid-template-columns: minmax(220px, 420px);
  gap: 12px;
  margin-bottom: 18px;
}

.brigade-list {
  display: flex;
  gap: 10px;
  overflow: auto;
  padding-bottom: 2px;
}

.brigade-card {
  min-width: 180px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--blue);
  border-radius: 8px;
  background: #f8fafc;
  cursor: grab;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

.brigade-card:active {
  cursor: grabbing;
}

.brigade-card.dragging {
  opacity: .65;
  transform: scale(.98);
  box-shadow: 0 12px 24px rgba(15, 23, 42, .18);
}

.brigade-card p {
  min-height: 36px;
  margin: 8px 0 10px;
  color: var(--muted);
}

.brigade-card .small-button {
  margin-right: 6px;
}

.brigade-card.selected {
  outline: 3px solid rgba(37, 99, 235, .35);
  background: #eff6ff;
}

/*
 * A brigádok fix méretű, kék gombok két sorban. A gombok oszloponként töltik
 * fel a két sort, és vízszintesen görgethetők, ha sok a brigád. Kattintásra a
 * szerkesztő ablak nyílik; húzással a naptárba oszthatók, illetve egymásra
 * ejtve átrendezhetők.
 */
.execution-brigade-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(2, auto);
  grid-auto-columns: max-content;
  justify-content: start;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 6px;
}

.brigade-button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 150px;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  cursor: grab;
  text-align: left;
}

.brigade-button:hover {
  background: var(--blue-dark);
}

.brigade-button:active {
  cursor: grabbing;
}

.brigade-button.dragging {
  opacity: .55;
}

.brigade-button.selected {
  outline: 3px solid rgba(37, 99, 235, .35);
}

.brigade-color-dot {
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, .7);
}

.brigade-button-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Beszúrási jelző az átrendezés során: a cél gomb elé vagy mögé. */
.brigade-button.drop-before::before,
.brigade-button.drop-after::after {
  content: '';
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: 3px;
  border-radius: 2px;
  background: var(--text);
}

.brigade-button.drop-before::before {
  left: -6px;
}

.brigade-button.drop-after::after {
  right: -6px;
}

.execution-table {
  width: 100%;
  min-width: 1180px;
  table-layout: fixed;
  --execution-project-width: 210px;
  --execution-action-width: 112px;
  --execution-action-total-width: 336px;
  --execution-day-count: 31;
}

.execution-table.week-view {
  min-width: 1080px;
  --execution-action-width: 118px;
  --execution-action-total-width: 354px;
}

.execution-table.month-view {
  min-width: 1180px;
}

.execution-table.execution-mobile-table {
  min-width: max-content;
}

.execution-mobile-toggle {
  min-width: 128px;
  background: #dc2626;
  color: #fff;
}

.execution-mobile-toggle.active {
  background: #2563eb;
}

#executionToggleActionColumnsBtn.active {
  background: #2563eb;
  color: #fff;
}

.execution-table-shell {
  max-height: calc(100vh - 230px);
  overflow: auto;
}

.execution-table .project-cell {
  width: var(--execution-project-width);
  min-width: var(--execution-project-width);
  max-width: var(--execution-project-width);
  font-weight: 700;
  font-size: 12px;
  line-height: 1.18;
  overflow-wrap: anywhere;
  vertical-align: top;
}

.execution-table .project-cell .secondary-button {
  padding: 6px 9px;
  margin: 5px 4px 0 0;
  font-size: 12px;
}

.execution-table tbody tr {
  border-top: 3px solid var(--line-strong);
}

.execution-table tbody tr + tr {
  border-top-width: 4px;
}

.execution-table th:first-child,
.execution-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 4;
  background: inherit;
}

.execution-table thead th {
  position: sticky;
  top: 0;
  z-index: 6;
  background: #f8fafc;
}

.execution-table thead th:first-child {
  z-index: 8;
}

.execution-table .day-head,
.execution-table .day-cell {
  width: calc((100% - var(--execution-project-width) - var(--execution-action-total-width)) / var(--execution-day-count));
  min-width: 38px;
}

.execution-table.week-view .day-head,
.execution-table.week-view .day-cell {
  min-width: 96px;
}

.execution-table .execution-action-col,
.execution-table .execution-action-cell {
  width: var(--execution-action-width);
  min-width: var(--execution-action-width);
  text-align: center;
  vertical-align: middle;
}

.execution-table .execution-action-cell .secondary-button,
.execution-table .execution-action-cell select {
  width: calc(var(--execution-action-width) - 18px);
  max-width: calc(var(--execution-action-width) - 18px);
  margin-inline: auto;
  white-space: normal;
  text-align: center;
}

.day-cell {
  padding: 4px !important;
}

.slot {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: var(--slot-min-height, 42px);
  height: auto;
  margin: 3px 0;
  padding: 3px;
  border: 1px dashed #bfd0e5;
  border-radius: 7px;
  background: rgba(248, 250, 252, .72);
  font-size: 11px;
  font-weight: 800;
  color: #365576;
  cursor: pointer;
  user-select: none;
}

.execution-brigade-table {
  width: auto;
  min-width: max-content;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.execution-brigade-table.month-view,
.execution-brigade-table.execution-month-table {
  width: 100%;
  min-width: 100%;
  table-layout: fixed;
}

.execution-brigade-table.week-view,
.execution-brigade-table.execution-week-table {
  min-width: 1280px;
}

.execution-brigade-table .execution-project-col,
.execution-brigade-table .execution-project-cell {
  width: var(--execution-project-width, 210px);
  min-width: var(--execution-project-width, 210px);
  max-width: var(--execution-project-width, 210px);
  position: sticky;
  left: 0;
  z-index: 5;
  background: #ffffff;
  box-shadow: 1px 0 0 #d6e0ee;
}

.execution-brigade-table thead .execution-project-col {
  z-index: 9;
  background: #f8fafc;
}

.execution-brigade-table .execution-day-head,
.execution-brigade-table .execution-day-cell {
  width: 86px;
  min-width: 86px;
  max-width: 86px;
}

.execution-brigade-table.month-view .execution-day-head,
.execution-brigade-table.month-view .execution-day-cell,
.execution-brigade-table.execution-month-table .execution-day-head,
.execution-brigade-table.execution-month-table .execution-day-cell {
  width: calc((100% - var(--execution-project-width, 210px) - var(--execution-action-total-width, 0px)) / var(--execution-day-count, 31));
  min-width: 34px;
  max-width: calc((100% - var(--execution-project-width, 210px) - var(--execution-action-total-width, 0px)) / var(--execution-day-count, 31));
}

.execution-brigade-table.week-view .execution-day-head,
.execution-brigade-table.week-view .execution-day-cell {
  width: calc((100% - var(--execution-project-width, 220px) - var(--execution-action-total-width, 0px)) / 7);
  min-width: 126px;
  max-width: none;
}

.execution-brigade-table .execution-day-head.weekend,
.execution-brigade-table .execution-day-cell.weekend {
  background: #ecfdf5;
}

.execution-brigade-table .execution-day-head.today-col,
.execution-brigade-table .execution-day-cell.today-col {
  background: #fee2e2;
}

.execution-brigade-table .execution-day-cell.planned,
.execution-brigade-table .execution-day-cell.today-col.planned {
  background: #fef9c3;
}

.execution-brigade-table .execution-warehouse-col,
.execution-brigade-table .execution-warehouse-cell,
.execution-brigade-table .execution-note-col,
.execution-brigade-table .execution-note-cell,
.execution-brigade-table .execution-action-col,
.execution-brigade-table .execution-action-cell {
  position: sticky;
  z-index: 5;
  background: #ffffff;
  box-shadow: -1px 0 0 #d6e0ee;
  text-align: center;
  vertical-align: middle;
}

.execution-brigade-table .execution-warehouse-col,
.execution-brigade-table .execution-warehouse-cell {
  right: calc(var(--execution-note-width, 118px) + var(--execution-status-width, 100px));
  width: var(--execution-warehouse-width, 136px);
  min-width: var(--execution-warehouse-width, 136px);
  max-width: var(--execution-warehouse-width, 136px);
}

.execution-brigade-table .execution-note-col,
.execution-brigade-table .execution-note-cell {
  right: var(--execution-status-width, 100px);
  width: var(--execution-note-width, 118px);
  min-width: var(--execution-note-width, 118px);
  max-width: var(--execution-note-width, 118px);
}

.execution-brigade-table .execution-action-col,
.execution-brigade-table .execution-action-cell {
  right: 0;
  width: var(--execution-status-width, 100px);
  min-width: var(--execution-status-width, 100px);
  max-width: var(--execution-status-width, 100px);
}

.execution-brigade-table th.execution-warehouse-col,
.execution-brigade-table th.execution-note-col,
.execution-brigade-table th.execution-action-col {
  z-index: 8;
  background: #f8fafc;
}

.execution-brigade-table.actions-hidden .execution-warehouse-col,
.execution-brigade-table.actions-hidden .execution-warehouse-cell,
.execution-brigade-table.actions-hidden .execution-note-col,
.execution-brigade-table.actions-hidden .execution-note-cell,
.execution-brigade-table.actions-hidden .execution-action-col,
.execution-brigade-table.actions-hidden .execution-action-cell {
  display: none;
}

.execution-brigade-table tbody tr {
  border-bottom: 3px solid #cbd5e1;
}

.execution-brigade-table tbody tr + tr .execution-project-cell,
.execution-brigade-table tbody tr + tr .execution-day-cell,
.execution-brigade-table tbody tr + tr .execution-warehouse-cell,
.execution-brigade-table tbody tr + tr .execution-note-cell,
.execution-brigade-table tbody tr + tr .execution-action-cell {
  border-top: 3px solid #cbd5e1;
}

.execution-brigade-table .execution-project-cell {
  font-size: 12px;
  line-height: 1.22;
  overflow-wrap: anywhere;
  vertical-align: top;
}

.execution-project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.execution-project-actions .secondary-button {
  padding: 6px 9px;
  font-size: 12px;
}

.execution-period-text {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.25;
}

.execution-brigade-day-cell {
  padding: 3px !important;
  height: 1px;
  vertical-align: stretch;
}

.execution-day-slot-stack {
  display: grid;
  grid-template-rows: minmax(var(--slot-min-height, 42px), 1fr) minmax(var(--slot-min-height, 42px), 1fr);
  gap: 3px;
  min-height: 100%;
  height: 100%;
}

.execution-brigade-slot {
  min-height: var(--slot-min-height, 42px);
  align-self: stretch;
  margin: 0;
}

.execution-brigade-table.month-view .execution-brigade-slot {
  padding: 2px;
  border-radius: 6px;
}

.execution-brigade-slot-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-size: 9px;
  line-height: 1;
  margin-bottom: 2px;
  text-transform: uppercase;
}

/* Kis gomb a napszak brigádjainak a másik napszakra másolásához. */
.slot-copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border-radius: 4px;
  background: var(--soft);
  color: var(--blue);
  font-size: 12px;
  line-height: 1;
}

.slot-copy-button:hover {
  background: var(--blue);
  color: #fff;
}

.execution-brigade-chip {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  max-width: 100%;
  min-width: 0;
  border-radius: 6px;
  color: #ffffff;
  font-size: 9px;
  font-weight: 900;
  padding: 2px 4px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: visible;
  position: relative;
  z-index: 1;
}

.execution-brigade-chip:hover,
.execution-brigade-chip:focus-within {
  z-index: 8;
}

.execution-brigade-chip-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.execution-brigade-remove {
  width: 16px;
  height: 16px;
  min-height: 16px;
  border-radius: 999px;
  padding: 0;
  background: rgba(255, 255, 255, .85);
  color: #0f172a;
  font-size: 12px;
  line-height: 1;
  flex: 0 0 auto;
  order: -1;
}

.execution-note-modal-btn,
.execution-status-btn,
.execution-brigade-table .execution-action-cell select,
.execution-brigade-table .execution-action-cell .secondary-button,
.execution-brigade-table .execution-warehouse-cell .secondary-button {
  width: auto;
  max-width: 132px;
  min-height: 58px;
  padding-block: 8px;
  justify-content: center;
  white-space: normal;
  line-height: 1.15;
  text-align: center;
  margin-inline: auto;
}

.execution-warehouse-btn.is-ready {
  background: #dcfce7;
  color: #166534;
}

.execution-warehouse-btn.is-waiting {
  background: #fef3c7;
  color: #92400e;
}

.completed-tasks-modal {
  width: min(980px, calc(100vw - 36px));
  max-height: min(760px, calc(100vh - 36px));
  overflow: hidden;
}

.completed-tasks-modal .table-shell {
  max-height: calc(100vh - 170px);
  overflow: auto;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.compact-table th,
.compact-table td {
  padding: 9px 10px;
}

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

.finance-actions .secondary-button {
  padding: 7px 10px;
}

.inspector-input {
  min-width: 120px;
  width: 100%;
  padding: 7px 8px;
  font-size: 13px;
}

.stat-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(520px, 100%), 1fr));
  gap: 16px;
}

.stat-donut-panel {
  --donut-size: clamp(150px, 18vw, 260px);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: clamp(14px, 1.5vw, 22px);
  background: var(--panel-bg, #fff);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
}

.stat-donut-panel h3 {
  text-align: center;
  margin: 0 0 16px;
}

.donut-layout {
  display: grid;
  grid-template-columns: minmax(var(--donut-size), .8fr) minmax(220px, 1.2fr);
  align-items: center;
  gap: clamp(14px, 2vw, 26px);
}

.donut-chart {
  width: var(--donut-size);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  justify-self: center;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08), 0 12px 30px rgba(15, 23, 42, .08);
}

.donut-chart::after {
  content: '';
  width: 43%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--panel-bg, #fff);
  position: absolute;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08);
}

.donut-chart span {
  position: relative;
  z-index: 1;
  font-size: 22px;
  font-weight: 800;
}

.donut-legend {
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 0;
}

.donut-legend-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  min-width: 0;
}

.donut-legend-row span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.donut-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

@media (max-width: 900px) {
  .donut-layout {
    grid-template-columns: 1fr;
  }

  .donut-chart {
    margin: 0 auto;
  }
}

.slot-label {
  font-size: 10px;
  line-height: 1;
}

.brigade-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  overflow: hidden;
  max-width: 100%;
  padding: 2px 4px;
  border-radius: 999px;
  color: #fff;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brigade-remove {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .88);
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.execution-brigade-chip.brigade-pill {
  justify-content: flex-start;
  overflow: visible;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.execution-brigade-chip.brigade-pill:hover,
.execution-brigade-chip.brigade-pill:focus-within {
  z-index: 8;
}

.execution-brigade-chip .execution-brigade-remove {
  order: -1;
}

.execution-brigade-chip .execution-brigade-chip-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot:hover {
  border-color: var(--blue);
  background: #eff6ff;
}

.slot.drop-target {
  border-color: var(--blue);
  background: #dbeafe;
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, .26);
}

.worker-schedule {
  overflow: auto;
}

.worker-copy-controls {
  justify-content: flex-end;
  margin-bottom: 10px;
}

.worker-copy-controls input[type="date"] {
  width: 170px;
}

.worker-table {
  min-width: 900px;
}

.worker-table th:first-child,
.worker-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 180px;
  min-width: 180px;
  background: inherit;
}

.worker-day-cell {
  min-width: 120px;
  vertical-align: top;
}

.worker-slot {
  margin: 3px 0;
  padding: 4px 6px;
  border-radius: 7px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  line-height: 1.25;
}

.worker-slot.conflict {
  background: #fee2e2;
  color: #991b1b;
  font-weight: 800;
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, .35);
}

.loader-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 260px;
  padding: 22px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .25);
  text-align: center;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  max-width: 420px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #0f172a;
  color: #fff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .25);
}

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

.muted {
  color: var(--muted);
}

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

.calendar-head-cell,
.calendar-cell {
  min-width: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.calendar-head-cell {
  padding: 8px;
  background: #f6f8fb;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.calendar-cell {
  min-height: 118px;
  padding: 6px;
  background: #fff;
}

.calendar-cell strong {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  text-align: right;
}

.calendar-empty {
  background: #f8fafc;
}

.calendar-today {
  background: #fff7d6;
  box-shadow: inset 0 0 0 2px #f59e0b;
}

.calendar-event {
  overflow: hidden;
  display: block;
  box-sizing: border-box;
  height: 19px;
  line-height: 11px;
  margin-bottom: 3px;
  padding: 4px 6px;
  border-radius: 6px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event-stack {
  display: flex;
  flex-direction: column;
}

.calendar-event-spacer {
  visibility: hidden;
  pointer-events: none;
}

.calendar-event.continues-before {
  margin-left: -7px;
}

.calendar-event.continues-after {
  margin-right: -7px;
}

.calendar-legend {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin: -4px 2px 10px;
  color: var(--muted);
  font-size: 12px;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.calendar-legend i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.project-dot {
  background: #2563eb;
}

.execution-dot {
  background: #f97316;
}

.manual-dot {
  background: #10b981;
}

.project-event {
  background: #2563eb;
}

.project-event-overdue {
  background: #ef4444;
}

.execution-event {
  background: #f97316;
}

.manual-event {
  background: #10b981;
}

.modal-message {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.45;
}

.multiline-message {
  white-space: pre-wrap;
}

.authenticator-setup-box {
  width: min(520px, 100%);
}

.authenticator-qr-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  color: var(--muted);
  text-align: center;
}

.authenticator-qr {
  width: 240px;
  height: 240px;
  image-rendering: crisp-edges;
}

.authenticator-details {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 8px 12px;
  align-items: start;
}

.authenticator-details span {
  color: var(--muted);
  font-weight: 700;
}

.authenticator-details code,
.authenticator-details textarea {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  word-break: break-all;
}

.authenticator-details textarea {
  min-height: 68px;
  resize: vertical;
}

.session-expired::before {
  content: "A munkamenet lejárt";
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, .62);
  color: #fff;
  font-size: 28px;
  font-weight: 900;
}

@media (max-width: 900px) {
  body {
    min-width: 0;
  }

  .topbar,
  .page-head,
  .filter-row,
  .execution-toolbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
  }

  .brand {
    white-space: normal;
  }

  .main-nav {
    width: 100%;
  }

  .nav-button,
  .secondary-button,
  .primary-button,
  .danger-button,
  .select-button {
    min-height: 40px;
    padding: 0 12px;
  }

  .user-pill {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto auto;
    column-gap: 8px;
    row-gap: 6px;
  }

  .view-as-wrap {
    grid-column: 1 / -1;
    grid-row: auto;
    width: 100%;
  }

  .view-as-wrap select {
    flex: 1;
    width: 100%;
    max-width: none;
  }

  .user-pill span,
  .user-pill small {
    grid-column: 1;
  }

  .user-pill #themeButton,
  .user-pill #logoutButton {
    grid-row: auto;
  }

  .app-shell {
    padding: 10px;
  }

  .page-head,
  .panel {
    padding: 14px;
    border-radius: 10px;
    overflow: hidden;
  }

  h1 {
    font-size: 24px;
  }

  .placeholder-grid,
  .metric-grid,
  .stat-list,
  .form-grid {
    grid-template-columns: 1fr;
  }

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

  .field,
  .field.grow {
    min-width: 0;
  }

  .section-head input[type="search"] {
    min-width: 0;
  }

  .dashboard-task-tools {
    justify-content: stretch;
  }

  .dashboard-task-tools input[type="search"],
  .dashboard-task-tools button {
    flex: 1 1 100%;
    max-width: none;
  }

  .table-shell .data-table {
    width: max-content;
    min-width: 720px;
  }

  #activeTasksTable {
    min-width: 680px;
  }

  #activeTasksTable th,
  #activeTasksTable td {
    min-width: 92px;
    padding: 9px 8px;
    overflow-wrap: normal;
  }

  #activeTasksTable th:nth-child(3),
  #activeTasksTable td:nth-child(3) {
    min-width: 180px;
  }

  #activeTasksTable th:nth-child(5),
  #activeTasksTable td:nth-child(5),
  #activeTasksTable th:nth-child(6),
  #activeTasksTable td:nth-child(6) {
    min-width: 82px;
    text-align: center;
  }

  #projectsTable,
  #financeTable,
  #statisticsProjectTable,
  #statisticsUserTable,
  #documentsTable {
    min-width: 920px;
  }

  .permission-matrix {
    min-width: 860px;
  }

  #adminView,
  #adminView .admin-stack,
  #adminView .admin-panel,
  #adminView .admin-collapsible,
  #adminView .inspector-block {
    min-width: 0;
    max-width: 100%;
  }

  #adminView .admin-panel,
  #adminView .admin-collapsible {
    overflow: hidden;
  }

  #adminView .table-shell,
  #adminView .inspector-block .table-shell {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #adminView .admin-table {
    width: max-content;
    min-width: 760px;
  }

  #adminView .permission-matrix {
    min-width: 860px;
  }

  #adminView .status-permission-matrix {
    min-width: 780px;
  }

  #adminView .inspector-block .data-table {
    min-width: 900px;
  }

  .calendar-legend {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-top: 8px;
  }

  .calendar-grid {
    width: 760px;
    max-width: none;
    min-width: 760px;
  }

  .panel:has(.calendar-grid) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .calendar-cell {
    min-height: 104px;
  }

  .calendar-event {
    height: 18px;
    padding: 4px 5px;
    font-size: 10px;
  }

  .execution-table-shell {
    max-height: none;
  }

  .execution-brigade-table.month-view,
  .execution-brigade-table.execution-month-table {
    width: max-content;
    min-width: 1180px;
  }

  .execution-brigade-table.week-view,
  .execution-brigade-table.execution-week-table {
    min-width: 1020px;
  }

}

/*
 * A "Mobil nézet" gomb fix oszlopszélességű, görgethető táblázattá alakítja a
 * kivitelezési ütemezőt. Ennek szándékosan a viewport szélességétől
 * függetlenül, mindig érvényesülnie kell (nem csak keskeny képernyőn), hogy
 * asztali gépen bekapcsolva és utána mobilra váltva is nagyítható,
 * kiszámítható oszlopszélességű felületet kapjunk.
 */
.execution-brigade-table.execution-mobile-table,
.execution-brigade-table.month-view.execution-mobile-table,
.execution-brigade-table.execution-month-table.execution-mobile-table,
.execution-brigade-table.week-view.execution-mobile-table,
.execution-brigade-table.execution-week-table.execution-mobile-table {
  width: max-content;
  min-width: max-content;
}

/*
 * A jobb oldali művelet-oszlopok mobil nézetben nem tapadnak, hogy a keskeny
 * képernyőn ne vegyenek el helyet a napoktól. A bal oldali "Projekt adatok"
 * oszlop viszont rögzítve marad (lásd lentebb), hogy vízszintes görgetés
 * közben is látszódjon, melyik projekt sorát nézzük.
 */
.execution-brigade-table.execution-mobile-table .execution-warehouse-col,
.execution-brigade-table.execution-mobile-table .execution-warehouse-cell,
.execution-brigade-table.execution-mobile-table .execution-note-col,
.execution-brigade-table.execution-mobile-table .execution-note-cell,
.execution-brigade-table.execution-mobile-table .execution-action-col,
.execution-brigade-table.execution-mobile-table .execution-action-cell {
  position: static;
  left: auto;
  right: auto;
  z-index: auto;
  box-shadow: none;
}

/*
 * A "Projekt adatok" oszlop vízszintes görgetéskor a bal szélen marad. A
 * háttérnek átlátszatlannak kell lennie, különben a hétvége/mai nap/tervezett
 * színezésű napcellák átlátszanának alatta görgetés közben.
 */
.execution-brigade-table.execution-mobile-table .execution-project-col,
.execution-brigade-table.execution-mobile-table .execution-project-cell {
  width: 190px;
  min-width: 190px;
  max-width: 190px;
  position: sticky;
  left: 0;
  z-index: 5;
  background: #ffffff;
  box-shadow: 1px 0 0 #d6e0ee;
}

/*
 * A fejléc bal felső sarokcellája egyszerre tapad felülre és balra, ezért a
 * napi fejléc (z-index: 6) és a sorok projektcellái fölé kell kerülnie.
 */
.execution-brigade-table.execution-mobile-table thead .execution-project-col {
  z-index: 9;
  background: #f8fafc;
}

.execution-brigade-table.execution-mobile-table .execution-day-head,
.execution-brigade-table.execution-mobile-table .execution-day-cell {
  width: 72px;
  min-width: 72px;
  max-width: 72px;
}

.execution-brigade-table.execution-mobile-table .execution-warehouse-col,
.execution-brigade-table.execution-mobile-table .execution-warehouse-cell {
  width: 116px;
  min-width: 116px;
  max-width: 116px;
}

.execution-brigade-table.execution-mobile-table .execution-note-col,
.execution-brigade-table.execution-mobile-table .execution-note-cell {
  width: 108px;
  min-width: 108px;
  max-width: 108px;
}

.execution-brigade-table.execution-mobile-table .execution-action-col,
.execution-brigade-table.execution-mobile-table .execution-action-cell {
  width: 126px;
  min-width: 126px;
  max-width: 126px;
}

/*
 * Mobil nézetben a napi fejlécnek a görgetés során is a doboz tetején kell
 * maradnia. A CSS szabvány nem engedi, hogy ugyanazon elemen overflow-x:
 * auto és overflow-y: visible egyszerre éljen (a böngésző a "visible"
 * tengelyt is "auto"-ra kényszeríti) - emiatt a fejléc a teljes oldalhoz
 * képest nem tudna sticky maradni, ha a doboz magassága korlátlan (mint a
 * keskeny képernyős, nem mobil-nézetes táblázatnál). Ezért mobil nézetben
 * mindig korlátozott magasságú, önmagában (mindkét irányban) görgethető
 * dobozt használunk - ugyanazt a mechanizmust, ami asztali nézetben is
 * működik -, függetlenül a böngésző ablakának szélességétől.
 */
.execution-table-shell:has(.execution-mobile-table) {
  max-height: calc(100vh - 230px);
  overflow: auto;
}

@media (max-width: 520px) {
  body {
    font-size: 13px;
  }

  .topbar {
    padding: 8px;
  }

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

  .nav-button {
    width: 100%;
    padding: 0 8px;
  }

  .app-shell {
    padding: 8px;
  }

  .page-head,
  .panel {
    padding: 12px;
  }

  .button-row > button,
  .button-row > input,
  .button-row > select {
    min-width: 0;
  }

  .calendar-grid {
    width: 700px;
    min-width: 700px;
  }

  .calendar-cell {
    min-height: 94px;
  }
}
