:root {
    --bg-dark: #000000;
    --sidebar-bg: #050505;
    --workspace-bg: #000000;
    --card-bg: #080808;
    --accent: #10b981;
    --accent-hover: #059669;
    --accent-dim: rgba(16, 185, 129, 0.1);
    --border: #1a1a1a;
    --text-main: #f8fafc;
    --text-dim: #888888;
    --danger: #ef4444;
    --warning: #f59e0b;
    --note-yellow: #fff9c4;
    --note-text: #1a1a1a;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body { height: 100%; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    width: 100%;
}

.app-wrapper { display: flex; height: 100%; width: 100vw; overflow: hidden; }

/* Sidebar: Compact & Professional */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    z-index: 100;
}

.sidebar-header { padding: 1.5rem 1rem; border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem; }
.brand-logo-img { width: 28px; height: 28px; object-fit: contain; filter: drop-shadow(0 0 8px var(--accent-dim)); }
.brand-name { font-weight: 800; font-size: 1.1rem; letter-spacing: 2px; color: #fff; }

.user-profile { 
    display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; 
    background: rgba(0,0,0,0.2); border-radius: 8px; border: 1px solid var(--border); 
}
.user-avatar { width: 32px; height: 32px; background: var(--card-bg); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 800; border: 1px solid var(--border); color: var(--accent); }
.user-info { display: flex; flex-direction: column; }
.user-role { font-size: 0.65rem; font-weight: 700; color: #fff; letter-spacing: 0.5px; }
.user-status { font-size: 0.55rem; color: var(--accent); font-family: 'Roboto Mono', monospace; font-weight: 600; }

.sidebar-nav { flex-grow: 1; padding: 1rem; overflow-y: auto; scrollbar-width: none; }
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-group { margin-bottom: 1.5rem; }
.group-label { font-size: 0.65rem; font-weight: 800; color: var(--text-dim); letter-spacing: 1.5px; margin-bottom: 0.75rem; padding-left: 0.5rem; text-transform: uppercase; }

.nav-item, .nav-link {
    padding: 0.6rem 0.75rem; border-radius: 6px; font-size: 0.8rem; color: var(--text-dim);
    cursor: pointer; display: flex; align-items: center; gap: 0.75rem; transition: var(--transition);
    border: 1px solid transparent;
}
.nav-item:hover, .nav-link:hover { background: rgba(255,255,255,0.05); color: #fff; transform: translateX(4px); }
.nav-item.active, .nav-link.active { 
    background: var(--accent-dim); 
    color: var(--accent); 
    font-weight: 700; 
    border-color: rgba(16, 185, 129, 0.2);
    box-shadow: inset 0 0 10px rgba(16, 185, 129, 0.05);
}

.opsec-widget { border-radius: 8px !important; border: 1px solid var(--border) !important; background: rgba(0,0,0,0.3) !important; }

#purge-session-btn { 
    margin-top: 0.5rem; border: 1px solid rgba(239, 68, 68, 0.2) !important; 
    color: var(--danger) !important; justify-content: center;
}
#purge-session-btn:hover { background: rgba(239, 68, 68, 0.1) !important; transform: none; border-color: var(--danger) !important; }

/* Workspace */
.workspace { flex: 1; background: var(--workspace-bg); display: flex; flex-direction: column; position: relative; }

.workspace-header {
    height: 64px; padding: 0 2rem; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(2, 6, 23, 0.8); backdrop-filter: blur(12px);
    position: sticky; top: 0; z-index: 90;
}
.workspace-header h1 { font-size: 1rem; font-weight: 800; text-transform: uppercase; letter-spacing: 2px; color: #fff; }

/* View Content */
.view-pane { padding: 2rem; overflow-y: auto; flex: 1; scroll-behavior: smooth; }

.node-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.tool-card {
    background: var(--card-bg); border: 1px solid var(--border);
    padding: 1.25rem; border-radius: 12px;
    transition: var(--transition);
    display: flex; flex-direction: column;
    position: relative; overflow: hidden;
}
.tool-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%;
    background: transparent; transition: var(--transition);
}
.tool-card:hover { 
    transform: translateY(-4px); 
    border-color: var(--accent);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}
.tool-card:hover::before { background: var(--accent); }

.tool-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.5rem; color: #fff; display: flex; align-items: center; justify-content: space-between; }
.tool-path { font-size: 0.65rem; color: var(--text-dim); font-family: 'Roboto Mono', monospace; margin-bottom: 0.75rem; background: rgba(0,0,0,0.2); padding: 2px 6px; border-radius: 4px; display: inline-block; width: fit-content; }

.btn-launch {
    margin-top: auto; display: block; width: 100%; text-align: center; 
    background: var(--accent); color: #000; text-decoration: none; 
    padding: 0.6rem; border-radius: 6px; font-size: 0.75rem; font-weight: 700;
    transition: var(--transition); border: none;
}
.btn-launch:hover { background: var(--accent-hover); transform: scale(1.02); }

.btn-copy-tiny {
    font-size: 0.55rem; font-weight: 800; color: var(--text-dim);
    cursor: pointer; border: 1px solid var(--border);
    padding: 2px 6px; border-radius: 4px; transition: var(--transition);
    background: rgba(255,255,255,0.05);
}
.btn-copy-tiny:hover { color: #fff; border-color: #fff; background: rgba(255,255,255,0.1); }

/* Report Builder: Modern Workspace */
.report-header-compact { 
    background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px;
    padding: 1.5rem; margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
.meta-row { display: flex; gap: 1.5rem; margin-bottom: 1.5rem; }
.meta-input-group { flex: 1; display: flex; flex-direction: column; gap: 0.5rem; }
.meta-input-group label { font-size: 0.65rem; font-weight: 800; color: var(--text-dim); letter-spacing: 1px; text-transform: uppercase; }
.meta-input-group input { background: rgba(0,0,0,0.2); border: 1px solid var(--border); padding: 0.6rem 0.8rem; color: #fff; font-size: 0.85rem; border-radius: 6px; transition: var(--transition); }
.meta-input-group input:focus { border-color: var(--accent); outline: none; background: rgba(0,0,0,0.4); }

.note-grid { 
    display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 2rem; 
    padding: 1rem; min-height: 400px;
}

.sticky-note {
    background: var(--note-yellow);
    color: var(--note-text);
    padding: 1.5rem;
    min-height: 250px;
    box-shadow: 10px 10px 20px rgba(0,0,0,0.2);
    position: relative;
    transform: rotate(-0.5deg);
    transition: var(--transition);
    border-radius: 2px;
}
.sticky-note:hover { transform: scale(1.02) rotate(0deg); z-index: 10; box-shadow: 15px 15px 30px rgba(0,0,0,0.3); }
.sticky-note:nth-child(even) { transform: rotate(0.8deg); }
.sticky-note h4 { font-family: 'Special Elite', cursive, serif; font-size: 1rem; border-bottom: 1px solid rgba(0,0,0,0.15); margin-bottom: 0.75rem; padding-bottom: 0.5rem; font-weight: 700; }
.note-img { width: 100%; height: 140px; object-fit: cover; border: 1px solid rgba(0,0,0,0.1); margin-bottom: 1rem; border-radius: 2px; }
.sticky-note p { font-family: 'Special Elite', cursive, serif; font-size: 0.9rem; line-height: 1.4; opacity: 0.9; }

.note-actions { position: absolute; top: 10px; right: 10px; display: flex; gap: 8px; opacity: 0; transition: var(--transition); }
.sticky-note:hover .note-actions { opacity: 1; }
.btn-note-icon { background: rgba(0,0,0,0.1); border: none; cursor: pointer; font-size: 0.9rem; padding: 4px 8px; border-radius: 4px; transition: var(--transition); }
.btn-note-icon:hover { background: rgba(0,0,0,0.2); transform: translateY(-2px); }

.action-bar { display: flex; justify-content: flex-end; gap: 1rem; margin-top: 1.5rem; border-top: 1px solid var(--border); padding-top: 1.5rem; flex-wrap: wrap; }
.btn-action { padding: 0.6rem 1.25rem; font-size: 0.75rem; font-weight: 700; cursor: pointer; border-radius: 6px; transition: var(--transition); border: 1px solid transparent; letter-spacing: 0.5px; }
.btn-action:hover { transform: translateY(-2px); }
.btn-confirm { background: var(--accent); color: #000; border: none; }
.btn-confirm:hover { background: var(--accent-hover); box-shadow: 0 4px 12px var(--accent-dim); }
.btn-ghost-danger { background: transparent; border: 1px solid var(--danger); color: var(--danger); }
.btn-ghost-danger:hover { background: rgba(239, 68, 68, 0.1); }

.hidden { display: none !important; }

/* Modals: Clean & Center */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9); backdrop-filter: blur(8px);
    display: none; align-items: center; justify-content: center; z-index: 1000;
}
.modal-overlay:not(.hidden) { display: flex; }
.modal-card { 
    background: var(--sidebar-bg); 
    border: 1px solid var(--border); 
    width: 95%;
    max-width: 450px; 
    padding: 2rem; 
    border-radius: 16px; 
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); 
    max-height: 90vh;
    overflow-y: auto;
}
.modal-card h3 { font-size: 1rem; font-weight: 800; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border); padding-bottom: 0.75rem; letter-spacing: 1px; color: #fff; }
.field-group { margin-bottom: 1.25rem; }
.field-group label { display: block; font-size: 0.65rem; color: var(--text-dim); margin-bottom: 0.5rem; font-weight: 700; letter-spacing: 1px; }
.field-group input, .field-group textarea, .field-group select { width: 100%; background: rgba(0,0,0,0.3); border: 1px solid var(--border); color: #fff; padding: 0.75rem; font-size: 0.9rem; border-radius: 8px; transition: var(--transition); font-family: inherit; }
.field-group input:focus, .field-group textarea:focus { border-color: var(--accent); outline: none; background: rgba(0,0,0,0.5); }
.field-group textarea { height: 120px; resize: none; }

/* Mobile Navigation & Components */
.mobile-bottom-nav, 
.mobile-category-scroller, 
.mobile-fab, 
.mobile-search-trigger {
    display: none !important;
}

@media screen and (min-width: 769px) {
    .menu-toggle { display: none !important; }
}

/* Responsive Mobile Styles */
@media screen and (max-width: 768px) {
    body { overflow: hidden; height: 100%; width: 100%; position: fixed; }
    
    .app-wrapper {
        flex-direction: column;
        height: 100%;
        width: 100%;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        z-index: 2000;
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        background: var(--sidebar-bg);
        width: 280px !important;
        box-shadow: 20px 0 50px rgba(0,0,0,0.5);
    }

    .sidebar.active {
        left: 0;
    }

    .workspace {
        width: 100%;
        height: 100%;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .workspace-header {
        height: 60px;
        flex-shrink: 0;
        position: relative;
        background: rgba(2, 6, 23, 0.95);
        z-index: 100;
        padding: 0 1rem;
    }

    .workspace-header h1 { font-size: 0.8rem; }

    .menu-toggle {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 40px;
        height: 40px;
        background: rgba(255,255,255,0.05);
        border: 1px solid var(--border);
        border-radius: 8px;
        cursor: pointer;
        padding: 0;
        align-items: center;
    }

    .menu-toggle span {
        width: 20px;
        height: 2px;
        background: #fff;
        border-radius: 2px;
        transition: var(--transition);
    }

    .menu-toggle.active span:nth-child(1) { transform: translateY(3.5px) rotate(45deg); width: 20px; }
    .menu-toggle.active span:nth-child(2) { opacity: 0; }
    .menu-toggle.active span:nth-child(3) { transform: translateY(-3.5px) rotate(-45deg); width: 20px; }

    .view-pane { padding: 1rem; padding-bottom: 120px; -webkit-overflow-scrolling: touch; }

    .node-grid { grid-template-columns: 1fr; gap: 1rem; }
    .note-grid { grid-template-columns: 1fr; gap: 1.5rem; }

    .meta-row { flex-direction: column; gap: 1rem; }
    .action-bar { flex-direction: column; gap: 0.75rem; align-items: stretch; }
    .btn-action { width: 100%; text-align: center; }

    .mobile-bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 70px;
        background: rgba(15, 23, 42, 0.98);
        backdrop-filter: blur(12px);
        border-top: 1px solid var(--border);
        z-index: 1000;
        justify-content: space-around;
        align-items: center;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        color: var(--text-dim);
        cursor: pointer;
        flex: 1;
        height: 100%;
        transition: var(--transition);
    }

    .mobile-nav-item.active { color: var(--accent); }
    .mobile-nav-item.active .nav-icon { transform: translateY(-2px); text-shadow: 0 0 10px var(--accent-dim); }

    .nav-icon { font-size: 1.25rem; transition: var(--transition); }
    .nav-label { font-size: 0.6rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; }

    .mobile-category-scroller {
        display: flex !important;
        overflow-x: auto;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
        background: rgba(0,0,0,0.4);
        border-bottom: 1px solid var(--border);
        scrollbar-width: none;
        position: sticky;
        top: 0;
        z-index: 50;
        margin: -1rem -1rem 1rem -1rem;
    }
    .mobile-category-scroller::-webkit-scrollbar { display: none; }

    .mobile-cat-item {
        white-space: nowrap;
        background: var(--card-bg);
        border: 1px solid var(--border);
        padding: 0.4rem 0.8rem;
        border-radius: 8px;
        font-size: 0.65rem;
        font-weight: 700;
        color: var(--text-dim);
    }
    .mobile-cat-item.active { background: var(--accent); color: #000; border-color: var(--accent); }

    .mobile-fab {
        display: flex !important;
        position: fixed;
        bottom: 90px;
        right: 20px;
        width: 56px;
        height: 56px;
        background: var(--accent);
        color: #000;
        border: none;
        border-radius: 16px;
        font-size: 1.75rem;
        box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
        align-items: center;
        justify-content: center;
        z-index: 900;
        cursor: pointer;
    }

    .sidebar-overlay {
        display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(2, 6, 23, 0.8); backdrop-filter: blur(4px); z-index: 1500;
    }
    .sidebar-overlay.active { display: block; }
    
    .modal-card {
        padding: 1.5rem;
        width: 92%;
    }
    
    #dork-result {
        font-size: 0.8rem !important;
    }
}

.guide-container {
    grid-column: 1/-1;
    padding: 2rem;
    max-width: 900px;
    margin: 0 auto;
    color: var(--text-main);
}

.guide-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
}

@media screen and (max-width: 768px) {
    .guide-container {
        padding: 1rem;
    }
    
    .guide-container h2 {
        font-size: 1.5rem !important;
    }
    
    .guide-steps {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.utilized-tools-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 1.5rem; }
.tool-tag {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--accent);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tool-tag-remove {
    cursor: pointer;
    opacity: 0.6;
    font-size: 0.8rem;
    transition: var(--transition);
}
.tool-tag-remove:hover { opacity: 1; color: var(--danger); }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }
