/* ============================================================
   OBSEPIO CAPITAL — ADMIN PORTAL STYLES
   Extends shared/css/base.css
   ============================================================ */

/* ============================================================
   LAYOUT OVERRIDES
   ============================================================ */
.content {
  max-width: 1400px;
  overflow-x: hidden;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0;
}

/* ============================================================
   SECTION TITLE
   ============================================================ */
.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.section-title [data-lucide] { width: 0.9rem; height: 0.9rem; }

/* ============================================================
   ADMIN TABLE
   ============================================================ */
.admin-table {
  width: 100%;
  font-size: 0.875rem;
}
.admin-table thead tr {
  border-bottom: 1px solid var(--border);
}
.admin-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.admin-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td { background: var(--surface-2); }
.admin-table .num {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}
.admin-table .pos { color: var(--success); }
.admin-table .neg { color: var(--error); }
.admin-table .text-muted { color: var(--text-muted); font-size: 0.8125rem; }
.admin-table .action-btns {
  display: flex;
  gap: 0.375rem;
  align-items: center;
}

/* Row-level action buttons */
.btn-row {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3125rem 0.5rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
  min-height: 30px;
}
.btn-row [data-lucide] { width: 0.8rem; height: 0.8rem; }
.btn-row:hover { color: var(--text); background: var(--surface-3); border-color: var(--border-strong); }
.btn-row.danger:hover { color: var(--error); border-color: var(--error); background: var(--error-bg); }

/* ============================================================
   DOCUMENT ADMIN LIST
   ============================================================ */
.doc-admin-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-top: 1rem;
}
.doc-admin-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.125rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow);
  transition: border-color var(--transition);
}
.doc-admin-row:hover { border-color: var(--border-strong); }
.doc-admin-row .doc-icon { flex-shrink: 0; }
.doc-admin-body {
  flex: 1;
  min-width: 0;
}
.doc-admin-title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-admin-meta {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.doc-admin-actions {
  display: flex;
  gap: 0.375rem;
  align-items: center;
  flex-shrink: 0;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: oklch(0 0 0 / 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  animation: fade-in 150ms var(--ease);
}
.modal-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: calc(100dvh - 3rem);
  display: flex;
  flex-direction: column;
  animation: modal-in 200ms var(--ease);
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-title { font-size: 1rem; font-weight: 600; }
.modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* Modal form styles */
.modal-body .form-field { margin-bottom: 1rem; }
.modal-body .form-field:last-child { margin-bottom: 0; }
.modal-body .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
}
.modal-body select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23797876' stroke-width='1.5'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
}
.modal-body textarea.form-input {
  resize: vertical;
  min-height: 80px;
}

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.upload-zone input[type="file"] { display: none; }
.upload-zone-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.875rem;
}
.upload-zone-label [data-lucide] { width: 1.5rem; height: 1.5rem; color: var(--text-faint); }
.upload-zone-filename {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--primary);
  font-weight: 500;
}

/* Progress bar */
.upload-progress {
  height: 4px;
  background: var(--surface-3);
  border-radius: 2px;
  margin-top: 0.75rem;
  overflow: hidden;
}
.upload-progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 200ms ease;
  width: 0%;
}

/* ============================================================
   DASHBOARD QUICK LIST
   ============================================================ */
.dash-list { list-style: none; margin: 0; padding: 0; }
.dash-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  gap: 0.5rem;
}
.dash-list-item:last-child { border-bottom: none; }
.dash-list-item .label { color: var(--text-muted); font-size: 0.8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.dash-list-item .val { font-family: var(--mono); font-size: 0.8125rem; font-variant-numeric: tabular-nums; flex-shrink: 0; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 767px) {
  .modal-card { max-width: 100%; }
  .modal-body .form-grid { grid-template-columns: 1fr; }
  .doc-admin-row { flex-wrap: wrap; }
  .admin-table th, .admin-table td { padding: 0.625rem 0.75rem; }
  #dash-kpi-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .filter-bar { gap: 0.5rem; }
}

