/* ============================================================
   P1s Security Platform — Complete Stylesheet
   Dark theme: bg #0a0a0a, cards #111, borders #222
   Accent: #ff6b6b (red), Secondary: #3498db (blue), #2ecc71 (green)
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0a0a0a;
    --bg-card: #111111;
    --bg-card-hover: #161616;
    --bg-input: #1a1a1a;
    --border: #222222;
    --border-light: #333333;
    --text: #e0e0e0;
    --text-muted: #888888;
    --text-dim: #555555;
    --accent: #ff6b6b;
    --accent-hover: #ff5252;
    --blue: #3498db;
    --green: #2ecc71;
    --green-dark: #27ae60;
    --yellow: #f1c40f;
    --orange: #e67e22;
    --red: #e74c3c;
    --purple: #9b59b6;
    --sidebar-w: 250px;
    --sidebar-collapsed: 60px;
    --header-h: 60px;
    --radius: 8px;
    --radius-sm: 4px;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --transition: 0.2s ease;
}

html { font-size: 14px; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--accent); }

h1, h2, h3, h4 { font-weight: 600; line-height: 1.3; }

.accent { color: var(--accent); }
.center { text-align: center; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* --- Buttons --- */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 20px; border: 1px solid transparent;
    border-radius: var(--radius); font-size: 0.93rem; font-weight: 500;
    cursor: pointer; transition: all var(--transition);
    text-decoration: none; line-height: 1.4;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border-light); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text-muted); border: none; }
.btn-ghost:hover { color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 0.82rem; }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-icon {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; padding: 4px 6px; font-size: 1rem;
    border-radius: var(--radius-sm); transition: all var(--transition);
}
.btn-icon:hover { color: var(--accent); background: rgba(255,107,107,0.1); }

/* --- Forms --- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; color: var(--text-muted); font-size: 0.88rem; }
.form-input, .form-select, .filter-input, .filter-select {
    width: 100%; padding: 10px 14px; background: var(--bg-input);
    border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--text); font-size: 0.93rem; transition: border-color var(--transition);
}
.form-input:focus, .form-select:focus, .filter-input:focus, .filter-select:focus {
    outline: none; border-color: var(--accent);
}
.form-input-lg { padding: 14px 18px; font-size: 1.05rem; }
.form-input::placeholder { color: var(--text-dim); }
textarea.form-input { resize: vertical; }
.form-hint { font-size: 0.78rem; color: var(--text-dim); margin-top: 4px; display: block; }
.form-error { color: var(--red); font-size: 0.88rem; margin-top: 8px; padding: 10px; background: rgba(231,76,60,0.1); border-radius: var(--radius); }
.form-row { display: flex; gap: 16px; }
.form-group-sm { max-width: 120px; }
.form-actions { display: flex; gap: 12px; margin-top: 8px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23888' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

/* ============================================================
   PUBLIC PAGES
   ============================================================ */

/* --- Nav --- */
.pub-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(10,10,10,0.92); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.nav-container {
    max-width: 1200px; margin: 0 auto; padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between; height: 64px;
}
.nav-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-size: 1.2rem; font-weight: 700; }
.logo-icon { font-size: 1.5rem; }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a { color: var(--text-muted); font-weight: 500; transition: color var(--transition); font-size: 0.93rem; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-cta { background: var(--accent) !important; color: #fff !important; padding: 8px 16px; border-radius: var(--radius); }
.nav-cta:hover { background: var(--accent-hover) !important; }
.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.5rem; cursor: pointer; }

/* --- Hero --- */
.hero {
    min-height: 100vh; display: flex; flex-direction: column;
    align-items: center; justify-content: center; text-align: center;
    padding: 80px 24px 40px; position: relative; overflow: hidden;
}
.hero-bg-grid {
    position: absolute; inset: 0;
    background-image: radial-gradient(circle at 1px 1px, var(--border) 1px, transparent 0);
    background-size: 40px 40px; opacity: 0.3;
}
.hero-content { position: relative; z-index: 1; }
.hero-title { font-size: 4rem; font-weight: 800; letter-spacing: -2px; margin-bottom: 12px; }
.hero-tagline { font-size: 1.5rem; color: var(--accent); font-weight: 600; margin-bottom: 8px; }
.hero-subtitle { font-size: 1.15rem; color: var(--text-muted); margin-bottom: 40px; }
.hero-stats {
    display: flex; align-items: center; justify-content: center;
    gap: 32px; margin-bottom: 40px;
}
.stat-item { text-align: center; }
.stat-number { display: block; font-size: 2rem; font-weight: 800; color: var(--text); }
.stat-label { display: block; font-size: 0.82rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.stat-divider { width: 1px; height: 40px; background: var(--border-light); }
.hero-ctas { display: flex; gap: 16px; justify-content: center; }
.hero-scroll-indicator {
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
    animation: bounce 2s infinite; color: var(--text-dim);
}
@keyframes bounce { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(8px); } }

/* --- Page Hero (subpages) --- */
.page-hero {
    padding: 120px 24px 60px; text-align: center;
    background: linear-gradient(180deg, rgba(255,107,107,0.05), transparent);
}
.page-hero h1 { font-size: 2.5rem; margin-bottom: 12px; }
.page-hero p { color: var(--text-muted); font-size: 1.1rem; }

/* --- Sections --- */
.section { padding: 80px 0; }
.section-title { font-size: 2rem; margin-bottom: 12px; }
.section-subtitle { color: var(--text-muted); margin-bottom: 40px; font-size: 1.05rem; }

/* --- About --- */
.about-grid { display: grid; grid-template-columns: 280px 1fr; gap: 60px; align-items: center; }
.avatar-ring {
    width: 200px; height: 200px; border-radius: 50%;
    border: 3px solid var(--accent); display: flex;
    align-items: center; justify-content: center; margin: 0 auto;
}
.avatar-placeholder {
    width: 180px; height: 180px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem; font-weight: 800; color: #fff;
}
.avatar-badge {
    text-align: center; margin-top: 12px; font-size: 0.82rem;
    color: var(--accent); font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
}
.about-role { color: var(--accent); font-weight: 500; margin-bottom: 16px; }
.about-bio { color: var(--text-muted); margin-bottom: 24px; line-height: 1.7; }
.about-platforms { display: flex; gap: 12px; flex-wrap: wrap; }
.platform-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text); font-size: 0.88rem;
    transition: all var(--transition);
}
.platform-badge:hover { border-color: var(--accent); color: var(--accent); }

/* --- Services Grid --- */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.service-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 32px;
    transition: all var(--transition);
}
.service-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: var(--shadow); }
.service-icon { font-size: 2.5rem; margin-bottom: 16px; }
.service-card h3 { margin-bottom: 12px; font-size: 1.15rem; }
.service-card p { color: var(--text-muted); font-size: 0.93rem; }

/* Service detail pages */
.service-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 24px; }
.service-detail-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 32px;
}
.service-detail-header { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.service-icon-lg { font-size: 2.5rem; }
.service-features { list-style: none; margin-top: 16px; }
.service-features li { padding: 8px 0; border-bottom: 1px solid var(--border); color: var(--text-muted); font-size: 0.93rem; }
.service-features li::before { content: "→ "; color: var(--accent); }

/* --- Track Record --- */
.track-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 24px; }
.track-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 32px; text-align: center;
}
.track-card.highlight { border-color: var(--accent); }
.track-icon { font-size: 2.5rem; margin-bottom: 12px; }
.track-number { font-size: 3rem; font-weight: 800; color: var(--accent); margin-bottom: 12px; }
.track-card p { color: var(--text-muted); font-size: 0.93rem; }

/* --- AI Section --- */
.section-ai { background: linear-gradient(135deg, rgba(255,107,107,0.05), rgba(52,152,219,0.05)); }
.ai-content { max-width: 700px; }
.ai-description { color: var(--text-muted); font-size: 1.05rem; margin-bottom: 24px; line-height: 1.7; }
.ai-features { display: flex; flex-direction: column; gap: 12px; }
.ai-feature { display: flex; align-items: center; gap: 12px; font-size: 1rem; }
.ai-dot { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; flex-shrink: 0; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* --- Trust --- */
.trust-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; }
.trust-badge {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 24px 32px; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); min-width: 120px;
}
.trust-icon { font-size: 2rem; }

/* --- Contact --- */
.contact-grid, .contact-page-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; }
.contact-details { margin-top: 24px; }
.contact-item { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.contact-icon { font-size: 1.3rem; }
.contact-social { display: flex; gap: 12px; margin-top: 24px; }
.social-link {
    padding: 8px 16px; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text-muted); font-size: 0.88rem;
}
.social-link:hover { border-color: var(--accent); color: var(--accent); }
.contact-form { background: var(--bg-card); padding: 32px; border-radius: var(--radius); border: 1px solid var(--border); }
.contact-form-wrapper h3 { margin-bottom: 20px; }
.contact-method { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.contact-method-icon { font-size: 1.5rem; }
.contact-method h4 { margin-bottom: 2px; }
.response-time { margin-top: 32px; padding: 16px; background: rgba(255,107,107,0.1); border-radius: var(--radius); }
.response-time p { color: var(--accent); font-weight: 500; }

/* --- CTA Section --- */
.section-cta { padding: 80px 0; background: linear-gradient(135deg, rgba(255,107,107,0.08), transparent); }
.section-cta h2 { margin-bottom: 12px; }
.section-cta p { color: var(--text-muted); margin-bottom: 24px; }

/* --- About Detail --- */
.about-detail-grid { display: grid; grid-template-columns: 280px 1fr; gap: 60px; }
.about-detail-left { text-align: center; }
.avatar-ring-lg { width: 220px; height: 220px; border-radius: 50%; border: 3px solid var(--accent); display: flex; align-items: center; justify-content: center; margin: 0 auto; }
.avatar-placeholder-lg { width: 200px; height: 200px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--purple)); display: flex; align-items: center; justify-content: center; font-size: 3.5rem; font-weight: 800; color: #fff; }
.about-quick-stats { display: flex; gap: 16px; margin-top: 24px; justify-content: center; }
.quick-stat { text-align: center; }
.qs-number { display: block; font-size: 1.5rem; font-weight: 800; color: var(--accent); }
.qs-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; }
.about-title-role { color: var(--accent); margin-bottom: 24px; }
.about-section-block { margin-bottom: 32px; }
.about-section-block h3 { margin-bottom: 12px; color: var(--text); }
.about-section-block p { color: var(--text-muted); line-height: 1.7; margin-bottom: 8px; }
.achievement-list { list-style: none; }
.achievement-list li { padding: 8px 0; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.spec-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.spec-tag { padding: 6px 14px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 20px; font-size: 0.82rem; color: var(--text-muted); }
.profile-links { display: flex; flex-direction: column; gap: 8px; }
.profile-link { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); }
.profile-link:hover { border-color: var(--accent); color: var(--accent); }

/* --- Footer --- */
.pub-footer { padding: 60px 0 30px; border-top: 1px solid var(--border); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-brand .logo-text { font-size: 1.2rem; font-weight: 700; }
.footer-brand p { color: var(--text-dim); margin-top: 12px; font-size: 0.88rem; line-height: 1.6; }
.footer-links h4 { margin-bottom: 16px; color: var(--text-muted); }
.footer-links a { display: block; color: var(--text-dim); margin-bottom: 8px; font-size: 0.88rem; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom { text-align: center; padding-top: 24px; border-top: 1px solid var(--border); color: var(--text-dim); font-size: 0.82rem; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
    display: flex; align-items: center; justify-content: center; min-height: 100vh;
    background: var(--bg);
}
.login-card {
    width: 100%; max-width: 400px; padding: 40px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius);
}
.login-header { text-align: center; margin-bottom: 32px; }
.login-header .logo-icon { font-size: 3rem; display: block; margin-bottom: 12px; }
.login-header h1 { font-size: 1.5rem; }
.login-header p { color: var(--text-muted); margin-top: 4px; }
.login-form .form-group { margin-bottom: 20px; }
.login-footer { text-align: center; margin-top: 24px; }
.login-footer a { color: var(--text-dim); font-size: 0.88rem; }

/* ============================================================
   DASHBOARD LAYOUT
   ============================================================ */
.dash-layout { display: flex; min-height: 100vh; }

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-w); background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column; position: fixed;
    top: 0; left: 0; bottom: 0; z-index: 200;
    transition: width var(--transition);
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .user-name { display: none; }
.sidebar.collapsed .sidebar-header { justify-content: center; }

.sidebar-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px; height: var(--header-h); border-bottom: 1px solid var(--border);
}
.sidebar-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 1.2rem; }
.sidebar-collapse-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.2rem; padding: 4px; }

.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: var(--radius);
    color: var(--text-muted); text-decoration: none; font-size: 0.93rem;
    transition: all var(--transition); margin-bottom: 2px;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.nav-item.active { background: rgba(255,107,107,0.1); color: var(--accent); }
.nav-icon { font-size: 1.15rem; width: 24px; text-align: center; flex-shrink: 0; }

.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin-bottom: 4px; }
.user-avatar { font-size: 1.3rem; }
.user-name { font-size: 0.88rem; color: var(--text-muted); }
.logout-link { color: var(--text-dim) !important; }
.logout-link:hover { color: var(--red) !important; }

/* --- Main --- */
.dash-main {
    flex: 1; margin-left: var(--sidebar-w);
    transition: margin-left var(--transition);
}
.sidebar.collapsed ~ .dash-main { margin-left: var(--sidebar-collapsed); }

.dash-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; height: var(--header-h);
    border-bottom: 1px solid var(--border); background: var(--bg-card);
    position: sticky; top: 0; z-index: 50;
}
.page-title { font-size: 1.3rem; }
.header-actions { display: flex; gap: 8px; }
.mobile-menu-btn { display: none; background: none; border: none; color: var(--text); font-size: 1.3rem; cursor: pointer; }

.dash-content { padding: 24px; padding-top: 24px; }

/* --- Stats Row --- */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px;
    display: flex; align-items: center; gap: 16px;
}
.stat-card-warning { border-left: 3px solid var(--orange); }
.stat-card-info { border-left: 3px solid var(--blue); }
.stat-card-success { border-left: 3px solid var(--green); }
.stat-card-icon { font-size: 1.8rem; }
.stat-card-value { display: block; font-size: 1.5rem; font-weight: 700; }
.stat-card-label { display: block; font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* --- Section Blocks --- */
.section-block {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px; margin-bottom: 20px;
}
.section-heading { font-size: 1.1rem; margin-bottom: 16px; }
.section-desc { color: var(--text-muted); margin-bottom: 16px; font-size: 0.93rem; }

/* --- Quick Actions --- */
.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.action-card {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 20px; background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius); cursor: pointer; transition: all var(--transition);
    color: var(--text); font-size: 0.88rem; text-align: center;
}
.action-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.action-icon { font-size: 1.8rem; }

/* --- Two Column --- */
.dash-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* --- Leads Mini List --- */
.lead-mini-item {
    display: flex; align-items: center; gap: 12px; padding: 10px;
    border-bottom: 1px solid var(--border); cursor: pointer; transition: background var(--transition);
}
.lead-mini-item:hover { background: var(--bg-card-hover); }
.lead-mini-score {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.82rem; font-weight: 700; flex-shrink: 0;
}
.lead-mini-info { flex: 1; min-width: 0; }
.lead-mini-host { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-mini-meta { display: flex; gap: 8px; font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

/* --- Activity Feed --- */
.activity-item { display: flex; gap: 12px; padding: 10px; border-bottom: 1px solid var(--border); }
.activity-icon { font-size: 1.1rem; flex-shrink: 0; }
.activity-info { flex: 1; }
.activity-desc { display: block; font-size: 0.88rem; }
.activity-time { display: block; font-size: 0.75rem; color: var(--text-dim); margin-top: 2px; }

/* --- Badges --- */
.badge {
    display: inline-flex; padding: 3px 10px; border-radius: 20px;
    font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px;
    background: rgba(255,255,255,0.08); color: var(--text-muted);
}
.badge-critical { background: rgba(231,76,60,0.2); color: var(--red); }
.badge-high { background: rgba(230,126,34,0.2); color: var(--orange); }
.badge-medium { background: rgba(241,196,15,0.2); color: var(--yellow); }
.badge-low { background: rgba(52,152,219,0.2); color: var(--blue); }
.badge-info { background: rgba(52,152,219,0.15); color: var(--blue); }
.badge-success { background: rgba(46,204,113,0.2); color: var(--green); }
.badge-muted { background: rgba(255,255,255,0.05); color: var(--text-dim); }

.badge-status-new { background: rgba(52,152,219,0.2); color: var(--blue); }
.badge-status-researched { background: rgba(155,89,182,0.2); color: var(--purple); }
.badge-status-report_generated { background: rgba(241,196,15,0.2); color: var(--yellow); }
.badge-status-contacted { background: rgba(230,126,34,0.2); color: var(--orange); }
.badge-status-responded { background: rgba(46,204,113,0.2); color: var(--green); }
.badge-status-rewarded { background: rgba(39,174,96,0.2); color: var(--green-dark); }
.badge-status-archived { background: rgba(127,140,141,0.2); color: #7f8c8d; }
.badge-status-draft { background: rgba(52,152,219,0.2); color: var(--blue); }
.badge-status-sent { background: rgba(230,126,34,0.2); color: var(--orange); }
.badge-status-replied { background: rgba(46,204,113,0.2); color: var(--green); }

/* Score badges */
.score-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 24px; border-radius: 12px;
    font-size: 0.78rem; font-weight: 700;
}
.score-high { background: rgba(46,204,113,0.2); color: var(--green); }
.score-medium { background: rgba(241,196,15,0.2); color: var(--yellow); }
.score-low { background: rgba(231,76,60,0.2); color: var(--red); }

/* --- Filter Bar --- */
.filter-bar {
    display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px;
    padding: 16px; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); align-items: center;
}
.filter-group { flex: 1; min-width: 140px; }
.filter-input-sm { max-width: 100px; min-width: 80px !important; }
.filter-select { min-width: 140px; }
.filter-select-inline { width: auto; display: inline-block; padding: 4px 28px 4px 8px; font-size: 0.82rem; }

/* --- Bulk Actions --- */
.bulk-actions {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px;
    background: rgba(255,107,107,0.1); border: 1px solid var(--accent);
    border-radius: var(--radius); margin-bottom: 16px;
}

/* --- Data Table --- */
.table-wrapper { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    padding: 10px 12px; text-align: left; font-size: 0.78rem;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border); background: var(--bg-card);
    position: sticky; top: var(--header-h); z-index: 15;
    white-space: nowrap;
}
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.data-table tr:hover td { background: var(--bg-card-hover); }
.data-table tr.selected td { background: rgba(255,107,107,0.05); }
.data-table-sm td, .data-table-sm th { padding: 6px 10px; font-size: 0.82rem; }

.sortable { cursor: pointer; user-select: none; }
.sortable:hover { color: var(--accent); }
.sort-asc::after { content: ' ↑'; color: var(--accent); }
.sort-desc::after { content: ' ↓'; color: var(--accent); }

.td-host { max-width: 250px; }
.host-link { color: var(--blue); word-break: break-all; }
.td-company { max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-plugin { max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-date { white-space: nowrap; color: var(--text-muted); }
.td-actions { white-space: nowrap; }
.td-email { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.td-reward { font-weight: 600; color: var(--green); }
.th-check { width: 36px; }

/* --- Pagination --- */
.pagination { display: flex; align-items: center; gap: 6px; margin-top: 20px; justify-content: center; flex-wrap: wrap; }
.pg-btn {
    padding: 6px 12px; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text-muted); cursor: pointer;
    font-size: 0.82rem; transition: all var(--transition);
}
.pg-btn:hover { border-color: var(--accent); color: var(--accent); }
.pg-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.pg-info { color: var(--text-dim); font-size: 0.78rem; margin-left: 12px; }

/* --- Detail Panel --- */
.detail-panel {
    position: fixed; top: 0; right: -500px; width: 480px; height: 100vh;
    background: var(--bg-card); border-left: 1px solid var(--border);
    z-index: 300; transition: right 0.3s ease; overflow-y: auto;
    box-shadow: -4px 0 20px rgba(0,0,0,0.5);
}
.detail-panel.open { right: 0; }
.detail-panel-wide { width: 600px; right: -620px; }
.detail-panel-wide.open { right: 0; }
.detail-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px; border-bottom: 1px solid var(--border);
    position: sticky; top: 0; background: var(--bg-card); z-index: 1;
}
.detail-panel-body { padding: 20px; }
.detail-section { margin-bottom: 24px; }
.detail-section h4 { margin-bottom: 12px; color: var(--text-muted); font-size: 0.88rem; text-transform: uppercase; letter-spacing: 0.5px; }
.detail-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.03); }
.detail-label { color: var(--text-dim); font-size: 0.88rem; }
.detail-pre { background: var(--bg); padding: 12px; border-radius: var(--radius); font-size: 0.78rem; overflow-x: auto; white-space: pre-wrap; word-break: break-all; max-height: 300px; overflow-y: auto; }
.detail-actions { display: flex; gap: 8px; margin-top: 16px; }

/* --- Companies Grid --- */
.companies-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.company-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px; cursor: pointer;
    transition: all var(--transition);
}
.company-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.company-card-header { margin-bottom: 16px; }
.company-name { font-size: 1.05rem; margin-bottom: 2px; }
.company-domain { font-size: 0.82rem; color: var(--text-dim); }
.company-card-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.company-stat { text-align: center; }
.company-stat-val { display: block; font-size: 1rem; font-weight: 600; }
.company-stat-label { font-size: 0.7rem; color: var(--text-dim); text-transform: uppercase; }
.company-card-footer { display: flex; gap: 6px; flex-wrap: wrap; }

/* --- Tags --- */
.tag {
    display: inline-flex; padding: 3px 10px; border-radius: 20px;
    font-size: 0.75rem; background: var(--bg-input); color: var(--text-muted);
    border: 1px solid var(--border);
}
.tag-accent { border-color: var(--accent); color: var(--accent); }
.tag-clickable { cursor: pointer; }
.tag-clickable:hover { border-color: var(--accent); color: var(--accent); }

/* --- Charts --- */
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.chart-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px;
}
.chart-card-wide { grid-column: span 2; }
.chart-title { font-size: 0.93rem; margin-bottom: 16px; color: var(--text-muted); }
.chart-wrapper { height: 280px; position: relative; }

/* --- Research Page --- */
.research-container { max-width: 900px; }
.research-input-row { display: flex; gap: 12px; }
.research-input-row .form-input { flex: 1; }
.research-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.research-summary { display: flex; gap: 24px; align-items: center; }
.research-score-circle {
    width: 90px; height: 90px; border-radius: 50%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.research-score-circle.green { background: rgba(46,204,113,0.15); border: 2px solid var(--green); }
.research-score-circle.yellow { background: rgba(241,196,15,0.15); border: 2px solid var(--yellow); }
.research-score-circle.red { background: rgba(231,76,60,0.15); border: 2px solid var(--red); }
.research-score-value { font-size: 1.8rem; font-weight: 800; }
.research-score-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; }
.research-summary-info h2 { margin-bottom: 8px; }
.research-recommendation { color: var(--text-muted); white-space: pre-line; margin-bottom: 12px; }
.research-badges { display: flex; gap: 8px; flex-wrap: wrap; }

.email-item { padding: 6px 0; }
.bounty-item { padding: 6px 0; }
.text-success { color: var(--green); }
.text-error { color: var(--red); }
.text-muted { color: var(--text-muted); }

/* AI Analysis Grid */
.ai-analysis-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ai-field { padding: 8px 0; }
.ai-field.full-width { grid-column: span 2; }
.ai-label { display: block; font-size: 0.75rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }

.ai-error-block { border-color: var(--orange) !important; }
.ai-error-msg { display: flex; gap: 16px; align-items: flex-start; }
.ai-error-icon { font-size: 2rem; }
.ai-error-msg p { color: var(--text-muted); margin: 4px 0 12px; }

/* Research History */
.research-history { }
.history-item {
    display: flex; align-items: center; gap: 12px; padding: 10px;
    border-bottom: 1px solid var(--border); cursor: pointer; transition: background var(--transition);
}
.history-item:hover { background: var(--bg-card-hover); }
.history-domain { font-weight: 500; }
.history-meta { flex: 1; font-size: 0.82rem; color: var(--text-muted); }

/* --- Settings --- */
.settings-container { max-width: 800px; }
.settings-section { margin-bottom: 32px; }
.settings-section-title { font-size: 1.2rem; margin-bottom: 8px; }
.settings-section-desc { color: var(--text-muted); font-size: 0.93rem; margin-bottom: 16px; }
.settings-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px;
}
.settings-divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.test-result { margin-top: 12px; font-size: 0.88rem; }

/* --- AI Provider Selector --- */
.provider-selector { display: flex; gap: 12px; }
.provider-btn {
    flex: 1; padding: 16px; background: var(--bg-input);
    border: 2px solid var(--border); border-radius: var(--radius);
    cursor: pointer; text-align: center; transition: all var(--transition);
    color: var(--text-muted);
}
.provider-btn:hover { border-color: var(--border-light); color: var(--text); }
.provider-btn.active { border-color: var(--accent); background: rgba(255,107,107,0.08); color: var(--text); }
.provider-icon { display: block; font-size: 1.8rem; margin-bottom: 4px; }
.provider-name { display: block; font-weight: 600; font-size: 1rem; }
.provider-model { display: block; font-size: 0.75rem; color: var(--text-dim); }

/* --- AI Key Groups --- */
.ai-key-group { margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.ai-key-group:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.ai-key-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ai-key-provider-icon { font-size: 1.5rem; }
.ai-key-header h4 { margin-bottom: 0; }
.ai-key-hint { font-size: 0.78rem; color: var(--text-dim); font-family: monospace; }
.ai-key-status { margin-left: auto; font-size: 0.82rem; }
.ai-key-input-row { display: flex; gap: 8px; }
.ai-key-input-row .form-input { flex: 1; }
.ai-key-test-result { margin-top: 8px; font-size: 0.82rem; min-height: 20px; }

/* --- Modal --- */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.7);
    z-index: 1000; display: none; align-items: center; justify-content: center;
    padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal-content {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); max-width: 700px; width: 100%;
    max-height: 80vh; overflow-y: auto;
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px; border-bottom: 1px solid var(--border);
}
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; }
.modal-body { padding: 20px; }
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; padding: 16px 20px; border-top: 1px solid var(--border); }

/* Report text preview */
.report-preview { }
.report-text { background: var(--bg); padding: 16px; border-radius: var(--radius); font-size: 0.82rem; white-space: pre-wrap; max-height: 400px; overflow-y: auto; }

/* --- Toast --- */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 2000; display: flex; flex-direction: column-reverse; gap: 8px; }
.toast {
    padding: 12px 20px; border-radius: var(--radius);
    font-size: 0.88rem; animation: slideIn 0.3s ease;
    max-width: 400px; word-break: break-word;
}
.toast-success { background: rgba(46,204,113,0.9); color: #fff; }
.toast-error { background: rgba(231,76,60,0.9); color: #fff; }
.toast-info { background: rgba(52,152,219,0.9); color: #fff; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* --- Loading / Empty States --- */
.loading-placeholder { text-align: center; padding: 40px; color: var(--text-dim); }
.empty-state { text-align: center; padding: 40px; color: var(--text-dim); }
.error-state { text-align: center; padding: 20px; color: var(--red); }

/* ============================================================
   LIGHT THEME (Enhanced contrast & polish)
   ============================================================ */
body.light-theme {
    --bg: #f3f4f7;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f1f3;
    --bg-input: #ecedf0;
    --border: #d0d4d9;
    --border-light: #b8bcc2;
    --text: #111827;
    --text-muted: #4b5563;
    --text-dim: #6b7280;
    --shadow: 0 2px 12px rgba(0,0,0,0.1);
}
body.light-theme .pub-nav {
    background: rgba(255,255,255,0.96);
    border-bottom-color: #d0d4d9;
}
body.light-theme .sidebar {
    background: #ffffff;
    border-right-color: #d0d4d9;
}
body.light-theme .dash-header {
    background: #ffffff;
    border-bottom-color: #d0d4d9;
}
body.light-theme .hero {
    background: linear-gradient(135deg, #f3f4f7, #e5e7eb);
}
body.light-theme .hero-bg-grid {
    background-image: radial-gradient(circle at 1px 1px, #d0d4d9 1px, transparent 0);
}
body.light-theme .detail-pre,
body.light-theme .report-text {
    background: #ecedf0;
    color: #111827;
}
body.light-theme .modal-content {
    background: #ffffff;
    border-color: #d0d4d9;
}
body.light-theme .modal-overlay {
    background: rgba(0,0,0,0.4);
}
body.light-theme .toast-info { background: rgba(37,99,235,0.95); }
body.light-theme .toast-success { background: rgba(22,163,74,0.95); }
body.light-theme .toast-error { background: rgba(220,38,38,0.95); }
/* Light mode cards need visible shadow */
body.light-theme .service-card,
body.light-theme .stat-card,
body.light-theme .settings-card,
body.light-theme .section-block,
body.light-theme .company-card,
body.light-theme .cert-card,
body.light-theme .contact-form-card,
body.light-theme .contact-mini-card {
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
/* Light mode table borders */
body.light-theme .data-table th {
    background: #f7f8fa;
    border-bottom: 2px solid #d0d4d9;
}
body.light-theme .data-table td {
    border-bottom-color: #e5e7eb;
}
/* Light mode badges */
body.light-theme .badge { background: rgba(0,0,0,0.06); }
body.light-theme .badge-critical { background: rgba(220,38,38,0.12); color: #dc2626; }
body.light-theme .badge-high { background: rgba(234,88,12,0.12); color: #ea580c; }
body.light-theme .badge-medium { background: rgba(202,138,4,0.12); color: #ca8a04; }
body.light-theme .badge-low { background: rgba(37,99,235,0.12); color: #2563eb; }
body.light-theme .badge-info { background: rgba(37,99,235,0.08); color: #2563eb; }
/* Light mode filter bar */
body.light-theme .filter-bar {
    background: #ffffff;
    border-color: #d0d4d9;
}
/* Light mode nav items */
body.light-theme .nav-item:hover { background: rgba(0,0,0,0.04); }
body.light-theme .nav-item.active { background: rgba(255,107,107,0.08); }
body.light-theme .theme-toggle:hover { background: rgba(0,0,0,0.04); }
/* Light mode accent pops */
body.light-theme .accent { color: #e63946; }
body.light-theme .btn-primary { background: #e63946; border-color: #e63946; }
body.light-theme .btn-primary:hover { background: #d32f2f; }
body.light-theme .carousel-logo { border-color: #d0d4d9; color: #4b5563; background: rgba(0,0,0,0.03); }
body.light-theme .carousel-logo:hover { border-color: #e63946; color: #e63946; }

/* Smooth theme transition */
body, body .sidebar, body .dash-header, body .dash-main,
body .section-block, body .stat-card, body .settings-card,
body .data-table th, body .data-table td, body .filter-bar,
body .modal-content, body .detail-panel, body .pub-nav,
body .form-input, body .form-select, body .filter-input, body .filter-select {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ============================================================
   THEME TOGGLE
   ============================================================ */
.theme-toggle {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: var(--radius);
    color: var(--text-muted); text-decoration: none; font-size: 0.93rem;
    transition: all var(--transition); margin-bottom: 8px;
    background: none; border: none; cursor: pointer; width: 100%; text-align: left;
}
.theme-toggle:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.theme-icon { font-size: 1.15rem; width: 24px; text-align: center; flex-shrink: 0; }

/* ============================================================
   SIDEBAR IMPROVEMENTS
   ============================================================ */
.nav-item {
    position: relative; overflow: hidden;
}
.nav-item::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px; background: var(--accent); transform: scaleY(0);
    transition: transform 0.2s ease;
}
.nav-item.active::before { transform: scaleY(1); }
.nav-item:hover {
    transform: translateX(2px);
}

/* ============================================================
   LOADING SKELETONS
   ============================================================ */
@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}
.skeleton {
    background: linear-gradient(90deg, var(--bg-input) 0px, var(--bg-card-hover) 100px, var(--bg-input) 200px);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}
.skeleton-line { height: 14px; margin-bottom: 8px; border-radius: 4px; }
.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }
.skeleton-card { height: 80px; border-radius: var(--radius); margin-bottom: 12px; }

/* ============================================================
   TOOLTIPS
   ============================================================ */
.btn-icon[title] {
    position: relative;
}
.btn-icon[title]:hover::after {
    content: attr(title);
    position: absolute; bottom: calc(100% + 6px); left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card); color: var(--text); border: 1px solid var(--border);
    padding: 4px 10px; border-radius: var(--radius-sm);
    font-size: 0.72rem; white-space: nowrap; z-index: 100;
    pointer-events: none;
}

/* ============================================================
   TABLE IMPROVEMENTS
   ============================================================ */
.data-table tr {
    transition: background-color 0.15s ease;
}
.data-table tbody tr:hover td {
    background: var(--bg-card-hover);
}

/* ============================================================
   INBOX
   ============================================================ */
.inbox-container { max-width: 900px; }
.inbox-item {
    display: flex; gap: 14px; padding: 14px 16px;
    border-bottom: 1px solid var(--border); cursor: pointer;
    transition: background var(--transition);
}
.inbox-item:hover { background: var(--bg-card-hover); }
.inbox-item.unread { background: rgba(52,152,219,0.05); }
.inbox-item.unread .inbox-from,
.inbox-item.unread .inbox-subject { font-weight: 700; }
.inbox-item-left { flex-shrink: 0; }
.inbox-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 1rem;
}
.inbox-item-main { flex: 1; min-width: 0; }
.inbox-item-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.inbox-from { font-size: 0.93rem; }
.inbox-date { font-size: 0.75rem; color: var(--text-dim); flex-shrink: 0; }
.inbox-subject { font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-addr { font-size: 0.75rem; color: var(--text-dim); margin-top: 2px; }
.inbox-error { text-align: center; padding: 40px; }
.inbox-error-icon { font-size: 2.5rem; display: block; margin-bottom: 12px; }
.inbox-error p { color: var(--text-muted); margin-bottom: 16px; }

.email-detail { }
.email-meta { margin-bottom: 16px; }
.email-body { margin: 16px 0; }
.email-reply-section { margin-top: 20px; }
.email-reply-section h4 { margin-bottom: 12px; }

/* ============================================================
   PLUGIN SELECTOR
   ============================================================ */
.plugin-category { margin-bottom: 8px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.plugin-category-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 14px; background: var(--bg-input); cursor: pointer;
    font-weight: 600; font-size: 0.88rem;
}
.plugin-category-header:hover { background: var(--bg-card-hover); }
.plugin-cat-toggle { color: var(--text-dim); font-size: 0.75rem; }
.plugin-category-body { padding: 8px 14px; }
.plugin-checkbox {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 0; font-size: 0.88rem; cursor: pointer;
}
.plugin-checkbox input[type="checkbox"] {
    accent-color: var(--accent); width: 16px; height: 16px;
}
.plugin-name { flex: 1; }
.plugin-select-actions { display: flex; gap: 4px; }

.fetch-dialog { }

/* ============================================================
   HOMEPAGE IMPROVEMENTS
   ============================================================ */
.hero-title {
    background: linear-gradient(135deg, var(--text), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-title .accent {
    -webkit-text-fill-color: var(--accent);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg-card); flex-direction: column; padding: 16px; border-bottom: 1px solid var(--border); }
    .nav-links.open { display: flex; }

    .hero-title { font-size: 2.5rem; }
    .hero-stats { flex-direction: column; gap: 16px; }
    .stat-divider { display: none; }

    .about-grid, .about-detail-grid, .contact-grid, .contact-page-grid, .contact-page-grid-new { grid-template-columns: 1fr; }
    .services-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }

    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .dash-main { margin-left: 0 !important; }
    .mobile-menu-btn { display: block; }

    .dash-two-col { grid-template-columns: 1fr; }
    .charts-grid { grid-template-columns: 1fr; }
    .chart-card-wide { grid-column: span 1; }
    .research-grid { grid-template-columns: 1fr; }
    .research-input-row { flex-direction: column; }
    .research-summary { flex-direction: column; text-align: center; }
    .provider-selector { flex-direction: column; }
    .ai-key-input-row { flex-direction: column; }

    .detail-panel, .detail-panel-wide { width: 100%; right: -100%; }

    .filter-bar { flex-direction: column; }
    .form-row { flex-direction: column; }
    .certs-grid { grid-template-columns: 1fr; }
    .platform-stats-grid { grid-template-columns: repeat(3, 1fr); }
    .bugcrowd-badges { flex-direction: column; align-items: center; }
    .contact-footer-grid { grid-template-columns: 1fr 1fr; }
    .contact-form-card h3 { font-size: 1.3rem; }
}

/* ============================================================
   FIX: Content area clears sticky header
   ============================================================ */
.dash-content {
    padding: 24px;
    min-height: calc(100vh - var(--header-h));
}

/* ============================================================
   SORT ARROWS for table headers
   ============================================================ */
.sort-arrows {
    font-size: 0.65rem;
    color: var(--text-dim);
    margin-left: 4px;
    letter-spacing: -2px;
    user-select: none;
}
.sortable:hover .sort-arrows,
.sortable-header:hover .sort-arrows {
    color: var(--accent);
}
/* Active sort state via JS-toggled classes */
.sortable.sort-asc .sort-arrows,
.sortable-header.sort-active-asc .sort-arrows {
    color: var(--accent);
}
.sortable.sort-asc .sort-arrows::after { content: ''; }
.sortable.sort-desc .sort-arrows::after { content: ''; }
/* Override default ↑↓ from existing .sort-asc / .sort-desc */
.sortable.sort-asc::after,
.sortable.sort-desc::after { content: none; }
.sortable.sort-asc .sort-arrows { letter-spacing: 0; }
.sortable.sort-asc .sort-arrows::before { content: '▲'; color: var(--accent); font-size: 0.7rem; }
.sortable.sort-desc .sort-arrows { letter-spacing: 0; }
.sortable.sort-desc .sort-arrows::before { content: '▼'; color: var(--accent); font-size: 0.7rem; }
.sortable-header.sort-active-asc .sort-arrows { letter-spacing: 0; }
.sortable-header.sort-active-asc .sort-arrows::before { content: '▲ '; color: var(--accent); }
.sortable-header.sort-active-desc .sort-arrows { letter-spacing: 0; }
.sortable-header.sort-active-desc .sort-arrows::before { content: '▼ '; color: var(--accent); }
.sortable-header {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.sortable-header:hover { color: var(--accent); }

/* ============================================================
   CERTIFICATIONS SECTION (Homepage & About)
   ============================================================ */
.section-certs {
    background: linear-gradient(135deg, rgba(255,107,107,0.03), rgba(52,152,219,0.03));
}
.certs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}
.cert-card {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: 28px 20px; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); transition: all var(--transition);
    text-decoration: none; color: var(--text);
}
.cert-card:hover {
    border-color: var(--accent); transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(255,107,107,0.15);
}
.cert-icon { font-size: 2.5rem; margin-bottom: 12px; }
.cert-card h3 { font-size: 1.3rem; margin-bottom: 4px; }
.cert-card p { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 12px; }
.cert-verify { font-size: 0.78rem; color: var(--accent); font-weight: 600; }

/* Platform stats grid */
.platform-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}
.platform-stat-card {
    text-align: center;
    padding: 20px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.platform-stat-value {
    display: block; font-size: 1.8rem; font-weight: 800; color: var(--accent);
}
.platform-stat-value sup { font-size: 0.6em; }
.platform-stat-label {
    display: block; font-size: 0.75rem; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px;
}

/* Bugcrowd badges */
.bugcrowd-badges {
    display: flex; justify-content: center; gap: 20px; flex-wrap: wrap;
}
.bc-badge {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 20px; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); min-width: 180px;
}
.bc-badge-icon { font-size: 1.8rem; }
.bc-badge strong { display: block; font-size: 0.93rem; }
.bc-level { font-size: 0.78rem; color: var(--accent); font-weight: 600; }

/* ============================================================
   LOGO CAROUSEL (CSS-only infinite scroll)
   ============================================================ */
.section-carousel {
    padding-bottom: 40px;
    overflow: hidden;
}
.logo-carousel-wrapper {
    overflow: hidden;
    position: relative;
    padding: 20px 0;
    /* Fade edges */
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}
.logo-carousel {
    display: flex;
    gap: 16px;
    animation: carousel-scroll 60s linear infinite;
    width: max-content;
}
.logo-carousel:hover {
    animation-play-state: paused;
}
.carousel-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    background: linear-gradient(135deg, rgba(255,107,107,0.06), rgba(52,152,219,0.06));
    border: 1px solid var(--border);
    border-radius: 24px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    transition: all 0.3s ease;
    letter-spacing: 0.2px;
}
.carousel-logo:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(255,107,107,0.08);
}
@keyframes carousel-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
/* ============================================================
   LOGO CAROUSEL — Company logos with names
   ============================================================ */
.carousel-logo-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(255,107,107,0.04), rgba(52,152,219,0.04));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 130px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}
.carousel-logo-item:hover {
    border-color: var(--accent);
    background: rgba(255,107,107,0.06);
    transform: translateY(-2px);
}
.carousel-logo-item img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 8px;
}
.carousel-logo-item img.favicon-fallback {
    width: 32px;
    height: 32px;
}
.carousel-logo-item span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    text-align: center;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.light-theme .carousel-logo-item {
    border-color: #d0d4d9;
    background: rgba(0,0,0,0.02);
}
body.light-theme .carousel-logo-item:hover {
    border-color: #e63946;
}

/* ============================================================
   HERO SERVICE CARDS
   ============================================================ */
.hero-services {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 48px;
    max-width: 900px;
}
.hero-service-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 16px;
    text-align: center;
    transition: all 0.3s ease;
}
.hero-service-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    background: rgba(255,107,107,0.05);
}
.hero-service-icon { font-size: 2rem; display: block; margin-bottom: 8px; }
.hero-service-card h4 { font-size: 0.88rem; margin-bottom: 4px; }
.hero-service-card p { font-size: 0.75rem; color: var(--text-muted); }

@media (max-width: 768px) {
    .hero-services { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   BOUNTY SCREENSHOTS GALLERY
   ============================================================ */
.section-screenshots { display: none; } /* Hidden until screenshots loaded */
.screenshot-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.screenshot-item {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-card);
    transition: all 0.3s ease;
}
.screenshot-item:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(255,107,107,0.15);
}
.screenshot-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}
.screenshot-caption {
    padding: 10px 14px;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
}

/* ============================================================
   SCREENSHOT MANAGEMENT (Settings)
   ============================================================ */
.screenshot-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s ease;
}
.screenshot-upload-area:hover { border-color: var(--accent); }
.screenshot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}
.screenshot-thumb {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-card);
}
.screenshot-thumb img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}
.screenshot-thumb-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    gap: 4px;
}
.screenshot-thumb-actions input {
    flex: 1;
    padding: 4px 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.78rem;
}
.screenshot-thumb-actions .btn-icon { color: var(--red); }

/* ============================================================
   ABOUT PAGE — Certs & Stats additions
   ============================================================ */
.about-certs-grid {
    display: flex; flex-direction: column; gap: 10px; margin-top: 8px;
}
.about-cert-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text); text-decoration: none;
    transition: all var(--transition);
}
.about-cert-item:hover { border-color: var(--accent); color: var(--accent); }
.about-cert-icon { font-size: 1.5rem; }
.about-cert-desc { display: block; font-size: 0.78rem; color: var(--text-muted); }
.about-stats-row {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.about-stat-item { text-align: center; padding: 12px; background: var(--bg-input); border-radius: var(--radius); }
.about-stat-val { display: block; font-size: 1.3rem; font-weight: 800; color: var(--accent); }
.about-stat-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; }

/* ============================================================
   CONTACT PAGE REDESIGN
   ============================================================ */
.contact-main-section { padding-bottom: 0; }
.contact-page-grid-new {
    display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: flex-start;
}
.contact-form-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 36px;
}
.contact-form-card h3 { font-size: 1.5rem; margin-bottom: 4px; }
.contact-form-inline .form-row { display: flex; gap: 16px; }
.contact-form-inline .form-row .form-group { flex: 1; }

.contact-sidebar-info { display: flex; flex-direction: column; gap: 16px; }
.contact-response-badge {
    display: flex; align-items: center; gap: 10px;
    padding: 16px; background: rgba(255,107,107,0.08); border: 1px solid rgba(255,107,107,0.2);
    border-radius: var(--radius); font-weight: 600; color: var(--accent);
}
.contact-mini-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px;
}
.contact-mini-card h4 { margin-bottom: 12px; }
.contact-why-list { list-style: none; }
.contact-why-list li {
    padding: 6px 0; border-bottom: 1px solid var(--border);
    color: var(--text-muted); font-size: 0.88rem;
}
.contact-why-list li:last-child { border-bottom: none; }

.contact-social-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.contact-social-item {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text-muted); font-size: 0.88rem;
    text-decoration: none; transition: all var(--transition);
}
.contact-social-item:hover { border-color: var(--accent); color: var(--accent); }

/* Contact footer (dark section) */
.contact-footer-section {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 48px 0;
    margin-top: 60px;
}
.contact-footer-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
}
.contact-footer-item {
    display: flex; align-items: center; gap: 16px;
}
.contact-footer-icon { font-size: 2rem; }
.contact-footer-item h4 { margin-bottom: 2px; font-size: 0.88rem; color: var(--text-muted); }
.contact-footer-item a { color: var(--text); font-weight: 500; }
.contact-footer-item a:hover { color: var(--accent); }

/* ============================================================
   ATTACHMENT UPLOAD (Reports)
   ============================================================ */
.attachment-upload-area {
    display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.attachment-list {
    display: flex; flex-direction: column; gap: 4px;
}
.attachment-item {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 10px; background: var(--bg-input); border-radius: var(--radius-sm);
    font-size: 0.82rem;
}
.attachment-icon { font-size: 1rem; }
.attachment-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-size { color: var(--text-dim); font-size: 0.75rem; }

/* ============================================================
   PROFILE PHOTO (Settings & Sidebar)
   ============================================================ */
.profile-photo-section {
    display: flex; align-items: center; gap: 24px;
}
.profile-photo-preview {
    width: 100px; height: 100px; border-radius: 50%;
    border: 3px solid var(--accent); overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.profile-photo-preview .avatar-placeholder-lg {
    width: 94px; height: 94px; font-size: 2rem;
}
.profile-photo-img {
    width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.profile-photo-actions {
    display: flex; flex-direction: column; gap: 8px;
}
.sidebar-profile-img {
    width: 28px; height: 28px; border-radius: 50%; object-fit: cover;
}
/* Public page avatar images */
.avatar-img-public {
    width: 180px; height: 180px; border-radius: 50%; object-fit: cover;
}
.avatar-ring .avatar-img-public {
    width: 180px; height: 180px;
}

/* ============================================================
   LOGS PAGE
   ============================================================ */
.log-row.log-error td { background: rgba(231,76,60,0.04); }
.log-row.log-warn td { background: rgba(241,196,15,0.04); }
.log-message { max-width: 500px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-category {
    display: inline-block; padding: 2px 8px;
    background: var(--bg-input); border-radius: 10px;
    font-size: 0.75rem; color: var(--text-muted);
}

/* ============================================================
   MODAL — Proper z-index & backdrop blur
   ============================================================ */
.modal-overlay {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.modal-content {
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

/* ============================================================
   TOAST — Consistent positioning (bottom-right, no overlap)
   ============================================================ */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

/* ============================================================
   TABLE POLISH — Column widths, no text overflow
   ============================================================ */
.data-table {
    table-layout: auto;
}
.data-table th {
    position: sticky;
    top: var(--header-h);
    z-index: 15;
    background: var(--bg-card);
}

/* ============================================================
   RESPONSIVE SIDEBAR — Collapse on mobile
   ============================================================ */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        z-index: 999;
        box-shadow: 4px 0 20px rgba(0,0,0,0.5);
    }
    /* Overlay behind sidebar */
    .sidebar.open::after {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: -1;
    }
}

/* ============================================================
   PROVIDER SELECTOR (5 providers)
   ============================================================ */
.provider-selector {
    display: flex; gap: 10px; flex-wrap: wrap;
}
.provider-btn {
    flex: 1; min-width: 100px;
}

/* ============================================================
   NOTIFICATIONS
   ============================================================ */
.notif-bell {
    position: relative;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px 8px;
    border-radius: var(--radius);
    transition: background 0.2s;
    user-select: none;
}
.notif-bell:hover { background: rgba(255,255,255,0.1); }
.notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--red);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    line-height: 1;
}
.notif-dropdown {
    position: fixed;
    top: var(--header-h);
    right: 12px;
    width: 360px;
    max-height: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    z-index: 200;
    overflow: hidden;
}
.notif-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}
.notif-dropdown-list {
    max-height: 360px;
    overflow-y: auto;
}
.notif-item {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    cursor: default;
}
.notif-item.unread {
    background: rgba(255,107,107,0.05);
    border-left: 3px solid var(--accent);
}
.notif-item-title { font-weight: 600; font-size: 0.85rem; }
.notif-item-msg { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.notif-item-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; }
.notif-empty { padding: 24px; text-align: center; color: var(--text-muted); font-size: 0.85rem; }

/* ============================================================
   REVENUE PAGE
   ============================================================ */
.td-reward { font-weight: 700; color: var(--green); }
.td-date { white-space: nowrap; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* ============================================================
   LEAKIX PLUGIN SELECTOR
   ============================================================ */
.plugin-category {
    margin-bottom: 16px;
}
.plugin-category-header {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--accent);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.plugin-category-header .toggle-icon {
    transition: transform 0.2s;
    font-size: 0.7rem;
}
.plugin-category-header.collapsed .toggle-icon { transform: rotate(-90deg); }
.plugin-checklist {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 4px 16px;
}
.plugin-checklist label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    padding: 3px 0;
    cursor: pointer;
}
.plugin-checklist label:hover { color: var(--accent); }

/* ============================================================
   EMAIL TEMPLATE EDITOR
   ============================================================ */
.template-tab-bar {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 16px;
}
.template-tab {
    padding: 8px 16px;
    cursor: pointer;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}
.template-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.template-tab:hover { color: var(--text); }
.template-vars {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.template-var {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 2px 8px;
    font-size: 0.75rem;
    font-family: monospace;
    cursor: pointer;
    color: var(--accent);
}
.template-var:hover { background: rgba(255,107,107,0.1); }
