/* ── Foreclosure Decoded — Admin Panel ─────────────────────────────────────
   Companion to styles.css. All vars, resets, and global typography live
   in styles.css — this file contains only admin-specific rules.
   ─────────────────────────────────────────────────────────────────────────── */

/* ── Action bar ───────────────────────────────────────────────────────────── */
.admin-action-bar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 90;
}
.admin-action-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  gap: 1rem;
}
@media (max-width: 1024px) { .admin-action-inner { padding: 0 24px; } }
@media (max-width: 640px)  { .admin-action-inner { padding: 0 16px; } }
@media (max-width: 480px)  { .admin-action-inner { padding: 0.35rem 16px; min-height: auto; } }

.admin-action-label {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
  flex-shrink: 0;
}
@media (max-width: 640px) { .admin-action-label { display: none; } }

.admin-pills {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  scroll-behavior: smooth;
  padding-right: 16px;
}
.admin-pills::-webkit-scrollbar { display: none; }

.admin-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--surface-alt);
  color: var(--text-muted);
  transition: all 0.12s;
  line-height: 1;
}
.admin-pill:hover  { border-color: var(--teal); color: var(--teal); background: rgba(31,122,114,.06); }
.admin-pill.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ── Page layout ──────────────────────────────────────────────────────────── */
.admin-page {
  max-width: 1300px;
  margin: 0 auto;
  padding: 1.5rem 32px 4rem;
}
@media (max-width: 1024px) { .admin-page { padding: 1.25rem 24px 3rem; } }
@media (max-width: 640px)  { .admin-page { padding: 1rem 16px 2.5rem; } }

.admin-columns {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 1024px) { .admin-columns { grid-template-columns: 1fr 260px; } }
@media (max-width: 860px)  { .admin-columns { grid-template-columns: 1fr; } }

/* ── Workspace views ──────────────────────────────────────────────────────── */
.workspace-view { display: none; }
.workspace-view.active-view {
  display: block;
  animation: adminViewFade .18s ease;
}
@keyframes adminViewFade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Context metric strip ─────────────────────────────────────────────────── */
.context-metric-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.25rem;
  background: #fff;
  box-shadow: var(--shadow);
}
.context-metric-unit {
  padding: 0.9rem 1rem;
  border-right: 1px solid var(--border);
  text-align: center;
}
.context-metric-unit:last-child { border-right: none; }
.context-metric-unit strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--navy);
  font-family: 'Poppins', system-ui, sans-serif;
  line-height: 1.1;
}
.context-metric-unit span {
  font-size: 0.67rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* ── View title row ───────────────────────────────────────────────────────── */
.admin-view-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.admin-view-title-row h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  font-family: 'Poppins', system-ui, sans-serif;
}

/* ── Action buttons ───────────────────────────────────────────────────────── */
.btn-cta-create {
  background: var(--teal);
  color: #fff;
  border: none;
  padding: 0.45rem 1rem;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Inter', system-ui, sans-serif;
  white-space: nowrap;
  transition: opacity .15s;
}
.btn-cta-create:hover { opacity: .85; }
.btn-cta-secondary {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--border);
  padding: 0.45rem 1rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Inter', system-ui, sans-serif;
  white-space: nowrap;
  transition: border-color .15s, background .15s;
}
.btn-cta-secondary:hover { border-color: var(--navy); background: var(--calc-bg, #f8fafc); }
.btn-cta-secondary:disabled { opacity: .5; cursor: default; }

.btn-edit-action {
  background: var(--surface-alt);
  color: var(--navy);
  border: 1px solid var(--border);
  padding: 0.3rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 5px;
  cursor: pointer;
  font-family: 'Inter', system-ui, sans-serif;
  transition: background .12s;
}
.btn-edit-action:hover { background: #e8eaee; }

.btn-delete-action {
  background: rgba(185,28,28,.08);
  color: #b91c1c;
  border: 1px solid rgba(185,28,28,.2);
  padding: 0.3rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 5px;
  cursor: pointer;
  font-family: 'Inter', system-ui, sans-serif;
  transition: background .12s;
}
.btn-delete-action:hover { background: rgba(185,28,28,.14); }

/* ── Data list ────────────────────────────────────────────────────────────── */
.admin-data-list { display: flex; flex-direction: column; gap: 0; }

.admin-row-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-bottom: none;
  background: #fff;
  gap: 1rem;
}
.admin-row-item:first-child { border-radius: 8px 8px 0 0; }
.admin-row-item:last-child  { border-bottom: 1px solid var(--border); border-radius: 0 0 8px 8px; }
.admin-row-item:only-child  { border-radius: 8px; border-bottom: 1px solid var(--border); }
.admin-row-item:hover { background: var(--bg); }

.admin-row-info-left { flex: 1; min-width: 0; }
.admin-item-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--navy);
  font-family: 'Poppins', system-ui, sans-serif;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-item-meta-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.admin-item-meta-row span {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.admin-row-controls-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

/* ── Category chip ────────────────────────────────────────────────────────── */
.admin-category-chip {
  display: inline-flex;
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.18rem 0.55rem;
  border-radius: 20px;
  background: rgba(31,122,114,.1);
  color: #145f58;
  border: 1px solid rgba(31,122,114,.22);
}

/* ── Access tier badges ───────────────────────────────────────────────────── */
.lcard__badge-premium {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(30,43,74,.09);
  color: var(--navy);
  border: 1px solid rgba(30,43,74,.2);
}
.lcard__badge-free {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(31,122,114,.1);
  color: #145f58;
  border: 1px solid rgba(31,122,114,.22);
}
.lcard__badge-bundle {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(184,134,11,.13);
  color: #7a6008;
  border: 1px solid rgba(184,134,11,.3);
}

/* ── Empty / guidance states ──────────────────────────────────────────────── */
.admin-guidance-card {
  padding: 12px 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.78rem;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.admin-empty-state-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  text-align: center;
}
.admin-empty-icon {
  width: 48px;
  height: 48px;
  background: var(--surface-alt);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.admin-empty-icon svg { width: 22px; height: 22px; stroke: var(--text-muted); }
.admin-empty-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Sidebar cards ────────────────────────────────────────────────────────── */
.admin-sidebar { display: flex; flex-direction: column; gap: 1.1rem; position: sticky; top: 68px; }
@media (max-width: 860px) { .admin-sidebar { position: static; } }

.ls-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.ls-card__head {
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 1rem;
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
}
.ls-card__body { padding: 0.5rem; }

/* ── Health monitor sidebar ───────────────────────────────────────────────── */
.sidebar-monitor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  border-bottom: 1px solid var(--surface-alt);
  font-size: 0.78rem;
  color: var(--text);
  font-weight: 500;
}
.sidebar-monitor-row:last-child { border-bottom: none; }

.status-dot-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot-indicator.good    { background: #16a34a; }
.status-dot-indicator.warning { background: var(--amber); }
.status-dot-indicator.error   { background: #dc2626; }

/* ── Admin ops sidebar ────────────────────────────────────────────────────── */
.sidebar-list-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  border-bottom: 1px solid var(--surface-alt);
  text-decoration: none;
  font-size: 0.78rem;
  color: var(--navy);
  font-weight: 600;
  transition: background .12s;
}
.sidebar-list-row:last-child { border-bottom: none; }
.sidebar-list-row:hover { background: var(--surface-alt); }

/* ── Modals (shared with other pages) ────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 700px;
  padding: 32px;
  box-shadow: var(--shadow-lg);
}
.modal-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.modal-header-row h3 { margin: 0; font-size: 1.05rem; }
.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 2px 6px;
}
.modal-close-btn:hover { color: var(--navy); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.full-width { grid-column: 1 / -1; }
.toggle-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.toggle-row label { font-weight: 600; font-size: 14px; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--navy); }

/* ── Modal action row (View / Save as Draft / Publish) ───────────────────── */
.modal-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
}
.modal-save-group {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.btn-ghost-sm {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  padding: 7px 12px;
  border-radius: 5px;
  transition: color .12s, background .12s;
  font-family: 'Inter', system-ui, sans-serif;
}
.btn-ghost-sm:hover { color: var(--navy); background: var(--surface-alt); }
.btn-outline-sm {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--border);
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Inter', system-ui, sans-serif;
  transition: background .12s;
}
.btn-outline-sm:hover { background: var(--surface-alt); }

/* ── List row: View button ────────────────────────────────────────────────── */
.btn-view-action {
  color: var(--teal);
  border: 1px solid rgba(31,122,114,.25);
  background: rgba(31,122,114,.06);
  padding: 0.3rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 5px;
  text-decoration: none;
  font-family: 'Inter', system-ui, sans-serif;
  transition: background .12s;
}
.btn-view-action:hover { background: rgba(31,122,114,.12); }

@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; }
  .full-width { grid-column: 1; }
  .modal-box { padding: 20px; }
  .modal-action-row { flex-wrap: wrap; }
}
