/* B360 Onboarding Tool - Styles */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand a {
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--gray-900);
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-links a {
    color: var(--gray-700);
    text-decoration: none;
}

.nav-links a:hover {
    color: var(--primary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-500);
    font-size: 0.875rem;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    flex: 1;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
}

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

.page-header h1 {
    font-size: 1.5rem;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.form-card {
    max-width: 500px;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.dashboard-grid .stat {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--primary);
}

.tenant-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.tenant-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    padding: 1rem;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: border-color 0.15s;
}

.tenant-card:hover {
    border-color: var(--primary);
}

.tenant-card h4 {
    font-size: 0.875rem;
    text-align: center;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table th,
.table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    background: var(--gray-50);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--gray-500);
}

.table tbody tr:hover {
    background: var(--gray-50);
}

.table a {
    color: var(--primary);
    text-decoration: none;
}

.table a:hover {
    text-decoration: underline;
}

/* Status badges */
.status {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-pending {
    background: var(--gray-200);
    color: var(--gray-700);
}

.status-processing {
    background: #dbeafe;
    color: #1e40af;
}

.status-completed {
    background: #dcfce7;
    color: #166534;
}

.status-failed {
    background: #fee2e2;
    color: #991b1b;
}

.status-lg {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--gray-500);
    font-size: 0.75rem;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Job detail */
.job-info .info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.info-item label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
}

.info-item p {
    font-weight: 500;
}

.stats-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-box {
    flex: 1;
    text-align: center;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 0.375rem;
}

.stat-box .stat-value {
    font-size: 2rem;
    font-weight: 600;
}

.stat-box .stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
}

.stat-success .stat-value {
    color: var(--success);
}

.stat-danger .stat-value {
    color: var(--danger);
}

.download-section {
    text-align: center;
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: 0.375rem;
}

/* Failures */
.failures-section {
    margin-top: 2rem;
}

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

.table-failures pre {
    font-size: 0.75rem;
    background: var(--gray-100);
    padding: 0.5rem;
    border-radius: 0.25rem;
    max-width: 400px;
    overflow-x: auto;
}

.table-failures details summary {
    cursor: pointer;
    color: var(--primary);
    font-size: 0.75rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--gray-500);
}

/* Welcome */
.welcome-box {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.welcome-box h2 {
    margin-bottom: 1rem;
}

.welcome-box p {
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.welcome-box .btn {
    margin-top: 1.5rem;
}

/* Error page */
.error-page {
    text-align: center;
    padding: 4rem;
}

.error-page h1 {
    font-size: 3rem;
    color: var(--danger);
    margin-bottom: 1rem;
}

.error-message {
    font-size: 1.25rem;
    color: var(--gray-500);
    margin-bottom: 2rem;
}

/* Help box */
.help-box {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1.5rem;
}

.help-box h3 {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.help-box ul,
.help-box ol {
    font-size: 0.875rem;
    color: var(--gray-700);
    padding-left: 1.5rem;
}

.help-box p {
    font-size: 0.875rem;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.import-order {
    background: white;
    border-radius: 0.375rem;
    padding: 0.75rem 0.75rem 0.75rem 2rem;
}

.import-order li {
    padding: 0.375rem 0;
    border-bottom: 1px dashed var(--gray-200);
}

.import-order li:last-child {
    border-bottom: none;
}

.import-order em {
    color: var(--gray-500);
    font-style: normal;
    font-size: 0.8125rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--gray-500);
    font-size: 0.875rem;
    border-top: 1px solid var(--gray-200);
    margin-top: auto;
}

/* Utilities */
.text-danger {
    color: var(--danger);
}

.text-muted {
    color: var(--gray-500);
}

.back-link {
    margin-top: 2rem;
}

.back-link a {
    color: var(--gray-500);
    text-decoration: none;
}

.back-link a:hover {
    color: var(--primary);
}

code {
    background: var(--gray-100);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.subtitle {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-top: -0.5rem;
}

.tenant-info {
    background: var(--gray-50);
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 2rem;
}

.tenant-info p {
    margin-bottom: 0.25rem;
}
