/* ===================================================
   TamgaLabs - Dashboard Stylesheet
   =================================================== */

.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.dashboard-sidebar {
  width: 260px;
  background: var(--black-light);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  padding: 96px 24px 24px;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.dashboard-sidebar .sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dashboard-sidebar .sidebar-brand img {
  height: 32px;
}

.dashboard-sidebar .sidebar-brand span {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--white);
}

.sidebar-nav {
  flex: 1;
}

.sidebar-nav .nav-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray-600);
  font-weight: 600;
  margin: 24px 0 12px;
  padding: 0 12px;
}

.sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--gray-400);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
}

.sidebar-nav .nav-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--gray-200);
}

.sidebar-nav .nav-item.active {
  background: rgba(212, 168, 67, 0.1);
  color: var(--gold);
}

.sidebar-nav .nav-item .icon {
  width: 20px;
  text-align: center;
  font-size: 1.125rem;
}

.sidebar-nav .nav-item .icon-svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* --- Dashboard Main --- */
.dashboard-main {
  flex: 1;
  margin-left: 260px;
  padding: 104px 32px 32px;
  min-height: 100vh;
}

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

.dashboard-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--white);
}

.dashboard-header .header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --- Dashboard Stats --- */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--gradient-card);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 24px;
}

.stat-card .stat-label {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-bottom: 8px;
  font-weight: 500;
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--white);
}

.stat-card .stat-change {
  font-size: 0.8125rem;
  margin-top: 4px;
}

.stat-card .stat-change.positive { color: #22c55e; }
.stat-card .stat-change.negative { color: #ef4444; }

/* --- Dashboard Table --- */
.dashboard-table {
  background: var(--gradient-card);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.dashboard-table .table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dashboard-table .table-header h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--white);
}

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

.dashboard-table th {
  padding: 12px 24px;
  text-align: left;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-500);
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dashboard-table td {
  padding: 16px 24px;
  font-size: 0.9375rem;
  color: var(--gray-300);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

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

.dashboard-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* --- API Key Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-active {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.badge-inactive {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.badge-pending {
  background: rgba(234, 179, 8, 0.1);
  color: #eab308;
}

/* --- API Key Display --- */
.api-key-display {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'SF Mono', monospace;
  font-size: 0.875rem;
  color: var(--gray-300);
}

.api-key-display .key-text {
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

/* --- Usage Chart Placeholder --- */
.usage-chart {
  background: var(--gradient-card);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

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

.usage-chart .chart-header h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--white);
}

.usage-chart .chart-body {
  height: 200px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.usage-chart .chart-bar {
  flex: 1;
  background: var(--gradient-gold);
  border-radius: 4px 4px 0 0;
  min-height: 8px;
  transition: var(--transition);
  opacity: 0.7;
}

.usage-chart .chart-bar:hover {
  opacity: 1;
}

/* --- Model Cards --- */
.model-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.model-card {
  background: var(--gradient-card);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: var(--transition);
}

.model-card:hover {
  border-color: rgba(212, 168, 67, 0.2);
}

.model-card .model-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 8px;
}

.model-card .model-provider {
  font-size: 0.8125rem;
  color: var(--gray-500);
  margin-bottom: 12px;
}

.model-card .model-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: #22c55e;
}

.model-card .model-status .dot {
  width: 6px;
  height: 6px;
  background: #22c55e;
  border-radius: 50%;
}

/* --- Cluster Cards --- */
.cluster-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.cluster-card {
  background: var(--gradient-card);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 24px;
}

.cluster-card .cluster-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.cluster-card .cluster-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--white);
}

.cluster-card .cluster-specs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.cluster-card .spec-item {
  text-align: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
}

.cluster-card .spec-item .value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
}

.cluster-card .spec-item .label {
  font-size: 0.75rem;
  color: var(--gray-500);
}

/* --- Settings --- */
.settings-section {
  background: var(--gradient-card);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
}

.settings-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 24px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

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

.settings-row .label {
  font-size: 0.9375rem;
  color: var(--gray-300);
}

.settings-row .value {
  font-size: 0.9375rem;
  color: var(--gray-500);
}

/* --- Toggle Switch --- */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.toggle input {
  display: none;
}

.toggle .slider {
  position: absolute;
  inset: 0;
  background: var(--gray-700);
  border-radius: 12px;
  transition: var(--transition);
}

.toggle .slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--white);
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: var(--transition);
}

.toggle input:checked + .slider {
  background: var(--gold);
}

.toggle input:checked + .slider::before {
  transform: translateX(20px);
}

/* --- Billing --- */
.billing-plan {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  background: rgba(212, 168, 67, 0.05);
  border: 1px solid rgba(212, 168, 67, 0.2);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.billing-plan .plan-info h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
}

.billing-plan .plan-info p {
  color: var(--gray-400);
  font-size: 0.9375rem;
}

.billing-plan .plan-price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gold);
}

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

  .model-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .dashboard-sidebar {
    width: 64px;
    padding: 88px 8px 16px;
  }

  .dashboard-sidebar .sidebar-brand span,
  .sidebar-nav .nav-item span,
  .sidebar-nav .nav-label {
    display: none;
  }

  .sidebar-nav .nav-item {
    justify-content: center;
    padding: 12px;
  }

  .dashboard-main {
    margin-left: 64px;
    padding: 88px 16px 16px;
  }

  .dashboard-stats {
    grid-template-columns: 1fr;
  }

  .model-grid,
  .cluster-grid {
    grid-template-columns: 1fr;
  }
}
