/* Security Dashboard — ServiceAlert.ai */

.sec-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

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

.sec-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.sec-header p {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin: 0;
}

.sec-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

.sec-breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
}

.sec-breadcrumb a:hover {
    color: var(--accent);
}

/* ── Summary Stat Bar ────────────────────────────────────── */
.sec-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.sec-stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px 16px;
    text-align: center;
}

.sec-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 2px;
}

.sec-stat-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
}

.sec-stat-value.critical { color: #ef4444; }
.sec-stat-value.high { color: #f97316; }
.sec-stat-value.medium { color: #f59e0b; }
.sec-stat-value.low { color: var(--text-secondary); }
.sec-stat-value.blue { color: var(--accent); }
.sec-stat-value.purple { color: #a78bfa; }

/* ── Three-Column Grid ───────────────────────────────────── */
.sec-grid {
    display: grid;
    grid-template-columns: 320px 1fr 280px;
    gap: 20px;
    align-items: start;
}

/* ── Threat Feed (Left) ──────────────────────────────────── */
.sec-feed {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

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

.sec-feed-header h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.sec-feed-filters {
    display: flex;
    gap: 4px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.sec-filter-btn {
    padding: 4px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.6875rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}

.sec-filter-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.sec-filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.sec-feed-list {
    max-height: 600px;
    overflow-y: auto;
}

.sec-feed-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    border-left: 3px solid transparent;
    cursor: default;
    transition: background 0.1s;
}

.sec-feed-item:hover {
    background: var(--bg-tertiary);
}

.sec-feed-item:last-child {
    border-bottom: none;
}

.sec-feed-item.critical { border-left-color: #ef4444; }
.sec-feed-item.high { border-left-color: #f97316; }
.sec-feed-item.medium, .sec-feed-item.warning { border-left-color: #f59e0b; }
.sec-feed-item.low, .sec-feed-item.info { border-left-color: var(--text-tertiary); }

.sec-feed-type {
    display: inline-block;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 2px 6px;
    border-radius: 3px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.sec-feed-domain {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    margin-bottom: 2px;
}

.sec-feed-domain a {
    color: inherit;
    text-decoration: none;
}

.sec-feed-domain a:hover {
    color: var(--accent);
}

.sec-feed-desc {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: 4px;
}

.sec-feed-time {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
}

.sec-feed-empty {
    padding: 40px 16px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

/* ── Charts (Center) ─────────────────────────────────────── */
.sec-charts {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sec-chart-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 20px;
}

.sec-chart-card h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px;
}

.sec-chart-wrap {
    position: relative;
    height: 220px;
}

/* ── Breakdowns (Right) ──────────────────────────────────── */
.sec-breakdowns {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sec-breakdown-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
}

.sec-breakdown-card h3 {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 10px;
}

/* Technique bars */
.sec-tech-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.75rem;
}

.sec-tech-label {
    width: 90px;
    color: var(--text-secondary);
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    flex-shrink: 0;
}

.sec-tech-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.sec-tech-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 0.3s;
}

.sec-tech-count {
    width: 28px;
    text-align: right;
    color: var(--text-tertiary);
    font-weight: 600;
    flex-shrink: 0;
}

/* Brand risk list */
.sec-brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8125rem;
}

.sec-brand-row:last-child {
    border-bottom: none;
}

.sec-brand-domain {
    color: var(--text-primary);
    font-weight: 500;
}

.sec-brand-pills {
    display: flex;
    gap: 4px;
}

.sec-pill {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 700;
}

.sec-pill.critical { background: rgba(239,68,68,0.15); color: #ef4444; }
.sec-pill.high { background: rgba(249,115,22,0.15); color: #f97316; }

/* Expiring certs / takedowns list */
.sec-mini-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 0.8125rem;
    border-bottom: 1px solid var(--border-color);
}

.sec-mini-row:last-child {
    border-bottom: none;
}

.sec-mini-domain {
    color: var(--text-primary);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 140px;
}

.sec-mini-badge {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

.sec-mini-badge.urgent { background: rgba(239,68,68,0.15); color: #ef4444; }
.sec-mini-badge.warning { background: rgba(245,158,11,0.15); color: #f59e0b; }
.sec-mini-badge.ok { background: rgba(16,185,129,0.15); color: #10B981; }

.sec-empty-small {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    text-align: center;
    padding: 12px 0;
}

/* ── Loading state ───────────────────────────────────────── */
.sec-loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
}

.sec-loading .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Sign-in gate ────────────────────────────────────────── */
.sec-signin {
    text-align: center;
    padding: 80px 20px;
}

.sec-signin h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.sec-signin p {
    color: var(--text-tertiary);
    margin-bottom: 20px;
}

.sec-signin-btn {
    padding: 10px 24px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1100px) {
    .sec-grid {
        grid-template-columns: 1fr 1fr;
    }
    .sec-feed {
        grid-column: 1 / -1;
    }
    .sec-feed-list {
        max-height: 350px;
    }
}

@media (max-width: 768px) {
    .sec-grid {
        grid-template-columns: 1fr;
    }
    .sec-stats {
        grid-template-columns: repeat(4, 1fr);
    }
    .sec-feed-list {
        max-height: 300px;
    }
}

@media (max-width: 480px) {
    .sec-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}
