:root {
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --success-gradient: linear-gradient(135deg, #059669 0%, #10b981 100%);
    --danger-gradient: linear-gradient(135deg, #dc2626 0%, #f97316 100%);
    --warning-gradient: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);

    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --success-color: #059669;
    --warning-color: #d97706;
    --danger-color: #dc2626;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #eef2ff;
    --border-light: rgba(148, 163, 184, 0.22);
    --border-medium: rgba(99, 102, 241, 0.26);

    --shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 18px 50px rgba(15, 23, 42, 0.1);
    --shadow-lg: 0 30px 80px rgba(15, 23, 42, 0.16);

    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 28px;
    --radius-xl: 36px;

    --transition-fast: 160ms ease;
    --transition-normal: 240ms ease;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.portal-body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--text-primary);
    background:
        radial-gradient(circle at top left, color-mix(in srgb, var(--primary-color) 18%, transparent), transparent 34%),
        radial-gradient(circle at top right, rgba(14, 165, 233, 0.12), transparent 28%),
        linear-gradient(180deg, #f8fbff 0%, #f3f6fb 46%, #eef4ff 100%);
}

a {
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
}

.portal-background {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.portal-background__orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(24px);
    opacity: 0.55;
}

.portal-background__orb--one {
    top: -4rem;
    left: -3rem;
    width: 18rem;
    height: 18rem;
    background: color-mix(in srgb, var(--primary-color) 18%, transparent);
}

.portal-background__orb--two {
    top: 8rem;
    right: -4rem;
    width: 24rem;
    height: 24rem;
    background: rgba(6, 182, 212, 0.12);
}

.portal-background__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.32), transparent 72%);
}

.portal-shell {
    position: relative;
    z-index: 1;
    width: min(1440px, calc(100% - 32px));
    margin: 0 auto;
    padding: 20px 0 40px;
}

.portal-topbar {
    position: sticky;
    top: 16px;
    z-index: 10;
    margin-bottom: 24px;
}

.portal-topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 20px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.8);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.08);
}

.portal-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    min-width: 0;
}

.portal-brand__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 16px;
    color: #fff;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    background: linear-gradient(135deg, #0f172a 0%, var(--primary-color) 100%);
    box-shadow: 0 14px 30px color-mix(in srgb, var(--primary-color) 28%, transparent);
}

.portal-brand__text {
    display: flex;
    flex-direction: column;
}

.portal-brand__title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.portal-brand__subtitle {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.portal-nav {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px;
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.58);
}

.portal-nav__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 86px;
    padding: 11px 16px;
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.01em;
    white-space: nowrap;
    text-decoration: none;
    transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.portal-nav__link:hover,
.portal-nav__link:focus {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.92);
    transform: translateY(-1px);
}

.portal-topbar__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.portal-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.04);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
}

.portal-status__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.18);
}

.portal-account-menu {
    position: relative;
}

.portal-account-menu__summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 10px 6px 6px;
    border-radius: 18px;
    list-style: none;
    cursor: pointer;
    background: rgba(15, 23, 42, 0.04);
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.portal-account-menu__summary::-webkit-details-marker {
    display: none;
}

.portal-account-menu[open] .portal-account-menu__summary,
.portal-account-menu__summary:hover {
    background: color-mix(in srgb, var(--primary-color) 8%, transparent);
}

.portal-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: var(--primary-gradient);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 12px 24px color-mix(in srgb, var(--primary-color) 24%, transparent);
}

.portal-account-menu__meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.portal-account-menu__name {
    font-weight: 700;
    font-size: 0.92rem;
}

.portal-account-menu__role {
    color: var(--text-muted);
    font-size: 0.76rem;
}

.portal-account-menu__chevron {
    font-size: 1.1rem;
    line-height: 1;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.portal-account-menu[open] .portal-account-menu__chevron {
    transform: rotate(45deg);
}

.portal-account-menu__panel {
    position: absolute;
    right: 0;
    top: calc(100% + 12px);
    width: 220px;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-md);
}

.portal-account-menu__panel a {
    display: block;
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
}

.portal-account-menu__panel a:hover {
    background: color-mix(in srgb, var(--primary-color) 8%, transparent);
    color: var(--text-primary);
}

.portal-account-menu__logout {
    color: var(--danger-color);
}

.portal-main {
    min-height: calc(100vh - 220px);
}

.portal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 20px 6px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.portal-messages {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.alert-modern {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-radius: 20px;
    border: 1px solid transparent;
    box-shadow: var(--shadow-sm);
}

.alert-modern__content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.alert-modern__content strong {
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.alert-modern__dismiss {
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.6;
}

.alert-modern__dismiss:hover {
    opacity: 1;
}

.alert-success-modern,
.alert-success {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.2);
    color: #065f46;
}

.alert-danger-modern,
.alert-error-modern,
.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.18);
    color: #991b1b;
}

.alert-info-modern,
.alert-info {
    background: color-mix(in srgb, var(--primary-color) 10%, white);
    border-color: color-mix(in srgb, var(--primary-color) 14%, transparent);
    color: color-mix(in srgb, var(--primary-color) 72%, black);
}

.alert-warning-modern,
.alert-warning {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.18);
    color: #92400e;
}

.auth-container,
.dashboard-container {
    width: min(1360px, 100%);
    margin: 0 auto;
}

.auth-container {
    display: grid;
    place-items: center;
    min-height: calc(100vh - 180px);
    padding: 32px 16px 48px; /* Increased padding for better spacing */
}

.auth-card {
    width: min(540px, 100%); /* Slightly wider for better proportions */
    border-radius: 32px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-lg);
}

.auth-header {
    padding: 40px 36px 32px; /* Increased padding for better breathing room */
    text-align: center;
    color: #fff;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.16), transparent 28%),
        linear-gradient(135deg, #0f172a 0%, color-mix(in srgb, var(--primary-color) 55%, #0f172a) 48%, var(--primary-color) 100%);
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 20px; /* Increased from 16px */
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.auth-title {
    margin: 0 0 12px; /* Increased from 8px */
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.auth-subtitle {
    margin: 0;
    font-size: 0.98rem;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.4; /* Added line height for better readability */
}

.auth-body {
    padding: 36px 36px 40px; /* Increased padding significantly */
}

.auth-footer {
    padding: 24px 36px 32px; /* Increased padding */
    text-align: center;
    background: rgba(248, 250, 252, 0.82);
    border-top: 1px solid rgba(148, 163, 184, 0.14);
}

/* Enhanced spacing for checkbox section */
.auth-body .d-flex.justify-content-between {
    margin-bottom: 32px; /* Increased from mb-4 (16px) */
    padding: 16px 0; /* Added vertical padding */
}

.auth-body .form-check {
    margin-bottom: 0; /* Remove default margin */
}

.auth-body .form-check-label {
    font-size: 0.9rem; /* Slightly larger for better readability */
    color: var(--text-secondary);
    margin-left: 6px; /* Better spacing between checkbox and label */
}

.auth-body .text-decoration-none {
    font-size: 0.9rem; /* Consistent with checkbox label */
    padding: 4px 0; /* Better touch target */
}

/* Enhanced button spacing */
.btn-modern {
    padding: 14px 24px; /* Increased padding for better touch targets */
    font-size: 1rem; /* Slightly larger font */
    font-weight: 600;
    border-radius: 16px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px; /* Ensure adequate touch target size */
}

.btn-modern.btn-primary-modern {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--primary-color) 25%, transparent);
}

.btn-modern.btn-primary-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px color-mix(in srgb, var(--primary-color) 35%, transparent);
}

/* Enhanced spacing for the sign-in button */
.auth-body .btn-modern.w-100 {
    margin-bottom: 28px; /* Increased from mb-3 (12px) */
}

/* Better spacing for the "Don't have an account" section */
.auth-body .text-center {
    margin-top: 8px; /* Add some top margin */
    padding-top: 20px; /* Add padding for better separation */
    border-top: 1px solid rgba(148, 163, 184, 0.1); /* Subtle separator */
}

.auth-body .text-center p {
    font-size: 0.9rem; /* Slightly larger for better readability */
    line-height: 1.5; /* Better line height */
    margin-bottom: 0;
}

/* Styling for the new template classes */
.forgot-password-link {
    color: var(--primary-color);
    font-size: 0.9rem;
    transition: color var(--transition-fast);
}

.forgot-password-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.signup-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.signup-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.signup-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.copyright-text {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Mobile-specific login page improvements */
@media (max-width: 768px) {
    .auth-container {
        padding: 24px 12px 32px; /* Adjusted for mobile */
    }
    
    .auth-card {
        width: min(480px, 100%); /* Slightly smaller on mobile */
        border-radius: 24px; /* Smaller radius for mobile */
    }
    
    .auth-header {
        padding: 32px 24px 24px; /* Reduced padding for mobile */
    }
    
    .auth-title {
        font-size: 1.75rem; /* Slightly smaller for mobile */
        margin-bottom: 10px;
    }
    
    .auth-subtitle {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .auth-body {
        padding: 28px 24px 32px; /* Reduced padding for mobile */
    }
    
    .form-floating-custom {
        margin-bottom: 20px; /* Slightly reduced for mobile */
    }
    
    .form-control-modern,
    .form-floating-custom input {
        padding: 14px 16px; /* Reduced padding for mobile */
        font-size: 0.9rem;
    }
    
    .auth-body .d-flex.justify-content-between {
        margin-bottom: 24px; /* Reduced for mobile */
        padding: 12px 0;
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .auth-body .form-check {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .btn-modern {
        padding: 12px 20px;
        font-size: 0.95rem;
        min-height: 48px; /* iOS touch target minimum */
    }
    
    .auth-body .btn-modern.w-100 {
        margin-bottom: 24px; /* Reduced for mobile */
    }
    
    .auth-body .text-center {
        padding-top: 16px; /* Reduced for mobile */
        margin-top: 4px;
    }
    
    .auth-body .text-center p {
        font-size: 0.85rem;
    }
    
    .auth-footer {
        padding: 20px 24px 24px; /* Reduced for mobile */
    }
}

/* Small mobile adjustments */
@media (max-width: 480px) {
    .auth-container {
        padding: 20px 8px 24px;
    }
    
    .auth-card {
        width: 100%;
        border-radius: 20px;
    }
    
    .auth-header {
        padding: 24px 20px 20px;
    }
    
    .auth-title {
        font-size: 1.5rem;
    }
    
    .auth-body {
        padding: 24px 20px 28px;
    }
    
    .form-floating-custom {
        margin-bottom: 18px;
    }
    
    .auth-body .d-flex.justify-content-between {
        margin-bottom: 20px;
        padding: 10px 0;
    }
    
    .btn-modern {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    .auth-body .btn-modern.w-100 {
        margin-bottom: 20px;
    }
    
    .auth-body .text-center {
        padding-top: 12px;
    }
    
    .auth-footer {
        padding: 16px 20px 20px;
    }
}

.form-floating-custom {
    position: relative;
    margin-bottom: 24px; /* Increased from 18px for better spacing */
}

.form-floating-custom label {
    display: block;
    margin-bottom: 10px; /* Increased from 8px */
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 700;
}

.form-control-modern,
.form-select-modern,
.form-floating-custom input,
.form-floating-custom select,
.form-floating-custom textarea {
    width: 100%;
    padding: 16px 18px; /* Increased padding for better touch targets */
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text-primary);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
    font-size: 0.95rem; /* Slightly larger font for better readability */
}

.form-control-modern:focus,
.form-select-modern:focus,
.form-floating-custom input:focus,
.form-floating-custom select:focus,
.form-floating-custom textarea:focus,
.btn-modern:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--primary-color) 45%, transparent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary-color) 12%, transparent);
}

.form-control-modern::placeholder,
.form-floating-custom input::placeholder,
.form-floating-custom textarea::placeholder {
    color: #94a3b8;
}

.invalid-feedback {
    margin-top: 8px;
    color: #b91c1c;
    font-size: 0.82rem;
    font-weight: 600;
}

.is-invalid {
    border-color: rgba(220, 38, 38, 0.36) !important;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1) !important;
}

.btn-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 14px;
    border: 1px solid transparent;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.94rem;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
    cursor: pointer;
}

.btn-modern:hover {
    transform: translateY(-1px);
}

.btn-primary-modern {
    color: #fff;
    background: var(--primary-gradient);
    box-shadow: 0 14px 32px color-mix(in srgb, var(--primary-color) 24%, transparent);
}

.btn-primary-modern:hover {
    color: #fff;
    box-shadow: 0 18px 36px color-mix(in srgb, var(--primary-color) 30%, transparent);
}

.btn-outline-modern {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(148, 163, 184, 0.24);
}

.btn-outline-modern:hover {
    color: var(--text-primary);
    border-color: color-mix(in srgb, var(--primary-color) 20%, transparent);
    background: color-mix(in srgb, var(--primary-color) 5%, white);
}

.btn-success-modern {
    color: #fff;
    background: var(--success-gradient);
}

.btn-warning-modern {
    color: #fff;
    background: var(--warning-gradient);
}

.btn-danger-modern {
    color: #fff;
    background: var(--danger-gradient);
}

.btn-sm {
    padding: 8px 12px;
    font-size: 0.82rem;
}

.dashboard-container {
    padding: 6px 0 18px;
}

.dashboard-header,
.info-card,
.profile-header,
.stat-card,
.action-card,
.dashboard-hero {
    animation: surface-in 420ms ease both;
}

.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.9fr);
    gap: 24px;
    margin-bottom: 28px;
    padding: 28px;
    border-radius: 32px;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.14), transparent 32%),
        linear-gradient(135deg, #0f172a 0%, color-mix(in srgb, var(--primary-color) 30%, #0f172a) 38%, var(--primary-color) 100%);
    color: #fff;
    box-shadow: var(--shadow-lg);
}

.dashboard-hero__main {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.section-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-bottom: 14px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: inherit;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.welcome-title {
    margin: 0;
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2rem, 3vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.04em;
}

.welcome-subtitle {
    margin: 14px 0 0;
    max-width: 48rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    line-height: 1.7;
}

.dashboard-hero__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.dashboard-chip {
    display: inline-flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.82rem;
    font-weight: 600;
}

.dashboard-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
}

.dashboard-hero__panel {
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.08);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.hero-panel__eyebrow {
    color: rgba(255, 255, 255, 0.66);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-panel__score {
    margin-top: 10px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 3.25rem;
    font-weight: 700;
    line-height: 1;
}

.hero-panel__text {
    margin: 14px 0 0;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.7;
}

.hero-panel__list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.hero-panel__item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.92rem;
}

.hero-panel__item span {
    color: rgba(255, 255, 255, 0.72);
}

.hero-panel__item strong {
    color: #fff;
}

.dashboard-section {
    margin-bottom: 28px;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.section-heading--compact {
    margin-bottom: 18px;
}

.section-subtitle {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.section-title {
    margin: 0;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.search-results-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-results-count {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.dashboard-section .section-kicker,
.info-card .section-kicker {
    margin-bottom: 8px;
    background: color-mix(in srgb, var(--primary-color) 8%, transparent);
    color: var(--primary-color);
}

.stats-grid,
.action-grid,
.admin-tools-grid {
    display: grid;
    gap: 18px;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.action-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card,
.action-card,
.info-card,
.profile-header {
    border: 1px solid rgba(255, 255, 255, 0.84);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
}

.stat-card {
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, color-mix(in srgb, var(--primary-color) 6%, transparent), transparent 50%);
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
}

.stat-card:hover::after,
.action-card:hover::after {
    opacity: 1;
}

.stat-card:hover,
.action-card:hover,
.info-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
}

.stat-title {
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
}

.stat-value {
    margin-top: 8px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.stat-caption {
    margin: 10px 0 0;
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.6;
}

.stat-trend {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.stat-icon,
.action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 18px;
    color: #fff;
    background: var(--primary-gradient);
    box-shadow: 0 12px 24px color-mix(in srgb, var(--primary-color) 20%, transparent);
}

.stat-icon.success {
    background: var(--success-gradient);
    box-shadow: 0 12px 24px rgba(5, 150, 105, 0.2);
}

.stat-icon.warning {
    background: var(--warning-gradient);
    box-shadow: 0 12px 24px rgba(217, 119, 6, 0.22);
}

.stat-icon.danger {
    background: var(--danger-gradient);
    box-shadow: 0 12px 24px rgba(220, 38, 38, 0.22);
}

.action-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: 290px;
    padding: 22px;
    cursor: pointer;
    overflow: hidden;
}

.action-card::after {
    content: '';
    position: absolute;
    inset: auto -20% -35% auto;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--primary-color) 12%, transparent), transparent 62%);
    transition: opacity var(--transition-normal);
}

.action-card--primary {
    background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--primary-color) 14%, transparent), transparent 32%),
        rgba(255, 255, 255, 0.94);
}

.action-card__header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
}

.action-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.action-badge--muted {
    background: rgba(148, 163, 184, 0.14);
    color: #475569;
}

.action-badge--secure {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.action-title {
    margin: 0;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.action-description {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.7;
}

.action-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    color: var(--primary-color);
    font-weight: 700;
}

.action-arrow {
    font-size: 1.2rem;
    transition: transform var(--transition-fast);
}

.action-card:hover .action-arrow {
    transform: translateX(4px);
}

.dashboard-section--split {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.9fr);
    gap: 18px;
}

.dashboard-side-stack {
    display: grid;
    gap: 18px;
}

.info-card {
    padding: 22px;
}

.info-card--admin {
    background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--primary-color) 10%, transparent), transparent 28%),
        rgba(255, 255, 255, 0.92);
}

.timeline-list,
.checklist,
.status-list,
.info-list {
    display: grid;
    gap: 14px;
}

.timeline-item,
.checklist-item,
.status-item,
.info-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding-top: 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.timeline-item:first-child,
.checklist-item:first-child,
.status-item:first-child,
.info-item:first-child {
    border-top: 0;
    padding-top: 0;
}

.timeline-item__icon--create {
    background: var(--success-gradient);
    color: white;
}

.timeline-item__icon--delete {
    background: var(--danger-gradient);
    color: white;
}

.timeline-item__icon--update {
    background: var(--warning-gradient);
    color: white;
}

.timeline-item__icon--generic {
    background: var(--primary-gradient);
    color: white;
}

.timeline-item__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
    min-width: 120px;
}

.timeline-item__type {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.timeline-item time {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.timeline-item__icon,
.checklist-item__status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--primary-color) 10%, white);
    color: var(--primary-color);
    font-weight: 800;
}

.timeline-item__body h3,
.checklist-item h3,
.status-title {
    margin: 0;
    font-size: 0.96rem;
    font-weight: 700;
}

.timeline-item__body p,
.checklist-item p,
.status-text {
    margin: 6px 0 0;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.6;
}

.timeline-item time {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.timeline-item--unread .timeline-item__icon {
    background: color-mix(in srgb, var(--primary-color) 14%, white);
    color: var(--primary-color);
}

.timeline-item--unread .timeline-item__body h3 {
    color: var(--text-primary);
}

.stat-card--accent {
    background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--primary-color) 12%, transparent), transparent 40%),
        rgba(255, 255, 255, 0.9);
}

.status-indicator {
    width: 12px;
    height: 12px;
    margin-top: 6px;
    border-radius: 50%;
    flex: 0 0 12px;
}

.status-indicator.success {
    background: #10b981;
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.12);
}

.status-indicator.warning {
    background: #f59e0b;
    box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.14);
}

.admin-tools-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.access-workspace {
    display: grid;
    gap: 24px;
}

.access-workspace__section {
    scroll-margin-top: 110px;
}

.access-admin-card {
    padding: 28px;
    overflow: hidden;
}

.access-user-list,
.access-membership-list {
    display: grid;
    gap: 14px;
}

.access-user-row,
.access-membership-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.2);
    width: 100%;
    box-sizing: border-box;
}

.access-membership-row {
    grid-template-columns: minmax(0, 1.6fr) minmax(220px, auto);
}

.access-user-row__identity,
.access-membership-row__identity {
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.access-user-row__name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.access-user-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.access-user-badge--super {
    background: var(--danger-gradient);
    color: white;
}

.access-user-badge--admin {
    background: var(--primary-gradient);
    color: white;
}

.access-user-email {
    color: var(--text-muted);
    font-size: 0.92rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.access-user-status {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 8px;
}

.access-user-status--inactive {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-muted);
}

.access-household-card__title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.access-household-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.access-household-badge--active {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
}

.access-household-badge--inactive {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-muted);
}

.access-household-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.access-household-activity small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.access-household-grid {
    display: grid;
    gap: 18px;
}

.access-user-row__meta,
.access-household-card__description {
    color: var(--text-muted);
    font-size: 0.92rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.access-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
    justify-content: flex-start;
}

.access-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.access-checkbox--tight {
    white-space: nowrap;
}

.access-user-row__actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(200px, 1fr) auto;
    gap: 8px;
    align-items: center;
    width: 100%;
}

.access-user-row__actions input {
    min-height: 42px;
    min-width: 0;
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.88);
}

.access-search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
    margin-bottom: 14px;
}

.access-search-form input {
    min-height: 46px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.88);
    padding: 0 12px;
}

.access-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.access-summary-tile {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.72);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.access-summary-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.access-summary-tile__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    color: #fff;
    flex-shrink: 0;
}

.access-summary-tile--admin .access-summary-tile__icon {
    background: var(--primary-gradient);
}

.access-summary-tile--finance .access-summary-tile__icon {
    background: var(--success-gradient);
}

.access-summary-tile--access .access-summary-tile__icon {
    background: var(--warning-gradient);
}

.access-summary-tile--pending .access-summary-tile__icon {
    background: var(--text-muted);
}

.access-summary-tile--alert .access-summary-tile__icon {
    background: var(--danger-gradient);
    animation: pulse-gentle 2s infinite;
}

.access-summary-tile__content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.access-summary-tile span {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.access-summary-tile strong {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Space Grotesk', sans-serif;
}

.access-summary-tile small {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

@keyframes pulse-gentle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.access-feature-list {
    display: grid;
    gap: 12px;
}

.access-feature-card {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.72);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.access-feature-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.access-feature-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.access-feature-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    font-size: 0.85rem;
}

.access-feature-card__meta span {
    color: var(--text-muted);
}

.access-feature-card__meta strong {
    color: var(--text-primary);
    font-weight: 600;
}

.access-approval-actions {
    display: grid;
    gap: 8px;
}

.notification-filter-card {
    margin-bottom: 16px;
}

.notification-preset-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.notification-preset-row form {
    margin: 0;
}

.notification-save-preset-form,
.notification-preset-rename-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.notification-save-preset-form input[type='text'],
.notification-preset-rename-form input[type='text'] {
    min-height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.88);
    padding: 0 10px;
    min-width: 250px;
}

.notification-filter-form {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 10px;
}

.notification-filter-form select,
.notification-filter-form input {
    min-height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.88);
    padding: 0 10px;
}

.notification-pagination {
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.notification-pagination__actions {
    display: flex;
    gap: 8px;
}

.access-compact-form,
.access-inline-form,
.access-membership-row__controls {
    display: grid;
    gap: 12px;
}

.access-household-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.access-household-card {
    display: grid;
    gap: 18px;
}

.access-household-card__top {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 16px;
}

.access-household-invite {
    display: grid;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.access-inline-form {
    grid-template-columns: minmax(0, 1.1fr) minmax(140px, 0.6fr) auto;
    align-items: center;
}

.form-field-modern {
    display: grid;
    gap: 8px;
}

.form-field-modern label {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.form-field-modern input,
.form-field-modern textarea,
.access-inline-form select,
.access-membership-row__controls select {
    min-height: 46px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: none;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 24px;
    margin-bottom: 20px;
}

.profile-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 86px;
    height: 86px;
    flex: 0 0 86px;
    border-radius: 26px;
    background: var(--primary-gradient);
    color: #fff;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    box-shadow: 0 18px 36px color-mix(in srgb, var(--primary-color) 24%, transparent);
}

.profile-info h2 {
    margin: 0 0 6px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.profile-info p {
    margin: 0;
    color: var(--text-secondary);
}

.badge-modern {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.badge-primary {
    background: color-mix(in srgb, var(--primary-color) 12%, white);
    color: var(--primary-color);
}

.badge-success {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
}

.info-item {
    justify-content: space-between;
}

.info-label {
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 700;
}

.info-value {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: right;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.theme-card {
    display: block;
    text-decoration: none;
    color: inherit;
}

.theme-card input[type="radio"] {
    display: none;
}

.theme-option {
    position: relative;
}

.theme-option.active::before {
    content: 'Selected';
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 1;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.16);
    color: #065f46;
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
}

.theme-preview {
    min-height: 138px;
    padding: 18px;
    border-radius: 22px;
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.preview-content h4 {
    margin: 0 0 8px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.2rem;
}

.preview-content p {
    margin: 0 0 12px;
    max-width: 28ch;
    opacity: 0.88;
}

.color-samples {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.color-sample {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.78);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.1);
}

.password-strength {
    margin-top: 10px;
}

.strength-bar {
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.2);
}

.strength-fill {
    height: 100%;
    transition: width var(--transition-normal);
}

.strength-fill.strength-weak {
    background: #ef4444;
}

.strength-fill.strength-fair {
    background: #f59e0b;
}

.strength-fill.strength-good {
    background: #22c55e;
}

.strength-fill.strength-strong {
    background: #0ea5e9;
}

.strength-text {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.tooltip-modern {
    position: absolute;
    z-index: 1000;
    padding: 8px 10px;
    border-radius: 10px;
    background: #0f172a;
    color: #fff;
    font-size: 0.76rem;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity var(--transition-fast), transform var(--transition-fast);
    pointer-events: none;
}

.tooltip-modern.show {
    opacity: 1;
    transform: translateY(0);
}

.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.9;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.d-block {
    display: block !important;
}

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

@keyframes surface-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bootstrap harmonization for templates that still use Bootstrap classes. */
.portal-main .card {
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(255, 255, 255, 0.82);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow-sm);
}

.portal-main .card-header,
.portal-main .card-footer {
    background: rgba(248, 250, 252, 0.7);
    border-color: rgba(148, 163, 184, 0.18);
}

.portal-main .table {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(99, 102, 241, 0.04);
    --bs-table-hover-bg: rgba(99, 102, 241, 0.07);
    color: var(--text-primary);
}

.portal-main .table > :not(caption) > * > * {
    border-bottom-color: rgba(148, 163, 184, 0.2);
}

.portal-main .btn {
    border-radius: 14px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.portal-main .btn-primary {
    border: 0;
    background: var(--primary-gradient);
    box-shadow: 0 8px 22px color-mix(in srgb, var(--primary-color) 24%, transparent);
}

.portal-main .btn-primary:hover,
.portal-main .btn-primary:focus {
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
}

.portal-main .btn-outline-primary,
.portal-main .btn-outline-secondary {
    border-color: rgba(99, 102, 241, 0.28);
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.72);
}

.portal-main .btn-outline-primary:hover,
.portal-main .btn-outline-secondary:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(79, 70, 229, 0.4);
}

.portal-main .form-control,
.portal-main .form-select,
.portal-main input[type='text'],
.portal-main input[type='email'],
.portal-main input[type='password'],
.portal-main input[type='number'],
.portal-main input[type='date'],
.portal-main textarea,
.portal-main select {
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(255, 255, 255, 0.86);
}

.portal-main .form-control:focus,
.portal-main .form-select:focus,
.portal-main input:focus,
.portal-main textarea:focus,
.portal-main select:focus {
    border-color: rgba(79, 70, 229, 0.65);
    box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.14);
}

@media (max-width: 1200px) {
    .stats-grid,
    .action-grid,
    .admin-tools-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-section--split,
    .dashboard-hero,
    .access-household-grid,
    .access-summary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .portal-topbar__inner {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .portal-nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
    }

    .portal-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 768px) {
    .portal-shell {
        width: min(100% - 20px, 1440px);
        padding-top: 12px;
    }

    .portal-topbar {
        top: 10px;
    }

    .portal-topbar__inner,
    .dashboard-hero,
    .auth-body,
    .auth-header,
    .auth-footer,
    .info-card,
    .profile-header {
        padding-left: 18px;
        padding-right: 18px;
    }

    .stats-grid,
    .action-grid,
    .admin-tools-grid {
        grid-template-columns: 1fr;
    }

    .access-user-row,
    .access-membership-row,
    .access-inline-form,
    .access-search-form,
    .notification-filter-form {
        grid-template-columns: 1fr;
    }

    .access-user-row__actions {
        min-width: 0;
        grid-template-columns: 1fr;
    }

    .notification-pagination {
        flex-direction: column;
        align-items: flex-start;
    }

    .notification-save-preset-form input[type='text'],
    .notification-preset-rename-form input[type='text'] {
        min-width: 0;
        width: 100%;
    }

    .access-feature-card__top,
    .access-feature-card__meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .timeline-item,
    .checklist-item,
    .status-item,
    .info-item,
    .profile-header {
        flex-direction: column;
    }

    .timeline-item time,
    .info-value {
        text-align: left;
        margin-left: 0;
    }

    .dashboard-hero__actions,
    .dashboard-hero__chips,
    .portal-topbar__actions {
        width: 100%;
    }

    .dashboard-hero__actions .btn-modern,
    .portal-topbar__actions .btn-modern {
        width: 100%;
    }

    .portal-account-menu {
        width: 100%;
    }

    .portal-account-menu__summary {
        width: 100%;
        justify-content: space-between;
    }

    .portal-account-menu__panel {
        left: 0;
        right: 0;
        width: 100%;
    }

    .auth-card {
        border-radius: 24px;
    }
}
