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

:root {
    --bg: #0f1117;
    --bg-card: #1a1d27;
    --bg-input: #252833;
    --border: #2d3040;
    --text: #e4e6ed;
    --text-muted: #8b8fa3;
    --accent: #4ade80;
    --accent-hover: #22c55e;
    --danger: #ef4444;
    --blue: #3b82f6;
    --sidebar-w: 220px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
}

/* Login */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2.5rem;
    width: 340px;
    text-align: center;
}
.login-box h1 { font-size: 1.8rem; margin-bottom: 0.25rem; }
.login-sub { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 0.9rem; }
.login-box input {
    width: 100%;
    padding: 0.7rem 1rem;
    margin-bottom: 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.95rem;
}
.login-box button {
    width: 100%;
    padding: 0.75rem;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 0.5rem;
}
.login-box button:hover { background: var(--accent-hover); }
.error { color: var(--danger); font-size: 0.85rem; margin-bottom: 1rem; }

/* Sidebar */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
}
.sidebar-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sidebar-header h2 { font-size: 1.15rem; }
.version { color: var(--text-muted); font-size: 0.75rem; }
.sidebar ul { list-style: none; padding: 0.5rem 0; flex: 1; }
.sidebar li a {
    display: block;
    padding: 0.65rem 1.25rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.15s;
}
.sidebar li a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.sidebar li a.active { color: var(--accent); background: rgba(74,222,128,0.08); border-right: 2px solid var(--accent); }
.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.beszel-link {
    color: var(--blue);
    text-decoration: none;
    font-size: 0.85rem;
}
.logout { color: var(--text-muted); text-decoration: none; font-size: 0.85rem; }
.logout:hover { color: var(--danger); }

/* Content */
.content {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 2rem;
    max-width: 1100px;
}
.content h1 { font-size: 1.6rem; margin-bottom: 0.25rem; }
.subtitle { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 0.9rem; }

/* Cards */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
}
.card-icon { font-size: 1.5rem; margin-bottom: 0.5rem; }
.card-label { color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; }
.card-value { font-size: 1.3rem; font-weight: 600; margin-top: 0.25rem; }
.card-sub { color: var(--text-muted); font-size: 0.8rem; margin-top: 0.25rem; }

/* Section boxes */
.section-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}
.section-box h2 { font-size: 1.1rem; margin-bottom: 1rem; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
thead th {
    text-align: left;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
}
tbody td {
    padding: 0.7rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 0.9rem;
    vertical-align: middle;
}
.text-muted { color: var(--text-muted); font-size: 0.8rem; }
.text-mono { font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; }

/* Badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}
.badge-green { background: rgba(74,222,128,0.15); color: var(--accent); }
.badge-red { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-gray { background: rgba(255,255,255,0.06); color: var(--text-muted); }

/* Buttons */
button, .btn-small {
    padding: 0.4rem 0.8rem;
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.15s;
}
button:hover, .btn-small:hover { border-color: var(--text-muted); }
.btn-danger { color: var(--danger); border-color: rgba(239,68,68,0.3); }
.btn-danger:hover { background: rgba(239,68,68,0.15); }
.btn-ssl { color: var(--accent); border-color: rgba(74,222,128,0.3); }
.btn-ssl:hover { background: rgba(74,222,128,0.15); }

/* Forms */
input[type="text"], input[type="password"] {
    padding: 0.5rem 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.9rem;
}
input:focus { outline: none; border-color: var(--accent); }
label { display: block; color: var(--text-muted); font-size: 0.8rem; margin-bottom: 0.3rem; }
.inline-form { display: flex; gap: 0.75rem; align-items: center; }
.inline-form input { flex: 1; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; align-items: end; }
.inline { display: inline; }
.actions { white-space: nowrap; }
.actions form { display: inline-block; margin-right: 0.3rem; }

/* Code blocks */
.code-block {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    overflow-x: auto;
    white-space: pre-wrap;
    color: var(--text-muted);
    line-height: 1.6;
}
.file-list { list-style: none; }
.file-list li {
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}
.alert.success { background: rgba(74,222,128,0.12); color: var(--accent); border: 1px solid rgba(74,222,128,0.2); }
.alert.error { background: rgba(239,68,68,0.12); color: var(--danger); border: 1px solid rgba(239,68,68,0.2); }

/* Mobile */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        min-height: auto;
        position: fixed;
        bottom: 0;
        top: auto;
        left: 0;
        flex-direction: row;
        z-index: 100;
        border-right: none;
        border-top: 1px solid var(--border);
    }
    .sidebar-header, .sidebar-footer { display: none; }
    .sidebar ul {
        display: flex;
        width: 100%;
        justify-content: space-around;
        padding: 0;
    }
    .sidebar li a {
        padding: 0.75rem 0.5rem;
        text-align: center;
        font-size: 1.2rem;
        border-right: none;
    }
    .sidebar li a.active { border-right: none; border-top: 2px solid var(--accent); }
    .content {
        margin-left: 0;
        padding: 1.25rem;
        padding-bottom: 5rem;
    }
    .cards { grid-template-columns: repeat(2, 1fr); }
    .form-grid { grid-template-columns: 1fr; }
}

/* Select */
select {
    padding: 0.5rem 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.9rem;
    width: 100%;
}
select:focus { outline: none; border-color: var(--accent); }

/* Stack Cards Grid */
.stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.stack-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.2rem;
    transition: border-color 0.2s;
}
.stack-card:hover { border-color: var(--text-muted); }
.stack-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}
.stack-icon { font-size: 1.6rem; }
.stack-name { font-size: 1.15rem; font-weight: 700; flex: 1; }
.stack-tech {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--accent);
    margin-bottom: 0.3rem;
}
.stack-size {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.7rem;
}
.stack-desc {
    font-size: 0.82rem;
    color: var(--text);
    line-height: 1.5;
    margin-bottom: 0.7rem;
}
.stack-examples {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.5;
    border-top: 1px solid var(--border);
    padding-top: 0.6rem;
}
.stack-examples-label {
    color: var(--text);
    font-weight: 600;
}

/* Semaforo */
.semaforo {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.semaforo-green {
    background: #4ade80;
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.5);
}
.semaforo-yellow {
    background: #fbbf24;
    box-shadow: 0 0 6px rgba(251, 191, 36, 0.5);
}
.semaforo-red {
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
}
.semaforo-gray {
    background: #6b7280;
    box-shadow: 0 0 4px rgba(107, 114, 128, 0.3);
}

/* Beszel nav link */
.beszel-nav {
    color: var(--blue) !important;
    border-left: 2px solid transparent;
}
.beszel-nav:hover {
    color: #60a5fa !important;
    background: rgba(59, 130, 246, 0.08) !important;
}
