:root {
  --bg: #f6f4ef;
  --panel: #ffffff;
  --text: #202020;
  --muted: #6f6b63;
  --line: #e5ded1;
  --accent: #a2843d;
  --accent-dark: #765f2d;
  --ink: #111111;
  --soft: #f4efe4;
  --soft-strong: #ebe1cc;
  --danger: #b20000;
  --success: #627d47;
  --shadow: 0 12px 34px rgba(32, 32, 32, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, #ffffff 0, var(--bg) 360px),
    var(--bg);
  font: 14px/1.5 "Segoe UI", Arial, Helvetica, sans-serif;
}

.boot-status {
  position: fixed;
  z-index: 9999;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(720px, calc(100vw - 24px));
  padding: 10px 14px;
  border: 1px solid #d6c18c;
  border-radius: 6px;
  background: #fff8df;
  color: #513f10;
  box-shadow: var(--shadow);
  font-weight: 600;
}

.boot-status a {
  color: inherit;
  font-weight: 700;
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(246, 244, 239, 0.94);
}

.login-overlay.hidden {
  display: none;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.login-card img {
  width: 180px;
  height: auto;
}

.login-card h1 {
  margin: 0;
  font-size: 24px;
}

.login-error {
  min-height: 20px;
  color: var(--danger);
  font-weight: 600;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 256px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #ffffff;
  border-right: 1px solid var(--line);
  padding: 24px 16px;
}

.brand {
  display: grid;
  gap: 8px;
  padding: 4px 8px 28px;
}

.brand-logo {
  width: min(190px, 100%);
  height: auto;
  display: block;
}

.brand span {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  padding: 0 12px;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}

.nav-item.active,
.nav-item:hover {
  color: var(--ink);
  background: var(--soft);
  border-color: var(--soft-strong);
}

.nav-item.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

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

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

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

.user-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: #ffffff;
  font-weight: 600;
}

.small-button {
  padding: 8px 10px;
}

.update-button {
  border-color: rgba(91, 123, 49, 0.32);
  color: var(--accent-dark);
  background: #ffffff;
}

.update-button:hover {
  border-color: var(--accent);
  background: var(--soft);
}

.update-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

h1 {
  color: var(--ink);
  font-size: 28px;
  font-weight: 700;
}

h2 {
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
}

.topbar p {
  color: var(--muted);
  margin-top: 4px;
}

.today {
  color: var(--accent-dark);
  white-space: nowrap;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 18px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}

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

.metric {
  min-height: 112px;
  padding: 18px;
  display: grid;
  align-content: space-between;
  gap: 10px;
}

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

.metric strong {
  color: var(--ink);
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: 30px;
  font-weight: 700;
}

.metric.alert {
  border-color: #ead1cf;
}

.metric.alert strong {
  color: var(--danger);
}

.dashboard-finance-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  padding: 12px 14px;
}

.project-delete-button {
  border-color: #ead1cf;
  background: #fff7f5;
  color: var(--danger);
}

.project-delete-button:hover {
  border-color: #d9a29a;
  background: #fff0ed;
}

.grid.two {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 18px;
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 14px;
  padding: 16px;
}

.quality-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 14px;
  padding: 16px;
}

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

.wizard-summary-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
}

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

.wizard-summary-item strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: 20px;
}

.wizard-list,
.pricing-recommendations {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.wizard-card,
.pricing-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.wizard-card.warning,
.pricing-card.warning {
  border-color: #e2d0a2;
  background: #fffaf0;
}

.wizard-card.critical,
.pricing-card.critical {
  border-color: #e4b0a8;
  background: #fff7f5;
}

.wizard-card header,
.pricing-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.wizard-card h3,
.pricing-card h3 {
  font-size: 16px;
}

.wizard-card p,
.pricing-card p {
  color: var(--muted);
}

.wizard-actions,
.pricing-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
}

.wizard-actions label,
.pricing-metric {
  display: grid;
  gap: 5px;
}

.pricing-metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.68);
}

.pricing-metric span {
  color: var(--muted);
  font-size: 12px;
}

.pricing-metric strong {
  color: var(--ink);
}

.management-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  padding: 16px;
}

.management-kpi {
  display: grid;
  gap: 8px;
  min-height: 92px;
  align-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.management-kpi span {
  color: var(--muted);
}

.management-kpi strong {
  color: var(--ink);
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: 22px;
}

.management-kpi small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.management-kpi.critical {
  border-color: #e4b0a8;
  background: #fff7f5;
}

.management-kpi.critical strong {
  color: var(--danger);
}

.management-kpi.warning {
  border-color: #e2d0a2;
  background: #fffaf0;
}

.management-kpi.good {
  border-color: #c8d6b7;
  background: #f8fbf4;
}

.analysis-period-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
  justify-content: flex-end;
}

.analysis-period-controls label {
  display: grid;
  gap: 5px;
  min-width: 135px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.analysis-period-controls input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  background: #ffffff;
  color: var(--ink);
}

.insight-card,
.quality-card {
  display: grid;
  gap: 10px;
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(32, 32, 32, 0.05);
}

.insight-card-link,
.insight-list-link {
  color: inherit;
  text-decoration: none;
}

.insight-card-link {
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.insight-card-link:hover {
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(32, 32, 32, 0.1);
  transform: translateY(-1px);
}

.insight-card-link:focus-visible,
.insight-list-link:focus-visible {
  outline: 3px solid rgba(174, 132, 39, 0.32);
  outline-offset: 2px;
}

.insight-list-link:hover {
  background: #fffaf0;
}

.insight-card header,
.quality-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.insight-card h3,
.quality-card h3 {
  font-size: 16px;
}

.insight-card p,
.quality-card p {
  color: var(--muted);
  line-height: 1.45;
}

.insight-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--soft);
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 12px;
}

.insight-action {
  align-self: end;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  border-top: 1px solid var(--line);
  padding-top: 9px;
  color: var(--ink);
  font-weight: 600;
}

.insight-action strong {
  color: var(--accent-dark);
  font-size: 12px;
  white-space: nowrap;
}

.insight-target-flash {
  animation: insight-target-flash 2.4s ease-out;
}

@keyframes insight-target-flash {
  0%, 35% {
    outline: 3px solid rgba(174, 132, 39, 0.72);
    outline-offset: 3px;
    box-shadow: 0 0 0 7px rgba(174, 132, 39, 0.13);
  }
  100% {
    outline-color: transparent;
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .insight-card-link,
  .insight-target-flash {
    animation: none;
    transition: none;
  }
}

@media (max-width: 640px) {
  .insight-action {
    grid-template-columns: 1fr;
  }

  .insight-action strong {
    white-space: normal;
  }
}

.insight-card.critical,
.quality-card.critical {
  border-color: #e4b0a8;
  background: #fff7f5;
  box-shadow: inset 4px 0 0 var(--danger);
}

.insight-card.critical .insight-badge,
.quality-card.critical .insight-badge {
  background: #fff0ed;
  color: var(--danger);
}

.insight-card.warning,
.quality-card.warning {
  border-color: #e2d0a2;
  background: #fffaf0;
  box-shadow: inset 4px 0 0 var(--accent);
}

.insight-card.opportunity,
.quality-card.opportunity {
  border-color: #c8d6b7;
  background: #f8fbf4;
  box-shadow: inset 4px 0 0 var(--success);
}

.insight-card.info,
.quality-card.info {
  background: #fbfaf7;
}

.priority-focus-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 14px;
  padding: 16px;
}

.priority-focus-card {
  display: grid;
  gap: 10px;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.priority-focus-card header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.priority-focus-card h3 {
  font-size: 16px;
}

.priority-focus-card.priority-1 {
  border-color: #e4b0a8;
  background: #fff7f5;
  box-shadow: inset 4px 0 0 var(--danger);
}

.priority-focus-card.priority-2 {
  border-color: #e2d0a2;
  background: #fffaf0;
  box-shadow: inset 4px 0 0 var(--accent);
}

.priority-focus-meta,
.priority-focus-tasks,
.priority-focus-warnings {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

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

.priority-focus-meta span {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  background: #fbfaf7;
}

.priority-focus-tasks strong {
  color: var(--text);
}

.priority-focus-requirements {
  display: grid;
  gap: 4px;
  border: 1px solid #d8c99f;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fffaf0;
  color: var(--text);
  font-size: 12px;
}

.priority-focus-requirements p {
  margin: 0;
  color: #5f5a50;
  line-height: 1.45;
  white-space: pre-wrap;
}

.priority-focus-warnings {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  color: var(--danger);
  font-weight: 600;
}

.my-today-grid,
.health-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
  padding: 16px;
}

.my-today-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.my-today-action {
  min-width: 0;
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  text-align: left;
  cursor: pointer;
}

.my-today-action:hover {
  border-color: #bfa86f;
  background: #fffdf7;
}

.my-today-action-icon {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 7px;
  color: #ffffff;
  background: var(--accent-dark);
  font-size: 15px;
  font-weight: 800;
}

.my-today-action > span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.my-today-action strong,
.my-today-action small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-today-action small {
  color: var(--muted);
  font-size: 11px;
}

.my-today-card,
.health-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.my-today-card header,
.health-card header {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfaf7;
}

.my-today-card h3,
.health-card h3 {
  font-size: 14px;
}

.my-today-list,
.health-card > div {
  display: grid;
}

.my-today-row,
.health-card > div > span {
  display: grid;
  gap: 3px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.my-today-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.my-today-row > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.my-today-row:last-child,
.health-card > div > span:last-child {
  border-bottom: 0;
}

.my-today-row strong {
  color: var(--text);
  font-size: 13px;
}

.my-today-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

.my-today-row .tiny-button {
  align-self: center;
  justify-self: end;
}

.my-today-row.warning,
.health-card.warning {
  border-color: #e2d0a2;
  background: #fffdf8;
}

.my-today-row.danger {
  color: var(--danger);
  background: #fff6f3;
}

.health-card.ok {
  border-color: rgba(98, 125, 71, 0.28);
}

.my-today-empty {
  grid-column: 1 / -1;
}

@media (max-width: 980px) {
  .my-today-grid,
  .health-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .my-today-actions {
    grid-template-columns: 1fr;
  }

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

  .my-today-row .tiny-button {
    justify-self: start;
  }
}

.priority-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.priority-badge.priority-1,
.priority-select.priority-1 {
  border-color: #e4b0a8;
  background: #fff0ed;
  color: var(--danger);
}

.priority-badge.priority-2,
.priority-select.priority-2 {
  border-color: #e2d0a2;
  background: #fff8e7;
  color: var(--accent-dark);
}

.priority-badge.priority-3,
.priority-select.priority-3 {
  background: var(--soft);
}

.priority-badge.priority-4,
.priority-select.priority-4,
.priority-badge.priority-5,
.priority-select.priority-5 {
  background: #f2f2f0;
  color: var(--muted);
}

.panel {
  overflow: hidden;
}

.panel-head {
  min-height: 58px;
  padding: 15px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(180deg, #ffffff, #fbfaf7);
  border-bottom: 1px solid var(--line);
}

.list {
  display: grid;
  gap: 0;
}

.list-item {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 4px;
}

.list-item:last-child {
  border-bottom: 0;
}

.list-item strong {
  font-size: 14px;
}

.list-item span {
  color: var(--muted);
}

.legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
}

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

.dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
}

.dot.running {
  background: var(--success);
}

.dot.waiting {
  background: var(--accent);
}

.dot.late {
  background: var(--danger);
}

.dot.task,
.timeline-bar.task {
  background: #4c6f9f;
}

.dot.on-hold {
  background: repeating-linear-gradient(45deg, #9a6a3a, #9a6a3a 4px, #d2b071 4px, #d2b071 8px);
}

.designer-schedule-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.designer-panel .schedule-row,
.schedule-board.compact .schedule-row {
  grid-template-columns: minmax(210px, 0.9fr) minmax(260px, 1.3fr) 120px;
  padding: 12px 14px;
}

.schedule-board {
  display: grid;
  gap: 0;
}

.schedule-row {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(360px, 1.4fr) 150px;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.schedule-row.linked {
  background: linear-gradient(90deg, rgba(186, 139, 59, 0.1), rgba(255, 255, 255, 0));
}

.schedule-row.on-hold {
  background: linear-gradient(90deg, rgba(170, 88, 54, 0.12), rgba(255, 255, 255, 0));
}

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

.schedule-main {
  min-width: 0;
}

.schedule-main strong {
  display: block;
  margin-bottom: 4px;
}

.schedule-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.schedule-title-line strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-sequence {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  border: 1px solid #d9c59e;
  border-radius: 999px;
  background: #fff8ea;
  color: #6e5824;
  font-size: 11px;
  font-weight: 800;
}

.schedule-link,
.schedule-link-note {
  display: block;
  margin-top: 5px;
  color: #6e5824;
  font-size: 11px;
  font-weight: 700;
}

.schedule-hold {
  display: block;
  margin-top: 5px;
  color: #8d4426;
  font-size: 11px;
  font-weight: 800;
}

.schedule-requirements {
  display: -webkit-box;
  margin-top: 5px;
  overflow: hidden;
  color: #6e5824;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.schedule-editor {
  display: grid;
  grid-template-columns: repeat(3, minmax(82px, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.schedule-editor label {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.schedule-editor input[type="date"],
.schedule-editor input[type="text"],
.schedule-editor input[type="number"],
.schedule-editor select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 7px;
  background: #fffdf9;
  color: var(--ink);
  font-size: 12px;
}

.schedule-editor input:disabled {
  background: #f1ece2;
  color: var(--muted);
}

.schedule-overlap-toggle {
  align-items: center;
  grid-template-columns: auto 1fr;
}

.schedule-overlap-toggle input {
  width: 15px;
  height: 15px;
}

.schedule-overlap-reason {
  grid-column: 1 / -1;
}

.schedule-link-note {
  grid-column: 1 / -1;
}

.schedule-conflict {
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 700;
}

.schedule-row > div:last-child {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  flex-wrap: wrap;
}

.timeline {
  height: 30px;
  background: #eee8dd;
  border: 1px solid #e2d7c4;
  border-radius: 8px;
  overflow: visible;
  position: relative;
}

.schedule-visual-board {
  position: relative;
  padding: 18px 20px 16px;
  background:
    linear-gradient(90deg, rgba(186, 139, 59, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, #fffdf8, #fbfaf7);
  background-size: 8.333% 100%, auto;
  border-top: 1px solid var(--line);
}

.schedule-visual-scale {
  display: grid;
  grid-template-columns: minmax(260px, 0.34fr) minmax(0, 1fr);
  gap: 18px;
  align-items: end;
  margin-bottom: 10px;
}

.schedule-visual-scale-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.schedule-visual-scale-track {
  position: relative;
  height: 34px;
  border-bottom: 1px solid #d8cbb7;
}

.schedule-visual-tick {
  position: absolute;
  bottom: 5px;
  transform: translateX(-50%);
  padding: 0 4px;
  background: #fffdf8;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.schedule-visual-tick::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 15px;
  width: 1px;
  height: 13px;
  background: #d8cbb7;
}

.schedule-visual-today {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--ink);
  z-index: 4;
}

.schedule-visual-today.scale::after {
  content: "\0160iandien";
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translate(-50%, -100%);
  white-space: nowrap;
  color: #ffffff;
  background: var(--ink);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(17, 17, 17, 0.18);
}

.schedule-visual-lanes {
  display: grid;
  gap: 10px;
}

.schedule-visual-lane {
  display: grid;
  grid-template-columns: minmax(260px, 0.34fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  position: relative;
  min-height: 74px;
  padding: 10px 0;
  border-top: 1px solid rgba(226, 215, 196, 0.65);
}

.schedule-visual-lane.task {
  min-height: 58px;
}

.schedule-visual-meta {
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.schedule-visual-meta-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.schedule-visual-meta-title strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-visual-meta small {
  color: #6e5824;
  font-size: 11px;
  font-weight: 800;
}

.schedule-visual-dependency {
  display: block;
  width: fit-content;
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid #e2d7c4;
  border-radius: 999px;
  background: #fff8ea;
  color: #6e5824;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-visual-meta.task .schedule-sequence {
  background: #eef3fb;
  border-color: #b9c9df;
  color: #2f5787;
}

.schedule-visual-track {
  position: relative;
  min-height: 54px;
}

.schedule-visual-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 36px;
  border-top: 1px solid #eadfcc;
}

.schedule-visual-contract {
  position: absolute;
  top: 23px;
  height: 28px;
  border: 1px dashed rgba(28, 28, 28, 0.2);
  border-radius: 8px;
  background: rgba(28, 28, 28, 0.06);
}

.schedule-visual-bar {
  position: absolute;
  top: 24px;
  min-width: 8px;
  min-height: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
  color: #ffffff;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(32, 32, 32, 0.12);
  z-index: 2;
}

.schedule-visual-date-label {
  position: absolute;
  top: 0;
  display: inline-flex;
  max-width: 150px;
  padding: 2px 5px;
  border: 1px solid #e2d7c4;
  border-radius: 4px;
  background: #fffdf8;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  pointer-events: none;
  z-index: 3;
}

.schedule-visual-date-label.start {
  transform: translateX(-2px);
}

.schedule-visual-date-label.end {
  transform: translateX(-100%);
}

.schedule-visual-bar.running {
  background: var(--success);
}

.schedule-visual-bar.waiting {
  background: var(--accent);
  color: #2b2417;
}

.schedule-visual-bar.late {
  background: var(--danger);
}

.schedule-visual-bar.task {
  background: #4c6f9f;
}

.schedule-visual-bar.on-hold {
  background: repeating-linear-gradient(45deg, #8f5c2f, #8f5c2f 8px, #c99b53 8px, #c99b53 16px);
  color: #fff8ea;
}

.schedule-visual-bar.priority-1 {
  border-left: 5px solid #8f1d1d;
}

.schedule-visual-bar.priority-2 {
  border-left: 5px solid #b57615;
}

.schedule-visual-bar.priority-4,
.schedule-visual-bar.priority-5 {
  border-left: 5px solid #6f6b63;
}

.schedule-task-marker {
  position: absolute;
  top: 14px;
  width: 2px;
  height: 38px;
  background: #4c6f9f;
  transform: translateX(-1px);
  z-index: 3;
}

.schedule-task-marker::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 50%;
  width: 11px;
  height: 11px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #4c6f9f;
  box-shadow: 0 5px 12px rgba(32, 32, 32, 0.18);
  transform: translate(-50%, -50%);
}

.schedule-task-marker.late,
.schedule-task-marker.late::before {
  background: var(--danger);
}

.schedule-task-marker span {
  position: absolute;
  top: -2px;
  left: 12px;
  min-width: max-content;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eef3fb;
  color: #2f5787;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(32, 32, 32, 0.1);
}

.schedule-task-marker.late span {
  background: #fff0ed;
  color: var(--danger);
}

.schedule-task-marker.edge-right span {
  right: 12px;
  left: auto;
}

.schedule-task-marker.edge-left span {
  left: 12px;
}

.schedule-visual-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.schedule-calendar-scale {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(360px, 1.4fr) 150px;
  gap: 14px;
  padding: 6px 18px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.designer-panel .schedule-calendar-scale,
.schedule-board.compact .schedule-calendar-scale {
  grid-template-columns: minmax(210px, 0.9fr) minmax(260px, 1.3fr) 120px;
  padding: 6px 14px 10px;
}

.schedule-scale-track {
  position: relative;
  height: 30px;
  border-bottom: 1px solid #e2d7c4;
}

.schedule-scale-tick {
  position: absolute;
  bottom: -2px;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 0 3px;
  background: #fbfaf7;
}

.schedule-calendar-scale.compact .schedule-scale-tick {
  font-size: 10px;
}

.schedule-scale-tick::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 16px;
  width: 1px;
  height: 12px;
  background: #d8cbb7;
}

.today-marker {
  position: absolute;
  top: -5px;
  bottom: -5px;
  width: 2px;
  background: var(--ink);
  z-index: 2;
}

.today-marker::after {
  content: "Šiandien";
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  color: #ffffff;
  background: var(--ink);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  box-shadow: 0 6px 14px rgba(17, 17, 17, 0.18);
}

.today-marker::after {
  content: "Šiandien";
}

.today-marker.scale::after {
  top: -18px;
}

.today-marker::after {
  content: "\0160iandien";
}

.today-marker.scale::after {
  content: "\0160iandien";
}

.today-marker.row::after {
  content: "";
  display: none;
}

.timeline-contract {
  position: absolute;
  top: 5px;
  height: 20px;
  border-radius: 999px;
  background: rgba(28, 28, 28, 0.08);
  border: 1px dashed rgba(28, 28, 28, 0.18);
}

.timeline-bar {
  position: absolute;
  top: 5px;
  height: 20px;
  border-radius: 999px;
  min-width: 8px;
  z-index: 1;
}

.timeline-bar.running {
  background: var(--success);
}

.timeline-bar.waiting {
  background: var(--accent);
}

.timeline-bar.late {
  background: var(--danger);
}

.timeline-bar.on-hold {
  background: repeating-linear-gradient(
    45deg,
    #9a6a3a,
    #9a6a3a 7px,
    #d2b071 7px,
    #d2b071 14px
  );
}

.timeline-bar.task {
  background: #4c6f9f;
}

.timeline-bar.priority-1 {
  background: var(--danger);
}

.timeline-bar.priority-2 {
  background: var(--accent);
}

.timeline-bar.priority-4,
.timeline-bar.priority-5 {
  background: #8f8b82;
}

.timeline-bar.on-hold,
.timeline-bar.on-hold.priority-1,
.timeline-bar.on-hold.priority-2,
.timeline-bar.on-hold.priority-3,
.timeline-bar.on-hold.priority-4,
.timeline-bar.on-hold.priority-5 {
  background: repeating-linear-gradient(
    45deg,
    #9a6a3a,
    #9a6a3a 7px,
    #d2b071 7px,
    #d2b071 14px
  );
}

.timeline-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  z-index: 2;
  pointer-events: none;
}

.history-grid {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 14px;
}

.history-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 10px;
  background: #ffffff;
}

.compact-card {
  gap: 8px;
}

.wide-input {
  min-width: 260px;
}

.history-card header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.history-card h3 {
  font-size: 15px;
}

.history-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.history-stat {
  background: #fbfaf7;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
}

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

.history-stat strong {
  display: block;
  margin-top: 2px;
}

.mini-projects {
  display: grid;
  gap: 6px;
}

.mini-project {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.payroll-history-details {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.payroll-history-details summary {
  width: fit-content;
  cursor: pointer;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.payroll-history-details summary:hover {
  color: var(--accent-dark);
}

.payroll-history-formula {
  margin: 10px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfaf7;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.payroll-history-table {
  table-layout: fixed;
  font-size: 12px;
}

.payroll-history-table th,
.payroll-history-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: top;
}

.form-grid {
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
  align-items: end;
}

.time-entry-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.time-entry-identity,
.time-period-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.time-entry-identity {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: #ffffff;
  color: var(--ink);
}

.time-form {
  grid-template-columns: minmax(130px, 0.8fr) minmax(150px, 0.9fr) minmax(220px, 1.5fr) minmax(100px, 0.65fr);
}

.time-form .time-form-feedback {
  grid-column: 1 / -1;
  min-height: 18px;
  margin: -4px 0 0;
  color: var(--success);
  font-size: 12px;
  font-weight: 700;
}

.time-form-lock {
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: #fff8e8;
  color: #5c4819;
  font-size: 12px;
  font-weight: 700;
}

.time-form-lock[hidden] {
  display: none;
}

.time-permission-notice {
  display: grid;
  gap: 5px;
  padding: 18px;
  background: #fbfaf7;
  color: var(--muted);
}

.time-permission-notice[hidden],
.time-form[hidden] {
  display: none !important;
}

.time-permission-notice strong {
  color: var(--ink);
}

.time-current-summary {
  display: grid;
}

.time-summary-row,
.time-summary-total {
  min-height: 67px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.time-summary-row div {
  display: grid;
  gap: 3px;
}

.time-summary-row span,
.time-summary-total span {
  color: var(--muted);
  font-size: 12px;
}

.time-summary-row > strong,
.time-summary-total strong {
  white-space: nowrap;
  font-size: 18px;
}

.time-summary-total {
  min-height: 54px;
  border-bottom: 0;
  background: #fbfaf7;
}

.time-register {
  display: grid;
  gap: 14px;
}

.time-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.time-control-person {
  min-width: 0;
  padding: 16px 18px 18px;
}

.time-control-person + .time-control-person {
  border-left: 1px solid var(--line);
}

.time-control-person > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.time-control-person > header span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.time-control-person h3 {
  margin: 2px 0 0;
  font-size: 16px;
}

.time-control-count {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 4px;
}

.time-control-count.clear {
  background: #edf4e8;
  color: #46612f;
}

.time-control-count.attention {
  background: #fff0e5;
  color: #8d3f13;
}

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

.time-check-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 8px 0;
  border-top: 1px solid #eee9df;
}

.time-check-item:first-child {
  border-top: 0;
}

.time-check-item i {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: #929087;
}

.time-check-item.ok i {
  background: var(--success);
}

.time-check-item.warning i {
  background: #c78524;
}

.time-check-item.danger i {
  background: var(--danger);
}

.time-check-item div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.time-check-item strong {
  font-size: 12px;
}

.time-check-item span {
  color: var(--muted);
  overflow-wrap: anywhere;
  font-size: 11px;
}

.time-register-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 4px 2px 0;
}

.time-register-header h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.time-register-header p,
.time-register-header > span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.time-register-header > span {
  white-space: nowrap;
}

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

.time-employee-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.time-employee-header {
  min-height: 94px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.time-employee-header span,
.time-employee-total span,
.time-employee-total small {
  color: var(--muted);
  font-size: 11px;
}

.time-employee-header h3 {
  margin: 3px 0 0;
  font-size: 21px;
}

.time-employee-total {
  display: grid;
  justify-items: end;
  gap: 2px;
  text-align: right;
}

.time-employee-total strong {
  font-size: 22px;
  color: var(--accent-dark);
}

.time-month-current {
  background: #f7faf6;
}

.time-month-heading,
.time-month-history > summary {
  min-height: 51px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.time-month-heading {
  border-bottom: 1px solid #dfe7dc;
}

.time-month-heading > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.time-month-heading span,
.time-month-history small {
  color: var(--muted);
  font-size: 11px;
}

.time-approval-badge {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid #d7d2c7;
  border-radius: 4px;
  background: #f5f3ee;
  color: #666157 !important;
  font-size: 10px !important;
  font-weight: 800;
  line-height: 1.2;
}

.time-approval-badge.submitted {
  border-color: #dfc88c;
  background: #fff7dc;
  color: #725612 !important;
}

.time-approval-badge.approved {
  border-color: #bfd0b2;
  background: #edf4e8;
  color: #46612f !important;
}

.time-approval-panel {
  min-width: 0;
  padding: 9px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #dfe7dc;
  background: #f2f6ef;
}

.time-approval-panel.compact {
  border-top: 1px solid var(--line);
  border-bottom-color: var(--line);
  background: #fbfaf7;
}

.time-approval-details {
  min-width: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
  font-size: 11px;
}

.time-approval-actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.time-approval-actions .small-button {
  min-height: 32px;
  padding: 5px 9px;
  font-size: 11px;
}

.time-entry-list {
  display: grid;
}

.time-entry-row {
  min-width: 0;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

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

.time-entry-row time {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.time-entry-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.time-entry-main strong,
.time-entry-main span {
  overflow-wrap: anywhere;
}

.time-entry-main strong {
  font-size: 13px;
}

.time-entry-main span {
  color: var(--muted);
  font-size: 11px;
}

.time-entry-main .time-entry-correction {
  color: #7d6330;
  overflow-wrap: anywhere;
  font-size: 10px;
}

.time-entry-hours {
  white-space: nowrap;
  color: var(--ink);
}

.time-entry-actions {
  min-width: 54px;
  display: flex;
  justify-content: flex-end;
}

.time-entry-actions:empty {
  min-width: 0;
}

.time-entry-actions .small-button {
  min-height: 30px;
  padding: 4px 8px;
  font-size: 11px;
}

.time-history-label {
  padding: 14px 16px 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.time-month-history {
  border-top: 1px solid var(--line);
}

.time-month-history > summary {
  cursor: pointer;
  list-style: none;
  background: #ffffff;
}

.time-month-history > summary::-webkit-details-marker {
  display: none;
}

.time-month-history > summary span {
  display: grid;
  gap: 2px;
}

.time-month-history > summary .time-history-summary-state {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.time-history-summary-state > strong {
  white-space: nowrap;
}

.time-month-history > summary::after {
  content: "+";
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  order: 3;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
}

.time-month-history[open] > summary::after {
  content: "−";
}

.time-month-history[open] > summary {
  background: #fbfaf7;
}

.time-history-empty,
.time-empty-state {
  margin: 0;
  padding: 16px;
  color: var(--muted);
  font-size: 12px;
}

.system-dialog {
  width: min(620px, calc(100vw - 32px));
  max-height: min(760px, calc(100dvh - 32px));
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 22px 60px rgba(24, 24, 24, 0.2);
}

.system-dialog.compact-dialog {
  width: min(480px, calc(100vw - 32px));
}

.system-dialog::backdrop {
  background: rgba(29, 29, 27, 0.44);
  backdrop-filter: blur(2px);
}

.system-dialog-form {
  display: grid;
}

.system-dialog-form > header,
.system-dialog-form > footer {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.system-dialog-form > header {
  border-bottom: 1px solid var(--line);
}

.system-dialog-form > footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  background: #fbfaf7;
}

.system-dialog-form h2 {
  margin: 2px 0 0;
  font-size: 18px;
}

.dialog-eyebrow {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.dialog-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #ffffff;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.system-dialog-body {
  padding: 18px;
  display: grid;
  gap: 14px;
}

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

.dialog-form-grid .wide {
  grid-column: 1 / -1;
}

.dialog-context {
  margin: 0;
  padding: 9px 11px;
  border-left: 3px solid var(--accent);
  background: var(--soft);
  font-weight: 700;
}

.dialog-error {
  min-height: 18px;
  margin: 0;
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
}

.project-form,
.task-form {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

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

.project-service-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  min-height: 62px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8faf7;
}

.project-service-field legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 13px;
}

.project-service-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 600;
}

.project-service-check input {
  width: auto;
  min-height: auto;
}

.field-inactive {
  opacity: 0.52;
}

input,
select,
textarea {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(162, 132, 61, 0.22);
  border-color: var(--accent);
}

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

.wide {
  grid-column: span 2;
}

button {
  font: inherit;
}

.primary,
.ghost {
  min-height: 40px;
  border-radius: 6px;
  padding: 0 14px;
  cursor: pointer;
}

.primary {
  border: 0;
  color: #ffffff;
  background: var(--ink);
}

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

.ghost {
  border: 1px solid var(--line);
  color: var(--text);
  background: #ffffff;
}

.ghost:hover {
  border-color: var(--accent);
}

.table-wrap {
  overflow: auto;
}

.payroll-tables {
  display: grid;
  gap: 18px;
}

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

.payroll-table-card > header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfaf7;
}

.payroll-table-card h3 {
  margin: 0 0 4px;
  font-size: 17px;
}

.payroll-table-card .table-wrap {
  overflow-x: hidden;
}

.payroll-table-card table {
  table-layout: fixed;
  font-size: 12px;
}

.payroll-table-card th,
.payroll-table-card td {
  padding: 8px 6px;
  line-height: 1.25;
  white-space: normal;
}

.payroll-table-card th span {
  display: block;
}

.payroll-table-card .money,
.payroll-table-card .hours {
  text-align: right;
}

.payroll-table-card td:first-child {
  word-break: break-word;
}

.payroll-table-card .table-input,
.payroll-table-card .table-select {
  width: 100%;
  min-width: 0;
  min-height: 30px;
  font-size: 12px;
}

.payroll-col-object {
  width: 10%;
}

.payroll-col-project {
  width: 11%;
}

.payroll-col-small {
  width: 4.5%;
}

.payroll-col-money {
  width: 5.1%;
}

.payroll-col-total-hours {
  width: 5.6%;
}

.payroll-col-method {
  width: 7%;
}

.payroll-col-percent {
  width: 5%;
}

.payroll-col-actual {
  width: 6%;
}

.payroll-col-notes {
  width: 10%;
}

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

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

th {
  color: #4d493f;
  background: #f6f1e8;
  font-weight: 600;
}

.table-input,
.table-select {
  min-height: 34px;
  min-width: 132px;
  border-radius: 5px;
  background: #ffffff;
}

.table-select {
  min-width: 168px;
}

.number-input {
  width: 108px;
  min-width: 108px;
  text-align: right;
}

.date-input {
  width: 142px;
  min-width: 142px;
}

.payroll-project-select {
  width: min(360px, 100%);
  min-width: 260px;
}

.project-rejected-row td {
  background: #f4f2ed;
  color: #6f6b63;
}

.project-rejected-row td:first-child {
  box-shadow: inset 3px 0 0 #a9a197;
}

.payroll-table-card th,
.payroll-table-card td {
  padding: 8px 6px;
  line-height: 1.25;
  white-space: normal;
}

.payroll-table-card .payroll-project-select {
  width: 100%;
  min-width: 0;
}

.payroll-table-card .payroll-method-select {
  width: 100%;
  min-width: 0;
}

.payroll-actual-paid-control {
  display: block;
}

.payroll-payout-control {
  display: grid;
  grid-template-columns: minmax(42px, 1fr) auto;
  gap: 4px;
  align-items: center;
}

.payroll-table-card .payroll-payout-input {
  width: 100%;
  min-width: 0;
  padding-inline: 6px;
}

.payroll-table-card .payroll-actual-paid-input {
  width: 100%;
  min-width: 0;
  padding-inline: 6px;
}

@media (max-width: 720px) {
  .payroll-table-card {
    overflow: visible;
  }

  .payroll-table-card .table-wrap {
    overflow: visible;
  }

  .payroll-table-card table,
  .payroll-table-card colgroup,
  .payroll-table-card thead,
  .payroll-table-card tbody {
    display: block;
    width: 100%;
  }

  .payroll-table-card colgroup,
  .payroll-table-card thead {
    display: none;
  }

  .payroll-table-card tbody {
    display: grid;
    gap: 10px;
    padding: 10px;
    background: #f8f9f6;
  }

  .payroll-table-card tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #ffffff;
  }

  .payroll-table-card tr.payroll-total-row {
    border-color: #c9b276;
    background: #fbfaf2;
  }

  .payroll-table-card td,
  .payroll-table-card th {
    display: block;
    min-width: 0;
    border: 0;
    padding: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: left;
  }

  .payroll-table-card td[colspan] {
    grid-column: 1 / -1;
  }

  .payroll-table-card td[data-payroll-mobile-wide="1"] {
    grid-column: 1 / -1;
  }

  .payroll-table-card td[data-payroll-mobile-empty="1"] {
    display: none;
  }

  .payroll-table-card td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
    text-transform: uppercase;
  }

  .payroll-table-card .money,
  .payroll-table-card .hours {
    text-align: left;
  }

  .payroll-table-card .money strong,
  .payroll-table-card .hours strong {
    font-size: 15px;
  }

  .payroll-table-card .payroll-project-select,
  .payroll-table-card .table-input,
  .payroll-table-card .table-select {
    min-height: 38px;
    font-size: 14px;
  }

  .payroll-payout-control {
    max-width: 138px;
    grid-template-columns: minmax(72px, 1fr) auto;
  }

  .payroll-table-card .cell-note {
    margin-top: 2px;
    font-size: 11px;
  }

  .payroll-table-card .payroll-notes:empty::after {
    content: "-";
    color: var(--muted);
    font-weight: 500;
  }
}

@media (max-width: 360px) {
  .payroll-table-card tbody {
    padding: 8px;
  }

  .payroll-table-card tr {
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 11px;
  }

  .payroll-table-card td[data-payroll-mobile-wide="1"] {
    grid-column: auto;
  }
}

.payroll-loss-row td {
  background: #fff2ef;
}

.payroll-loss-row td:first-child {
  box-shadow: inset 3px 0 0 var(--danger);
}

.payroll-notes {
  min-width: 0;
  max-width: none;
  white-space: normal;
  font-weight: 600;
}

.payroll-table-card .cell-note {
  font-size: 11px;
  line-height: 1.2;
}

.cell-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

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

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

.checkbox-row input,
.weekday-picker input {
  width: auto;
  min-height: auto;
}

.weekday-picker {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.weekday-picker legend {
  color: var(--muted);
  padding: 0 6px;
}

.weekday-picker label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.employee-grid {
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 14px;
}

.employee-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  display: grid;
  gap: 14px;
  background: #ffffff;
}

.employee-card header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--ink);
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  font-weight: 700;
}

.employee-meta {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfaf7;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.employee-section {
  display: grid;
  gap: 6px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.employee-section strong {
  color: var(--ink);
  font-size: 13px;
}

.employee-section span {
  line-height: 1.35;
}

.hidden-frame {
  display: none;
  width: 0;
  height: 0;
  border: 0;
}

td.money,
td.hours {
  text-align: right;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent-dark);
}

.status.closed {
  background: #efefef;
  color: var(--muted);
}

.status.attention {
  background: #fff3f1;
  color: var(--danger);
}

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

.month-filter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.month-filter input {
  width: 160px;
}

.payroll-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.project-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.project-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.project-tab {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.project-tab.active,
.project-tab:hover {
  border-color: var(--soft-strong);
  background: var(--soft);
  color: var(--ink);
}

.project-tab span {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  min-height: 22px;
  margin-left: 6px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
}

.project-tab-panel {
  display: none;
}

.project-tab-panel.active {
  display: block;
}

.panel-note {
  max-width: 820px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.project-info-list {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.project-info-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.project-info-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.project-info-card h3 {
  margin-bottom: 3px;
  font-size: 16px;
}

.project-info-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.project-info-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  background: #fbfaf7;
}

.project-info-checklist {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 8px;
}

.project-info-check {
  min-width: 0;
  min-height: 96px;
  display: grid;
  align-content: start;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px;
  background: #fbfaf7;
  color: var(--text);
}

.project-info-check-main {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  color: var(--text);
}

.project-info-check-main input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
}

.project-info-check-main span {
  font-weight: 600;
}

.project-info-check-detail {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding-left: 27px;
}

.project-info-check-detail small {
  color: var(--muted);
  line-height: 1.3;
}

.project-info-date-input {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  margin: 0;
  padding: 5px 7px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.project-info-requirements {
  display: grid;
  grid-template-columns: minmax(240px, 0.42fr) minmax(320px, 1fr);
  gap: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  background: #f7f6f2;
}

.project-info-requirements.active {
  border-color: #d8c99f;
  background: #fffaf0;
}

.project-info-requirements.incomplete {
  border-color: #dfaaa2;
  box-shadow: inset 4px 0 0 var(--danger);
}

.project-info-requirements-toggle {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  color: var(--text);
}

.project-info-requirements-toggle input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
}

.project-info-requirements-toggle span {
  display: grid;
  gap: 4px;
}

.project-info-requirements-toggle small,
.project-info-requirements-meta {
  color: var(--muted);
  font-weight: 400;
  line-height: 1.4;
}

.project-info-requirements textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
}

.project-info-requirements-meta {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  font-size: 12px;
}

.project-info-requirements.incomplete .project-info-requirements-meta span {
  color: var(--danger);
  font-weight: 700;
}

.project-info-timeline {
  display: grid;
  gap: 6px;
  padding-top: 2px;
}

.project-info-timeline ul {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 5px;
  list-style: none;
}

.project-info-timeline li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.project-info-timeline li strong {
  color: var(--text);
}

.accounting-list {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.count-badge {
  display: inline-flex;
  min-width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  vertical-align: middle;
}

.accounting-archive-list {
  display: grid;
  padding: 0 16px 16px;
}

.accounting-archive-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(4, minmax(130px, 1fr)) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.accounting-archive-row:first-child {
  border-top: 0;
}

.accounting-archive-row > div,
.accounting-archive-project {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.accounting-archive-row strong,
.accounting-archive-row span,
.accounting-archive-row small {
  overflow-wrap: anywhere;
}

.accounting-archive-row small,
.accounting-archive-project span,
.accounting-archive-label {
  color: var(--muted);
  font-size: 11px;
}

.accounting-archive-label {
  font-weight: 700;
  text-transform: uppercase;
}

.project-archive-table td {
  vertical-align: top;
}

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

.accounting-card.accounting-overdue {
  border-color: #e4b0a8;
  background: #fff8f6;
  box-shadow: inset 4px 0 0 var(--danger);
}

.accounting-card.accounting-inactive {
  border-color: #dfe5dc;
  background: #f7f8f5;
}

.accounting-card.accounting-inactive h3 {
  color: var(--muted);
}

.accounting-card.accounting-inactive .table-wrap,
.accounting-card.accounting-inactive .accounting-contract-grid {
  opacity: 0.88;
}

.accounting-section-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.accounting-section-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.accounting-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.accounting-card h3 {
  margin-bottom: 3px;
  font-size: 16px;
}

.accounting-card-status {
  display: grid;
  justify-items: end;
  gap: 5px;
  text-align: right;
}

.accounting-contract-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
}

.accounting-contract-grid label,
.accounting-services-field {
  display: grid;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}

.accounting-contract-grid input:not([type="checkbox"]) {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  background: #ffffff;
  color: var(--text);
}

.accounting-service-check,
.accounting-paid-toggle {
  display: flex !important;
  align-items: center;
  grid-template-columns: none !important;
  gap: 8px;
  min-height: 36px;
  color: var(--text) !important;
}

.accounting-service-check input,
.accounting-paid-toggle input {
  width: 18px;
  min-height: 18px;
}

.accounting-paid-toggle {
  align-self: end;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.accounting-paid-note {
  padding: 9px 10px;
  border-radius: 6px;
  background: #eef6ed;
  color: var(--muted);
  font-size: 13px;
}

.accounting-table {
  min-width: 980px;
}

.accounting-table th,
.accounting-table td {
  white-space: normal;
}

.accounting-table .accounting-input {
  min-width: 160px;
}

.table-check {
  display: inline-flex;
  align-items: center;
  grid-template-columns: none;
  gap: 7px;
  color: var(--text);
  white-space: nowrap;
}

.table-check input {
  width: 18px;
  min-height: 18px;
}

.invoice-overdue-row td {
  background: #fff0ed;
}

.empty-state {
  padding: 16px;
  color: var(--muted);
}

.compact-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.compact-filter input {
  width: 220px;
}

.compact-filter select {
  width: 230px;
}

.payroll-note,
.calc-preview {
  color: var(--muted);
  background: #fbfaf7;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
}

.calc-preview {
  min-height: 40px;
}

@media (max-width: 980px) {
  .time-entry-layout,
  .time-employee-grid,
  .time-control-grid {
    grid-template-columns: 1fr;
  }

  .time-control-person + .time-control-person {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .login-overlay {
    justify-items: start;
  }

  .login-card {
    width: min(360px, calc(100vw - 56px));
    max-width: calc(100vw - 56px);
    margin-left: 14px;
  }

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    height: auto;
    padding: 12px;
  }

  .brand {
    padding: 0 4px 10px;
  }

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

  .brand-logo {
    width: 170px;
  }

  .nav {
    grid-template-columns: repeat(12, 1fr);
  }

  .nav-item {
    justify-content: center;
    padding: 0 8px;
  }

  .nav-item span {
    display: none;
  }

  .main {
    padding: 18px;
  }

  .topbar {
    display: grid;
  }

  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .project-controls {
    justify-content: stretch;
  }

  .project-tabs,
  .accounting-card header,
  .priority-focus-card header,
  .project-info-card header,
  .project-info-requirements-meta,
  .project-info-timeline li {
    display: grid;
  }

  .accounting-card-status {
    justify-items: start;
    text-align: left;
  }

  .accounting-contract-grid {
    grid-template-columns: 1fr;
  }

  .compact-filter {
    align-items: stretch;
    display: grid;
    width: 100%;
  }

  .compact-filter input,
  .compact-filter select {
    width: 100%;
  }

  .metrics,
  .designer-schedule-grid,
  .grid.two,
  .form-grid,
  .insights-grid,
  .quality-grid,
  .management-kpis,
  .priority-focus-list,
  .priority-focus-meta,
  .project-info-checklist,
  .project-info-requirements,
  .history-grid,
  .employee-grid {
    grid-template-columns: 1fr;
  }

  .schedule-row {
    grid-template-columns: 1fr;
  }

  .schedule-visual-scale,
  .schedule-visual-lane {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .schedule-visual-scale-title {
    display: none;
  }

  .schedule-visual-track {
    min-height: 58px;
  }

  .wide {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  html {
    -webkit-text-size-adjust: 100%;
  }

  body {
    overflow-x: hidden;
    font-size: 14px;
  }

  .boot-status {
    top: 8px;
    padding: 9px 10px;
    font-size: 12px;
  }

  .login-overlay {
    align-items: start;
    overflow: auto;
    padding: 14px;
  }

  .login-card {
    width: min(360px, calc(100vw - 56px));
    max-width: calc(100vw - 56px);
    margin-top: 28px;
    padding: 18px;
  }

  .wizard-summary,
  .wizard-actions,
  .pricing-metrics {
    grid-template-columns: 1fr;
  }

  .login-card img {
    width: 150px;
  }

  .login-card h1 {
    font-size: 22px;
  }

  .login-card .muted {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 12px;
    line-height: 1.35;
  }

  .app {
    display: block;
    min-height: 100dvh;
  }

  .sidebar {
    top: 0;
    padding: 8px 10px 9px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 20px rgba(32, 32, 32, 0.08);
  }

  .brand {
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 8px;
    padding: 0 0 8px;
  }

  .brand-logo {
    width: 136px;
  }

  .brand span {
    font-size: 10px;
  }

  .nav {
    display: flex;
    grid-template-columns: none;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    flex: 0 0 auto;
    width: auto;
    min-width: 72px;
    min-height: 48px;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    padding: 5px 9px;
    font-size: 18px;
    scroll-snap-align: start;
  }

  .nav-item span {
    display: block;
    max-width: 78px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10.5px;
    line-height: 1.1;
  }

  .nav-item.active {
    box-shadow: inset 0 -3px 0 var(--accent);
  }

  .main {
    padding: 14px 10px 22px;
  }

  .topbar {
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
  }

  h1 {
    font-size: 22px;
  }

  h2 {
    font-size: 15px;
  }

  .topbar p,
  .panel-note {
    font-size: 12px;
    line-height: 1.35;
  }

  .topbar-actions {
    justify-content: flex-start;
    gap: 8px;
  }

  .today,
  .user-pill,
  .small-button {
    min-height: 38px;
    padding: 7px 9px;
    border-radius: 6px;
    font-size: 12px;
  }

  .view.active {
    gap: 12px;
  }

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

  .metric {
    min-height: 92px;
    padding: 12px;
  }

  .metric strong {
    font-size: 22px;
  }

  .panel-head {
    min-height: 0;
    padding: 12px;
    gap: 8px;
  }

  .form-grid,
  .project-form,
  .task-form {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }

  .time-register-header,
  .time-employee-header {
    align-items: flex-start;
  }

  .time-register-header {
    display: grid;
  }

  .time-register-header > span {
    white-space: normal;
  }

  .time-employee-header {
    padding: 14px 12px;
  }

  .time-entry-row {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 11px 12px;
  }

  .time-entry-row time {
    grid-column: 1 / -1;
  }

  .time-entry-main {
    grid-column: 1 / -1;
  }

  .time-entry-hours {
    grid-column: 1;
  }

  .time-entry-actions {
    grid-column: 2;
  }

  .time-approval-panel {
    align-items: flex-start;
    flex-direction: column;
    padding-right: 12px;
    padding-left: 12px;
  }

  .time-approval-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .time-control-person {
    padding: 14px 12px;
  }

  .dialog-form-grid {
    grid-template-columns: 1fr;
  }

  .dialog-form-grid .wide {
    grid-column: auto;
  }

  .system-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
  }

  .system-dialog-form > header,
  .system-dialog-form > footer,
  .system-dialog-body {
    padding-right: 14px;
    padding-left: 14px;
  }

  .time-month-heading,
  .time-month-history > summary,
  .time-summary-row,
  .time-summary-total {
    padding-right: 12px;
    padding-left: 12px;
  }

  label {
    font-size: 12px;
  }

  input,
  select,
  textarea {
    min-height: 46px;
    padding: 10px 11px;
    font-size: 16px;
  }

  .primary,
  .ghost {
    min-height: 46px;
  }

  .table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-wrap table {
    min-width: 720px;
    font-size: 12px;
  }

  th,
  td {
    padding: 8px;
  }

  .table-input,
  .table-select {
    min-height: 38px;
  }

  .project-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .project-tabs::-webkit-scrollbar {
    display: none;
  }

  .project-tab {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 0 12px;
  }

  .project-controls,
  .payroll-controls,
  .month-filter {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    width: 100%;
  }

  .month-filter input {
    width: 100%;
  }

  .list-item,
  .project-info-list,
  .accounting-list,
  .insights-grid,
  .priority-focus-list,
  .history-grid {
    padding: 12px;
  }

  .insight-card,
  .priority-focus-card,
  .history-card,
  .project-info-card,
  .accounting-card,
  .employee-card {
    padding: 12px;
  }

  .schedule-row,
  .designer-panel .schedule-row,
  .schedule-board.compact .schedule-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px 12px;
  }

  .schedule-calendar-scale,
  .designer-panel .schedule-calendar-scale,
  .schedule-board.compact .schedule-calendar-scale {
    grid-template-columns: 1fr;
    padding: 8px 12px 12px;
  }

  .schedule-calendar-scale > span {
    display: none;
  }

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

  .timeline {
    height: 34px;
  }

  .timeline-label {
    padding: 0 8px;
    justify-content: flex-start;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .schedule-visual-board {
    padding: 12px;
  }

  .schedule-visual-lane {
    min-height: 90px;
    padding: 12px 0;
  }

  .schedule-visual-bar {
    height: 38px;
  }

  .schedule-visual-meta-title strong {
    white-space: normal;
  }

  .schedule-visual-note {
    gap: 6px 10px;
  }

  .today-marker::after {
    top: -22px;
    font-size: 10px;
  }

  .history-card header,
  .payroll-table-card > header {
    display: grid;
  }

  .history-stats {
    grid-template-columns: 1fr;
  }

  .mini-project {
    grid-template-columns: 1fr;
  }

  .accounting-table {
    min-width: 760px;
  }

  .payroll-table-card .table-wrap {
    overflow-x: visible;
  }

  .payroll-table-card table {
    min-width: 0;
  }

  .accounting-service-check,
  .accounting-paid-toggle,
  .table-check {
    min-height: 38px;
  }

  .employee-card {
    min-width: 0;
  }
}

@media (max-width: 380px) {
  .metrics {
    grid-template-columns: 1fr;
  }

  .brand-logo {
    width: 124px;
  }

  .nav-item {
    min-width: 68px;
  }
}

/* Solid UI refinement */
:root {
  --bg: #f3f1eb;
  --panel: #ffffff;
  --text: #24231f;
  --muted: #6e6a61;
  --line: #ded7c9;
  --accent: #a2843d;
  --accent-dark: #6f5726;
  --ink: #151515;
  --soft: #f5f0e5;
  --soft-strong: #e8dcc4;
  --danger: #a73527;
  --success: #647a54;
  --steel: #41505a;
  --blueprint: #ecf0ef;
  --shadow: 0 10px 28px rgba(21, 21, 21, 0.06);
  --shadow-soft: 0 2px 10px rgba(21, 21, 21, 0.04);
  --radius: 8px;
}

html {
  background: var(--bg);
}

body {
  background:
    linear-gradient(90deg, rgba(65, 80, 90, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(65, 80, 90, 0.028) 1px, transparent 1px),
    linear-gradient(180deg, #fbfaf7 0, var(--bg) 360px);
  background-size: 48px 48px, 48px 48px, auto;
  color: var(--text);
}

::selection {
  color: #ffffff;
  background: var(--accent-dark);
}

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

.sidebar {
  padding: 22px 14px;
  background:
    linear-gradient(180deg, #ffffff 0, #fbfaf7 68%, #f4f1eb 100%);
  border-right-color: #d8d0c0;
  box-shadow: 4px 0 22px rgba(21, 21, 21, 0.035);
}

.brand {
  margin-bottom: 12px;
  padding: 10px 10px 24px;
  border-bottom: 1px solid var(--line);
}

.brand-logo {
  width: min(204px, 100%);
}

.brand span {
  width: max-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  background: #ffffff;
  color: var(--accent-dark);
  font-weight: 700;
}

.nav {
  gap: 5px;
}

.nav-item {
  min-height: 43px;
  border-radius: var(--radius);
  color: #56524a;
  font-weight: 600;
}

.nav-icon {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--steel);
  background: rgba(255, 255, 255, 0.72);
  font-size: 15px;
  line-height: 1;
}

.nav-item.active,
.nav-item:hover {
  background: #ffffff;
  border-color: var(--line);
  color: var(--ink);
}

.nav-item.active {
  box-shadow:
    inset 3px 0 0 var(--accent),
    var(--shadow-soft);
}

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon {
  border-color: var(--soft-strong);
  color: var(--accent-dark);
  background: var(--soft);
}

.main {
  padding: 30px clamp(18px, 2.3vw, 36px);
}

.view.active {
  max-width: 1680px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  margin: -30px calc(clamp(18px, 2.3vw, 36px) * -1) 22px;
  padding: 22px clamp(18px, 2.3vw, 36px) 18px;
  background: rgba(251, 250, 247, 0.94);
  border-bottom-color: #d8d0c0;
  backdrop-filter: blur(12px);
}

h1 {
  font-size: clamp(24px, 2.1vw, 32px);
}

h2 {
  font-size: 17px;
}

.topbar p {
  max-width: 780px;
}

.topbar-actions {
  gap: 8px;
}

.today,
.user-pill {
  border-color: var(--line);
  border-radius: 999px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.today {
  color: var(--accent-dark);
  font-weight: 700;
}

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

.metric,
.panel,
.project-tabs,
.payroll-table-card,
.history-card,
.employee-card,
.project-info-card,
.accounting-card,
.priority-focus-card,
.insight-card,
.quality-card,
.wizard-card,
.pricing-card,
.management-kpi {
  border-color: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.panel,
.metric {
  background: rgba(255, 255, 255, 0.96);
}

.metric {
  min-height: 104px;
  padding: 17px;
  border-top: 3px solid #ffffff;
}

.metric span {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.metric strong {
  font-size: 28px;
}

.metric.alert {
  border-color: #e2c0bb;
  border-top-color: var(--danger);
  background: #fff9f7;
}

.panel {
  overflow: clip;
}

.panel-head {
  min-height: 60px;
  background:
    linear-gradient(180deg, #ffffff 0, #fbfaf7 100%);
  border-bottom-color: var(--line);
}

.panel-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.panel-head h2::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: var(--accent);
}

.panel-note {
  color: #716c62;
}

.list-item {
  transition:
    background 0.16s ease,
    border-color 0.16s ease;
}

.list-item:hover {
  background: #fbfaf7;
}

.form-grid,
.project-info-list,
.accounting-list,
.employee-grid,
.history-grid,
.insights-grid,
.quality-grid,
.priority-focus-list,
.wizard-list,
.pricing-recommendations,
.management-kpis {
  padding: 18px;
}

label {
  color: #5f5a50;
  font-weight: 700;
}

input,
select,
textarea {
  border-color: #d7cebe;
  border-radius: 7px;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(21, 21, 21, 0.02);
}

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

input:focus,
select:focus,
textarea:focus,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(162, 132, 61, 0.18);
  border-color: var(--accent);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: #f1eee7;
  color: #8a8375;
  cursor: not-allowed;
}

.primary,
.ghost {
  border-radius: 7px;
  font-weight: 700;
  transition:
    transform 0.12s ease,
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.primary {
  background: var(--ink);
  box-shadow: 0 8px 18px rgba(21, 21, 21, 0.16);
}

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

.ghost {
  background: #ffffff;
}

.ghost:hover {
  border-color: var(--accent);
  background: var(--soft);
}

.primary:active,
.ghost:active {
  transform: translateY(0);
}

.project-tabs {
  padding: 5px;
  background: rgba(255, 255, 255, 0.94);
}

.project-tab {
  border-radius: 7px;
  font-weight: 700;
}

.project-tab.active,
.project-tab:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
}

.project-tab.active span,
.project-tab:hover span {
  color: var(--ink);
}

.status,
.priority-badge,
.insight-badge {
  border: 1px solid rgba(162, 132, 61, 0.24);
  font-weight: 700;
}

.status.closed {
  border-color: #d6d3cd;
}

.status.attention {
  border-color: #e2c0bb;
}

.table-wrap {
  border-top: 1px solid var(--line);
  background: #ffffff;
}

table {
  font-size: 13px;
}

th,
td {
  border-bottom-color: #e7e1d6;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f1eadf;
  color: #423d34;
  font-size: 12px;
  text-transform: uppercase;
}

tbody tr {
  transition: background 0.14s ease;
}

tbody tr:hover td {
  background: #fbfaf7;
}

.table-input,
.table-select {
  border-color: #d7cebe;
}

.calc-preview,
.payroll-note,
.accounting-contract-grid,
.project-service-field,
.history-stat,
.employee-meta,
.priority-focus-meta span,
.project-info-meta span,
.pricing-metric,
.wizard-summary-item {
  background: #fbfaf7;
  border-color: var(--line);
}

.schedule-row {
  transition: background 0.14s ease;
}

.schedule-row:hover {
  background: #fbfaf7;
}

.timeline {
  background: #e9e1d4;
  border-color: #d6c9b5;
}

.timeline-bar {
  box-shadow: inset 0 -1px 0 rgba(21, 21, 21, 0.14);
}

.today-marker {
  background: var(--ink);
  box-shadow: 0 0 0 2px #ffffff;
}

.accounting-card.accounting-overdue,
.insight-card.critical,
.quality-card.critical,
.priority-focus-card.priority-1,
.payroll-loss-row td {
  background: #fff8f6;
}

.insight-card.warning,
.quality-card.warning,
.priority-focus-card.priority-2,
.wizard-card.warning,
.pricing-card.warning {
  background: #fffbf1;
}

.insight-card.opportunity,
.quality-card.opportunity,
.management-kpi.good {
  background: #f8fbf5;
}

.empty-state {
  color: var(--muted);
  background: #fbfaf7;
}

.login-overlay {
  background:
    linear-gradient(90deg, rgba(65, 80, 90, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(65, 80, 90, 0.028) 1px, transparent 1px),
    rgba(246, 244, 239, 0.96);
  background-size: 48px 48px, 48px 48px, auto;
}

.login-card {
  border-color: #d8d0c0;
  box-shadow: 0 18px 46px rgba(21, 21, 21, 0.1);
}

.login-card img {
  width: 196px;
}

.computer-table-wrap table {
  min-width: 980px;
}

.computer-row td {
  vertical-align: top;
}

.computer-row.active {
  background: #f7fbf4;
}

.computer-row.offline {
  color: var(--muted);
}

.computer-status-dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  margin-right: 6px;
  border-radius: 999px;
  background: #9b9487;
}

.computer-status-dot.active {
  background: #4d8b2d;
}

.computer-status-dot.online {
  background: #c59a2c;
}

.computer-status-dot.offline {
  background: #9b9487;
}

.task-popup {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  width: min(420px, calc(100vw - 28px));
}

.task-popup.hidden {
  display: none;
}

.task-popup-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid #d8d0c0;
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: 0 20px 54px rgba(21, 21, 21, 0.18);
}

.task-popup-card header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.task-popup-card h2 {
  margin: 0 0 4px;
}

.task-popup-body {
  display: grid;
  gap: 8px;
}

.task-popup-item {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.task-popup-item:first-child {
  border-top: 0;
  padding-top: 0;
}

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

@media (max-width: 980px) {
  .topbar {
    margin: -18px -18px 18px;
    padding: 18px;
  }

  .nav-item > span:not(.nav-icon) {
    display: none;
  }

  .nav-icon {
    display: inline-grid !important;
  }

  .nav {
    grid-template-columns: repeat(12, minmax(42px, 1fr));
  }

  .nav-item {
    min-width: 0;
  }
}

@media (max-width: 640px) {
  body {
    background:
      linear-gradient(90deg, rgba(65, 80, 90, 0.035) 1px, transparent 1px),
      linear-gradient(180deg, rgba(65, 80, 90, 0.028) 1px, transparent 1px),
      #f7f4ee;
    background-size: 38px 38px, 38px 38px, auto;
  }

  .sidebar {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
  }

  .brand {
    padding-bottom: 7px;
  }

  .brand-logo {
    width: 148px;
  }

  .brand span {
    padding: 2px 7px;
  }

  .nav-item {
    min-width: 76px;
    border-color: var(--line);
    background: #ffffff;
  }

  .nav-item > span:not(.nav-icon) {
    display: block;
  }

  .nav-icon {
    width: 24px;
    height: 24px;
    font-size: 14px;
  }

  .main {
    padding: 14px 10px 24px;
  }

  .task-popup {
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
  }

  .topbar {
    position: static;
    margin: 0 0 14px;
    padding: 0 0 12px;
    background: transparent;
    backdrop-filter: none;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .today,
  .user-pill,
  .small-button {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .small-button {
    grid-column: 1 / -1;
  }

  .metrics {
    gap: 9px;
  }

  .metric {
    min-height: 88px;
    padding: 12px;
  }

  .metric span {
    font-size: 11px;
  }

  .panel-head h2::before {
    height: 16px;
  }

  .form-grid,
  .project-info-list,
  .accounting-list,
  .employee-grid,
  .history-grid,
  .insights-grid,
  .quality-grid,
  .priority-focus-list,
  .wizard-list,
  .pricing-recommendations,
  .management-kpis {
    padding: 12px;
  }

  th {
    font-size: 11px;
  }
}

/* Compact tables: keep registers visible without horizontal page scrolling. */
.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.table-wrap table,
.accounting-table,
.computer-table-wrap table,
.payroll-table-card table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.table-wrap th,
.table-wrap td {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  padding: 7px 6px;
  line-height: 1.28;
}

.table-wrap th {
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}

.table-wrap .table-input,
.table-wrap .table-select,
.table-wrap .number-input,
.table-wrap .date-input,
.table-wrap .wide-input,
.table-wrap .accounting-input,
.table-wrap .payroll-project-select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.table-wrap select,
.table-wrap input,
.table-wrap button {
  min-width: 0;
}

.table-wrap .table-check,
.table-wrap .accounting-service-check,
.table-wrap .accounting-paid-toggle {
  min-width: 0;
  white-space: normal;
  align-items: flex-start;
}

.table-wrap td.money,
.table-wrap td.hours {
  white-space: normal;
}

.cell-note {
  overflow-wrap: anywhere;
}

.accounting-card .table-wrap,
.payroll-table-card .table-wrap {
  overflow-x: hidden;
}

.accounting-table th,
.accounting-table td,
.payroll-table-card th,
.payroll-table-card td,
.computer-table-wrap th,
.computer-table-wrap td {
  white-space: normal;
}

@media (max-width: 980px) {
  .table-wrap table,
  .accounting-table,
  .computer-table-wrap table,
  .payroll-table-card table {
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .table-wrap {
    overflow-x: hidden;
  }

  .table-wrap table,
  .accounting-table,
  .computer-table-wrap table,
  .payroll-table-card table {
    min-width: 0;
    font-size: 11px;
  }

  .table-wrap th,
  .table-wrap td {
    padding: 6px 4px;
  }
}

/* 2026 clarity update */
:root {
  --bg: #eef1ee;
  --panel: #ffffff;
  --text: #20231f;
  --muted: #626861;
  --line: #d9ded8;
  --accent: #a2843d;
  --accent-dark: #715a27;
  --ink: #171917;
  --soft: #f2f4f1;
  --soft-strong: #e7ebe6;
  --danger: #a63227;
  --success: #527344;
  --steel: #42545d;
  --shadow: 0 12px 30px rgba(28, 34, 29, 0.07);
  --shadow-soft: 0 2px 8px rgba(28, 34, 29, 0.05);
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  letter-spacing: 0;
}

.skip-link {
  position: fixed;
  z-index: 10000;
  top: 10px;
  left: 10px;
  transform: translateY(-160%);
  padding: 9px 12px;
  border-radius: 6px;
  color: #ffffff;
  background: var(--ink);
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

.sidebar {
  overflow-y: auto;
  background: #f8faf8;
  border-right-color: var(--line);
  box-shadow: 3px 0 18px rgba(28, 34, 29, 0.04);
}

.brand {
  margin-bottom: 8px;
  border-bottom-color: var(--line);
}

.nav-group-label {
  display: block;
  margin: 15px 10px 5px;
  color: #7b817a;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.nav-group-label:first-child {
  margin-top: 2px;
}

.nav-item {
  color: #4f554f;
}

.nav-item:hover {
  color: var(--ink);
  background: var(--soft);
  border-color: var(--line);
  box-shadow: none;
}

.nav-item.active {
  color: #ffffff;
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-item.active .nav-icon {
  color: #f2deb0;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.14);
}

.main {
  width: 100%;
}

.view.active {
  width: 100%;
  max-width: 1640px;
  margin: 0 auto;
}

.topbar {
  background: rgba(255, 255, 255, 0.96);
  border-bottom-color: var(--line);
  box-shadow: 0 5px 16px rgba(28, 34, 29, 0.04);
}

h1 {
  font-size: 28px;
}

.save-status {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #ffffff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.save-status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--success);
}

.save-status[data-state="pending"] .save-status-dot,
.save-status[data-state="saving"] .save-status-dot {
  background: var(--accent);
}

.save-status[data-state="warning"] .save-status-dot {
  background: #c18425;
}

.save-status[data-state="error"] {
  color: var(--danger);
  border-color: #e2bcb7;
  background: #fff8f7;
}

.save-status[data-state="error"] .save-status-dot {
  background: var(--danger);
}

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

.quick-actions button {
  min-width: 0;
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.quick-actions button:hover {
  border-color: #bfa86f;
  background: #fffdf7;
}

.quick-action-icon {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 7px;
  color: #ffffff;
  background: var(--ink);
  font-size: 17px;
  font-weight: 800;
}

.quick-actions button > span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

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

.quick-actions small {
  color: var(--muted);
  font-size: 11px;
}

.metrics {
  gap: 10px;
}

.metric {
  min-height: 96px;
  border-top-color: var(--accent);
  box-shadow: var(--shadow-soft);
}

.metric:nth-child(2n) {
  border-top-color: var(--steel);
}

.metric:nth-child(3n) {
  border-top-color: var(--success);
}

.panel,
.metric {
  background: #ffffff;
}

.panel-head {
  background: #fbfcfa;
}

th {
  background: #edf1ed;
  color: #414841;
}

.dashboard-finance-note {
  padding: 0;
  background: #ffffff;
}

.dashboard-finance-note summary {
  padding: 11px 14px;
  color: #4e564e;
  font-weight: 700;
  cursor: pointer;
}

.dashboard-finance-note p {
  padding: 0 14px 13px;
}

.password-visibility {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.password-visibility input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

.login-overlay {
  background: rgba(238, 241, 238, 0.97);
}

.login-card {
  border-top: 4px solid var(--accent);
  box-shadow: 0 20px 50px rgba(28, 34, 29, 0.14);
}

button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(162, 132, 61, 0.28);
  outline-offset: 2px;
}

@media (max-width: 980px) {
  .nav-group-label {
    display: none;
  }

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

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

.accounting-archive-row .small-button {
    justify-self: start;
  }
}

/* PENS integration and external specialist contacts */
.external-employee-form {
  align-items: end;
}

.external-employee-card {
  border-left: 4px solid var(--accent);
}

.external-access-note {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 11px;
  background: var(--soft);
}

.external-access-note span {
  color: var(--muted);
  font-size: 12px;
}

.project-assignee-stack,
.project-assignee-row {
  display: grid;
  gap: 5px;
}

.project-assignee-row {
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
}

.project-assignee-row > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.registry-pens-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border-top: 1px solid var(--line);
  padding-top: 5px;
}

.tiny-button {
  min-height: 26px;
  padding: 2px 7px;
  font-size: 11px;
}

.pens-project-panel,
.questionnaire-project-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(260px, auto);
  align-items: center;
  gap: 14px;
  border: 1px solid #d8ccb0;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: 12px;
  background: #fbfaf7;
}

.pens-project-panel.warning,
.questionnaire-project-panel.warning {
  border-color: #e2c0bb;
  border-left-color: var(--danger);
  background: #fff9f7;
}

.pens-project-panel > div:first-child,
.questionnaire-project-panel > div:first-child {
  display: grid;
  gap: 2px;
}

.pens-project-panel small,
.questionnaire-project-panel small {
  color: var(--muted);
}

.pens-project-actions,
.questionnaire-project-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.questionnaire-contract-create {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.questionnaire-contract-create label {
  display: grid;
  gap: 4px;
  min-width: min(240px, 100%);
  color: var(--muted);
  font-size: 12px;
  text-align: left;
}

.questionnaire-contract-create input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 6px 9px;
  background: #ffffff;
  color: var(--ink);
}

.button-link {
  text-decoration: none;
}

.error-text {
  color: var(--danger) !important;
}

.pens-results-dialog {
  width: min(980px, calc(100vw - 32px));
}

/* Collaboration workspace */
.count-badge {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  margin-left: 6px;
  padding: 0 6px;
  place-items: center;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  vertical-align: 2px;
}

.activity-center-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.activity-center-item {
  position: relative;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.activity-center-item:hover,
.activity-center-item:focus-visible {
  border-color: var(--accent);
  background: #fffdf8;
}

.activity-center-item.unread {
  border-left: 3px solid var(--accent);
}

.activity-center-item.danger {
  border-left-color: var(--danger);
}

.activity-center-item.warning {
  border-left-color: #b18a35;
}

.activity-center-item > span:last-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.activity-center-item small,
.activity-center-item span span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.activity-center-dot {
  width: 7px;
  height: 7px;
  margin-top: 6px;
  border-radius: 50%;
  background: #b9b9b3;
}

.activity-center-item.unread .activity-center-dot {
  background: var(--accent);
}

.segmented-control {
  display: inline-grid;
  grid-auto-flow: column;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.segmented-control button {
  min-height: 34px;
  padding: 6px 12px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.segmented-control button:last-child {
  border-right: 0;
}

.segmented-control button.active {
  background: var(--text);
  color: #fff;
}

.task-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
  padding: 0 16px 16px;
}

.task-board[hidden],
.task-list-view[hidden] {
  display: none;
}

.task-board-column {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f7f4;
}

.task-board-column > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.task-board-column > header span {
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
}

.task-board-dropzone {
  min-height: 94px;
  padding: 8px;
}

.task-board-card {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
  padding: 11px;
  border: 1px solid #dedbd2;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(29, 29, 27, 0.05);
  cursor: grab;
}

.task-board-card:last-child {
  margin-bottom: 0;
}

.task-board-card.late {
  border-left: 3px solid var(--danger);
}

.task-board-card.blocked {
  border-left: 3px solid #b18a35;
  background: #fffdf7;
}

.task-board-card.done {
  opacity: 0.76;
}

.task-card-topline,
.task-card-meta,
.task-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.task-card-meta,
.task-dependency,
.task-blocked-reason {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.task-blocked-reason {
  padding: 7px 8px;
  border-left: 2px solid #b18a35;
  background: #fff8e9;
  color: #72571e;
}

.task-priority-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8b9189;
}

.task-priority-dot.high {
  background: #b18a35;
}

.task-priority-dot.urgent {
  background: var(--danger);
}

.icon-button {
  display: inline-grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.icon-button.active {
  border-color: var(--accent);
  color: var(--accent-dark, #7d5e1d);
  background: #fff8e8;
}

.icon-button:disabled {
  opacity: 0.35;
  cursor: default;
}

.task-project-link {
  padding: 0;
  border: 0;
  background: none;
  color: #73581e;
  font-size: 12px;
  text-align: left;
  text-decoration: underline;
  cursor: pointer;
}

.task-checklist {
  display: grid;
  gap: 5px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
}

.task-checklist > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.task-checklist label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  color: var(--text);
  font-size: 12px;
}

.task-board-empty {
  padding: 14px 4px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.table-action-stack {
  display: grid;
  gap: 5px;
}

.project-info-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-workspace-dialog {
  width: min(1100px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
}

.project-workspace-dialog .system-dialog-form {
  min-height: min(760px, calc(100dvh - 32px));
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.workspace-tabs {
  display: flex;
  gap: 2px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfaf7;
}

.workspace-tabs button {
  padding: 11px 14px 9px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.workspace-tabs button.active {
  border-bottom-color: var(--accent);
  color: var(--text);
}

.project-workspace-body {
  min-height: 0;
  overflow-y: auto;
  background: #f7f7f4;
}

.workspace-pane {
  display: none;
  gap: 12px;
}

.workspace-pane.active {
  display: grid;
}

.workspace-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.workspace-form .wide {
  grid-column: 1 / -1;
}

.workspace-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.workspace-form-actions > span {
  margin-right: auto;
}

.workspace-feed,
.workspace-pinned,
.workspace-document-list,
.workspace-approval-list {
  display: grid;
  gap: 9px;
}

.workspace-pinned:empty {
  display: none;
}

.workspace-pinned {
  padding: 11px;
  border: 1px solid #d9c28d;
  border-radius: 8px;
  background: #fff9eb;
}

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

.workspace-message.compact {
  padding: 10px 12px;
}

.workspace-message > header,
.workspace-approval-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.workspace-message > header > span,
.workspace-approval-card > header > span {
  display: grid;
  gap: 2px;
}

.workspace-message small,
.workspace-approval-card small,
.workspace-document-version small,
.workspace-document-group summary small {
  color: var(--muted);
  font-size: 11px;
}

.workspace-message p,
.workspace-approval-card p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.workspace-message-actions,
.workspace-approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.workspace-replies {
  display: grid;
  gap: 7px;
  margin: 2px 0 0 20px;
  padding-left: 10px;
  border-left: 2px solid var(--line);
}

.workspace-mention {
  color: #73581e;
  font-weight: 800;
}

.workspace-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid #d9c28d;
  border-radius: 999px;
  background: #fff9eb;
  color: #72571e;
  font-size: 10px;
  font-weight: 800;
}

.workspace-badge.approved {
  border-color: #9bb595;
  background: #edf6eb;
  color: #35602f;
}

.workspace-badge.returned,
.workspace-badge.rejected {
  border-color: #e2aaa0;
  background: #fff0ed;
  color: var(--danger);
}

.workspace-document-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.workspace-document-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
}

.workspace-document-group > summary > span:first-child,
.workspace-document-version > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.workspace-document-versions {
  border-top: 1px solid var(--line);
}

.workspace-document-version {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.workspace-document-version:last-child {
  border-bottom: 0;
}

.workspace-document-version.archived {
  opacity: 0.56;
}

.workspace-document-version > div {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.workspace-approval-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 3px solid #b18a35;
  border-radius: 8px;
  background: #fff;
}

.workspace-approval-card.approved {
  border-left-color: #4f7d47;
}

.workspace-approval-card.returned,
.workspace-approval-card.rejected {
  border-left-color: var(--danger);
}

.workspace-approval-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--muted);
  font-size: 12px;
}

.workspace-approval-history {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 9px 12px 9px 28px;
  background: #f7f7f4;
}

.workspace-approval-history li span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 980px) {
  .task-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .activity-center-list,
  .task-board,
  .workspace-document-form,
  .workspace-approval-form {
    grid-template-columns: 1fr;
  }

  .activity-center-panel .panel-head,
  .workspace-form-actions,
  .workspace-document-version {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace-form .wide {
    grid-column: auto;
  }

  .workspace-tabs {
    padding: 0 8px;
    overflow-x: auto;
  }

  .workspace-tabs button {
    flex: 1 0 auto;
  }

  .project-workspace-dialog {
    width: calc(100vw - 12px);
    max-height: calc(100dvh - 12px);
  }

  .project-workspace-dialog .system-dialog-form {
    min-height: calc(100dvh - 12px);
  }

  .workspace-replies {
    margin-left: 6px;
  }

  .workspace-document-version > div {
    width: 100%;
  }

  .workspace-document-version > div > * {
    flex: 1;
    text-align: center;
  }
}

.pens-result-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.pens-result-summary > div {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fbfaf7;
}

.pens-result-summary span,
.pens-result-summary small {
  color: var(--muted);
  font-size: 12px;
}

.pens-result-section {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

.pens-result-section h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
  font-size: 16px;
}

.pens-result-section h3 span {
  min-width: 28px;
  color: var(--accent-dark);
}

.pens-result-section dl {
  margin: 0;
}

.pens-result-section dl > div {
  display: grid;
  grid-template-columns: minmax(220px, 40%) minmax(0, 1fr);
  gap: 12px;
  border-top: 1px solid #eee9df;
  padding: 8px 0;
}

.pens-result-section dt {
  color: var(--muted);
}

.pens-result-section dd {
  margin: 0;
  font-weight: 600;
  white-space: pre-wrap;
}

@media (max-width: 900px) {
  .pens-project-panel,
  .questionnaire-project-panel {
    grid-template-columns: 1fr auto;
  }

  .pens-project-actions,
  .questionnaire-project-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

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

@media (max-width: 620px) {
  .pens-project-panel,
  .questionnaire-project-panel,
  .pens-result-summary {
    grid-template-columns: 1fr;
  }

  .pens-project-actions,
  .questionnaire-project-actions {
    grid-column: auto;
  }

  .pens-project-actions > *,
  .questionnaire-project-actions > * {
    width: 100%;
    justify-content: center;
  }

  .questionnaire-contract-create,
  .questionnaire-contract-create label,
  .questionnaire-contract-create button {
    width: 100%;
  }

  .pens-result-section dl > div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

@media (max-width: 640px) {
  h1 {
    font-size: 22px;
  }

  .sidebar {
    overflow-y: visible;
    background: #ffffff;
  }

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

  .save-status,
  .user-pill {
    grid-column: auto;
    min-width: 0;
    white-space: normal;
  }

  .today {
    display: none;
  }

  .topbar-actions .small-button {
    grid-column: auto;
  }

  .quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .accounting-archive-list {
    padding: 0 12px 12px;
  }

  .accounting-archive-row {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .quick-actions button {
    min-height: 62px;
    padding: 9px;
  }

  .quick-action-icon {
    width: 30px;
    height: 30px;
  }

  .quick-actions strong,
  .quick-actions small {
    white-space: normal;
  }
}

@media (max-width: 380px) {
  .quick-actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
