:root {
  --sidebar-width: 240px;
  --topbar-height: 60px;
  --bg-dark: #0f1115;
  --bg-card: #1a1d23;
  --bg-card-hover: #232730;
  --border-color: #2a2f3a;
  --accent-blue: #4c8bf5;
  --accent-green: #2ecc71;
  --accent-purple: #9b59b6;
  --accent-orange: #f39c12;
}

* { box-sizing: border-box; }

body {
  background: var(--bg-dark);
  color: #e6e6e6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
}

/* ========== LAYOUT ========== */
.layout-wrapper {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: #15171c;
  border-right: 1px solid var(--border-color);
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-header {
  padding: 20px;
  font-size: 1.25rem;
  font-weight: bold;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent-blue);
}

.sidebar-nav { padding: 15px 0; }

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: #a0a0a0;
  text-decoration: none;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
  background: var(--bg-card-hover);
  color: #fff;
}

.sidebar-nav a.active {
  background: var(--bg-card-hover);
  color: var(--accent-blue);
  border-left-color: var(--accent-blue);
}

.sidebar-divider {
  padding: 15px 20px 5px;
  font-size: 0.75rem;
  color: #666;
  font-weight: bold;
  letter-spacing: 1px;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.topbar {
  height: var(--topbar-height);
  background: #15171c;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 1.1rem;
  margin: 0;
  font-weight: 500;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #a0a0a0;
}

.content-area { min-height: calc(100vh - var(--topbar-height)); }

/* ========== CARDS ========== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border-color);
  padding: 14px 20px;
}

.card-body { padding: 20px; }

.stat-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.2s;
}

.stat-card:hover { transform: translateY(-2px); }

.stat-label {
  font-size: 0.85rem;
  color: #a0a0a0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: bold;
  margin: 8px 0;
}

.stat-icon {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  opacity: 0.2;
}

.stat-blue .stat-value { color: var(--accent-blue); }
.stat-green .stat-value { color: var(--accent-green); }
.stat-purple .stat-value { color: var(--accent-purple); }

/* ========== TABLES ========== */
.table { color: #e6e6e6; margin-bottom: 0; }
.table thead th {
  background: #15171c;
  border-color: var(--border-color);
  color: #a0a0a0;
  font-size: 0.85rem;
  text-transform: uppercase;
}
.table tbody td { border-color: var(--border-color); }
.table-hover > tbody > tr:hover { background: var(--bg-card-hover); }

/* ========== LOG BOX ========== */
.log-box {
  background: #0a0c10;
  color: #00ff88;
  font-family: "Cascadia Code", "Fira Code", monospace;
  font-size: 0.85rem;
  padding: 16px;
  margin: 0;
  height: 350px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.result-json {
  background: #0a0c10;
  color: #e6e6e6;
  font-family: "Cascadia Code", "Fira Code", monospace;
  font-size: 0.85rem;
  padding: 16px;
  border-radius: 6px;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* ========== PIPELINE ========== */
.pipeline-step {
  padding: 10px 14px;
  background: var(--bg-card-hover);
  border-radius: 6px;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pipeline-arrow {
  text-align: center;
  color: #666;
  font-size: 1.2rem;
}

/* ========== LOGIN PAGE ========== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f1115 0%, #1a1d23 100%);
  padding: 20px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-header i {
  font-size: 3rem;
  color: var(--accent-blue);
}

.login-header h2 {
  margin-top: 15px;
  margin-bottom: 5px;
}

/* ========== FORMS ========== */
.form-control, .form-select {
  background: #0f1115;
  border-color: var(--border-color);
  color: #e6e6e6;
}

.form-control:focus, .form-select:focus {
  background: #0f1115;
  color: #e6e6e6;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 0.2rem rgba(76, 139, 245, 0.25);
}

.form-range::-webkit-slider-thumb { background: var(--accent-blue); }

/* ========== BADGES ========== */
.badge { font-weight: 500; padding: 5px 10px; }

/* ========== LIST GROUP ========== */
.list-group-item {
  border-color: var(--border-color);
  color: #e6e6e6;
}

.list-group-item:hover {
  background: var(--bg-card-hover);
  color: #fff;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; }
  .stat-value { font-size: 1.8rem; }
  .stat-icon { font-size: 2rem; }
}
