/* ═══════════════════════════════════════════════
   Accident Case Win — Admin Panel Styles
   (extends the main claymorphism theme)
   ═══════════════════════════════════════════════ */

/* The hidden attribute must always win over display rules */
[hidden] { display: none !important; }

.admin-body { min-height: 100vh; }

.admin-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 14px 0;
  background: rgba(233, 238, 247, 0.85);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 10px 30px rgba(163, 177, 208, 0.3);
}
.admin-header .header-inner { display: flex; align-items: center; justify-content: space-between; }
.admin-tag {
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-deep);
  background: var(--primary-soft);
  padding: 4px 10px;
  border-radius: 999px;
  margin-left: 8px;
  vertical-align: middle;
}
.admin-header-actions { display: flex; gap: 10px; }

.admin-main { padding: 48px 0 80px; }

/* ── Login ── */
.login-wrap { display: grid; place-items: center; min-height: 62vh; }
.login-card {
  width: min(420px, 100%);
  padding: 44px 38px;
  text-align: center;
  animation: popIn 0.55s var(--ease);
}
.lock-badge {
  width: 68px; height: 68px;
  margin: 0 auto 20px;
  display: grid; place-items: center;
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(145deg, #5c7dff, var(--primary-deep));
  box-shadow:
    8px 10px 22px rgba(74, 108, 247, 0.4),
    inset 1px 1px 2px rgba(255, 255, 255, 0.55),
    inset -3px -5px 10px rgba(10, 25, 110, 0.25);
}
.lock-badge svg { width: 30px; height: 30px; }
.login-card h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 8px; }
.login-card > p { font-size: 0.9rem; color: var(--muted); margin-bottom: 24px; }
.login-card .field { text-align: left; }
.login-error {
  padding: 11px 16px;
  margin: 4px 0 14px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--rose);
  background: #ffedf2;
  box-shadow: var(--clay-inset);
  animation: popIn 0.35s var(--ease);
}

/* ── ActiveProspect notice ── */
.ap-notice {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 22px;
  margin-bottom: 26px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  color: #8a5a00;
  background: linear-gradient(150deg, #fff6e6, #feedd4);
  box-shadow: var(--clay-shadow);
  animation: popIn 0.5s var(--ease);
}
.ap-notice svg { flex: 0 0 auto; width: 26px; height: 26px; }
.ap-notice code {
  font-size: 0.8rem;
  background: rgba(255,255,255,0.7);
  padding: 2px 8px;
  border-radius: 8px;
}

/* ── Stats ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}
.stat-chip {
  padding: 20px 16px;
  text-align: center;
  border-radius: var(--radius-md);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.stat-chip:hover { transform: translateY(-4px); box-shadow: var(--clay-shadow-hover); }
.stat-num {
  display: block;
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, var(--primary), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-num.ok { background: linear-gradient(120deg, var(--green), var(--accent)); -webkit-background-clip: text; background-clip: text; }
.stat-num.bad { background: linear-gradient(120deg, var(--rose), var(--amber)); -webkit-background-clip: text; background-clip: text; }
.stat-lbl { font-size: 0.78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* ── Leads panel ── */
.leads-panel { padding: 28px; border-radius: var(--radius-lg); }
.panel-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 14px;
  margin-bottom: 20px;
}
.panel-toolbar h2 { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; }
.toolbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.search-box {
  display: flex; align-items: center; gap: 8px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--bg-soft);
  box-shadow: var(--clay-inset);
}
.search-box svg { width: 16px; height: 16px; color: var(--muted); flex: 0 0 auto; }
.search-box input {
  border: none; background: none; outline: none;
  padding: 11px 0;
  width: 230px;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--ink);
}

/* ── Table ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); }
.leads-table { width: 100%; border-collapse: separate; border-spacing: 0 10px; min-width: 880px; }
.leads-table th {
  text-align: left;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  padding: 4px 14px;
  white-space: nowrap;
}
.leads-table td {
  background: var(--bg-soft);
  padding: 14px;
  font-size: 0.88rem;
  white-space: nowrap;
  vertical-align: middle;
}
.leads-table tbody tr { transition: transform 0.3s var(--ease); }
.leads-table tbody tr:hover td { background: #eef3fb; }
.leads-table td:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); color: var(--muted); font-size: 0.8rem; }
.leads-table td:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.leads-table .cell-name { font-weight: 700; cursor: pointer; color: var(--primary-deep); }
.leads-table .cell-name:hover { text-decoration: underline; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-delivered { color: #0e9f6e; background: #eafbef; }
.badge-failed { color: var(--rose); background: #ffedf2; }
.badge-pending { color: var(--amber); background: #fff6e6; }
.badge-skipped { color: var(--muted); background: #eceff6; }

.cert-link {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
}
.cert-link svg { width: 13px; height: 13px; }
.cert-none { color: #b3bdd4; font-size: 0.78rem; }

.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 11px;
  color: var(--muted);
  background: var(--surface);
  box-shadow: var(--clay-shadow);
  transition: color 0.25s, transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.icon-btn:hover { transform: translateY(-2px); box-shadow: var(--clay-shadow-hover); }
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn.view:hover { color: var(--primary); }
.icon-btn.retry:hover { color: var(--amber); }
.icon-btn.delete:hover { color: var(--rose); }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon {
  width: 74px; height: 74px;
  margin: 0 auto 18px;
  display: grid; place-items: center;
  border-radius: 26px;
  color: var(--muted);
  background: var(--bg-soft);
  box-shadow: var(--clay-inset);
}
.empty-icon svg { width: 32px; height: 32px; }
.empty-state h3 { font-size: 1.15rem; font-weight: 800; margin-bottom: 6px; }
.empty-state p { font-size: 0.9rem; color: var(--muted); }

.dash-meta { text-align: center; margin-top: 18px; font-size: 0.78rem; color: var(--muted); }

/* ── Modal ── */
.modal-backdrop {
  position: fixed; inset: 0;
  z-index: 200;
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(27, 39, 69, 0.35);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.3s var(--ease);
}
.modal-card {
  width: min(560px, 100%);
  max-height: 85vh;
  overflow-y: auto;
  padding: 30px;
  animation: popIn 0.4s var(--ease);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-head h3 { font-size: 1.25rem; font-weight: 800; }
.modal-close {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 13px;
  color: var(--muted);
  background: var(--bg-soft);
  box-shadow: var(--clay-inset);
  transition: color 0.25s;
}
.modal-close:hover { color: var(--rose); }
.modal-close svg { width: 16px; height: 16px; }

.modal-body { display: grid; gap: 12px; }
.modal-body .detail-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  box-shadow: var(--clay-inset);
  font-size: 0.86rem;
}
.modal-body dt { font-weight: 800; color: var(--muted); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; padding-top: 2px; }
.modal-body dd { word-break: break-word; }
.modal-body dd a { color: var(--primary); font-weight: 600; }
.modal-body dd pre {
  white-space: pre-wrap;
  font-size: 0.76rem;
  font-family: inherit;
  color: var(--muted);
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.btn-danger {
  color: #fff;
  background: linear-gradient(145deg, #fb7185, var(--rose));
  box-shadow:
    8px 10px 22px rgba(244, 63, 110, 0.35),
    inset 1px 1px 2px rgba(255, 255, 255, 0.55),
    inset -3px -5px 10px rgba(120, 5, 40, 0.25);
}
.btn-danger:hover { transform: translateY(-2px); }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 26px; left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  padding: 13px 26px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, #34d399, var(--green));
  box-shadow: 8px 10px 24px rgba(34, 197, 94, 0.45);
  animation: toastIn 0.4s var(--ease);
}
.toast.error { background: linear-gradient(145deg, #fb7185, var(--rose)); box-shadow: 8px 10px 24px rgba(244, 63, 110, 0.45); }
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 16px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Responsive ── */
@media (max-width: 860px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .search-box input { width: 140px; }
  .admin-main { padding: 30px 0 60px; }
}
