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

:root {
    --brand-navy: #1b365d;
    --brand-navy-2: #2a4a6b;
    --brand-pink: #ed6ba8;
    --brand-teal: #059f91;
    --surface: #ffffff;
    --shadow-1: rgba(16,24,40,0.06);
    --shadow-2: rgba(16,24,40,0.14);
}

html, body {
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background-color: #1b365d;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-logo a { display: inline-flex; align-items: center; text-decoration: none; }

.logo {
    height: 40px;
    width: auto;
}

.company-name {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-email {
    color: white;
    font-size: 0.9rem;
}

.logout-btn {
    color: #ed6ba8;
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid #ed6ba8;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background-color: #059f91;
    border-color: #059f91;
    color: white;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #1b365d 0%, #2a4a6b 100%);
    color: white;
    padding: 100px 0;
    text-align: center;
    flex: 1; /* Take up remaining space */
    display: flex;
    align-items: center;
}

.hero-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #ed6ba8;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Microsoft Login Button */
.auth-section {
    margin-top: 3rem;
}

.microsoft-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background-color: white;
    color: #1b365d;
    padding: 16px 32px;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.microsoft-login-btn:hover {
    background-color: #059f91;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.microsoft-icon {
    width: 20px;
    height: 20px;
}

/* Features Section */
.features-section {
    padding: 80px 0;
    background-color: white;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: #ed6ba8;
    margin-bottom: 3rem;
    font-weight: 600;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.feature-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #ed6ba8, #059f91);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.feature-icon svg {
    width: 32px;
    height: 32px;
}

.feature-card:hover {
    transform: translateY(-4px);
}

.feature-card h3 {
    color: #1b365d;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.feature-card p {
    color: #666;
    line-height: 1.6;
}

/* Dashboard */
.dashboard-main {
    flex: 1; /* Take up remaining space */
    padding: 60px 0;
}

.welcome-section {
    text-align: center;
    margin-bottom: 4rem;
}

.dashboard-title {
    font-size: 2.5rem;
    color: #ed6ba8;
    margin-bottom: 1rem;
    font-weight: 600;
}

.dashboard-subtitle {
    font-size: 1.1rem;
    color: #666;
}

/* Modules Section */
.modules-section {
    margin-top: 3rem;
}

/* Modules Grid (list of modules) */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.module-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 3rem;
}

.module-card.module-disabled {
    opacity: .65;
}

.module-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #f0f0f0;
}

.module-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    color: #ed6ba8;
    background: linear-gradient(135deg, #ed6ba8, #059f91);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.module-icon svg {
    width: 40px;
    height: 40px;
    color: white;
}

.module-header h2 {
    color: #1b365d;
    font-size: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.module-header p {
    color: #666;
    font-size: 1.1rem;
}

/* Resources Grid */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 0;
}

.resource-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    text-align: center;
    border: 1px solid #e9ecef;
}

.resource-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    background: white;
}

.resource-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    color: #ed6ba8;
}

.resource-icon svg {
    width: 100%;
    height: 100%;
}

.resource-card h3 {
    color: #1b365d;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.resource-card p {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Completion badge */
.completion-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .8rem;
    font-weight: 700;
    padding: .2rem .55rem;
    border-radius: 9999px;
    border: 1px solid transparent;
    line-height: 1.1;
}
.completion-badge.complete { background: rgba(34,197,94,0.12); color: #16a34a; border-color: #22c55e; }
.completion-badge.incomplete { background: rgba(239,68,68,0.12); color: #b91c1c; border-color: #ef4444; }

.resource-btn {
    background-color: #ed6ba8;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

.resource-btn:hover {
    background-color: #059f91;
    transform: translateY(-1px);
}

/* Global disabled buttons */
button:disabled,
.btn:disabled,
.btn.disabled,
.resource-btn:disabled,
.resource-btn.disabled,
[role="button"][aria-disabled="true"] {
    background-color: #94a3b8 !important; /* slate-400 */
    color: #ffffff !important;
    border-color: #94a3b8 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.9;
    pointer-events: none;
}

button:disabled:hover,
.btn:disabled:hover,
.btn.disabled:hover,
.resource-btn:disabled:hover,
.resource-btn.disabled:hover,
[role="button"][aria-disabled="true"]:hover {
    background-color: #94a3b8 !important;
    transform: none !important;
}

/* Footer */
.footer {
    background-color: #1b365d;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: auto;
}

.footer p {
    opacity: 0.8;
}

/* Breadcrumbs */
#breadcrumbs { font-size: 0.95rem; }
#breadcrumbs .crumb-link { color: #ed6ba8; text-decoration: none; font-weight: 600; }
#breadcrumbs .crumb-link:hover { color: #059f91; text-decoration: underline; }
#breadcrumbs .crumb-current { color: #1b365d; font-weight: 700; }
#breadcrumbs .crumb-sep { color: #b0bccf; margin: 0 .35rem; }

/* Responsive Design */
/* --- Modal (shared) --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 20% 10%, rgba(237,107,168,0.12), transparent 40%),
        radial-gradient(circle at 80% 90%, rgba(5,159,145,0.12), transparent 40%),
        rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1000;
    animation: modalFade .14s ease-out;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.modal-content {
    width: 100%;
    max-width: 1000px;
    background: var(--surface);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(27,54,93,0.08);
    box-shadow: 0 24px 60px var(--shadow-2), 0 8px 24px var(--shadow-1);
    animation: modalIn .16s cubic-bezier(.2,.8,.2,1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-navy-2) 100%);
    color: #fff;
    border-bottom: 2px solid rgba(237,107,168,0.45);
}

.modal-title {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: .2px;
}

.modal-close-btn {
    appearance: none;
    border: 1px solid transparent;
    color: #fff;
    background: var(--brand-pink);
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .03s ease;
    box-shadow: 0 1px 2px var(--shadow-1), 0 0 0 0 rgba(237,107,168,0.45);
}

.modal-close-btn:hover { background: var(--brand-teal); border-color: var(--brand-teal); }
.modal-close-btn:active { transform: translateY(1px); }
.modal-close-btn:focus { outline: none; box-shadow: 0 0 0 3px rgba(237,107,168,0.35); }

.modal-body {
    position: relative;
    background: #000;
    aspect-ratio: 16 / 9;
}

.modal-body iframe,
.modal-body video {
    width: 100%;
    height: 100%;
    display: block;
}

@keyframes modalFade { from { opacity: 0 } to { opacity: 1 } }
@keyframes modalIn { from { opacity: 0; transform: translateY(6px) scale(.98) } to { opacity: 1; transform: translateY(0) scale(1) } }

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .resources-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .dashboard-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .hero-container {
        padding: 0 15px;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .resource-card {
        padding: 1.5rem;
    }
    
    .microsoft-login-btn {
        padding: 14px 24px;
        font-size: 1rem;
    }
}

/* =====================
   Modern User Cards
   ===================== */

.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.user-card {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
    position: relative;
}

.user-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
    border-color: var(--brand-teal);
}

.user-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-navy), var(--brand-teal));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--brand-navy);
    margin: 0 0 0.25rem 0;
}

.user-email {
    color: #6b7280;
    font-size: 0.9rem;
    margin: 0;
}

.user-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-status-badge.active {
    background: rgba(5, 159, 145, 0.1);
    color: var(--brand-teal);
    border: 1px solid rgba(5, 159, 145, 0.2);
}

.user-status-badge.inactive {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.2);
}

.user-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1rem 0;
    padding: 1rem 0;
    border-top: 1px solid #f3f4f6;
    border-bottom: 1px solid #f3f4f6;
}

.user-stat {
    text-align: center;
}

.user-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-navy);
    margin: 0;
}

.user-stat-label {
    font-size: 0.8rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0.25rem 0 0 0;
}

.progress-ring {
    width: 40px;
    height: 40px;
    position: relative;
    margin: 0 auto 0.25rem;
}

.progress-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-ring circle {
    fill: transparent;
    stroke-width: 3;
    r: 16;
    cx: 20;
    cy: 20;
}

.progress-ring .progress-ring-bg {
    stroke: #e5e7eb;
}

.progress-ring .progress-ring-fill {
    stroke-dasharray: 100.53; /* 2 * π * 16 */
    stroke-dashoffset: 100.53;
    transition: stroke-dashoffset 0.5s ease-in-out;
}

.course-access {
    margin: 0.75rem 0;
}

.course-access-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.course-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.course-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid;
}

.course-badge.granted {
    background: rgba(5, 159, 145, 0.1);
    color: var(--brand-teal);
    border-color: rgba(5, 159, 145, 0.2);
}

.course-badge.denied {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
    border-color: rgba(107, 114, 128, 0.2);
}

.user-actions {
    display: flex;
    gap: 0.375rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.user-actions .btn {
    flex: 1;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    border-radius: 4px;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 24px;
}

.admin-toggle-btn {
    flex: 1 !important;
    padding: 0.25rem 0.5rem !important;
    border-radius: 4px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem !important;
    font-weight: 600;
    margin-left: 0 !important;
    min-height: 24px;
}

.admin-toggle-btn.admin-add {
    background: #10b981;
    color: white;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.admin-toggle-btn.admin-add:hover {
    background: #059669;
    transform: scale(1.05);
}

.admin-toggle-btn.admin-remove {
    background: #f59e0b;
    color: white;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.admin-toggle-btn.admin-remove:hover {
    background: #d97706;
    transform: scale(1.05);
}

.user-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
    font-size: 0.8rem;
    color: #6b7280;
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.4rem;
    background: linear-gradient(135deg, var(--brand-pink), #f472b6);
    color: white;
    border-radius: 10px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 1;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
    grid-column: 1 / -1;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.error-state {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
}

.error-state .empty-state-icon {
    color: #ef4444;
    opacity: 1;
}

/* User Dropdown Styles */
.user-dropdown-container {
    position: relative;
}

.user-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.user-dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.user-dropdown-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-navy), var(--brand-teal));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.user-dropdown-name {
    font-weight: 500;
}

.user-dropdown-arrow {
    transition: transform 0.2s ease;
}

.user-dropdown-container.open .user-dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
    min-width: 240px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.user-dropdown-container.open .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.user-dropdown-email {
    display: block;
    font-size: 0.875rem;
    color: #1e293b;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.user-dropdown-role {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.user-dropdown-divider {
    height: 1px;
    background: #f1f5f9;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #374151;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.user-dropdown-item:hover {
    background: #f8fafc;
    color: #1e293b;
}

.user-dropdown-item svg {
    width: 16px;
    height: 16px;
    color: #6b7280;
}

/* Responsive Design */
@media (max-width: 768px) {
    .users-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .user-card {
        padding: 1rem;
    }

    .user-actions {
        flex-direction: column;
    }

    .user-stats {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}
