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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0a0c10;
  color: #d1d5db;
  min-height: 100vh;
}

.container { max-width: 840px; margin: 0 auto; padding: 48px 24px; }

/* Header */
.header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
h1 { font-size: 26px; font-weight: 700; color: #f0f0f0; letter-spacing: -0.5px; }
.subtitle { color: #6b7280; font-size: 14px; margin-top: 4px; }
.connection-status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #6b7280; margin-top: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; transition: background 0.3s; }
.dot.connected { background: #22c55e; box-shadow: 0 0 6px #22c55e66; }
.btn-logout { background: none; border: 1px solid #30363d; color: #8b949e; padding: 4px 12px; border-radius: 6px; font-size: 12px; cursor: pointer; margin-left: 8px; transition: all 0.2s; }
.btn-logout:hover { border-color: #ef4444; color: #ef4444; }

/* Channel Tabs */
.channel-tabs { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 16px; }
.tab-list { display: flex; gap: 4px; background: #111318; border: 1px solid #1e2028; border-radius: 12px; padding: 4px; }
.tab { position: relative; padding: 10px 32px; background: transparent; border: none; border-radius: 8px; color: #6b7280; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.tab:hover { color: #9ca3af; }
.tab.active { background: #1e2028; color: #f0f0f0; }
.tab-dot-indicator { display: none; width: 6px; height: 6px; border-radius: 50%; background: #22c55e; position: absolute; top: 6px; right: 10px; }
.tab.running .tab-dot-indicator { display: block; }
.tab-arrow { background: none; border: 1px solid #1e2028; color: #6b7280; width: 36px; height: 36px; border-radius: 8px; cursor: pointer; font-size: 20px; transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
.tab-arrow:hover { border-color: #3b82f6; color: #3b82f6; }

/* Total Bar */
.total-bar { text-align: center; font-size: 13px; color: #6b7280; margin-bottom: 20px; padding: 8px; background: #111318; border: 1px solid #1e2028; border-radius: 8px; }
#totalSessions { color: #f0f0f0; font-weight: 700; }

/* Cards */
.card { background: #111318; border: 1px solid #1e2028; border-radius: 14px; padding: 24px; margin-bottom: 20px; }
.card-title { font-size: 12px; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 20px; }
#channelLabel { color: #3b82f6; }

/* Form */
.form-group { margin-bottom: 16px; }
label { display: block; font-size: 13px; color: #9ca3af; margin-bottom: 6px; }
input[type="text"], input[type="number"] { width: 100%; padding: 11px 14px; background: #0a0c10; border: 1px solid #1e2028; border-radius: 10px; color: #e5e7eb; font-size: 14px; outline: none; transition: border-color 0.2s; }
input:focus { border-color: #3b82f6; }
input::placeholder { color: #4b5563; }

/* Buttons */
.btn-row { display: flex; gap: 12px; margin-top: 20px; }
.btn { flex: 1; padding: 12px 24px; border: none; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-start { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; }
.btn-stop { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; }
.btn.loading { pointer-events: none; opacity: 0.7; }
.btn.loading .btn-text { visibility: hidden; }
.btn.loading::after {
  content: ""; position: absolute; width: 20px; height: 20px;
  top: 50%; left: 50%; margin: -10px 0 0 -10px;
  border: 3px solid rgba(255,255,255,0.3); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.6s linear infinite;
}
.btn { position: relative; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Status Grid */
.status-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 600px) { .status-grid { grid-template-columns: repeat(2, 1fr); } }
.stat { background: #0a0c10; border-radius: 10px; padding: 16px; text-align: center; }
.stat-label { display: block; font-size: 11px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.stat-value { display: block; font-size: 28px; font-weight: 700; color: #f0f0f0; }
.stat-value.running { color: #22c55e; }
.stat-value.stopping { color: #eab308; }
.stat-value.idle { color: #6b7280; }
.url-display { font-size: 13px; color: #3b82f6; word-break: break-all; margin-top: 12px; padding: 0 4px; }

/* VPS Nodes Grid */
.nodes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 600px) { .nodes-grid { grid-template-columns: repeat(2, 1fr); } }
.node-card { background: #0a0c10; border-radius: 8px; padding: 12px; text-align: center; border: 1px solid #1e2028; }
.node-card.online { border-color: #22c55e33; }
.node-card.offline { border-color: #ef444433; opacity: 0.5; }
.node-name { font-size: 11px; font-weight: 600; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.5px; }
.node-status { font-size: 10px; margin-top: 4px; }
.node-status.online { color: #22c55e; }
.node-status.offline { color: #ef4444; }
.node-cpu { font-size: 18px; font-weight: 700; color: #f0f0f0; margin-top: 4px; }

/* Resources */
.resource { margin-bottom: 18px; }
.resource:last-child { margin-bottom: 0; }
.resource-header { display: flex; justify-content: space-between; font-size: 13px; color: #9ca3af; margin-bottom: 8px; }
.bar { width: 100%; height: 8px; background: #1e2028; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; transition: width 0.6s ease; width: 0%; }
.bar-fill.cpu { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.bar-fill.mem { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.bar-fill.warn { background: linear-gradient(90deg, #eab308, #facc15); }
.bar-fill.danger { background: linear-gradient(90deg, #ef4444, #f87171); }

/* Log */
.log { background: #0a0c10; border-radius: 10px; padding: 16px; max-height: 220px; overflow-y: auto; font-family: "SF Mono", "Fira Code", monospace; font-size: 12px; line-height: 1.8; color: #6b7280; }
.log::-webkit-scrollbar { width: 6px; }
.log::-webkit-scrollbar-track { background: transparent; }
.log::-webkit-scrollbar-thumb { background: #1e2028; border-radius: 3px; }
.log .info { color: #22c55e; }
.log .error { color: #ef4444; }
.log .warn { color: #eab308; }
