/* ============================================================
   Admin dashboard styling
   ============================================================ */

.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: static !important; }
}

.admin-sidebar {
  position: sticky;
  top: 24px;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--ink-200);
  border-radius: var(--r-md, 12px);
  padding: 8px;
}

.admin-nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: .95em;
  color: var(--ink-700);
  text-align: left;
  transition: all .15s;
}

.admin-nav__item:hover { background: var(--brand-50); color: var(--brand-700); }
.admin-nav__item.is-active {
  background: var(--brand-600);
  color: #fff;
}
.admin-nav__item.is-active:hover { background: var(--brand-700); }

.admin-h2 {
  font-size: 1.45rem;
  margin: 0 0 16px;
  color: var(--ink-900);
  font-weight: 700;
}

.admin-h-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.admin-h-row .admin-h2 { margin-bottom: 0; }

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.admin-stat {
  padding: 20px;
  text-align: center;
}

.admin-stat__v {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--brand-700);
  line-height: 1.1;
}

.admin-stat__l {
  color: var(--ink-600);
  font-size: .92em;
  margin-top: 4px;
}

.admin-table {
  padding: 0;
  overflow: auto;
}

.admin-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92em;
  min-width: 720px;
}

.admin-table thead {
  background: var(--brand-50);
}

.admin-table th {
  text-align: left;
  padding: 12px 14px;
  font-weight: 700;
  color: var(--brand-700);
  border-bottom: 1px solid var(--brand-100);
  font-size: .9em;
}

.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--ink-100);
  vertical-align: middle;
}

.admin-table tbody tr:hover { background: var(--brand-50); }
.admin-table tbody tr:last-child td { border-bottom: 0; }

.admin-row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-row-actions .btn {
  padding: 6px 10px;
  font-size: .85em;
}

/* ============ Modal ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 30, 25, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  overflow-y: auto;
}

.modal {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  max-width: 720px;
  width: 100%;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

.modal .admin-h2 { margin-bottom: 14px; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--ink-100);
}

/* Override doc-row__type colors for admin */
.doc-row__type {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: .78em;
  font-weight: 700;
}
.doc-row__type--pdf { background: #fde7e9; color: #c5253a; }
.doc-row__type--docx, .doc-row__type--doc { background: #e3f0fb; color: #1e63b8; }
.doc-row__type--xlsx, .doc-row__type--xls { background: #e6f5ec; color: #197f47; }
.doc-row__type--pptx, .doc-row__type--ppt { background: #fdecdb; color: #b85b00; }
.doc-row__type--zip { background: #f0ecf8; color: #5e3aa1; }
.doc-row__type--txt { background: #f0f1f2; color: #555; }
