﻿/* Documents index */

.documents-page {
  width: 100%;
}

.documents-header {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
}

.documents-header h1 {
  margin-bottom: 0.3rem;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
}

.documents-header p:not(.page-eyebrow) {
  margin: 0;
  color: var(--dk-text-muted);
}

.documents-header-actions {
  display: flex;
  gap: 0.65rem;
}

.documents-header-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.documents-header-actions svg {
  width: 1.08rem;
  height: 1.08rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Document filters */

.document-filter-panel {
  margin-bottom: 1.5rem;
  padding: 1.2rem;
  background: var(--dk-surface);
  border: 1px solid var(--dk-border);
  border-radius: var(--dk-radius-lg);
  box-shadow: var(--dk-shadow-sm);
}

.document-filter-form {
  display: grid;
  grid-template-columns:
    minmax(15rem, 2fr)
    minmax(10rem, 1fr)
    minmax(10rem, 1fr)
    auto;
  align-items: end;
  gap: 0.9rem;
}

.search-input-wrapper {
  position: relative;
}

.search-input-wrapper svg {
  position: absolute;
  top: 50%;
  left: 0.85rem;
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: #94a3b8;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: translateY(-50%);
  pointer-events: none;
}

.search-input-wrapper .form-control {
  padding-left: 2.7rem;
}

.document-filter-actions {
  display: flex;
  gap: 0.5rem;
}

.document-results-header {
  margin-bottom: 0.9rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.document-results-header h2 {
  margin-bottom: 0.15rem;
  font-size: 1.05rem;
}

.document-results-header p {
  margin: 0;
  color: var(--dk-text-muted);
  font-size: 0.78rem;
}

.document-results-header > a {
  font-size: 0.82rem;
  font-weight: 650;
  text-decoration: none;
}

/* Desktop document list */

.document-desktop-list {
  overflow: hidden;
  background: var(--dk-surface);
  border: 1px solid var(--dk-border);
  border-radius: var(--dk-radius-lg);
  box-shadow: var(--dk-shadow-sm);
}

.document-desktop-list tbody tr {
  transition: background-color 150ms ease;
}

.document-desktop-list tbody tr:hover {
  background: #f8faff;
}

.document-name-cell {
  min-width: 13rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.document-name-cell > span:last-child {
  min-width: 0;
}

.document-name-cell a {
  overflow: hidden;
  display: block;
  color: var(--dk-navy);
  font-weight: 700;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-name-cell a:hover {
  color: var(--dk-primary);
}

.document-name-cell small {
  overflow: hidden;
  display: block;
  max-width: 15rem;
  margin-top: 0.12rem;
  color: var(--dk-text-muted);
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-type-icon {
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: var(--dk-primary);
  background: var(--dk-primary-soft);
  border-radius: 0.75rem;
}

.document-type-icon svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.document-category {
  padding: 0.35rem 0.58rem;
  color: #475569;
  background: #f1f5f9;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 650;
  white-space: nowrap;
}

.document-view-link {
  width: 2rem;
  height: 2rem;
  display: inline-grid;
  place-items: center;
  color: #64748b;
  border-radius: 0.55rem;
  font-size: 1.4rem;
  text-decoration: none;
}

.document-view-link:hover {
  color: var(--dk-primary);
  background: var(--dk-primary-soft);
}

/* Mobile document cards */

.document-mobile-list {
  display: grid;
  gap: 0.85rem;
}

.document-mobile-card {
  padding: 1rem;
  display: block;
  color: var(--dk-text);
  background: var(--dk-surface);
  border: 1px solid var(--dk-border);
  border-radius: var(--dk-radius-lg);
  box-shadow: var(--dk-shadow-sm);
  text-decoration: none;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.document-mobile-card:hover,
.document-mobile-card:focus {
  color: var(--dk-text);
  border-color: #c7d2fe;
  box-shadow: var(--dk-shadow);
  transform: translateY(-1px);
}

.document-mobile-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.7rem;
}

.document-mobile-title {
  min-width: 0;
}

.document-mobile-title h2 {
  overflow: hidden;
  margin: 0.08rem 0 0.15rem;
  font-size: 0.95rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-mobile-title p {
  margin: 0;
  color: var(--dk-text-muted);
  font-size: 0.72rem;
}

.document-mobile-top .badge {
  margin-top: 0.15rem;
  font-size: 0.62rem;
}

.document-mobile-details {
  margin: 0.9rem 0;
  padding: 0.75rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  background: var(--dk-surface-muted);
  border-radius: 0.75rem;
}

.document-mobile-details > div {
  min-width: 0;
}

.document-mobile-details span,
.document-mobile-details strong {
  display: block;
}

.document-mobile-details span {
  margin-bottom: 0.18rem;
  color: var(--dk-text-muted);
  font-size: 0.64rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.document-mobile-details strong {
  overflow: hidden;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-mobile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--dk-text-muted);
  font-size: 0.7rem;
}

.document-mobile-footer > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-mobile-open {
  flex-shrink: 0;
  color: var(--dk-primary);
  font-weight: 700;
}

/* Document empty state */

.document-empty-state {
  min-height: 22rem;
  padding: 3rem 1.5rem;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  background: var(--dk-surface);
  border: 1px solid var(--dk-border);
  border-radius: var(--dk-radius-lg);
  box-shadow: var(--dk-shadow-sm);
}

.document-empty-icon {
  width: 4.5rem;
  height: 4.5rem;
  margin-bottom: 1rem;
  display: grid;
  place-items: center;
  color: var(--dk-primary);
  background: var(--dk-primary-soft);
  border-radius: 1.25rem;
}

.document-empty-icon svg {
  width: 2rem;
  height: 2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.document-empty-state h2 {
  margin-bottom: 0.4rem;
  font-size: 1.3rem;
}

.document-empty-state p {
  max-width: 31rem;
  margin-bottom: 1.25rem;
  color: var(--dk-text-muted);
}

/* Document list responsiveness */

@media (max-width: 991.98px) {
  .document-filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .document-search-field {
    grid-column: 1 / -1;
  }

  .document-filter-actions {
    grid-column: 1 / -1;
  }
}

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

  .documents-header-actions {
    width: 100%;
  }

  .documents-header-actions .btn {
    flex: 1;
    justify-content: center;
  }

  .document-filter-panel {
    padding: 1rem;
  }

  .document-filter-form {
    grid-template-columns: 1fr;
  }

  .document-search-field,
  .document-filter-actions {
    grid-column: auto;
  }

  .document-filter-actions {
    flex-direction: column;
  }

  .document-filter-actions,
  .document-filter-actions .btn {
    width: 100%;
  }
}

@media (max-width: 419.98px) {
  .documents-header-actions {
    flex-direction: column-reverse;
  }

  .document-results-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.4rem;
  }

  .document-mobile-top {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .document-mobile-top .badge {
    grid-column: 2;
    width: fit-content;
  }
}
