/**
 * ═══════════════════════════════════════════════════════════════
 * ADMIN DASHBOARD V2.0 - Styles
 * ═══════════════════════════════════════════════════════════════
 */

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD LAYOUT
   ═══════════════════════════════════════════════════════════════ */

.admin-dashboard {
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

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

.dashboard-header h1 {
  font-size: 26px;
  font-weight: 700;
  color: #E5E7EB;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

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

.dashboard-actions button {
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-export {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.btn-export:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-refresh {
  background: linear-gradient(135deg, #D4A853, #B8892E);
  color: #0d0b0f;
}

.btn-refresh:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(212, 168, 83, 0.35);
}

.btn-members {
  background: linear-gradient(135deg, #D4A853, #B8892E);
  color: #0d0b0f;
}

.btn-members:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(212, 168, 83, 0.35);
}

/* ═══════════════════════════════════════════════════════════════
   STATS CARDS GRID
   ═══════════════════════════════════════════════════════════════ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
  background: linear-gradient(145deg, rgba(22, 36, 58, 0.96), rgba(14, 24, 42, 0.94));
  border-radius: 14px;
  padding: 20px;
  border: 1px solid rgba(212, 168, 83, 0.12);
}

.stat-card {
  background: linear-gradient(135deg, rgba(22, 36, 58, 0.95), rgba(14, 24, 42, 0.98));
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s, box-shadow 0.3s;
  border: 1px solid rgba(212, 168, 83, 0.15);
}

.stat-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 32px rgba(212, 168, 83, 0.15);
  border-color: rgba(212, 168, 83, 0.35);
}

.stat-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.stat-card-icon {
  font-size: 24px;
  opacity: 0.9;
}

.stat-card-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.badge-positive {
  background: rgba(52, 211, 153, 0.25);
  color: #34D399;
  border: 1px solid rgba(52, 211, 153, 0.4);
  font-weight: 700;
}

.badge-negative {
  background: rgba(248, 113, 113, 0.25);
  color: #F87171;
  border: 1px solid rgba(248, 113, 113, 0.4);
  font-weight: 700;
}

.badge-neutral {
  background: rgba(156, 163, 175, 0.2);
  color: #C7C7D1;
  border: 1px solid rgba(156, 163, 175, 0.3);
  font-weight: 700;
}

.stat-card-value {
  font-size: 32px;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 6px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  letter-spacing: -0.02em;
}

.stat-card-label {
  font-size: 14px;
  color: #C7C7D1;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card-sublabel {
  font-size: 12px;
  color: #9B9BAA;
  margin-top: 6px;
}

/* Card variants */
.stat-card.members {
  border-left: 5px solid #D4A853;
  background: linear-gradient(135deg, rgba(212, 168, 83, 0.12), rgba(184, 137, 46, 0.08));
}

.stat-card.active {
  border-left: 5px solid #10B981;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.15));
}

.stat-card.messages {
  border-left: 5px solid #60A5FA;
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.15), rgba(59, 130, 246, 0.15));
}

.stat-card.voice {
  border-left: 5px solid #60A5FA;
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.12), rgba(59, 130, 246, 0.08));
}

.stat-card.costs {
  border-left: 5px solid #F87171;
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.15), rgba(239, 68, 68, 0.15));
}

.stat-card.revenue {
  border-left: 5px solid #34D399;
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.15), rgba(16, 185, 129, 0.15));
}

.stat-card.profit {
  border-left: 5px solid #FBBF24;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.15));
}

.stat-card.alerts {
  border-left: 5px solid #EF4444;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(220, 38, 38, 0.15));
}

/* ═══════════════════════════════════════════════════════════════
   COST BREAKDOWN SECTION
   ═══════════════════════════════════════════════════════════════ */

.cost-section {
  background: linear-gradient(145deg, rgba(22, 36, 58, 0.96), rgba(14, 24, 42, 0.94));
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 24px;
  border: 1px solid rgba(212, 168, 83, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.cost-section h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(245, 240, 232, 0.95);
}

.cost-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.cost-card {
  background: linear-gradient(145deg, rgba(10, 18, 32, 0.9), rgba(14, 24, 42, 0.92));
  border-radius: 10px;
  padding: 16px;
  border: 1px solid rgba(212, 168, 83, 0.1);
}

.cost-card-title {
  font-size: 14px;
  font-weight: 600;
  color: rgba(245, 240, 232, 0.55);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cost-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(245, 240, 232, 0.08);
}

.cost-row:last-child {
  border-bottom: none;
}

.cost-row.total {
  font-weight: 600;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 2px solid rgba(212, 168, 83, 0.2);
  border-bottom: none;
}

.cost-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: rgba(245, 240, 232, 0.75);
}

.cost-label .provider-icon {
  font-size: 16px;
}

.cost-value {
  font-size: 14px;
  font-weight: 600;
  color: rgba(245, 240, 232, 0.95);
}

.cost-value.negative {
  color: #ef4444;
}

.cost-value.positive {
  color: #10b981;
}

/* ═══════════════════════════════════════════════════════════════
   PROFIT SUMMARY
   ═══════════════════════════════════════════════════════════════ */

.profit-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.profit-card {
  background: linear-gradient(145deg, rgba(10, 18, 32, 0.98), rgba(18, 31, 49, 0.98));
  border-radius: 16px;
  padding: clamp(16px, 3vw, 24px);
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
  min-width: 0;
  border: 1px solid rgba(245, 240, 232, 0.06);
}

.profit-card.revenue {
  border-left: 4px solid #10b981;
}

.profit-card.costs {
  border-left: 4px solid #ef4444;
}

.profit-card.profit {
  border-left: 4px solid #3b82f6;
}

.profit-card.profit.negative {
  border-left-color: #ef4444;
}

.profit-label {
  font-size: clamp(11px, 2vw, 14px);
  font-weight: 600;
  color: rgba(245, 240, 232, 0.6);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profit-value {
  font-size: clamp(24px, 5vw, 36px);
  font-weight: 800;
  line-height: 1.2;
  color: #f5f0e8;
}

.profit-card.revenue .profit-value {
  color: #059669;
}

.profit-card.costs .profit-value {
  color: #dc2626;
}

.profit-card.profit .profit-value {
  color: #d97706;
}

.profit-card.profit.negative .profit-value {
  color: #dc2626;
}

.profit-period {
  font-size: 11px;
  color: rgba(245, 240, 232, 0.5);
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   ALERTS SECTION
   ═══════════════════════════════════════════════════════════════ */

.alerts-section {
  background: linear-gradient(145deg, rgba(22, 36, 58, 0.96), rgba(14, 24, 42, 0.94));
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 24px;
  border: 1px solid rgba(212, 168, 83, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.alerts-section h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(245, 240, 232, 0.95);
}

.alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.15);
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-left: 3px solid #ef4444;
}

.alert-item.warning {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
  border-left-color: #f59e0b;
}

.alert-item.info {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  border-left-color: #3b82f6;
}

.alert-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.alert-text {
  font-size: 14px;
  color: #f5f0e8;
}

.alert-count {
  font-weight: 700;
  color: #dc2626;
}

.alert-action {
  padding: 6px 12px;
  background: rgba(245, 240, 232, 0.08);
  border: 1px solid rgba(245, 240, 232, 0.15);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  color: #f5f0e8;
}

.alert-action:hover {
  background: rgba(245, 240, 232, 0.15);
  border-color: rgba(212, 168, 83, 0.35);
}

/* ═══════════════════════════════════════════════════════════════
   CHART OBSERVABILITY
   ═══════════════════════════════════════════════════════════════ */

.chart-obs-section {
  background: linear-gradient(145deg, rgba(22, 36, 58, 0.96), rgba(14, 24, 42, 0.94));
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(212, 168, 83, 0.12);
}

.chart-obs-header {
  margin-bottom: 18px;
}

.chart-obs-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #f5f0e8;
}

.chart-obs-subtitle {
  margin-top: 6px;
  color: rgba(245, 240, 232, 0.55);
  font-size: 13px;
}

.chart-obs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.chart-obs-card {
  background: linear-gradient(145deg, rgba(10, 18, 32, 0.95), rgba(14, 24, 42, 0.92));
  border: 1px solid rgba(212, 168, 83, 0.12);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.chart-obs-card.success {
  border-color: rgba(52, 211, 153, 0.25);
}

.chart-obs-card.danger {
  border-color: rgba(248, 113, 113, 0.25);
}

.chart-obs-card.active {
  border-color: rgba(96, 165, 250, 0.25);
}

.chart-obs-value {
  font-size: 30px;
  font-weight: 800;
  color: #f5f0e8;
}

.chart-obs-label {
  margin-top: 6px;
  color: rgba(245, 240, 232, 0.6);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chart-obs-meta {
  margin-top: 4px;
  color: rgba(245, 240, 232, 0.45);
  font-size: 12px;
}

.chart-obs-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.chart-type-card {
  background: linear-gradient(145deg, rgba(10, 18, 32, 0.95), rgba(14, 24, 42, 0.92));
  border-radius: 14px;
  padding: 16px;
  border: 1px solid rgba(212, 168, 83, 0.12);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.chart-type-title {
  color: #f5f0e8;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 10px;
}

.chart-type-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  color: rgba(245, 240, 232, 0.7);
  font-size: 13px;
}

.chart-type-stats strong {
  color: #e8d5b0;
}

.chart-obs-panels {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.chart-obs-panel {
  background: linear-gradient(145deg, rgba(10, 18, 32, 0.95), rgba(14, 24, 42, 0.92));
  border-radius: 14px;
  padding: 18px;
  border: 1px solid rgba(212, 168, 83, 0.12);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.chart-obs-panel h3 {
  margin: 0 0 12px;
  color: #f5f0e8;
  font-size: 16px;
  font-weight: 700;
}

.chart-error-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chart-error-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(248, 113, 113, 0.14);
  border: 1px solid rgba(248, 113, 113, 0.22);
  color: #FECACA;
  font-size: 12px;
  font-weight: 700;
}

.chart-obs-table-wrap {
  overflow-x: auto;
}

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

.chart-obs-table th,
.chart-obs-table td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(245, 240, 232, 0.08);
  vertical-align: top;
  color: rgba(245, 240, 232, 0.88);
  font-size: 13px;
}

.chart-obs-table th {
  color: rgba(245, 240, 232, 0.5);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chart-user-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chart-user-cell strong {
  color: #f5f0e8;
}

.chart-user-cell span {
  color: rgba(245, 240, 232, 0.5);
  font-size: 12px;
}

.chart-error-cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chart-error-cell small {
  color: rgba(245, 240, 232, 0.55);
  line-height: 1.45;
}

.chart-error-badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.18);
  color: #FDE68A;
  border: 1px solid rgba(251, 191, 36, 0.28);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.chart-error-badge.timeout {
  background: rgba(248, 113, 113, 0.16);
  color: #FECACA;
  border-color: rgba(248, 113, 113, 0.28);
}

.chart-empty {
  color: #6b6189;
  margin: 0;
}

.chart-obs-error {
  background: linear-gradient(145deg, rgba(42, 18, 24, 0.95), rgba(24, 12, 16, 0.92));
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.chart-obs-error-title {
  color: #fecaca;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}

.chart-obs-error-message {
  color: rgba(254, 202, 202, 0.85);
  font-size: 13px;
  margin-bottom: 14px;
  line-height: 1.45;
}

/* ═══════════════════════════════════════════════════════════════
   MEMBERS TABLE (Enhanced)
   ═══════════════════════════════════════════════════════════════ */

.members-section {
  background: linear-gradient(145deg, rgba(22, 36, 58, 0.96), rgba(14, 24, 42, 0.94));
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(212, 168, 83, 0.12);
}

.members-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.members-section-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: #E5E7EB;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.members-table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

/* Bulk action bar */
.bulk-action-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(212, 168, 83, 0.08);
  border: 1px solid rgba(212, 168, 83, 0.25);
  border-radius: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.bulk-count {
  font-size: 13px;
  color: rgba(212, 168, 83, 0.9);
  font-weight: 600;
  flex: 1;
}
.btn-bulk-delete {
  background: linear-gradient(135deg, #7f1d1d, #991b1b);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 6px 14px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
}
.btn-bulk-delete:hover { box-shadow: 0 2px 8px rgba(239,68,68,0.3); filter: brightness(1.1); }
.btn-bulk-delete:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-bulk-cancel {
  background: none;
  color: rgba(245,240,232,0.45);
  border: 1px solid rgba(245,240,232,0.12);
  padding: 6px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
}
.btn-bulk-cancel:hover { color: rgba(245,240,232,0.8); border-color: rgba(245,240,232,0.3); }

/* Checkbox column */
.select-cell {
  width: 36px;
  text-align: center;
  padding: 0 8px !important;
}
.member-select-cb, #selectAllCb {
  width: 16px;
  height: 16px;
  accent-color: #D4A853;
  cursor: pointer;
}

.members-table-v2 {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.members-table-v2 th {
  background: linear-gradient(135deg, rgba(22, 36, 58, 0.98), rgba(14, 24, 42, 0.98));
  padding: 16px;
  text-align: left;
  font-weight: 700;
  color: rgba(212, 168, 83, 0.9);
  border-bottom: 2px solid rgba(212, 168, 83, 0.2);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-size: 13px;
}

.members-table-v2 th.sortable {
  cursor: pointer;
  user-select: none;
}

.members-table-v2 th.sortable:hover {
  background: linear-gradient(135deg, #8B7BD6, #6B5BB0);
}

.members-table-v2 th .sort-icon {
  margin-left: 4px;
  opacity: 0.5;
}

.members-table-v2 th.sorted .sort-icon {
  opacity: 1;
}

.members-table-v2 td {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
  color: #E5E7EB;
  font-size: 14px;
}

.members-table-v2 tr:last-child td {
  border-bottom: none;
}

.members-table-v2 tr:hover {
  background: rgba(212, 168, 83, 0.06);
  transition: all 0.2s ease;
}

.members-table-v2 tr:hover td {
  color: rgba(245, 240, 232, 0.9);
  font-weight: 500;
}

/* Member info cell */
.member-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.member-name {
  font-weight: 700;
  color: #E5E7EB;
}

.members-table-v2 tr:hover .member-name {
  color: #F5F0E8;
}

.member-email {
  font-size: 12px;
  color: #9B9BAA;
}

.members-table-v2 tr:hover .member-email {
  color: rgba(212, 168, 83, 0.7);
}

/* Cost cells */
.cost-cell {
  text-align: right;
  font-family: 'SF Mono', 'Consolas', monospace;
  font-size: 13px;
}

.cost-cell .amount {
  font-weight: 700;
}

.cost-cell .amount.negative {
  color: #F87171;
}

.members-table-v2 tr:hover .cost-cell .amount.negative {
  color: #F87171;
}

.cost-cell .amount.positive {
  color: #34D399;
}

.members-table-v2 tr:hover .cost-cell .amount.positive {
  color: #34D399;
}

.cost-cell .breakdown {
  font-size: 11px;
  color: #9B9BAA;
}

.members-table-v2 tr:hover .cost-cell .breakdown {
  color: rgba(212, 168, 83, 0.5);
}

/* Usage cells */
.usage-cell {
  text-align: center;
}

.usage-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 12px;
}

.usage-badge.chat {
  background: rgba(96, 165, 250, 0.2);
  color: #60A5FA;
  border: 1px solid rgba(96, 165, 250, 0.3);
}

.members-table-v2 tr:hover .usage-badge.chat {
  background: rgba(96, 165, 250, 0.2);
  color: #60A5FA;
}

.usage-badge.voice {
  background: rgba(96, 165, 250, 0.15);
  color: #60A5FA;
  border: 1px solid rgba(96, 165, 250, 0.25);
}

.members-table-v2 tr:hover .usage-badge.voice {
  background: rgba(96, 165, 250, 0.2);
  color: #60A5FA;
}

/* Profit cell */
.profit-cell {
  text-align: right;
}

.profit-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 12px;
}

.profit-badge.positive {
  background: rgba(52, 211, 153, 0.25);
  color: #34D399;
  border: 1px solid rgba(52, 211, 153, 0.4);
}

.members-table-v2 tr:hover .profit-badge.positive {
  background: rgba(52, 211, 153, 0.2);
  color: #34D399;
}

.profit-badge.negative {
  background: rgba(248, 113, 113, 0.25);
  color: #F87171;
  border: 1px solid rgba(248, 113, 113, 0.4);
}

.members-table-v2 tr:hover .profit-badge.negative {
  background: rgba(248, 113, 113, 0.2);
  color: #F87171;
}

.profit-badge.neutral {
  background: rgba(156, 163, 175, 0.2);
  color: #9CA3AF;
  border: 1px solid rgba(156, 163, 175, 0.3);
}

.members-table-v2 tr:hover .profit-badge.neutral {
  background: rgba(156, 163, 175, 0.15);
  color: #9CA3AF;
}

/* Actions cell */
.actions-cell {
  white-space: nowrap;
}

.actions-cell button {
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  margin-right: 4px;
  transition: all 0.2s;
}

.btn-details {
  background: linear-gradient(135deg, rgba(123, 110, 204, 0.3), rgba(167, 139, 250, 0.3));
  color: #E5E7EB;
  border: 1px solid rgba(167, 139, 250, 0.4);
  font-weight: 600;
}

.btn-details:hover {
  background: linear-gradient(135deg, rgba(123, 110, 204, 0.5), rgba(167, 139, 250, 0.5));
  box-shadow: 0 4px 12px rgba(123, 110, 204, 0.4);
}

.btn-credits {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.3), rgba(16, 185, 129, 0.3));
  color: #E5E7EB;
  border: 1px solid rgba(52, 211, 153, 0.4);
  font-weight: 600;
}

.btn-credits:hover {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.5), rgba(16, 185, 129, 0.5));
  box-shadow: 0 4px 12px rgba(52, 211, 153, 0.4);
}

.btn-voice {
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.3), rgba(139, 92, 246, 0.3));
  color: #E5E7EB;
  border: 1px solid rgba(192, 132, 252, 0.4);
  font-weight: 600;
}

.btn-voice:hover {
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.5), rgba(139, 92, 246, 0.5));
  box-shadow: 0 4px 12px rgba(192, 132, 252, 0.4);
}

/* ═══════════════════════════════════════════════════════════════
   LOADING & EMPTY STATES
   ═══════════════════════════════════════════════════════════════ */

.dashboard-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #64748b;
}

.dashboard-loading .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(212, 168, 83, 0.15);
  border-top-color: #D4A853;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.dashboard-empty {
  text-align: center;
  padding: 40px 20px;
  color: #94a3b8;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

/* Tablet landscape and smaller desktops */
@media (max-width: 1024px) {
  .profit-summary {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
  }
  
  .profit-value {
    font-size: clamp(22px, 4vw, 32px);
  }
}

/* Tablet portrait */
@media (max-width: 768px) {
  .admin-dashboard {
    padding: 12px;
  }
  
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .dashboard-header h1 {
    font-size: 22px;
  }
  
  .dashboard-actions {
    width: 100%;
    flex-direction: column;
  }
  
  .dashboard-actions button {
    width: 100%;
    justify-content: center;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .profit-summary {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .profit-card {
    padding: 16px;
  }
  
  .stat-card {
    padding: 16px;
  }
  
  .stat-card-value {
    font-size: 24px;
  }
  
  .members-table-v2 {
    font-size: 11px;
  }
  
  .members-table-v2 th,
  .members-table-v2 td {
    padding: 10px 8px;
  }
  
  .cost-grid {
    grid-template-columns: 1fr;
  }

  .chart-obs-grid,
  .chart-obs-type-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .admin-dashboard {
    padding: 8px;
  }
  
  .dashboard-header h1 {
    font-size: 20px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .profit-summary {
    gap: 10px;
  }
  
  .profit-card {
    padding: 14px;
  }
  
  .profit-value {
    font-size: 28px;
  }
  
  .profit-label {
    font-size: 11px;
  }
  
  .stat-card {
    padding: 14px;
  }
  
  .stat-card-value {
    font-size: 22px;
  }
  
  .stat-card-label {
    font-size: 12px;
  }
  
  .members-table-v2 {
    font-size: 10px;
    min-width: 700px;
  }
  
  .members-table-v2 th,
  .members-table-v2 td {
    padding: 8px 6px;
  }
  
  .member-name {
    font-size: 13px;
  }
  
  .member-email {
    font-size: 10px;
  }
  
  .dashboard-actions button {
    padding: 8px 12px;
    font-size: 13px;
  }

  .actions-cell button {
    padding: 8px 12px;
    font-size: 14px;
    min-width: 44px;
    min-height: 44px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   COSMIC BLUEPRINT CHART MANAGER MODAL
   ═══════════════════════════════════════════════════════════════ */

.btn-unlock {
  background: linear-gradient(135deg, #1a3a1a, #1f4a1f);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #34D399;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  margin-left: 4px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-unlock:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(52, 211, 153, 0.3);
  border-color: rgba(52, 211, 153, 0.6);
}

.btn-charts {
  background: linear-gradient(135deg, #1a2d4a, #243d62);
  border: 1px solid rgba(212, 168, 83, 0.3);
  color: #D4A853;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  margin-left: 4px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-charts:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(212, 168, 83, 0.25);
  border-color: rgba(212, 168, 83, 0.6);
}

.chart-mgr-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}
.chart-mgr-modal {
  background: linear-gradient(145deg, rgba(22, 36, 58, 0.98), rgba(14, 24, 42, 0.98));
  border: 1px solid rgba(212, 168, 83, 0.15);
  border-radius: 20px;
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(212, 168, 83, 0.08);
}
.chart-mgr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid rgba(212, 168, 83, 0.1);
}
.chart-mgr-header h2 {
  color: #F5F0E8;
  font-size: 18px;
  margin: 0;
  font-weight: 600;
}
.chart-mgr-close {
  background: none;
  border: none;
  color: rgba(245, 240, 232, 0.35);
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
}
.chart-mgr-close:hover { color: #F5F0E8; }

.chart-mgr-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.chart-mgr-section {
  margin-bottom: 24px;
}
.chart-mgr-section h3 {
  color: rgba(212, 168, 83, 0.85);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 12px 0;
}

.chart-mgr-credits {
  display: flex;
  gap: 12px;
}
.chart-mgr-credit-card {
  flex: 1;
  background: rgba(14, 24, 42, 0.9);
  border: 1px solid rgba(212, 168, 83, 0.15);
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
  transition: border-color 0.2s;
}
.chart-mgr-credit-card.active {
  border-color: rgba(212, 168, 83, 0.6);
  background: rgba(212, 168, 83, 0.08);
}
.chart-mgr-credit-icon { font-size: 22px; display: block; }
.chart-mgr-credit-count {
  font-size: 28px;
  font-weight: 700;
  color: #F5F0E8;
  display: block;
  margin: 4px 0;
}
.chart-mgr-credit-card:not(.active) .chart-mgr-credit-count { color: rgba(245, 240, 232, 0.3); }
.chart-mgr-credit-label {
  font-size: 11px;
  color: rgba(245, 240, 232, 0.4);
  text-transform: uppercase;
}

.chart-mgr-grant {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.chart-mgr-select {
  background: rgba(14, 24, 42, 0.9);
  border: 1px solid rgba(212, 168, 83, 0.2);
  color: #F5F0E8;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  flex: 1;
  min-width: 120px;
  outline: none;
}
.chart-mgr-select:focus {
  border-color: rgba(212, 168, 83, 0.5);
}
.chart-mgr-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s;
  white-space: nowrap;
}
.chart-mgr-btn.grant {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #fff;
}
.chart-mgr-btn.grant:hover { transform: scale(1.03); }
.chart-mgr-btn-sm {
  padding: 3px 10px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}
.chart-mgr-btn-sm.remove {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.chart-mgr-btn-sm.remove:hover {
  background: rgba(239, 68, 68, 0.3);
}

.chart-mgr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.chart-mgr-table th {
  text-align: left;
  color: rgba(212, 168, 83, 0.6);
  font-weight: 600;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(212, 168, 83, 0.1);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.chart-mgr-table td {
  color: rgba(245, 240, 232, 0.8);
  padding: 10px 8px;
  border-bottom: 1px solid rgba(212, 168, 83, 0.06);
}
.chart-mgr-status {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.chart-mgr-status.completed { background: rgba(16, 185, 129, 0.15); color: #10B981; }
.chart-mgr-status.generating { background: rgba(245, 158, 11, 0.15); color: #F59E0B; }
.chart-mgr-status.failed { background: rgba(239, 68, 68, 0.15); color: #EF4444; }

@media (max-width: 600px) {
  .chart-mgr-overlay { padding: 10px; }
  .chart-mgr-modal { max-height: 92vh; border-radius: 12px; }
  .chart-mgr-body { padding: 16px; padding-bottom: 32px; }
  .chart-mgr-credits { flex-direction: column; gap: 8px; }
  .chart-mgr-grant { flex-direction: column; }
  .chart-mgr-select { width: 100%; }
  .chart-mgr-btn { width: 100%; text-align: center; padding: 12px 16px; font-size: 15px; }
}
