/* ================================
   RESET & VARIABLES
================================ */
:root {
  --bg-main: #f6f7fb;
  --bg-card: #ffffff;
  --border: #e6e8f0;
  --text-main: #0f172a;
  --text-muted: #6b7280;
  --primary: #6d28d9;
  --primary-soft: #ede9fe;
  --green: #16a34a;
  --green-soft: #dcfce7;
  --red: #ef4444;
  --red-soft: #fee2e2;
  --yellow: #f59e0b;
  --yellow-soft: #fef3c7;
  --blue-soft: #e0ecff;
  --orange-soft: #ffedd5;
  --pink-soft: #fde7f3;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
}

/* ================================
   APP LAYOUT
================================ */
.app {
  display: flex;
  min-height: 100vh;
}

/* ================================
   SIDEBAR
================================ */
.sidebar {
  width: 260px;
  background: #ffffff;
  border-right: 1px solid var(--border);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 26px;
}

.sidebar-logo img {
  width: 150px;
}

.sidebar-logo .subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.sidebar-section {
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  margin: 18px 0 8px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 14px;
  color: #475569;
  border-radius: var(--radius-md);
  text-decoration: none;
  cursor: pointer;
}

.sidebar-link i {
  width: 18px;
  text-align: center;
}

.sidebar-link:hover {
  background: #f1f5f9;
}

.sidebar-link.active {
  background: #21bad6;
  color: #fff;
}

.badge-count {
  margin-left: auto;
  background: var(--red-soft);
  color: var(--red);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ================================
   MAIN AREA
================================ */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ================================
   TOPBAR
================================ */
.topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.search-wrap {
  position: relative;
  width: 420px;
}

.search-wrap i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
}

.search-wrap input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #f9fafb;
  font-size: 14px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.notify {
  position: relative;
  cursor: pointer;
}

.notify i {
  font-size: 18px;
  color: #475569;
}

.notify .dot {
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
}

.profile {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  position: relative;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #21BAD6;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.profile .name {
  font-size: 14px;
  font-weight: 600;
}

.profile .role {
  font-size: 12px;
  color: var(--text-muted);
}

.profile-menu {
  position: absolute;
  top: 110%;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 160px;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
  display: none;
}

.profile-menu.show {
  display: block;
}

.profile-menu a {
  display: block;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-main);
  text-decoration: none;
}

.profile-menu a:hover {
  background: #f1f5f9;
}

/* ================================
   PAGE CONTENT
================================ */
.page {
  padding: 26px 30px 40px;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* Titles */
.page-title {
  font-size: 28px;
  margin: 6px 0 4px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 22px;
}

.page-subtitle span {
  color: var(--primary);
  font-weight: 500;
}

/* ================================
   STATS
================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 26px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  min-height: 96px;
}

.stat-card .icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon.purple { background: var(--primary-soft); color: var(--primary); }
.icon.pink { background: var(--pink-soft); color: #db2777; }
.icon.blue { background: var(--blue-soft); color: #2563eb; }
.icon.orange { background: var(--orange-soft); color: #ea580c; }

.stat-card .label {
  font-size: 13px;
  color: var(--text-muted);
}

.stat-card .value {
  font-size: 22px;
  font-weight: 700;
}

.stat-card .growth {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
  display: inline-block;
  margin-left: 6px;
}

/* ================================
   DASHBOARD GRID
================================ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.card-head h3 {
  margin: 0;
  font-size: 16px;
}

.card-head span {
  font-size: 13px;
  color: var(--text-muted);
}

/* Chart Tabs */
.chart-tabs {
  display: flex;
  gap: 6px;
}

.chart-tabs button {
  background: #f1f5f9;
  border: 1px solid var(--border);
  padding: 6px 12px;
  font-size: 13px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.chart-tabs button.active {
  background: #ffffff;
  color: var(--primary);
  border-color: var(--primary);
}

/* Chart Canvas */
#revenueChart {
  width: 100% !important;
  height: 260px !important;
}

/* ================================
   LIVE CALLS
================================ */
.live-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: #f9fafb;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}

.live-row img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.live-row strong {
  display: block;
  font-size: 14px;
}

.live-row span {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-outline {
  margin-left: auto;
  border: 1px solid var(--primary);
  color: var(--primary);
  background: transparent;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
}

.red-dot {
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.view-all {
  font-size: 13px;
  color: var(--primary);
  cursor: pointer;
}

/* ================================
   ALERTS
================================ */
.alerts {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.alert {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-md);
}

.alert i {
  font-size: 18px;
}

.alert.danger {
  background: var(--red-soft);
  color: var(--red);
}

.alert.warning {
  background: var(--yellow-soft);
  color: var(--yellow);
}

/* ================================
   RESPONSIVE
================================ */
@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================
   INFLUENCER MANAGEMENT
========================= */

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

.page-actions {
  display: flex;
  gap: 12px;
}

.btn-primary {
  background: #6d28d9;
  color: #fff;
  border-radius: 10px;
  padding: 10px 16px;
  border: none;
}

.btn-outline {
  border: 1px solid #e5e7eb;
  background: #fff;
  padding: 10px 14px;
  border-radius: 10px;
}

.influencers-stats .stat-card {
  min-height: 110px;
}

.highlight-warning {
  border-left: 4px solid #f59e0b;
}

.filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 28px 0;
}

.filter-bar select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}

.view-toggle {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.view-toggle i {
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
}

.view-toggle .active {
  background: #eef2ff;
  color: #6d28d9;
}

/* TABLE */
.table-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #eef2f7;
  overflow: hidden;
}

.influencer-table {
  width: 100%;
  border-collapse: collapse;
}

.influencer-table th,
.influencer-table td {
  padding: 16px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
}

.influencer-table th {
  color: #64748b;
  text-align: left;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-cell img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.user-cell span {
  color: #64748b;
  font-size: 13px;
}

.badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.badge.success {
  background: #dcfce7;
  color: #16a34a;
}

.badge.warning {
  background: #ffedd5;
  color: #f97316;
}

.badge.danger {
  background: #fee2e2;
  color: #dc2626;
}

.row-warning {
  background: #fff7ed;
}

/*ends*/

/* =========================
   LIVE CALLS – FINAL OVERRIDES
========================= */

.livecalls-page .page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.btn-export {
  background: #6d28d9;
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* STATS */
.live-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 26px;
}

.live-stat-card {
  background: #fff;
  border: 1px solid #eef2f7;
  border-radius: 14px;
  padding: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.live-stat-card .label {
  font-size: 13px;
  color: #6b7280;
}

.live-stat-card .value {
  font-size: 26px;
  font-weight: 700;
}

.live-stat-card .meta {
  font-size: 13px;
  margin-top: 4px;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon.purple { background: #ede9fe; color: #6d28d9; }
.stat-icon.orange { background: #ffedd5; color: #ea580c; }
.stat-icon.green { background: #dcfce7; color: #16a34a; }

/* FILTER BAR */
.live-filter-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0;
}

.filter-input {
  position: relative;
}

.filter-input i {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  color: #9ca3af;
}

.filter-input input {
  padding: 10px 12px 10px 34px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.live-filter-bar select,
.live-filter-bar input[type="date"] {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.flag-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.clear-filter {
  margin-left: auto;
  font-size: 14px;
  color: #6d28d9;
  cursor: pointer;
}

/* LIVE NOW */
.live-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  margin: 20px 0 14px;
}

.dot-live {
  width: 10px;
  height: 10px;
  background: #22c55e;
  border-radius: 50%;
}

/* LIVE CARDS */
.live-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.live-call-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #eef2f7;
  padding: 18px;
  position: relative;
}

.live-call-card.active {
  border: 2px solid #a78bfa;
}

.badge-live {
  position: absolute;
  top: 14px;
  left: 14px;
  background: #fee2e2;
  color: #dc2626;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
}

.duration {
  text-align: right;
  font-weight: 600;
}

.duration small {
  display: block;
  font-size: 12px;
  color: #94a3b8;
}

/* PARTICIPANTS */
.participants {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin: 18px 0;
}

.participant {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.participant img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.participant span {
  font-size: 14px;
  color: #0f172a;
}

/* RATE */
.rate {
  text-align: center;
  color: #6d28d9;
  font-weight: 600;
  margin-bottom: 16px;
}

/* ACTIONS */
.call-actions {
  display: flex;
  gap: 10px;
}

.btn-monitor {
  flex: 1;
  border: 1px solid #6d28d9;
  color: #6d28d9;
  background: #fff;
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
}

.btn-terminate {
  flex: 1;
  background: #ef4444;
  color: #fff;
  border: none;
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
}

/*ends*/
body .btn.btn-primary {
    width: 100%;
    padding: 13px;
    border-radius: 12px;
    border: none;
    background-color: #21bad6;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease;
}
.btn.btn-primary:hover {
    background-color: #4496c9 !important;
}
body .text-primary{color: #21bad6 !important}
body .btn.cta{background-color: #5cdb5c !important;opacity: 1; transition: 0.3s;}
body .btn.cta:hover{opacity: 0.7;color:#fff; transition: 0.3s;}