@import url('https://fonts.googleapis.com/css2?family=Oxanium:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

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

:root {
  --bg:     #08090d;
  --bg2:    #0d0e14;
  --bg3:    #111421;
  --card:   #0f1117;
  --border: #1a1d2e;
  --border2:#222540;
  --cyan:   #00d4ff;
  --cyan2:  #00a8cc;
  --purple: #7c3aed;
  --green:  #00ff88;
  --orange: #f97316;
  --red:    #ef4444;
  --yellow: #fbbf24;
  --text:   #e2e8f0;
  --text2:  #94a3b8;
  --text3:  #475569;
  --font:   'Oxanium', sans-serif;
  --mono:   'JetBrains Mono', monospace;
}

html, body { height: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.6; overflow-x: hidden; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--cyan2); }

/* ── Animations ── */
@keyframes fadeIn    { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }
@keyframes slideIn   { from{transform:translateX(-16px);opacity:0} to{transform:translateX(0);opacity:1} }
@keyframes spin      { to{transform:rotate(360deg)} }
@keyframes glowPulse { 0%,100%{opacity:.7} 50%{opacity:1} }
@keyframes float     { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
@keyframes loadBar   { from{width:0} to{width:100%} }
@keyframes blink     { 0%,100%{opacity:1} 50%{opacity:0} }

.animate-in  { animation: fadeIn .35s ease forwards; }
.animate-slide { animation: slideIn .25s ease forwards; }

/* ── Grid background ── */
.grid-bg {
  background-image: linear-gradient(rgba(0,212,255,.025) 1px,transparent 1px),
                    linear-gradient(90deg,rgba(0,212,255,.025) 1px,transparent 1px);
  background-size: 40px 40px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 18px; border-radius: 4px; border: none; cursor: pointer;
  font-family: var(--font); font-size: 13px; font-weight: 600;
  letter-spacing: .5px; text-transform: uppercase; text-decoration: none;
  transition: all .18s; white-space: nowrap;
}
.btn:disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }
.btn-cyan   { background: var(--cyan); color: #000; }
.btn-cyan:hover   { background: #00eeff; box-shadow: 0 0 18px rgba(0,212,255,.5); }
.btn-outline{ background: transparent; color: var(--cyan); border: 1px solid var(--cyan); }
.btn-outline:hover{ background: rgba(0,212,255,.1); }
.btn-ghost  { background: transparent; color: var(--text2); border: 1px solid var(--border2); }
.btn-ghost:hover  { background: var(--bg3); color: var(--text); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; box-shadow: 0 0 16px rgba(239,68,68,.4); }
.btn-green  { background: var(--green); color: #000; }
.btn-green:hover  { background: #00ffaa; box-shadow: 0 0 16px rgba(0,255,136,.4); }
.btn-purple { background: var(--purple); color: #fff; }
.btn-purple:hover { background: #6d28d9; box-shadow: 0 0 16px rgba(124,58,237,.4); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn-icon { padding: 7px; }
.btn-full { width: 100%; }

/* ── Cards ── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; contain: layout style; }
.card-hover { transition: all .18s; }
.card-hover:hover { border-color: var(--border2); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.card-body  { padding: 22px; }
.card-header{ padding: 14px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 15px; font-weight: 700; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 11px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: .6px; font-family: var(--mono); margin-bottom: 6px; }
.form-hint  { font-size: 11px; color: var(--text3); margin-top: 4px; }
.input {
  width: 100%; background: var(--bg2); border: 1px solid var(--border2);
  color: var(--text); border-radius: 4px; padding: 9px 13px;
  font-family: var(--font); font-size: 14px; transition: border-color .18s;
}
.input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0,212,255,.1); }
.input::placeholder { color: var(--text3); }
.input:disabled { opacity: .5; cursor: not-allowed; }
select.input option { background: var(--bg2); }
textarea.input { resize: vertical; min-height: 90px; }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 3px; font-size: 11px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; font-family: var(--mono); }
.badge-cyan   { background: rgba(0,212,255,.15); color: var(--cyan); }
.badge-green  { background: rgba(0,255,136,.15); color: var(--green); }
.badge-red    { background: rgba(239,68,68,.15);  color: var(--red); }
.badge-orange { background: rgba(249,115,22,.15); color: var(--orange); }
.badge-purple { background: rgba(124,58,237,.15); color: #a78bfa; }
.badge-gray   { background: rgba(100,116,139,.15);color: var(--text2); }
.badge-yellow { background: rgba(251,191,36,.15); color: var(--yellow); }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: 10px 16px; font-size: 11px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--text3); border-bottom: 1px solid var(--border); font-family: var(--mono); white-space: nowrap; }
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text2); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: rgba(255,255,255,.02); }
.data-table .td-mono { font-family: var(--mono); font-size: 12px; }
.data-table .td-bold { color: var(--text); font-weight: 600; }

/* ── Progress bars ── */
.progress { height: 4px; background: var(--border2); border-radius: 2px; overflow: hidden; margin-top: 4px; }
.progress-fill { height: 100%; border-radius: 2px; transition: width .5s ease; }
.progress-cyan   { background: var(--cyan); }
.progress-green  { background: var(--green); }
.progress-purple { background: var(--purple); }
.progress-orange { background: var(--orange); }
.progress-red    { background: var(--red); }

/* ── Stat cards ── */
.stat-card { padding: 20px; }
.stat-value { font-size: 26px; font-weight: 700; font-family: var(--mono); line-height: 1.1; }
.stat-label { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--text3); font-family: var(--mono); margin-top: 4px; }
.stat-change{ font-size: 12px; font-weight: 600; }

/* ── Tabs ── */
.tab-bar  { display: flex; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab-item { padding: 10px 18px; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--text3); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all .15s; white-space: nowrap; }
.tab-item:hover  { color: var(--text2); }
.tab-item.active { color: var(--cyan); border-bottom-color: var(--cyan); }

/* ── Divider ── */
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ── Modal ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.85); backdrop-filter: blur(5px); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.hidden { display: none; }
.modal-box { background: var(--bg2); border: 1px solid var(--border2); border-radius: 10px; padding: 28px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; animation: fadeIn .2s ease; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text3); cursor: pointer; font-size: 18px; padding: 4px; line-height: 1; }
.modal-close:hover { color: var(--text); }

/* ── Toast ── */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--bg3); border: 1px solid var(--border2); border-left: 3px solid var(--cyan); padding: 13px 18px; border-radius: 6px; font-size: 13px; display: flex; align-items: center; gap: 10px; min-width: 280px; max-width: 380px; box-shadow: 0 8px 32px rgba(0,0,0,.5); animation: fadeIn .3s ease; }
.toast-success { border-left-color: var(--green); }
.toast-error   { border-left-color: var(--red); }
.toast-warning { border-left-color: var(--yellow); }
.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast-msg  { flex: 1; }
.toast-close{ background: none; border: none; color: var(--text3); cursor: pointer; font-size: 14px; padding: 0; }

/* ── Spinner ── */
.spinner { display: inline-block; border: 2px solid var(--border2); border-top-color: var(--cyan); border-radius: 50%; animation: spin .7s linear infinite; flex-shrink: 0; }

/* ── Status dot ── */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-green  { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot-gray   { background: var(--text3); }
.dot-yellow { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); }
.dot-orange { background: var(--orange); box-shadow: 0 0 6px var(--orange); }
.dot-red    { background: var(--red); box-shadow: 0 0 6px var(--red); }

/* ── Gradient text ── */
.grad-cyan   { background: linear-gradient(135deg,var(--cyan),var(--purple)); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }
.grad-green  { background: linear-gradient(135deg,var(--cyan),var(--green));  -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }

/* ── Section header ── */
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.section-title{ font-size: 20px; font-weight: 700; }
.section-sub  { font-size: 13px; color: var(--text3); margin-top: 2px; }

/* ── Empty state ── */
.empty-state  { text-align: center; padding: 60px 24px; }
.empty-icon   { font-size: 52px; margin-bottom: 16px; }
.empty-title  { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.empty-sub    { font-size: 14px; color: var(--text3); margin-bottom: 24px; }

/* ── Resource gauge ── */
.gauge-row  { margin-bottom: 14px; }
.gauge-head { display: flex; justify-content: space-between; margin-bottom: 5px; }
.gauge-label{ font-size: 11px; color: var(--text3); font-family: var(--mono); text-transform: uppercase; letter-spacing: .5px; }
.gauge-val  { font-size: 12px; font-weight: 600; font-family: var(--mono); }

/* ── Console ── */
.console-out { background: #020304; border: 1px solid var(--border); border-radius: 6px; padding: 14px; font-family: var(--mono); font-size: 12px; line-height: 1.9; height: 380px; overflow-y: auto; color: #8090a0; }
.cl-info  { color: #60a5fa; }
.cl-warn  { color: var(--yellow); }
.cl-error { color: var(--red); }
.cl-ok    { color: var(--green); }
.cl-input { color: #e2e8f0; }
.console-in { display: flex; gap: 10px; margin-top: 10px; }
.console-in .input { font-family: var(--mono); font-size: 13px; }

/* ── File manager ── */
.file-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 4px; cursor: pointer; font-size: 13px; color: var(--text2); transition: background .12s; border: 1px solid transparent; }
.file-row:hover   { background: var(--bg3); border-color: var(--border); }
.file-row.selected{ background: rgba(0,212,255,.07); border-color: rgba(0,212,255,.2); color: var(--text); }

/* ── Misc layout helpers ── */
.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-14 { gap: 14px; }
.gap-20 { gap: 20px; }
.flex-1 { flex: 1; }
.wrap   { flex-wrap: wrap; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.text-mono { font-family: var(--mono); }
.text-cyan  { color: var(--cyan); }
.text-green { color: var(--green); }
.text-red   { color: var(--red); }
.text-orange{ color: var(--orange); }
.text-muted { color: var(--text3); }
.text-sm    { font-size: 12px; }
.text-xs    { font-size: 11px; }
.font-bold  { font-weight: 700; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
@media(max-width:900px){ .grid-4{grid-template-columns:1fr 1fr;} .grid-3{grid-template-columns:1fr 1fr;} }
@media(max-width:600px){ .grid-4,.grid-3,.grid-2{grid-template-columns:1fr;} }

/* ── Loading screen ── */
#page-loader { position:fixed;inset:0;background:var(--bg);display:flex;flex-direction:column;align-items:center;justify-content:center;z-index:9999;transition:opacity .4s ease; }
#page-loader .logo   { font-size:52px;margin-bottom:16px;animation:float 2s ease-in-out infinite; }
#page-loader .name   { font-size:24px;font-weight:800;letter-spacing:2px;margin-bottom:6px; }
#page-loader .sub    { font-size:11px;color:var(--text3);letter-spacing:3px;text-transform:uppercase;margin-bottom:28px; }
#page-loader .bar    { width:180px;height:3px;background:var(--border2);border-radius:2px;overflow:hidden; }
#page-loader .fill   { height:100%;background:linear-gradient(90deg,var(--cyan),var(--purple));animation:loadBar 1.4s ease forwards; }
