/* admin.css - Executive Admin Portal & Outreach Engine Styling */

.admin-body {
  background-color: #f8fafc;
}

.admin-navbar {
  border-bottom: 2px solid rgba(16, 185, 129, 0.2);
}

.admin-shield-badge {
  font-size: 0.68rem;
  font-weight: 800;
  background: var(--violet-light);
  color: var(--violet);
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid rgba(139, 92, 246, 0.3);
  letter-spacing: 0.05em;
}

/* ========================================================
   ADMIN LOGIN CARD STYLING (LUMINOUS & GLASSMORPHIC)
   ======================================================== */
.admin-login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  z-index: 10;
}

.admin-login-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  border-radius: 28px;
  padding: 44px 40px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.12), 0 0 30px rgba(16, 185, 129, 0.15);
  animation: fadeIn 0.35s ease;
}

.login-brand-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.login-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.toggle-pwd-link {
  font-size: 0.78rem;
  color: var(--indigo);
  font-weight: 700;
  cursor: pointer;
}

.login-alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 20px;
  animation: fadeIn 0.2s ease;
}

.login-alert.error {
  background: var(--rose-light);
  color: #9f1239;
  border: 1px solid rgba(244, 63, 94, 0.4);
}

.login-alert.success {
  background: var(--emerald-light);
  color: #065f46;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.login-card-footer {
  margin-top: 28px;
  text-align: center;
  border-top: 1px solid var(--border-light);
  padding-top: 20px;
}

.back-link {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--emerald-dark);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 10px;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--text-main);
}

.security-note {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Admin Panes */
.admin-pane {
  display: none;
  animation: fadeIn 0.3s ease forwards;
}

.admin-pane.active {
  display: block;
}

/* Mailboxes Grid with Gauges */
.mailboxes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.mailbox-card {
  background: var(--bg-canvas);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s;
}

.mailbox-card:hover {
  background: #ffffff;
  border-color: var(--emerald);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.mb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.mb-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--emerald-dark);
}

.mb-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
}

.mb-status-dot.exhausted {
  background: var(--rose);
}

.mb-email {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
  word-break: break-all;
}

.mb-name {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.mb-meter-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.mb-meter-row strong {
  color: var(--text-main);
}

.mb-track {
  height: 6px;
  background: var(--bg-subtle);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 10px;
}

.mb-fill {
  height: 100%;
  background: var(--grad-pakistan);
  border-radius: 9999px;
  transition: width 0.4s ease;
}

.mb-footer {
  font-size: 0.72rem;
  color: var(--emerald-dark);
  font-weight: 700;
}

/* Outreach Grid Layout */
.outreach-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 28px;
  margin-bottom: 32px;
}

/* Drag & Drop Zone */
.upload-dropzone {
  border: 2px dashed rgba(16, 185, 129, 0.45);
  background: var(--bg-canvas);
  border-radius: 20px;
  padding: 44px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
  background: #f0fdf4;
  border-color: var(--emerald);
  transform: scale(1.01);
}

.drop-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.upload-dropzone h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.upload-dropzone p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

/* Upload Summary */
.upload-summary {
  margin-top: 24px;
  animation: fadeIn 0.3s ease;
}

.summary-stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.sum-card {
  background: var(--bg-canvas);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}

.sum-card.valid {
  background: #f0fdf4;
  border-color: var(--emerald);
}

.sum-card .lbl {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.sum-card .val {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
}

.sum-card.valid .val {
  color: var(--emerald-dark);
}

.campaign-settings-box {
  background: var(--bg-canvas);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.campaign-actions-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Progress Box */
.progress-box {
  margin-bottom: 24px;
}

.prog-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.progress-track {
  height: 12px;
  background: var(--bg-subtle);
  border-radius: 9999px;
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.progress-fill {
  height: 100%;
  background: var(--grad-vibrant);
  border-radius: 9999px;
  transition: width 0.3s ease;
}

.campaign-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.3fr;
  gap: 12px;
  margin-bottom: 24px;
}

.c-stat {
  background: var(--bg-canvas);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 12px;
}

.c-lbl {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.c-val {
  font-size: 1.15rem;
  font-weight: 800;
}

.c-val.green { color: var(--emerald-dark); }
.c-val.red { color: var(--rose); }

/* Live Console Log */
.live-console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.live-console {
  background: #111827;
  border-radius: 14px;
  padding: 16px;
  min-height: 220px;
  max-height: 260px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.log-line {
  color: #a7f3d0;
  line-height: 1.4;
  word-break: break-all;
}

.log-line.fail {
  color: #fca5a5;
}

/* Modals */
.admin-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.admin-modal-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 32px;
  width: 100%;
  max-width: 540px;
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.25s ease;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-header h3 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Filter Select & Table Badges */
.filter-select {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  outline: none;
}

.status-badge-select {
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 4px 8px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  background: #ffffff;
}

@media (max-width: 960px) {
  .outreach-grid {
    grid-template-columns: 1fr;
  }
}
