/* Dashboard Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #8b5cf6;
  --secondary-dark: #7c3aed;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --dark: #1e293b;
  --dark-light: #334155;
  --light: #f8fafc;
  --white: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  --sidebar-width: 260px;
}

body {
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--light);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--white);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-header {
  padding: 30px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
  font-size: 1.8rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 5px;
}

.tagline {
  font-size: 0.85rem;
  color: var(--text-light);
}

.sidebar-nav {
  flex: 1;
  padding: 20px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 25px;
  color: var(--text);
  text-decoration: none;
  transition: all 0.3s;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: var(--light);
  border-left-color: var(--primary);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, transparent 100%);
  border-left-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

.nav-item .icon {
  font-size: 1.3rem;
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--border);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.user-info h4 {
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.user-info p {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Top Bar */
.topbar {
  background: var(--white);
  padding: 20px 30px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.search-bar {
  position: relative;
  flex: 1;
  max-width: 500px;
}

.search-bar input {
  width: 100%;
  padding: 12px 45px 12px 20px;
  border: 1px solid var(--border);
  border-radius: 25px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.3s;
}

.search-bar input:focus {
  border-color: var(--primary);
}

.search-icon {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
}

.topbar-actions {
  display: flex;
  gap: 15px;
  align-items: center;
}

.notification-btn {
  position: relative;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
}

.notification-btn .badge {
  position: absolute;
  top: 5px;
  right: 5px;
  background: var(--danger);
  color: var(--white);
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 10px;
}

/* Buttons */
.btn-primary,
.btn-secondary {
  padding: 10px 25px;
  border-radius: 25px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: var(--white);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: var(--white);
  color: var(--primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--primary);
}

.btn-sm {
  padding: 6px 15px;
  font-size: 0.85rem;
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn-icon {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 5px;
}

/* Dashboard Content */
.dashboard-content {
  padding: 30px;
  flex: 1;
}

/* Welcome Section */
.welcome-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.welcome-section h1 {
  font-size: 2rem;
  margin-bottom: 5px;
}

.welcome-section p {
  color: var(--text-light);
}

.quick-actions {
  display: flex;
  gap: 10px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--white);
  padding: 25px;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.12);
  border-color: var(--primary);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.stat-header h3 {
  font-size: 0.95rem;
  color: var(--text-light);
  font-weight: 500;
}

.stat-header .icon {
  font-size: 1.8rem;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 10px;
}

.stat-change {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.9rem;
  margin-bottom: 15px;
}

.stat-change.positive {
  color: var(--success);
}

.stat-change.warning {
  color: var(--warning);
}

.stat-change.danger {
  color: var(--danger);
}

.stat-change .text {
  color: var(--text-light);
}

.stat-action {
  width: 100%;
  padding: 10px;
  background: var(--light);
  border: none;
  border-radius: 8px;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}

.stat-action:hover {
  background: rgba(102, 126, 234, 0.1);
}

.mini-chart {
  display: flex;
  gap: 5px;
  align-items: flex-end;
  height: 40px;
}

.mini-chart .bar {
  flex: 1;
  background: linear-gradient(180deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: 3px;
  min-height: 10px;
}

/* AI Insights */
.ai-insights {
  margin-bottom: 40px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-header h2 {
  font-size: 1.5rem;
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.insight-card {
  background: var(--white);
  padding: 25px;
  border-radius: 15px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 20px;
  border-left: 4px solid var(--primary);
}

.insight-card.priority-high {
  border-left-color: var(--danger);
}

.insight-card.priority-medium {
  border-left-color: var(--warning);
}

.insight-card.priority-low {
  border-left-color: var(--success);
}

.insight-icon {
  font-size: 2.5rem;
}

.insight-content h4 {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.insight-content p {
  color: var(--text-light);
  margin-bottom: 15px;
  line-height: 1.6;
}

/* Recent Section */
.recent-section {
  margin-bottom: 40px;
}

.table-container {
  background: var(--white);
  border-radius: 15px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  background: var(--light);
}

.data-table th {
  padding: 15px;
  text-align: left;
  font-weight: 600;
  color: var(--text-light);
  font-size: 0.9rem;
}

.data-table td {
  padding: 15px;
  border-top: 1px solid var(--border);
}

.customer-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-sm {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}

.badge-type {
  padding: 5px 12px;
  border-radius: 15px;
  font-size: 0.85rem;
  font-weight: 600;
}

.badge-type.payment-in {
  background: rgba(76, 175, 80, 0.1);
  color: var(--success);
}

.badge-type.payment-out {
  background: rgba(244, 67, 54, 0.1);
  color: var(--danger);
}

.amount {
  font-weight: 700;
  font-size: 1.05rem;
}

.amount.positive {
  color: var(--success);
}

.amount.negative {
  color: var(--danger);
}

.status-badge {
  padding: 5px 12px;
  border-radius: 15px;
  font-size: 0.85rem;
  font-weight: 600;
}

.status-badge.success {
  background: rgba(76, 175, 80, 0.1);
  color: var(--success);
}

.status-badge.pending {
  background: rgba(255, 193, 7, 0.1);
  color: var(--warning);
}

/* Marketing Section */
.marketing-section {
  margin-bottom: 40px;
}

.marketing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
}

.marketing-card {
  background: var(--white);
  padding: 25px;
  border-radius: 15px;
  box-shadow: var(--shadow);
}

.marketing-card h4 {
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.metric .label {
  font-size: 0.85rem;
  color: var(--text-light);
}

.metric .value {
  font-size: 1.5rem;
  font-weight: 700;
}

.metric .value.success {
  color: var(--success);
}

.progress-bar {
  height: 8px;
  background: var(--light);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: 10px;
}

.metric-note {
  font-size: 0.85rem;
  color: var(--text-light);
}

.campaign-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.campaign-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: var(--light);
  border-radius: 8px;
}

.campaign-status {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.campaign-status.active {
  background: rgba(76, 175, 80, 0.1);
  color: var(--success);
}

.campaign-status.paused {
  background: rgba(255, 193, 7, 0.1);
  color: var(--warning);
}

/* Quick Links */
.quick-links-section {
  margin-bottom: 40px;
}

.quick-links-section h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
}

.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
}

.quick-link-card {
  background: var(--white);
  padding: 30px;
  border-radius: 15px;
  box-shadow: var(--shadow);
  text-align: center;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.3s, box-shadow 0.3s;
}

.quick-link-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

.quick-link-card .icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }

  .main-content {
    margin-left: 0;
  }

  .topbar {
    flex-direction: column;
    gap: 15px;
  }

  .search-bar {
    max-width: 100%;
  }

  .welcome-section {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .quick-actions {
    flex-direction: column;
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}
