.documents-page {
  color: var(--ink);
  min-width: 0;
  font-size: 14px;
  line-height: 1.6;
}
.documents-selector {
  padding: 22px;
  margin: 0 0 24px;
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.documents-fields {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(210px, 1fr) minmax(260px, 1.3fr);
  gap: 18px;
  align-items: end;
}
.documents-fields > label {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}
.documents-fields :is(input, select) {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 46px;
  font-size: 16px;
  line-height: 1.5;
  padding: 10px 38px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--theme-surface, #fff);
  color: var(--ink);
  font-weight: 400;
}
.documents-fields input {
  padding-right: 12px;
}
.documents-fields :is(input, select):disabled {
  opacity: 1;
  background: var(--bg);
  color: var(--muted);
  cursor: not-allowed;
}
.documents-fields input::placeholder {
  color: var(--muted);
  opacity: 1;
}
.documents-fields :is(input, select):focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}
.documents-selection {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  min-width: 0;
  overflow-wrap: anywhere;
}
.documents-selection strong {
  font-size: 16px;
  line-height: 1.5;
  font-weight: 600;
  color: var(--ink);
}
.documents-selection span {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}
.documents-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.documents-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--theme-surface, #fff);
  color: var(--ink);
}
.documents-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--purple-bg);
  color: var(--purple);
  flex-shrink: 0;
}
.documents-card-icon svg {
  width: 24px;
  height: 24px;
}
.documents-card h2 {
  font-size: 22px;
  line-height: 1.35;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  overflow-wrap: anywhere;
}
.documents-card p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
  margin: 0 0 10px;
  flex: 1;
}
.documents-card > .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  max-width: 100%;
  min-height: 46px;
  font-size: 15px;
  line-height: 1.5;
  white-space: normal;
  word-break: normal;
  overflow-wrap: normal;
  text-align: center;
}
.documents-card > .btn:disabled {
  opacity: 1;
  background: var(--purple-bg);
  border-color: var(--line);
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
}
.documents-print-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}
.documents-print-note svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 3px;
}
@media (max-width: 1100px) {
  .documents-fields {
    grid-template-columns: minmax(180px, 0.8fr) minmax(210px, 1fr);
  }
  .documents-student-label {
    grid-column: 1/-1;
  }
}
@media (max-width: 600px) {
  .documents-selector {
    padding: 18px;
  }
  .documents-fields,
  .documents-cards {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
  .documents-student-label {
    grid-column: auto;
  }
  .documents-card {
    padding: 21px;
  }
  .documents-card h2 {
    font-size: 21px;
  }
  .documents-card > .btn {
    width: 100%;
  }
  .documents-print-note {
    font-size: 13px;
  }
}
.documents-history {
  margin-top: 28px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--theme-surface, #fff);
  min-width: 0;
}
.documents-history-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.documents-history-heading > div {
  min-width: 0;
}
.documents-history h2 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.4;
  font-weight: 600;
}
.documents-history-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}
.documents-history .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  font-size: 14px;
  line-height: 1.5;
  white-space: normal;
  word-break: normal;
  overflow-wrap: normal;
  text-align: center;
}
.documents-history .btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.documents-history .btn:disabled {
  opacity: 1;
  background: var(--bg);
  border-color: var(--line);
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
}
.documents-history-filter {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 7px !important;
  max-width: 320px;
  margin: 0 0 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  min-width: 0;
}
.documents-history-filter select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 36px 9px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--theme-surface, #fff);
  color: var(--ink);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  max-width: 100%;
}
.documents-history :is(button, select):focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 3px;
}
.documents-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.documents-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 240px);
  gap: 22px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--theme-surface, #fff);
  min-width: 0;
}
.documents-history-details {
  min-width: 0;
  overflow-wrap: anywhere;
}
.documents-history-kind {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--purple-bg);
  color: var(--purple);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}
.documents-history h3 {
  margin: 10px 0 14px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.documents-history dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 20px;
  margin: 0;
}
.documents-history dl > div:last-child {
  grid-column: 1/-1;
}
.documents-history dt {
  margin: 0 0 3px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.documents-history dd {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.documents-history-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
  min-width: 0;
}
.documents-history-actions p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}
.documents-history-empty {
  padding: 22px;
  margin: 0;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}
.documents-history-legacy {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-left: 3px solid var(--purple);
  border-radius: 5px;
  background: var(--purple-bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
}
.documents-history-error {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--bg);
}
.documents-history-error p {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.documents-history-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.documents-history-pagination span {
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
  color: var(--muted);
}
@media (max-width: 800px) {
  .documents-history-item {
    grid-template-columns: minmax(0, 1fr);
  }
  .documents-history-actions {
    flex-direction: row;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .documents-history-actions .btn {
    flex: 1 1 200px;
  }
}
@media (max-width: 600px) {
  .documents-history {
    padding: 18px;
  }
  .documents-history-heading {
    gap: 12px;
    flex-wrap: wrap;
  }
  .documents-history h2 {
    font-size: 21px;
  }
  .documents-history-item {
    padding: 16px;
    gap: 16px;
  }
  .documents-history-filter {
    max-width: none;
  }
  .documents-history-filter select {
    font-size: 16px;
  }
  .documents-history dl {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  .documents-history dl > div:last-child {
    grid-column: auto;
  }
  .documents-history-actions {
    flex-direction: column;
  }
  .documents-history-actions .btn {
    flex: 0 1 auto;
    width: 100%;
  }
  .documents-history-pagination {
    gap: 8px;
    flex-wrap: wrap;
  }
  .documents-history-pagination span {
    flex: 1 1 100%;
    order: -1;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .documents-history-pagination .btn {
    flex: 1;
  }
}
.documents-history-origin {
  margin: -2px 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
