:root {
  --bg: #0d1117;
  --bg-2: #151b23;
  --bg-3: #1c242e;
  --line: #2a3440;
  --fg: #e6edf3;
  --fg-dim: #9aa7b4;
  --accent: #3ddc84;
  --accent-2: #26a866;
  --danger: #f85149;
  --warn: #e3b341;
  --radius: 14px;
  --font: "Vazirmatn", "IRANSans", "Segoe UI", Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  direction: rtl;
  font-family: var(--font);
  background: radial-gradient(1200px 600px at 80% -10%, #1b3a2b 0%, transparent 60%), var(--bg);
  color: var(--fg);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.7;
}
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { line-height: 1.4; margin: 0 0 .6rem; }

/* ---------- layout ---------- */
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
header.nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(13,17,23,.85); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { font-weight: 800; font-size: 1.2rem; display: flex; align-items: center; gap: 8px; }
.brand .cube { width: 22px; height: 22px; border-radius: 5px; background: linear-gradient(145deg, var(--accent), #1f7a4d); }
.nav-links { display: flex; gap: 14px; margin-inline-start: auto; align-items: center; flex-wrap: wrap; }
.nav-links a { color: var(--fg-dim); font-size: .93rem; }
.nav-links a:hover, .nav-links a.active { color: var(--fg); }

/* ---------- cards & controls ---------- */
.card {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
}
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--fg-dim); }
.small { font-size: .85rem; }

button, .btn {
  font-family: inherit; font-size: .92rem; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg-3); color: var(--fg);
  padding: 9px 16px; border-radius: 10px; transition: .15s;
}
button:hover, .btn:hover { border-color: var(--accent); }
button:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(160deg, var(--accent), var(--accent-2)); color: #07130d; border: none; }
.btn-danger { color: var(--danger); border-color: #55282a; }
.btn-sm { padding: 5px 10px; font-size: .82rem; border-radius: 8px; }

input, select, textarea {
  font-family: inherit; font-size: .92rem;
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
label { display: block; font-size: .85rem; color: var(--fg-dim); margin-bottom: 5px; }
.field { margin-bottom: 14px; }

input[type=range] { -webkit-appearance: none; appearance: none; height: 6px; background: var(--bg-3); border: none; padding: 0; border-radius: 99px; }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); cursor: pointer; border: 3px solid var(--bg-2);
}
input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); border: 3px solid var(--bg-2); }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: right; padding: 9px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--fg-dim); font-weight: 600; font-size: .82rem; }
code, .mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; direction: ltr; display: inline-block; }

.badge { font-size: .75rem; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg-3); }
.badge.running { color: var(--accent); border-color: #235c3e; background: #10261b; }
.badge.offline { color: var(--fg-dim); }
.badge.installing, .badge.starting { color: var(--warn); border-color: #5a4b1c; background: #241f10; }
.badge.error, .badge.suspended { color: var(--danger); border-color: #55282a; background: #241213; }

/* ---------- hero & plans ---------- */
.hero { padding: 70px 0 40px; text-align: center; }
.hero h1 { font-size: clamp(1.9rem, 5vw, 3rem); }
.hero p { color: var(--fg-dim); max-width: 620px; margin: 0 auto 24px; }
.plan { position: relative; display: flex; flex-direction: column; }
.plan.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.plan .tag { position: absolute; top: -11px; inset-inline-start: 20px; background: var(--accent); color: #07130d; font-size: .72rem; font-weight: 700; padding: 2px 10px; border-radius: 99px; }
.price { font-size: 1.7rem; font-weight: 800; }
.price small { font-size: .8rem; font-weight: 400; color: var(--fg-dim); }
.speclist { list-style: none; padding: 0; margin: 14px 0; font-size: .9rem; }
.speclist li { padding: 5px 0; border-bottom: 1px dashed var(--line); display: flex; justify-content: space-between; }

/* ---------- console ---------- */
.console {
  background: #05080b; border: 1px solid var(--line); border-radius: 10px;
  height: 420px; overflow-y: auto; padding: 12px 14px;
  font-family: ui-monospace, Consolas, monospace; font-size: .82rem;
  direction: ltr; text-align: left; white-space: pre-wrap; word-break: break-word;
}
.console .l { color: #b9c6d3; }
.console .l.err { color: #ff8a80; }
.console .l.warn { color: #ffd479; }
.console .l.cmd { color: var(--accent); }

/* ---------- misc ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 20px; padding-bottom: 0; }
.tabs button { background: none; border: none; border-bottom: 2px solid transparent; border-radius: 0; color: var(--fg-dim); padding: 10px 14px; white-space: nowrap; }
.tabs button.active { color: var(--fg); border-bottom-color: var(--accent); }

.bar { height: 7px; background: var(--bg-3); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.bar > i.hot { background: var(--warn); }
.bar > i.full { background: var(--danger); }

.stat { background: var(--bg-3); border-radius: 10px; padding: 12px 14px; }
.stat b { display: block; font-size: 1.25rem; }

#toast {
  position: fixed; bottom: 22px; inset-inline-start: 22px; z-index: 100;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--bg-3); border: 1px solid var(--line); border-inline-start: 3px solid var(--accent);
  padding: 11px 16px; border-radius: 10px; max-width: 380px; font-size: .9rem;
  animation: slide .2s ease;
}
.toast.err { border-inline-start-color: var(--danger); }
@keyframes slide { from { opacity: 0; transform: translateY(8px); } }

.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 90;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; }

.kv { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.kv:last-child { border: none; }
.total { font-size: 1.15rem; font-weight: 800; color: var(--accent); }
.note { background: #16221b; border: 1px solid #24503a; color: #a9e6c4; padding: 10px 14px; border-radius: 10px; font-size: .85rem; }
.warnbox { background: #241f10; border: 1px solid #5a4b1c; color: #f0d99a; padding: 10px 14px; border-radius: 10px; font-size: .85rem; }
footer { border-top: 1px solid var(--line); margin-top: 60px; padding: 28px 0; color: var(--fg-dim); font-size: .85rem; }
