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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #0f1117;
    color: #e1e4e8;
    line-height: 1.6;
}

a { color: #58a6ff; text-decoration: none; }
a:hover { text-decoration: underline; }

.top-nav {
    background: #161b22;
    border-bottom: 1px solid #30363d;
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}
.nav-brand { font-weight: 700; font-size: 1.2rem; color: #fff; }
.nav-brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.nav-links a { color: #8b949e; font-size: 0.9rem; padding: 0.25rem 0.5rem; border-radius: 4px; }
.nav-links a:hover { color: #fff; background: #21262d; text-decoration: none; }
.nav-links a.active { color: #fff; background: #30363d; }

.container { max-width: 1280px; margin: 0 auto; padding: 1.5rem 2rem; }

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s;
}
.stat-card:hover { border-color: #58a6ff; text-decoration: none; }
.stat-number { font-size: 1.8rem; font-weight: 700; }
.stat-label { font-size: 0.8rem; color: #8b949e; margin-top: 0.15rem; }
.stat-hot .stat-number { color: #f85149; }
.stat-free .stat-number { color: #d29922; }
.stat-paying .stat-number { color: #3fb950; }
.stat-outreach .stat-number { color: #bc8cff; }

.filter-bar {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    align-items: center;
}
.search-input, .filter-select {
    background: #0d1117;
    border: 1px solid #30363d;
    color: #e1e4e8;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
}
.search-input { flex: 1; min-width: 200px; }
.search-input:focus, .filter-select:focus { outline: none; border-color: #58a6ff; }

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid #30363d;
    background: #21262d;
    color: #e1e4e8;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}
.btn:hover { background: #30363d; text-decoration: none; }
.btn-primary { background: #1f6feb; border-color: #1f6feb; color: #fff; }
.btn-primary:hover { background: #388bfd; }
.btn-success { background: #238636; border-color: #238636; color: #fff; }
.btn-success:hover { background: #2ea043; }
.btn-danger { background: #da3633; border-color: #da3633; color: #fff; }
.btn-danger:hover { background: #f85149; }
.btn-ghost { background: transparent; border-color: transparent; color: #8b949e; }
.btn-ghost:hover { color: #e1e4e8; }
.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.8rem; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #21262d;
    font-size: 0.9rem;
}
th {
    background: #161b22;
    color: #8b949e;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
    z-index: 1;
}
tbody tr { border-left: 3px solid transparent; }
tbody tr:hover { background: #161b22; }
tbody tr.stage-hot { border-left-color: #f85149; }
tbody tr.stage-warm { border-left-color: #d29922; }
tbody tr.stage-contacted { border-left-color: #3fb950; }
tbody tr.stage-closed { border-left-color: #8b949e; }
.empty-state { text-align: center; color: #8b949e; padding: 3rem; }

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}
.badge-new { background: #1c2433; color: #58a6ff; }
.badge-contacted { background: #1c2d1f; color: #3fb950; }
.badge-warm { background: #2d2418; color: #d29922; }
.badge-hot { background: #2d1b1b; color: #f85149; }
.badge-closed { background: #1c1c1c; color: #8b949e; }

.badge-free { background: #1c1c1c; color: #8b949e; }
.badge-free-promo { background: #2d2418; color: #d29922; }
.badge-business { background: #1c2d1f; color: #3fb950; }
.badge-premium { background: #1c2433; color: #58a6ff; }
.badge-founding-member { background: #2d1c2d; color: #bc8cff; }
.badge-community-partner { background: #2d2418; color: #d29922; }

.badge-active { background: #1c2d1f; color: #3fb950; }
.badge-incomplete_expired { background: #2d1b1b; color: #f85149; }
.badge-none { background: #1c1c1c; color: #484f58; }

.results-count { font-size: 0.85rem; color: #8b949e; margin-bottom: 0.75rem; }
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}
.page-info { color: #8b949e; font-size: 0.9rem; }

.back-link { display: inline-block; margin-bottom: 1rem; color: #8b949e; font-size: 0.9rem; }
.back-link:hover { color: #fff; }

.detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.detail-header h1 { font-size: 1.6rem; }

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
@media (max-width: 800px) { .detail-grid { grid-template-columns: 1fr; } }

.detail-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 1.5rem;
}
.detail-card h2 { font-size: 1rem; margin-bottom: 0.5rem; color: #e1e4e8; }
.detail-card .muted { font-size: 0.8rem; color: #484f58; margin-bottom: 1rem; }

.info-list { display: grid; grid-template-columns: 130px 1fr; gap: 0.4rem 1rem; font-size: 0.9rem; }
.info-list dt { color: #8b949e; }
.info-list dd { word-break: break-word; }

.quick-action { margin-bottom: 1.5rem; }
.crm-form { display: flex; flex-direction: column; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.3rem; }
.form-group label { font-size: 0.85rem; color: #8b949e; }
.form-group input,
.form-group textarea,
.form-group select {
    background: #0d1117;
    border: 1px solid #30363d;
    color: #e1e4e8;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { outline: none; border-color: #58a6ff; }
textarea { resize: vertical; }

.meta-section { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid #30363d; }
.meta-section h3 { font-size: 0.9rem; color: #8b949e; margin-bottom: 0.75rem; }

.tag-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag {
    background: #21262d;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #8b949e;
}

.flash-success {
    background: #1c2d1f;
    border: 1px solid #238636;
    color: #3fb950;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
