:root {
    --bg-primary: #0F1419;
    --bg-secondary: #1A1F26;
    --bg-card: #242B33;
    --bg-elevated: #2D3640;
    --accent-primary: #00D9A5;
    --accent-secondary: #FF6B6B;
    --accent-warning: #FFB84D;
    --accent-info: #4DA6FF;
    --text-primary: #FFFFFF;
    --text-secondary: #8B98A5;
    --text-muted: #5C6670;
    --border-color: #2D3640;
    --severity-critical: #FF6B6B;
    --severity-high: #FF8C42;
    --severity-medium: #FFB84D;
    --severity-low: #4DA6FF;
    --sidebar-width: 280px;
    --sidebar-collapsed: 64px;
    --header-height: 60px;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
    --transition-fast: 150ms ease;
    --transition-normal: 200ms ease;
}

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

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-normal);
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 28px;
    height: 28px;
    color: var(--accent-primary);
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), #00B894);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.sidebar-toggle:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.sidebar-toggle svg {
    width: 20px;
    height: 20px;
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    margin-bottom: 4px;
}

.nav-item:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(0, 217, 165, 0.1);
    color: var(--accent-primary);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item span {
    white-space: nowrap;
    font-weight: 500;
}

.sidebar.collapsed .nav-item span {
    display: none;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px;
}

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-header {
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
}

.header-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    width: 400px;
}

.header-search svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.header-search input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 14px;
    width: 100%;
}

.header-search input::placeholder {
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-md);
    position: relative;
    transition: all var(--transition-fast);
}

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

.header-btn svg {
    width: 20px;
    height: 20px;
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--accent-secondary);
    color: white;
    font-size: 10px;
    font-weight: 600;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.user-menu:hover {
    background: var(--bg-card);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent-primary), #00B894);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.user-name {
    font-weight: 500;
    color: var(--text-primary);
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: var(--bg-primary);
}

.page {
    max-width: 1600px;
    margin: 0 auto;
}

.page.hidden {
    display: none;
}

.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

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

.metric-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-primary);
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.metric-icon svg {
    width: 24px;
    height: 24px;
}

.metric-icon.critical {
    background: rgba(255, 107, 107, 0.15);
    color: var(--severity-critical);
}

.metric-icon.high {
    background: rgba(255, 140, 66, 0.15);
    color: var(--severity-high);
}

.metric-icon.assets {
    background: rgba(77, 166, 255, 0.15);
    color: var(--accent-info);
}

.metric-icon.risk {
    background: rgba(0, 217, 165, 0.15);
    color: var(--accent-primary);
}

.metric-content {
    display: flex;
    flex-direction: column;
}

.metric-value {
    font-size: 28px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.metric-label {
    color: var(--text-secondary);
    font-size: 13px;
}

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

.chart-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.chart-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.chart-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.chart-body {
    padding: 20px;
}

.chart-body canvas {
    width: 100% !important;
    height: 200px !important;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-color.critical { background: var(--severity-critical); }
.legend-color.high { background: var(--severity-high); }
.legend-color.medium { background: var(--severity-medium); }
.legend-color.low { background: var(--severity-low); }

.vuln-list {
    max-height: 250px;
    overflow-y: auto;
}

.vuln-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.vuln-list-item:last-child {
    border-bottom: none;
}

.vuln-id {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--accent-primary);
}

.vuln-desc {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

.severity-badge {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.severity-badge.critical {
    background: rgba(255, 107, 107, 0.2);
    color: var(--severity-critical);
}

.severity-badge.high {
    background: rgba(255, 140, 66, 0.2);
    color: var(--severity-high);
}

.severity-badge.medium {
    background: rgba(255, 184, 77, 0.2);
    color: var(--severity-medium);
}

.severity-badge.low {
    background: rgba(77, 166, 255, 0.2);
    color: var(--severity-low);
}

.filters-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.filter-group select,
.filter-group input {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 14px;
    outline: none;
    transition: all var(--transition-fast);
}

.filter-group select:focus,
.filter-group input:focus {
    border-color: var(--accent-primary);
}

.filter-group select {
    min-width: 160px;
}

.filter-group input {
    min-width: 250px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    text-decoration: none;
}

.btn svg {
    width: 18px;
    height: 18px;
}

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

.btn-primary:hover {
    background: #00C49A;
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-sm svg {
    width: 14px;
    height: 14px;
}

.data-table-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

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

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.data-table tr:hover {
    background: var(--bg-secondary);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.pagination button {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination button:hover,
.pagination button.active {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.assets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.asset-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

.asset-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.asset-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.asset-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
}

.asset-icon svg {
    width: 20px;
    height: 20px;
}

.asset-icon.windows { color: #00A4EF; }
.asset-icon.linux { color: #FCC624; }
.asset-icon.macos { color: #A3AAAE; }
.asset-icon.network { color: #4DA6FF; }

.asset-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.asset-ip {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--text-secondary);
}

.asset-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.asset-detail {
    display: flex;
    flex-direction: column;
}

.asset-detail-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.asset-detail-value {
    font-size: 13px;
    color: var(--text-primary);
}

.agent-platforms {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.platform-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

.platform-card:hover {
    border-color: var(--accent-primary);
}

.platform-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
}

.platform-icon svg {
    width: 100%;
    height: 100%;
}

.platform-card[data-platform="windows"] .platform-icon { color: #00A4EF; }
.platform-card[data-platform="linux"] .platform-icon { color: #FCC624; }
.platform-card[data-platform="macos"] .platform-icon { color: #A3AAAE; }

.platform-card span {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.frameworks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.framework-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-color);
}

.framework-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.framework-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.framework-badge {
    padding: 4px 10px;
    background: rgba(0, 217, 165, 0.15);
    color: var(--accent-primary);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.framework-card p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.framework-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
}

.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.report-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

.report-card:hover {
    border-color: var(--accent-primary);
}

.report-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    color: var(--accent-primary);
}

.report-icon svg {
    width: 100%;
    height: 100%;
}

.report-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.report-card p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 16px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.settings-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-color);
}

.settings-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.setting-item {
    margin-bottom: 16px;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-item label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.setting-item input,
.setting-item select {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 14px;
    outline: none;
}

.setting-item input:focus,
.setting-item select:focus {
    border-color: var(--accent-primary);
}

.setting-item.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
}

.setting-item.checkbox input {
    width: 18px;
    height: 18px;
}

.setting-item.checkbox label {
    margin-bottom: 0;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.hidden {
    display: none;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
}

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

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(80vh - 70px);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent-primary);
}

.scan-actions {
    margin-bottom: 16px;
}

@media (max-width: 1200px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .agent-platforms {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        z-index: 100;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .agent-platforms {
        grid-template-columns: 1fr;
    }
    
    .header-search {
        width: 200px;
    }
    
    .filters-bar {
        flex-wrap: wrap;
    }
}
/* Login Screen */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.login-screen.hidden {
    display: none;
}

.login-container {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    width: 64px;
    height: 64px;
    color: var(--accent-primary);
    margin-bottom: 16px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--accent-primary), #00B894);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.login-form input {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-size: 15px;
    outline: none;
    transition: all var(--transition-fast);
}

.login-form input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 217, 165, 0.1);
}

.login-error {
    color: var(--accent-secondary);
    font-size: 13px;
    margin-bottom: 16px;
    min-height: 20px;
}

.btn-block {
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-size: 15px;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    color: var(--text-muted);
    font-size: 12px;
}

.app-container.hidden {
    display: none;
}

/* Logout button in header */
.user-menu .logout-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    margin-left: 8px;
}

.user-menu .logout-btn:hover {
    background: var(--bg-card);
    color: var(--accent-secondary);
}
