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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    color: #333;
}

.navbar {
    background: #1a73e8;
    color: white;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 600;
}

.nav-links a {
    color: white;
    text-decoration: none;
    margin-left: 1.5rem;
    font-size: 0.9rem;
}

.nav-links a:hover {
    text-decoration: underline;
}

.btn-login, .btn-logout {
    background: rgba(255,255,255,0.2);
    padding: 0.4rem 1rem;
    border-radius: 4px;
}

.btn-login:hover, .btn-logout:hover {
    background: rgba(255,255,255,0.3);
    text-decoration: none !important;
}

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

/* Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.login-card {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 420px;
    width: 100%;
}

.login-card h1 {
    margin-bottom: 0.5rem;
    color: #1a73e8;
}

.login-card p {
    color: #666;
    margin-bottom: 1.5rem;
}

.btn-google {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    border: 1px solid #dadce0;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.2s, box-shadow 0.2s;
}

.btn-google:hover {
    background: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.note {
    font-size: 0.8rem !important;
    color: #999 !important;
    margin-top: 1.5rem !important;
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.btn-primary {
    background: #1a73e8;
    color: white;
    border: none;
    padding: 0.65rem 1.35rem;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.btn-primary:hover:not(:disabled) {
    background: #1557b0;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
    border: none;
    padding: 0.65rem 1.25rem;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-danger-sm {
    background: #d93025;
    color: white;
    border: none;
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
}

.btn-danger-sm:hover {
    background: #b71c1c;
}

.table-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.85rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    font-size: 0.85rem;
    text-transform: uppercase;
}

tr:hover {
    background: #f8f9fa;
}

.badge {
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-active { background: #e6f4ea; color: #137333; }
.badge-suspended { background: #fce8e6; color: #c5221f; }
.badge-pending { background: #fef7e0; color: #b06000; }
.badge-id { background: #e8f0fe; color: #1a73e8; }

.count {
    margin-top: 1rem;
    color: #666;
    font-size: 0.9rem;
}

.empty-state {
    background: white;
    padding: 3rem;
    border-radius: 10px;
    text-align: center;
    color: #999;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Form */
.form-container {
    background: white;
    padding: 2.2rem;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    max-width: 780px;
    margin: 0 auto;
}

.form-container h1 {
    margin-bottom: 0.3rem;
    color: #1a73e8;
    font-size: 1.6rem;
}

.form-desc {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.form-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #202124;
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.35rem;
    border-bottom: 2px solid #e8eaed;
}

.user-form .form-group {
    margin-bottom: 1.25rem;
}

.user-form label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: #3c4043;
    font-size: 0.88rem;
}

.user-form input[type="text"],
.user-form input[type="password"],
.user-form input[type="tel"] {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid #dadce0;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.user-form input:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26,115,232,0.15);
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.input-with-suffix {
    display: flex;
    align-items: center;
}

.input-with-suffix input {
    border-radius: 6px 0 0 6px;
}

.suffix {
    background: #f1f3f4;
    padding: 0.65rem 0.75rem;
    border: 1px solid #dadce0;
    border-left: none;
    border-radius: 0 6px 6px 0;
    color: #5f6368;
    font-size: 0.9rem;
    white-space: nowrap;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    align-items: center;
}

/* Alerts */
.alert {
    padding: 0.85rem 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.alert-success {
    background: #e6f4ea;
    color: #137333;
    border: 1px solid #ceead6;
}

.alert-error {
    background: #fce8e6;
    color: #c5221f;
    border: 1px solid #f5c6cb;
}

.text-success { color: #137333; font-size: 0.9rem; margin-top: 4px; }
.text-muted { color: #666; font-size: 0.85rem; }

/* Password Options */
.password-options {
    margin-bottom: 0.75rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    font-weight: 500;
    color: #3c4043;
    font-size: 0.88rem;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #1a73e8;
}

.sub-label {
    font-size: 0.85rem !important;
    color: #666 !important;
    margin-bottom: 0.3rem !important;
}

.generated-password {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.generated-password input {
    flex: 1;
    padding: 0.65rem 0.85rem;
    border: 1px solid #dadce0;
    border-radius: 6px;
    font-size: 0.95rem;
    background: #f8f9fa;
    font-family: monospace;
    color: #333;
}

.btn-copy {
    background: #1a73e8;
    color: white;
    border: none;
    padding: 0.65rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.btn-copy:hover {
    background: #1557b0;
}

/* Groups & Spaces lists */
.groups-list {
    border: 1px solid #dadce0;
    border-radius: 6px;
    max-height: 220px;
    overflow-y: auto;
    background: #ffffff;
}

.group-item {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid #f1f3f4;
    font-weight: 400 !important;
    justify-content: flex-start;
    transition: background 0.15s;
}

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

.group-item:hover {
    background: #f8f9fa;
}

.group-name {
    font-weight: 600;
    color: #202124;
    margin-right: 0.5rem;
}

.group-email {
    font-size: 0.8rem;
    color: #5f6368;
}

.space-badge {
    margin-left: auto;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: #e8f0fe;
    color: #1a73e8;
    font-weight: 600;
}

.no-groups {
    color: #80868b;
    font-size: 0.85rem;
    font-style: italic;
    padding: 0.5rem 0;
}

.group-search-input {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid #dadce0;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    transition: border-color 0.2s;
}

.group-search-input:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26,115,232,0.15);
}

.spaces-toolbar {
    margin-bottom: 0.5rem;
}

.space-selection-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    margin-top: 4px;
}

.btn-link {
    background: none;
    border: none;
    color: #1a73e8;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.btn-link:hover {
    text-decoration: underline;
}

.sep {
    color: #dadce0;
}

.counter-badge {
    margin-left: auto;
    font-weight: 600;
    background: #e8f0fe;
    color: #1a73e8;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
}

.no-results {
    color: #80868b;
    font-size: 0.85rem;
    font-style: italic;
    padding: 0.5rem 0;
}

/* =============================================================================
   ONBOARDING SUMMARY RESULTS CARD
   ============================================================================= */
.summary-card {
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1.5px solid #dadce0;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    animation: fadeIn 0.25s ease;
}

.summary-success {
    border-color: #a7f3d0;
    background: #f6fdf9;
}

.summary-partial {
    border-color: #fde68a;
    background: #fffbeb;
}

.summary-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.2rem;
}

.summary-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: bold;
    flex-shrink: 0;
}

.summary-success .summary-icon {
    background: #d1fae5;
    color: #065f46;
}

.summary-partial .summary-icon {
    background: #fef3c7;
    color: #92400e;
}

.summary-header h2 {
    font-size: 1.25rem;
    color: #202124;
    margin-bottom: 2px;
}

.summary-subtitle {
    font-size: 0.85rem;
    color: #5f6368;
}

.user-info-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid #e8eaed;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 1.2rem;
    font-size: 0.9rem;
}

.user-info-banner .label {
    color: #5f6368;
    margin-right: 6px;
}

.user-info-banner code {
    background: #f1f3f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85rem;
}

.summary-section {
    margin-bottom: 1.2rem;
}

.summary-section h3 {
    font-size: 0.95rem;
    color: #202124;
    margin-bottom: 8px;
    border-bottom: 1px solid #e8eaed;
    padding-bottom: 4px;
}

.chat-stats-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.stat-pill {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
}

.stat-total { background: #e8eaed; color: #3c4043; }
.stat-added { background: #d1fae5; color: #065f46; }
.stat-already { background: #e0f2fe; color: #0369a1; }
.stat-failed { background: #fee2e2; color: #991b1b; }

.results-table-container {
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid #e8eaed;
    border-radius: 6px;
    background: #ffffff;
}

.results-table {
    width: 100%;
    font-size: 0.85rem;
}

.results-table th {
    background: #f8f9fa;
    padding: 8px 12px;
    font-size: 0.78rem;
}

.results-table td {
    padding: 8px 12px;
}

.status-pill {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-added { background: #d1fae5; color: #065f46; }
.status-already { background: #e0f2fe; color: #0369a1; }
.status-failed { background: #fee2e2; color: #991b1b; }

.summary-actions {
    display: flex;
    gap: 10px;
    margin-top: 1.2rem;
}

.divider {
    border: 0;
    border-top: 1px solid #dadce0;
    margin: 2rem 0;
}

/* Spinner */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
