:root {
  --bg-dark: #090a0f;
  --panel-bg: rgba(22, 24, 37, 0.7);
  --panel-border: rgba(255, 255, 255, 0.08);
  --primary-color: #53fc18; /* Kick neon green theme */
  --primary-hover: #45d411;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --accent-red: #ef4444;
  --accent-red-hover: #dc2626;
  --input-bg: rgba(10, 11, 18, 0.8);
  --input-border: rgba(255, 255, 255, 0.15);
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'Space Grotesk', monospace;
}

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

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 10% 10%, rgba(83, 252, 24, 0.05) 0px, transparent 50%),
    radial-gradient(at 90% 90%, rgba(99, 102, 241, 0.05) 0px, transparent 50%);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
}

/* Auth Overlay Panel */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: radial-gradient(circle at center, rgba(13, 15, 28, 0.95), var(--bg-dark));
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(8px);
  transition: opacity 0.3s ease;
}

.auth-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.brand-logo, .logo {
  background: var(--primary-color);
  color: #000;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 24px;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(83, 252, 24, 0.3);
}

.auth-card h2 {
  font-size: 24px;
  font-weight: 700;
}

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

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

label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"] {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-main);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  outline: none;
  font-family: var(--font-sans);
  transition: all 0.2s ease;
}

input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(83, 252, 24, 0.15);
}

/* Checkbox Styling */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  text-transform: none;
  color: var(--text-main);
}

.checkbox-label input {
  accent-color: var(--primary-color);
  width: 16px;
  height: 16px;
}

/* Buttons */
button {
  cursor: pointer;
  border: none;
  font-family: var(--font-sans);
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary-color);
  color: #000;
  border-radius: 10px;
  padding: 14px 20px;
  font-size: 14px;
  width: 100%;
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 0 15px rgba(83, 252, 24, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 14px;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-danger {
  background: var(--accent-red);
  color: var(--text-main);
  border-radius: 10px;
  padding: 14px 20px;
  font-size: 14px;
}

.btn-danger:hover {
  background: var(--accent-red-hover);
}

.error-msg {
  color: var(--accent-red);
  font-size: 13px;
  margin-bottom: 16px;
  font-weight: 500;
}

.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

/* Dashboard Container */
.dashboard-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  width: 260px;
  background: rgba(13, 15, 28, 0.85);
  border-right: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  padding: 24px;
  backdrop-filter: blur(10px);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}

.logo-text {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

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

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

.nav-item:hover, .nav-item.active {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
  border-left: 3px solid var(--primary-color);
  border-radius: 0 10px 10px 0;
}

.icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.btn-logout {
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  width: 100%;
  padding: 12px 16px;
  text-align: left;
}

.btn-logout:hover {
  color: var(--accent-red);
}

/* Content Area */
.content-area {
  flex: 1;
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 20px;
}

.top-bar h1 {
  font-size: 28px;
  font-weight: 700;
}

.user-badge {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

/* Tab panes */
.tab-pane {
  display: none;
  flex-direction: column;
  gap: 30px;
}

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

/* Grid Layout */
.grid-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
}

/* Cards */
.card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 24px;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

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

/* Form panel */
.panel-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.action-buttons {
  display: flex;
  gap: 16px;
  margin-top: 10px;
}

.action-buttons button {
  width: auto;
}

/* Metrics styles */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.metric-box {
  background: var(--input-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metric-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.metric-value {
  font-size: 32px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--primary-color);
}

.metrics-footer {
  text-align: center;
}

.link-btn {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.link-btn:hover {
  text-decoration: underline;
}

/* Table styles */
.card-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.table-container {
  overflow-x: auto;
  margin-top: 12px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th, .data-table td {
  padding: 14px 16px;
  font-size: 14px;
}

.data-table th {
  border-bottom: 2px solid var(--panel-border);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.05em;
}

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

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

.loading-cell {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 0 !important;
}

/* Inline registration form */
.modal-form-inline {
  background: var(--input-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.inline-form {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.inline-form input {
  flex: 1;
  min-width: 200px;
}

.inline-form button {
  width: auto;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Streams grid layout */
.streams-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.stream-card {
  background: rgba(13, 15, 28, 0.6);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, border-color 0.2s;
}

.stream-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-color);
}

.stream-thumbnail-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
}

.stream-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.viewer-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.viewer-badge::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent-red);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

.stream-details {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stream-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.streamer-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.streamer-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

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

.stream-category {
  display: inline-block;
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 4px;
}

.error-banner {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--accent-red);
  color: #fca5a5;
  padding: 12px 16px;
  border-radius: 8px;
  margin-top: 15px;
  font-size: 13px;
}

.streams-stats-bar {
  margin-top: 15px;
  font-size: 13px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 10px;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}

/* Console Log Panel Styles */
.console-box {
  background: #05060b;
  border: 1px solid rgba(83, 252, 24, 0.2);
  border-radius: 8px;
  padding: 16px;
  font-family: var(--font-sans); /* Use sans but style like terminal */
  font-size: 12px;
  line-height: 1.6;
  height: 250px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.8);
}

.console-line {
  color: #a7f3d0;
  white-space: pre-wrap;
  word-break: break-all;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  padding-bottom: 2px;
}

.console-line.system {
  color: var(--text-muted);
  font-style: italic;
}

.console-line.error {
  color: #f87171;
}

.console-line.success {
  color: var(--primary-color);
}

/* ========================== Premium Viewers / SMM Panel ========================== */

.smm-balance-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(83, 252, 24, 0.06);
  border: 1px solid rgba(83, 252, 24, 0.15);
  padding: 6px 14px;
  border-radius: 20px;
}

.smm-price-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 8px;
}

.smm-orders-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 500px;
  overflow-y: auto;
}

.smm-order-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px;
  transition: border-color 0.2s ease;
}

.smm-order-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

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

.smm-order-card .order-id {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.smm-order-card .order-channel {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-main);
}

.smm-order-card .order-details {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.smm-order-card .order-details span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.smm-status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.smm-status-badge.pending {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.25);
}

.smm-status-badge.in-progress {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
  animation: pulseGlow 2s infinite;
}

.smm-status-badge.completed {
  background: rgba(83, 252, 24, 0.10);
  color: #53fc18;
  border: 1px solid rgba(83, 252, 24, 0.25);
}

.smm-status-badge.partial {
  background: rgba(251, 146, 60, 0.12);
  color: #fb923c;
  border: 1px solid rgba(251, 146, 60, 0.25);
}

.smm-status-badge.cancelled, .smm-status-badge.canceled {
  background: rgba(239, 68, 68, 0.10);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.smm-status-badge.processing {
  background: rgba(139, 92, 246, 0.12);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.25);
  animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.smm-empty-state {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
}

.smm-cancel-btn {
  background: none;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.smm-cancel-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: #ef4444;
}

.smm-key-setup .connected-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(83, 252, 24, 0.05);
  border: 1px solid rgba(83, 252, 24, 0.15);
  border-radius: 8px;
  font-size: 13px;
  color: #53fc18;
}
