/* ===========================================================================
   BotConnecta Manager — Stylesheet
   Design: Dark/Glass premium com tema claro/escuro
   =========================================================================== */

:root {
    /* Dark theme (padrão) */
    --bg-primary:    #0f1117;
    --bg-secondary:  #161b27;
    --bg-card:       #1a2035;
    --bg-card-hover: #1e2540;
    --bg-input:      #111827;
    --bg-sidebar:    #0d1220;

    --border:        rgba(255,255,255,0.07);
    --border-strong: rgba(255,255,255,0.12);

    --text-primary:  #f1f5f9;
    --text-secondary:#94a3b8;
    --text-muted:    #64748b;

    --accent:        #6366f1;
    --accent-hover:  #4f46e5;
    --accent-light:  rgba(99,102,241,0.15);

    --green:         #10b981;
    --green-light:   rgba(16,185,129,0.15);
    --red:           #ef4444;
    --red-light:     rgba(239,68,68,0.15);
    --orange:        #f59e0b;
    --orange-light:  rgba(245,158,11,0.15);
    --purple:        #8b5cf6;
    --purple-light:  rgba(139,92,246,0.15);
    --blue:          #3b82f6;
    --blue-light:    rgba(59,130,246,0.15);

    --sidebar-width: 240px;
    --header-height: 56px;
    --radius:        10px;
    --radius-sm:     6px;
    --radius-lg:     14px;

    --shadow:     0 4px 24px rgba(0,0,0,0.4);
    --shadow-sm:  0 2px 8px rgba(0,0,0,0.3);
    --shadow-lg:  0 8px 40px rgba(0,0,0,0.5);

    --transition: 0.2s ease;
}

/* Light theme */
[data-theme="light"] {
    --bg-primary:    #f1f5f9;
    --bg-secondary:  #e8edf5;
    --bg-card:       #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-input:      #f8fafc;
    --bg-sidebar:    #1a2035;

    --border:        rgba(0,0,0,0.08);
    --border-strong: rgba(0,0,0,0.15);

    --text-primary:  #0f172a;
    --text-secondary:#475569;
    --text-muted:    #94a3b8;

    --shadow:     0 4px 16px rgba(0,0,0,0.1);
    --shadow-sm:  0 2px 6px rgba(0,0,0,0.08);
    --shadow-lg:  0 8px 32px rgba(0,0,0,0.12);
}

/* ── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; -webkit-font-smoothing: antialiased; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ─────────────────────────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow: hidden;
    transition: transform var(--transition);
}

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────────── */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo-icon {
    width: 40px; height: 40px;
    background: var(--accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 0 20px rgba(99,102,241,0.4);
}

.sidebar-logo-name {
    font-weight: 700;
    font-size: 1rem;
    color: #f1f5f9;
    letter-spacing: -0.3px;
}
.sidebar-logo-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 8px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition);
    margin-bottom: 2px;
    text-decoration: none;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
    text-decoration: none;
}

.nav-item.active {
    background: var(--accent-light);
    color: var(--accent);
}

.nav-item.active svg { color: var(--accent); }

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.8rem; color: white;
    flex-shrink: 0;
}

.user-name { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); }
.user-role { font-size: 0.7rem; color: var(--text-muted); }
.sidebar-user { flex: 1; display: flex; align-items: center; gap: 8px; }

.btn-logout {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: all var(--transition);
    flex-shrink: 0;
}
.btn-logout:hover { background: var(--red-light); color: var(--red); }

/* ── Page Header ────────────────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
}

.page-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── Cards ───────────────────────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body { padding: 20px; }

/* ── Stats Grid ─────────────────────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: border-color var(--transition), transform var(--transition);
}

.stat-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

.stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.stat-icon-blue   { background: var(--blue-light);   color: var(--blue); }
.stat-icon-green  { background: var(--green-light);  color: var(--green); }
.stat-icon-orange { background: var(--orange-light); color: var(--orange); }
.stat-icon-purple { background: var(--purple-light); color: var(--purple); }

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
}
.btn:hover { text-decoration: none; }

.btn-primary   { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary { background: var(--bg-card); border-color: var(--border); color: var(--text-primary); }
.btn-secondary:hover { border-color: var(--border-strong); background: var(--bg-card-hover); }

.btn-danger { background: var(--red-light); color: var(--red); border-color: rgba(239,68,68,0.3); }
.btn-danger:hover { background: var(--red); color: white; }

.btn-warning { background: var(--orange-light); color: var(--orange); border-color: rgba(245,158,11,0.3); }
.btn-warning:hover { background: var(--orange); color: white; }

.btn-success { background: var(--green-light); color: var(--green); border-color: rgba(16,185,129,0.3); }
.btn-success:hover { background: var(--green); color: white; }

.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 12px 20px; font-size: 0.95rem; }
.btn-full { width: 100%; justify-content: center; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Table ───────────────────────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    padding: 10px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(255,255,255,0.02); }

.table-empty {
    text-align: center;
    padding: 48px 16px !important;
    color: var(--text-muted);
}

.table-empty svg { opacity: 0.3; margin-bottom: 12px; }
.table-empty p { margin-bottom: 16px; }

/* ── Badges / Status ──────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-version { background: var(--accent-light); color: var(--accent); }

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
}

.status-online    { background: var(--green-light); color: var(--green); }
.status-online .status-dot { background: var(--green); box-shadow: 0 0 6px var(--green); }

.status-offline   { background: var(--red-light); color: var(--red); }
.status-offline .status-dot { background: var(--red); }

.status-installing { background: var(--blue-light); color: var(--blue); }
.status-installing .status-dot { background: var(--blue); animation: pulse 1s infinite; }

.status-updating  { background: var(--orange-light); color: var(--orange); }
.status-updating .status-dot { background: var(--orange); animation: pulse 1s infinite; }

.status-degraded  { background: var(--orange-light); color: var(--orange); }
.status-degraded .status-dot { background: var(--orange); }

.status-pending   { background: rgba(100,116,139,0.15); color: var(--text-muted); }
.status-pending .status-dot { background: var(--text-muted); }

.status-stopped   { background: rgba(100,116,139,0.15); color: var(--text-muted); }
.status-stopped .status-dot { background: var(--text-muted); }

.status-checking  { background: var(--blue-light); color: var(--blue); }
.status-checking .status-dot { background: var(--blue); animation: pulse 0.5s infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ── Forms ───────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control { cursor: pointer; }

.form-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 5px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.input-icon-wrapper { position: relative; }
.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}
.input-icon-wrapper .form-control { padding-left: 38px; }

/* ── Alerts ───────────────────────────────────────────────────────────────────── */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 16px;
}

.alert-error   { background: var(--red-light); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }
.alert-success { background: var(--green-light); color: var(--green); border: 1px solid rgba(16,185,129,0.2); }
.alert-info    { background: var(--blue-light); color: var(--blue); border: 1px solid rgba(59,130,246,0.2); }
.alert-warning { background: var(--orange-light); color: var(--orange); border: 1px solid rgba(245,158,11,0.2); }

/* ── Quick Actions ────────────────────────────────────────────────────────────── */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* ── Misc ─────────────────────────────────────────────────────────────────────── */
.client-name { font-weight: 600; font-size: 0.875rem; }
.vps-info { display: flex; flex-direction: column; gap: 2px; }
.vps-name { font-weight: 500; font-size: 0.875rem; }
.vps-ip   { font-size: 0.75rem; color: var(--text-muted); font-family: monospace; }

.domain-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--accent);
}

.action-buttons { display: flex; gap: 4px; }

/* ── Activity Log ─────────────────────────────────────────────────────────────── */
.activity-log { padding: 8px 0; }

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }

.activity-icon {
    width: 28px; height: 28px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}
.activity-success { background: var(--green-light); color: var(--green); }
.activity-error   { background: var(--red-light);   color: var(--red); }
.activity-started { background: var(--blue-light);  color: var(--blue); }

.activity-content { flex: 1; }
.activity-text { font-size: 0.85rem; color: var(--text-primary); }
.activity-details { color: var(--text-muted); font-size: 0.82rem; }
.activity-time { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* ── Toast ────────────────────────────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    font-size: 0.875rem;
    color: var(--text-primary);
    min-width: 280px;
    max-width: 380px;
    pointer-events: auto;
    animation: slideIn 0.3s ease;
}

.toast-success { border-left: 3px solid var(--green); }
.toast-error   { border-left: 3px solid var(--red); }
.toast-warning { border-left: 3px solid var(--orange); }
.toast-info    { border-left: 3px solid var(--accent); }

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── Spinner ──────────────────────────────────────────────────────────────────── */
.spinner {
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Login ────────────────────────────────────────────────────────────────────── */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.login-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.login-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
}

.login-orb-1 {
    width: 500px; height: 500px;
    background: var(--accent);
    top: -200px; left: -100px;
    animation: floatOrb 8s ease-in-out infinite;
}
.login-orb-2 {
    width: 400px; height: 400px;
    background: var(--purple);
    bottom: -100px; right: -100px;
    animation: floatOrb 10s ease-in-out infinite reverse;
}
.login-orb-3 {
    width: 300px; height: 300px;
    background: var(--blue);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation: floatOrb 12s ease-in-out infinite;
}

@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, -30px); }
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: rgba(26, 32, 53, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.login-logo-icon {
    width: 52px; height: 52px;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    color: white;
    box-shadow: 0 0 30px rgba(99,102,241,0.4);
    flex-shrink: 0;
}

.login-title { font-size: 1.4rem; font-weight: 700; color: var(--text-primary); }
.login-sub   { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

.login-form { margin-top: 8px; }

.login-hint {
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 16px;
}

/* ── Progress Bar ─────────────────────────────────────────────────────────────── */
.progress-wrapper { margin-bottom: 8px; }
.progress-label { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 6px; }
.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--purple));
    border-radius: 10px;
    transition: width 0.5s ease;
}

/* ── Log Terminal ─────────────────────────────────────────────────────────────── */
.terminal {
    background: #0a0d14;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.8rem;
    line-height: 1.7;
    color: #a8ff78;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ── Steps ────────────────────────────────────────────────────────────────────── */
.steps {
    display: flex;
    gap: 0;
    margin-bottom: 28px;
    position: relative;
}

.step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.step::before {
    content: '';
    position: absolute;
    top: 15px;
    left: -50%;
    right: 50%;
    height: 2px;
    background: var(--border);
}

.step:first-child::before { display: none; }

.step.active::before,
.step.done::before { background: var(--accent); }

.step-dot {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--bg-input);
    border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    position: relative;
    z-index: 1;
    transition: all var(--transition);
}

.step.active .step-dot { background: var(--accent); border-color: var(--accent); color: white; }
.step.done .step-dot { background: var(--green); border-color: var(--green); color: white; }

.step-label { font-size: 0.72rem; color: var(--text-muted); margin-top: 6px; text-align: center; }
.step.active .step-label { color: var(--accent); font-weight: 600; }
.step.done .step-label { color: var(--green); }

/* ── Modal ────────────────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ── Section Header ───────────────────────────────────────────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.section-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); }

/* ── Grid ─────────────────────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ── VPS Cards ────────────────────────────────────────────────────────────────── */
.vps-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition);
}
.vps-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.vps-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.vps-card-name { font-weight: 600; font-size: 0.95rem; }
.vps-card-ip { font-size: 0.78rem; color: var(--text-muted); font-family: monospace; margin-top: 2px; }
.vps-card-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.vps-stat { background: var(--bg-secondary); border-radius: var(--radius-sm); padding: 10px; text-align: center; }
.vps-stat-value { font-size: 1.2rem; font-weight: 700; color: var(--text-primary); }
.vps-stat-label { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.vps-card-actions { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }

/* ── Responsive ───────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }
    .main-content { margin-left: 0; }
    .menu-toggle { display: flex; }
    .form-row, .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .page-content { padding: 16px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
}

/* ── Theme Toggle Button ──────────────────────────────────────────────────────── */
.theme-toggle-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    outline: none;
}
.theme-toggle-btn:hover {
    color: var(--accent);
    border-color: var(--accent-light);
    transform: scale(1.05);
}
.theme-sun { display: block; color: #f59e0b; }
.theme-moon { display: none; color: #6366f1; }
[data-theme="light"] .theme-sun { display: none; }
[data-theme="light"] .theme-moon { display: block; }

/* ── Login Top Bar ───────────────────────────────────────────────────────────── */
.login-top-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

/* ── Password Toggle Button ─────────────────────────────────────────────────── */
.input-password-wrapper {
    position: relative;
}
.input-password-wrapper .form-control {
    padding-right: 42px;
}
.btn-toggle-pw {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: color var(--transition);
}
.btn-toggle-pw:hover {
    color: var(--text-primary);
}

/* ── Settings Layout ─────────────────────────────────────────────────────────── */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 20px;
    align-items: start;
}
.settings-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.settings-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.card-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.profile-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 24px;
}
.profile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    color: white;
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
.profile-details {
    flex: 1;
}
.profile-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}
.profile-role {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}
.status-dot-static {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    display: inline-block;
}
.profile-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.form-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    letter-spacing: 0.2px;
}
.form-divider {
    height: 1px;
    background: var(--border);
    margin: 20px 0;
}
.form-actions-right {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
}

/* ── Theme Options Grid ──────────────────────────────────────────────────────── */
.theme-choice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.theme-option-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
}
.theme-option-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
}
.theme-option-card.active {
    border-color: var(--accent);
    background: var(--accent-light);
}
.theme-preview {
    width: 100%;
    height: 60px;
    border-radius: var(--radius-sm);
    display: flex;
    overflow: hidden;
    border: 1px solid var(--border);
}
.theme-preview-dark {
    background: #0f1117;
}
.theme-preview-dark .preview-sidebar {
    width: 25%;
    background: #0d1220;
    border-right: 1px solid rgba(255,255,255,0.08);
}
.theme-preview-dark .preview-content {
    flex: 1;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.theme-preview-dark .preview-bar {
    height: 8px;
    background: #161b27;
    border-radius: 2px;
}
.theme-preview-dark .preview-box {
    flex: 1;
    background: #1a2035;
    border-radius: 2px;
}

.theme-preview-light {
    background: #f8fafc;
}
.theme-preview-light .preview-sidebar {
    width: 25%;
    background: #ffffff;
    border-right: 1px solid rgba(0,0,0,0.08);
}
.theme-preview-light .preview-content {
    flex: 1;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.theme-preview-light .preview-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 2px;
}
.theme-preview-light .preview-box {
    flex: 1;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 2px;
}

.theme-option-label {
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-primary);
}
.theme-active-indicator {
    display: none;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent);
}

/* ── System Info List ────────────────────────────────────────────────────────── */
.system-info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.system-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.system-info-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.info-label {
    color: var(--text-muted);
}
.info-value {
    font-weight: 500;
    color: var(--text-primary);
}

/* ── Security Tips List ──────────────────────────────────────────────────────── */
.security-tips-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
}
.security-tips-list li {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
    position: relative;
    padding-left: 16px;
}
.security-tips-list li::before {
    content: "•";
    color: var(--orange);
    position: absolute;
    left: 0;
    font-size: 1.1rem;
    line-height: 1;
}

/* ── Light Mode Refinements (Zero Contrast Issues) ────────────────────────────── */
[data-theme="light"] .sidebar {
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
}
[data-theme="light"] .sidebar-logo-name {
    color: #0f172a;
}
[data-theme="light"] .sidebar-nav .nav-item {
    color: #475569;
}
[data-theme="light"] .sidebar-nav .nav-item:hover {
    background: #f1f5f9;
    color: #0f172a;
}
[data-theme="light"] .sidebar-nav .nav-item.active {
    background: rgba(99, 102, 241, 0.12);
    color: #4f46e5;
}
[data-theme="light"] .sidebar-user .user-name {
    color: #0f172a;
}
[data-theme="light"] .page-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}
[data-theme="light"] .card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .card-header {
    border-bottom: 1px solid #e2e8f0;
}
[data-theme="light"] .profile-banner {
    background: #f8fafc;
    border-color: #e2e8f0;
}
[data-theme="light"] .form-control {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}
[data-theme="light"] .form-control:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
[data-theme="light"] .login-body {
    background: #f8fafc;
}
[data-theme="light"] .login-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e2e8f0;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .login-orb {
    opacity: 0.08;
}
[data-theme="light"] .vps-card,
[data-theme="light"] .stat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}
[data-theme="light"] .vps-stat {
    background: #f8fafc;
}
[data-theme="light"] .table tr:hover td {
    background: #f8fafc;
}
[data-theme="light"] .table td,
[data-theme="light"] .table th {
    border-bottom-color: #e2e8f0;
}
[data-theme="light"] .btn-secondary {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #1e293b;
}
[data-theme="light"] .btn-secondary:hover {
    background: #f1f5f9;
}
[data-theme="light"] .modal {
    background: #ffffff;
    border-color: #e2e8f0;
}
[data-theme="light"] .theme-option-card {
    background: #f8fafc;
    border-color: #e2e8f0;
}
[data-theme="light"] .theme-option-card.active {
    background: rgba(99, 102, 241, 0.08);
    border-color: #6366f1;
}

@media (max-width: 992px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

