/* ESP32 Control — matches ReconPulse design */
:root {
    --bg: #0a0e17;
    --bg-card: #1e293b;
    --bg-hover: #253348;
    --border: #334155;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --accent: #22c55e;
    --cyan: #06b6d4;
    --blue: #3b82f6;
    --red: #ef4444;
    --orange: #f97316;
    --yellow: #f59e0b;
    --radius: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
}
/* Sidebar */
.sidebar {
    width: 220px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 10;
}
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1.2rem;
    margin-bottom: 1.5rem;
    text-decoration: none;
}
.sidebar-logo-text { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.sidebar-logo-text .accent { color: var(--accent); }
.sidebar-nav { flex: 1; }
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 1.2rem;
    color: var(--text-muted);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.9rem;
}
.sidebar-item:hover { color: var(--text); background: var(--bg-hover); }
.sidebar-item.active { color: var(--accent); background: rgba(34,197,94,0.1); border-right: 3px solid var(--accent); }
.sidebar-bottom { border-top: 1px solid var(--border); padding-top: 0.5rem; }
/* Content */
.content {
    flex: 1;
    margin-left: 220px;
    padding: 0 2rem 2rem;
}
.topbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}
.badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}
.badge-on { background: rgba(34,197,94,0.15); color: var(--accent); }
.badge-off { background: rgba(239,68,68,0.15); color: var(--red); }
/* Page header */
.page-header { margin-bottom: 2rem; }
.page-header h1 {
    font-size: 1.8rem;
    background: linear-gradient(135deg, var(--accent), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.3rem;
}
.page-header p { color: var(--text-muted); }
/* Cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; margin-bottom: 1.5rem; }
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.card h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.card-icon { font-size: 2rem; margin-bottom: 0.8rem; }
.card-desc { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 1rem; }
.card-info {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem;
    background: var(--bg);
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}
/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #2563eb; }
.btn-success { background: var(--accent); color: #000; }
.btn-success:hover { background: #16a34a; }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: #475569; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-tag {
    padding: 0.3rem 0.7rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-tag:hover { border-color: var(--accent); color: var(--accent); }
.quick-commands { display: flex; gap: 0.4rem; margin-top: 0.8rem; flex-wrap: wrap; }
/* Stats */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; margin-bottom: 1rem; }
.stat { text-align: center; padding: 0.6rem; background: var(--bg); border-radius: 8px; }
.stat-val { font-size: 1.1rem; font-weight: 700; color: var(--accent); }
.stat-lbl { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.2rem; }
/* Progress */
.progress-wrap { display: flex; align-items: center; gap: 1rem; margin: 1.5rem 0; }
.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--cyan));
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s;
}
.progress-text { font-size: 0.85rem; color: var(--text-muted); min-width: 40px; }
/* Terminal */
.terminal {
    background: #000;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.8rem;
    max-height: 200px;
    overflow-y: auto;
}
.term-line { margin-bottom: 0.15rem; color: var(--text); }
.term-ok { color: var(--accent); }
.term-err { color: var(--red); }
.term-info { color: var(--text-muted); }
.term-cmd { color: var(--blue); }
.term-muted { color: var(--text-muted); }
.terminal-input { display: flex; gap: 0.5rem; margin-top: 0.8rem; }
.terminal-input input {
    flex: 1;
    padding: 0.6rem 0.8rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
}
.terminal-input input:focus { outline: none; border-color: var(--accent); }
/* WiFi list */
.wifi-list { max-height: 300px; overflow-y: auto; }
.wifi-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.15s;
}
.wifi-item:hover { border-color: var(--accent); }
.signal { display: flex; align-items: flex-end; gap: 2px; }
.muted { color: var(--text-muted); font-size: 0.8rem; }
.hidden { display: none !important; }
.spinner {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .sidebar-logo-text, .sidebar-item span { display: none; }
    .content { margin-left: 60px; padding: 0 1rem; }
    .card-grid { grid-template-columns: 1fr; }
}
