/* RPOW MINER — Clean Dark Style */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0b0b10;
    --panel: #111118;
    --border: #1e1e2a;
    --border-light: #2a2a38;
    --text: #d4d4dc;
    --text-dim: #6b6b78;
    --text-bright: #f0f0f5;
    --accent: #7c8aff;
    --accent-dim: #5b6ad4;
    --green: #3fb950;
    --green-bg: rgba(63,185,80,0.1);
    --red: #f85149;
    --red-bg: rgba(248,81,73,0.1);
    --yellow: #d2991d;
    --yellow-bg: rgba(210,153,29,0.1);
    --gold: #e8b730;
    --radius: 6px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --mono: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
}

html, body {
    height: 100%; font-family: var(--font); background: var(--bg); color: var(--text);
    line-height: 1.5; font-size: 13px; -webkit-font-smoothing: antialiased;
}

/* ── Buttons ─────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 5px 12px; border: 1px solid var(--border-light); border-radius: var(--radius);
    background: transparent; color: var(--text-dim); cursor: pointer;
    font-size: 12px; font-family: var(--font); transition: 0.12s; white-space: nowrap;
    font-weight: 500;
}
.btn:hover { border-color: var(--text); color: var(--text-bright); background: transparent; }
.btn-accent { color: var(--gold); border-color: var(--gold); font-weight: 600; }
.btn-accent:hover { border-color: var(--gold); color: var(--gold); background: rgba(232,183,48,0.08); }
.btn-active { color: var(--green); border-color: var(--green); font-weight: 700; }
.btn-active:hover { background: var(--green-bg); }
.btn-green { color: var(--green); border-color: var(--green); font-weight: 600; }
.btn-green:hover { background: var(--green-bg); }
.btn-stop { color: var(--red); border-color: var(--red); }
.btn-stop:hover { background: var(--red-bg); }
.btn-sm { padding: 3px 8px; font-size: 11px; }
.btn-xs { padding: 2px 6px; font-size: 10px; border-radius: 4px; }

/* ── Layout ──────────────────────────────── */
.dashboard { max-width: 1200px; margin: 0 auto; padding: 20px 24px; }

/* ── Header ──────────────────────────────── */
.header {
    text-align: center; padding: 10px 0 16px;
    border-bottom: 1px solid var(--border); margin-bottom: 16px;
}
.header h1 {
    font-size: 36px; font-weight: 900; color: #f0883e;
    letter-spacing: 0.04em; margin-bottom: 2px;
    text-transform: uppercase;
}
.header .runtime {
    font-family: var(--mono); font-size: 13px; color: var(--text-dim);
}

/* ── Controls bar ────────────────────────── */
.controls {
    display: flex; align-items: center; gap: 6px; padding: 0 0 14px;
    flex-wrap: wrap;
}
.controls-left { display: flex; gap: 6px; }
.controls-right { display: flex; gap: 6px; margin-left: auto; }

.total-mints-big {
    font-size: 25px; font-weight: 800; color: #f0883e;
    letter-spacing: 0.03em; line-height: 1.1;
}

.controls-row {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 12px; padding: 0 0 14px; flex-wrap: wrap;
}
.controls-row > div { display: flex; gap: 6px; align-items: center; }

/* ── Stats row ───────────────────────────── */
.stats-row {
    display: flex; gap: 32px; justify-content: flex-end;
    padding: 0 0 14px; border-bottom: 1px solid var(--border); margin-bottom: 12px;
}
.stat-item { text-align: center; }
.stat-label { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.07em; }
.stat-value { font-size: 18px; font-weight: 700; color: var(--gold); font-family: var(--mono); }
.stat-unit { font-size: 10px; color: var(--text-dim); }

/* ── Guide section ───────────────────────── */
.guide {
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 14px 18px; margin-bottom: 14px;
}
.guide h3 { font-size: 14px; color: var(--accent); margin-bottom: 8px; }
.guide ol { padding-left: 20px; color: var(--text-dim); font-size: 12px; line-height: 1.8; }
.guide ol li { margin-bottom: 2px; }
.guide code {
    background: var(--bg); padding: 1px 6px; border-radius: 3px;
    font-family: var(--mono); font-size: 11px; color: var(--accent);
}
.guide-toggle {
    cursor: pointer; color: var(--text-dim); font-size: 12px;
    float: right; border: none; background: none;
}
.guide-toggle:hover { color: var(--text); }

/* ── Table ───────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.mining-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.mining-table thead th {
    padding: 7px 10px; text-align: left; font-weight: 600; font-size: 10px;
    color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border); background: var(--panel);
}
.mining-table tbody td {
    padding: 6px 10px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.mining-table tbody tr:hover td { background: rgba(124,138,255,0.03); }
.mining-table .col-id { width: 28px; color: var(--text-dim); text-align: center; }
.mining-table .col-balance { color: var(--gold); font-weight: 700; }
.mining-table .col-success { color: var(--green); }
.mining-table .col-last { color: var(--text-dim); font-size: 11px; }
.mining-table .col-actions { width: 140px; }
.row-active td { background: rgba(63,185,80,0.04) !important; }
.row-dup-ip td { background: rgba(248,81,73,0.05) !important; }
.col-ip-dup { color: var(--red); font-weight: bold; }

/* Status pills */
.status-badge {
    display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 10px;
    font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
}
.status-badge.mining,.status-badge.solving,.status-badge.connected,.status-badge.submitting { color: var(--green); }
.status-badge.cooldown,.status-badge.fetching,.status-badge.connecting { color: var(--yellow); }
.status-badge.error,.status-badge.fail { color: var(--red); }
.status-badge.idle,.status-badge.stopped { color: var(--text-dim); }

/* ── Empty state ─────────────────────────── */
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-dim); }
.empty-state h2 { font-size: 16px; margin-bottom: 6px; color: var(--text); }

/* ── Log Panel ───────────────────────────── */
.log-panel { margin-top: 14px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.log-header {
    display: flex; justify-content: space-between; padding: 7px 14px;
    background: var(--panel); border-bottom: 1px solid var(--border);
    font-size: 12px; color: var(--text-dim);
}
.log-content {
    height: 280px; overflow-y: auto; padding: 6px 14px;
    font-family: var(--mono); font-size: 11px; background: var(--bg);
}
.log-entry { padding: 1px 0; color: var(--text-dim); }
.log-error { color: var(--red); }
.log-success { color: var(--green); }
.log-warn { color: var(--yellow); }

/* ── Modal ───────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.8); }
.modal-content {
    position: relative; background: var(--panel); border: 1px solid var(--border);
    border-radius: 8px; padding: 20px; max-width: 460px; width: 92%; max-height: 88vh; overflow-y: auto;
}
.modal-content h2 { font-size: 16px; margin-bottom: 12px; color: var(--accent); }
.modal-content label { display: block; margin-top: 10px; margin-bottom: 3px; font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; }
.modal-content label .hint { font-size: 10px; color: #555; margin-left: 6px; text-transform: none; letter-spacing: 0; }
.modal-content input,.modal-content textarea {
    width: 100%; padding: 7px 10px; border: 1px solid var(--border-light); border-radius: var(--radius);
    background: var(--bg); color: var(--text); font-size: 12px; font-family: var(--font); outline: none;
}
.modal-content textarea { font-family: var(--mono); resize: vertical; min-height: 44px; }
.modal-content input:focus,.modal-content textarea:focus { border-color: var(--accent); }
.form-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.proxy-result { font-size: 11px; color: var(--green); font-family: var(--mono); }
.modal-buttons { display: flex; gap: 8px; margin-top: 14px; justify-content: flex-end; }

/* ── Scrollbar ───────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }

@media (max-width: 768px) {
    .dashboard { padding: 8px; }
    .controls { flex-direction: column; }
    .controls-right { margin-left: 0; }
    .stats-row { justify-content: center; }
}
