:root {
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #8fcbca;
    --accent-hover: #7bb5b4;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #10b981;
    --border: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #020617 100%);
    color: var(--text-primary);
    min-height: 100vh;
}

.dashboard {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 260px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--border);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.logo { display: flex; align-items: center; gap: 1rem; color: var(--accent); }
.logo i { font-size: 1.8rem; }
.logo h2 { font-weight: 600; font-size: 1.2rem; color: #fff; }

nav { display: flex; flex-direction: column; gap: 0.8rem; }
nav a {
    text-decoration: none;
    color: var(--text-secondary);
    padding: 1rem 1.2rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    border: 1px solid transparent;
}
nav a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    transform: translateX(4px);
}
nav a.active {
    background: linear-gradient(135deg, rgba(143, 203, 202, 0.2), rgba(143, 203, 202, 0.05));
    color: var(--accent);
    border: 1px solid rgba(143, 203, 202, 0.3);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
nav a i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    transition: transform 0.3s;
}
nav a.active i {
    transform: scale(1.15);
    color: var(--accent);
}


.content {
    flex: 1;
    padding: 3rem;
    overflow-y: auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

h1 { font-weight: 300; font-size: 2rem; letter-spacing: -0.5px; }

.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    display: flex; align-items: center; gap: 0.5rem;
    transition: all 0.3s;
}
.status-badge.connected { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.status-badge.disconnected { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

.grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

.card.glass {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.card h3 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: #cbd5e1;
    display: flex; align-items: center; gap: 0.5rem;
}

.qr-container {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    margin: 1.5rem 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.qr-container img { width: 100%; max-width: 250px; }

.actions { display: flex; gap: 1rem; margin-top: auto; }

.btn {
    flex: 1;
    padding: 0.8rem;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex; justify-content: center; align-items: center; gap: 0.5rem;
}
.btn.primary { background: var(--accent); color: white; }
.btn.primary:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3); }
.btn.danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid var(--danger); }
.btn.danger:hover { background: var(--danger); color: white; transform: translateY(-2px); }

.terminal {
    background: #000;
    border-radius: 8px;
    padding: 1.5rem;
    height: 400px;
    overflow-y: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    color: #a3be8c;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.log-line { margin-bottom: 0.6rem; padding-bottom: 0.6rem; border-bottom: 1px solid #111; line-height: 1.4; }
.log-line:last-child { border-bottom: none; }
.log-line .time { color: #888; margin-right: 0.5rem; }
.log-line.INFO { color: #81a1c1; }
.log-line.SUCCESS { color: #a3be8c; }
.log-line.ERROR { color: #bf616a; }
.log-line.WARN { color: #ebcb8b; }

/* Custom Scrollbar for terminal */
.terminal::-webkit-scrollbar { width: 8px; }
.terminal::-webkit-scrollbar-track { background: #111; border-radius: 4px; }
.terminal::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }
.terminal::-webkit-scrollbar-thumb:hover { background: #666; }

.form-input {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    margin-bottom: 1.2rem;
    margin-top: 0.3rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.settings-column label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Toast Settings */
#toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    z-index: 1000;
    transition: opacity 0.3s, transform 0.3s;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}
#toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Tool Cards */
.tool-card {
    position: relative;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    text-decoration: none;
    transition: transform 0.2s, border-color 0.2s;
    overflow: hidden;
}

.tool-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255,255,255,0.2);
}

.tool-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.tool-info h4 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
    font-weight: 600;
}

.tool-info p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
}

.external-icon {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity 0.2s;
}

.tool-card:hover .external-icon {
    opacity: 0.8;
}

