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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

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

.auth-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    margin: 100px auto;
}

.auth-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.form-group textarea {
    resize: vertical;
}

.btn {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
}

.error {
    color: #dc3545;
    margin-top: 10px;
    font-size: 14px;
    text-align: center;
}

.hidden {
    display: none;
}

.dashboard-header {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.dashboard-header h1 {
    color: #333;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    color: #666;
}

.credit-display {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    color: white;
    font-size: 14px;
    font-weight: 600;
}

.credit-label {
    opacity: 0.9;
}

.credit-amount {
    font-size: 16px;
    font-weight: 700;
}

.btn-link {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-link:hover {
    background: rgba(255, 255, 255, 0.3);
}

.credit-packages {
    display: grid;
    gap: 15px;
}

.credit-package {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s;
    cursor: pointer;
}

.credit-package:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.credit-package.featured {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

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

.package-name {
    font-size: 18px;
    font-weight: 700;
    color: #1a202c;
}

.package-price {
    font-size: 24px;
    font-weight: 800;
    color: #667eea;
}

.package-description {
    color: #718096;
    font-size: 14px;
    margin-bottom: 15px;
}

.package-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.package-credits {
    font-size: 14px;
    color: #4a5568;
}

.package-savings {
    font-size: 12px;
    color: #48bb78;
    font-weight: 600;
}

.dashboard-tabs {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.dashboard-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.section-header h2 {
    color: #333;
}

.section-header .btn {
    width: auto;
    padding: 10px 20px;
}

.filter-bar {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-bar label {
    color: #666;
    font-weight: 500;
}

.filter-bar select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.data-list {
    display: grid;
    gap: 15px;
}

.data-item {
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 5px;
    background: #f9f9f9;
}

.data-item h3 {
    color: #333;
    margin-bottom: 10px;
}

.data-item p {
    color: #666;
    margin-bottom: 5px;
    font-size: 14px;
}

.data-item .meta {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    font-size: 12px;
    color: #999;
}

.data-item .status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.status-new { background: #e3f2fd; color: #1976d2; }
.status-contacted { background: #fff3e0; color: #f57c00; }
.status-qualified { background: #e8f5e9; color: #388e3c; }
.status-converted { background: #e8f5e9; color: #2e7d32; }
.status-lost { background: #ffebee; color: #d32f2f; }
.status-draft { background: #f5f5f5; color: #616161; }
.status-active { background: #e8f5e9; color: #388e3c; }
.status-paused { background: #fff3e0; color: #f57c00; }
.status-completed { background: #e3f2fd; color: #1976d2; }

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    z-index: 1000;
    padding: 24px 0;
}

/* Higher specificity than both .modal and .hidden individually, so a modal
   with class="modal hidden" is guaranteed to actually be hidden. Without this,
   .modal's display:flex (declared after .hidden in this file) wins the CSS
   cascade tie since both selectors have equal specificity, causing modals to
   stay visible (or their backdrop to persist) even after closeModal() runs. */
.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    align-self: flex-start;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #333;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-actions .btn {
    width: auto;
    flex: 1;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* ─── Alpha 1.0 Room Layout ─── */
.alpha-badge {
    font-size: 12px;
    background: #667eea;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    vertical-align: middle;
    margin-left: 8px;
}

.room-nav {
    background: white;
    padding: 10px 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.room-btn {
    padding: 8px 16px;
    border: none;
    background: #f0f0f0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    transition: all 0.2s;
}

.room-btn:hover {
    background: #e0e0e0;
}

.room-btn.active {
    background: #667eea;
    color: white;
}

.room-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.room-section h2 {
    color: #333;
    margin-bottom: 20px;
}

.room-section h3 {
    color: #555;
    margin: 20px 0 10px 0;
    font-size: 16px;
}

.room-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .room-grid {
        grid-template-columns: 1fr;
    }
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    background: #f9f9f9;
    text-align: center;
}

.stat-label {
    font-size: 12px;
    color: #999;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.stat-key {
    font-weight: 600;
    color: #555;
    min-width: 120px;
    display: inline-block;
}

.btn-sm {
    width: auto;
    padding: 6px 14px;
    font-size: 13px;
}

/* ─── Compliance room ─── */
.cbadge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; margin-right: 4px; }
.cbadge-ok { background: #e8f5e9; color: #2e7d32; }
.cbadge-warn { background: #fff3e0; color: #b26a00; }
.cbadge-bad { background: #ffebee; color: #c62828; }
.cbadge-info { background: #e3f2fd; color: #1565c0; }
.cbadge-muted { background: #f0f0f0; color: #616161; }
.compliance-banner { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; border-radius: 6px; padding: 12px 16px; margin-bottom: 16px; font-weight: 600; }
.how-it-works { margin: 8px 0 16px; padding: 10px 14px; background: #f7f9fc; border: 1px solid #e3e8ef; border-radius: 6px; font-size: 13px; color: #555; }
.how-it-works summary { cursor: pointer; font-weight: 600; color: #1565c0; }
.how-it-works ol { margin: 8px 0 0 18px; line-height: 1.6; }
.hint { font-size: 12px; color: #888; margin-bottom: 8px; }
.inline-form { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.inline-form input { padding: 6px 8px; border: 1px solid #ccc; border-radius: 4px; flex: 1; min-width: 120px; }

/* ─── Recruiting room (admin) ─── */
.recruit-details { margin: 10px 0; font-size: 13px; }
.recruit-details summary { cursor: pointer; font-weight: 600; color: #1565c0; }
.recruit-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.recruit-table td { padding: 4px 8px 4px 0; vertical-align: top; word-break: break-word; color: #444; }
.recruit-table .recruit-label { color: #777; white-space: nowrap; width: 1%; }
.recruit-actions { margin: 8px 0 0; }
.recruit-actions select { padding: 6px 8px; border: 1px solid #ccc; border-radius: 4px; }
#recruiting-filter { padding: 6px 8px; border: 1px solid #ccc; border-radius: 4px; }
