:root {
  --primary: #2d176e;
  --secondary: #17151f;
  --accent: #b78a2d;
  --primary-fg: #ffffff;
  --header-bg: #17151f;
  --header-color: #ffffff;
  --breadcrumbs-bg: #2d176e;
  --breadcrumbs-fg: rgba(255, 255, 255, 0.78);
  --breadcrumbs-link-fg: #ffffff;
  --link-fg: #4f35a5;
  --link-hover-color: #2d176e;
  --button-bg: #2d176e;
  --button-hover-bg: #24125d;
  --default-button-bg: #2d176e;
  --default-button-hover-bg: #24125d;
  --object-tools-bg: #2d176e;
  --object-tools-hover-bg: #24125d;
  --hairline-color: #e7e7ee;
  --border-color: #d9d8e4;
  --body-bg: #f6f6f9;
  --darkened-bg: #eeeeF4;
  --selected-bg: #ede9ff;
  --body-fg: #17151f;
  --body-quiet-color: #5f6472;
}

body {
  color: #17151f;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#container,
#content,
#content-main,
.module,
.form-row,
label,
td,
th,
p,
li,
dt,
dd {
  color: #17151f;
}

.quiet,
.help,
.form-row .help,
.aligned label,
label.required,
.readonly {
  color: #4f5563;
}

#header {
  min-height: 74px;
  padding: 0 28px;
  background: linear-gradient(135deg, #17151f 0%, #2d176e 100%);
  box-shadow: 0 12px 32px rgba(23, 21, 31, 0.24);
}

.leo-admin-brand,
.leo-admin-logo {
  display: flex;
  align-items: center;
}

.leo-admin-logo {
  gap: 14px;
  color: #ffffff;
  text-decoration: none;
}

.leo-admin-logo:hover {
  color: #ffffff;
}

.leo-admin-logo img {
  width: 136px;
  max-height: 58px;
  padding: 6px 12px;
  border-radius: 12px;
  background: #ffffff;
  object-fit: contain;
}

.leo-admin-logo strong,
.leo-admin-logo small {
  display: block;
}

.leo-admin-logo strong {
  font-size: 18px;
  line-height: 1.1;
}

.leo-admin-logo small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

div.breadcrumbs {
  padding: 13px 28px;
  background: #24125d;
  color: rgba(255, 255, 255, 0.74);
  font-weight: 700;
}

#content {
  padding: 28px;
  background: #f6f6f9;
}

.module,
.inline-group,
fieldset.module {
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--body-bg);
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.06);
}

.aligned .form-row {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 58px;
  overflow: visible;
}

.aligned label {
  width: 150px;
  flex: 0 0 150px;
  font-weight: 800;
}

.aligned .form-row > div,
.aligned .form-row .flex-container {
  flex: 1 1 auto;
  min-width: 0;
}

.aligned .checkbox-row {
  display: block;
}

.aligned .checkbox-row label {
  width: auto;
  flex: initial;
}

.related-widget-wrapper {
  max-width: 100%;
}

.related-widget-wrapper select {
  min-width: 0;
}

.related-widget-wrapper-link {
  margin-left: 6px;
}

.module h2,
.module caption,
.inline-group h2 {
  padding: 12px 16px;
  background: linear-gradient(135deg, #2d176e, #24125d);
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 0;
}

.form-row {
  padding: 14px 16px;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="date"],
textarea,
select,
.vTextField {
  border-radius: 10px;
  border-color: #d5d3df;
  background: #ffffff;
  color: #17151f;
}

input[readonly],
input[disabled],
select[disabled],
textarea[disabled],
.readonly {
  opacity: 1;
  color: #17151f;
  -webkit-text-fill-color: #17151f;
}

input[readonly],
input[disabled],
select[disabled],
textarea[disabled] {
  background: #f8f8fb;
  border-color: #d8d7e2;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #4f35a5;
  box-shadow: 0 0 0 3px rgba(79, 53, 165, 0.13);
}

.submit-row {
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.06);
}

.button,
input[type="submit"],
input[type="button"],
.submit-row input,
a.button {
  border-radius: 10px;
  font-weight: 800;
}

.object-tools a,
.object-tools button {
  border-radius: 10px;
  font-weight: 800;
}

.results table {
  overflow: hidden;
  border-radius: 12px;
}

thead th {
  background: #f3f2f8;
  color: #17151f;
  font-weight: 800;
}

tbody tr:hover {
  background: #f4f1ff;
}

.leo-certificate-preview {
  cursor: pointer;
}

.leo-certificate-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  place-items: center;
}

.leo-certificate-modal.open {
  display: grid;
}

.leo-certificate-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 21, 31, 0.64);
}

.leo-certificate-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1100px, calc(100vw - 36px));
  height: min(820px, calc(100vh - 36px));
  overflow: hidden;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

.leo-certificate-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 10px 14px 10px 18px;
  border-bottom: 1px solid var(--border-color);
  background: #f6f6f9;
}

.leo-certificate-title {
  min-width: 0;
}

.leo-certificate-title span {
  display: block;
  color: var(--body-quiet-color);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.leo-certificate-title strong {
  display: block;
  margin-top: 2px;
  font-size: 16px;
  line-height: 1.2;
}

.leo-certificate-header > strong {
  font-size: 16px;
  line-height: 1.2;
}

.leo-certificate-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  flex: 0 0 auto;
  padding: 4px;
  border: 1px solid #dedce8;
  border-radius: 12px;
  background: #ffffff;
}

.leo-certificate-header > div:not(.leo-certificate-title):not(.leo-certificate-actions) {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  flex: 0 0 auto;
  padding: 4px;
  border: 1px solid #dedce8;
  border-radius: 12px;
  background: #ffffff;
}

.leo-certificate-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 0;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.leo-certificate-action.secondary {
  padding: 0 12px;
  background: #ede9ff;
  color: #2d176e;
}

.leo-certificate-action.secondary:hover {
  background: #ded7ff;
  color: #24125d;
}

.leo-certificate-action.close {
  width: 34px;
  padding: 0;
  background: #2d176e;
  color: #ffffff;
  font-size: 16px;
  text-transform: uppercase;
}

.leo-certificate-action.close:hover {
  background: #24125d;
}

.leo-certificate-header > div:not(.leo-certificate-title):not(.leo-certificate-actions) .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin: 0;
  border: 0;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  box-shadow: none;
}

.leo-certificate-header > div:not(.leo-certificate-title):not(.leo-certificate-actions) .leo-certificate-open {
  padding: 0 12px;
  background: #ede9ff;
  color: #2d176e;
}

.leo-certificate-header > div:not(.leo-certificate-title):not(.leo-certificate-actions) [data-certificate-close] {
  min-width: 58px;
  padding: 0 12px;
  background: #2d176e;
  color: #ffffff;
}

.leo-certificate-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #f6f6f9;
}

.leo-certificate-modal-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .leo-certificate-header {
    align-items: stretch;
    flex-direction: column;
  }

  .leo-certificate-actions {
    justify-content: space-between;
    width: 100%;
  }

  .leo-certificate-header > div:not(.leo-certificate-title):not(.leo-certificate-actions) {
    justify-content: space-between;
    width: 100%;
  }

  .leo-certificate-action.secondary {
    flex: 1 1 auto;
  }

  .leo-certificate-header > div:not(.leo-certificate-title):not(.leo-certificate-actions) .leo-certificate-open {
    flex: 1 1 auto;
  }
}

.inline-group {
  overflow: visible;
}

#trainings-group .tabular {
  min-width: 0;
}

#trainings-group .tabular table {
  width: 100%;
  table-layout: fixed;
}

#trainings-group .tabular tr.form-row {
  display: table-row;
  min-height: 0;
  padding: 0;
}

#trainings-group .tabular th,
#trainings-group .tabular td {
  display: table-cell;
}

#trainings-group .tabular th,
#trainings-group .tabular td {
  color: #17151f;
  vertical-align: top;
}

#trainings-group .tabular th {
  padding: 10px 8px;
  font-size: 10px;
  line-height: 1.2;
  white-space: normal;
}

#trainings-group .tabular td {
  padding: 14px 8px 12px;
}

#trainings-group .tabular td > p {
  margin: 0;
}

#trainings-group .tabular th.original,
#trainings-group .tabular td.original {
  display: none !important;
}

#trainings-group .tabular th.column-catalog_item,
#trainings-group .tabular td.field-catalog_item {
  width: 24%;
}

#trainings-group .tabular th.column-due_date,
#trainings-group .tabular td.field-due_date {
  width: 14%;
}

#trainings-group .tabular th.column-is_not_authorized,
#trainings-group .tabular td.field-is_not_authorized {
  width: 9%;
  text-align: center;
}

#trainings-group .tabular th.column-certificate,
#trainings-group .tabular td.field-certificate {
  width: 30%;
}

#trainings-group .tabular th.column-certificate_preview,
#trainings-group .tabular td.field-certificate_preview {
  width: 11%;
  text-align: center;
}

#trainings-group .tabular th.column-status_badge,
#trainings-group .tabular td.field-status_badge {
  width: 8%;
  text-align: center;
}

#trainings-group .tabular th:last-child,
#trainings-group .tabular td.delete {
  width: 4%;
  text-align: center;
}

#trainings-group .tabular select,
#trainings-group .tabular input[type="text"] {
  width: 100%;
  max-width: 100%;
}

#trainings-group .tabular .related-widget-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 32px;
}

#trainings-group .tabular .related-widget-wrapper select {
  min-width: 0;
}

#trainings-group .tabular .related-widget-wrapper-link {
  flex: 0 0 auto;
}

#trainings-group .tabular .related-widget-wrapper-link img {
  width: 18px;
  height: 18px;
}

#trainings-group .tabular .datetimeshortcuts {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  max-width: 80px;
  font-size: 0;
  white-space: nowrap;
  vertical-align: middle;
}

#trainings-group .tabular .datetimeshortcuts a:first-child {
  display: none;
}

#trainings-group .tabular .date {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  min-height: 32px;
}

#trainings-group .tabular td.field-due_date input {
  width: min(118px, 100%);
}

#trainings-group .tabular .file-upload {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  color: #4f5563;
  font-size: 12px;
  line-height: 1.35;
}

#trainings-group .tabular .file-upload a {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  color: #2d176e;
  font-weight: 800;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

#trainings-group .tabular .clearable-file-input {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 0;
}

#trainings-group .tabular input[type="file"] {
  max-width: 100%;
  font-size: 12px;
}

.leo-certificate-preview-stack {
  display: grid;
  gap: 8px;
  justify-items: center;
  align-content: start;
}

.leo-certificate-preview-stack .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 104px;
  min-height: 32px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.leo-certificate-preview-stack .button {
  margin: 0;
}

#trainings-group .tabular .readonly {
  color: #17151f;
  font-weight: 800;
}

#trainings-group .tabular .leo-badge {
  justify-content: center;
  min-width: 76px;
}

#trainings-group .tabular td.field-status_badge p,
#trainings-group .tabular td.delete {
  text-align: center;
}

#trainings-group .tabular td.delete input[type="checkbox"] {
  display: block;
  margin: 6px auto 0;
}

.leo-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.leo-badge-success {
  background: #dcfce7;
  color: #047857;
}

.leo-badge-danger {
  background: #fee4e2;
  color: #b42318;
}

.leo-badge-warning {
  background: #fff4d5;
  color: #995c00;
}

.leo-badge-info {
  background: #e0f2fe;
  color: #0369a1;
}

.leo-badge-muted {
  background: #ececf1;
  color: #667085;
}

@media (max-width: 767px) {
  #header {
    padding: 12px 16px;
  }

  #content {
    padding: 18px;
  }

  .leo-admin-logo span {
    display: none;
  }
}
