/* =========================================
   RESET
========================================= */

*{
  box-sizing:border-box;
}

body{
  margin:0;
  font-family:Inter,Arial,sans-serif;
  background:#f5f7fb;
  color:#111827;
}

/* =========================================
   LAYOUT
========================================= */

.dashboard{
  max-width:1200px;
  margin:auto;
  padding:1rem;
}

.topbar{
  margin-bottom:1.5rem;
}

h1{
  margin:0;
  font-size:1.8rem;
  font-weight:800;
}

.subtitle{
  margin-top:.4rem;
  color:#6b7280;
  font-size:.95rem;
}

/* =========================================
   FILTERS
========================================= */

.filters{
  display:flex;
  gap:.75rem;
  margin:1.5rem 0 1rem;
  flex-wrap:wrap;
}

.filters button{
  border:none;
  background:white;
  border:1px solid #dbe3ee;
  color:#374151;
  padding:.8rem 1rem;
  border-radius:12px;
  font-weight:600;
  cursor:pointer;
  transition:.2s;
  flex:1;
  min-width:90px;
}

.filters button.active{
  background:#2563eb;
  color:white;
  border-color:#2563eb;
}

/* =========================================
   SUMMARY CARDS
========================================= */

.summary-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:1rem;
  margin-bottom:1.5rem;
}

.summary-card{
  background:white;
  border-radius:18px;
  padding:1.25rem;
  border:1px solid #e5e7eb;
  box-shadow:0 4px 14px rgba(0,0,0,0.04);
}

.summary-label{
  font-size:.9rem;
  color:#6b7280;
  margin-bottom:.5rem;
}

.summary-value{
  font-size:2rem;
  font-weight:800;
}

/* =========================================
   ACTIONS
========================================= */

.analytics-actions{
  background:white;
  border:1px solid #e5e7eb;
  border-radius:18px;
  padding:1rem;
  margin-bottom:1.5rem;
  display:flex;
  flex-direction:column;
  gap:.75rem;
}

.analytics-actions input{
  width:100%;
  padding:.9rem;
  border-radius:12px;
  border:1px solid #d1d5db;
  font-size:1rem;
}

.action-buttons{
  display:flex;
  gap:.75rem;
}

.btn{
  flex:1;
  border:none;
  padding:.9rem;
  border-radius:12px;
  font-weight:700;
  cursor:pointer;
}

.btn-danger{
  background:#ef4444;
  color:white;
}

/* =========================================
   BUSINESS LIST
========================================= */

.section-title{
  margin:0 0 1rem;
  font-size:1.25rem;
  font-weight:800;
}

.business-list{
  display:flex;
  flex-direction:column;
  gap:1rem;
}

/* =========================================
   BUSINESS CARD
========================================= */

.business-card{
  background:white;
  border-radius:20px;
  border:1px solid #e5e7eb;
  overflow:hidden;
  box-shadow:0 4px 18px rgba(0,0,0,0.04);
}

.business-main{
  padding:1.2rem;
}

.business-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:1rem;
}

.business-name{
  font-size:1.05rem;
  font-weight:800;
  margin:0;
  word-break:break-word;
}

.views-badge{
  background:#eff6ff;
  color:#2563eb;
  font-weight:700;
  padding:.45rem .8rem;
  border-radius:999px;
  font-size:.9rem;
  white-space:nowrap;
}

.quick-stats{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:.75rem;
  margin-top:1rem;
}

.stat-box{
  background:#f8fafc;
  border-radius:14px;
  padding:.9rem;
}

.stat-label{
  font-size:.8rem;
  color:#6b7280;
  margin-bottom:.25rem;
}

.stat-value{
  font-weight:800;
  font-size:1rem;
}

/* =========================================
   EXPAND BUTTON
========================================= */

.expand-btn{
  width:100%;
  border:none;
  background:#f9fafb;
  border-top:1px solid #e5e7eb;
  padding:1rem;
  font-weight:700;
  cursor:pointer;
  color:#2563eb;
}

/* =========================================
   EXPANDED DETAILS
========================================= */

.business-details{
  display:none;
  padding:1rem 1.2rem 1.5rem;
  border-top:1px solid #f1f5f9;
  background:#fcfcfd;
}

.business-details.open{
  display:block;
}

.detail-group{
  margin-bottom:1.25rem;
}

.detail-group:last-child{
  margin-bottom:0;
}

.detail-title{
  font-size:.9rem;
  font-weight:800;
  margin-bottom:.65rem;
}

.info-list{
  display:flex;
  flex-direction:column;
  gap:.5rem;
}

.info-item{
  background:white;
  border:1px solid #eef2f7;
  border-radius:12px;
  padding:.75rem .9rem;
  font-size:.92rem;
}

/* ======================================
   LIVE VISITOR BADGE
====================================== */

.live-badge{
  display:inline-flex;
  align-items:center;
  gap:6px;

  padding:6px 12px;

  background:#e8f8ec;
  color:#1d7a37;

  border:1px solid #7ddf9b;
  border-radius:999px;

  font-size:13px;
  font-weight:600;
}

.live-badge::before{
  content:"";
  width:8px;
  height:8px;
  border-radius:50%;
  background:#22c55e;

  animation:livePulse 1.8s infinite ease-in-out;
}

@keyframes livePulse{

  0%{
    transform:scale(1);
    opacity:1;
  }

  50%{
    transform:scale(1.4);
    opacity:.6;
  }

  100%{
    transform:scale(1);
    opacity:1;
  }

}

/* =========================================
   TABLET+
========================================= */

@media(min-width:768px){

  .dashboard{
    padding:2rem;
  }

  .summary-grid{
    grid-template-columns:repeat(4,1fr);
  }

  .analytics-actions{
    flex-direction:row;
    align-items:center;
  }

  .analytics-actions input{
    max-width:220px;
  }

  .action-buttons{
    margin-left:auto;
    width:auto;
  }

  .btn{
    width:180px;
    flex:none;
  }

  .quick-stats{
    grid-template-columns:repeat(4,1fr);
  }
  }
