:root {
  color-scheme: light;
  --bg: #f3f6f8;
  --panel: #ffffff;
  --panel-soft: #f9fbfc;
  --ink: #142126;
  --muted: #61717a;
  --line: #d9e2e7;
  --line-soft: #edf3f5;
  --accent: #126c64;
  --accent-strong: #0b514c;
  --accent-soft: #e7f4f1;
  --gold: #bd8b24;
  --amber: #a96312;
  --red: #a93a46;
  --blue: #2c5f89;
  --nav: #17252b;
  --shadow: 0 18px 44px rgba(18, 32, 38, 0.075);
  --shadow-soft: 0 9px 24px rgba(18, 32, 38, 0.055);
  --shadow-hover: 0 14px 30px rgba(18, 32, 38, 0.09);
  --radius: 14px;
  --radius-lg: 18px;
}

* {
  box-sizing: border-box;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #b9c7cc transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: #b9c7cc;
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

::-webkit-scrollbar-track {
  background: transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(18, 108, 100, 0.08), transparent 360px),
    linear-gradient(180deg, #fbfcfd 0, var(--bg) 420px),
    var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

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

button {
  max-width: 100%;
  min-width: max-content;
  line-height: 1.15;
  white-space: nowrap;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

button.primary-button:disabled,
button.primary-button.is-disabled {
  background: #e5ecef;
  border-color: #d2dde2;
  color: #7a8a94;
  box-shadow: none;
  transform: none;
}

button.primary-button:disabled:hover,
button.primary-button.is-disabled:hover {
  background: #e5ecef;
  color: #7a8a94;
  box-shadow: none;
  transform: none;
}

#openLocalFolderBtn:disabled,
#openLocalFolderBtn.is-disabled {
  background: #e5ecef !important;
  border-color: #d2dde2 !important;
  color: #7a8a94 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  opacity: 1;
  pointer-events: none;
}

#projectForm.no-project-selected {
  opacity: 0.72;
}

#projectForm.no-project-selected input,
#projectForm.no-project-selected select,
#projectForm.no-project-selected textarea,
#projectForm.no-project-selected .custom-select-button,
#projectForm.no-project-selected .custom-date-button {
  background: #f2f6f8 !important;
  border-color: #d8e3e8 !important;
  color: #7a8a94 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
}

#projectForm.no-project-selected .primary-button,
#projectForm.no-project-selected .mini-button {
  background: #e5ecef !important;
  border-color: #d2dde2 !important;
  color: #7a8a94 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  transform: none !important;
}

#projectForm.no-project-selected label,
#projectForm.no-project-selected .field-label,
#projectForm.no-project-selected .project-structures-title,
#projectForm.no-project-selected .client-portal-panel {
  color: #7a8a94;
}

.app-shell {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  min-height: 100vh;
}

body.unauthenticated {
  background:
    radial-gradient(circle at 50% 18%, rgba(18, 108, 100, 0.13), transparent 360px),
    linear-gradient(180deg, #f7fafb 0%, #eef4f6 100%);
}

body.unauthenticated .app-shell {
  grid-template-columns: 1fr;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

body.unauthenticated .sidebar {
  position: static;
  width: min(430px, calc(100vw - 32px));
  height: auto;
  min-height: 0;
  overflow: visible;
  padding: 28px;
  border-radius: 28px;
  box-shadow: 0 24px 70px rgba(18, 32, 38, 0.18);
}

body.unauthenticated .main,
body.unauthenticated #mainNav,
body.unauthenticated .current-user,
body.unauthenticated .sync-panel {
  display: none;
}

body.unauthenticated .brand {
  justify-content: center;
  text-align: left;
}

body.unauthenticated .auth-panel {
  margin-top: 8px;
  padding: 18px;
  border-radius: 22px;
}

body.unauthenticated .login-form {
  gap: 11px;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0)),
    linear-gradient(180deg, #182d33 0%, var(--nav) 100%);
  color: #f8fbf8;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 10px 0 30px rgba(18, 32, 38, 0.10);
}

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

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: linear-gradient(180deg, #f2cc68 0%, #dfb23e 100%);
  color: #162326;
  font-weight: 800;
  border-radius: 16px;
  box-shadow: inset 0 -10px 18px rgba(23, 35, 38, 0.08), 0 10px 22px rgba(0, 0, 0, 0.12);
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.15;
  letter-spacing: 0;
}

.brand p {
  margin: 4px 0 0;
  color: rgba(248, 251, 248, 0.7);
  font-size: 12px;
}

.auth-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.065);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.login-form,
.current-user {
  display: grid;
  gap: 8px;
}

.login-form input,
.login-form select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 10px 11px;
  color: #f8fbf8;
  background: rgba(255, 255, 255, 0.09);
}

.login-form input::placeholder {
  color: rgba(248, 251, 248, 0.58);
}

.login-form button,
.current-user button {
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  color: #172326;
  background: linear-gradient(180deg, #f3cf72 0%, #e2b43b 100%);
  cursor: pointer;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.login-form small,
.current-user span {
  color: rgba(248, 251, 248, 0.68);
  font-size: 12px;
}

.current-user strong {
  color: #fff;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-group {
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.nav-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  padding: 0 8px;
  cursor: pointer;
  list-style: none;
  color: rgba(248, 251, 248, 0.62);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.nav-group summary::after {
  content: "+";
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(248, 251, 248, 0.82);
}

.nav-group[open] summary::after {
  content: "-";
}

.nav-note {
  display: block;
  margin: 2px 8px 6px;
  color: rgba(248, 251, 248, 0.52);
  font-size: 12px;
}

.nav-item {
  border: 0;
  color: rgba(248, 251, 248, 0.78);
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 750;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.nav-item.active,
.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.115);
}

.nav-item.active {
  box-shadow: inset 3px 0 0 #f1c75b, 0 9px 20px rgba(0, 0, 0, 0.10);
}

.nav-item:hover {
  transform: translateX(2px);
}

.nav-item-private {
  margin-top: 8px;
  border: 1px solid rgba(241, 199, 91, 0.35);
  color: #ffe6a2;
  background: rgba(241, 199, 91, 0.08);
}

.nav-item-private.active,
.nav-item-private:hover {
  color: #172326;
  background: #f1c75b;
}

.subnav,
.module-head {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 16px;
  flex-wrap: wrap;
}

.module-view {
  animation: viewIn 0.18s ease-out;
}

@keyframes viewIn {
  from {
    opacity: 0.82;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.task-create-bar {
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.task-create-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.dashboard-calendar {
  margin-top: 14px;
}

.today-grid {
  display: grid;
  gap: 16px;
}

.dashboard-today {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.dashboard-today .module-head {
  align-items: center;
}

.dashboard-today-stats {
  margin: 0;
}

.dashboard-today-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.compact-panel {
  min-height: 0;
}

.today-list.compact {
  padding: 12px;
}

.dashboard-today-grid .today-list.compact {
  max-height: 520px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.today-panel.danger {
  border-color: rgba(178, 58, 72, 0.28);
}

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

.today-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 120px 120px 92px 70px auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
  min-width: 0;
  box-shadow: 0 1px 0 rgba(18, 32, 38, 0.03);
}

.today-row.compact {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px 12px;
  padding: 14px 12px 12px;
}

.today-row.compact .today-actions {
  grid-column: 1 / -1;
  padding-top: 2px;
  border-top: 1px solid var(--line-soft);
}

.today-row.compact .today-task-main {
  gap: 5px;
}

.today-row.compact .today-task-main > strong {
  font-size: 14px;
  line-height: 1.3;
}

.today-row.compact .today-project {
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.today-row.compact .today-assignee {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.today-row.compact .today-assignee strong {
  color: var(--ink);
  font-size: inherit;
}

.today-row.compact .today-status {
  width: auto;
  white-space: nowrap;
  justify-self: end;
}

.today-row.is-overdue {
  border-color: rgba(178, 58, 72, 0.36);
  background: #fff8f9;
}

.today-row strong,
.today-row span {
  min-width: 0;
}

.today-row div:first-child {
  display: grid;
  gap: 3px;
}

.today-row div:first-child span {
  color: var(--muted);
  font-size: 12px;
}

.today-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.danger-text {
  color: var(--red);
}

.chip {
  height: 36px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.chip:hover {
  border-color: #bfd2ca;
  transform: translateY(-1px);
}

.sync-panel {
  margin-top: auto;
  display: grid;
  gap: 5px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.055);
  color: rgba(248, 251, 248, 0.75);
}

.sync-panel strong {
  color: #fff;
}

.main {
  min-width: 0;
  padding: 22px 28px 32px;
}

.topbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  padding: 16px 20px;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
}

.topbar h1 {
  margin: 2px 0 0;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: 0;
}

.topbar-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-transform: capitalize;
}

.topbar-user {
  min-width: 220px;
  display: grid;
  justify-items: end;
  gap: 3px;
  color: var(--muted);
}

.topbar-user span {
  color: var(--ink);
  font-weight: 800;
}

.topbar-user strong {
  color: var(--accent);
  font-size: 13px;
}

.topbar-user small {
  color: var(--muted);
  text-align: right;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 150px 190px 44px;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.search-wrap {
  height: 46px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 12px;
  box-shadow: var(--shadow-soft);
}

.search-wrap input,
select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

select:focus,
input:focus,
textarea:focus {
  outline: 0;
  border-color: #91b8ad;
  box-shadow: 0 0 0 3px rgba(18, 108, 100, 0.12);
}

.search-wrap input {
  border: 0;
  outline: 0;
}

select,
input {
  height: 46px;
  padding: 0 12px;
}

textarea {
  padding: 11px 12px;
  resize: vertical;
}

.icon-button,
.primary-button {
  min-height: 46px;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 16px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.icon-button {
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 14px;
}

.primary-button {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(18, 108, 100, 0.16);
}

.primary-button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.secondary-action {
  background: linear-gradient(180deg, #477394 0%, #315b7c 100%);
}

.secondary-action:hover {
  background: #244a70;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
  margin: 0 0 20px;
}

.stat {
  background: linear-gradient(180deg, #ffffff 0%, var(--panel-soft) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 15px 16px;
  box-shadow: var(--shadow-soft);
  min-height: 90px;
}

.stat span {
  color: var(--muted);
  font-size: 13px;
}

.stat strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
  letter-spacing: 0;
  line-height: 1.12;
}

.stat.attention strong {
  color: var(--amber);
}

.performance-stats {
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 10px;
}

.performance-stats .stat {
  padding: 10px 12px;
  min-height: 76px;
}

.performance-stats .stat span {
  display: block;
  line-height: 1.25;
}

.performance-stats .stat strong {
  font-size: 22px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(420px, 0.92fr) minmax(420px, 1.08fr);
  gap: 20px;
  align-items: start;
}

.workspace.single {
  grid-template-columns: 1fr;
}

.list-panel,
.details-panel,
.table-panel {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  min-height: 0;
  overflow: hidden;
}

.table-panel {
  min-height: 0;
}

.summary-list,
.data-grid,
.table-like {
  display: grid;
  gap: 12px;
  padding: 16px;
  min-width: 0;
}

.roots-panel {
  min-height: 0;
  margin: 18px 0 0;
}

.inline-form.roots-form {
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  column-gap: 16px;
  row-gap: 10px;
  padding: 20px 24px 8px;
}

.roots-form textarea {
  width: 100%;
  min-width: 0;
  min-height: 72px;
  resize: vertical;
  font-size: 1rem;
  line-height: 1.35;
  padding: 16px 18px;
  white-space: pre-wrap;
}

.roots-form .primary-button {
  min-width: 220px;
  min-height: 60px;
  justify-self: end;
  white-space: nowrap;
}

.roots-list {
  padding-top: 10px;
}

.summary-row.roots-row {
  grid-template-columns: minmax(0, 1fr) auto 150px 52px;
  align-items: center;
  gap: 14px;
}

.roots-row strong {
  overflow-wrap: anywhere;
}

.roots-row .mini-button {
  min-height: 42px;
  width: 100%;
  border-radius: 10px;
}

.roots-row [data-delete-root] {
  font-weight: 800;
  padding: 0;
}

.roots-state {
  display: block;
  padding: 0 24px 16px;
}

.summary-row,
.task-card,
.table-row {
  display: grid;
  gap: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  box-shadow: 0 1px 0 rgba(18, 32, 38, 0.03);
  min-width: 0;
}

.summary-row > *,
.task-card > *,
.table-row > *,
.permit-row > *,
.performance-row > *,
.performance-event > *,
.work-order-row > *,
.today-row > * {
  min-width: 0;
}

.summary-row {
  grid-template-columns: 1fr repeat(2, 110px);
  align-items: center;
}

.task-card {
  grid-template-columns: minmax(140px, 0.8fr) minmax(240px, 1.3fr) minmax(150px, 0.85fr) 140px 140px auto auto;
  align-items: start;
  border-left: 5px solid var(--line);
  position: relative;
}

.task-group {
  display: grid;
  gap: 10px;
}

.task-group-title {
  margin: 12px 0 0;
  padding: 11px 13px;
  background: #f7fafb;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 15px;
}

.task-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.summary-row:hover,
.task-card:hover,
.table-row:hover,
.permit-row:hover,
.performance-row:hover,
.performance-event:hover {
  border-color: #c8d6ce;
  box-shadow: var(--shadow-hover);
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(31, 42, 46, 0.16);
}

.task-status-neinceput {
  background: #f7f8f5;
  border-color: #d9ded8;
  border-left-color: #8a9498;
}

.task-status-in-lucru {
  background: #edf6ff;
  border-color: #c7dcef;
  border-left-color: var(--blue);
}

.task-status-finalizat {
  background: #edf8f1;
  border-color: #c8e4d1;
  border-left-color: var(--accent);
}

.task-status-blocat {
  background: #fff0f2;
  border-color: #efc4ca;
  border-left-color: var(--red);
}

.task-status-amanat {
  background: #fff6e8;
  border-color: #ead2aa;
  border-left-color: var(--amber);
}

.task-card strong,
.table-row strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.task-meta,
.table-row span {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.task-date-proposal {
  display: grid;
  gap: 12px;
  padding: 16px;
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius-lg);
}

.proposal-head,
.proposal-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.proposal-list {
  display: grid;
  gap: 8px;
}

.proposal-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 170px;
  gap: 12px;
  align-items: center;
}

.proposal-row span {
  display: grid;
  gap: 2px;
}

.proposal-row small {
  color: var(--muted);
}

.calendar-toolbar {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  box-shadow: var(--shadow-soft);
}

.calendar-toolbar h2 {
  margin: 0;
  min-width: 220px;
  font-size: 20px;
}

.calendar-legend {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-left: auto;
}

.calendar-dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid var(--line);
}

.calendar-free {
  background: #eef7f0;
  border-color: #bfdac6;
}

.calendar-programmed {
  background: #edf6ff;
  border-color: #b9d2e8;
}

.calendar-vacation {
  background: #fff0f2;
  border-color: #efc4ca;
}

.calendar-unscheduled {
  background: #fff6e8;
  border-color: #ead2aa;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(118px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.calendar-weekday {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  padding: 0 8px;
}

.calendar-day {
  height: 216px;
  min-height: 216px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  gap: 6px;
  overflow: hidden;
}

.calendar-day.is-free {
  background: #f4fbf5;
  border-color: #cfe3d4;
}

.calendar-day.has-program {
  background: #f3f8fd;
  border-color: #c8dcec;
}

.calendar-day.has-vacation {
  background: #fff7f8;
  border-color: #efc4ca;
}

.calendar-day.is-past {
  background: #eef2f4;
  border-color: #d5dee3;
  color: #6f7d85;
  box-shadow: none;
}

.calendar-day.is-past .calendar-day-head span,
.calendar-day.is-past .calendar-task span {
  color: #7c8991;
}

.calendar-day.is-past .calendar-task {
  background: #f7f9fa;
  border-color: #d8e0e5;
  border-left-color: #9aa8b0;
}

.calendar-day.is-today {
  position: relative;
  background: #fffdf4;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(189, 139, 36, 0.18), var(--shadow-soft);
}

.calendar-day.is-today .calendar-day-head strong {
  display: inline-flex;
  min-width: 28px;
  min-height: 28px;
  padding: 0 8px;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  background: var(--gold);
  color: #fff;
}

.calendar-today-label {
  color: inherit;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.muted-day {
  background: transparent;
  border-style: dashed;
  height: 44px;
  min-height: 44px;
}

.calendar-day-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.calendar-day-head span {
  color: var(--muted);
  font-size: 12px;
}

.calendar-items {
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 0;
  overflow: hidden;
}

.calendar-task {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 5px;
  min-height: 22px;
  padding: 2px 4px 2px 6px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 24px auto;
  gap: 5px;
  align-items: center;
  font-size: 11px;
  min-width: 0;
}

.calendar-task strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-task-project {
  max-width: 72px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-task-assignee {
  width: 24px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(31, 42, 46, 0.12);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font-size: 9px;
  font-weight: 900;
}

.calendar-task-alert {
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
}

.calendar-more {
  min-height: 22px;
  display: flex;
  align-items: center;
  padding: 2px 7px;
  border: 1px dashed #b9c9cf;
  border-radius: 5px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  cursor: help;
}

.calendar-task-note {
  color: var(--amber);
  font-weight: 700;
}

.calendar-vacation-item,
.calendar-task-warning,
.proposal-row.has-warning {
  background: #fff0f2;
  border-color: #efc4ca;
  border-left-color: var(--red);
}

.calendar-task-overlap {
  background: #fff8e8;
  border-color: #ead2aa;
  border-left-color: var(--amber);
}

.proposal-warning {
  grid-column: 1 / -1;
  color: var(--red);
  font-size: 12px;
}

.calendar-unscheduled-panel {
  margin-top: 0;
}

.table-row {
  grid-template-columns: 120px minmax(200px, 1fr) 130px 140px 150px;
  align-items: center;
}

.table-row.with-action {
  grid-template-columns: 120px minmax(200px, 1fr) 130px 140px 150px 80px;
}

/* MY TASKS REPORT POLISH */
#schedule3dView {
  display: grid;
  gap: 18px;
  --task-not-started: #64748b;
  --task-working: #1677c8;
  --task-done: #18864b;
  --task-blocked: #c7374f;
  --task-postponed: #b56b08;
}

#schedule3dView.hidden {
  display: none;
}

.my-tasks-toolbar {
  display: grid;
  grid-template-columns: minmax(390px, auto) minmax(160px, 0.75fr) minmax(180px, 1fr) minmax(180px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
}

.task-view-tabs.my-tasks-view-tabs {
  grid-template-columns: repeat(4, minmax(96px, 1fr));
  white-space: nowrap;
}

.my-tasks-view-notice {
  min-height: 42px;
  padding: 11px 14px;
  border-left: 4px solid #087266;
  background: #eef7f5;
  color: #52656f;
  font-size: 12px;
  font-weight: 750;
}

.date-filter-chip {
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px 8px 6px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
  box-shadow: 0 8px 18px rgba(18, 32, 38, 0.04);
}

.date-filter-chip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.date-filter-chip input {
  min-height: 36px;
  min-width: 150px;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 6px 8px;
}

.my-tasks-panel {
  overflow: hidden;
}

.my-tasks-panel .panel-head {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
}

.my-tasks-list {
  gap: 10px;
  padding: 14px;
}

#scheduleTable .my-task-card {
  display: grid;
  grid-template-columns: minmax(115px, 0.65fr) minmax(260px, 1.45fr) minmax(210px, 1fr) 180px minmax(155px, 0.72fr);
  gap: 16px;
  align-items: center;
  min-height: 108px;
  padding: 14px 14px 14px 16px;
  border: 1px solid var(--line);
  border-left-width: 6px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(15, 35, 43, 0.055);
}

#scheduleTable .my-task-card.is-reorderable {
  grid-template-columns: 42px minmax(115px, 0.65fr) minmax(260px, 1.45fr) minmax(210px, 1fr) 180px minmax(155px, 0.72fr);
}

.task-order-control {
  display: grid;
  gap: 5px;
  justify-items: center;
  align-content: center;
}

.task-order-control > strong {
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #e8f2ef;
  color: var(--accent-strong);
  font-size: 13px;
}

.task-order-handle {
  width: 28px;
  height: 28px;
  border: 1px solid #ccdadd;
  border-radius: 6px;
  background: #fff;
  color: #60747d;
  cursor: grab;
  font-weight: 900;
}

.is-reorderable.dragging {
  opacity: 0.48;
}

.is-reorderable.drop-before {
  box-shadow: inset 0 3px 0 var(--accent);
}

.is-reorderable.drop-after {
  box-shadow: inset 0 -3px 0 var(--accent);
}

.my-task-card.task-status-neinceput { border-left-color: var(--task-not-started); }
.my-task-card.task-status-in-lucru { border-left-color: var(--task-working); background: #f7fbff; }
.my-task-card.task-status-finalizat { border-left-color: var(--task-done); background: #f6fcf8; }
.my-task-card.task-status-blocat { border-left-color: var(--task-blocked); background: #fff8f9; }
.my-task-card.task-status-amanat { border-left-color: var(--task-postponed); background: #fffbf4; }

.my-task-card-project,
.my-task-card-work,
.my-task-card-schedule {
  display: grid;
  gap: 4px;
  align-content: start;
}

.my-task-card-project strong,
.my-task-card-work strong {
  font-size: 14px;
  line-height: 1.3;
}

.my-task-card-actions {
  display: grid;
  gap: 7px;
}

.my-task-card-actions select {
  min-height: 40px;
  width: 100%;
  font-weight: 850;
}

.my-task-card-actions .mini-button {
  width: 100%;
}

@media (max-width: 1180px) {
  .my-tasks-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-view-tabs.my-tasks-view-tabs,
  #myTasksRefreshBtn {
    grid-column: 1 / -1;
  }

  #scheduleTable .my-task-card {
    grid-template-columns: minmax(105px, 0.6fr) minmax(210px, 1.25fr) minmax(180px, 1fr) 160px minmax(140px, 0.7fr);
  }

  #scheduleTable .my-task-card.is-reorderable {
    grid-template-columns: 38px minmax(105px, 0.6fr) minmax(210px, 1.25fr) minmax(180px, 1fr) 160px minmax(140px, 0.7fr);
  }
}

@media (max-width: 760px) {
  .my-tasks-toolbar,
  .date-filter-chip {
    display: grid;
    grid-template-columns: 1fr;
  }

  .task-view-tabs.my-tasks-view-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .my-tasks-view-tabs .task-view-tab {
    padding-inline: 8px;
  }

  .date-filter-chip input {
    width: 100%;
  }

  #scheduleTable .my-task-card {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  #scheduleTable .my-task-card.is-reorderable {
    grid-template-columns: 1fr;
  }

  .my-task-card-actions {
    max-width: 280px;
  }
}

.work-order-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 14px;
  align-items: start;
}

.work-order-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fbfcfb;
}

.work-order-group-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #f2f6f3;
}

.work-order-group-head h3 {
  margin: 0;
  font-size: 16px;
}

.work-order-group-head span {
  color: var(--muted);
  font-size: 13px;
}

.work-order-group-head strong {
  min-width: 36px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #e8f2ef;
  color: var(--accent-strong);
}

.work-order-group-list {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.work-order-row {
  display: grid;
  grid-template-columns: 34px 42px minmax(0, 1fr) 92px 86px;
  gap: 10px;
  align-items: center;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 6px solid var(--accent);
  border-radius: var(--radius);
  cursor: default;
}

.work-order-drag-handle {
  width: 30px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f6faf8;
  color: var(--accent-strong);
  font-weight: 900;
  letter-spacing: 0;
  cursor: grab;
}

.work-order-drag-handle:active {
  cursor: grabbing;
}

.work-order-row.dragging {
  opacity: 0.55;
}

.work-order-row.changed {
  border-left-color: var(--amber);
}

.work-order-row.drop-before {
  box-shadow: inset 0 3px 0 var(--accent);
}

.work-order-row.drop-after {
  box-shadow: inset 0 -3px 0 var(--accent);
}

.order-number {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #edf4f1;
  color: var(--accent-strong);
  font-weight: 800;
}

.order-actions {
  display: flex;
  gap: 6px;
}

.mini-button {
  min-width: 36px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.mini-button:hover {
  background: var(--accent-soft);
  border-color: #bcd2ca;
  transform: translateY(-1px);
}

.inline-form {
  display: grid;
  grid-template-columns: 150px 1fr 1.2fr 120px 150px 140px 120px;
  gap: 10px;
  margin-bottom: 14px;
}

.service-form {
  grid-template-columns: minmax(220px, 1.4fr) 170px minmax(160px, 1fr) 130px 150px 90px 130px minmax(160px, 1fr) 120px;
}

.permit-form {
  grid-template-columns: minmax(240px, 1.25fr) 150px 90px minmax(300px, 2fr) 110px;
  align-items: center;
}

.permit-form.custom-permit {
  grid-template-columns: minmax(220px, 1.1fr) 150px minmax(160px, 0.85fr) 86px minmax(260px, 1.8fr) 110px;
}

.permit-form .primary-button {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 13px;
  justify-self: start;
  width: auto;
}

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

.field-label select,
.field-label input {
  width: 100%;
}

.permit-autocomplete-field {
  position: relative;
}

.selected-project-label {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.autocomplete-results {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(18, 32, 38, 0.16);
  padding: 6px;
}

.autocomplete-option {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.autocomplete-option:hover,
.autocomplete-option:focus {
  background: var(--accent-soft);
  outline: none;
}

.autocomplete-option span,
.autocomplete-empty {
  color: var(--muted);
  font-size: 12px;
}

.autocomplete-empty {
  padding: 12px;
}

.permit-filter-bar {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(170px, 0.6fr) minmax(260px, 1fr) 150px;
  gap: 12px;
  align-items: end;
  margin: 0 0 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(18, 32, 38, 0.03);
}

.payment-form {
  grid-template-columns: minmax(190px, 1fr) minmax(240px, 1.4fr) 120px 150px 140px 110px;
  align-items: center;
}

.permit-list {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.performance-layout {
  display: grid;
  grid-template-columns: minmax(620px, 1.25fr) minmax(360px, 0.75fr);
  gap: 20px;
  align-items: start;
  margin-bottom: 18px;
}

.performance-main-panel,
.performance-detail-panel,
.performance-action-panel {
  min-height: 0;
}

.performance-warning {
  margin: 0 0 14px;
  padding: 13px 15px;
  border: 1px solid #ead2aa;
  border-left: 6px solid var(--amber);
  border-radius: 14px;
  background: #fff8eb;
  color: var(--ink);
  font-weight: 800;
}

.performance-table,
.performance-detail,
.performance-events {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.performance-main-panel .performance-table,
.performance-detail-panel .performance-detail {
  max-height: 620px;
  overflow: auto;
}

.performance-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(160px, 1.1fr) minmax(120px, 0.75fr) minmax(120px, 0.75fr) 96px 64px;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
  padding: 13px 14px;
  text-align: left;
  white-space: normal;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.performance-row.active {
  background: var(--accent-soft);
  border-left-color: var(--accent-strong);
}

.performance-row strong,
.performance-event strong {
  overflow-wrap: anywhere;
}

.performance-row span,
.performance-event span,
.performance-summary span {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.performance-row progress {
  width: 100%;
  height: 8px;
  grid-column: 1 / 4;
}

.performance-row .badge {
  justify-self: start;
}

.performance-event {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(4, minmax(110px, 0.5fr)) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
  padding: 13px 14px;
}

.performance-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
}

.performance-summary span {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px;
  background: var(--panel-soft);
}

.performance-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 14px;
}

.performance-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.performance-actions .table-panel {
  min-height: 0;
}

.report-preview-panel {
  min-height: 0;
  margin-top: 16px;
}

.users-panel {
  min-height: 0;
}

#usersView > .module-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content max-content;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

#usersView > .module-head > div:first-child {
  min-width: 0;
  padding-right: 16px;
}

#usersView #backupNowBtn,
#usersView #refreshUsersBtn {
  min-width: 132px;
  min-height: 44px;
}

#usersView #backupNowBtn {
  grid-column: 2;
  justify-self: end;
}

#usersView #refreshUsersBtn {
  grid-column: 3;
  justify-self: end;
}

.backup-state {
  margin: -4px 0 14px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 760px) {
  #usersView > .module-head {
    grid-template-columns: 1fr 1fr;
  }

  #usersView > .module-head > div:first-child {
    grid-column: 1 / -1;
    padding-right: 0;
  }

  #usersView #backupNowBtn,
  #usersView #refreshUsersBtn {
    width: 100%;
    min-width: 0;
  }

  #usersView #backupNowBtn {
    grid-column: 1;
  }

  #usersView #refreshUsersBtn {
    grid-column: 2;
  }
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.user-card {
  display: grid;
  gap: 15px;
  padding: 15px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #ffffff 0%, var(--panel-soft) 100%);
  box-shadow: var(--shadow-soft);
}

.user-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.user-identity {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.user-identity strong {
  font-size: 17px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.user-identity span {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.user-identity .user-function-line {
  max-width: 100%;
  color: #0b756b;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.25;
}

.user-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-card-grid {
  display: grid;
  grid-template-columns: minmax(160px, 0.75fr) minmax(220px, 1fr) minmax(220px, 1fr);
  gap: 14px;
  align-items: start;
}

.user-card-grid label,
.user-requested-function {
  min-width: 0;
}

.user-card-grid select {
  min-width: 0;
}

.user-requested-function {
  display: grid;
  gap: 6px;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
}

.user-requested-function span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.user-requested-function strong {
  color: var(--ink);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.user-card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.user-card-actions .inline-check {
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.user-card-actions input {
  width: 16px;
  height: 16px;
}

/* USER CARD FUNCTION VISIBILITY - final */
.user-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.user-identity {
  min-width: 0;
  max-width: 100%;
}

.user-identity strong,
.user-identity span {
  min-width: 0;
}

.user-identity .user-function-line {
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.user-badges {
  max-width: 220px;
}

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

.performance-form input,
.performance-form select {
  min-width: 0;
}

.performance-form .primary-button {
  justify-self: start;
}

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

.permit-row {
  display: grid;
  grid-template-columns: minmax(230px, 1.25fr) 110px repeat(3, 112px) 125px 112px minmax(180px, 1fr) 42px;
  gap: 10px;
  align-items: center;
  padding: 13px 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 14px;
  position: relative;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.permit-row.warn-row {
  border-left-color: var(--red);
  background: #fff7f8;
}

.payment-row {
  display: grid;
  grid-template-columns: minmax(240px, 1.35fr) 120px 150px 140px minmax(220px, 0.9fr) 44px;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(18, 32, 38, 0.03);
}

.payment-warning {
  background: #fff8e6;
  border-color: #f1cf7a;
}

.payment-danger {
  background: #fff1f1;
  border-color: #ef9a9a;
}

.payment-paid {
  background: #f7faf8;
  color: var(--muted);
}

.payment-paid .payment-main,
.payment-paid .payment-amount {
  text-decoration: line-through;
}

.payment-main {
  display: grid;
  gap: 4px;
}

.payment-main span {
  color: var(--muted);
}

.payment-amount {
  font-weight: 800;
}

.payment-delete {
  min-height: 42px;
  width: 42px;
  padding: 0;
  font-weight: 800;
}

.vacation-row {
  grid-template-columns: minmax(110px, 0.8fr) 150px 120px 98px minmax(130px, 0.9fr) minmax(130px, 0.9fr) minmax(180px, 1.2fr) 92px;
}

.vacation-row .mini-button {
  min-height: 38px;
  padding: 0 10px;
  font-weight: 800;
}

/* VACATIONS LIST LAYOUT FIX - final */
#vacationsView #vacationTable.table-like {
  display: grid;
  gap: 12px;
  padding: 16px;
}

#vacationsView .vacation-card {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(130px, 0.7fr) 120px minmax(110px, 0.55fr) minmax(110px, 0.55fr) minmax(230px, 1fr) 92px;
  gap: 14px;
  align-items: center;
  min-height: 78px;
  padding: 14px 16px;
  border: 1px solid #dfe8eb;
  border-left: 5px solid var(--accent);
  border-radius: 15px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
  box-shadow: 0 1px 0 rgba(18, 32, 38, 0.03);
}

#vacationsView .vacation-card.is-cancelled {
  border-left-color: var(--amber);
  background: #fffaf1;
}

#vacationsView .vacation-person,
#vacationsView .vacation-replacement,
#vacationsView .vacation-meta {
  min-width: 0;
  display: grid;
  gap: 4px;
}

#vacationsView .vacation-person strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#vacationsView .vacation-person span,
#vacationsView .vacation-replacement span,
#vacationsView .vacation-meta span {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 750;
  line-height: 1.2;
}

#vacationsView .vacation-replacement strong,
#vacationsView .vacation-meta strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#vacationsView .vacation-status {
  width: 100%;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  text-align: center;
  white-space: nowrap;
}

#vacationsView .vacation-note {
  min-width: 0;
  overflow: hidden;
  color: #566471;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#vacationsView .vacation-cancel-button {
  width: 100%;
  justify-self: stretch;
  min-height: 34px;
  padding: 0 12px;
  white-space: nowrap;
}

#vacationsView .vacation-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

#vacationsView .vacation-actions .mini-button {
  width: 100%;
}

@media (max-width: 1180px) {
  #vacationsView .vacation-card {
    grid-template-columns: minmax(220px, 1fr) minmax(130px, 0.75fr) 120px minmax(120px, 0.7fr) minmax(120px, 0.7fr);
  }

  #vacationsView .vacation-note {
    grid-column: 1 / 5;
  }

  #vacationsView .vacation-actions,
  #vacationsView .vacation-cancel-button,
  #vacationsView .vacation-action-placeholder {
    grid-column: 5 / 6;
  }
}

@media (max-width: 760px) {
  #vacationsView .vacation-card {
    grid-template-columns: 1fr;
  }

  #vacationsView .vacation-note,
  #vacationsView .vacation-actions,
  #vacationsView .vacation-cancel-button,
  #vacationsView .vacation-action-placeholder {
    grid-column: 1 / -1;
  }

  #vacationsView .vacation-status,
  #vacationsView .vacation-actions,
  #vacationsView .vacation-cancel-button {
    width: auto;
    justify-self: start;
  }
}

#vacationsView #vacationForm.inline-form {
  display: grid;
  grid-template-columns: 150px minmax(210px, 1fr) minmax(210px, 1fr) 120px minmax(150px, 0.7fr) minmax(0, 1fr) 150px;
  gap: 10px 12px;
  align-items: center;
  width: 100%;
  overflow: hidden;
}

#vacationsView #vacationForm.inline-form > * {
  min-width: 0;
}

#vacationsView #vacationForm.inline-form button {
  grid-column: 7 / 8;
  width: 150px;
  min-width: 150px;
  justify-self: end;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  #vacationsView #vacationForm.inline-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #vacationsView #vacationForm.inline-form button {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }
}

.completed-row {
  opacity: 0.72;
}

.completed-row::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: 50%;
  border-top: 2px solid rgba(32, 48, 51, 0.56);
  pointer-events: none;
  z-index: 3;
}

.status-pill {
  min-width: 0;
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #e8f2ef;
  color: var(--accent-strong);
  font-weight: 800;
  padding: 8px 11px;
}

.status-pill.warn {
  background: #fff1f2;
  color: var(--red);
  border-color: #ffd6dc;
}

.compact-date {
  gap: 4px;
  font-size: 11px;
}

.compact-date input,
.permit-notes {
  min-height: 34px;
}

.next-check {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.next-check strong {
  color: var(--ink);
}

.print-sheet {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: grid;
  gap: 18px;
}

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

.sheet-item {
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
  break-inside: avoid;
  page-break-inside: avoid;
}

.sheet-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.sheet-item strong {
  display: block;
  break-before: avoid;
  page-break-before: avoid;
  overflow-wrap: anywhere;
}

.print-keep-together {
  break-inside: avoid;
  page-break-inside: avoid;
}

.dtac-structures-section,
.project-structures-panel {
  margin-top: 24px;
}

.dtac-structures-title,
.dtac-structure-head,
.project-structures-title,
.project-structure-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dtac-structures-title h3,
.dtac-structure-head h3,
.project-structures-title h3,
.project-structure-head h3 {
  margin: 0;
}

.dtac-structures-list,
.project-structures-list {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.dtac-structure-card,
.project-structure-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: #fff;
}

.dtac-structure-actions,
.project-structure-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dtac-structure-grid,
.project-structure-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.dtac-structure-grid label,
.project-structure-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.panel-head {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
  position: relative;
}

.panel-head h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0;
  line-height: 1.2;
}

.panel-head span {
  color: var(--muted);
  font-size: 13px;
}

.project-list {
  max-height: calc(100vh - 220px);
  overflow: auto;
  padding: 10px;
}

.project-row {
  width: 100%;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  border: 1px solid transparent;
  background: #fff;
  text-align: left;
  padding: 14px 15px;
  cursor: pointer;
  position: relative;
  border-radius: 14px;
  margin-bottom: 8px;
  box-shadow: 0 1px 0 rgba(23, 35, 38, 0.03);
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.project-row:hover,
.project-row.active {
  background: var(--accent-soft);
  border-color: #c4d8d0;
  box-shadow: var(--shadow-soft);
}

.project-row:hover {
  transform: translateY(-1px);
}

.project-code {
  color: var(--accent-strong);
  font-weight: 800;
}

.project-main strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-main span {
  color: var(--muted);
  display: block;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 29px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f1f4f5;
  color: #53636b;
  font-size: 12px;
  font-weight: 800;
}

.badge.warn {
  background: #fff4e3;
  color: var(--amber);
  border-color: #f2d7ac;
}

.badge.done {
  background: #e7f4ef;
  color: var(--accent-strong);
  border-color: #c9e4d9;
}

.badge.danger {
  background: #ffe8e8;
  color: var(--red);
  border-color: #efb5b5;
}

.badge,
.status-pill,
.code-pill {
  border: 1px solid rgba(23, 35, 38, 0.06);
}

.details-panel {
  padding: 20px;
}

.details-panel,
.list-panel,
.table-panel {
  backdrop-filter: blur(8px);
}

.empty-state {
  min-height: 420px;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 8px;
  color: var(--muted);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(249, 251, 252, 0.92)),
    repeating-linear-gradient(135deg, rgba(18, 108, 100, 0.035) 0 1px, transparent 1px 12px);
  border: 1px dashed #cfdce1;
  border-radius: var(--radius-lg);
  padding: 22px;
}

.empty-state.compact {
  min-height: 120px;
}

.empty-state strong {
  color: var(--ink);
  font-size: 19px;
}

.hidden {
  display: none;
}

/* Global UI polish layer: shared visual rules without changing app structure. */
.main {
  padding-top: 20px;
}

.sidebar {
  gap: 20px;
}

.nav-group {
  gap: 6px;
}

.nav-group summary {
  letter-spacing: 0.06em;
  color: rgba(248, 251, 248, 0.72);
}

.nav-item {
  position: relative;
  min-height: 38px;
  padding: 10px 12px 10px 14px;
  font-size: 13.5px;
  letter-spacing: 0;
}

.nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  font-weight: 850;
  box-shadow: inset 4px 0 0 #f1c75b, 0 10px 22px rgba(0, 0, 0, 0.14);
}

.auth-panel,
.sync-panel,
.topbar,
.module-head,
.toolbar,
.table-panel,
.list-panel,
.details-panel,
.today-panel,
.project-structure-card,
.dtac-structure-card,
.user-card,
.payment-row {
  border-color: var(--line);
}

.topbar {
  min-height: 70px;
  padding: 14px 18px;
}

.topbar h1 {
  font-size: 25px;
  font-weight: 850;
}

.topbar-user {
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(249, 251, 252, 0.82);
}

.module-head {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.module-head h2,
.panel-head h2,
.task-group-title,
.dtac-structures-title h3,
.project-structure-head h3 {
  font-weight: 850;
  letter-spacing: 0;
}

.panel-head {
  background: linear-gradient(180deg, #fbfcfd 0%, #f3f7f8 100%);
  border-bottom: 1px solid var(--line);
}

.stats-grid {
  gap: 16px;
}

.stat {
  border-color: #d7e3e7;
  box-shadow: 0 12px 28px rgba(18, 32, 38, 0.065);
}

.stat span {
  display: block;
  font-size: 12.5px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat strong {
  font-size: 26px;
  font-weight: 900;
}

.table-panel,
.list-panel,
.details-panel {
  box-shadow: 0 14px 34px rgba(18, 32, 38, 0.07);
}

.summary-row,
.task-card,
.table-row,
.today-row,
.work-order-row,
.permit-row,
.performance-row,
.performance-event,
.project-row,
.user-card,
.payment-row {
  border-color: #dfe8eb;
}

.summary-row:hover,
.task-card:hover,
.table-row:hover,
.today-row:hover,
.work-order-row:hover,
.permit-row:hover,
.performance-row:hover,
.performance-event:hover,
.project-row:hover,
.user-card:hover,
.payment-row:hover {
  border-color: #c9d9de;
  box-shadow: var(--shadow-soft);
}

.project-row {
  align-items: center;
}

.project-code {
  font-size: 13px;
}

.project-main strong,
.task-card strong,
.today-row strong,
.work-order-row strong,
.permit-row strong,
.performance-row strong,
.user-identity strong,
.payment-main strong {
  font-weight: 850;
}

.task-meta,
.project-main span,
.selected-project-label,
.empty-state span,
.topbar-kicker {
  color: var(--muted);
  font-size: 12.5px;
}

.primary-button,
.secondary-button,
.mini-button,
.icon-button {
  font-weight: 800;
}

.mini-button {
  border-radius: 10px;
}

.badge,
.status-pill,
.code-pill {
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
}

.badge.danger,
.status-pill.warn,
.payment-danger .badge {
  background: #ffe8e8;
  color: var(--red);
  border-color: #efb5b5;
}

.badge.warn {
  background: #fff5df;
  color: #8f5411;
  border-color: #f0d6a5;
}

.badge.done {
  background: #e5f5ef;
  color: var(--accent-strong);
  border-color: #bddfce;
}

.empty-state {
  min-height: 240px;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 251, 252, 0.96)),
    repeating-linear-gradient(135deg, rgba(18, 108, 100, 0.035) 0 1px, transparent 1px 14px);
}

.empty-state.compact {
  min-height: 96px;
  padding: 18px;
}

.empty-state strong {
  font-size: 17px;
  font-weight: 850;
}

.today-grid,
.dashboard-today-grid {
  gap: 16px;
}

.today-panel .panel-head,
.dashboard-today .module-head {
  background: linear-gradient(180deg, #fbfcfd 0%, #f3f7f8 100%);
}

.work-order-group {
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.work-order-group-head {
  background: linear-gradient(180deg, #f7faf9 0%, #eef6f3 100%);
}

.work-order-row {
  padding: 14px;
}

.work-order-drag-handle {
  background: #eef8f5;
}

.permit-form,
.permit-filter-bar,
.inline-form,
.performance-form,
.payment-form {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.field-label {
  font-size: 12.5px;
  font-weight: 750;
  color: var(--muted);
}

.user-card {
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
}

.user-card-head {
  align-items: start;
}

.performance-layout,
.performance-actions {
  gap: 18px;
}

.print-sheet {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.sheet-item {
  border-color: #dfe8eb;
  background: #fbfcfd;
}

.project-form {
  display: grid;
  gap: 16px;
}

.details-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  border-bottom: 1px solid var(--line);
  margin: -20px -20px 0;
  padding: 20px;
  background: var(--panel-soft);
  border-radius: 18px 18px 0 0;
}

.details-head h2 {
  margin: 8px 0 4px;
  font-size: 22px;
  line-height: 1.2;
}

.details-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.project-folder-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  min-width: 260px;
}

.code-pill {
  display: inline-flex;
  padding: 5px 9px;
  background: #e8f2ef;
  color: var(--accent-strong);
  font-weight: 800;
  border-radius: 999px;
}

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

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

label.wide,
.notes-label {
  grid-column: 1 / -1;
}

.check-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.check-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 9px 11px;
  color: var(--ink);
  background: var(--panel-soft);
}

.check-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

#saveState {
  color: var(--muted);
  font-size: 13px;
}

/* PROJECT SAVE ACTION FIX - final */
#projectForm .form-actions {
  margin-top: 8px;
  padding: 16px 0 8px;
  border-top: 1px solid var(--line-soft);
}

#projectForm .form-actions #saveState {
  min-width: 0;
  overflow: hidden;
  padding-right: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#projectForm .form-actions button[type="submit"] {
  width: 132px;
  min-width: 132px;
  min-height: 44px;
  justify-self: end;
  border-radius: 12px;
  padding: 0 18px;
  box-shadow: 0 12px 24px rgba(18, 108, 100, 0.16);
}

.client-portal-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f7fbfb;
}

.client-portal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#clientPortalInfo {
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: #ffffff;
  overflow-wrap: anywhere;
}

/* Premium rebrand layer: SaaS/admin dashboard look aligned with AZD mockup. */
:root {
  --premium-sidebar: #071f24;
  --premium-sidebar-2: #082b2f;
  --premium-accent: #006b5f;
  --premium-accent-2: #00796b;
  --premium-gold: #d6a21e;
  --premium-bg: #f5f7f8;
  --premium-card: #ffffff;
  --premium-ink: #1f2933;
  --premium-muted: #6b7280;
  --premium-line: #e2e8f0;
  --premium-danger: #dc2626;
  --premium-warning: #f59e0b;
  --premium-success: #15803d;
  --premium-blue: #2563a8;
  --premium-shadow: 0 16px 42px rgba(15, 23, 42, 0.08);
  --premium-shadow-soft: 0 8px 22px rgba(15, 23, 42, 0.055);
}

body {
  background:
    radial-gradient(circle at 82% 0%, rgba(0, 121, 107, 0.08), transparent 360px),
    linear-gradient(180deg, #ffffff 0%, var(--premium-bg) 360px),
    var(--premium-bg);
  color: var(--premium-ink);
}

.app-shell {
  grid-template-columns: 286px minmax(0, 1fr);
}

.sidebar {
  background:
    radial-gradient(circle at 18% 0%, rgba(214, 162, 30, 0.13), transparent 190px),
    linear-gradient(180deg, #092a31 0%, var(--premium-sidebar) 54%, #06191d 100%);
  padding: 26px 20px 20px;
  gap: 20px;
  box-shadow: 14px 0 34px rgba(5, 16, 20, 0.22);
}

.brand {
  gap: 13px;
  min-height: 58px;
}

.brand-mark {
  position: relative;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--premium-gold), #f3cc68);
  color: transparent;
  box-shadow: 0 12px 24px rgba(214, 162, 30, 0.26);
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 11px;
  border: 4px solid #0b2b31;
  border-left-color: transparent;
  border-radius: 6px;
  transform: rotate(-45deg);
}

.brand-mark::after {
  inset: 17px;
  border-width: 3px;
  opacity: 0.75;
}

.brand h1 {
  font-size: 18px;
  font-weight: 900;
}

.brand p {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.68);
}

.auth-panel {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.current-user {
  position: relative;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 3px 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.045));
}

.current-user::before {
  content: "AD";
  grid-row: 1 / span 2;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #1f7c83, var(--premium-accent));
  color: #fff;
  font-weight: 900;
  font-size: 13px;
}

.current-user strong,
.current-user span {
  grid-column: 2;
}

.current-user button {
  grid-column: 3;
  grid-row: 1 / span 2;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  background: rgba(214, 162, 30, 0.16);
  color: #f7d678;
  box-shadow: none;
}

.nav-list {
  gap: 14px;
}

.nav-group {
  padding: 0;
  border: 0;
  background: transparent;
}

.nav-group summary {
  min-height: 28px;
  padding: 0 10px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 11px;
}

.nav-group summary::after {
  display: none;
}

.nav-item,
.sidebar-item {
  min-height: 46px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 800;
  background: transparent;
}

.nav-item::before {
  content: "□";
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
}

.nav-item[data-module="dashboard"]::before { content: "⌂"; }
.nav-item[data-module="projects"]::before { content: "▣"; }
.nav-item[data-module="workOrder"]::before { content: "↕"; }
.nav-item[data-module="dtac"]::before { content: "▤"; }
.nav-item[data-module="schedule3d"]::before { content: "TM"; font-size: 10px; font-weight: 900; }
.nav-item[data-module="tasks"]::before { content: "✓"; }
.nav-item[data-module="services"]::before { content: "PT"; font-size: 10px; font-weight: 900; }
.nav-item[data-module="permits"]::before { content: "A"; font-size: 11px; font-weight: 900; }
.nav-item[data-module="payments"]::before { content: "lei"; font-size: 9px; font-weight: 900; }
.nav-item[data-module="vacations"]::before { content: "C"; font-size: 11px; font-weight: 900; }
.nav-item[data-module="reports"]::before { content: "R"; font-size: 11px; font-weight: 900; }
.nav-item[data-module="performance"]::before { content: "↗"; }
.nav-item[data-module="analiza"]::before { content: "AI"; font-size: 10px; font-weight: 900; }
.nav-item[data-module="users"]::before { content: "U"; font-size: 11px; font-weight: 900; }
.nav-item[data-module="health"]::before { content: "⚙"; }

.nav-item.active,
.sidebar-item.active {
  color: #fff;
  background: linear-gradient(135deg, #c7921d 0%, var(--premium-gold) 100%);
  box-shadow: 0 13px 28px rgba(214, 162, 30, 0.28);
}

.nav-item.active::before {
  color: #062126;
  background: rgba(255, 255, 255, 0.38);
}

.nav-item:hover:not(.active) {
  background: rgba(0, 121, 107, 0.34);
  transform: translateX(2px);
}

.sync-panel,
.sidebar-support {
  margin-top: auto;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.075);
}

.sidebar-support {
  margin-top: 0;
  display: grid;
  gap: 3px;
}

.sidebar-support span,
.sidebar-support small,
.sync-panel span,
.sync-panel small {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

.sidebar-support strong,
.sync-panel strong {
  color: #fff;
  font-size: 14px;
}

.main {
  padding: 24px 32px 34px;
}

.topbar,
.page-header {
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 18px;
  align-items: center;
  margin: -8px -10px 20px;
  padding: 16px 20px 18px;
  border: 0;
  border-bottom: 1px solid var(--premium-line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: none;
}

.breadcrumb {
  margin: 0 0 4px;
  color: var(--premium-muted);
  font-size: 12px;
  font-weight: 750;
}

.page-title,
.topbar h1 {
  margin: 0;
  color: var(--premium-ink);
  font-size: 26px;
  font-weight: 900;
}

.topbar-kicker {
  margin-top: 4px;
  font-size: 12px;
}

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

.topbar-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--premium-line);
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-weight: 900;
  box-shadow: var(--premium-shadow-soft);
}

.topbar-user {
  min-width: 178px;
  padding: 10px 14px;
  border-left: 1px solid var(--premium-line);
  border-radius: 0;
  background: transparent;
}

.toolbar,
.search-bar {
  grid-template-columns: minmax(320px, 1fr) 160px 190px 48px;
  gap: 12px;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.search-wrap {
  height: 48px;
  border-color: var(--premium-line);
  border-radius: 12px;
  box-shadow: var(--premium-shadow-soft);
}

.filter-button,
.toolbar .icon-button {
  background: #fff;
  border: 1px solid var(--premium-line);
  border-radius: 12px;
}

.kpi-grid,
.stats-grid {
  gap: 18px;
}

.kpi-card,
.stat {
  position: relative;
  min-height: 104px;
  display: grid;
  align-content: center;
  padding: 18px 18px 18px 82px;
  border: 1px solid var(--premium-line);
  border-radius: 14px;
  background: var(--premium-card);
  box-shadow: var(--premium-shadow-soft);
}

.stat::before,
.kpi-card::before {
  content: "▦";
  position: absolute;
  left: 18px;
  top: 50%;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  transform: translateY(-50%);
  background: linear-gradient(135deg, var(--premium-accent), #004b45);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 10px 18px rgba(0, 107, 95, 0.18);
}

.stat:nth-child(2)::before { background: linear-gradient(135deg, var(--premium-blue), #1d4f8f); }
.stat:nth-child(3)::before { content: "✓"; background: linear-gradient(135deg, var(--premium-success), #166534); }
.stat.attention::before { content: "!"; background: linear-gradient(135deg, #f97316, var(--premium-warning)); }

.stat span {
  color: var(--premium-muted);
  font-size: 12px;
  font-weight: 850;
}

.stat strong {
  margin-top: 2px;
  color: #111827;
  font-size: 28px;
}

.panel,
.section-card,
.table-panel,
.list-panel,
.details-panel {
  border: 1px solid var(--premium-line);
  border-radius: 16px;
  background: var(--premium-card);
  box-shadow: var(--premium-shadow);
}

.panel-header,
.panel-head {
  min-height: 58px;
  padding: 16px 18px;
  background: #fff;
  border-bottom: 1px solid var(--premium-line);
}

.panel-head h2 {
  color: #111827;
  font-size: 16px;
}

.workspace {
  grid-template-columns: minmax(420px, 0.9fr) minmax(560px, 1.55fr);
  gap: 18px;
}

.project-list {
  gap: 0;
  padding: 8px;
}

.project-row {
  grid-template-columns: 90px minmax(0, 1fr) auto 22px;
  min-height: 54px;
  margin: 0;
  padding: 12px 10px 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--premium-line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

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

.project-row.active,
.project-row:hover {
  border-radius: 10px;
  background: #e8f7f5;
  border-bottom-color: transparent;
  box-shadow: inset 4px 0 0 rgba(0, 107, 95, 0.65);
}

.project-code {
  color: #07575a;
  font-weight: 900;
}

.project-main strong {
  color: #111827;
  font-size: 13.5px;
}

.project-chevron {
  color: #64748b;
  font-weight: 900;
}

.details-panel {
  padding: 0;
}

.details-head {
  margin: 0;
  padding: 18px 20px;
  border-bottom: 1px solid var(--premium-line);
  background: #fff;
}

.details-head h2 {
  margin-top: 6px;
  color: #111827;
  font-size: 18px;
}

.details-head p {
  color: var(--premium-muted);
  font-size: 12px;
}

.project-form {
  gap: 0;
}

.form-grid,
.check-row,
.notes-label,
.project-structures-panel,
.client-portal-panel,
.client-portal-files {
  margin: 0;
  padding: 18px 20px;
  border-bottom: 1px solid var(--premium-line);
}

.form-grid,
.form-field {
  gap: 12px 18px;
}

.form-grid label,
.project-structure-grid label,
.field-label,
.form-field {
  color: #475569;
  font-size: 12px;
  font-weight: 850;
}

.input,
.select,
.textarea,
input,
select,
textarea {
  border-color: #dbe4ea;
  border-radius: 8px;
  background: #fff;
}

input,
select {
  height: 38px;
}

textarea {
  min-height: 86px;
}

.btn,
.primary-button {
  min-height: 40px;
  border-radius: 8px;
}

.btn-primary,
.primary-button {
  background: linear-gradient(180deg, var(--premium-accent-2), #004f49);
}

.btn-secondary,
.secondary-action {
  background: linear-gradient(180deg, #245f83, #174766);
}

.btn-danger,
.danger-button,
[data-delete-project-structure],
.payment-delete {
  border-color: #fecaca;
  color: var(--premium-danger);
  background: #fff;
}

.project-structures-panel {
  background: #fff;
}

.project-structures-title,
.project-structure-head {
  padding: 0 0 12px;
  border-bottom: 1px solid var(--premium-line);
}

.project-structure-card {
  border: 1px solid var(--premium-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--premium-shadow-soft);
}

.project-structure-grid {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
}

.client-portal-panel {
  border: 0;
  border-top: 1px solid var(--premium-line);
  border-radius: 0;
  box-shadow: none;
}

.client-portal-actions {
  gap: 8px;
}

.client-portal-actions .primary-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.work-order-group {
  border-radius: 16px;
  box-shadow: var(--premium-shadow);
}

.work-order-group-head {
  padding: 16px 18px;
  background: #fff;
}

.work-order-group-head h3 {
  font-size: 17px;
}

.work-order-row {
  grid-template-columns: 34px 40px minmax(0, 1fr) auto auto;
  padding: 14px;
  border-left-color: var(--premium-accent);
  box-shadow: none;
}

.drag-handle,
.work-order-drag-handle {
  border-color: #cfe5e2;
  background: #e8f7f5;
  color: var(--premium-accent);
}

.work-order-row .order-actions .mini-button {
  opacity: 0.55;
}

.work-order-row:hover .order-actions .mini-button {
  opacity: 1;
}

.permit-form,
.permit-filter-bar,
.payment-form,
.inline-form,
.performance-form {
  border-color: var(--premium-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--premium-shadow-soft);
}

.permit-row,
.performance-row,
.performance-event,
.summary-row,
.table-row,
.task-card,
.today-row,
.payment-row,
.user-card {
  border-color: var(--premium-line);
  border-radius: 12px;
  background: #fff;
}

.permit-row {
  box-shadow: var(--premium-shadow-soft);
}

.user-card {
  border-left-color: var(--premium-accent);
}

.badge-muted,
.badge {
  border-color: #e5e7eb;
  background: #f8fafc;
  color: #475569;
}

.badge-success,
.badge.done {
  border-color: #bbf7d0;
  background: #ecfdf3;
  color: var(--premium-success);
}

.badge-warning,
.badge.warn {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
}

.badge-danger,
.badge.danger,
.status-pill.warn {
  border-color: #fecaca;
  background: #fef2f2;
  color: var(--premium-danger);
}

.empty-state {
  border-color: #d8e4ea;
  border-radius: 16px;
  background:
    linear-gradient(180deg, #ffffff, #f8fafc),
    repeating-linear-gradient(135deg, rgba(0, 107, 95, 0.035) 0 1px, transparent 1px 14px);
}

/* Pixel polish layer: final proportions, spacing, focus states and mature SaaS finish. */
:root {
  --azd-bg: #f4f7f8;
  --azd-surface: #ffffff;
  --azd-surface-soft: #f8fafb;
  --azd-border: #dfe7ea;
  --azd-border-soft: #edf2f4;
  --azd-sidebar: #061f24;
  --azd-sidebar-2: #082b30;
  --azd-primary: #006b5f;
  --azd-primary-dark: #004f47;
  --azd-primary-soft: #e3f3f0;
  --azd-gold: #d6a21e;
  --azd-text: #172026;
  --azd-muted: #64748b;
  --azd-muted-2: #94a3b8;
  --azd-success: #15803d;
  --azd-warning: #d97706;
  --azd-danger: #dc2626;
  --azd-info: #2563eb;
  --azd-radius-sm: 6px;
  --azd-radius-md: 10px;
  --azd-radius-lg: 14px;
  --azd-radius-xl: 18px;
  --azd-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --azd-shadow-md: 0 6px 18px rgba(15, 23, 42, 0.08);
  --azd-shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.10);
  --azd-space-xs: 4px;
  --azd-space-sm: 8px;
  --azd-space-md: 12px;
  --azd-space-lg: 16px;
  --azd-space-xl: 24px;
}

body {
  font-size: 13.75px;
  line-height: 1.48;
  text-rendering: geometricPrecision;
}

.main {
  max-width: 1920px;
  width: 100%;
  margin: 0 auto;
}

.page-content,
.page-inner,
.content-shell {
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
}

.form-shell {
  max-width: 1600px;
}

.topbar {
  margin-left: 0;
  margin-right: 0;
  padding-left: 22px;
  padding-right: 22px;
}

.breadcrumb {
  font-size: 12.5px;
}

.topbar h1,
.page-title {
  font-size: clamp(24px, 1.6vw, 28px);
  line-height: 1.05;
}

.topbar-icon,
.icon-button,
.mini-button,
.primary-button,
.btn {
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.topbar-icon:hover {
  color: var(--azd-primary);
  border-color: #b7d8d2;
  box-shadow: var(--azd-shadow-md);
  transform: translateY(-1px);
}

.azd-card,
.azd-panel,
.azd-section,
.panel,
.section-card,
.table-panel,
.list-panel,
.details-panel {
  border-color: var(--azd-border);
  border-radius: var(--azd-radius-xl);
  box-shadow: var(--azd-shadow-md);
}

.azd-card-header,
.panel-header,
.panel-head {
  padding: 15px 18px;
  border-bottom-color: var(--azd-border-soft);
}

.azd-card-title,
.panel-head h2 {
  font-size: 15px;
  font-weight: 800;
}

.azd-card-subtitle,
.panel-head span {
  color: var(--azd-muted);
  font-size: 12.5px;
}

.azd-card-body,
.summary-list,
.data-grid,
.table-like {
  padding: 16px;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
}

.stat,
.kpi-card {
  min-height: 108px;
  padding: 18px 18px 18px 78px;
  border-radius: 16px;
  box-shadow: var(--azd-shadow-md);
}

.stat:hover,
.kpi-card:hover {
  box-shadow: var(--azd-shadow-lg);
  transform: translateY(-1px);
}

.stat::before,
.kpi-card::before {
  left: 16px;
  width: 44px;
  height: 44px;
  border-radius: 13px;
}

.stat span {
  font-size: 11.75px;
  letter-spacing: 0.055em;
}

.stat strong {
  font-size: clamp(24px, 1.8vw, 30px);
}

.form-grid,
.form-grid-2,
.form-grid-3,
.form-grid-4 {
  display: grid;
  align-items: start;
}

.form-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px 16px;
}

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

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

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

.form-grid label,
.project-structure-grid label,
.field-label,
.form-field,
.notes-label {
  gap: 6px;
  color: var(--azd-muted);
  font-size: 11.75px;
  font-weight: 800;
  letter-spacing: 0.035em;
}

input,
select,
textarea,
.input,
.select,
.textarea {
  min-height: 38px;
  border-color: var(--azd-border);
  border-radius: var(--azd-radius-md);
  padding: 8px 10px;
  color: var(--azd-text);
  font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.02);
}

textarea,
.textarea {
  min-height: 92px;
  line-height: 1.45;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #cbd9de;
}

input:focus,
select:focus,
textarea:focus,
.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--azd-primary);
  box-shadow: 0 0 0 3px rgba(0, 107, 95, 0.13), inset 0 1px 0 rgba(15, 23, 42, 0.02);
}

input:disabled,
select:disabled,
textarea:disabled,
input[readonly],
textarea[readonly] {
  background: #f3f6f7;
  color: var(--azd-muted-2);
}

.check-row {
  gap: 10px 16px;
}

.check-row label,
.inline-check {
  min-height: 34px;
  border-radius: 999px;
  background: var(--azd-surface-soft);
}

.btn,
.primary-button,
.secondary-button,
.mini-button,
.icon-button {
  min-height: 38px;
  border-radius: var(--azd-radius-md);
  padding-inline: 14px;
  font-size: 13px;
  font-weight: 800;
}

.btn-small,
.mini-button {
  min-height: 30px;
  padding-inline: 9px;
  font-size: 12px;
}

.btn-primary,
.primary-button {
  box-shadow: 0 8px 16px rgba(0, 107, 95, 0.16);
}

.btn-primary:hover,
.primary-button:hover {
  box-shadow: 0 12px 22px rgba(0, 107, 95, 0.20);
}

.btn-secondary,
.secondary-action {
  box-shadow: 0 8px 16px rgba(37, 99, 168, 0.12);
}

.btn-ghost,
.mini-button,
.icon-button {
  background: #fff;
}

.btn-danger,
.danger-button,
[data-delete-project-structure],
[data-delete-permit],
.payment-delete {
  color: var(--azd-danger);
  border-color: #fecaca;
  background: #fff7f7;
}

.btn-warning {
  color: var(--azd-warning);
  border-color: #fed7aa;
  background: #fff8ed;
}

.badge,
.badge-success,
.badge-warning,
.badge-danger,
.badge-info,
.badge-neutral,
.badge-critical {
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  line-height: 1.1;
}

.badge-info {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: var(--azd-info);
}

.badge-neutral {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: var(--azd-muted);
}

.badge-critical {
  border-color: #fdba74;
  background: #fff7ed;
  color: #c2410c;
}

.summary-row,
.task-card,
.table-row,
.today-row,
.work-order-row,
.permit-row,
.performance-row,
.performance-event,
.project-row,
.user-card,
.payment-row {
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease;
}

.summary-row:hover,
.task-card:hover,
.table-row:hover,
.today-row:hover,
.work-order-row:hover,
.permit-row:hover,
.performance-row:hover,
.performance-event:hover,
.project-row:hover,
.user-card:hover,
.payment-row:hover {
  transform: translateY(-1px);
}

.project-row,
.performance-row {
  cursor: pointer;
}

.project-row.active,
.performance-row.active,
.selected-row,
.active-row {
  background: var(--azd-primary-soft);
  border-left-color: var(--azd-primary);
}

.project-row {
  min-height: 58px;
}

.project-main strong {
  font-size: 13.75px;
}

.project-main span,
.task-meta {
  font-size: 12.5px;
}

.details-panel {
  max-width: 1220px;
  justify-self: stretch;
}

.details-head {
  gap: 18px;
}

.code-pill {
  min-height: 28px;
  padding: 5px 10px;
}

.project-folder-actions .primary-button {
  min-width: 190px;
}

.notes-label {
  display: grid;
}

.project-structure-card {
  padding: 16px;
}

.project-structure-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 14px;
}

.project-structure-actions {
  justify-content: flex-end;
}

.client-portal-panel,
.client-portal-files {
  background: linear-gradient(180deg, #ffffff, #fbfcfd);
}

.client-portal-actions {
  align-items: center;
}

.work-order-list {
  gap: 16px;
}

.work-order-group-head strong {
  border-radius: var(--azd-radius-md);
}

.work-order-row {
  min-height: 74px;
}

.work-order-row .badge.warn,
.work-order-row .badge.danger {
  border-color: #fdba74;
  background: #fff7ed;
  color: #c2410c;
}

.work-order-row .order-actions .mini-button {
  min-width: 28px;
  width: 28px;
  min-height: 28px;
  padding: 0;
}

.permit-form,
.permit-filter-bar {
  padding: 16px;
}

.permit-row {
  padding: 13px;
}

.permit-notes {
  min-height: 36px;
}

.autocomplete-results {
  border-radius: var(--azd-radius-lg);
  box-shadow: var(--azd-shadow-lg);
}

.user-card {
  gap: 12px;
  padding: 14px;
}

.user-card-grid {
  gap: 12px;
}

.user-card-actions {
  gap: 8px;
}

.performance-row,
.performance-event {
  padding: 13px 14px;
}

.performance-detail-panel,
.performance-main-panel,
.performance-action-panel {
  min-height: 0;
}

.calendar-day {
  min-height: 216px;
  box-shadow: var(--azd-shadow-sm);
}

.calendar-task {
  border-radius: var(--azd-radius-sm);
}

.print-sheet {
  padding: 18px;
}

.empty-state {
  position: relative;
  min-height: 180px;
  overflow: hidden;
}

.empty-state::before {
  content: "·";
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin: 0 auto 4px;
  border-radius: 999px;
  background: var(--azd-primary-soft);
  color: var(--azd-primary);
  font-size: 26px;
  font-weight: 900;
}

.empty-state strong {
  font-size: 16px;
}

.empty-state span {
  max-width: 420px;
  margin-inline: auto;
}

.sidebar {
  padding-top: 24px;
}

.brand {
  margin-bottom: 2px;
}

.nav-group + .nav-group {
  margin-top: 2px;
}

.sync-panel,
.sidebar-support {
  padding: 13px 14px;
  border-radius: var(--azd-radius-lg);
}

.current-user {
  margin-bottom: 2px;
}

.topbar {
  border-radius: 0 0 var(--azd-radius-lg) var(--azd-radius-lg);
}

@media (min-width: 1800px) {
  .workspace {
    grid-template-columns: minmax(430px, 0.78fr) minmax(720px, 1.35fr);
  }

  .details-panel {
    max-width: 1320px;
  }

  .form-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    position: relative;
    height: auto;
  }

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

  .workspace {
    grid-template-columns: 1fr;
  }

  .performance-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .dashboard-today-grid {
    grid-template-columns: 1fr;
  }

  .performance-layout,
  .performance-actions,
  .roots-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .main {
    padding: 14px;
  }

  .topbar {
    display: grid;
    align-items: start;
  }

  .topbar-user {
    min-width: 0;
    justify-items: start;
  }

  .sidebar {
    padding: 16px 14px;
    gap: 16px;
  }

  .nav-list {
    grid-template-columns: 1fr;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
  }

  .toolbar,
  .stats-grid,
  .dashboard-today-grid,
  .form-grid,
  .check-row,
  .inline-form,
  .work-order-list,
  .task-card,
  .table-row,
  .work-order-row,
  .permit-row,
  .payment-row,
  .vacation-row,
  .proposal-row,
  .summary-row,
  .sheet-grid {
    grid-template-columns: 1fr;
  }

  .project-row {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .project-row .badge {
    grid-column: 2;
    justify-self: start;
  }

  .details-head {
    display: grid;
  }

  .calendar-grid {
    grid-template-columns: 1fr;
  }

  .today-row,
  .today-row.compact {
    grid-template-columns: 1fr;
  }

  .calendar-weekday,
  .muted-day {
    display: none;
  }

  .calendar-toolbar h2 {
    min-width: 0;
  }

  .performance-workspace,
  .performance-layout,
  .performance-actions,
  .roots-form,
  .roots-row,
  .user-card-grid,
  .payment-form,
  .performance-row,
  .performance-event,
  .performance-summary,
  .performance-form {
    grid-template-columns: 1fr;
  }

  .inline-form.roots-form,
  .summary-row.roots-row {
    grid-template-columns: 1fr;
  }

  .user-card-head,
  .user-card-actions {
    display: grid;
    justify-content: stretch;
  }

  .user-badges {
    justify-content: start;
  }

  .list-panel,
  .details-panel,
  .table-panel {
    box-shadow: var(--shadow-soft);
  }

  button {
    min-width: 0;
    white-space: normal;
  }
}

@media print {
  .sidebar,
  .toolbar,
  .module-head,
  .primary-button,
  .icon-button {
    display: none !important;
  }

  .app-shell,
  .main,
  .module-view {
    display: block;
    padding: 0;
  }

  .hidden {
    display: none !important;
  }

  .print-sheet,
  .table-like {
    border: 0;
    box-shadow: none;
  }

  @page {
    margin: 12mm;
  }

  .print-sheet {
    padding: 0;
    gap: 10px;
    font-size: 12px;
  }

  .print-sheet h2,
  .dtac-structures-title h3,
  .dtac-structure-head h3 {
    break-after: avoid;
    page-break-after: avoid;
  }

  .sheet-grid {
    gap: 4px 20px;
  }

  .sheet-item {
    padding: 5px 0;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .sheet-item span,
  .sheet-item strong {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .dtac-structures-section,
  .dtac-structures-list,
  .dtac-structure-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .dtac-structures-list {
    gap: 8px;
    margin-top: 8px;
  }

  .dtac-structure-card {
    padding: 10px 12px;
  }
}

/* PROJECTS PAGE BALANCE FIX - final */
#projectsView .workspace {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

#projectsView .list-panel,
#projectsView .details-panel {
  width: 100%;
  min-width: 0;
}

#projectsView .details-panel {
  align-self: start;
}

#projectsView .list-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

#projectsView .project-list {
  min-height: 0;
  max-height: none;
  overflow: auto;
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  padding: 10px 14px;
}

#projectsView .roots-panel {
  overflow: hidden;
}

#projectsView .inline-form.roots-form {
  grid-template-columns: minmax(0, 1fr) 210px 210px;
  gap: 16px;
  align-items: center;
  padding: 20px 24px 14px;
}

#projectsView .roots-form textarea {
  min-height: 72px;
}

#projectsView .roots-form .primary-button {
  width: 100%;
  min-width: 0;
  min-height: 56px;
}

#projectsView .roots-warning {
  display: block;
  padding: 0 24px 14px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
}

#projectsView #projectRootsList.roots-list {
  padding: 0 24px 18px;
}

#projectsView .roots-state {
  display: block;
  padding: 0 24px 16px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
}

#projectForm .form-actions {
  padding: 16px 20px 14px;
}

#projectForm .form-actions #saveState {
  padding-left: 0;
}

@media (max-width: 1320px) {
  #projectsView .workspace {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  #projectsView .workspace,
  #projectsView .inline-form.roots-form {
    grid-template-columns: 1fr;
  }
}

/* AVIZE ALIGNMENT FIX - final */
:root {
  --azd-avize-control-height: 34px;
  --azd-avize-form-control-height: 36px;
  --azd-avize-label-height: 14px;
  --azd-avize-form-label-height: 16px;
  --azd-avize-field-gap: 4px;
  --azd-avize-row-gap: 10px;
}

#permitsView .avize-add-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.6fr) 180px 120px minmax(260px, 1fr) auto;
  gap: var(--azd-avize-row-gap);
  align-items: end;
}

#permitsView .permit-form.custom-permit.avize-add-grid {
  grid-template-columns: minmax(360px, 1.45fr) 180px minmax(180px, 0.85fr) 120px minmax(260px, 1fr) auto;
}

#permitsView .avize-filter-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.3fr) 180px minmax(280px, 1fr) auto;
  gap: var(--azd-avize-row-gap);
  align-items: end;
}

#permitsView .avize-field-stack {
  display: grid;
  grid-template-rows: var(--azd-avize-form-label-height) var(--azd-avize-form-control-height);
  gap: var(--azd-avize-field-gap);
  min-width: 0;
  margin: 0;
}

#permitsView .avize-field-title {
  height: var(--azd-avize-form-label-height);
  min-height: var(--azd-avize-form-label-height);
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  line-height: var(--azd-avize-form-label-height);
}

#permitsView .avize-field-stack input,
#permitsView .avize-field-stack select,
#permitsView .avize-add-button,
#permitsView .avize-reset-button {
  width: 100%;
  height: var(--azd-avize-form-control-height);
  min-height: var(--azd-avize-form-control-height);
  box-sizing: border-box;
  align-self: end;
  line-height: 1.2;
}

#permitsView .avize-add-button,
#permitsView .avize-reset-button {
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: end;
  padding: 0 16px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

#permitsView .avize-reset-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  box-shadow: none;
}

#permitsView .avize-reset-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  cursor: pointer;
}

#permitsView .avize-add-grid .selected-project-label,
#permitsView .avize-filter-grid .selected-project-label {
  display: none;
}

#permitsView .avize-list {
  overflow-x: auto;
  overflow-y: visible;
}

#permitsView .avize-row {
  display: grid;
  grid-template-columns:
    minmax(300px, 1.5fr)
    120px
    110px
    110px
    110px
    120px
    110px
    minmax(260px, 1fr)
    34px;
  gap: var(--azd-avize-row-gap);
  align-items: end;
  min-width: 1450px;
  padding: 10px 12px;
}

#permitsView .avize-row > * {
  min-width: 0;
}

#permitsView .avize-title-cell {
  min-width: 0;
  align-self: center;
}

#permitsView .avize-title-cell strong,
#permitsView .avize-title-cell .task-meta {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#permitsView .avize-status-cell {
  height: var(--azd-avize-control-height);
  display: flex;
  align-items: center;
  align-self: end;
}

#permitsView .avize-status-cell .status-pill {
  width: 100%;
  min-width: 100px;
  height: 30px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  white-space: nowrap;
}

#permitsView .avize-row-field {
  display: grid;
  grid-template-rows: var(--azd-avize-label-height) var(--azd-avize-control-height);
  gap: var(--azd-avize-field-gap);
  min-width: 0;
  margin: 0;
  align-items: end;
}

#permitsView .avize-row-field label {
  height: var(--azd-avize-label-height);
  min-height: var(--azd-avize-label-height);
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  line-height: var(--azd-avize-label-height);
}

#permitsView .avize-row-field input,
#permitsView .avize-row-field select {
  width: 100%;
  height: var(--azd-avize-control-height);
  min-height: var(--azd-avize-control-height);
  box-sizing: border-box;
  padding: 0 10px;
  border-radius: 8px;
  line-height: 1.2;
}

#permitsView .permit-next-check {
  min-width: 120px;
}

#permitsView .permit-next-check strong {
  width: 100%;
  height: var(--azd-avize-control-height);
  min-height: var(--azd-avize-control-height);
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#permitsView .permit-next-check .badge {
  display: none;
}

#permitsView .avize-observatii-cell {
  min-width: 260px;
}

#permitsView .avize-delete-button {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: end;
  padding: 0;
}

@media (max-width: 1180px) {
  #permitsView .avize-add-grid,
  #permitsView .permit-form.custom-permit.avize-add-grid,
  #permitsView .avize-filter-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  #permitsView .avize-add-grid,
  #permitsView .permit-form.custom-permit.avize-add-grid,
  #permitsView .avize-filter-grid {
    grid-template-columns: 1fr;
  }
}

/* AVIZE ADD FORM LAYOUT FIX - final */
#permitsView #permitForm.avize-add-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  width: 100%;
  overflow: hidden;
}

#permitsView #permitForm.avize-add-grid > * {
  min-width: 0;
}

#permitsView #permitForm.avize-add-grid .avize-field-stack {
  display: grid;
  grid-template-rows: 18px 44px;
  gap: 6px;
  min-width: 0;
  margin: 0;
}

#permitsView #permitForm.avize-add-grid .avize-field-title {
  height: 18px;
  min-height: 18px;
  color: #566471;
  font-size: 12px;
  font-weight: 750;
  line-height: 18px;
}

#permitsView #permitForm.avize-add-grid input,
#permitsView #permitForm.avize-add-grid select {
  width: 100%;
  height: 44px;
  min-width: 0;
  min-height: 44px;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#permitsView #permitForm.avize-add-grid .selected-project-label {
  display: none;
}

#permitsView #permitForm.avize-add-grid .avize-project-field {
  grid-column: 1 / 6;
}

#permitsView #permitForm.avize-add-grid .avize-type-field {
  grid-column: 6 / 8;
}

#permitsView #permitForm.avize-add-grid .avize-custom-field {
  grid-column: 8 / 11;
}

#permitsView #permitForm.avize-add-grid .avize-custom-field.hidden {
  display: none !important;
}

#permitsView #permitForm.avize-add-grid .avize-cost-field {
  grid-column: 8 / 10;
}

#permitsView #permitForm.avize-add-grid .avize-notes-add-field {
  grid-column: 1 / 11;
}

#permitsView #permitForm.avize-add-grid .avize-add-button {
  grid-column: 11 / 13;
  width: 150px;
  min-width: 150px;
  justify-self: end;
  height: 44px;
  min-height: 44px;
  align-self: end;
  padding: 0 16px;
  border-radius: 12px;
  white-space: nowrap;
}

#permitsView #permitForm.custom-permit.avize-add-grid .avize-project-field {
  grid-column: 1 / 5;
}

#permitsView #permitForm.custom-permit.avize-add-grid .avize-type-field {
  grid-column: 5 / 7;
}

#permitsView #permitForm.custom-permit.avize-add-grid .avize-custom-field {
  grid-column: 7 / 10;
}

#permitsView #permitForm.custom-permit.avize-add-grid .avize-cost-field {
  grid-column: 10 / 13;
}

#permitsView #permitForm.custom-permit.avize-add-grid .avize-notes-add-field {
  grid-column: 1 / 10;
}

#permitsView #permitForm.custom-permit.avize-add-grid .avize-add-button {
  grid-column: 10 / 13;
  width: 150px;
  min-width: 150px;
  justify-self: end;
}

@media (max-width: 1180px) {
  #permitsView #permitForm.avize-add-grid,
  #permitsView #permitForm.custom-permit.avize-add-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #permitsView #permitForm.avize-add-grid .avize-project-field,
  #permitsView #permitForm.avize-add-grid .avize-notes-add-field,
  #permitsView #permitForm.avize-add-grid .avize-add-button,
  #permitsView #permitForm.custom-permit.avize-add-grid .avize-project-field,
  #permitsView #permitForm.custom-permit.avize-add-grid .avize-notes-add-field,
  #permitsView #permitForm.custom-permit.avize-add-grid .avize-add-button {
    grid-column: 1 / -1;
  }

  #permitsView #permitForm.avize-add-grid .avize-type-field,
  #permitsView #permitForm.avize-add-grid .avize-custom-field,
  #permitsView #permitForm.avize-add-grid .avize-cost-field,
  #permitsView #permitForm.custom-permit.avize-add-grid .avize-type-field,
  #permitsView #permitForm.custom-permit.avize-add-grid .avize-custom-field,
  #permitsView #permitForm.custom-permit.avize-add-grid .avize-cost-field {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  #permitsView #permitForm.avize-add-grid,
  #permitsView #permitForm.custom-permit.avize-add-grid {
    grid-template-columns: 1fr;
  }

  #permitsView #permitForm.avize-add-grid > *,
  #permitsView #permitForm.custom-permit.avize-add-grid > * {
    grid-column: 1 / -1 !important;
  }
}

/* AVIZE LIST SPACING FIX - final */
#permitsView .permit-list.avize-list {
  gap: 12px;
  padding: 16px;
}

#permitsView .permit-row.avize-row {
  grid-template-columns:
    minmax(360px, 1.45fr)
    124px
    146px
    146px
    146px
    150px
    146px
    minmax(380px, 1fr)
    36px;
  gap: 16px;
  min-width: 1780px;
  padding: 18px 18px;
  border-radius: 16px;
  align-items: center;
}

#permitsView .permit-row.avize-row .avize-title-cell {
  display: grid;
  gap: 4px;
  padding-right: 8px;
}

#permitsView .permit-row.avize-row .avize-title-cell strong {
  color: #15202b;
  font-size: 13.5px;
  line-height: 1.25;
}

#permitsView .permit-row.avize-row .avize-title-cell .task-meta {
  color: #657482;
  font-size: 12px;
  line-height: 1.25;
}

#permitsView .permit-row.avize-row .avize-status-cell .status-pill {
  min-width: 0;
  height: 36px;
  min-height: 36px;
}

#permitsView .permit-row.avize-row .avize-row-field {
  display: grid;
  grid-template-rows: 18px 42px;
  gap: 8px;
  align-self: stretch;
  align-content: center;
}

#permitsView .permit-row.avize-row .avize-row-field label {
  height: 18px;
  min-height: 18px;
  font-size: 11px;
  line-height: 18px;
  font-weight: 900;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#permitsView .permit-row.avize-row .avize-row-field input,
#permitsView .permit-row.avize-row .avize-row-field select,
#permitsView .permit-row.avize-row .permit-next-check strong {
  height: 42px;
  min-height: 42px;
  border-radius: 13px;
}

#permitsView .permit-row.avize-row .avize-row-field .custom-date,
#permitsView .permit-row.avize-row .avize-row-field .custom-date-button {
  height: 42px;
  min-height: 42px;
}

#permitsView .permit-row.avize-row .avize-row-field .custom-date-button {
  border-radius: 13px;
  font-size: 12px;
  font-weight: 750;
}

#permitsView .permit-row.avize-row .permit-next-check strong {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: #f8fbfc;
  border: 1px solid var(--line);
}

#permitsView .permit-row.avize-row .avize-observatii-cell {
  min-width: 380px;
}

#permitsView .permit-row.avize-row .avize-delete-button {
  width: 32px;
  min-width: 32px;
  height: 36px;
  min-height: 36px;
  align-self: center;
}

/* KPI BALANCE FIX - final: smaller text, stronger icon box, no overlap. */
.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.stat,
.kpi-card {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  align-content: center;
  column-gap: 14px;
  row-gap: 3px;
  min-height: 100px;
  padding: 16px 18px;
  border-radius: 16px;
  overflow: hidden;
}

.stat::before,
.kpi-card::before {
  position: static;
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: center;
  justify-self: center;
  width: 58px;
  height: 58px;
  left: auto;
  top: auto;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #ffffff;
  font-size: 23px;
  font-weight: 850;
  line-height: 1;
  text-align: center;
  transform: none;
  box-shadow: 0 14px 28px rgba(0, 107, 95, 0.16);
}

.stat.attention::before {
  box-shadow: 0 14px 28px rgba(217, 119, 6, 0.18);
}

.stat span,
.kpi-card span {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #6b7280;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.045em;
  line-height: 1.18;
  text-transform: uppercase;
}

.stat strong,
.kpi-card strong {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  min-width: 0;
  margin: 0;
  color: #111827;
  font-size: clamp(20px, 1.35vw, 25px);
  font-weight: 750;
  letter-spacing: 0;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.stat.attention strong {
  color: #a86108;
}

.performance-stats {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.performance-stats .stat {
  min-height: 92px;
  grid-template-columns: 56px minmax(0, 1fr);
  padding: 14px 16px;
}

.performance-stats .stat::before {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  font-size: 20px;
}

.performance-stats .stat span {
  font-size: 10px;
}

.performance-stats .stat strong {
  font-size: clamp(18px, 1.2vw, 22px);
}

@media (max-width: 760px) {
  .stat,
  .kpi-card,
  .performance-stats .stat {
    grid-template-columns: 56px minmax(0, 1fr);
    min-height: 88px;
    padding: 13px 14px;
  }

  .stat::before,
  .kpi-card::before,
  .performance-stats .stat::before {
    width: 50px;
    height: 50px;
  }
}

/* Calendar toolbar alignment fix: keep month title centered between arrows. */
.calendar-toolbar {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 54px;
  align-items: center;
  gap: 12px;
}

.calendar-toolbar h2 {
  grid-column: 2;
  justify-self: center;
  min-width: 0;
  margin: 0;
  text-align: center;
}

.calendar-toolbar #dashboardCalendarPrevBtn {
  grid-column: 1;
  justify-self: start;
}

.calendar-toolbar #dashboardCalendarNextBtn {
  grid-column: 3;
  justify-self: end;
}

.calendar-toolbar .calendar-legend {
  grid-column: 1 / -1;
  justify-content: center;
  margin-left: 0;
}

/* SIDEBAR USER CARD FIX - final */
.current-user {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 8px 12px;
  padding: 14px 16px;
  border-radius: 18px;
}

.current-user::before {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: center;
  width: 44px;
  height: 44px;
  font-size: 14px;
}

.current-user strong {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: 13.5px;
  font-weight: 850;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.current-user span {
  grid-column: 2 / 4;
  grid-row: 2;
  min-width: 0;
  color: rgba(248, 251, 248, 0.72);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.25;
}

.current-user-role-line,
.current-user-function-line {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.current-user-role-line {
  color: rgba(248, 251, 248, 0.82);
  font-weight: 650;
}

.current-user-function-line {
  margin-top: 2px;
  color: rgba(248, 251, 248, 0.66);
  font-weight: 500;
}

.current-user button {
  grid-column: 3;
  grid-row: 1;
  align-self: center;
  min-width: 68px;
  height: 32px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
}

/* SIDEBAR ALIGNMENT POLISH - final */
.sidebar {
  padding: 22px 16px 18px;
  gap: 18px;
}

.brand {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 0 4px;
}

.brand-mark {
  width: 48px;
  height: 48px;
}

.brand h1,
.brand p {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.current-user {
  grid-template-columns: 52px minmax(0, 1fr) 82px;
  gap: 6px 12px;
  padding: 14px;
  border-radius: 20px;
}

.current-user::before {
  width: 46px;
  height: 46px;
}

.current-user strong {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  font-size: 14px;
}

.current-user span {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
}

.current-user button {
  grid-column: 3;
  grid-row: 1 / span 2;
  justify-self: end;
  width: 82px;
  min-width: 82px;
}

.nav-list {
  gap: 16px;
}

.nav-group {
  gap: 5px;
}

.nav-group + .nav-group {
  margin-top: 0;
}

.nav-group summary {
  min-height: 24px;
  padding: 0 8px;
  letter-spacing: 0.06em;
}

.nav-item {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  justify-self: stretch;
  padding: 6px 10px;
  border-radius: 14px;
  line-height: 1.1;
}

.nav-item::before {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
  color: rgba(255, 255, 255, 0.70);
  font-size: 11px;
}

.nav-item[data-module="dashboard"]::before { content: "DB"; font-size: 10px; font-weight: 900; }
.nav-item[data-module="today"]::before { content: "AZ"; font-size: 10px; font-weight: 900; }
.nav-item[data-module="projects"]::before { content: "PR"; font-size: 10px; font-weight: 900; }
.nav-item[data-module="workOrder"]::before { content: "OL"; font-size: 10px; font-weight: 900; }
.nav-item[data-module="dtac"]::before { content: "DT"; font-size: 10px; font-weight: 900; }
.nav-item[data-module="tasks"]::before { content: "TD"; font-size: 10px; font-weight: 900; }
.nav-item[data-module="permits"]::before { content: "AV"; font-size: 10px; font-weight: 900; }
.nav-item[data-module="payments"]::before { content: "PL"; font-size: 10px; font-weight: 900; }
.nav-item[data-module="vacations"]::before { content: "CO"; font-size: 10px; font-weight: 900; }
.nav-item[data-module="reports"]::before { content: "RP"; font-size: 10px; font-weight: 900; }
.nav-item[data-module="performance"]::before { content: "PF"; font-size: 10px; font-weight: 900; }
.nav-item[data-module="users"]::before { content: "UT"; font-size: 10px; font-weight: 900; }
.nav-item[data-module="health"]::before { content: "HL"; font-size: 10px; font-weight: 900; }
.nav-item[data-module="myProjects"]::before { content: "PM"; font-size: 10px; font-weight: 900; }
.nav-item[data-module="myTimesheet"]::before { content: "PO"; font-size: 10px; font-weight: 900; }
.nav-item[data-module="myPerformance"]::before { content: "PE"; font-size: 10px; font-weight: 900; }
.nav-item[data-module="notifications"]::before { content: "NT"; font-size: 10px; font-weight: 900; }

.notification-nav-item {
  position: relative;
  grid-template-columns: 34px minmax(0, 1fr) auto;
}

.notification-unread-badge {
  min-width: 22px;
  height: 22px;
  margin-left: auto;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #d92f4c;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.notification-nav-item.has-unread-notifications {
  color: #fff;
  background: rgba(217, 47, 76, 0.18);
  box-shadow: inset 3px 0 0 #ff6079;
}

.notification-nav-item.has-unread-notifications .notification-unread-badge {
  animation: notification-pulse 1.4s ease-in-out infinite;
}

@keyframes notification-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(217, 47, 76, 0.5); }
  50% { transform: scale(1.1); box-shadow: 0 0 0 7px rgba(217, 47, 76, 0); }
}

.nav-item.active {
  box-shadow: 0 12px 24px rgba(214, 162, 30, 0.24);
}

.nav-item:not(.active):hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav-item.hidden,
.nav-group.hidden {
  display: none !important;
}

.sync-panel {
  gap: 6px;
  padding: 14px;
  border-radius: 18px;
}

.sync-panel span,
.sync-panel small {
  line-height: 1.25;
}

/* SIDEBAR USER FUNCTION VISIBILITY - final */
.current-user {
  grid-template-columns: 52px minmax(0, 1fr) 74px;
  grid-template-rows: auto auto;
  align-items: start;
  gap: 6px 10px;
  padding: 14px;
}

.current-user::before {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: center;
}

.current-user strong {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  min-width: 0;
  padding-top: 1px;
  font-size: 14px;
  line-height: 1.15;
}

.current-user span {
  grid-column: 2 / 4;
  grid-row: 2;
  min-width: 0;
  padding-right: 2px;
}

.current-user-role-line {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.25;
}

.current-user-function-line {
  display: -webkit-box;
  margin-top: 3px;
  overflow: hidden;
  color: rgba(248, 251, 248, 0.72);
  line-height: 1.22;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.current-user button {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  align-self: start;
  width: 74px;
  min-width: 74px;
  height: 34px;
  min-height: 34px;
  padding: 0 10px;
}

/* LARGE TASK CREATE BAR FIX - final */
#largeTaskCreateBar.task-create-bar {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) minmax(170px, 0.8fr) minmax(170px, 0.85fr) 110px minmax(170px, 0.8fr) minmax(220px, 1fr) 142px;
  gap: 10px;
  align-items: center;
  width: 100%;
  overflow: hidden;
}

#largeTaskCreateBar > * {
  min-width: 0;
}

#largeTaskCreateBar select,
#largeTaskCreateBar input {
  width: 100%;
  min-width: 0;
}

#largeTaskCreateBar #largeTaskCustom.hidden {
  display: none;
}

#largeTaskCreateBar #addLargeTaskBtn {
  width: 100%;
  min-width: 0;
  padding: 0 14px;
  white-space: nowrap;
}

#largeTaskCreateBar #largeTaskCreateState {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1500px) {
  #largeTaskCreateBar.task-create-bar {
    grid-template-columns: minmax(260px, 1.35fr) minmax(170px, 0.85fr) minmax(170px, 0.85fr) 100px minmax(170px, 0.85fr) 142px;
  }

  #largeTaskCreateBar #largeTaskCreateState {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1180px) {
  #largeTaskCreateBar.task-create-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #largeTaskCreateBar #addLargeTaskBtn,
  #largeTaskCreateBar #largeTaskCreateState {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  #largeTaskCreateBar.task-create-bar {
    grid-template-columns: 1fr;
  }
}

/* SERVICE TASK FORM FIX - final: two-row layout that stays inside the page. */
#serviceForm.service-form {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px 12px;
  align-items: center;
  width: 100%;
  overflow: hidden;
}

#serviceForm.service-form > * {
  min-width: 0;
}

#serviceForm.service-form select,
#serviceForm.service-form input,
#serviceForm.service-form button {
  width: 100%;
  min-width: 0;
}

#serviceForm.service-form > :nth-child(1) {
  grid-column: 1 / 5;
}

#serviceForm.service-form > :nth-child(2) {
  grid-column: 5 / 7;
}

#serviceForm.service-form > :nth-child(3) {
  grid-column: 7 / 10;
}

#serviceForm.service-form > :nth-child(4) {
  grid-column: 10 / 13;
}

#serviceForm.service-form > :nth-child(5) {
  grid-column: 1 / 3;
}

#serviceForm.service-form > :nth-child(6) {
  grid-column: 3 / 4;
}

#serviceForm.service-form > :nth-child(7) {
  grid-column: 4 / 6;
}

#serviceForm.service-form > :nth-child(8) {
  grid-column: 6 / 10;
}

#serviceForm.service-form > :nth-child(9) {
  grid-column: 10 / 13;
  justify-self: stretch;
  padding: 0 16px;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  #serviceForm.service-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #serviceForm.service-form > * {
    grid-column: auto;
  }

  #serviceForm.service-form > :nth-child(1),
  #serviceForm.service-form > :nth-child(3),
  #serviceForm.service-form > :nth-child(8),
  #serviceForm.service-form > :nth-child(9) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  #serviceForm.service-form {
    grid-template-columns: 1fr;
  }

  #serviceForm.service-form > * {
    grid-column: 1 / -1;
  }
}

/* TASK CREATE BUTTON ALIGNMENT FIX - final */
#largeTaskCreateBar.task-create-bar {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

#largeTaskCreateBar #largeTaskType {
  grid-column: 2 / 4;
}

#largeTaskCreateBar #largeTaskCustom {
  grid-column: 4 / 7;
}

#largeTaskCreateBar #largeTaskPerson {
  grid-column: 4 / 6;
}

#largeTaskCreateBar #largeTaskCustom:not(.hidden) + #largeTaskPerson {
  grid-column: 7 / 9;
}

#largeTaskCreateBar #largeTaskDuration {
  grid-column: 6 / 8;
}

#largeTaskCreateBar #largeTaskCustom:not(.hidden) + #largeTaskPerson + #largeTaskDuration {
  grid-column: 9 / 10;
}

#largeTaskCreateBar #largeTaskCreateState {
  grid-column: 8 / 11;
}

#largeTaskCreateBar #largeTaskCustom:not(.hidden) + #largeTaskPerson + #largeTaskDuration + #addLargeTaskBtn + #largeTaskCreateState {
  grid-column: 10 / 11;
}

#largeTaskCreateBar #addLargeTaskBtn {
  grid-column: 11 / 13;
  justify-self: stretch;
  width: 100%;
  min-height: 40px;
}

#serviceForm.service-form > :nth-child(8) {
  grid-column: 6 / 11;
}

#serviceForm.service-form > :nth-child(9) {
  grid-column: 11 / 13;
  width: 150px;
  min-width: 150px;
  justify-self: end;
}

@media (max-width: 1180px) {
  #largeTaskCreateBar.task-create-bar,
  #serviceForm.service-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #largeTaskCreateBar > *,
  #largeTaskCreateBar #largeTaskType,
  #largeTaskCreateBar #largeTaskCustom,
  #largeTaskCreateBar #largeTaskPerson,
  #largeTaskCreateBar #largeTaskDuration,
  #largeTaskCreateBar #largeTaskCreateState,
  #largeTaskCreateBar #addLargeTaskBtn,
  #serviceForm.service-form > :nth-child(8),
  #serviceForm.service-form > :nth-child(9) {
    grid-column: 1 / -1;
  }

  #serviceForm.service-form > :nth-child(9) {
    width: 100%;
    min-width: 0;
  }
}

/* TASK DATE PICKERS - final */
#largeTaskCreateBar .custom-date {
  min-width: 150px;
}

#largeTaskCreateBar.task-create-bar {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

#largeTaskCreateBar #largeTaskType {
  grid-column: 1 / 3;
}

#largeTaskCreateBar #largeTaskCustom {
  grid-column: 3 / 5;
}

#largeTaskCreateBar #largeTaskPerson {
  grid-column: 3 / 5;
}

#largeTaskCreateBar #largeTaskCustom:not(.hidden) + #largeTaskPerson {
  grid-column: 5 / 7;
}

#largeTaskCreateBar #largeTaskPerson + .custom-date {
  grid-column: 5 / 7;
}

#largeTaskCreateBar #largeTaskCustom:not(.hidden) + #largeTaskPerson + .custom-date {
  grid-column: 7 / 9;
}

#largeTaskCreateBar #largeTaskDuration {
  grid-column: 7 / 8;
}

#largeTaskCreateBar #largeTaskCustom:not(.hidden) + #largeTaskPerson + .custom-date + #largeTaskDuration {
  grid-column: 9 / 10;
}

#largeTaskCreateBar #addLargeTaskBtn {
  grid-column: 10 / 13;
}

#largeTaskCreateBar #largeTaskCreateState {
  grid-column: 1 / -1;
}

@media (max-width: 1180px) {
  #largeTaskCreateBar #largeTaskType,
  #largeTaskCreateBar #largeTaskCustom,
  #largeTaskCreateBar #largeTaskPerson,
  #largeTaskCreateBar .custom-date,
  #largeTaskCreateBar #largeTaskDuration,
  #largeTaskCreateBar #largeTaskCreateState,
  #largeTaskCreateBar #addLargeTaskBtn {
    grid-column: 1 / -1;
  }
}

/* WORK ORDER ACTIONS FIX - final */
.work-order-row {
  grid-template-columns: 34px 40px minmax(0, 1fr) 104px 96px;
  padding-right: 18px;
}

.work-order-row .badge {
  justify-self: end;
  max-width: 104px;
}

.work-order-row .order-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: 96px;
  min-width: 96px;
  justify-self: start;
}

.work-order-row .order-actions .order-move-button {
  width: 42px;
  min-width: 42px;
  height: 32px;
  min-height: 32px;
  padding: 0 6px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.work-order-row .order-actions [data-move="down"] {
  width: 48px;
  min-width: 48px;
}

/* PROJECT TOOLBAR WIDTH FIX - final */
#projectToolbar.toolbar {
  display: grid;
  grid-template-columns: minmax(420px, 1.25fr) 140px 200px 118px;
  gap: 12px;
  align-items: center;
  width: 100%;
}

#projectToolbar .search-wrap {
  min-width: 0;
}

#projectToolbar .search-wrap input {
  min-width: 0;
}

#projectToolbar #yearFilter,
#projectToolbar #statusFilter,
#projectToolbar #refreshBtn {
  width: 100%;
  min-width: 0;
}

#projectToolbar #refreshBtn {
  justify-self: stretch;
  padding: 0 14px;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

#projectToolbar #refreshBtn.is-loading {
  border-color: #b7d6cf;
  background: #eef8f6;
  color: var(--accent-strong);
}

@media (max-width: 1180px) {
  #projectToolbar.toolbar {
    grid-template-columns: minmax(0, 1fr) 132px 184px 112px;
  }
}

@media (max-width: 760px) {
  #projectToolbar.toolbar {
    grid-template-columns: 1fr;
  }
}

/* PROJECT LIST ALIGNMENT FIX - final */
.project-list {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  justify-content: stretch;
  gap: 0;
  padding: 8px 12px;
  overflow-x: hidden;
}

.project-list.is-searching {
  align-content: start;
}

.project-row {
  width: 100%;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 126px 22px;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  margin: 0;
  padding: 10px 4px;
  border: 0;
  border-bottom: 1px solid #dbe5e9;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
  transform: none;
}

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

.project-row:hover,
.project-row.active {
  border-radius: 10px;
  background: #e8f7f5;
  box-shadow: inset 4px 0 0 rgba(0, 107, 95, 0.55);
  transform: none;
}

.project-code {
  min-width: 0;
  color: #07575a;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.15;
  white-space: nowrap;
}

.project-main {
  min-width: 0;
  display: grid;
  gap: 3px;
  align-content: center;
}

.project-main strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #111827;
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-main span {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #64727a;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-row .badge {
  width: 112px;
  max-width: 112px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  overflow: hidden;
  padding: 0 10px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-chevron {
  width: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  color: #64748b;
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}

/* REPORT ACTIONS ALIGNMENT FIX - final */
#reportsView .module-head {
  display: grid;
  grid-template-columns: max-content max-content max-content minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  justify-content: start;
}

#reportsView #reportsMonth {
  grid-column: 1 / -1;
  width: 100%;
}

#reportsView #reportGenerateBtn,
#reportsView #reportExcelBtn,
#reportsView #reportPdfBtn {
  width: auto;
  min-width: 122px;
  justify-self: start;
}

#reportsView #reportsState {
  justify-self: end;
  text-align: right;
}

@media (max-width: 760px) {
  #reportsView .module-head {
    grid-template-columns: 1fr;
  }

  #reportsView #reportGenerateBtn,
  #reportsView #reportExcelBtn,
  #reportsView #reportPdfBtn,
  #reportsView #reportsState {
    width: 100%;
    justify-self: stretch;
    text-align: left;
  }
}

/* PERFORMANCE SYMMETRY LAYOUT FIX - final */
#performanceView .performance-layout {
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.62fr);
  gap: 18px;
  align-items: start;
  overflow-x: hidden;
}

#performanceView .performance-main-panel,
#performanceView .performance-detail-panel {
  height: clamp(940px, calc(100vh - 250px), 1020px);
  max-height: 1020px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

#performanceView .performance-main-panel .performance-table {
  max-height: none;
  min-height: 0;
  overflow: hidden;
  align-content: start;
}

#performanceView .performance-detail-panel .performance-detail {
  max-height: none;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  align-content: start;
}

#performanceView .performance-table,
#performanceView .performance-detail,
#performanceView .performance-events {
  gap: 8px;
  padding: 14px;
}

#performanceView .performance-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  min-height: 132px;
  padding: 12px 16px;
  align-items: stretch;
}

#performanceView .performance-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 14px;
  align-items: start;
}

#performanceView .performance-person {
  min-width: 0;
  display: grid;
  gap: 3px;
  align-content: start;
}

#performanceView .performance-card-result {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  white-space: nowrap;
}

#performanceView .performance-card-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(82px, 1fr));
  gap: 8px;
  align-items: stretch;
}

#performanceView .performance-card-metrics span {
  min-width: 0;
  min-height: 42px;
  display: grid;
  gap: 4px;
  align-content: center;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: normal;
  white-space: nowrap;
}

#performanceView .performance-card-metrics small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

#performanceView .performance-person strong,
#performanceView .performance-person span {
  overflow: hidden;
  overflow-wrap: normal;
  text-overflow: ellipsis;
}

#performanceView .performance-person span {
  line-height: 1.25;
}

#performanceView .performance-progress {
  grid-column: auto;
  width: 100%;
  height: 9px;
  align-self: end;
}

#performanceView .performance-index {
  min-width: 42px;
  justify-self: center;
  justify-content: center;
}

#performanceView .performance-rank {
  justify-self: end;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

#performanceView .performance-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
}

#performanceView .performance-summary span {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
}

#performanceView .task-group-title {
  margin: 10px 16px 0;
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbfc;
}

#performanceView .performance-detail-panel .performance-events {
  min-width: 0;
  overflow: visible;
}

#performanceView .performance-detail-panel .performance-event {
  grid-template-columns: minmax(0, 1fr) minmax(88px, max-content);
  align-items: start;
  overflow: hidden;
}

#performanceView .performance-detail-panel .performance-event > div,
#performanceView .performance-detail-panel .performance-event > span,
#performanceView .performance-detail-panel .performance-event > strong {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

#performanceView .performance-detail-panel .performance-event > div {
  grid-column: 1 / -1;
}

#performanceView .performance-detail-panel .performance-event .order-actions {
  justify-self: end;
  white-space: nowrap;
}

#performanceView .performance-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

#performanceView .performance-action-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
}

#performanceView .performance-action-panel .panel-head {
  min-height: 58px;
  padding-right: 190px;
}

#performanceView .performance-form {
  height: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 10px 12px;
}

#performanceView .performance-form .primary-button {
  position: absolute;
  top: 13px;
  right: 16px;
  width: 170px;
  min-height: 38px;
}

@media (max-width: 1280px) {
  #performanceView .performance-layout,
  #performanceView .performance-actions {
    grid-template-columns: 1fr;
  }

  #performanceView .performance-main-panel,
  #performanceView .performance-detail-panel {
    height: auto;
    max-height: none;
    min-height: 0;
  }

  #performanceView .performance-row {
    grid-template-columns: 1fr;
  }

  #performanceView .performance-card-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #performanceView .performance-main-panel .performance-table {
    overflow: visible;
  }
}

@media (max-width: 760px) {
  #performanceView .performance-summary,
  #performanceView .performance-form {
    grid-template-columns: 1fr;
  }

  #performanceView .performance-card-head,
  #performanceView .performance-card-metrics {
    grid-template-columns: 1fr;
  }

  #performanceView .performance-progress,
  #performanceView .performance-index,
  #performanceView .performance-rank,
  #performanceView .performance-form .primary-button {
    width: 100%;
    justify-self: stretch;
  }

  #performanceView .performance-action-panel .panel-head {
    padding-right: 0;
  }

  #performanceView .performance-form .primary-button {
    position: static;
  }
}

/* ANALIZA PANEL HEIGHT SYMMETRY FIX - final */
#analizaView .performance-layout {
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.62fr);
  gap: 18px;
  align-items: stretch;
}

#analizaView .performance-main-panel,
#analizaView .performance-detail-panel {
  min-height: 560px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

#analizaView .performance-detail {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  align-content: stretch;
}

#analizaView .module-head {
  display: flex;
  align-items: end;
  justify-content: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

#analizaView .analiza-interval-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(132px, 1fr));
  gap: 10px;
  width: 320px;
  margin-left: 10px;
}

#analizaView .module-head > div:first-child {
  flex: 0 1 520px;
}

#analizaView #analizaLogoutBtn {
  margin-left: 8px;
}

#analizaView #analizaPrintBtn {
  margin-left: 0;
}

#analizaView .analiza-interval-controls label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

#analizaView .analiza-interval-controls input[type="month"] {
  height: 46px;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
}

#analizaView .analiza-interval-controls .custom-date-button {
  height: 50px;
  border-radius: 16px;
  border-color: #cddfe4;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfc 100%);
  font-weight: 850;
}

#analizaView .analiza-interval-controls .custom-date-menu {
  width: 286px;
}

#analizaView .analiza-interval-controls .custom-month-grid {
  gap: 7px;
}

#analizaView .analiza-interval-controls .custom-month-option {
  min-height: 38px;
  border: 1px solid transparent;
}

#healthView #healthContent {
  gap: 10px;
  padding: 16px;
}

#healthView .health-row {
  grid-template-columns: minmax(130px, 0.55fr) minmax(0, 1fr) minmax(118px, 0.32fr);
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border-left: 5px solid #dfe8eb;
  border-radius: 16px;
  background: #fff;
}

#healthView .health-label {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  overflow-wrap: anywhere;
}

#healthView .health-detail {
  min-width: 0;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#healthView .health-status {
  width: 100%;
  min-width: 0;
  justify-content: center;
  justify-self: end;
}

#healthView .health-row:has(.badge.warn) {
  border-left-color: #f2c94c;
  background: #fffdf6;
}

#healthView .health-row:has(.badge.done) {
  border-left-color: #8ee6b1;
}

#analizaView #analizaEmployees .performance-row {
  grid-template-columns: minmax(210px, 1fr) repeat(3, minmax(150px, 0.72fr)) 58px;
  align-items: center;
}

#analizaView .analiza-employee-main {
  min-width: 0;
  display: grid;
  gap: 4px;
  align-content: center;
}

#analizaView .analiza-employee-rank {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

#analizaView .analiza-employee-main strong {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#analizaView #financialDetail .performance-events {
  min-height: 0;
  align-content: stretch;
}

#analizaView #financialDetail .empty-state {
  height: 100%;
  min-height: 180px;
}

#analizaView #analizaAlerts {
  display: grid;
  gap: 8px;
  padding: 16px;
  overflow-x: hidden;
}

#analizaView .analiza-alert-grid {
  display: grid;
  grid-template-columns: minmax(150px, 0.85fr) minmax(190px, 0.9fr) minmax(150px, 0.75fr) minmax(170px, 0.8fr) minmax(150px, 0.55fr);
  column-gap: 18px;
  align-items: center;
}

#analizaView .analiza-alert-head {
  min-height: 34px;
  padding: 0 18px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

#analizaView .analiza-alert-head span:nth-child(3),
#analizaView .analiza-alert-head span:nth-child(4),
#analizaView .analiza-alert-head span:nth-child(5) {
  color: var(--ink);
}

#analizaView .analiza-alert-row {
  min-height: 58px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-left: 5px solid #dfe7eb;
  border-radius: 14px;
  background: #fff;
}

#analizaView .analiza-alert-row > * {
  min-width: 0;
}

#analizaView .analiza-alert-row strong,
#analizaView .analiza-alert-row span:not(.badge) {
  overflow-wrap: anywhere;
}

#analizaView .analiza-interval {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 5px 10px;
  border: 1px solid #d7e7e9;
  border-radius: 999px;
  background: #f7fbfc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

#analizaView .analiza-alert-row .badge {
  width: 100%;
  min-width: 0;
  justify-content: center;
}

@media (max-width: 1280px) {
  #analizaView .performance-layout {
    grid-template-columns: 1fr;
  }

  #analizaView .module-head {
    align-items: stretch;
  }

  #analizaView .analiza-interval-controls {
    width: 100%;
    margin-left: 0;
  }

  #analizaView .performance-main-panel,
  #analizaView .performance-detail-panel {
    min-height: 0;
  }

  #analizaView #analizaEmployees .performance-row {
    grid-template-columns: 1fr;
  }

  #analizaView .analiza-alert-head {
    display: none;
  }

  #analizaView .analiza-alert-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  #analizaView .analiza-alert-row .badge {
    width: fit-content;
    justify-content: flex-start;
  }

  #healthView .health-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  #healthView .health-status {
    width: fit-content;
    min-width: 132px;
    justify-self: start;
  }
}

/* FORM CONTROLS NATURAL POLISH - final */
select,
input,
textarea,
.custom-select-button {
  min-width: 0;
  border-color: #d7e4e8;
  border-radius: 14px;
  background-color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 1px 2px rgba(18, 32, 38, 0.03);
}

input[type="date"],
input[type="month"],
input[type="number"],
input[type="text"],
input[type="search"],
input[type="password"] {
  appearance: none;
}

input[type="date"],
input[type="month"] {
  color-scheme: light;
  padding-right: 12px;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator {
  width: 18px;
  height: 18px;
  padding: 6px;
  margin-right: -4px;
  border-radius: 10px;
  cursor: pointer;
  opacity: 0.72;
  transition: background 0.15s ease, opacity 0.15s ease;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="month"]::-webkit-calendar-picker-indicator:hover {
  background: #e6f5f2;
  opacity: 1;
}

.custom-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.native-select-hidden {
  display: none !important;
}

.native-control-hidden {
  display: none !important;
}

.custom-select-button {
  width: 100%;
  height: 46px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid #cddfe4;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.custom-select-button::after {
  content: "";
  width: 8px;
  height: 8px;
  justify-self: center;
  border-right: 2px solid #687b86;
  border-bottom: 2px solid #687b86;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.15s ease;
}

.custom-select-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select.open .custom-select-button,
.custom-select-button:focus-visible {
  outline: 0;
  border-color: #0b8b7f;
  box-shadow: 0 0 0 3px rgba(0, 107, 95, 0.13), 0 8px 18px rgba(18, 32, 38, 0.08);
}

.custom-select.open .custom-select-button::after {
  transform: translateY(2px) rotate(225deg);
}

.custom-select.disabled .custom-select-button {
  cursor: not-allowed;
  background: #f4f7f8;
  color: var(--muted);
}

.custom-select-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 272px;
  display: none;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid #c9dde2;
  border-radius: 18px;
  background: #fbfefd;
  box-shadow: 0 18px 42px rgba(20, 38, 48, 0.18);
}

.custom-select.open .custom-select-menu,
.custom-select-menu.is-open {
  display: grid;
  gap: 2px;
}

.table-panel:has(.custom-select.open),
.details-panel:has(.custom-select.open),
.list-panel:has(.custom-select.open),
.azd-card:has(.custom-select.open) {
  overflow: visible;
}

.custom-select-option {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 9px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.custom-select-option:hover,
.custom-select-option:focus-visible {
  outline: 0;
  background: #e7f5f2;
}

.custom-select-option[aria-selected="true"] {
  background: linear-gradient(180deg, #0c8176 0%, #086b62 100%);
  color: #fff;
  font-weight: 800;
}

.custom-select-option:disabled {
  cursor: not-allowed;
  color: #97a7af;
}

.custom-date {
  position: relative;
  width: 100%;
  min-width: 0;
}

.custom-date-button {
  width: 100%;
  height: 46px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid #cddfe4;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 1px 2px rgba(18, 32, 38, 0.03);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.custom-date-button::after {
  content: "";
  width: 16px;
  height: 16px;
  justify-self: center;
  border: 2px solid #607680;
  border-top-width: 4px;
  border-radius: 4px;
  box-sizing: border-box;
}

.custom-date-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-date:not(.has-value) .custom-date-label {
  color: var(--muted);
}

.custom-date.open .custom-date-button,
.custom-date-button:focus-visible {
  outline: 0;
  border-color: #0b8b7f;
  box-shadow: 0 0 0 3px rgba(0, 107, 95, 0.13), 0 8px 18px rgba(18, 32, 38, 0.08);
}

.custom-date.disabled .custom-date-button {
  cursor: not-allowed;
  background: #f4f7f8;
  color: var(--muted);
}

.custom-date-menu {
  position: absolute;
  z-index: 90;
  top: calc(100% + 8px);
  left: 0;
  width: min(320px, calc(100vw - 32px));
  display: none;
  gap: 10px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid #c9dde2;
  border-radius: 20px;
  background: #fbfefd;
  box-shadow: 0 18px 42px rgba(20, 38, 48, 0.18);
}

.custom-date.open .custom-date-menu,
.custom-date-menu.is-open {
  display: grid;
}

.floating-control-layer {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
}

.floating-control-layer .custom-select-menu,
.floating-control-layer .custom-date-menu {
  pointer-events: auto;
  z-index: 10001;
}

.custom-date-head,
.custom-date-foot {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 8px;
}

.custom-date-head strong {
  min-width: 0;
  text-align: center;
  font-size: 13px;
}

.custom-date-head button,
.custom-date-foot button,
.custom-day,
.custom-month-option {
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.custom-date-head button {
  width: 36px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #0b756b;
  font-size: 22px;
  font-weight: 800;
}

.custom-weekdays,
.custom-day-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.custom-weekdays span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.custom-day,
.custom-month-option {
  min-height: 34px;
  padding: 0 8px;
}

.custom-day {
  display: grid;
  place-items: center;
  align-content: center;
  line-height: 1;
}

.custom-day.today {
  min-height: 42px;
  border: 1px solid #d7b45b;
  background: #fff8df;
  color: #75530a;
  font-weight: 850;
}

.custom-day.today small {
  margin-top: 3px;
  font-size: 8px;
  font-weight: 850;
  text-transform: uppercase;
}

.custom-day.today.active {
  border-color: #086b62;
  background: linear-gradient(180deg, #0c8176 0%, #086b62 100%);
  color: #fff;
}

.custom-month-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.custom-date-foot {
  grid-template-columns: 1fr 1fr;
}

.custom-date-foot button {
  min-height: 34px;
  color: #0b756b;
  font-weight: 800;
}

.custom-day:hover,
.custom-day:focus-visible,
.custom-month-option:hover,
.custom-month-option:focus-visible,
.custom-date-head button:hover,
.custom-date-foot button:hover {
  outline: 0;
  background: #e7f5f2;
}

.custom-day.muted {
  color: #9badb4;
}

.custom-day.active,
.custom-month-option.active {
  background: linear-gradient(180deg, #0c8176 0%, #086b62 100%);
  color: #fff;
  font-weight: 800;
}

.table-panel:has(.custom-date.open),
.details-panel:has(.custom-date.open),
.list-panel:has(.custom-date.open),
.azd-card:has(.custom-date.open) {
  overflow: visible;
}

.toolbar > .custom-select,
.toolbar > .custom-date,
.module-head > .custom-select,
.module-head > .custom-date,
.inline-form > .custom-select,
.inline-form > .custom-date,
.performance-form > .custom-select,
.performance-form > .custom-date,
.permit-filter-bar > .custom-select,
.permit-filter-bar > .custom-date,
.permit-form > .custom-select,
.permit-form > .custom-date,
.form-row > .custom-select,
.form-row > .custom-date,
.form-grid > .custom-select,
.form-grid > .custom-date,
.compact-form > .custom-select,
.compact-form > .custom-date {
  width: 100%;
}

option {
  color: var(--ink);
  background: #fff;
}

.employee-project-list,
.employee-simple-list {
  display: grid;
  gap: 12px;
}

.project-completion-gate {
  padding: 14px 20px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: #f7faf9;
}

.project-completion-gate label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.project-completion-gate input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.project-completion-gate span {
  display: grid;
  gap: 3px;
}

.project-completion-gate small {
  color: var(--muted);
}

.project-operational-panel {
  display: grid;
}

.project-operational-panel.is-locked {
  position: relative;
  min-height: 520px;
  background: #e9edef;
  opacity: 0.72;
  filter: grayscale(0.75);
  pointer-events: none;
}

.project-operational-panel.is-locked::after {
  content: "Proiect blocat - activeaza completarea dupa primirea actelor";
  position: sticky;
  top: 24px;
  z-index: 3;
  align-self: start;
  justify-self: center;
  margin-top: 28px;
  padding: 11px 16px;
  border: 1px solid #c7d0d5;
  border-radius: 8px;
  background: #f7f9fa;
  color: #56666f;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(35, 51, 59, 0.08);
}

.project-operational-panel.is-locked > * {
  display: none;
}

.project-operational-panel.is-locked::after {
  display: block;
}

.project-form.is-project-locked .project-completion-gate {
  background: #e9edef;
}

.project-documents-panel {
  margin: 0;
  padding: 16px 18px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.project-documents-panel legend {
  padding: 0 8px;
  color: var(--ink);
  font-weight: 850;
}

.project-documents-panel > p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
}

.project-documents-panel.is-locked {
  border-color: #d5dde1;
  background: #eef1f3;
}

.project-documents-panel.is-locked .form-grid {
  opacity: 0.58;
}

.project-documents-panel.is-locked input {
  cursor: not-allowed;
  background: #e4e8eb;
}

.project-row.documents-locked:not(.active) {
  background: #f0f3f4;
  filter: grayscale(0.35);
}

.my-projects-toolbar {
  display: flex;
  align-items: center;
}

.task-view-tabs.my-projects-view-tabs {
  width: min(720px, 100%);
  grid-template-columns: repeat(4, minmax(110px, 1fr));
}

.employee-project-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.employee-project-head,
.employee-project-meta,
.employee-task-row,
.notification-row {
  display: grid;
  gap: 10px;
  align-items: center;
}

.employee-project-head {
  grid-template-columns: minmax(0, 1fr) auto;
}

.employee-project-head span,
.employee-project-meta span,
.employee-task-row .task-meta {
  color: var(--muted);
}

.employee-project-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  font-size: 13px;
}

.employee-task-list {
  display: grid;
  gap: 8px;
}

.employee-task-row {
  grid-template-columns: minmax(180px, 1fr) auto minmax(130px, 160px) minmax(90px, 120px) minmax(160px, 1fr) auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.employee-task-row input,
.employee-task-row select {
  min-width: 0;
}

.notification-row {
  grid-template-columns: minmax(160px, 0.6fr) minmax(0, 1fr);
}

.notification-row {
  position: relative;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid #a9b5bb;
  border-radius: 8px;
  background: #f7f9fa;
}

.notification-row.is-unread {
  border-color: #f0b3be;
  border-left-color: #d92f4c;
  background: #fff4f6;
  box-shadow: 0 8px 20px rgba(163, 36, 60, 0.1);
}

.notification-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notification-new-label,
.notification-read-label {
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.notification-new-label {
  background: #d92f4c;
  color: #fff;
}

.notification-read-label {
  background: #e5eaed;
  color: #65737c;
}

.notification-row small {
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .notification-nav-item.has-unread-notifications .notification-unread-badge {
    animation: none;
  }
}

@media (max-width: 860px) {
  .task-view-tabs.my-projects-view-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .employee-project-head,
  .employee-project-meta,
  .employee-task-row,
  .notification-row {
    grid-template-columns: 1fr;
  }
}

/* TASK BOARD MODERNIZATION - final */
:is(#tasksView, #managementTasksView) {
  --task-not-started: #64748b;
  --task-working: #1677c8;
  --task-done: #18864b;
  --task-blocked: #c7374f;
  --task-postponed: #b56b08;
}

.task-page-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.task-view-tabs {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid #d9e3e8;
  border-radius: 8px;
  background: #eef3f5;
}

.task-view-tabs.task-main-view-tabs {
  grid-template-columns: repeat(4, minmax(78px, 1fr));
  white-space: nowrap;
}

.task-view-tab {
  min-height: 38px;
  padding: 0 13px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #52656f;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.task-view-tab span {
  display: inline-grid;
  min-width: 22px;
  min-height: 22px;
  margin-left: 6px;
  place-items: center;
  border-radius: 11px;
  background: #dce6ea;
  font-size: 12px;
}

.task-view-tab.active {
  background: #fff;
  color: #102a33;
  box-shadow: 0 1px 4px rgba(15, 35, 43, 0.12);
}

.task-view-tab.active span {
  background: #d9f0ea;
  color: #087266;
}

.task-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  min-width: 0;
}

#tasksView .task-filter-grid {
  grid-template-columns:
    minmax(130px, 0.75fr)
    minmax(280px, 1.4fr)
    minmax(130px, 0.85fr)
    minmax(130px, 0.85fr);
}

.task-filter-grid > * {
  min-width: 0;
  width: 100%;
}

.management-task-filter-grid {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
}

.task-overview {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}

.task-overview-item {
  display: flex;
  min-height: 58px;
  padding: 10px 12px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid;
  border-left-width: 5px;
  border-radius: 8px;
}

.task-overview-item span {
  font-size: 12px;
  font-weight: 800;
}

.task-overview-item strong {
  color: #102a33;
  font-size: 22px;
}

:is(#tasksView, #managementTasksView) .task-legend {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

:is(#tasksView, #managementTasksView) .legend-item {
  min-height: 48px;
  padding: 8px 10px;
  border-radius: 8px;
}

:is(#tasksView, #managementTasksView) .legend-item > span:last-child {
  display: grid;
  gap: 1px;
}

:is(#tasksView, #managementTasksView) .legend-item strong {
  font-size: 12px;
}

:is(#tasksView, #managementTasksView) .legend-item small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

:is(#tasksView, #managementTasksView) .legend-swatch {
  width: 10px;
  height: 30px;
  border: 0;
  border-radius: 3px;
}

:is(#tasksView, #managementTasksView) .legend-swatch.task-status-neinceput { background: var(--task-not-started); }
:is(#tasksView, #managementTasksView) .legend-swatch.task-status-in-lucru { background: var(--task-working); }
:is(#tasksView, #managementTasksView) .legend-swatch.task-status-finalizat { background: var(--task-done); }
:is(#tasksView, #managementTasksView) .legend-swatch.task-status-blocat { background: var(--task-blocked); }
:is(#tasksView, #managementTasksView) .legend-swatch.task-status-amanat { background: var(--task-postponed); }

.task-archive-notice {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-left: 4px solid #637884;
  background: #eef3f5;
  color: #52656f;
  font-size: 12px;
  font-weight: 700;
}

#taskBoard.data-grid,
#managementTaskBoard.data-grid {
  gap: 18px;
  padding: 0;
}

:is(#tasksView, #managementTasksView) .task-group {
  gap: 8px;
}

:is(#tasksView, #managementTasksView) .task-group-title {
  display: flex;
  min-height: 42px;
  margin: 0;
  padding: 10px 13px;
  align-items: center;
  justify-content: space-between;
  border-radius: 8px;
  background: #eef3f5;
  font-size: 14px;
}

:is(#tasksView, #managementTasksView) .task-card {
  display: grid;
  grid-template-columns: minmax(150px, 0.75fr) minmax(230px, 1.35fr) minmax(170px, 0.8fr) 180px minmax(170px, auto);
  gap: 16px;
  min-height: 108px;
  padding: 14px 14px 14px 16px;
  align-items: center;
  border-width: 1px 1px 1px 6px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(15, 35, 43, 0.055);
}

:is(#tasksView, #managementTasksView) .task-card.has-order {
  grid-template-columns: 42px minmax(150px, 0.75fr) minmax(230px, 1.35fr) minmax(170px, 0.8fr) 180px minmax(170px, auto);
}

:is(#tasksView, #managementTasksView) .task-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 35, 43, 0.09);
}

:is(#tasksView, #managementTasksView) .task-card.task-status-neinceput { border-left-color: var(--task-not-started); }
:is(#tasksView, #managementTasksView) .task-card.task-status-in-lucru { border-left-color: var(--task-working); background: #f7fbff; }
:is(#tasksView, #managementTasksView) .task-card.task-status-finalizat { border-left-color: var(--task-done); background: #f6fcf8; }
:is(#tasksView, #managementTasksView) .task-card.task-status-blocat { border-left-color: var(--task-blocked); background: #fff8f9; }
:is(#tasksView, #managementTasksView) .task-card.task-status-amanat { border-left-color: var(--task-postponed); background: #fffbf4; }

.task-card-assignee,
.task-card-work,
.task-card-schedule {
  display: grid;
  gap: 4px;
  align-content: start;
}

.task-duration-editor {
  display: grid;
  grid-template-columns: auto 58px minmax(76px, auto);
  gap: 5px;
  align-items: center;
  width: fit-content;
  margin-top: 3px;
}

.task-duration-editor label {
  color: #60727b;
  font-size: 11px;
  font-weight: 800;
}

.task-duration-editor input {
  width: 58px;
  min-height: 30px;
  padding: 4px 6px;
  text-align: center;
}

.task-duration-editor .mini-button {
  min-height: 30px;
  padding: 4px 9px;
}

.task-card-eyebrow {
  color: #71838c;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

:is(#tasksView, #managementTasksView) .task-card strong {
  font-size: 14px;
  line-height: 1.25;
}

:is(#tasksView, #managementTasksView) .task-card .task-meta {
  line-height: 1.4;
}

.task-deadline {
  width: fit-content;
  padding: 5px 8px;
  border: 1px solid #d8e2e7;
  border-radius: 6px;
  background: #f4f7f8;
}

.task-deadline.is-overdue {
  border-color: #f0b8c1;
  background: #fff0f2;
  color: #a92038;
}

.task-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.task-badges .badge {
  margin: 0;
}

.task-archive-date {
  color: #60727b;
  font-size: 11px;
  font-weight: 700;
}

.task-card-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #dce5e9;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.82);
}

.task-card-points span {
  display: grid;
  min-height: 56px;
  padding: 7px 5px;
  place-items: center;
  border-right: 1px solid #e3eaed;
}

.task-card-points span:last-child {
  border-right: 0;
}

.task-card-points small {
  color: #71838c;
  font-size: 10px;
  font-weight: 750;
}

.task-card-points strong {
  color: #102a33;
  font-size: 16px;
}

.task-card-actions {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 34px;
  gap: 7px;
  align-items: center;
}

.task-card-actions > .custom-select,
.task-card-actions > select {
  grid-column: 1;
  width: 100%;
  min-width: 0;
}

.task-status-label {
  grid-column: 1 / -1;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 5px;
  color: #fff;
  font-size: 11px;
  font-weight: 850;
}

.task-status-label.task-status-neinceput { background: var(--task-not-started); }
.task-status-label.task-status-in-lucru { background: var(--task-working); }
.task-status-label.task-status-finalizat { background: var(--task-done); }
.task-status-label.task-status-blocat { background: var(--task-blocked); }
.task-status-label.task-status-amanat { background: var(--task-postponed); }

.task-card-actions .mini-button:not(.task-delete-button) {
  grid-column: 1 / -1;
}

.task-blockage-reason,
.today-blockage-reason {
  display: grid;
  gap: 2px;
  margin-top: 7px;
  color: #9f243b;
  font-size: 12px;
  line-height: 1.35;
}

.task-blockage-reason {
  padding: 7px 9px;
  border-left: 3px solid var(--task-blocked);
  background: #fff0f2;
}

.unblock-button {
  border-color: #b9ddd2;
  background: #edf8f4;
  color: #087266;
}

.task-delete-button {
  grid-column: 2;
  grid-row: 2;
  width: 34px;
  min-width: 34px;
  padding: 0;
  color: #a92038;
}

@media (max-width: 1350px) {
  .task-page-toolbar {
    grid-template-columns: 1fr;
  }

  :is(#tasksView, #managementTasksView) .task-card {
    grid-template-columns: minmax(150px, 0.8fr) minmax(220px, 1.2fr) minmax(160px, 0.8fr) minmax(170px, auto);
  }

  :is(#tasksView, #managementTasksView) .task-card.has-order {
    grid-template-columns: 42px minmax(150px, 0.8fr) minmax(220px, 1.2fr) minmax(160px, 0.8fr) minmax(170px, auto);
  }

  .task-card-points {
    grid-column: 2 / 4;
  }
}

@media (max-width: 950px) {
  .task-filter-grid,
  .task-overview,
  :is(#tasksView, #managementTasksView) .task-legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #tasksView .task-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  :is(#tasksView, #managementTasksView) .task-card {
    grid-template-columns: 1fr 1fr;
  }

  :is(#tasksView, #managementTasksView) .task-card.has-order {
    grid-template-columns: 42px 1fr 1fr;
  }

  .task-card-points {
    grid-column: 1;
  }
}

@media (max-width: 620px) {
  .task-filter-grid,
  .task-overview,
  :is(#tasksView, #managementTasksView) .task-legend,
  :is(#tasksView, #managementTasksView) .task-card {
    grid-template-columns: 1fr;
  }

  #tasksView .task-filter-grid {
    grid-template-columns: 1fr;
  }

  :is(#tasksView, #managementTasksView) .task-card.has-order {
    grid-template-columns: 1fr;
  }

  .task-card-points {
    grid-column: 1;
  }
}

/* PT SERVICE BOARD MODERNIZATION - final */
#servicesView {
  --service-scheduled: #64748b;
  --service-working: #1677c8;
  --service-done: #18864b;
  --service-blocked: #c7374f;
}

.service-board-toolbar {
  display: grid;
  grid-template-columns: minmax(300px, 1fr);
  gap: 16px;
  padding: 14px 16px 10px;
  align-items: center;
}

#projectToolbar.services-context {
  grid-template-columns: minmax(360px, 1fr) minmax(480px, auto);
}

#projectToolbar.services-context #yearFilter,
#projectToolbar.services-context #statusFilter,
#projectToolbar.services-context #refreshBtn {
  display: none;
}

.service-toolbar-tabs {
  grid-template-columns: repeat(4, minmax(88px, 1fr));
  margin: 0;
  white-space: nowrap;
}

.service-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(170px, 240px));
  gap: 10px;
  justify-content: end;
}

.service-overview,
.service-legend {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
  padding: 0 16px 12px;
}

.service-overview-item {
  display: flex;
  min-height: 58px;
  padding: 10px 12px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid;
  border-left-width: 5px;
  border-radius: 8px;
}

.service-overview-item span {
  font-size: 12px;
  font-weight: 800;
}

.service-overview-item strong {
  color: #102a33;
  font-size: 22px;
}

.service-overview-item.service-status-programat { border-color: #d7dfe4; border-left-color: var(--service-scheduled); background: #f7f9fa; }
.service-overview-item.service-status-in-lucru { border-color: #c4def1; border-left-color: var(--service-working); background: #f1f8fe; }
.service-overview-item.service-status-finalizat { border-color: #c6e4d1; border-left-color: var(--service-done); background: #f2faf5; }
.service-overview-item.service-status-blocat { border-color: #efc7ce; border-left-color: var(--service-blocked); background: #fff4f6; }

.service-legend-item {
  display: flex;
  min-height: 48px;
  padding: 8px 10px;
  gap: 9px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.service-legend-item > span:last-child {
  display: grid;
}

.service-legend-item strong {
  font-size: 12px;
}

.service-legend-item small {
  color: var(--muted);
  font-size: 11px;
}

.service-legend-swatch {
  width: 10px;
  height: 30px;
  border-radius: 3px;
}

.service-legend-swatch.service-status-programat { background: var(--service-scheduled); }
.service-legend-swatch.service-status-in-lucru { background: var(--service-working); }
.service-legend-swatch.service-status-finalizat { background: var(--service-done); }
.service-legend-swatch.service-status-blocat { background: var(--service-blocked); }

#servicesView .task-archive-notice {
  margin: 0 16px 12px;
}

#serviceTable.table-like {
  gap: 18px;
  padding-top: 4px;
}

.service-group {
  display: grid;
  gap: 8px;
}

.service-group-title {
  display: flex;
  min-height: 42px;
  margin: 0;
  padding: 10px 13px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3f5;
  font-size: 14px;
}

.service-group-title span {
  color: var(--muted);
  font-size: 12px;
}

.service-task-card {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) minmax(150px, 0.65fr) minmax(240px, 1fr) minmax(190px, auto);
  gap: 18px;
  min-height: 104px;
  padding: 14px 14px 14px 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-left-width: 6px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(15, 35, 43, 0.055);
}

.service-task-card.has-order {
  grid-template-columns: 42px minmax(260px, 1.4fr) minmax(150px, 0.65fr) minmax(240px, 1fr) minmax(190px, auto);
}

.service-task-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 35, 43, 0.09);
}

.service-task-card.service-status-programat { border-left-color: var(--service-scheduled); }
.service-task-card.service-status-in-lucru { border-left-color: var(--service-working); background: #f7fbff; }
.service-task-card.service-status-finalizat { border-left-color: var(--service-done); background: #f6fcf8; }
.service-task-card.service-status-blocat { border-left-color: var(--service-blocked); background: #fff8f9; }

.service-task-main,
.service-task-person,
.service-task-period {
  display: grid;
  gap: 4px;
  align-content: start;
}

.service-task-main strong,
.service-task-person strong,
.service-task-period strong {
  color: #102a33;
  font-size: 14px;
}

.service-task-main span:not(.task-card-eyebrow),
.service-task-main small,
.service-task-person small,
.service-task-period small {
  color: var(--muted);
  font-size: 12px;
}

.service-task-period strong.is-overdue {
  width: fit-content;
  padding: 5px 8px;
  border: 1px solid #f0b8c1;
  border-radius: 6px;
  background: #fff0f2;
  color: #a92038;
}

.service-task-actions {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) 34px;
  gap: 7px;
  align-items: center;
}

.service-task-actions > .custom-select,
.service-task-actions > select {
  grid-column: 1;
  width: 100%;
  min-width: 0;
}

.service-status-label {
  grid-column: 1 / -1;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 5px;
  color: #fff;
  font-size: 11px;
  font-weight: 850;
}

.service-status-label.service-status-programat { background: var(--service-scheduled); }
.service-status-label.service-status-in-lucru { background: var(--service-working); }
.service-status-label.service-status-finalizat { background: var(--service-done); }
.service-status-label.service-status-blocat { background: var(--service-blocked); }

.service-delete-button {
  grid-column: 2;
  grid-row: 2;
  width: 34px;
  min-width: 34px;
  padding: 0;
  color: #a92038;
}

@media (max-width: 1150px) {
  #projectToolbar.services-context {
    grid-template-columns: minmax(280px, 1fr) minmax(420px, auto);
  }

  .service-board-toolbar {
    grid-template-columns: 1fr;
  }

  .service-filter-grid {
    justify-content: stretch;
  }

  .service-task-card {
    grid-template-columns: 1fr 1fr;
  }

  .service-task-card.has-order {
    grid-template-columns: 42px 1fr 1fr;
  }
}

@media (max-width: 720px) {
  #projectToolbar.services-context {
    grid-template-columns: 1fr;
  }

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

  .service-filter-grid,
  .service-overview,
  .service-legend,
  .service-task-card {
    grid-template-columns: 1fr;
  }

  .service-task-card.has-order {
    grid-template-columns: 1fr;
  }
}

/* UNIFIED TASK WORKSPACES - final */
:is(#tasksView, #managementTasksView, #servicesView) {
  --workspace-border: #d8e4e8;
  --workspace-soft: #f4f8f9;
  --workspace-ink: #102a33;
}

.task-workspace-toolbar,
.task-create-panel {
  margin-bottom: 14px;
  border: 1px solid var(--workspace-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(22, 48, 58, 0.05);
}

.task-workspace-toolbar {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.task-workspace-primary {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(430px, 520px);
  gap: 12px;
  align-items: end;
}

.task-local-search {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.task-local-search > span {
  padding-left: 2px;
  color: #657982;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.task-local-search input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border-color: #cfe0e5;
  background: #fbfdfe;
}

.task-workspace-toolbar .task-view-tabs {
  width: 100%;
  margin: 0;
  grid-template-columns: repeat(4, minmax(82px, 1fr));
  white-space: nowrap;
}

.task-workspace-toolbar .task-filter-grid {
  display: grid;
  grid-template-columns:
    minmax(170px, 0.8fr)
    minmax(300px, 1.45fr)
    minmax(180px, 0.9fr)
    minmax(180px, 0.9fr);
  gap: 10px;
}

.task-workspace-toolbar .management-task-filter-grid {
  grid-template-columns: repeat(3, minmax(200px, 1fr));
}

.task-workspace-toolbar .custom-select,
.task-workspace-toolbar select {
  width: 100%;
  min-width: 0;
}

.task-create-panel {
  padding: 12px;
}

.task-create-panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  padding: 0 2px;
}

.task-create-panel-head > div {
  display: grid;
  gap: 2px;
}

.task-create-panel-head span {
  color: #087266;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.task-create-panel-head strong {
  color: var(--workspace-ink);
  font-size: 15px;
}

.task-create-panel-head small {
  color: #6a7e87;
  font-size: 11px;
  font-weight: 650;
  text-align: right;
}

.task-create-form {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border: 1px solid #e0eaed;
  border-radius: 10px;
  background: var(--workspace-soft);
  overflow: visible;
}

.task-create-form > *,
.task-create-form .custom-select,
.task-create-form .custom-date {
  width: 100%;
  min-width: 0;
}

.task-create-form select,
.task-create-form input,
.task-create-form button,
.task-create-form .custom-select-button,
.task-create-form .custom-date-button {
  min-height: 44px;
}

#largeTaskCreateBar > .custom-select:has(#largeTaskProject) { grid-column: 1 / 5; }
#largeTaskCreateBar > .custom-select:has(#largeTaskType) { grid-column: 5 / 8; }
#largeTaskCreateBar > #largeTaskCustom { grid-column: 7 / 10; }
#largeTaskCreateBar > .custom-select:has(#largeTaskPerson) { grid-column: 8 / 13; }
#largeTaskCreateBar:has(#largeTaskCustom:not(.hidden)) > .custom-select:has(#largeTaskType) { grid-column: 5 / 7; }
#largeTaskCreateBar:has(#largeTaskCustom:not(.hidden)) > .custom-select:has(#largeTaskPerson) { grid-column: 10 / 13; }
#largeTaskCreateBar > .custom-date:has(#largeTaskStartDate) { grid-column: 1 / 3; }
#largeTaskCreateBar > #largeTaskDuration { grid-column: 3 / 4; }
#largeTaskCreateBar > .custom-select:has(#largeTaskStatus) { grid-column: 4 / 6; }
#largeTaskCreateBar > #largeTaskNotes { grid-column: 6 / 11; }
#largeTaskCreateBar > #addLargeTaskBtn { grid-column: 11 / 13; }

#managementTaskCreateBar > .custom-select:has(#managementTaskType) { grid-column: 1 / 4; }
#managementTaskCreateBar > .custom-select:has(#managementTaskPerson) { grid-column: 4 / 7; }
#managementTaskCreateBar > .custom-date:has(#managementTaskStartDate) { grid-column: 7 / 9; }
#managementTaskCreateBar > #managementTaskDuration { grid-column: 9 / 10; }
#managementTaskCreateBar > #addManagementTaskBtn { grid-column: 10 / 13; }

#serviceForm.service-form > .custom-select:has(#serviceProjectSelect) { grid-column: 1 / 5; }
#serviceForm.service-form > .custom-select:has(#serviceTypeSelect) { grid-column: 5 / 7; }
#serviceForm.service-form > input[name="customService"] { grid-column: 7 / 10; }
#serviceForm.service-form > .custom-select:has(#servicePersonSelect) { grid-column: 10 / 13; }
#serviceForm.service-form > .custom-date:has([name="startDate"]) { grid-column: 1 / 3; }
#serviceForm.service-form > input[name="durationDays"] { grid-column: 3 / 4; }
#serviceForm.service-form > .custom-select:has([name="status"]) { grid-column: 4 / 6; }
#serviceForm.service-form > input[name="notes"] { grid-column: 6 / 11; }
#serviceForm.service-form > .primary-button { grid-column: 11 / 13; width: 100%; min-width: 0; }

.task-create-form > .task-meta {
  grid-column: 1 / -1;
  min-height: 18px;
  padding: 0 2px;
}

#servicesView > .table-panel {
  overflow: visible;
}

@media (max-width: 1180px) {
  .task-workspace-primary {
    grid-template-columns: 1fr;
  }

  .task-workspace-toolbar .task-filter-grid,
  .task-workspace-toolbar .management-task-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .task-create-form > *,
  .task-create-form > .custom-select,
  .task-create-form > .custom-date,
  #largeTaskCreateBar > *,
  #managementTaskCreateBar > *,
  #serviceForm.service-form > * {
    grid-column: auto !important;
  }

  .task-create-form > .task-meta,
  #serviceForm.service-form > input[name="notes"],
  #serviceForm.service-form > .primary-button {
    grid-column: 1 / -1 !important;
  }
}

@media (max-width: 700px) {
  .task-workspace-toolbar .task-view-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-workspace-toolbar .task-filter-grid,
  .task-workspace-toolbar .management-task-filter-grid,
  .task-create-form {
    grid-template-columns: 1fr;
  }

  .task-create-panel-head {
    display: grid;
    align-items: start;
  }

  .task-create-panel-head small {
    text-align: left;
  }

  .task-create-form > *,
  .task-create-form > .task-meta,
  #serviceForm.service-form > input[name="notes"],
  #serviceForm.service-form > .primary-button {
    grid-column: 1 !important;
  }
}
