/* ============================================================
   Wesearch Admin Portal — Stylesheet
   ============================================================ */

/* Admin login page */
.admin-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #062847;
  font-family: 'DM Sans', sans-serif;
}
.admin-login-box {
  background: #fff;
  border-radius: 16px;
  padding: 48px 44px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
}
.admin-login-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #062847;
  margin-bottom: 6px;
}
.admin-login-logo span { color: #1a7a4a; }
.admin-login-sub {
  font-size: 0.82rem;
  color: #6b7a8d;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.admin-login-sub::before {
  content: '';
  width: 28px; height: 1px;
  background: #e2e8f0;
}
.aform-group { margin-bottom: 18px; }
.aform-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #062847;
  margin-bottom: 6px;
}
.aform-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: #2d3748;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.aform-input:focus { border-color: #062847; }
.admin-login-btn {
  width: 100%;
  background: #062847;
  color: #fff;
  border: none;
  padding: 13px;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.2s;
}
.admin-login-btn:hover { background: #0a3d6b; }
.admin-login-error {
  background: #fdecea;
  border: 1px solid #f5c6cb;
  color: #721c24;
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 0.82rem;
  margin-bottom: 14px;
  display: none;
}
.admin-login-error.show { display: block; }
.admin-back-link {
  text-align: center;
  margin-top: 20px;
  font-size: 0.82rem;
  color: #6b7a8d;
}
.admin-back-link a { color: #1a7a4a; cursor: pointer; font-weight: 600; }

/* ── Admin Shell ──────────────────────────────────────── */
#adminShell {
  display: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: #2d3748;
  background: #f1f4f8;
  min-height: 100vh;
}
#adminShell.active { display: block; }

.a-topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: #062847;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.a-topbar-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
}
.a-topbar-logo span { color: #5dbb8b; }
.a-topbar-center {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.a-topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.a-role-badge {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8);
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 100px;
  border: 0.5px solid rgba(255,255,255,0.2);
}
.a-avatar {
  width: 30px; height: 30px;
  background: #5dbb8b;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 0.7rem; font-weight: 600;
  cursor: pointer;
}
.a-notif {
  position: relative;
  cursor: pointer;
  display: flex; align-items: center;
}
.a-notif-dot {
  position: absolute; top: -2px; right: -2px;
  width: 7px; height: 7px;
  background: #e74c3c;
  border-radius: 50%;
  border: 1px solid #062847;
}
.a-logout-btn {
  background: rgba(255,255,255,0.08);
  border: 0.5px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.75);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.15s;
}
.a-logout-btn:hover { background: rgba(255,255,255,0.15); }

.a-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  min-height: calc(100vh - 52px);
}

/* ── Sidebar ────────────────────────────────────────────── */
.a-sidebar {
  background: #062847;
  padding: 16px 0 32px;
  overflow-y: auto;
  position: sticky;
  top: 52px;
  height: calc(100vh - 52px);
}
.a-nav-group {
  font-size: 9.5px;
  font-weight: 600;
  color: rgba(255,255,255,0.3);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 16px 16px 5px;
}
.a-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  cursor: pointer;
  font-size: 12.5px;
  color: rgba(255,255,255,0.6);
  border-left: 2.5px solid transparent;
  transition: all 0.12s;
  text-decoration: none;
  white-space: nowrap;
}
.a-nav-item:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.9); }
.a-nav-item.active { background: rgba(255,255,255,0.1); color: #fff; border-left-color: #5dbb8b; }
.a-nav-icon { font-size: 14px; width: 16px; text-align: center; flex-shrink: 0; }
.a-nav-badge {
  margin-left: auto;
  background: rgba(231,76,60,0.9);
  color: #fff;
  font-size: 9.5px;
  padding: 1px 6px;
  border-radius: 100px;
  flex-shrink: 0;
}

/* ── Main content ───────────────────────────────────────── */
.a-main {
  padding: 24px;
  overflow-y: auto;
  background: #f1f4f8;
}
.a-section { display: none; }
.a-section.active { display: block; }

.a-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}
.a-page-title { font-size: 16px; font-weight: 600; color: #062847; }
.a-page-sub { font-size: 12px; color: #6b7a8d; margin-top: 2px; }
.a-page-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }

/* ── Stat cards ─────────────────────────────────────────── */
.a-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.a-stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 18px;
}
.a-stat-label { font-size: 11.5px; color: #6b7a8d; margin-bottom: 6px; }
.a-stat-val { font-size: 22px; font-weight: 600; color: #062847; line-height: 1; }
.a-stat-change { font-size: 11px; margin-top: 5px; }
.a-up { color: #1a7a4a; } .a-dn { color: #c0392b; } .a-neu { color: #6b7a8d; }

/* ── Cards ──────────────────────────────────────────────── */
.a-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
}
.a-card-header {
  padding: 14px 18px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  background: #fff;
}
.a-card-title { font-size: 13.5px; font-weight: 600; color: #062847; }
.a-card-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── Tables ─────────────────────────────────────────────── */
.a-table-wrap { overflow-x: auto; }
.a-table {
  width: 100%;
  border-collapse: collapse;
}
.a-table th {
  font-size: 11px;
  font-weight: 600;
  color: #6b7a8d;
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  background: #f8f9fb;
  white-space: nowrap;
}
.a-table td {
  font-size: 12.5px;
  padding: 10px 16px;
  border-bottom: 1px solid #e2e8f0;
  color: #2d3748;
  vertical-align: middle;
}
.a-table tr:last-child td { border-bottom: none; }
.a-table tr:hover td { background: #f8f9fb; }
.a-table td.mono { font-family: 'Courier New', monospace; font-size: 11px; }

/* ── Buttons ─────────────────────────────────────────────── */
.a-btn {
  border: 1px solid #c9d3df;
  background: #fff;
  color: #2d3748;
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 12px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
  white-space: nowrap;
}
.a-btn:hover { background: #f8f9fb; border-color: #062847; }
.a-btn-primary { background: #062847; color: #fff; border-color: #062847; }
.a-btn-primary:hover { background: #0a3d6b; }
.a-btn-green { background: #1a7a4a; color: #fff; border-color: #1a7a4a; }
.a-btn-green:hover { background: #22a062; }
.a-btn-danger { background: #fdecea; color: #9b1c1c; border-color: #f5c6cb; }
.a-btn-danger:hover { background: #fbd5d5; }
.a-btn-sm { padding: 4px 10px; font-size: 11px; }
.a-btn-lk { background: none; border: none; color: #0a5fa0; cursor: pointer; font-size: 12px; padding: 0; font-family: 'DM Sans', sans-serif; font-weight: 500; }

/* ── Form elements ──────────────────────────────────────── */
.a-search {
  border: 1px solid #c9d3df;
  background: #fff;
  color: #2d3748;
  padding: 7px 12px;
  border-radius: 7px;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  width: 200px;
  outline: none;
}
.a-search:focus { border-color: #062847; }
.a-sel {
  border: 1px solid #c9d3df;
  background: #fff;
  color: #2d3748;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  outline: none;
}
.a-fl { display: block; font-size: 11.5px; font-weight: 600; color: #062847; margin-bottom: 5px; }
.a-fi {
  border: 1px solid #c9d3df;
  background: #fff;
  color: #2d3748;
  padding: 9px 12px;
  border-radius: 7px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  width: 100%;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.a-fi:focus { border-color: #062847; }
.a-fi:read-only { background: #f8f9fb; color: #6b7a8d; }
textarea.a-fi { resize: vertical; min-height: 80px; }
.a-fg { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.a-frow { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.a-f3row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* Toggle */
.a-toggle { position: relative; display: inline-block; width: 36px; height: 20px; flex-shrink: 0; }
.a-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.a-toggle-track { position: absolute; inset: 0; background: #c9d3df; border-radius: 100px; cursor: pointer; transition: background 0.2s; }
.a-toggle input:checked + .a-toggle-track { background: #1a7a4a; }
.a-toggle-track::after { content: ''; position: absolute; width: 15px; height: 15px; left: 2.5px; top: 2.5px; background: #fff; border-radius: 50%; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.a-toggle input:checked + .a-toggle-track::after { transform: translateX(16px); }

/* ── Badges ──────────────────────────────────────────────── */
.a-badge { display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 600; padding: 2px 9px; border-radius: 100px; white-space: nowrap; }
.a-bg { background: #e8f5ee; color: #0f5c2f; }
.a-br { background: #fdecea; color: #9b1c1c; }
.a-ba { background: #fef3c7; color: #78420a; }
.a-bb { background: #e8f0fe; color: #1a4f9c; }
.a-bx { background: #f1f4f8; color: #6b7a8d; }

/* ── Alert bars ─────────────────────────────────────────── */
.a-alert { padding: 10px 14px; border-radius: 8px; font-size: 12px; margin-bottom: 14px; border-left: 3px solid; }
.a-alert-info { background: #e8f0fe; color: #1a4f9c; border-left-color: #1a4f9c; }
.a-alert-warn { background: #fef3c7; color: #78420a; border-left-color: #d97706; }
.a-alert-success { background: #e8f5ee; color: #0f5c2f; border-left-color: #1a7a4a; }
.a-alert-danger { background: #fdecea; color: #9b1c1c; border-left-color: #c0392b; }

/* ── Modals ──────────────────────────────────────────────── */
.a-modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(6,40,71,0.55);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}
.a-modal-overlay.active { display: flex; }
.a-modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.2);
  animation: aModalIn 0.22s ease;
}
.a-modal.wide { max-width: 640px; }
@keyframes aModalIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.a-modal-header { padding: 22px 24px 0; display: flex; justify-content: space-between; align-items: flex-start; }
.a-modal-header h3 { font-size: 15px; font-weight: 600; color: #062847; }
.a-modal-close { background: #f1f4f8; border: none; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; color: #6b7a8d; transition: background 0.15s; flex-shrink: 0; }
.a-modal-close:hover { background: #e2e8f0; }
.a-modal-body { padding: 18px 24px 24px; }
.a-modal-footer { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; padding-top: 14px; border-top: 1px solid #e2e8f0; }

/* ── Side panel ─────────────────────────────────────────── */
.a-side-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 440px;
  background: #fff;
  border-left: 1px solid #e2e8f0;
  z-index: 500;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
  box-shadow: -4px 0 24px rgba(0,0,0,0.1);
}
.a-side-panel.open { transform: translateX(0); }
.a-panel-head {
  padding: 18px 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0;
  background: #fff; z-index: 2;
}
.a-panel-head h3 { font-size: 14px; font-weight: 600; color: #062847; }
.a-panel-body { padding: 20px; }

/* ── Stepper ─────────────────────────────────────────────── */
.a-stepper { display: flex; align-items: center; margin-bottom: 24px; }
.a-step { display: flex; align-items: center; gap: 8px; flex: 1; }
.a-step:last-child { flex: 0; }
.a-step-n { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.a-step-n.done { background: #1a7a4a; color: #fff; }
.a-step-n.curr { background: #062847; color: #fff; }
.a-step-n.todo { background: #f1f4f8; color: #6b7a8d; border: 1px solid #c9d3df; }
.a-step-lbl { font-size: 11.5px; color: #6b7a8d; }
.a-step-lbl.curr { color: #062847; font-weight: 600; }
.a-step-line { flex: 1; height: 1px; background: #c9d3df; margin: 0 8px; }
.a-step-content { display: none; }
.a-step-content.active { display: block; }

/* ── Setting rows ────────────────────────────────────────── */
.a-srow { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid #e2e8f0; }
.a-srow:last-child { border-bottom: none; }
.a-srow h4 { font-size: 12.5px; font-weight: 600; color: #062847; }
.a-srow p { font-size: 11.5px; color: #6b7a8d; margin-top: 2px; }

/* ── Two / three col ─────────────────────────────────────── */
.a-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.a-three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ── Gateway rows ────────────────────────────────────────── */
.a-gw-row { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.a-gw-logo { width: 44px; height: 26px; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex-shrink: 0; }

/* ── Poll options ────────────────────────────────────────── */
.a-poll-opt-row { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.a-poll-opt-input { flex: 1; border: 1px solid #c9d3df; background: #fff; color: #2d3748; padding: 8px 10px; border-radius: 7px; font-size: 12.5px; font-family: 'DM Sans', sans-serif; outline: none; }
.a-poll-opt-input:focus { border-color: #062847; }

/* ── Progress bar ────────────────────────────────────────── */
.a-prog { height: 7px; background: #e2e8f0; border-radius: 100px; overflow: hidden; margin-top: 10px; }
.a-prog-fill { height: 100%; background: #1a7a4a; border-radius: 100px; transition: width 0.4s ease; }

/* ── Result bars ─────────────────────────────────────────── */
.a-res-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.a-res-lbl { width: 180px; font-size: 12px; color: #2d3748; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.a-res-bar { flex: 1; height: 8px; background: #e2e8f0; border-radius: 100px; overflow: hidden; }
.a-res-fill { height: 100%; border-radius: 100px; background: #1a7a4a; }
.a-res-pct { font-size: 12px; font-weight: 600; color: #062847; width: 36px; text-align: right; flex-shrink: 0; }

/* ── File drop ───────────────────────────────────────────── */
.a-file-drop { border: 2px dashed #c9d3df; border-radius: 8px; padding: 28px; text-align: center; cursor: pointer; transition: border-color 0.15s; }
.a-file-drop:hover { border-color: #062847; }
.a-file-drop .fd-title { font-size: 13px; font-weight: 600; color: #062847; }
.a-file-drop p { font-size: 11.5px; color: #6b7a8d; margin-top: 6px; }

/* ── Activity feed ───────────────────────────────────────── */
.a-act-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid #e2e8f0; align-items: flex-start; }
.a-act-item:last-child { border-bottom: none; }
.a-act-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.a-act-text { font-size: 12.5px; color: #2d3748; line-height: 1.4; }
.a-act-time { font-size: 11px; color: #9aa5b1; margin-top: 2px; }

/* ── Tag chips ───────────────────────────────────────────── */
.a-tag-wrap { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.a-tag-chip { background: #f1f4f8; border: 1px solid #c9d3df; border-radius: 100px; padding: 4px 12px; font-size: 11.5px; color: #2d3748; cursor: pointer; transition: all 0.15s; }
.a-tag-chip.selected { background: #e8f5ee; border-color: #1a7a4a; color: #0f5c2f; }

/* ── Confirm modal ───────────────────────────────────────── */
.a-confirm-box { text-align: center; padding: 12px 0 6px; }
.a-confirm-icon { font-size: 36px; margin-bottom: 14px; }
.a-confirm-box h4 { font-size: 15px; font-weight: 600; color: #062847; margin-bottom: 7px; }
.a-confirm-box p { font-size: 12.5px; color: #6b7a8d; line-height: 1.6; max-width: 340px; margin: 0 auto; }

/* ── Detail grid ─────────────────────────────────────────── */
.a-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; margin-bottom: 16px; }
.a-dg-lbl { font-size: 10.5px; color: #6b7a8d; margin-bottom: 2px; text-transform: uppercase; letter-spacing: 0.5px; }
.a-dg-val { font-size: 12.5px; font-weight: 600; color: #062847; }

/* ── Toast ───────────────────────────────────────────────── */
.a-toast-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.a-toast { background: #062847; color: #fff; padding: 11px 16px; border-radius: 9px; font-size: 12.5px; font-weight: 500; font-family: 'DM Sans', sans-serif; display: flex; align-items: center; gap: 9px; max-width: 320px; box-shadow: 0 4px 16px rgba(0,0,0,0.2); animation: aToastIn 0.2s ease; }
.a-toast.t-ok { background: #1a7a4a; }
.a-toast.t-err { background: #c0392b; }
@keyframes aToastIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

/* ── Charts ──────────────────────────────────────────────── */
.a-chart-wrap { position: relative; width: 100%; height: 180px; }

/* ── Pagination ──────────────────────────────────────────── */
.a-pag { display: flex; justify-content: center; gap: 6px; margin-top: 14px; }
.a-pb { width: 32px; height: 32px; border-radius: 7px; border: 1px solid #c9d3df; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; cursor: pointer; color: #2d3748; transition: all 0.12s; }
.a-pb.active { background: #062847; border-color: #062847; color: #fff; }
.a-pb:hover:not(.active) { border-color: #062847; }

/* ── Thread messages ─────────────────────────────────────── */
.a-thread { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.a-msg { border-radius: 8px; padding: 10px 14px; }
.a-msg-in { background: #f1f4f8; }
.a-msg-out { background: #e8f5ee; }
.a-msg-meta { font-size: 10.5px; color: #9aa5b1; margin-bottom: 4px; }
.a-msg-text { font-size: 12.5px; color: #2d3748; line-height: 1.5; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1100px) {
  .a-layout { grid-template-columns: 180px 1fr; }
  .a-stats { grid-template-columns: 1fr 1fr; }
  .a-three { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .a-layout { grid-template-columns: 1fr; }
  .a-sidebar { display: none; }
  .a-stats { grid-template-columns: 1fr 1fr; }
  .a-two { grid-template-columns: 1fr; }
  .a-three { grid-template-columns: 1fr; }
  .a-frow { grid-template-columns: 1fr; }
  .a-side-panel { width: 100%; }
  .a-main { padding: 14px; }
  .a-modal { max-width: 100%; border-radius: 16px 16px 0 0; }
  .a-modal-overlay { align-items: flex-end; }
}
