/* ═══ VARIABLES & RESET ════════════════════════════════════════════════════ */
:root {
  --orange: #f97316;
  --green:  #166534;
  --green2: #22c55e;
  --cream:  #fffdf5;
  --text:   #1f2937;
  --deep:   #0f172a;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(15,23,42,.09);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top right, #ecfeff 0%, #fffdf5 35%, #fefce8 100%);
}
.container { width: min(1100px, 92%); margin: 0 auto; }
.section-gap { margin-top: 2rem; }

/* ═══ TOPBAR ════════════════════════════════════════════════════════════════ */
.topbar {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #e5e7eb;
  position: sticky; top: 0; z-index: 100;
}
.nav {
  display: flex; align-items: center;
  justify-content: space-between; gap: .8rem;
  padding: .7rem 0;
}
.logo { font-size: 1.1rem; letter-spacing: .3px; margin: 0; white-space: nowrap; }
nav { display: flex; flex-wrap: wrap; gap: .6rem; }
nav a { text-decoration: none; color: var(--green); font-weight: 600; font-size: .9rem; }
nav a:hover { text-decoration: underline; }
.nav-right { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }

/* Nav profile button */
.profile-nav-btn {
  display: flex; align-items: center; gap: .4rem;
  background: #f0fdf4; border: 1px solid #bbf7d0;
  border-radius: 999px; padding: .3rem .7rem .3rem .3rem;
  cursor: pointer; font-weight: 600; color: var(--green); font-size: .88rem;
  transition: background .2s;
}
.profile-nav-btn:hover { background: #dcfce7; }
.nav-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--green2);
}

/* ═══ BUTTONS ═══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-block;
  background: linear-gradient(135deg, #fb923c, #f97316);
  color: white; padding: .7rem 1rem;
  border-radius: var(--radius); text-decoration: none;
  border: none; cursor: pointer; font-weight: 600; font-size: .95rem;
  transition: opacity .2s;
}
.btn:hover { opacity: .88; }
.btn.secondary { background: linear-gradient(135deg, #22c55e, #166534); }
.btn.outline   { background: transparent; color: var(--green); border: 1.5px solid var(--green); }
.btn.ghost     { background: #e2e8f0; color: #0f172a; }
.btn.btn-sm    { padding: .4rem .75rem; font-size: .85rem; }

/* ═══ MODALS ════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 1rem;
}
.modal-card {
  background: white; border-radius: 18px;
  padding: 1.8rem; width: min(420px, 100%);
  box-shadow: 0 24px 48px rgba(15,23,42,.2);
  position: relative; animation: popIn .22s ease;
}
@keyframes popIn {
  from { transform: scale(.92); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.modal-close {
  position: absolute; top: 1rem; right: 1rem;
  border: none; background: #f1f5f9;
  border-radius: 50%; width: 30px; height: 30px;
  cursor: pointer; font-size: 1rem; line-height: 1;
  color: #64748b;
}
.modal-close:hover { background: #e2e8f0; }

/* Login modal */
.login-brand { text-align: center; margin-bottom: 1.4rem; }
.login-paw { font-size: 2.5rem; display: block; }
.login-brand h3 { margin: .4rem 0 .2rem; }
.login-brand p  { color: #64748b; margin: 0; font-size: .9rem; }
.login-options { display: flex; flex-direction: column; gap: .7rem; }
.login-option-btn {
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  padding: .75rem 1rem; border-radius: var(--radius);
  border: 1.5px solid #e5e7eb; background: white;
  font-weight: 600; font-size: .95rem; cursor: pointer; transition: background .15s;
}
.login-option-btn:hover { background: #f8fafc; }
.login-option-btn.google   { border-color: #dadce0; }
.login-option-btn.facebook { background: #1877f2; color: white; border-color: #1877f2; }
.login-option-btn.facebook:hover { background: #166fe5; }
.login-option-btn.visitor  { border-color: #cbd5e1; color: #475569; }

/* Profile modal */
.profile-card { width: min(460px, 100%); }
.profile-header {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1.2rem;
}
.profile-avatar-large {
  width: 72px; height: 72px; border-radius: 50%;
  object-fit: cover; border: 3px solid var(--green2);
  flex-shrink: 0;
}
.profile-info h3  { margin: 0 0 .2rem; font-size: 1.15rem; }
.profile-email    { margin: 0 0 .4rem; color: #64748b; font-size: .88rem; }
.profile-badges   { display: flex; gap: .4rem; flex-wrap: wrap; }
.badge            { padding: .2rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.badge-visitor    { background: #f1f5f9; color: #475569; }
.badge-admin      { background: #dcfce7; color: #166534; }
.badge-provider   { background: #eff6ff; color: #1d4ed8; }

.profile-stats-row {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: .6rem; text-align: center; margin-bottom: 1.2rem;
}
.pstat {
  background: #f8fafc; border-radius: 10px; padding: .7rem .4rem;
}
.pstat strong { display: block; color: var(--green); font-size: 1.3rem; }
.pstat span   { font-size: .78rem; color: #64748b; }

.activity-heading { margin: 0 0 .5rem; font-size: .9rem; color: #64748b; text-transform: uppercase; letter-spacing: .05em; }
.activity-list    { max-height: 200px; overflow-y: auto; }
.activity-item    { display: flex; align-items: flex-start; gap: .6rem; padding: .6rem 0; border-bottom: 1px solid #f1f5f9; }
.ai-icon { font-size: 1.2rem; flex-shrink: 0; }
.ai-body { flex: 1; }
.ai-body strong  { font-size: .9rem; display: block; }
.ai-body p       { margin: .1rem 0; font-size: .82rem; color: #64748b; }
.ai-body small   { color: #94a3b8; font-size: .78rem; }
.no-activity     { text-align: center; color: #94a3b8; font-size: .88rem; padding: .8rem 0; }
.no-activity a   { color: var(--green); }
.profile-logout-btn { width: 100%; margin-top: .8rem; }

/* Status badges */
.status-badge     { padding: .18rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.sb-pending       { background: #fef3c7; color: #92400e; }
.sb-resolved      { background: #dcfce7; color: #166534; }
.sb-active        { background: #eff6ff; color: #1d4ed8; }

/* ═══ HERO ══════════════════════════════════════════════════════════════════ */
.hero { padding: 2rem 0; background: linear-gradient(135deg,#ffffff,#f0fdf4); }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 2rem; align-items: center; }
.hero img  { width: 100%; border-radius: var(--radius); object-fit: cover; min-height: 260px; box-shadow: 0 12px 32px rgba(15,23,42,.18); }
.cta-group { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }

/* ═══ STATS ═════════════════════════════════════════════════════════════════ */
.stats { display: grid; grid-template-columns: repeat(4,1fr); gap: .7rem; margin: 1.5rem auto; }
.stats div { background: white; padding: 1rem; border-radius: var(--radius); text-align: center; box-shadow: var(--shadow); }
.stats strong { display: block; color: var(--green); font-size: 1.4rem; }

/* ═══ CARDS ═════════════════════════════════════════════════════════════════ */
.cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; margin-top: 1rem; }
.card  { background: white; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.card img    { width: 100%; height: 180px; object-fit: cover; }
.card h4, .card p { padding: 0 .8rem; }

/* ═══ PANELS ════════════════════════════════════════════════════════════════ */
.panel { background: rgba(255,255,255,.96); padding: 1.2rem; border-radius: 16px; box-shadow: var(--shadow); }
form   { display: grid; gap: .6rem; }
input, textarea, select, button { padding: .7rem; border: 1px solid #d1d5db; border-radius: 10px; font: inherit; }
textarea { min-height: 90px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--green2); border-color: var(--green2); }
.emergency  { color: #dc2626; font-weight: 700; }
.whatsapp   { display: inline-block; margin-bottom: .8rem; color: white; background: #25d366; padding: .5rem .9rem; border-radius: 8px; text-decoration: none; font-weight: 600; }
.fund-note  { color: #64748b; font-size: .88rem; }
.form-status { padding: .6rem .8rem; border-radius: 8px; font-weight: 600; display: block; margin-top: .4rem; }
.form-status.success { background: #dcfce7; color: #166534; }
.form-status.error   { background: #fee2e2; color: #991b1b; }

/* Status in login modal */
.status { padding: .6rem .8rem; border-radius: 8px; font-weight: 600; font-size: .88rem; }
.status.neutral { background: #f1f5f9; color: #334155; }
.status.success { background: #dcfce7; color: #166534; }
.status.warning { background: #ffedd5; color: #9a3412; }

/* ═══ TEAM ══════════════════════════════════════════════════════════════════ */
.team { display: grid; grid-template-columns: repeat(3,1fr); gap: .8rem; margin-top: .8rem; }
.team div { background: white; padding: 1rem; border-radius: var(--radius); box-shadow: var(--shadow); text-align: center; }
iframe { width: 100%; min-height: 240px; border: 0; border-radius: 10px; margin-top: .6rem; }

/* ═══ CHAT ══════════════════════════════════════════════════════════════════ */
.chatbox {
  position: fixed; right: 1rem; bottom: 1rem;
  width: min(360px,92vw);
  background: rgba(255,255,255,.98);
  border: 1px solid #dbeafe;
  border-radius: 18px; padding: .8rem;
  box-shadow: 0 22px 40px rgba(59,130,246,.2);
  z-index: 90;
}
.chatbox.minimized { width: auto; padding: .4rem .6rem; border-radius: 999px; }
.chatbox.minimized h4, .chatbox.minimized #chatMessages, .chatbox.minimized #chatForm { display: none; }
.chat-toggle {
  float: right; border-radius: 999px; border: none;
  padding: .35rem .75rem;
  background: linear-gradient(135deg,#1d4ed8,#2563eb);
  color: #fff; font-size: .82rem; font-weight: 700; cursor: pointer;
}
#chatMessages { max-height: 170px; overflow: auto; background: #f8fafc; padding: .5rem; border-radius: 8px; margin: .5rem 0; }
.msg          { margin: .3rem 0; font-size: .88rem; }
.msg.bot      { color: var(--green); }
.msg.user     { color: #111827; text-align: right; }

/* ═══ ADMIN DASHBOARD ═══════════════════════════════════════════════════════ */
.admin-panel {
  background: rgba(255,255,255,.97);
  padding: 1.5rem; border-radius: 18px;
  box-shadow: var(--shadow);
}
.admin-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 1.2rem;
}
.admin-header h3 { margin: 0; font-size: 1.25rem; }
.admin-subtitle   { margin: .2rem 0 0; color: #64748b; font-size: .85rem; }

/* Admin summary cards */
.admin-summary {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: .8rem; margin-bottom: 1.4rem;
}
.ascard {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .15rem; background: #f0fdf4; border: 1px solid #bbf7d0;
  border-radius: 14px; padding: 1rem .5rem; text-align: center;
}
.ascard.orange { background: #fff7ed; border-color: #fed7aa; }
.ascard.red    { background: #fef2f2; border-color: #fecaca; }
.asicon { font-size: 1.4rem; }
.ascard strong { font-size: 1.5rem; color: var(--deep); line-height: 1.1; }
.ascard small  { color: #64748b; font-size: .78rem; }

/* Admin tabs */
.admin-tabs {
  display: flex; gap: .5rem; flex-wrap: wrap;
  border-bottom: 2px solid #e5e7eb; margin-bottom: 1rem;
}
.tab-btn {
  padding: .55rem 1rem; border: none; background: none;
  font-weight: 600; font-size: .9rem; color: #64748b;
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; border-radius: 8px 8px 0 0;
  transition: color .15s;
}
.tab-btn.active { color: var(--green); border-bottom-color: var(--green); background: #f0fdf4; }
.tab-btn:hover:not(.active) { color: var(--text); background: #f8fafc; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Admin data cards */
.admin-cards { display: grid; gap: .75rem; }
.admin-card {
  background: white; border: 1px solid #e5e7eb;
  border-radius: 12px; padding: 1rem; box-shadow: 0 2px 8px rgba(15,23,42,.05);
}
.admin-card.ac-resolved { opacity: .65; border-color: #bbf7d0; }
.ac-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: .5rem; gap: .5rem;
}
.ac-top strong { font-size: .95rem; flex: 1; }
.ac-condition { margin: .3rem 0; color: #374151; font-size: .9rem; }
.ac-meta {
  display: flex; flex-wrap: wrap; gap: .4rem .9rem;
  font-size: .82rem; color: #6b7280; margin-top: .5rem;
}
.ac-img-link   { font-size: .85rem; color: #1d4ed8; text-decoration: none; display: inline-block; margin-top: .4rem; }
.ac-resolve-btn { margin-top: .6rem; }
.resolved-label { color: #166534; font-weight: 700; font-size: .85rem; display: inline-block; margin-top: .6rem; }
.empty-state   { color: #94a3b8; text-align: center; padding: 1.5rem; }

/* Message cards in admin */
.msg-card { border-left: 3px solid #cbd5e1; }
.msg-card.msg-user { border-left-color: #6366f1; }
.msg-card.msg-bot  { border-left-color: var(--green); }
.msg-who { font-size: .8rem; font-weight: 700; color: #64748b; display: block; margin-bottom: .3rem; }
.msg-card p     { margin: 0 0 .3rem; font-size: .9rem; }
.msg-card small { color: #94a3b8; font-size: .78rem; }

/* ═══ RESPONSIVE ════════════════════════════════════════════════════════════ */
@media (max-width: 860px) {
  .hero-grid, .cards, .team { grid-template-columns: 1fr; }
  .stats         { grid-template-columns: repeat(2,1fr); }
  .admin-summary { grid-template-columns: repeat(2,1fr); }
  nav { display: none; }
  .logo { font-size: .95rem; }
}
@media (max-width: 480px) {
  .stats, .admin-summary { grid-template-columns: 1fr 1fr; }
  .profile-stats-row     { grid-template-columns: 1fr 1fr 1fr; }
}
