/* ==============================================================================
   FLUENTA AI — SAAS ADMIN PORTAL STYLESHEET
   ============================================================================== */

:root {
  --bg-base: #0B0F19;
  --bg-surface: #111827;
  --bg-card: #1E293B;
  --bg-hover: #334155;
  
  --primary: #6366F1;
  --primary-dark: #4F46E5;
  --primary-glow: rgba(99, 102, 241, 0.25);
  
  --secondary: #10B981;
  --secondary-glow: rgba(16, 185, 129, 0.2);

  --accent-gold: #F59E0B;
  --accent-blue: #0ea5e9;
  --accent-purple: #8B5CF6;
  --danger: #EF4444;

  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-active: rgba(99, 102, 241, 0.5);

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-base);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* App Layout */
.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  padding: 0 8px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 8px 16px var(--primary-glow);
}

.brand-text h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: white;
}

.brand-text h2 span {
  color: var(--primary);
}

.badge-admin {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-gold);
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 2px;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.nav-item:hover {
  background-color: var(--bg-card);
  color: var(--text-main);
  transform: translateX(3px);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.18), rgba(99, 102, 241, 0.05));
  color: var(--primary);
  border-left: 3px solid var(--primary);
  font-weight: 600;
}

.sidebar-footer {
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
}

.admin-info {
  display: flex;
  flex-direction: column;
}

.admin-name {
  font-size: 13px;
  font-weight: 600;
}

.admin-role {
  font-size: 11px;
  color: var(--text-dim);
}

.btn-logout {
  background: transparent;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: background 0.2s;
}

.btn-logout:hover {
  background-color: rgba(239, 68, 68, 0.1);
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: radial-gradient(circle at top right, #1E1B4B 0%, var(--bg-base) 45%);
}

.topbar {
  padding: 24px 32px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar-title h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 26px;
  font-weight: 700;
}

.topbar-title p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  background-color: var(--bg-card);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.green {
  background-color: var(--secondary);
  box-shadow: 0 0 8px var(--secondary);
}

.btn-refresh {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-refresh:hover {
  background-color: var(--primary-dark);
  transform: translateY(-1px);
}

.content-body {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
}

/* Tab Panes */
.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

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

.stat-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary-glow);
}

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

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

.stat-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

.stat-badge.green {
  background: rgba(16, 185, 129, 0.15);
  color: var(--secondary);
}

.stat-badge.gold {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-gold);
}

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: white;
  margin-bottom: 6px;
}

.stat-subtext {
  font-size: 12px;
  color: var(--text-dim);
}

/* 2 Column Layout */
.grid-2-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.dashboard-panel {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
}

.dashboard-panel.full-width {
  width: 100%;
}

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

.panel-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 700;
}

.panel-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.badge-live {
  font-size: 10px;
  font-weight: 800;
  color: var(--secondary);
  background: rgba(16, 185, 129, 0.15);
  padding: 4px 8px;
  border-radius: 6px;
}

.badge-shield {
  font-size: 10px;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-glow);
  padding: 4px 8px;
  border-radius: 6px;
}

/* Engine List */
.engine-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.engine-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background-color: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.engine-info {
  display: flex;
  flex-direction: column;
}

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

.engine-desc {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

.tag {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
}

.tag.green {
  background: rgba(16, 185, 129, 0.15);
  color: var(--secondary);
}

.tag.blue {
  background: rgba(14, 165, 233, 0.15);
  color: var(--accent-blue);
}

/* Guardrail Content */
.guardrail-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.guardrail-metric {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
}

.guardrail-metric .label {
  color: var(--text-muted);
}

.guardrail-metric .val {
  font-weight: 600;
}

.highlight-green {
  color: var(--secondary);
}

.progress-bar-container {
  margin-top: 20px;
}

.progress-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.progress-track {
  height: 8px;
  background-color: var(--bg-card);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--secondary), var(--primary));
  border-radius: 4px;
}

/* Data Table */
.table-responsive {
  overflow-x: auto;
}

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

.data-table th {
  text-align: left;
  padding: 14px 16px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-subtle);
  background-color: rgba(30, 41, 59, 0.4);
}

.data-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

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

.plan-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.plan-pill.yearly {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-gold);
}

.plan-pill.monthly {
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary);
}

.plan-pill.free {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
}

.btn-action {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-action:hover {
  background-color: var(--primary);
  border-color: var(--primary);
}

/* Live Stream */
.live-stream-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stream-card {
  padding: 16px;
  background-color: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.stream-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text-dim);
}

.stream-intent {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
  font-weight: 600;
}

.stream-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stream-original {
  color: var(--text-muted);
  font-size: 13px;
}

.stream-translated {
  color: white;
  font-size: 14px;
  font-weight: 600;
}

/* Config Grid */
.config-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.config-card {
  background-color: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.config-card h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  margin-bottom: 6px;
}

.config-card p {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.4;
}

.config-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.config-field label {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
}

.config-field input {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 8px 12px;
  border-radius: 6px;
  color: white;
  font-size: 13px;
}

/* Settings Form */
.settings-form {
  max-width: 500px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

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

.form-group input {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 12px 16px;
  border-radius: 8px;
  color: white;
  font-size: 14px;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
}
