/* CyberAI Dashboard - Refined Design */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f5f6fa;
    color: #1a1d29;
    min-height: 100vh;
}

/* Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: #ffffff;
    border-right: 1px solid #e8e9ed;
    padding: 20px 12px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px 20px;
    border-bottom: 1px solid #e8e9ed;
    margin-bottom: 16px;
}

.sidebar-logo .logo-icon {
    width: 32px;
    height: 32px;
    background: #1a1d29;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
}

.sidebar-logo .logo-text {
    font-size: 16px;
    font-weight: 700;
}

.sidebar-nav { list-style: none; }
.nav-section { margin-bottom: 12px; }

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    color: #8b8e99;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 10px 6px;
}

.nav-section ul { list-style: none; }
.nav-item { margin-bottom: 2px; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: #5a5d6b;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
}

.nav-link:hover { background: #f5f6fa; color: #1a1d29; }
.nav-link.active { background: #f0f1f5; color: #1a1d29; font-weight: 600; }
.nav-link i { width: 16px; text-align: center; font-size: 13px; }

.nav-link .badge {
    margin-left: auto;
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 10px;
    background: #ff6b35;
    color: #fff;
    font-weight: 600;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    padding: 24px 28px;
    flex: 1;
    min-width: 0;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.header-left h1 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 6px;
}

.header-left p {
    color: #8b8e99;
    font-size: 13px;
    max-width: 480px;
    line-height: 1.5;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: #fff;
    border: 1px solid #e8e9ed;
    border-radius: 20px;
    font-size: 12px;
    color: #5a5d6b;
}

.status-badge .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid #e8e9ed;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #5a5d6b;
    position: relative;
}

.icon-btn .notification-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 6px;
    height: 6px;
    background: #ff6b35;
    border-radius: 50%;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #1a1d29;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

/* Stats Cards */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    border-radius: 14px;
    padding: 18px;
    border: 1px solid #e8e9ed;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.stat-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.stat-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #f5f6fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5a5d6b;
    font-size: 14px;
}

.stat-card-title {
    font-size: 12px;
    color: #8b8e99;
    font-weight: 500;
}

.stat-card-header .fa-ellipsis-h {
    margin-left: auto;
    color: #8b8e99;
    cursor: pointer;
}

.stat-card-value {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #8b8e99;
}

.trend-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
}

.trend-badge.up { background: #dcfce7; color: #16a34a; }
.trend-badge.down { background: #fef3c7; color: #d97706; }

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 16px;
    align-items: start;
}

.card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e8e9ed;
    padding: 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

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

.card-title {
    font-size: 15px;
    font-weight: 600;
}

.tab-group {
    display: flex;
    background: #f0f1f5;
    border-radius: 10px;
    padding: 4px;
    border: 1px solid #e8e9ed;
    gap: 2px;
}

.tab-btn {
    padding: 6px 18px;
    border-radius: 7px;
    border: 1px solid transparent;
    background: transparent;
    color: #8b8e99;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.tab-btn:hover {
    color: #1a1d29;
    background: rgba(255,255,255,0.6);
}

.tab-btn.active {
    background: #fff;
    color: #1a1d29;
    border-color: #e8e9ed;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    font-weight: 600;
}

/* Severity Bar */
.severity-section { margin-bottom: 18px; }

.section-label {
    font-size: 12px;
    color: #8b8e99;
    margin-bottom: 10px;
    font-weight: 500;
}

.severity-bar {
    display: flex;
    border-radius: 10px;
    overflow: hidden;
    height: 44px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.severity-item {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.severity-item:hover { opacity: 0.85; }
.severity-item.critical { background: #1a1d29; }
.severity-item.high { background: #ff6b35; }
.severity-item.medium { background: #d1d2d6; color: #5a5d6b; }

/* State Cards */
.state-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}

.state-card {
    background: #f5f6fa;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.state-card-value {
    font-size: 14px;
    font-weight: 600;
}

.state-card-label {
    font-size: 11px;
    color: #8b8e99;
    margin-top: 2px;
}

/* Duration Bar */
.duration-section { margin-bottom: 12px; }

.duration-bar {
    height: 6px;
    background: #f5f6fa;
    border-radius: 3px;
    position: relative;
    margin-bottom: 6px;
}

.duration-fill {
    height: 100%;
    background: linear-gradient(90deg, #1a1d29, #5a5d6b);
    border-radius: 3px;
    width: 60%;
}

.duration-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #8b8e99;
}

.findings-badge {
    text-align: center;
    margin-top: 10px;
}

.findings-badge span {
    background: #f5f6fa;
    padding: 4px 14px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    color: #5a5d6b;
}

/* AI Task Form */
.ai-task-form {
    background: #f5f6fa;
    border-radius: 10px;
    padding: 14px;
    margin-top: 16px;
}

.ai-task-form-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-task-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #e8e9ed;
    border-radius: 8px;
    font-size: 13px;
    resize: none;
    margin-bottom: 10px;
    font-family: inherit;
    background: #fff;
}

.ai-task-form textarea:focus {
    outline: none;
    border-color: #1a1d29;
}

.ai-task-form .form-row {
    display: flex;
    gap: 10px;
}

.ai-task-form select {
    flex: 1;
    padding: 8px;
    border: 1px solid #e8e9ed;
    border-radius: 6px;
    font-size: 12px;
    background: #fff;
}

.btn-primary {
    padding: 8px 16px;
    background: #1a1d29;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.btn-primary:hover { background: #2d3041; }

/* Right Column */
.right-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Gauge Chart */
.gauge-container {
    text-align: center;
    padding: 10px 0 16px;
}

.gauge-svg {
    width: 180px;
    height: 100px;
    margin: 0 auto;
}

.gauge-bg {
    fill: none;
    stroke: #f5f6fa;
    stroke-width: 16;
    stroke-linecap: round;
}

.gauge-fill {
    fill: none;
    stroke: #ff6b35;
    stroke-width: 16;
    stroke-linecap: round;
    stroke-dasharray: 251;
    stroke-dashoffset: 80;
    transition: stroke-dashoffset 1s ease;
}

.gauge-value {
    font-size: 32px;
    font-weight: 700;
    margin-top: -10px;
}

.gauge-label {
    font-size: 12px;
    color: #8b8e99;
}

.gauge-legend {
    list-style: none;
    margin-top: 16px;
}

.gauge-legend li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 12px;
    color: #5a5d6b;
}

.gauge-legend .dot {
    width: 8px;
    height: 8px;
    border-radius: 3px;
    flex-shrink: 0;
}

.gauge-legend .count {
    margin-left: auto;
    font-weight: 600;
    color: #1a1d29;
}

.gauge-legend li:nth-child(1) .dot { background: #ff6b35; }
.gauge-legend li:nth-child(2) .dot { background: #ff9f7a; }
.gauge-legend li:nth-child(3) .dot { background: #ffcdb2; }
.gauge-legend li:nth-child(4) .dot { background: #f5e6dc; }

.btn-outline {
    width: 100%;
    padding: 9px;
    border: 1px solid #e8e9ed;
    border-radius: 8px;
    background: #fff;
    font-size: 12px;
    cursor: pointer;
    color: #5a5d6b;
    font-weight: 500;
    margin-top: 12px;
    transition: all 0.2s;
}

.btn-outline:hover {
    background: #f5f6fa;
    border-color: #d1d2d6;
}

/* Threat Feed */
.threat-feed-card { flex: 1; }

.threat-list {
    list-style: none;
    max-height: 320px;
    overflow-y: auto;
}

.threat-item {
    display: flex;
    gap: 10px;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 6px;
    background: #f5f6fa;
    transition: background 0.15s;
}

.threat-item:hover { background: #e8e9ed; }

.threat-severity {
    width: 3px;
    border-radius: 2px;
    flex-shrink: 0;
    align-self: stretch;
}

.threat-severity.critical { background: #1a1d29; }
.threat-severity.high { background: #ff6b35; }
.threat-severity.medium { background: #d1d2d6; }

.threat-content { flex: 1; min-width: 0; }

.threat-title {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.threat-desc {
    font-size: 11px;
    color: #8b8e99;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.threat-meta {
    display: flex;
    gap: 10px;
    font-size: 10px;
    color: #8b8e99;
}

.threat-meta span {
    display: flex;
    align-items: center;
    gap: 3px;
}

/* Pulse Animation for Map */
@keyframes pulse-marker {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(3); opacity: 0; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #e8e9ed; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #d1d2d6; }

/* Responsive */
@media (max-width: 1200px) {
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .content-grid { grid-template-columns: 1fr; }
}
