/* ========================================================================
   PVEBoard - Custom Theme Nubify (con soporte light/dark)
   ======================================================================== */

/* ── Paleta Nubify (alias sobre las variables de tema) ─────────── */
:root {
    --nubify-primary: #6366f1;
    --nubify-primary-dark: #4f46e5;
    --nubify-primary-light: #818cf8;
    --nubify-accent: #06b6d4;
    --nubify-gradient: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
    --nubify-success: #22c55e;
    --nubify-danger: #ef4444;
    --nubify-warning: #f59e0b;
    --nubify-console: #8b5cf6;
}

/* ── Toggle switch de tema ──────────────────────────────────────── */
.theme-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 26px;
    vertical-align: middle;
    margin: 0 8px;
}
.theme-switch input { display: none; }
.theme-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: 26px;
    transition: 0.3s;
}
.theme-switch .slider::before {
    content: "";
    position: absolute;
    height: 20px; width: 20px;
    left: 2px; bottom: 2px;
    background: var(--accent);
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.theme-switch input:checked + .slider {
    background: #f0f4f8;
    border-color: rgba(99,102,241,0.4);
}
.theme-switch input:checked + .slider::before {
    transform: translateX(26px);
    background: #f59e0b;
    box-shadow: 0 2px 8px rgba(245,158,11,0.5);
}
.theme-switch .icon-sun, .theme-switch .icon-moon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    pointer-events: none;
    transition: opacity 0.3s;
}
.theme-switch .icon-moon { left: 7px; opacity: 1; }
.theme-switch .icon-sun { right: 7px; opacity: 0.4; }
.theme-switch input:checked ~ .icon-moon { opacity: 0.3; }
.theme-switch input:checked ~ .icon-sun { opacity: 1; }

/* ── HEADER con logo ───────────────────────────────────────────── */
.header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
}
.header h2 img {
    height: 32px;
    width: auto;
}

/* ── TABS ──────────────────────────────────────────────────────── */
.tab-btn {
    font-weight: 600;
    transition: all 0.2s ease;
}
.tab-btn:hover {
    transform: translateY(-1px);
}
.tab-btn.tab-active {
    background: var(--nubify-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* ── TABLAS ────────────────────────────────────────────────────── */
table {
    border-radius: 12px;
    overflow: hidden;
}
th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 14px 12px;
}
td {
    padding: 12px;
    vertical-align: middle;
}

/* ── BADGES ────────────────────────────────────────────────────── */
.badge {
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    display: inline-block;
}

/* ── BOTONES ───────────────────────────────────────────────────── */
.btn {
    padding: 7px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    margin: 2px;
    transition: all 0.15s ease;
    letter-spacing: 0.3px;
}
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}
.btn:disabled {
    opacity: 0.3;
    cursor: default;
    transform: none;
    box-shadow: none;
}
.btn-start { background: var(--nubify-success); }
.btn-stop { background: var(--nubify-danger); }
.btn-reboot { background: var(--nubify-warning); }
.btn-console { background: var(--nubify-console); }

/* ── TOAST ─────────────────────────────────────────────────────── */
#toast {
    border-radius: 10px;
    font-weight: 600;
}

/* ── LOGIN ─────────────────────────────────────────────────────── */
.box .logo img {
    height: 48px;
    width: auto;
    margin-bottom: 8px;
}
input {
    border-radius: 8px;
    transition: border-color 0.2s ease;
}
input:focus {
    border-color: var(--nubify-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
button[type="submit"] {
    background: var(--nubify-gradient);
    font-weight: 700;
    border-radius: 8px;
    transition: all 0.2s ease;
}
button[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* ── ADMIN PANEL ───────────────────────────────────────────────── */
.card {
    border-radius: 12px;
}
.card h3 {
    color: var(--nubify-primary-light);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.badge-admin { background: var(--nubify-primary); }
.badge-soporte { background: var(--nubify-console); }

/* ── Scrollbar ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border-input, #334155);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary, #94a3b8);
}

/* ── Admin link ────────────────────────────────────────────────── */
.admin-link {
    color: var(--nubify-primary-light);
    text-decoration: none;
    font-weight: 600;
    padding: 4px 10px;
    border: 1px solid var(--nubify-primary-light);
    border-radius: 6px;
    transition: all 0.15s ease;
    font-size: 12px;
}
.admin-link:hover {
    background: var(--nubify-primary);
    color: #fff;
    border-color: var(--nubify-primary);
}

/* ── Responsive ────────────────────────────────────────────────── */
@media screen and (max-width: 768px) {
    .header h2 img { height: 26px; }
}
@media screen and (max-width: 480px) {
    .header h2 img { height: 22px; }
}
/* ========================================================================
   Responsive baseline 2026 — touch, safe areas and accessibility
   ======================================================================== */
html { overflow-x: hidden; -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; }
button, a, input, select, textarea { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--nubify-accent, #06b6d4); outline-offset: 2px; }
@media (pointer: coarse) {
    button, .btn, .admin-link, .tab-btn { min-height: 44px; }
}
@media screen and (max-width: 480px) {
    input, select, textarea { font-size: 16px; }
    #toast, #toast-admin { left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
