/* WAISP Nest Studio — Official Crimson #d01336 Theme */
:root {
    --bg: #0b090a;
    --bg-card: rgba(208, 19, 54, 0.04);
    --bg-card-hover: rgba(208, 19, 54, 0.08);
    --border: rgba(208, 19, 54, 0.22);
    
    --primary: #d01336;
    --primary-hover: #b0102d;
    --primary-glow: rgba(208, 19, 54, 0.35);
    
    --accent: #facc15;
    --accent-glow: rgba(250, 204, 21, 0.35);
    
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    --text: #fef1f2;
    --text-muted: #a1a1aa;
    
    --font-sans: 'Inter', sans-serif;
    --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-sans); background: var(--bg); color: var(--text); line-height: 1.5; overflow-x: hidden; }

.layout { display: flex; height: 100vh; }
.sidebar { width: 260px; background: rgba(15, 12, 14, 0.95); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 24px 16px; }
.logo { display: flex; align-items: center; gap: 12px; font-size: 1.25rem; font-weight: 700; margin-bottom: 40px; }
.logo-img { width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 0 8px var(--primary-glow)); }
.logo-badge { background: rgba(208, 19, 54, 0.18); color: var(--primary); font-size: 0.65rem; padding: 2px 6px; border-radius: 4px; }

.nav-menu { display: flex; flex-direction: column; gap: 6px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; color: var(--text-muted); text-decoration: none; border-radius: 8px; font-weight: 500; transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease; }
.nav-item:hover, .nav-item.active { background: rgba(208, 19, 54, 0.15); color: var(--primary); }

.sidebar-footer { border-top: 1px solid var(--border); padding-top: 16px; margin-top: auto; }
.user-profile { display: flex; align-items: center; gap: 12px; padding: 4px 8px; }
.user-profile img.avatar { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); }
.avatar-placeholder { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,0.05); display: flex; align-items: center; justify-content: center; color: var(--text-muted); border: 1px solid var(--border); }
.user-info { display: flex; flex-direction: column; }
.user-name { font-size: 0.9rem; font-weight: 500; }
.user-status { font-size: 0.75rem; }

.main-content { flex: 1; display: flex; flex-direction: column; overflow-y: auto; }
.topbar { display: flex; justify-content: flex-end; align-items: center; padding: 16px 40px; border-bottom: 1px solid var(--border); background: rgba(15, 12, 14, 0.8); }
.token-group { display: flex; gap: 8px; }
.input-token { background: rgba(255,255,255,0.05); border: 1px solid var(--border); color: var(--text); padding: 8px 12px; border-radius: 8px; width: 280px; }

.content-body { padding: 32px 40px; flex: 1; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }

.glass { background: var(--bg-card); border: 1px solid var(--border); backdrop-filter: blur(12px); border-radius: var(--radius); padding: 24px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.stat-card { display: flex; align-items: center; gap: 16px; }
.stat-icon { font-size: 1.8rem; color: var(--primary); }
.stat-value { font-size: 1.6rem; font-weight: 700; }

.code-badge {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    padding: 3px 8px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--accent);
    word-break: break-all;
    display: inline-block;
}

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 8px; font-weight: 600; cursor: pointer; border: none; transition: opacity 0.2s ease, background-color 0.2s ease; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: rgba(255,255,255,0.08); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }

.input { width: 100%; background: rgba(0,0,0,0.4); border: 1px solid var(--border); color: var(--text); padding: 10px 14px; border-radius: 8px; font-family: var(--font-sans); }

/* Form & Modal Layout Fixes */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 0;
}

.form-group label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(0, 0, 0, 0.35);
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 400;
    font-size: 0.88rem;
    cursor: pointer;
}

.modal-backdrop { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh; 
    background: rgba(0,0,0,0.85); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    z-index: 100;
    backdrop-filter: blur(8px);
}

.modal { 
    width: 92%; 
    max-width: 540px; 
    max-height: 88vh; 
    display: flex; 
    flex-direction: column; 
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 20px 50px rgba(0,0,0,0.7);
}

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

.modal-body { 
    padding: 20px 24px; 
    overflow-y: auto; 
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.modal-footer { 
    display: flex; 
    justify-content: flex-end; 
    gap: 12px; 
    padding: 16px 24px 20px;
    border-top: 1px solid var(--border);
}

.btn-close { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; }

/* Alert Box Formatting for Triggered Canaries */
.triggered-alert-box {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid var(--danger);
    border-radius: 10px;
    padding: 18px 22px;
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    line-height: 1.6;
}

.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 24px; }

/* Toasts */
#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: rgba(15, 12, 14, 0.95);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius);
    color: var(--text);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(16px);
    animation: toastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 420px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.toast-success { border-left-color: #10b981; }
.toast-danger { border-left-color: #ef4444; }
.toast-warning { border-left-color: #f59e0b; }
.toast-info { border-left-color: var(--primary); }

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.hidden { display: none !important; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.footer { padding: 20px 40px; border-top: 1px solid var(--border); text-align: center; color: var(--text-muted); font-size: 0.85rem; }
