/* =============================================================================
   BDMS (Business Data Management System) — Complete Stylesheet
   ============================================================================= */

/* ===== CSS VARIABLES ===== */
:root { --transition: 0.3s ease; }

[data-theme="dark"] {
  --bg: #0f1117; --surface: #1a1d27; --surface2: #252836; --surface3: #2d3348;
  --primary: #4f8df5; --primary-hover: #3a7be8; --primary-bg: rgba(79,141,245,0.12);
  --success: #22c55e; --success-bg: rgba(34,197,94,0.12);
  --warning: #f59e0b; --warning-bg: rgba(245,158,11,0.12);
  --error: #ef4444; --error-bg: rgba(239,68,68,0.12);
  --info: #8b5cf6; --info-bg: rgba(139,92,246,0.12);
  --text: #e2e8f0; --text2: #94a3b8; --text3: #64748b;
  --border: #2d3348; --shadow: rgba(0,0,0,0.4);
  --sidebar-bg: #141720; --login-bg: #0a0c12;
}

[data-theme="light"] {
  --bg: #f1f5f9; --surface: #ffffff; --surface2: #f8fafc; --surface3: #e2e8f0;
  --primary: #3b82f6; --primary-hover: #2563eb; --primary-bg: rgba(59,130,246,0.08);
  --success: #16a34a; --success-bg: rgba(22,163,74,0.08);
  --warning: #d97706; --warning-bg: rgba(217,119,6,0.08);
  --error: #dc2626; --error-bg: rgba(220,38,38,0.08);
  --info: #7c3aed; --info-bg: rgba(124,58,237,0.08);
  --text: #1e293b; --text2: #475569; --text3: #94a3b8;
  --border: #e2e8f0; --shadow: rgba(0,0,0,0.08);
  --sidebar-bg: #ffffff; --login-bg: #f1f5f9;
}

/* ===== RESET ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Segoe UI', Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background var(--transition), color var(--transition);
}
a { color: var(--primary); text-decoration: none; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* =============================================================================
   LOGIN PAGE
   ============================================================================= */
#loginPage { display: flex; height: 100vh; background: var(--login-bg); }

.login-left {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e3a5f 0%, #0f1b2d 50%, #0a1628 100%);
  color: #fff; padding: 40px; position: relative; overflow: hidden;
}
.login-left::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 30h60M30 0v60' stroke='%23ffffff08' stroke-width='1'/%3E%3C/svg%3E");
  opacity: 0.5;
}
.login-left h1 { font-size: 48px; font-weight: 800; z-index: 1; letter-spacing: -1px; }
.login-left h1 span { color: #4f8df5; }
.login-left p { z-index: 1; margin-top: 12px; font-size: 18px; color: #94a3b8; }
.login-left .features { z-index: 1; margin-top: 40px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.login-left .feat {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px; padding: 16px;
}
.login-left .feat .feat-icon { font-size: 24px; margin-bottom: 8px; }
.login-left .feat h3 { font-size: 14px; font-weight: 600; }
.login-left .feat p { font-size: 12px; color: #64748b; margin-top: 4px; }

.login-right {
  width: 480px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--surface); padding: 60px;
}
.login-logo {
  width: 64px; height: 64px; background: var(--primary); border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 800; color: #fff; margin-bottom: 24px;
}
.login-right h2 { font-size: 24px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.login-right .login-sub { font-size: 14px; color: var(--text2); margin-bottom: 32px; }

.login-form { width: 100%; }
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 600; color: var(--text2);
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px;
}
.form-group input {
  width: 100%; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface2); color: var(--text); font-size: 15px; outline: none;
  transition: border var(--transition);
}
.form-group input:focus { border-color: var(--primary); }

.divider {
  display: flex; align-items: center; gap: 12px; margin: 20px 0;
  color: var(--text3); font-size: 13px;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.remember-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px; font-size: 13px;
}
.remember-row label {
  display: flex; align-items: center; gap: 6px; color: var(--text2); cursor: pointer;
}

/* =============================================================================
   BUTTONS
   ============================================================================= */
.btn {
  padding: 12px 24px; border: none; border-radius: 10px; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: all var(--transition); display: inline-flex; align-items: center; gap: 8px;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; width: 100%; justify-content: center; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-sso {
  background: transparent; border: 1px solid var(--border); color: var(--text);
  width: 100%; justify-content: center; margin-bottom: 16px;
}
.btn-sso:hover { background: var(--surface2); }
.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: 8px; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text2); }
.btn-outline:hover { background: var(--surface2); }
.btn-secondary { background: var(--surface2); border: 1px solid var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--surface3); }
.btn-danger { background: var(--error); color: #fff; border: none; }
.btn-danger:hover { opacity: 0.9; }
.btn-close {
  background: none; border: none; color: var(--text2); font-size: 24px;
  cursor: pointer; line-height: 1;
}

/* =============================================================================
   MAIN APP LAYOUT
   ============================================================================= */
#appMain { display: none; height: 100vh; }
.app-layout { display: flex; height: 100%; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: 260px; background: var(--sidebar-bg); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; transition: width var(--transition);
  overflow: hidden; flex-shrink: 0;
}
.sidebar.collapsed { width: 72px; }
.sidebar-header {
  padding: 16px 20px; display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border); min-height: 64px;
}
.sidebar-logo {
  width: 36px; height: 36px; background: var(--primary); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; font-size: 16px; flex-shrink: 0;
}
.sidebar-title { font-size: 16px; font-weight: 700; white-space: nowrap; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px; }
.nav-section { margin-bottom: 4px; }
.nav-section-title {
  font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase;
  letter-spacing: 1px; padding: 12px 12px 6px; white-space: nowrap;
}
.sidebar.collapsed .nav-section-title { display: none; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px;
  cursor: pointer; color: var(--text2); font-size: 14px; transition: all var(--transition);
  white-space: nowrap; position: relative;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: var(--primary-bg); color: var(--primary); font-weight: 600; }
.nav-icon { width: 20px; text-align: center; font-size: 16px; flex-shrink: 0; }
.sidebar.collapsed .nav-label { display: none; }
.nav-item .badge {
  background: var(--error); color: #fff; font-size: 10px; padding: 2px 6px;
  border-radius: 10px; margin-left: auto;
}
.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; }
.user-avatar {
  width: 36px; height: 36px; border-radius: 10px; background: var(--info);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.sidebar.collapsed .user-info { display: none; }
.user-info { white-space: nowrap; }
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--text3); }

/* ===== TOPBAR ===== */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  height: 64px; display: flex; align-items: center; padding: 0 24px; gap: 16px;
  background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.topbar-toggle { cursor: pointer; font-size: 20px; color: var(--text2); padding: 4px; }
.breadcrumb { font-size: 14px; color: var(--text2); }
.breadcrumb span { color: var(--text); font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar-search {
  padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface2); color: var(--text); font-size: 13px; width: 240px; outline: none;
}
.topbar-search:focus { border-color: var(--primary); }
.topbar-btn {
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border);
  background: transparent; color: var(--text2); cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 16px; position: relative;
}
.topbar-btn:hover { background: var(--surface2); }
.topbar-btn .notif-dot {
  position: absolute; top: 6px; right: 6px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--error);
}
.theme-toggle {
  cursor: pointer; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface2); color: var(--text2); font-size: 13px;
  display: flex; align-items: center; gap: 6px;
}
.theme-toggle:hover { background: var(--surface3); }

/* =============================================================================
   CONTENT AREA & PAGES
   ============================================================================= */
.content-area { flex: 1; overflow-y: auto; padding: 24px; }
.page { display: none; }
.page.active { display: block; }
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.page-header p { font-size: 14px; color: var(--text2); }
.page-actions { display: flex; gap: 8px; }

/* =============================================================================
   CARDS & GRID
   ============================================================================= */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
}
.card-header h3 { font-size: 15px; font-weight: 600; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

/* ===== KPI CARDS ===== */
.kpi-card { display: flex; align-items: center; gap: 16px; }
.kpi-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.kpi-value { font-size: 28px; font-weight: 800; line-height: 1; }
.kpi-label { font-size: 12px; color: var(--text2); margin-top: 4px; }
.kpi-change { font-size: 12px; margin-top: 2px; }
.kpi-change.up { color: var(--success); }
.kpi-change.down { color: var(--error); }

/* =============================================================================
   BADGES
   ============================================================================= */
.badge-status {
  padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-error { background: var(--error-bg); color: var(--error); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-primary { background: var(--primary-bg); color: var(--primary); }

/* =============================================================================
   TABLES
   ============================================================================= */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; padding: 10px 12px; font-weight: 600; color: var(--text2);
  border-bottom: 2px solid var(--border); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
td { padding: 12px; border-bottom: 1px solid var(--border); }
tr:hover td { background: var(--surface2); }

/* =============================================================================
   GAUGES
   ============================================================================= */
.gauge {
  width: 80px; height: 80px; border-radius: 50%; position: relative;
  display: flex; align-items: center; justify-content: center;
}
.gauge-value { font-size: 18px; font-weight: 700; }
.gauge-label { font-size: 11px; color: var(--text3); text-align: center; margin-top: 4px; }

/* =============================================================================
   CHARTS & PROGRESS BARS
   ============================================================================= */
.chart-placeholder {
  background: var(--surface2); border: 1px dashed var(--border); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text3); font-size: 13px; min-height: 200px; flex-direction: column; gap: 8px;
}
.progress-bar { height: 8px; background: var(--surface3); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; transition: width 0.5s; }

/* =============================================================================
   TABS
   ============================================================================= */
.tabs {
  display: flex; gap: 4px; margin-bottom: 20px;
  border-bottom: 1px solid var(--border); padding-bottom: 0;
}
.tab {
  padding: 10px 16px; font-size: 13px; font-weight: 600; color: var(--text2);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* =============================================================================
   BAR CHARTS (HORIZONTAL)
   ============================================================================= */
.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.bar-label { width: 100px; font-size: 12px; color: var(--text2); text-align: right; flex-shrink: 0; }
.bar-track {
  flex: 1; height: 24px; background: var(--surface3); border-radius: 4px;
  overflow: hidden; position: relative;
}
.bar-fill {
  height: 100%; border-radius: 4px; display: flex; align-items: center;
  padding: 0 8px; font-size: 11px; font-weight: 600; color: #fff;
}
.bar-val { width: 50px; font-size: 13px; font-weight: 600; text-align: right; flex-shrink: 0; }

/* =============================================================================
   TIMELINE
   ============================================================================= */
.timeline-item { display: flex; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.timeline-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.timeline-content { flex: 1; }
.timeline-time { font-size: 12px; color: var(--text3); }
.timeline-desc { font-size: 13px; margin-top: 2px; }

/* =============================================================================
   FILTER BAR
   ============================================================================= */
.filter-bar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-bar select,
.filter-bar input {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface2); color: var(--text); font-size: 13px; outline: none;
}
.filter-bar select:focus,
.filter-bar input:focus { border-color: var(--primary); }

/* =============================================================================
   FORMS (GENERAL)
   ============================================================================= */
input[type="text"], select {
  width: 100%; padding: 8px 12px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 13px;
}
input[type="text"]:focus, select:focus {
  outline: none; border-color: var(--primary);
}
select { cursor: pointer; }

/* =============================================================================
   KANBAN
   ============================================================================= */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kanban-col { background: var(--surface2); border-radius: 12px; padding: 12px; min-height: 300px; }
.kanban-col-header {
  font-size: 13px; font-weight: 700; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: space-between;
}
.kanban-col-header .count {
  background: var(--surface3); padding: 2px 8px; border-radius: 10px; font-size: 11px;
}
.kanban-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px; margin-bottom: 8px; cursor: pointer;
}
.kanban-card:hover { border-color: var(--primary); }
.kanban-card h4 { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.kanban-card p { font-size: 12px; color: var(--text2); }
.kanban-card .card-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 8px; font-size: 11px; color: var(--text3);
}

/* =============================================================================
   SERVER CARDS & MINI GAUGES
   ============================================================================= */
.server-card { text-align: center; }
.server-card .server-name { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.server-card .server-type { font-size: 12px; color: var(--text3); margin-bottom: 16px; }
.server-gauges { display: flex; justify-content: center; gap: 20px; }
.mini-gauge { text-align: center; }
.mini-gauge-ring {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; border: 4px solid var(--surface3);
}
.mini-gauge-label { font-size: 11px; color: var(--text3); margin-top: 4px; }

/* =============================================================================
   DAX CODE BLOCKS
   ============================================================================= */
.dax-code {
  font-family: 'Cascadia Code', 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 13px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 16px; line-height: 1.6; white-space: pre-wrap; overflow-x: auto;
}
.dax-keyword { color: #c586c0; }
.dax-function { color: #dcdcaa; }
.dax-string { color: #ce9178; }
.dax-comment { color: #6a9955; }

/* =============================================================================
   STATS & ALERTS
   ============================================================================= */
.stat-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.stat-label { font-size: 13px; color: var(--text2); }
.stat-value { font-size: 13px; font-weight: 600; }

.alert-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px;
  border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; cursor: pointer;
}
.alert-item:hover { background: var(--surface2); }
.alert-severity { width: 4px; border-radius: 2px; align-self: stretch; flex-shrink: 0; }
.alert-body { flex: 1; }
.alert-title { font-size: 13px; font-weight: 600; }
.alert-desc { font-size: 12px; color: var(--text2); margin-top: 2px; }
.alert-meta { font-size: 11px; color: var(--text3); margin-top: 4px; display: flex; gap: 12px; }

/* =============================================================================
   WIKI SIDEBAR
   ============================================================================= */
.wiki-sidebar { width: 240px; border-right: 1px solid var(--border); padding-right: 16px; flex-shrink: 0; }
.wiki-item { padding: 8px 12px; border-radius: 6px; font-size: 13px; cursor: pointer; color: var(--text2); }
.wiki-item:hover { background: var(--surface2); }
.wiki-item.active { background: var(--primary-bg); color: var(--primary); }
.wiki-cat {
  font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase;
  padding: 12px 12px 4px; letter-spacing: 0.5px;
}

/* =============================================================================
   MODAL
   ============================================================================= */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center; z-index: 200;
}
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  width: 600px; max-height: 80vh; overflow-y: auto;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px; border-bottom: 1px solid var(--border);
}
.modal-body { padding: 20px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 16px 20px; border-top: 1px solid var(--border);
}

/* =============================================================================
   PIPELINE CARDS
   ============================================================================= */
.pipeline-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 20px; margin-bottom: 12px;
  display: flex; justify-content: space-between; align-items: center;
}
.pipeline-info h4 { font-size: 15px; font-weight: 600; }
.pipeline-info p { font-size: 12px; color: var(--text2); margin-top: 4px; }
.pipeline-info .step-count { font-size: 11px; color: var(--text3); margin-top: 6px; }
.pipeline-actions { display: flex; gap: 8px; }

/* =============================================================================
   PIPELINE STEPS
   ============================================================================= */
.step-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  margin-bottom: 8px; font-size: 13px;
}
.step-item .step-type {
  font-size: 11px; font-weight: 600; padding: 2px 8px;
  border-radius: 4px; text-transform: uppercase;
}
.step-type-sql { background: rgba(79,141,245,0.12); color: var(--primary); }
.step-type-pbi { background: var(--warning-bg); color: var(--warning); }
.step-item .step-name { flex: 1; }
.step-item .step-remove {
  background: none; border: none; color: var(--text2); cursor: pointer; font-size: 16px;
}
.step-item .step-remove:hover { color: var(--error); }
.step-actions { display: flex; gap: 8px; margin-top: 8px; }
.add-step-row { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.add-step-row select { flex: 1; }

/* =============================================================================
   RUN CARDS
   ============================================================================= */
.run-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 20px; margin-bottom: 12px;
}
.run-card-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;
}
.run-card-header h4 { font-size: 14px; }
.run-progress {
  background: var(--surface3); border-radius: 4px; height: 6px;
  overflow: hidden; margin-bottom: 8px;
}
.run-progress-bar {
  height: 100%; background: var(--primary); border-radius: 4px; transition: width 0.3s;
}
.run-detail { font-size: 12px; color: var(--text2); }

/* =============================================================================
   STEPPER / FUNNEL (Pipeline Run Progress)
   ============================================================================= */
.stepper {
  display: flex; align-items: flex-start; gap: 0;
  margin: 16px 0 8px; overflow-x: auto;
}
.stepper-step { display: flex; align-items: center; flex: 1; min-width: 0; }
.stepper-node {
  display: flex; flex-direction: column; align-items: center;
  min-width: 80px; position: relative;
}
.stepper-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  border: 2px solid var(--border); background: var(--bg); color: var(--text2);
  transition: all 0.3s; position: relative;
}
.stepper-icon .step-num { z-index: 1; }

/* Stepper states */
.stepper-step[data-status="pending"] .stepper-icon {
  border-color: var(--border); color: var(--text2);
}
.stepper-step[data-status="running"] .stepper-icon {
  border-color: var(--primary); background: var(--primary-bg); color: var(--primary);
  animation: pulse-ring 1.5s ease infinite;
}
.stepper-step[data-status="waiting"] .stepper-icon {
  border-color: var(--warning); background: var(--warning-bg); color: var(--warning);
  animation: pulse-ring 1.5s ease infinite;
}
.stepper-step[data-status="completed"] .stepper-icon {
  border-color: var(--success); background: var(--success-bg); color: var(--success);
}
.stepper-step[data-status="failed"] .stepper-icon {
  border-color: var(--error); background: var(--error-bg); color: var(--error);
}

@keyframes pulse-ring {
  0%  { box-shadow: 0 0 0 0 rgba(79,141,245,0.4); }
  70% { box-shadow: 0 0 0 8px rgba(79,141,245,0); }
  100%{ box-shadow: 0 0 0 0 rgba(79,141,245,0); }
}

/* Stepper labels */
.stepper-label { margin-top: 8px; text-align: center; max-width: 100px; }
.stepper-label-name {
  font-size: 11px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100px; display: block;
}
.stepper-label-type {
  font-size: 10px; color: var(--text2); text-transform: uppercase;
  letter-spacing: 0.3px; margin-top: 2px;
}
.stepper-label-status {
  font-size: 10px; margin-top: 3px; font-weight: 600; text-transform: uppercase;
}
.stepper-step[data-status="running"]   .stepper-label-status { color: var(--primary); }
.stepper-step[data-status="waiting"]   .stepper-label-status { color: var(--warning); }
.stepper-step[data-status="completed"] .stepper-label-status { color: var(--success); }
.stepper-step[data-status="failed"]    .stepper-label-status { color: var(--error); }
.stepper-step[data-status="pending"]   .stepper-label-status { color: var(--text3); }

/* Stepper connectors */
.stepper-connector {
  flex: 1; height: 2px; background: var(--border);
  margin: 18px 0 0; min-width: 20px; transition: background 0.3s;
}
.stepper-connector.done   { background: var(--success); }
.stepper-connector.active { background: var(--primary); }

/* =============================================================================
   TOAST NOTIFICATIONS
   ============================================================================= */
#toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 300;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 16px; font-size: 13px; min-width: 280px; animation: slideIn 0.2s ease;
}
.toast-success { border-left: 3px solid var(--success); }
.toast-error   { border-left: 3px solid var(--error); }
.toast-info    { border-left: 3px solid var(--primary); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* =============================================================================
   QUICK RUN ROW (Dashboard)
   ============================================================================= */
.quick-run-row { display: flex; gap: 12px; align-items: center; }
.quick-run-row select { flex: 1; }

/* =============================================================================
   UTILITY CLASSES
   ============================================================================= */
.muted { color: var(--text2); font-size: 13px; margin-bottom: 16px; }
.center { text-align: center; }

/* =============================================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================================= */

/* Tablet: 1024px and below */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .kanban { grid-template-columns: repeat(2, 1fr); }
  .topbar-search { width: 180px; }
  .login-left .features { grid-template-columns: 1fr; }
}

/* Mobile-landscape / small tablets: 768px and below */
@media (max-width: 768px) {
  .sidebar { width: 72px; }
  .sidebar .nav-label { display: none; }
  .sidebar .nav-section-title { display: none; }
  .sidebar .user-info { display: none; }
  .sidebar-title { display: none; }

  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: 1fr 1fr; }

  .topbar-search { display: none; }
  .content-area { padding: 16px; }

  .login-left { display: none; }
  .login-right { width: 100%; padding: 32px; }

  .modal { width: 95vw; margin: 0 auto; }

  .pipeline-card { flex-direction: column; align-items: flex-start; gap: 12px; }
  .pipeline-actions { width: 100%; justify-content: flex-end; }

  .stepper { flex-wrap: wrap; gap: 4px; }
  .stepper-connector { min-width: 12px; }
}

/* Mobile portrait: 480px and below */
@media (max-width: 480px) {
  .grid-4,
  .grid-3,
  .grid-2 { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: 1fr; }

  .topbar { padding: 0 12px; gap: 8px; }
  .topbar-right { gap: 8px; }
  .content-area { padding: 12px; }

  .kpi-card { gap: 10px; }
  .kpi-value { font-size: 22px; }
  .kpi-icon { width: 40px; height: 40px; font-size: 18px; }

  .page-header h1 { font-size: 20px; }

  .stepper-node { min-width: 60px; }
  .stepper-icon { width: 30px; height: 30px; font-size: 12px; }
  .stepper-label-name { font-size: 10px; max-width: 60px; }

  .filter-bar { flex-direction: column; }
  .filter-bar select,
  .filter-bar input { width: 100%; }

  .quick-run-row { flex-direction: column; align-items: stretch; }
  .quick-run-row select { width: 100%; }
}
