.management-header {
  align-items: flex-end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 24px;
}

.management-header h1 {
  color: var(--ink);
  font-size: 30px;
  line-height: 1.15;
  margin: 4px 0 7px;
}

.management-header p:not(.section-label) {
  color: var(--muted);
  margin: 0;
}

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

.button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  justify-content: center;
  line-height: 1;
  min-height: 38px;
  padding: 0 15px;
  text-decoration: none;
}

.button-primary {
  background: #166534;
  color: #fff;
}

.button-primary:hover {
  background: #14532d;
}

.button-secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.button-secondary:hover {
  background: #f8fafc;
  border-color: #aeb8c6;
}

.button-danger {
  background: #fff;
  border-color: #fecaca;
  color: #b42318;
}

.button-danger:hover {
  background: #fff7f7;
}

.button-wide {
  width: 100%;
}

.filter-bar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 14px;
}

.filter-bar input,
.filter-bar select {
  min-width: 210px;
}

.filter-bar input[type="search"] {
  flex: 1 1 280px;
  max-width: 440px;
}

.period-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.period-buttons .button { padding: 8px 10px; }
.period-buttons .button.selected { background: #23845b; border-color: #23845b; color: #fff; }

.timeline-filter {
  align-items: stretch;
  flex-direction: column;
  margin-bottom: 24px;
}

.timeline-filter input[type="datetime-local"] { width: 100%; }
.timeline-filter .button { align-self: flex-start; }

input,
select,
textarea {
  background: #fff;
  border: 1px solid #cbd2dc;
  border-radius: 5px;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
}

textarea {
  line-height: 1.45;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #23845b;
  box-shadow: 0 0 0 3px rgb(35 132 91 / 12%);
  outline: 0;
}

input[type="checkbox"] {
  min-height: auto;
  width: 17px;
}

.report-builder { padding: 24px; }

.report-period-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(240px, 1.6fr) repeat(2, minmax(170px, 1fr));
}

.report-period-grid label > span,
.report-options-heading p {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin: 0 0 6px;
}

.report-options-heading {
  align-items: end;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  margin-top: 22px;
  padding-top: 20px;
}

.report-options-heading h2 { font-size: 17px; margin: 0 0 4px; }
.report-selection-actions { display: flex; gap: 12px; }
.report-selection-actions button {
  background: none;
  border: 0;
  color: #166534;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 0;
}

.report-field-groups {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  margin-top: 16px;
}

.report-field-groups fieldset {
  border: 1px solid var(--line);
  border-radius: 6px;
  margin: 0;
  padding: 13px 14px 10px;
}

.report-field-groups legend {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  padding: 0 5px;
}

.report-checkbox {
  align-items: flex-start;
  color: #475467;
  display: flex;
  font-size: 13px;
  gap: 8px;
  margin: 8px 0;
}

.report-checkbox input { flex: 0 0 auto; margin-top: 1px; }
.report-actions { margin-top: 20px; }
.report-preview-scroll {
  max-height: min(65vh, 680px);
  overflow: auto;
}

.report-preview-table {
  min-width: max-content;
  width: 100%;
}

.report-preview-table th {
  max-width: 190px;
  min-width: 120px;
  position: sticky;
  top: 0;
  white-space: normal;
  z-index: 2;
}

.report-preview-table td {
  height: 44px;
  max-width: 230px;
  min-width: 120px;
  padding-bottom: 9px;
  padding-top: 9px;
}

.report-preview-table th:first-child,
.report-preview-table td:first-child {
  left: 0;
  min-width: 190px;
  position: sticky;
}

.report-preview-table th:first-child { z-index: 3; }
.report-preview-table td:first-child { background: #fff; z-index: 1; }
.report-preview-table tbody tr:nth-child(even) td:first-child { background: #fbfcfc; }

.report-preview-value,
.report-employee strong {
  display: block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-value-duration,
.report-value-integer {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.management-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  min-width: 0;
  padding: 20px;
}

.management-panel > .table-wrap {
  margin: -20px;
}

.management-panel > .table-wrap + .pagination {
  margin-top: 20px;
}

.data-table {
  min-width: 760px;
  width: 100%;
}

.data-table th {
  background: #f8fafb;
  color: #687385;
  font-size: 11px;
  font-weight: 700;
  padding: 11px 14px;
  text-align: left;
  text-transform: uppercase;
}

.data-table td {
  border-top: 1px solid #edf0f3;
  color: #344054;
  font-size: 13px;
  padding: 12px 14px;
  vertical-align: middle;
}

.data-table td > strong,
.data-table td > small {
  display: block;
}

.data-table td > small {
  color: var(--muted);
  margin-top: 3px;
}

.comparison-table th { white-space: nowrap; }
.muted-note { color: var(--muted); font-size: 13px; margin: -4px 0 16px; }

.data-table code {
  background: #f5f7f8;
  border-radius: 3px;
  display: block;
  font-size: 11px;
  max-width: 340px;
  overflow: hidden;
  padding: 5px 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-link,
.table-action {
  background: none;
  border: 0;
  color: #166534;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 0;
  text-decoration: none;
}

.row-link:hover,
.table-action:hover {
  text-decoration: underline;
}

.status-tag {
  background: #f2f4f7;
  border-radius: 4px;
  color: #475467;
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 6px 8px;
  white-space: nowrap;
}

.status-active,
.status-approved,
.status-manager_confirmed {
  background: #e8f5ed;
  color: #166534;
}

.status-submitted,
.status-employee_classified {
  background: #fff7df;
  color: #8a5800;
}

.status-returned,
.status-revoked,
.status-blocked {
  background: #fff0f0;
  color: #a6302a;
}

.status-adjusted {
  background: #e7f4f4;
  color: #12666b;
}

.status-draft,
.status-auto {
  background: #eef1f4;
  color: #53606f;
}

.pagination {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  justify-content: space-between;
  padding-top: 18px;
}

.load-more {
  display: flex;
  justify-content: center;
  padding-top: 20px;
}

.pagination a {
  color: #166534;
  font-weight: 700;
  text-decoration: none;
}

.tabs {
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 22px;
  margin-bottom: 14px;
  overflow-x: auto;
}

.tabs a {
  border-bottom: 2px solid transparent;
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  padding: 0 1px 10px;
  text-decoration: none;
}

.tabs a.selected {
  border-bottom-color: #23845b;
  color: #166534;
}

.detail-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
}

.panel-heading {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 17px;
}

.panel-heading h2 {
  color: var(--ink);
  font-size: 17px;
  margin: 0;
}

.panel-heading > span {
  color: var(--muted);
  font-size: 12px;
}

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

.detail-list > div {
  border-top: 1px solid #edf0f3;
  min-width: 0;
  padding: 12px 8px 12px 0;
}

.detail-list .detail-wide {
  grid-column: 1 / -1;
}

.detail-list dt {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.detail-list dd {
  color: var(--ink);
  font-size: 13px;
  margin: 0;
  overflow-wrap: anywhere;
}

.detail-list a {
  color: #166534;
  font-weight: 700;
}

.action-panel > p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.section-gap {
  margin-top: 16px;
}

.note {
  background: #f8fafb;
  border-left: 3px solid #93a1b3;
  margin-top: 16px;
  padding: 12px 14px;
}

.note p {
  color: #475467;
  font-size: 13px;
  margin: 5px 0 0;
}

.compact-list {
  display: grid;
}

.compact-list > a {
  align-items: center;
  border-top: 1px solid #edf0f3;
  color: var(--ink);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 12px 0;
  text-decoration: none;
}

.compact-list > a:first-child {
  border-top: 0;
}

.compact-list span > strong,
.compact-list span > small {
  display: block;
}

.compact-list span > small {
  color: var(--muted);
  margin-top: 3px;
}

.entity-form {
  display: grid;
  gap: 14px;
}

.form-panel {
  max-width: 760px;
}

.form-field {
  display: grid;
  gap: 6px;
}

.form-field > label,
.entity-form > label {
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

.form-field > small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.form-field-check {
  align-items: center;
  display: grid;
  grid-template-columns: 24px 1fr;
}

.form-field-check > label {
  grid-column: 2;
  grid-row: 1;
}

.form-field-check > input {
  grid-column: 1;
  grid-row: 1;
}

.form-field-check > small,
.form-field-check > .field-error {
  grid-column: 2;
}

.form-field ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 15px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.form-field ul label {
  align-items: center;
  display: inline-flex;
  gap: 5px;
}

.field-error,
.form-error {
  color: #b42318;
  font-size: 12px;
}

.form-error ul {
  margin: 0;
  padding-left: 18px;
}

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

.timeline article {
  display: grid;
  gap: 12px;
  grid-template-columns: 10px 1fr;
  padding: 8px 0;
}

.timeline article > i {
  background: #23845b;
  border-radius: 50%;
  height: 8px;
  margin-top: 4px;
  width: 8px;
}

.timeline strong,
.timeline small {
  display: block;
}

.timeline small {
  color: var(--muted);
  margin-top: 3px;
}

.timeline p {
  color: #475467;
  margin: 6px 0 0;
}

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

.settings-item {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  min-height: 94px;
  padding: 18px;
  text-decoration: none;
}

.settings-item:hover {
  border-color: #98a5b5;
}

.settings-item strong,
.settings-item small {
  display: block;
}

.settings-item small {
  color: var(--muted);
  line-height: 1.4;
  margin-top: 5px;
}

.settings-item b {
  color: #166534;
  font-size: 22px;
}

.analytics-kpis {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.analytics-kpis article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
}

.analytics-kpis span,
.analytics-kpis strong {
  display: block;
}

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

.analytics-kpis strong {
  color: var(--ink);
  font-size: 25px;
  margin-top: 7px;
}

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

.chart-panel-wide { grid-column: 1 / -1; }

.bar-chart { display: grid; gap: 13px; }

.bar-chart-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(120px, 1fr) minmax(110px, 2fr) 38px;
}

.bar-chart-row strong,
.bar-chart-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-chart-row strong { color: var(--ink); font-size: 13px; }
.bar-chart-row small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.bar-chart-row > span { color: var(--muted); font-size: 12px; text-align: right; }
.bar-chart-track { background: #edf1f4; border-radius: 20px; height: 9px; overflow: hidden; }
.bar-chart-track i { background: #23845b; border-radius: inherit; display: block; height: 100%; min-width: 2px; }

.daily-chart { align-items: end; display: flex; gap: 8px; height: 180px; overflow-x: auto; padding-top: 20px; }
.daily-chart-item { align-items: center; display: flex; flex: 1 0 38px; flex-direction: column; height: 100%; justify-content: end; min-width: 38px; }
.daily-chart-value { color: var(--muted); font-size: 10px; margin-bottom: 5px; white-space: nowrap; }
.daily-chart-bar-wrap { align-items: end; background: #edf1f4; border-radius: 4px 4px 0 0; display: flex; height: 120px; width: 22px; }
.daily-chart-bar-wrap i { background: #23845b; border-radius: 4px 4px 0 0; display: block; width: 100%; }
.daily-chart-item small { color: var(--muted); font-size: 10px; margin-top: 6px; }

@media (max-width: 760px) {
  .analytics-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-grid { grid-template-columns: 1fr; }
  .chart-panel-wide { grid-column: auto; }
}

.messages {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.message {
  background: #eef7f1;
  border: 1px solid #b9dfc6;
  border-radius: 5px;
  color: #166534;
  font-size: 13px;
  padding: 10px 13px;
}

.message-error {
  background: #fff3f2;
  border-color: #f6c8c4;
  color: #a6302a;
}

.sidebar-footer > strong {
  color: #d7dce3;
  display: block;
  font-size: 12px;
  margin-top: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.language-form {
  display: grid;
  gap: 4px;
  margin-top: 12px;
}

.language-form label {
  color: #aeb7c3;
  font-size: 11px;
}

.language-form select {
  background: #252d38;
  border: 1px solid #46515f;
  border-radius: 4px;
  color: #fff;
  font: inherit;
  font-size: 12px;
  min-height: 32px;
  padding: 4px 7px;
  width: 100%;
}

.logout-link {
  background: none;
  border: 0;
  color: #aeb7c3;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  margin-top: 5px;
  padding: 0;
}

.logout-link:hover {
  color: #fff;
}

.login-page {
  align-items: center;
  background: #f1f3f5;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-panel {
  background: #fff;
  border: 1px solid #d9dee5;
  border-radius: 6px;
  display: grid;
  gap: 24px;
  max-width: 400px;
  padding: 30px;
  width: 100%;
}

.login-panel .brand {
  color: var(--ink);
  padding: 0;
}

.login-panel h1 {
  color: var(--ink);
  font-size: 26px;
  margin: 5px 0 0;
}

.language-form-login {
  margin-top: 0;
}

.language-form-login label {
  color: var(--muted);
}

.language-form-login select {
  background: #fff;
  border-color: #cfd5dd;
  color: var(--ink);
}

@media (max-width: 960px) {
  .detail-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .report-field-groups { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  .report-period-grid,
  .report-field-groups { grid-template-columns: 1fr; }

  .management-header {
    align-items: stretch;
    flex-direction: column;
  }

  .management-header h1 {
    font-size: 25px;
  }

  .filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-bar input,
  .filter-bar select {
    max-width: none;
    width: 100%;
  }


  .management-panel {
    padding: 15px;
  }

  .management-panel > .table-wrap {
    margin: -15px;
  }

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

  .detail-list .detail-wide {
    grid-column: auto;
  }

  .login-panel {
    padding: 22px;
  }
}
