/* Portal Dashboard CSS — Design Refresh v2 · March 2026 */
/* Premium dashboard: warm neutrals, generous whitespace, 8px grid, bento-inspired layout */

:root {
    /* ═══ Design System Colors — MANDATORY ═══ */
    --color-primary: #1A365D;
    --color-primary-navy: #1A365D;
    --color-primary-dark: #122647;
    --color-primary-light: #E8EDF5;
    --color-secondary: #1F7063;
    --color-secondary-teal: #1F7063;
    --color-teal: #1F7063;
    --color-teal-light: rgba(31, 112, 99, 0.06);
    --color-teal-medium: rgba(31, 112, 99, 0.12);
    --color-hover-navy: #122647;
    --color-hover-teal: #19604F;
    --color-gold: #FBBF24;

    /* Neutrals — warmer palette */
    --color-white: #FFFFFF;
    --color-bg-white: #FFFFFF;
    --color-bg-surface: #F7F5F2;
    --color-bg-warm: #FAF8F5;
    --color-gray-50: #FAFAF8;
    --color-gray-100: #F3F2EF;
    --color-gray-200: #E5E4E0;
    --color-border-grey: #E2E0DC;
    --color-gray-300: #D1D0CC;
    --color-gray-400: #9CA3AF;
    --color-text-primary: #1E293B;
    --color-text-secondary: #596577;
    --color-text-muted: #94A3B8;
    --color-gray-600: #4B5563;
    --color-gray-700: #374151;
    --color-gray-900: #111827;

    /* Status */
    --color-success: #22C55E;
    --color-success-light: #DCFCE7;
    --color-warning: #F59E0B;
    --color-error: #DC2626;
    --color-info: #3B82F6;

    /* Spacing — 8px grid */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-2xl: 24px;

    /* Shadows — softer, more diffused */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.03), 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.03);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.03);
    --shadow-xl: 0 12px 40px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.03);
    --shadow-card-hover: 0 8px 24px rgba(0,0,0,0.07), 0 2px 6px rgba(0,0,0,0.04);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Layout */
    --sidebar-width: 260px;
    --topnav-height: 64px;
    --mobile-bottom-nav-height: 64px;
}

/* ═══ Reset ═══ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--color-bg-surface);
    color: var(--color-gray-900);
    line-height: 1.6;
}

/* ═══ Scroll-reveal animations ═══ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(31, 112, 99, 0.25); }
    50% { box-shadow: 0 0 0 6px rgba(31, 112, 99, 0); }
}
@keyframes spin { to { transform: rotate(360deg); } }

.dashboard-content > * {
    animation: fadeInUp 0.5s var(--transition-base) both;
}
.dashboard-content > :nth-child(1) { animation-delay: 0s; }
.dashboard-content > :nth-child(2) { animation-delay: 0.08s; }
.dashboard-content > :nth-child(3) { animation-delay: 0.16s; }

.dashboard-main > * {
    animation: fadeInUp 0.45s var(--transition-base) both;
}
.dashboard-main > :nth-child(1) { animation-delay: 0.1s; }
.dashboard-main > :nth-child(2) { animation-delay: 0.18s; }
.dashboard-main > :nth-child(3) { animation-delay: 0.26s; }

.dashboard-sidebar > * {
    animation: slideInRight 0.45s var(--transition-base) both;
}
.dashboard-sidebar > :nth-child(1) { animation-delay: 0.15s; }
.dashboard-sidebar > :nth-child(2) { animation-delay: 0.22s; }
.dashboard-sidebar > :nth-child(3) { animation-delay: 0.29s; }
.dashboard-sidebar > :nth-child(4) { animation-delay: 0.36s; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ═══════════════════════════════════════════════
   TOP NAVIGATION — clean, minimal
   ═══════════════════════════════════════════════ */
.top-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topnav-height);
    background: var(--color-white);
    border-bottom: 1px solid var(--color-gray-200);
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,0.92);
}

.top-nav-content {
    max-width: 100%;
    height: 100%;
    padding: 0 var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-link { display: flex; align-items: center; }
.site-logo { height: 44px; width: auto; }

.top-nav-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

.hamburger-line {
    width: 22px; height: 2px;
    background: var(--color-gray-700);
    border-radius: 2px;
    transition: var(--transition-base);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.user-email {
    font-size: 13px;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.btn-logout {
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.btn-logout:hover {
    border-color: var(--color-error);
    color: var(--color-error);
    background: rgba(220, 38, 38, 0.04);
}

/* ═══════════════════════════════════════════════
   SIDEBAR — refined navigation
   ═══════════════════════════════════════════════ */
.portal-container {
    display: flex;
    margin-top: var(--topnav-height);
    min-height: calc(100vh - var(--topnav-height));
}

.sidebar {
    position: fixed;
    left: 0;
    top: var(--topnav-height);
    width: var(--sidebar-width);
    height: calc(100vh - var(--topnav-height));
    background: var(--color-white);
    border-right: 1px solid var(--color-gray-200);
    overflow-y: auto;
    padding: var(--space-md) 0;
    z-index: 40;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 var(--space-sm); }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-md);
    margin: 0 4px;
}

.nav-item:hover {
    background: var(--color-gray-50);
    color: var(--color-text-primary);
}

.nav-item.active {
    background: var(--color-teal-light);
    color: var(--color-teal);
    font-weight: 600;
    border-right: none;
}

.nav-icon { width: 20px; height: 20px; flex-shrink: 0; opacity: 0.7; }
.nav-item:hover .nav-icon,
.nav-item.active .nav-icon { opacity: 1; }

.nav-divider {
    height: 1px;
    background: var(--color-gray-100);
    margin: var(--space-sm) var(--space-md);
}

/* ═══════════════════════════════════════════════
   MAIN CONTENT AREA
   ═══════════════════════════════════════════════ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: var(--space-xl) var(--space-xl) var(--space-3xl);
    max-width: 1200px;
}

/* ═══════════════════════════════════════════════
   LOADING STATE (skeleton)
   ═══════════════════════════════════════════════ */
.loading-state {
    padding: var(--space-3xl) var(--space-2xl);
}

.skeleton-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
}

.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.skeleton {
    background: linear-gradient(90deg, var(--color-gray-100) 25%, var(--color-gray-50) 50%, var(--color-gray-100) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

.skeleton-circle-large {
    width: 56px; height: 56px;
    border-radius: 50%;
    margin-bottom: var(--space-md);
}

.skeleton-title {
    height: 20px;
    width: 60%;
    margin-bottom: var(--space-sm);
}

.skeleton-title.short { width: 40%; }

.skeleton-text {
    height: 14px;
    width: 80%;
}

.spinner {
    width: 48px; height: 48px;
    border: 3px solid var(--color-gray-200);
    border-top-color: var(--color-teal);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto var(--space-md);
}

/* ═══════════════════════════════════════════════
   CARD BASE — elevated, warm
   ═══════════════════════════════════════════════ */
.card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(0,0,0,0.04);
    transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-card-hover);
}

/* ═══════════════════════════════════════════════
   WELCOME SECTION — Premium hero with gradient
   ═══════════════════════════════════════════════ */
.welcome-section {
    background: linear-gradient(135deg, #1A365D 0%, #234876 40%, #1F7063 100%);
    border-radius: var(--radius-xl);
    padding: var(--space-xl) var(--space-xl);
    margin-bottom: var(--space-lg);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(26, 54, 93, 0.2);
}

/* Subtle decorative pattern */
.welcome-section::before {
    content: '';
    position: absolute;
    top: -40%; right: -10%;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.welcome-section::after {
    content: '';
    position: absolute;
    bottom: -30%; left: 10%;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(31,112,99,0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.welcome-greeting {
    font-size: 26px;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 6px;
    line-height: 1.25;
    position: relative;
    z-index: 1;
    letter-spacing: -0.01em;
}

.welcome-stage-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    position: relative;
    z-index: 1;
}

.welcome-stage-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    color: #FFFFFF;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.12);
}

.welcome-stage-name {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
}

/* Progress bar in welcome */
.welcome-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: var(--space-lg);
    position: relative;
    z-index: 1;
}

.welcome-progress-bar {
    flex: 1;
    max-width: 280px;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    overflow: hidden;
}

.welcome-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #34D399, #A7F3D0);
    border-radius: 3px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.welcome-progress-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    font-weight: 500;
}

.welcome-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 36px !important;
    background: #FFFFFF !important;
    color: #1A365D !important;
    border: none !important;
    border-radius: 12px !important;
    font-size: 16px !important;
    font-weight: 700;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    z-index: 1;
    min-height: 56px;
    letter-spacing: -0.01em;
    box-shadow: 0 4px 14px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.08) !important;
    line-height: 1;
}

.welcome-cta:hover {
    background: #F0FDFA !important;
    color: #1F7063 !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2), 0 2px 6px rgba(0,0,0,0.1) !important;
}

.welcome-cta svg {
    width: 18px;
    height: 18px;
    transition: transform var(--transition-fast);
    stroke-width: 2.5;
}

.welcome-cta:hover svg {
    transform: translateX(3px);
}

/* ═══════════════════════════════════════════════
   TWO-COLUMN DASHBOARD LAYOUT
   ═══════════════════════════════════════════════ */
.dashboard-two-col {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: var(--space-lg);
    align-items: start;
}

.dashboard-main { display: flex; flex-direction: column; gap: var(--space-lg); }
.dashboard-sidebar { display: flex; flex-direction: column; gap: var(--space-lg); }

/* ═══════════════════════════════════════════════
   WIDGET TITLES — consistent pattern
   ═══════════════════════════════════════════════ */
.widget-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.widget-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-primary);
    margin: 0;
    letter-spacing: -0.01em;
}

.widget-action {
    font-size: 13px;
    color: var(--color-teal);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.widget-action:hover {
    color: var(--color-hover-teal);
}

/* ═══════════════════════════════════════════════
   NEXT ACTIONS WIDGET — clean, interactive
   ═══════════════════════════════════════════════ */
.next-actions-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.next-action-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: 14px var(--space-md);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: var(--color-gray-50);
    transition: var(--transition-fast);
    cursor: pointer;
}

.next-action-item:hover {
    border-color: var(--color-teal);
    background: var(--color-teal-light);
    transform: translateX(2px);
}

.next-action-item.completed {
    opacity: 0.55;
    background: var(--color-success-light);
}

.next-action-checkbox {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--color-gray-300);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
    transition: var(--transition-fast);
}

.next-action-item:hover .next-action-checkbox {
    border-color: var(--color-teal);
}

.next-action-item.completed .next-action-checkbox {
    border-color: var(--color-success);
    background: var(--color-success);
}

.next-action-checkbox svg {
    width: 12px;
    height: 12px;
    stroke: white;
    opacity: 0;
}

.next-action-item.completed .next-action-checkbox svg {
    opacity: 1;
}

.next-action-text h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 2px;
    line-height: 1.4;
}

.next-action-item.completed .next-action-text h4 {
    text-decoration: line-through;
    color: var(--color-text-muted);
}

.next-action-text p {
    font-size: 13px;
    color: var(--color-text-secondary);
    line-height: 1.4;
}

.next-action-item.completed .next-action-text p {
    text-decoration: line-through;
    color: var(--color-text-muted);
}

/* ═══════════════════════════════════════════════
   JOURNEY STEPPER — enhanced visual
   ═══════════════════════════════════════════════ */
.journey-stepper-card {
    padding: var(--space-lg);
}

.journey-stepper-card .widget-title {
    margin-bottom: var(--space-lg);
}

.journey-stepper {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
    padding: 0 8px;
}

.journey-stepper::before {
    content: '';
    position: absolute;
    top: 17px;
    left: 28px;
    right: 28px;
    height: 3px;
    background: var(--color-gray-200);
    border-radius: 2px;
    z-index: 0;
}

.journey-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    z-index: 1;
    text-decoration: none;
    cursor: pointer;
}

.journey-step-dot {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
    transition: var(--transition-spring);
    border: 2px solid var(--color-gray-300);
    background: var(--color-white);
    color: var(--color-gray-400);
}

.journey-step.future .journey-step-dot {
    border-color: var(--color-gray-200);
    background: var(--color-white);
    color: var(--color-gray-400);
}

.journey-step.current .journey-step-dot {
    border-color: var(--color-teal);
    background: var(--color-teal);
    color: var(--color-white);
    box-shadow: 0 0 0 5px rgba(31, 112, 99, 0.12);
    animation: pulseGlow 2.5s ease-in-out infinite;
}

.journey-step.completed .journey-step-dot {
    border-color: var(--color-success);
    background: var(--color-success);
    color: var(--color-white);
}

.journey-step-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-muted);
    text-align: center;
    max-width: 80px;
    line-height: 1.3;
    transition: var(--transition-fast);
}

.journey-step.current .journey-step-label {
    color: var(--color-teal);
    font-weight: 600;
}

.journey-step.completed .journey-step-label {
    color: var(--color-success);
}

.journey-step:hover .journey-step-label {
    color: var(--color-primary);
}

.journey-step:hover .journey-step-dot {
    transform: scale(1.12);
    box-shadow: var(--shadow-md);
}

/* ═══════════════════════════════════════════════
   QUICK TOOLS GRID — bento-inspired
   ═══════════════════════════════════════════════ */
.quick-tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 16px 20px !important;
    background: var(--color-white) !important;
    border: 1px solid #E5E4E0 !important;
    border-radius: 14px !important;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;
}

.tool-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 60%, rgba(31, 112, 99, 0.03));
    opacity: 0;
    transition: opacity var(--transition-base);
    pointer-events: none;
}

.tool-card:hover {
    border-color: #1F7063 !important;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.07), 0 2px 6px rgba(0,0,0,0.04) !important;
}

.tool-card:hover::after {
    opacity: 1;
}

.tool-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #E8EDF5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1A365D;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.tool-card:hover .tool-card-icon {
    background: var(--color-teal);
    color: var(--color-white);
    transform: scale(1.05);
}

.tool-card-icon svg {
    width: 22px;
    height: 22px;
}

.tool-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #1E293B;
    line-height: 1.35;
}

.tool-card-desc {
    font-size: 12px;
    color: #94A3B8;
    line-height: 1.35;
    margin-top: -2px;
}

/* ═══════════════════════════════════════════════
   SIDEBAR WIDGETS
   ═══════════════════════════════════════════════ */

/* Stat Summary — refined */
.stat-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.stat-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px var(--space-sm);
    background: var(--color-bg-warm);
    border-radius: var(--radius-md);
    text-align: center;
    transition: var(--transition-fast);
}

.stat-mini:hover {
    background: var(--color-teal-light);
}

.stat-mini-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.stat-mini-label {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-top: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-mini.stat-highlight .stat-mini-value {
    color: var(--color-teal);
}

/* Knowledge Spotlight — warm card */
.knowledge-spotlight {
    background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
    border: 1px solid #FDE68A;
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
}

.knowledge-spotlight::after {
    content: '';
    position: absolute;
    top: -20px; right: -20px;
    width: 80px; height: 80px;
    background: radial-gradient(circle, rgba(251,191,36,0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.spotlight-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.spotlight-icon {
    font-size: 20px;
}

.spotlight-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-primary);
}

.spotlight-content {
    font-size: 14px;
    color: var(--color-gray-700);
    line-height: 1.55;
    margin-bottom: var(--space-md);
}

.spotlight-link {
    font-size: 13px;
    color: var(--color-teal);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.spotlight-link:hover {
    color: var(--color-hover-teal);
}

/* Community Preview */
.community-preview-card .widget-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.community-posts {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.community-post {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    cursor: pointer;
}

.community-post:hover {
    background: var(--color-gray-50);
}

.community-post-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 2px;
    line-height: 1.4;
}

.community-post-meta {
    font-size: 12px;
    color: var(--color-text-muted);
}

.community-cta {
    display: block;
    text-align: center;
    padding: 10px;
    margin-top: var(--space-sm);
    background: var(--color-teal-light);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-teal);
    text-decoration: none;
    transition: var(--transition-fast);
}

.community-cta:hover {
    background: var(--color-teal-medium);
}

/* ═══════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════ */
.btn-primary {
    padding: 12px 24px;
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-primary:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    padding: 12px 24px;
    background: var(--color-white);
    color: var(--color-gray-700);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-fast);
}

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

.btn-sm { padding: 8px 16px; font-size: 13px; }

/* ═══════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: var(--space-xl);
    color: var(--color-text-muted);
}

.empty-state svg {
    opacity: 0.2;
    margin-bottom: var(--space-sm);
    width: 32px;
    height: 32px;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: var(--space-sm);
}

/* ═══════════════════════════════════════════════
   MOBILE BOTTOM NAVIGATION
   ═══════════════════════════════════════════════ */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--mobile-bottom-nav-height);
    background: var(--color-white);
    border-top: 1px solid var(--color-gray-200);
    z-index: 100;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}

.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-decoration: none;
    color: var(--color-gray-600);
    font-size: 11px;
    font-weight: 500;
    padding: var(--space-sm);
    transition: var(--transition-fast);
}

.mobile-nav-item.active { color: var(--color-teal); }
.mobile-nav-item svg { width: 22px; height: 22px; }

/* ═══════════════════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════════════════ */
*:focus-visible {
    outline: 2px solid var(--color-teal);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE: TABLET (<=1024px)
   ═══════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .dashboard-two-col {
        grid-template-columns: 1fr;
    }

    .dashboard-sidebar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-md);
    }

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

    .journey-stepper-card {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE: MOBILE (<=767px)
   ═══════════════════════════════════════════════ */
@media (max-width: 767px) {
    :root {
        --sidebar-width: 0;
    }

    .site-logo { height: 38px; }
    .mobile-menu-toggle { display: flex; }
    .user-email { display: none; }

    .sidebar {
        display: block !important;  /* Override design-system display:none !important */
        transform: translateX(-100%);
        transition: transform var(--transition-base);
        width: 280px;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }

    .main-content {
        margin-left: 0;
        padding: var(--space-md);
        padding-bottom: calc(var(--mobile-bottom-nav-height) + var(--space-xl));
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Ensure all cards and sections fit within mobile viewport */
    .welcome-section,
    .card,
    .knowledge-spotlight,
    .ref-widget-card {
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }

    .dashboard-two-col,
    .dashboard-main,
    .dashboard-sidebar {
        max-width: 100%;
        min-width: 0;
    }

    .mobile-bottom-nav { display: flex; }

    /* Welcome section */
    .welcome-section {
        padding: var(--space-lg) 20px;
        border-radius: var(--radius-lg);
    }
    .welcome-greeting { font-size: 22px; }

    .welcome-stage-info {
        flex-wrap: wrap;
    }

    .welcome-cta {
        width: 100% !important;
        justify-content: center;
        padding: 16px 24px !important;
        font-size: 15px !important;
        box-sizing: border-box !important;
    }

    /* Knowledge spotlight — prevent text overflow on mobile */
    .knowledge-spotlight {
        overflow: hidden;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .spotlight-content {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }

    /* Referral widget — contain within viewport */
    .ref-widget-card {
        max-width: 100% !important;
        overflow: hidden;
    }

    .ref-widget-link-row {
        max-width: 100%;
    }

    .ref-widget-link-input {
        min-width: 0 !important;
        flex: 1 !important;
    }

    /* Two-column -> single column */
    .dashboard-two-col {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .dashboard-sidebar {
        display: flex;
        flex-direction: column;
        gap: var(--space-md);
    }

    /* Tools grid: 2 columns on mobile */
    .quick-tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .tool-card {
        padding: 20px 12px 16px !important;
    }

    /* Journey stepper: scrollable */
    .journey-stepper-card {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .journey-stepper {
        min-width: 560px;
        padding: 0 var(--space-sm);
    }

    .journey-step-label {
        font-size: 10px;
        max-width: 60px;
    }

    .journey-step-dot {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    /* Cards */
    .card {
        padding: var(--space-md);
        border-radius: var(--radius-md);
    }

    /* Stats — 2x2 grid on mobile for readability */
    .stat-summary {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px;
    }

    .stat-mini {
        padding: 12px 8px;
    }

    .stat-mini-value {
        font-size: 20px;
    }

    .stat-mini-label {
        font-size: 10px;
    }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE: VERY SMALL (<=375px)
   ═══════════════════════════════════════════════ */
@media (max-width: 375px) {
    .top-nav-content { padding: 0 var(--space-md); }

    .main-content {
        padding: 12px;
        padding-bottom: calc(var(--mobile-bottom-nav-height) + var(--space-md));
    }

    .welcome-greeting { font-size: 20px; }
    .welcome-section { padding: 20px 16px; }

    .stat-summary {
        grid-template-columns: 1fr 1fr;
    }
}

/* ═══════════════════════════════════════════════
   DESKTOP LARGE (>=1440px)
   ═══════════════════════════════════════════════ */
@media (min-width: 1440px) {
    .dashboard-two-col {
        grid-template-columns: 1fr 380px;
    }
}

/* ═══════════════════════════════════════════════
   STAGE NAVIGATION BUTTONS
   ═══════════════════════════════════════════════ */
.stage-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 40px 0 32px;
    margin-top: 48px;
    border-top: 2px solid #E5E4E0;
}

/* Base button — shared across all three */
.btn-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    cursor: pointer;
    min-height: 52px;
    border: none;
    position: relative;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-nav svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Previous Stage — ghost/outline style (tertiary) */
.btn-nav-prev {
    background: transparent;
    color: #4A5568;
    border: 1.5px solid #D1D5DB;
}

.btn-nav-prev:hover:not(:disabled) {
    background: #F7F7F5;
    border-color: #9CA3AF;
    color: #1A365D;
}

.btn-nav-prev:hover:not(:disabled) svg {
    transform: translateX(-3px);
}

.btn-nav-prev:active:not(:disabled) {
    transform: scale(0.98);
}

/* Back to Dashboard — subtle teal (secondary) */
.btn-nav-dashboard {
    background: rgba(45, 155, 135, 0.08);
    color: #2D9B87;
    border: 1.5px solid rgba(45, 155, 135, 0.25);
}

.btn-nav-dashboard:hover {
    background: rgba(45, 155, 135, 0.14);
    border-color: rgba(45, 155, 135, 0.4);
    color: #1F7063;
    box-shadow: 0 2px 8px rgba(45, 155, 135, 0.1);
}

.btn-nav-dashboard:active {
    transform: scale(0.98);
}

/* Next Stage — solid navy (primary action) */
.btn-nav-next {
    background: linear-gradient(135deg, #1A365D 0%, #234876 100%);
    color: #FFFFFF;
    box-shadow: 0 2px 6px rgba(26, 54, 93, 0.2), 0 1px 2px rgba(26, 54, 93, 0.1);
}

.btn-nav-next:hover:not(:disabled) {
    background: linear-gradient(135deg, #234876 0%, #2D5A8E 100%);
    box-shadow: 0 4px 12px rgba(26, 54, 93, 0.25), 0 2px 4px rgba(26, 54, 93, 0.15);
    transform: translateY(-1px);
    color: #FFFFFF;
}

.btn-nav-next:hover:not(:disabled) svg {
    transform: translateX(3px);
}

.btn-nav-next:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(26, 54, 93, 0.2);
}

/* Disabled state (Stage 1 prev, Stage 8 next) */
.btn-nav:disabled,
.btn-nav[disabled] {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
    transform: none;
}

/* Focus visible for keyboard navigation */
.btn-nav:focus-visible {
    outline: 2px solid #2D9B87;
    outline-offset: 2px;
}

/* Responsive: tablet and below */
@media (max-width: 768px) {
    .stage-navigation {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .btn-nav-prev,
    .btn-nav-next {
        flex: 1 1 auto;
        min-width: 0;
    }
    
    .btn-nav-dashboard {
        order: 3;
        width: 100%;
    }
    
    .btn-nav {
        padding: 14px 20px;
        font-size: 14px;
    }
}

/* Responsive: mobile */
@media (max-width: 480px) {
    .stage-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-nav-prev,
    .btn-nav-next {
        width: 100%;
    }
    
    .btn-nav-dashboard {
        order: 3;
    }
    
    .btn-nav {
        padding: 14px 24px;
        justify-content: center;
    }
}
