/* ============================================
   Dokumente & Anhänge – фирменные карточки
   В том же стиле, что и #sicherheit
   ============================================ */

/* Секция документов внутри правой части дашборда */
.dash-right .dash-section-docs {
  width: 100%;
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
  box-sizing: border-box;
}

/* Базовая типографика секции */
.dash-section-docs,
.dash-section-docs * {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Отступы секции */
.dash-section-docs {
  margin-top: 20px;
  margin-bottom: 32px;
}

/* Сетка: одна колонка, вертикально */
.dash-section-docs .security-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
}

/* Базовая карточка */
.dash-section-docs .security-card {
  position: relative;
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
  min-height: 170px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

/* Цветная полоска сверху */
.dash-section-docs .security-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, #4f46e5, #22c55e, #0ea5e9);
}

/* Hover (кроме hero по ощущениям всё равно ок) */
.dash-section-docs .security-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.1);
}

/* ========== HERO-карточка ========= */

.dash-section-docs .security-card--hero {
  min-height: 110px;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.dash-section-docs .security-card--hero:hover {
  transform: none;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.dash-section-docs .security-card--hero .sec-hero-inner {
  max-width: 540px;
}

.dash-section-docs .security-card--hero .sec-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.dash-section-docs .security-card--hero .sec-subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  color: #6b7280;
}

/* ========== Шапка карточек ========= */

.dash-section-docs .sec-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.dash-section-docs .sec-icon {
  width: 40px;
  height: 40px;
  border-radius: 16px;
  background: radial-gradient(circle at 30% 20%, #f5f3ff, #dde4ff);
  box-shadow: 0 10px 20px rgba(79, 70, 229, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-section-docs .sec-icon i {
  font-size: 1.1rem;
  color: #4338ca;
}

.dash-section-docs .sec-headings {
  min-width: 0;
}

.dash-section-docs .sec-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: #9ca3af;
  margin-bottom: 2px;
}

.dash-section-docs .sec-card-title {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 700;
  color: #0f172a;
}

/* Текст */
.dash-section-docs .sec-text {
  margin: 4px 0 10px;
  font-size: 0.9rem;
  color: #4b5563;
}

/* Линия статуса */
.dash-section-docs .sec-status-line {
  margin: 4px 0 10px;
}

.dash-section-docs .sec-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.24rem 0.7rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
}

/* Футер карточек: метрики + кнопки */

.dash-section-docs .sec-footer {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.dash-section-docs .sec-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dash-section-docs .sec-metric-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #9ca3af;
}

.dash-section-docs .sec-metric-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: #111827;
}

.dash-section-docs .sec-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.dash-section-docs .sec-footer .btn {
  white-space: nowrap;
}

/* ========== Специфика документов ========= */

/* Форма upload внутри карточки */
.dash-section-docs .security-card--docs-upload {
  display: flex;
  flex-direction: column;
}

.dash-section-docs .security-card--docs-upload .sec-text {
  margin-top: 2px;
  margin-bottom: 12px;
  max-width: 30rem;
}

/* Сама форма: ровный вертикальный ритм */
.dash-section-docs .docs-upload-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* --- Блок выбора файлов --- */
.dash-section-docs .docs-file-block {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f9fafb;
  border: 1px dashed rgba(148, 163, 184, 0.8); /* slate-400 */
}

.dash-section-docs .docs-file-block .form-label {
  margin-bottom: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #6b7280;
}

/* Прячем нативный input[type=file] */
.dash-section-docs .docs-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  border: 0;
  clip: rect(0, 0, 0, 0);
}

/* Подпись к выбранным файлам */
.dash-section-docs #docs-files-label {
  font-size: 0.8rem;
  color: #6b7280;
}

/* --- Ряд с годом + кнопкой --- */
.dash-section-docs .docs-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-end;
}

.dash-section-docs .docs-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dash-section-docs .docs-field label.form-label {
  margin-bottom: 2px;
}

/* Год — компактный блок фиксированной ширины */
.dash-section-docs .docs-field-year {
  flex: 0 0 auto;
}

/* Кнопка занимает остаток строки */
.dash-section-docs .docs-upload-button {
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-end;
}

/* Select года — «таблетка» нормальной ширины */
.dash-section-docs .docs-select-year {
  display: inline-block;
  min-width: 120px;
  max-width: 150px;

  font-size: 0.9rem;
  line-height: 1.3;

  border-radius: 999px;
  border: 1px solid #c3cff8;
  background-color: #fff;
  background-image: none;

  padding: 0.32rem 0.9rem;
}

/* Мобильный вид: всё в столбик, кнопка на всю ширину */
@media (max-width: 768px) {
  .dash-section-docs .docs-row {
    flex-direction: column;
    align-items: stretch;
  }

  .dash-section-docs .docs-upload-button {
    justify-content: flex-start;
  }

  .dash-section-docs .docs-select-year {
    width: 100%;
    max-width: 100%;
  }
}

/* Бейджи года и таблица документов */
.dash-section-docs .docs-year-badge {
  background: #eef2ff;
  color: #4338ca;
  font-weight: 600;
  font-size: 0.78rem;
}

.dash-section-docs .docs-kind-badge {
  font-size: 0.78rem;
}

.dash-section-docs .docs-table-wrapper {
  margin-top: 6px;
  max-width: 100%;
  overflow-x: auto; /* на всякий случай, если когда-нибудь не влезет */
}

/* Таблица как список карточек */
.dash-section-docs .docs-table {
  width: 100%;
  table-layout: auto;
  border-collapse: separate;
  border-spacing: 0 8px; /* вертикальный зазор между "карточками" */
}

/* Заголовки таблицы */
.dash-section-docs .docs-table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  padding: 0.55rem 0.75rem;
}

/* Ячейки */
.dash-section-docs .docs-table td {
  font-size: 0.88rem;
  color: #374151;
  border-bottom: none;
  padding: 0.55rem 0.75rem;
}

/* Карточки-строки */
.dash-section-docs .docs-table tbody tr {
  background: #f9fafb;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.dash-section-docs .docs-table tbody tr td:first-child {
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}

.dash-section-docs .docs-table tbody tr td:last-child {
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}

.dash-section-docs .docs-table tbody tr:hover {
  background: #eef2ff;
}

/* Ячейки: разрешаем перенос строк */
.dash-section-docs .docs-table th,
.dash-section-docs .docs-table td {
  white-space: normal;
  word-break: break-word;
}

/* Первая колонка: Jahr + Dokument в столбик */
.dash-section-docs .docs-file-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dash-section-docs .docs-file-year {
  font-size: 0.78rem;
}

/* Имя файла */
.dash-section-docs .docs-file-name {
  font-weight: 500;
  white-space: normal;
  word-break: break-word;
}

/* Кнопка удаления без рамки, но с hover */
.dash-section-docs .docs-delete-btn {
  border: none;
  background: transparent;
  padding: 4px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.15rem;
  color: #ef4444; /* красный */
}

.dash-section-docs .docs-delete-btn:hover {
  background: rgba(248, 113, 113, 0.16);
  color: #b91c1c;
}

.dash-section-docs .docs-delete-btn:focus-visible {
  outline: 2px solid #fb7185;
  outline-offset: 2px;
}

/* Чуть уменьшаем шрифт в таблице на очень узких экранах */
@media (max-width: 480px) {
  .dash-section-docs .docs-table th,
  .dash-section-docs .docs-table td {
    font-size: 0.8rem;
  }
}
