.system-holidays-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0 auto;
  max-width: var(--system-admin-page-max-width, 1320px);
  padding: 18px 20px 96px;
}

.system-holidays-workbar {
  align-items: center;
  background: #ffffff;
  border: 1px solid #d8e1e7;
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px;
}

.system-holidays-filters {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.system-holidays-actions {
  align-items: end;
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.system-holidays-summary {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.system-holidays-metric {
  align-items: center;
  background: #f5f8fa;
  border: 1px solid #d8e1e7;
  border-radius: 6px;
  display: flex;
  gap: 10px;
  min-height: 40px;
  padding: 8px 12px;
}

.system-holidays-metric span,
.system-holidays-search span,
.system-holidays-filter span,
.system-holidays-field span {
  color: #5b6b76;
  font-size: 12px;
  font-weight: 700;
}

.system-holidays-metric strong {
  color: #1d2b34;
  font-size: 15px;
  font-weight: 800;
}

.system-holidays-search,
.system-holidays-filter,
.system-holidays-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.system-holidays-search input,
.system-holidays-filter input,
.system-holidays-filter select,
.system-holidays-field input,
.system-holidays-field select,
.system-holidays-field textarea {
  background: #ffffff;
  border: 1px solid #c8d3db;
  border-radius: 6px;
  color: #1f2d36;
  font-size: 14px;
  min-height: 38px;
  padding: 8px 10px;
}

.system-holidays-field textarea {
  min-height: 72px;
  resize: vertical;
}

.system-holidays-search input {
  width: 260px;
}

.system-holidays-filter input {
  width: 96px;
}

.system-holidays-filter select {
  width: 128px;
}

.system-holidays-search input:focus,
.system-holidays-filter input:focus,
.system-holidays-filter select:focus,
.system-holidays-field input:focus,
.system-holidays-field select:focus,
.system-holidays-field textarea:focus {
  border-color: #1f7a6c;
  box-shadow: 0 0 0 3px rgba(31, 122, 108, 0.16);
  outline: none;
}

.system-holidays-icon-button {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 18px;
  height: 38px;
  justify-content: center;
  min-height: 38px;
  padding: 0;
  width: 38px;
}

.system-holidays-icon-button svg,
.system-holidays-row-button svg,
.system-holidays-dialog-close svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.system-holidays-icon-button svg {
  height: 18px;
  width: 18px;
}

#addHolidayButton {
  order: 1;
}

#reloadHolidaysButton {
  order: 2;
}

.system-holidays-table-section {
  background: #ffffff;
  border: 1px solid #c8d3db;
  border-radius: 8px;
  overflow: hidden;
}

.system-holidays-section-header {
  align-items: center;
  background: #eef6f3;
  border-bottom: 1px solid #c4d7d1;
  display: flex;
  justify-content: space-between;
  padding: 14px 16px;
}

.system-holidays-section-header h2 {
  align-items: center;
  color: #173f38;
  display: flex;
  font-size: 17px;
  gap: 8px;
  margin: 0;
}

.system-holidays-section-header h2::before {
  background: #1f7a6c;
  border-radius: 999px;
  content: "";
  display: inline-block;
  height: 18px;
  width: 4px;
}

.system-holidays-table-wrap {
  overflow-x: auto;
}

.system-holidays-table {
  border-collapse: collapse;
  min-width: 1040px;
  table-layout: fixed;
  width: 100%;
}

.system-holidays-table th,
.system-holidays-table td {
  border-bottom: 1px solid #d4dee5;
  padding: 10px 12px;
  text-align: center;
  vertical-align: middle;
}

.system-holidays-table th:not(:last-child),
.system-holidays-table td:not(:last-child) {
  border-right: 1px solid #d4dee5;
}

.system-holidays-table th {
  background: #f5f8fa;
  color: #4f606c;
  font-size: 12px;
  font-weight: 800;
  position: static;
  top: auto;
  white-space: nowrap;
  z-index: auto;
}

.system-holidays-table td {
  color: #22313b;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.system-holidays-table th:nth-child(1),
.system-holidays-table td:nth-child(1) {
  width: 112px;
  white-space: nowrap;
}

.system-holidays-table th:nth-child(2),
.system-holidays-table td:nth-child(2) {
  width: 58px;
}

.system-holidays-table th:nth-child(3),
.system-holidays-table td:nth-child(3) {
  width: 108px;
}

.system-holidays-table th:nth-child(4),
.system-holidays-table td:nth-child(4) {
  width: 116px;
}

.system-holidays-table th:nth-child(5),
.system-holidays-table td:nth-child(5) {
  width: 190px;
  text-align: left;
}

.system-holidays-table th:nth-child(6),
.system-holidays-table td:nth-child(6) {
  width: 82px;
}

.system-holidays-table th:nth-child(7),
.system-holidays-table td:nth-child(7) {
  width: 210px;
  text-align: left;
}

.system-holidays-table th:nth-child(8),
.system-holidays-table td:nth-child(8) {
  width: 92px;
}

.system-holidays-name-cell,
.system-holidays-note-cell {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-holidays-empty {
  color: #6a7882;
  height: 80px;
  text-align: center;
  vertical-align: middle;
}

.system-holidays-badge {
  background: #eef3f6;
  border: 1px solid #cfdbe3;
  border-radius: 999px;
  color: #41525e;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 5px 8px;
  white-space: nowrap;
}

.system-holidays-badge.is-active,
.system-holidays-badge.is-holiday {
  background: #e8f5f1;
  border-color: #9ccfc0;
  color: #166657;
}

.system-holidays-badge.is-inactive {
  background: #f6eeee;
  border-color: #e1bcbc;
  color: #8b3434;
}

.system-holidays-badge.is-special {
  background: #eef2fb;
  border-color: #b9c9eb;
  color: #34558f;
}

.system-holidays-badge.is-workday {
  background: #fff3dc;
  border-color: #e7c178;
  color: #806019;
}

.system-holidays-badge.is-prescribed,
.system-holidays-badge.is-statutory {
  background: #edf4f7;
  border-color: #b5ccd7;
  color: #2f6074;
}

.system-holidays-badge.is-auto {
  background: #f4f6f7;
  border-color: #d5dde2;
  color: #5a6871;
}

.system-holidays-row-actions {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  justify-content: center;
}

.system-holidays-row-button {
  align-items: center;
  background: #eaf4f7;
  border: 1px solid #a7cbd6;
  border-radius: 6px;
  color: #2c5f6f;
  cursor: pointer;
  display: inline-flex;
  height: 30px;
  justify-content: center;
  padding: 0;
  width: 30px;
}

.system-holidays-row-button:hover {
  background: #d8edf3;
  border-color: #8ebdca;
}

.system-holidays-row-button.is-danger {
  background: #f8eeee;
  border-color: #e3bcbc;
  color: #8f3434;
}

.system-holidays-row-button.is-danger:hover {
  background: #f1dddd;
  border-color: #d9a6a6;
}

.system-holidays-row-button svg {
  height: 16px;
  width: 16px;
}

.system-holidays-dialog {
  border: 0;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(21, 32, 38, 0.24);
  color: #20303a;
  max-width: min(820px, calc(100vw - 32px));
  padding: 0;
  width: 820px;
}

.system-holidays-dialog::backdrop {
  background: rgba(12, 24, 31, 0.42);
}

.system-holidays-dialog form {
  display: flex;
  flex-direction: column;
  max-height: min(88vh, 720px);
}

.system-holidays-dialog-header {
  align-items: center;
  background: #eef6f3;
  border-bottom: 1px solid #c4d7d1;
  display: flex;
  justify-content: space-between;
  padding: 14px 16px;
}

.system-holidays-dialog-header h2 {
  color: #173f38;
  font-size: 18px;
  margin: 0;
}

.system-holidays-dialog-close {
  align-items: center;
  background: transparent;
  border: 1px solid #b7cac4;
  border-radius: 6px;
  color: #31514b;
  cursor: pointer;
  display: inline-flex;
  height: 34px;
  justify-content: center;
  padding: 0;
  width: 34px;
}

.system-holidays-dialog-close:hover {
  background: #dcece7;
}

.system-holidays-dialog-close svg {
  height: 18px;
  width: 18px;
}

.system-holidays-dialog-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 150px 150px 170px 1fr;
  overflow-y: auto;
  padding: 16px;
}

.system-holidays-field-wide {
  grid-column: span 2;
}

.system-holidays-toggle {
  align-items: center;
  background: #f7fafb;
  border: 1px solid #d5dee4;
  border-radius: 6px;
  color: #334550;
  display: flex;
  font-size: 13px;
  font-weight: 700;
  gap: 8px;
  grid-column: span 2;
  min-height: 38px;
  padding: 8px 10px;
}

.system-holidays-toggle input {
  height: 16px;
  width: 16px;
}

.system-holidays-dialog-footer {
  align-items: center;
  border-top: 1px solid #d8e1e7;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px 16px 14px;
}

.system-holidays-dialog-footer .status {
  color: #657682;
  font-size: 12px;
  font-weight: 700;
  margin: 0;
}

.system-holidays-dialog-footer .status.error {
  color: #a13b3b;
}

.system-holidays-dialog-footer .status.loading {
  color: #2c5f6f;
}

.system-holidays-dialog-footer button[type="submit"] {
  background: #2c7892;
  border: 1px solid #25677d;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  min-height: 38px;
  min-width: 96px;
  padding: 8px 16px;
}

.system-holidays-dialog-footer button[type="submit"]:hover {
  background: #24677d;
}

.system-holidays-dialog-footer button[type="submit"]:disabled {
  cursor: wait;
  opacity: 0.64;
}

@media (max-width: 960px) {
  .system-holidays-main {
    padding: 12px 12px 80px;
  }

  .system-holidays-workbar,
  .system-holidays-actions,
  .system-holidays-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .system-holidays-actions {
    margin-left: 0;
  }

  .system-holidays-summary {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .system-holidays-metric {
    flex: 1 1 120px;
  }

  .system-holidays-search,
  .system-holidays-search input,
  .system-holidays-filter,
  .system-holidays-filter input,
  .system-holidays-filter select {
    width: 100%;
  }

  .system-holidays-icon-button {
    width: 42px;
  }

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

  .system-holidays-field-wide,
  .system-holidays-toggle {
    grid-column: auto;
  }
}
