/* ── Variables ──────────────────────────────────────────────────────────────── */
:root {
  --bg-0:      #080a10;
  --bg-1:      #0d0f18;
  --bg-2:      #111520;
  --bg-3:      #161b28;
  --bg-4:      #1a2035;
  --border:    #1e2738;
  --border2:   #252f45;
  --text-1:    #e2e8f4;
  --text-2:    #94a3b8;
  --text-3:    #64748b;
  --text-4:    #475569;
  --blue:      #1a6cf5;
  --blue-l:    #3b82f6;
  --blue-bg:   #1a2f5f;
  --cyan:      #00b4d8;
  --green:     #22c55e;
  --green-bg:  #0f2a1a;
  --purple:    #a78bfa;
  --purple-bg: #2a1a4a;
  --orange:    #fb923c;
  --red:       #ef4444;
  --red-bg:    #2a1010;
  --font:      'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-logo: 'Rajdhani', sans-serif;
  --radius:    8px;
  --radius-lg: 10px;
  --sidebar-w: 200px;
  --topbar-h:  44px;
}

/* ── Reset ───────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: var(--font); background: var(--bg-0); color: var(--text-1); font-size: 14px; overflow: hidden; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── Layout ──────────────────────────────────────────────────────────────────── */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ─────────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.logo-text {
  font-family: var(--font-logo);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.logo-text span { color: var(--blue); }
.sidebar-nav { padding: 10px 8px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--text-3);
  font-size: 13px;
  font-weight: 400;
  transition: all 0.15s;
}
.nav-item:hover { background: var(--bg-4); color: var(--text-2); }
.nav-item.active { background: var(--blue); color: #fff; font-weight: 500; box-shadow: 0 4px 14px rgba(26,108,245,0.35); }
.nav-item i { font-size: 17px; width: 20px; flex-shrink: 0; }

.sidebar-bottom { border-top: 1px solid var(--border); padding: 10px 8px 6px; }
.user-card { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius); }
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--blue-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: #60a5fa; flex-shrink: 0;
}
.user-name { font-size: 12px; font-weight: 500; color: var(--text-1); }
.user-role { font-size: 10px; color: var(--text-4); }
.sidebar-actions {
  display: flex;
  justify-content: space-around;
  padding: 6px 0;
}
.sidebar-actions i, .sidebar-actions a i {
  font-size: 16px;
  color: var(--text-4);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius);
  transition: color 0.15s;
  display: block;
}
.sidebar-actions i:hover, .sidebar-actions a:hover i { color: var(--text-2); background: var(--bg-4); }
.version-bar { display: flex; align-items: center; gap: 6px; padding: 4px 8px; font-size: 10px; color: var(--text-4); }
.dot-green { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex-shrink: 0; }

/* ── Main ────────────────────────────────────────────────────────────────────── */
.main-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.topbar {
  height: var(--topbar-h);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  flex-shrink: 0;
}
.topbar-left { flex: 1; }
.topbar-right { display: flex; gap: 8px; align-items: center; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }
.breadcrumb i { font-size: 15px; }
.breadcrumb span { color: var(--text-2); }
.icon-btn {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text-3);
  width: 30px; height: 30px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  position: relative;
  transition: all 0.15s;
}
.icon-btn:hover { background: var(--bg-4); color: var(--text-2); }
.notify-btn .badge {
  position: absolute;
  top: -4px; right: -4px;
  width: 14px; height: 14px;
  background: var(--red);
  border-radius: 50%;
  font-size: 8px;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.page-content { flex: 1; overflow-y: auto; padding: 20px 24px; background: var(--bg-1); }

/* ── Stats ───────────────────────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 20px; }
.stat-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color 0.15s;
}
.stat-card:hover { border-color: var(--border2); }
.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.si-blue   { background: var(--blue-bg); color: #60a5fa; }
.si-green  { background: var(--green-bg); color: #4ade80; }
.si-purple { background: var(--purple-bg); color: var(--purple); }
.si-cyan   { background: #0a2535; color: var(--cyan); }
.si-orange { background: #2a1a0a; color: var(--orange); }
.si-red    { background: var(--red-bg); color: var(--red); }
.stat-num { font-size: 24px; font-weight: 600; line-height: 1; color: var(--text-1); }
.stat-label { font-size: 11px; color: var(--text-4); margin-top: 2px; }
.stat-tag { font-size: 10px; font-weight: 500; margin-top: 2px; }
.tag-green  { color: #4ade80; }
.tag-orange { color: var(--orange); }
.tag-blue   { color: #60a5fa; }
.tag-red    { color: var(--red); }

/* ── Panels ──────────────────────────────────────────────────────────────────── */
.panels-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.panel {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}
.panel-title { font-size: 11px; font-weight: 600; color: var(--text-3); letter-spacing: 0.4px; margin-bottom: 14px; text-transform: uppercase; }

/* ── Project rows ────────────────────────────────────────────────────────────── */
.project-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--bg-3); cursor: pointer; transition: all 0.15s; }
.project-row:last-child { border-bottom: none; }
.project-row:hover .proj-name { color: var(--blue-l); }
.proj-icon { width: 32px; height: 32px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.proj-name { font-size: 12px; font-weight: 500; color: var(--text-1); }
.proj-tech { font-size: 10px; color: var(--text-4); margin-top: 1px; }
.proj-time { margin-left: auto; font-size: 10px; color: var(--text-4); display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.online  { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.offline { width: 5px; height: 5px; border-radius: 50%; background: var(--text-4); }

/* ── Activity ────────────────────────────────────────────────────────────────── */
.activity-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--bg-3); }
.activity-row:last-child { border-bottom: none; }
.act-dot { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid; display: flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; margin-top: 1px; }
.act-green  { border-color: var(--green); color: var(--green); }
.act-blue   { border-color: var(--blue-l); color: var(--blue-l); }
.act-red    { border-color: var(--red); color: var(--red); }
.act-cyan   { border-color: var(--cyan); color: var(--cyan); }
.act-purple { border-color: var(--purple); color: var(--purple); }
.act-title { font-size: 12px; font-weight: 500; color: var(--text-1); line-height: 1.4; }
.act-sub   { font-size: 10px; color: var(--text-4); margin-top: 2px; }
.act-time  { margin-left: auto; font-size: 10px; color: var(--text-4); white-space: nowrap; flex-shrink: 0; }
.view-all-link { display: block; text-align: center; padding: 8px; font-size: 12px; color: var(--blue-l); margin-top: 8px; border-radius: var(--radius); transition: background 0.15s; }
.view-all-link:hover { background: var(--bg-4); }

/* ── Hero Banner ─────────────────────────────────────────────────────────────── */
.hero-banner {
  background: linear-gradient(135deg, var(--bg-3) 0%, #111d38 60%, var(--bg-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.hero-banner::after {
  content: '';
  position: absolute; right: 0; top: 0;
  width: 300px; height: 100%;
  background: radial-gradient(ellipse at right center, rgba(26,108,245,0.07) 0%, transparent 70%);
  pointer-events: none;
}
.hero-text h1 { font-family: var(--font-logo); font-size: 26px; font-weight: 700; }
.hero-text h1 span { color: var(--blue); }
.hero-text p { font-size: 13px; color: var(--text-3); margin-top: 3px; }

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: var(--radius); font-size: 13px; font-weight: 500; border: 1px solid transparent; transition: all 0.15s; cursor: pointer; }
.btn-primary   { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #1558d4; }
.btn-secondary { background: var(--bg-4); color: var(--text-2); border-color: var(--border2); }
.btn-secondary:hover { background: var(--bg-3); color: var(--text-1); }
.btn-danger    { background: var(--red-bg); color: var(--red); border-color: #3a1515; }
.btn-danger:hover { background: #3a1515; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ── Forms ───────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
.form-control {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text-1);
  padding: 9px 12px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
.form-control:focus { border-color: var(--blue); }
.form-control::placeholder { color: var(--text-4); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }

/* ── Badges ──────────────────────────────────────────────────────────────────── */
.badge-pill { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 10px; font-weight: 600; letter-spacing: 0.3px; }
.bp-green  { background: rgba(34,197,94,.15);  color: #4ade80; }
.bp-orange { background: rgba(251,146,60,.15); color: var(--orange); }
.bp-blue   { background: rgba(59,130,246,.15); color: #60a5fa; }
.bp-red    { background: rgba(239,68,68,.15);  color: var(--red); }
.bp-purple { background: rgba(167,139,250,.15);color: var(--purple); }
.bp-gray   { background: var(--bg-4); color: var(--text-3); }

/* ── Page header ─────────────────────────────────────────────────────────────── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-header h2 { font-size: 18px; font-weight: 600; color: var(--text-1); }
.page-header p  { font-size: 12px; color: var(--text-4); margin-top: 2px; }

/* ── Modal ───────────────────────────────────────────────────────────────────── */
.modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 1000; align-items: center; justify-content: center; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--bg-2); border: 1px solid var(--border2); border-radius: var(--radius-lg); padding: 24px; width: 480px; max-width: 95vw; max-height: 85vh; overflow-y: auto; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-size: 15px; font-weight: 600; color: var(--text-1); }
.modal-close { background: transparent; border: none; color: var(--text-4); font-size: 20px; cursor: pointer; padding: 2px; }
.modal-close:hover { color: var(--text-2); }
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* ── Alert ───────────────────────────────────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.alert-error   { background: var(--red-bg);   border: 1px solid #3a1515; color: var(--red); }
.alert-success { background: var(--green-bg); border: 1px solid #1a3a1a; color: #4ade80; }

/* ── Tables ──────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { background: var(--bg-3); color: var(--text-3); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; padding: 9px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody tr { border-bottom: 1px solid var(--border); transition: background 0.1s; }
tbody tr:hover { background: var(--bg-3); }
tbody td { padding: 9px 14px; font-size: 12px; color: var(--text-2); }
tbody tr:last-child { border-bottom: none; }

/* ── Editor ──────────────────────────────────────────────────────────────────── */
.editor-layout { display: flex; height: calc(100vh - var(--topbar-h) - 58px); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.editor-sidebar { width: 200px; background: var(--bg-2); border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; }
.editor-sidebar-header { padding: 9px 12px; font-size: 10px; font-weight: 600; color: var(--text-4); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 6px; }
.editor-file-list { flex: 1; overflow-y: auto; padding: 4px 0; }
.editor-file-item { display: flex; align-items: center; gap: 7px; padding: 6px 12px; font-size: 11px; color: var(--text-3); cursor: pointer; transition: all 0.15s; margin: 1px 4px; border-radius: 4px; }
.editor-file-item:hover { background: var(--bg-4); color: var(--text-2); }
.editor-file-item.active { background: var(--blue-bg); color: #93c5fd; }
.editor-file-item i { font-size: 13px; flex-shrink: 0; }
.editor-main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg-0); }
.editor-tabs { display: flex; align-items: flex-end; background: var(--bg-2); border-bottom: 1px solid var(--border); padding: 0 10px; gap: 2px; overflow-x: auto; flex-shrink: 0; }
.editor-tab { display: flex; align-items: center; gap: 5px; padding: 6px 12px; font-size: 11px; color: var(--text-4); cursor: pointer; border-radius: 4px 4px 0 0; white-space: nowrap; border: 1px solid transparent; border-bottom: none; margin-bottom: -1px; transition: all 0.15s; }
.editor-tab:hover { color: var(--text-2); background: var(--bg-3); }
.editor-tab.active { background: var(--bg-0); color: var(--text-1); border-color: var(--border); }
.editor-tab .tab-x { opacity: 0.4; font-size: 10px; }
.editor-tab:hover .tab-x { opacity: 0.8; }
.editor-code-area { flex: 1; display: flex; overflow: hidden; }
.line-numbers { width: 42px; text-align: right; padding: 12px 8px 12px 0; font-family: var(--font-mono); font-size: 12px; line-height: 1.7; color: var(--text-4); user-select: none; flex-shrink: 0; border-right: 1px solid var(--border); background: var(--bg-1); overflow: hidden; }
.code-editor-textarea { flex: 1; background: transparent; border: none; outline: none; color: var(--text-1); font-family: var(--font-mono); font-size: 12px; line-height: 1.7; padding: 12px 16px; resize: none; tab-size: 4; white-space: pre; overflow-wrap: normal; overflow-x: auto; }
.editor-statusbar { height: 22px; background: var(--blue); display: flex; align-items: center; padding: 0 12px; gap: 14px; font-size: 10px; color: rgba(255,255,255,0.7); flex-shrink: 0; }
.statusbar-right { margin-left: auto; display: flex; gap: 12px; }

/* ── Terminal ────────────────────────────────────────────────────────────────── */
.terminal-panel { height: 180px; background: var(--bg-0); border-top: 1px solid var(--border); display: flex; flex-direction: column; font-family: var(--font-mono); font-size: 11px; flex-shrink: 0; }
.terminal-header { padding: 5px 12px; background: var(--bg-2); border-bottom: 1px solid var(--border); font-size: 11px; color: var(--text-3); display: flex; align-items: center; gap: 8px; }
.terminal-body { flex: 1; overflow-y: auto; padding: 8px 12px; line-height: 1.65; }
.t-prompt { color: #4ade80; }
.t-cmd    { color: var(--text-1); }
.t-info   { color: var(--text-4); }
.t-ok     { color: var(--green); }
.t-err    { color: var(--red); }

/* ── Database ────────────────────────────────────────────────────────────────── */
.db-layout { display: flex; gap: 14px; }
.db-sidebar { width: 190px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 10px 0; overflow-y: auto; flex-shrink: 0; }
.db-table-item { padding: 7px 14px; font-size: 12px; color: var(--text-3); cursor: pointer; display: flex; align-items: center; gap: 7px; transition: all 0.15s; }
.db-table-item:hover { background: var(--bg-4); color: var(--text-2); }
.db-table-item.active { background: var(--blue-bg); color: #93c5fd; }
.db-main { flex: 1; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.db-query-box { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 14px; flex-shrink: 0; }
.db-result-box { flex: 1; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.db-result-header { padding: 9px 14px; border-bottom: 1px solid var(--border); font-size: 11px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; flex-shrink: 0; }
.db-result-content { flex: 1; overflow: auto; }

/* ── Kanban ──────────────────────────────────────────────────────────────────── */
.kanban { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; align-items: start; }
.kanban-col { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.kanban-header { padding: 10px 14px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.kanban-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.task-card { background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.task-title { font-size: 12px; font-weight: 500; color: var(--text-1); margin-bottom: 6px; line-height: 1.3; }
.task-meta  { font-size: 10px; color: var(--text-4); display: flex; align-items: center; gap: 8px; }

/* ── Login ───────────────────────────────────────────────────────────────────── */
.login-wrap { min-height: 100vh; background: var(--bg-0); display: flex; align-items: center; justify-content: center; }
.login-box { background: var(--bg-2); border: 1px solid var(--border2); border-radius: 14px; padding: 38px 34px; width: 380px; }
.login-logo { display: flex; flex-direction: column; align-items: center; margin-bottom: 28px; }
.login-logo-text { font-family: var(--font-logo); font-size: 24px; font-weight: 700; margin-top: 12px; }
.login-logo-text span { color: var(--blue); }
.login-logo-sub { font-size: 11px; color: var(--text-4); margin-top: 4px; }
.login-box h2 { font-size: 15px; font-weight: 600; margin-bottom: 18px; color: var(--text-1); }
