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

:root {
    --primary-color: #0066FF;
    --secondary-color: #00C896;
    --danger-color: #FF3B30;
    --warning-color: #FF9500;
    --dark: #1A1A1A;
    --gray-900: #2A2A2A;
    --gray-700: #4A4A4A;
    --gray-500: #6A6A6A;
    --gray-300: #C8C8C8;
    --gray-200: #E8E8E8;
    --gray-100: #F4F4F4;
    --border: #E0E0E0;
    --bg-primary: #FFFFFF;
    --bg-secondary: #FAFAFA;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-secondary);
    color: var(--dark);
    line-height: 1.6;
}

.portal-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.portal-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.875rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.portal-logo {
    height: 32px;
    width: auto;
    display: block;
}

.portal-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.portal-username {
    font-size: 0.875rem;
    color: var(--gray-700);
    font-weight: 500;
}

.portal-main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    min-height: calc(100vh - 140px);
}

.page-header {
    margin-bottom: 1.75rem;
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark);
}

.page-header p {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* Login page */
.login-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
    background: var(--bg-secondary);
}

.login-logo {
    height: 40px;
    width: auto;
    margin-bottom: 2rem;
}

.login-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
}

.login-card h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.login-card p {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}

/* Stat cards */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: border-color 0.2s;
}

.stat-card:hover {
    border-color: var(--gray-300);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--gray-500);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--dark);
}

/* Section */
.section {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 1.25rem;
}

/* Onboarding card */
.onboarding-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    max-width: 560px;
    margin: 0 auto;
}

.onboarding-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.onboarding-card p {
    font-size: 0.9rem;
    color: var(--gray-700);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.onboarding-steps {
    list-style: none;
    margin-bottom: 1.5rem;
}

.onboarding-steps li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: var(--gray-700);
    border-bottom: 1px solid var(--border);
}

.onboarding-steps li:last-child {
    border-bottom: none;
}

.step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.status-pill.pending {
    background: #FFF8E6;
    color: var(--warning-color);
    border: 1px solid var(--warning-color);
}

.status-pill.complete {
    background: #F0FFF4;
    color: var(--secondary-color);
    border: 1px solid var(--secondary-color);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

/* Buttons */
.btn {
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    border: 1px solid transparent;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    font-family: inherit;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: #0052CC;
    border-color: #0052CC;
}

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

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--dark);
    border-color: var(--border);
}

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

.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.8rem;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark);
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--bg-primary);
    color: var(--dark);
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Banners */
.error-banner {
    background: #FFF0F0;
    color: var(--danger-color);
    padding: 0.875rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid var(--danger-color);
    font-size: 0.875rem;
    display: none;
}

.warning-banner {
    background: #FFF8E6;
    color: #7A4500;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--warning-color);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Table */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table th {
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--dark);
    vertical-align: middle;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background: var(--bg-secondary);
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--gray-500);
    font-size: 0.9rem;
}

.loading {
    text-align: center;
    padding: 3rem;
    color: var(--gray-500);
    font-size: 0.9rem;
}

/* Help sidebar */
.help-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 200;
}

.help-overlay.open {
    display: block;
}

.help-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    height: 100vh;
    background: var(--bg-primary);
    border-left: 1px solid var(--border);
    z-index: 300;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.help-sidebar.open {
    transform: translateX(0);
}

.help-sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.help-sidebar-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
}

.help-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    font-family: inherit;
}

.help-close:hover {
    color: var(--dark);
}

.help-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 1rem;
}

.help-section {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.help-section:last-child {
    border-bottom: none;
}

.help-section h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.help-section p,
.help-section li {
    font-size: 0.825rem;
    color: var(--gray-700);
    line-height: 1.65;
}

.help-section ul {
    padding-left: 1.25rem;
    margin-top: 0.25rem;
}

.help-section li {
    margin-bottom: 0.25rem;
}

.help-sidebar-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.support-link {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
}

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

/* Footer */
.portal-footer {
    text-align: center;
    padding: 2rem 1.5rem;
    color: var(--gray-500);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    margin-top: 3rem;
    background: var(--bg-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .portal-main {
        padding: 0 1rem;
        margin: 1.5rem auto;
    }

    .portal-header-inner {
        padding: 0.875rem 1rem;
    }

    .portal-username {
        display: none;
    }

    .stat-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .help-sidebar {
        width: 100%;
    }

    .table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

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

    .login-card {
        padding: 1.5rem;
    }
}
