/* ═══════════════════════════════════════════════════════════
   AI Training Platform — Stylesheet
   Aesthetic: Industrial-editorial. Dark slate. Sharp accents.
   Typography: DM Sans + Playfair Display + JetBrains Mono
   ═══════════════════════════════════════════════════════════ */

:root {
    --color-bg: #F6F5F2;
    --color-surface: #FFFFFF;
    --color-surface-raised: #FFFFFF;
    --color-text: #1A1A1A;
    --color-text-secondary: #555555;
    --color-muted: #8E8E8E;
    --color-border: #E0DDD8;
    --color-border-strong: #C5C0B8;
    --color-accent: #FF6600;
    --color-accent-hover: #E55A00;
    --color-success: #00875A;
    --color-warning: #C27200;
    --color-danger: #CC3340;
    --color-info: #FF6600;
    --color-dark: #1A1D23;
    --color-dark-secondary: #2A2D35;

    --font-body: 'DM Sans', -apple-system, sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --transition: 200ms ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
h1, h2, h3, h4, h5, h6 { line-height: 1.25; font-weight: 600; }
h1 { font-family: var(--font-display); font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }
a { color: var(--color-accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-accent-hover); }
code, pre { font-family: var(--font-mono); font-size: 0.875rem; }
code { background: #F0EDE8; padding: 0.15em 0.4em; border-radius: var(--radius-sm); }
pre { background: var(--color-dark); color: #E0E0E0; padding: 1.25rem; border-radius: var(--radius-md); overflow-x: auto; line-height: 1.5; }
pre code { background: none; padding: 0; color: inherit; }
img { max-width: 100%; height: auto; }

/* ── Top Navigation ─────────────────────────────────── */
.top-nav { background: var(--color-dark); color: #FFF; position: sticky; top: 0; z-index: 100; border-bottom: 3px solid var(--color-accent); }
.nav-inner { max-width: 1400px; margin: 0 auto; padding: 0 2rem; height: 56px; display: flex; align-items: center; justify-content: space-between; }
.nav-brand { display: flex; align-items: center; gap: 0.6rem; color: #FFF; font-weight: 700; font-size: 1rem; letter-spacing: 0.03em; text-transform: uppercase; }
.brand-icon { color: var(--color-accent); font-size: 1.2rem; }
.brand-icon.large { font-size: 3rem; }
.nav-links { display: flex; align-items: center; gap: 0.25rem; }
.nav-link { color: rgba(255,255,255,0.7); padding: 0.4rem 0.75rem; border-radius: var(--radius-sm); font-size: 0.875rem; font-weight: 500; transition: all var(--transition); }
.nav-link:hover, .nav-link.active { color: #FFF; background: rgba(255,255,255,0.1); }
.nav-user { display: flex; align-items: center; gap: 0.5rem; margin-left: 1rem; padding-left: 1rem; border-left: 1px solid rgba(255,255,255,0.15); }
.nav-user-name { color: rgba(255,255,255,0.6); font-size: 0.8rem; }
.nav-logout { color: rgba(255,255,255,0.5) !important; font-size: 0.8rem !important; }

/* ── Flash Messages ─────────────────────────────────── */
.flash-container { max-width: 800px; margin: 1rem auto; padding: 0 2rem; }
.flash { padding: 0.75rem 1rem; border-radius: var(--radius-md); font-size: 0.9rem; cursor: pointer; display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; animation: slideDown 0.3s ease; }
.flash-success { background: #E6F5EE; color: #00573A; border-left: 4px solid var(--color-success); }
.flash-error { background: #FCECED; color: #8C1D28; border-left: 4px solid var(--color-danger); }
.flash-info { background: #FFF3E6; color: #7A4500; border-left: 4px solid var(--color-info); }
.flash-warning { background: #FFF5E6; color: #7A4500; border-left: 4px solid var(--color-warning); }
.flash-close { font-size: 1.2rem; opacity: 0.5; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

.main-content { flex: 1; }
.site-footer { background: var(--color-dark); color: rgba(255,255,255,0.4); font-size: 0.8rem; padding: 1rem 2rem; text-align: center; }
.footer-sep { margin: 0 0.5rem; }

/* ── Buttons ──────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--font-body); font-size: 0.9rem; font-weight: 600; padding: 0.6rem 1.25rem; border-radius: var(--radius-sm); border: none; cursor: pointer; transition: all var(--transition); text-decoration: none; line-height: 1.3; }
.btn-primary { background: var(--color-accent); color: #FFF; }
.btn-primary:hover { background: var(--color-accent-hover); color: #FFF; }
.btn-primary:disabled { background: var(--color-border-strong); cursor: not-allowed; }
.btn-secondary { background: var(--color-border); color: var(--color-text); }
.btn-secondary:hover { background: var(--color-border-strong); color: var(--color-text); }
.btn-danger { background: var(--color-danger); color: #FFF; }
.btn-full { width: 100%; justify-content: center; }
.btn-sm { font-size: 0.8rem; padding: 0.4rem 0.9rem; }
.btn-xs { font-size: 0.75rem; padding: 0.25rem 0.6rem; background: var(--color-border); color: var(--color-text); border-radius: var(--radius-sm); }
.btn-xs:hover { background: var(--color-border-strong); color: var(--color-text); }
.btn-xs.btn-danger { background: var(--color-danger); color: #fff; }

/* ── Forms ─────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.35rem; color: var(--color-text-secondary); letter-spacing: 0.02em; text-transform: uppercase; }
.form-group input[type="text"], .form-group input[type="email"], .form-group input[type="password"], .form-group input[type="url"], .form-group textarea, .form-group select { width: 100%; padding: 0.65rem 0.85rem; border: 2px solid var(--color-border); border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 0.95rem; background: var(--color-surface); color: var(--color-text); transition: border-color var(--transition); }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { outline: none; border-color: var(--color-accent); }
.form-group textarea { resize: vertical; }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 200px; }
.form-row .flex-1 { flex: 1; }
.form-row .flex-2 { flex: 2; }
.form-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--color-border); }
.required { color: var(--color-danger); }
.checkbox-group label { text-transform: none; font-weight: 400; font-size: 0.95rem; }
.checkbox-label { display: flex !important; align-items: flex-start; gap: 0.6rem; cursor: pointer; }
.checkbox-label input[type="checkbox"] { margin-top: 0.25rem; width: 18px; height: 18px; accent-color: var(--color-accent); }
.checkbox-custom { display: none; }
.color-input-wrapper { display: flex; gap: 0.5rem; align-items: center; }
.color-input-wrapper input[type="color"] { width: 44px; height: 38px; border: 2px solid var(--color-border); border-radius: var(--radius-sm); cursor: pointer; padding: 2px; }
.color-input-wrapper .color-text { width: 100px; }
.code-editor { font-family: var(--font-mono); font-size: 0.85rem; line-height: 1.5; }
.inline-form { display: inline; }

/* ── Auth Pages ────────────────────────────────────── */
.page-auth { background: var(--color-dark); }
.page-auth .site-footer { background: transparent; }
.auth-wrapper { display: flex; min-height: 100vh; }
.auth-visual { flex: 1; background: linear-gradient(160deg, #0A0C10 0%, #141820 40%, #0D2137 100%); display: flex; align-items: center; justify-content: center; padding: 3rem; position: relative; overflow: hidden; }
.auth-visual::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 30% 50%, rgba(255,102,0,0.15) 0%, transparent 60%); }
.auth-visual-content { position: relative; z-index: 1; }
.auth-brand h1 { color: #FFF; font-size: 2.5rem; line-height: 1.15; margin-top: 1rem; }
.auth-tagline { color: rgba(255,255,255,0.5); margin-top: 1.5rem; font-size: 1.05rem; line-height: 1.6; }
.auth-visual-decoration { margin-top: 3rem; display: flex; flex-direction: column; gap: 0.6rem; }
.deco-line { height: 2px; background: linear-gradient(90deg, var(--color-accent) 0%, transparent 100%); border-radius: 1px; }
.deco-line:nth-child(1) { width: 200px; }
.deco-line:nth-child(2) { width: 140px; opacity: 0.6; }
.deco-line:nth-child(3) { width: 80px; opacity: 0.3; }
.auth-form-side { width: 480px; background: var(--color-surface); display: flex; align-items: center; justify-content: center; padding: 3rem; }
.auth-form-container { width: 100%; max-width: 360px; }
.auth-form-container h2 { font-family: var(--font-display); font-size: 1.75rem; margin-bottom: 0.35rem; }
.auth-subtitle { color: var(--color-muted); margin-bottom: 2rem; font-size: 0.9rem; }
.auth-divider { text-align: center; margin: 1.75rem 0; position: relative; color: var(--color-muted); font-size: 0.8rem; }
.auth-divider::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--color-border); }
.auth-divider span { position: relative; background: var(--color-surface); padding: 0 1rem; }
.sso-buttons { display: flex; flex-direction: column; gap: 0.6rem; }
.btn-sso { width: 100%; justify-content: center; padding: 0.65rem; background: var(--color-surface); border: 2px solid var(--color-border); color: var(--color-text); font-weight: 600; }
.btn-sso:hover { border-color: var(--color-accent); color: var(--color-accent); }
.btn-sso svg { flex-shrink: 0; }

/* ── Dashboard ─────────────────────────────────────── */
.dashboard { max-width: 1100px; margin: 0 auto; padding: 2.5rem 2rem; }
.dashboard-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 2.5rem; padding-bottom: 2rem; border-bottom: 1px solid var(--color-border); }
.dashboard-greeting h1 { font-size: 2rem; }
.dashboard-subtitle { color: var(--color-muted); margin-top: 0.4rem; font-size: 1rem; }
.stat-ring { width: 80px; height: 80px; position: relative; }
.stat-ring svg { width: 100%; height: 100%; }
.stat-ring-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1rem; color: var(--color-text); }
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1.5rem; }
.module-card { background: var(--color-surface); border-radius: var(--radius-lg); padding: 1.75rem; border: 1px solid var(--color-border); transition: all 0.25s ease; position: relative; overflow: hidden; display: flex; flex-direction: column; }
.module-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--module-accent); }
.module-card:hover { border-color: var(--module-accent); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.module-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; }
.module-icon { width: 48px; height: 48px; background: color-mix(in srgb, var(--module-accent) 10%, transparent); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; color: var(--module-accent); }
.module-badge { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 0.2rem 0.6rem; border-radius: 99px; }
.badge-complete { background: #E6F5EE; color: var(--color-success); }
.badge-progress { background: #FFF5E6; color: var(--color-warning); }
.badge-new { background: #F0EDE8; color: var(--color-muted); }
.module-card-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.4rem; }
.module-card-subtitle { color: var(--color-text-secondary); font-size: 0.9rem; line-height: 1.5; margin-bottom: 1rem; flex: 1; }
.module-card-meta { display: flex; gap: 1rem; font-size: 0.8rem; color: var(--color-muted); margin-bottom: 1rem; }
.progress-bar-container { width: 100%; height: 6px; background: var(--color-border); border-radius: 3px; overflow: hidden; margin-bottom: 1rem; }
.progress-bar { height: 100%; background: var(--module-accent, var(--color-accent)); border-radius: 3px; transition: width 0.5s ease; }
.progress-inline { display: inline-block; width: 80px; vertical-align: middle; margin-right: 0.5rem; }
.module-card-link { font-weight: 700; font-size: 0.9rem; color: var(--module-accent); letter-spacing: 0.02em; }
.module-card-link:hover { color: var(--color-text); }
.module-complete { opacity: 0.75; }
.module-complete:hover { opacity: 1; }

/* ── Module Viewer ─────────────────────────────────── */
.module-viewer { display: flex; min-height: calc(100vh - 56px - 48px); }
.module-sidebar { width: 300px; min-width: 300px; background: var(--color-surface); border-right: 1px solid var(--color-border); display: flex; flex-direction: column; position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; }
.sidebar-header { padding: 1.5rem; border-bottom: 1px solid var(--color-border); }
.sidebar-back { font-size: 0.8rem; color: var(--color-muted); display: block; margin-bottom: 0.75rem; }
.sidebar-back:hover { color: var(--color-accent); }
.sidebar-title { font-size: 1.1rem; font-weight: 700; }
.sidebar-progress { margin-top: 0.75rem; }
.progress-label { font-size: 0.75rem; color: var(--color-muted); margin-top: 0.3rem; display: block; }
.sidebar-nav { padding: 0.75rem 0; flex: 1; }
.sidebar-link { display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 1.5rem; font-size: 0.875rem; color: var(--color-text-secondary); transition: all var(--transition); border-left: 3px solid transparent; }
.sidebar-link:hover { background: var(--color-bg); color: var(--color-text); }
.sidebar-link.active { background: color-mix(in srgb, var(--module-accent) 6%, transparent); color: var(--color-text); font-weight: 600; border-left-color: var(--module-accent); }
.sidebar-link.completed .sidebar-link-text { color: var(--color-muted); }
.sidebar-link-indicator { flex-shrink: 0; width: 16px; height: 16px; }
.sidebar-link-text { line-height: 1.3; }
.module-content-area { flex: 1; min-width: 0; padding: 2.5rem; max-width: 900px; }
.module-content-inner { max-width: 760px; }

/* ── Section Content ───────────────────────────────── */
.section-content h2 { margin-top: 2rem; margin-bottom: 0.75rem; }
.section-content h3 { margin-top: 1.5rem; margin-bottom: 0.5rem; }
.section-content p { margin-bottom: 1rem; }
.section-content ul, .section-content ol { margin-bottom: 1rem; padding-left: 1.5rem; }
.section-content li { margin-bottom: 0.4rem; }
.section-content table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; }
.section-content th, .section-content td { padding: 0.6rem 0.85rem; text-align: left; border-bottom: 1px solid var(--color-border); font-size: 0.9rem; }
.section-content th { font-weight: 700; background: var(--color-bg); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }

.section-hero { margin: -2.5rem -2.5rem 2rem -2.5rem; padding: 3rem 2.5rem; color: #FFF; position: relative; }
.hero-content { max-width: 600px; }
.hero-badge { display: inline-block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; background: rgba(255,255,255,0.15); padding: 0.2rem 0.7rem; border-radius: 99px; margin-bottom: 1rem; }
.section-hero h1 { color: #FFF; font-size: 2.2rem; margin-bottom: 0.5rem; }
.hero-subtitle { color: rgba(255,255,255,0.75); font-size: 1.1rem; }

.content-block { margin-bottom: 2rem; }
.content-block h2 { margin-bottom: 0.75rem; }
.content-block h3 { margin-top: 1.75rem; margin-bottom: 0.5rem; }
.content-block p { margin-bottom: 1rem; color: var(--color-text-secondary); line-height: 1.7; }

.callout { display: flex; gap: 0.85rem; padding: 1rem 1.25rem; border-radius: var(--radius-md); margin: 1.25rem 0; font-size: 0.9rem; line-height: 1.6; }
.callout-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 0.1rem; }
.callout-body { flex: 1; }
.callout-body p { margin-bottom: 0; }
.callout-info { background: #FFF3E6; border-left: 4px solid var(--color-info); }
.callout-warning { background: #FFF7E6; border-left: 4px solid var(--color-warning); }
.callout-success { background: #E6F5EE; border-left: 4px solid var(--color-success); }
.warning-banner { background: #FFF7E6; border: 2px solid var(--color-warning); border-radius: var(--radius-md); padding: 1rem 1.25rem; margin: 1.5rem 0; font-size: 0.9rem; }

.learning-objectives { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.objective-card { background: var(--color-bg); border-radius: var(--radius-md); padding: 1.25rem; border: 1px solid var(--color-border); }
.objective-number { font-family: var(--font-display); font-size: 1.75rem; font-weight: 800; color: var(--module-accent, var(--color-accent)); opacity: 0.35; margin-bottom: 0.3rem; }
.objective-card h4 { margin-bottom: 0.3rem; }
.objective-card p { font-size: 0.875rem; color: var(--color-text-secondary); margin-bottom: 0; }

.split-layout { display: flex; gap: 2rem; margin: 1.5rem 0; flex-wrap: wrap; }
.split-left, .split-right { flex: 1; min-width: 280px; }
.check-list, .x-list { list-style: none; padding: 0; }
.check-list li, .x-list li { padding: 0.5rem 0; padding-left: 1.5rem; position: relative; border-bottom: 1px solid var(--color-border); font-size: 0.9rem; }
.check-list li::before { content: '✓'; position: absolute; left: 0; color: var(--color-success); font-weight: 700; }
.x-list li::before { content: '✕'; position: absolute; left: 0; color: var(--color-danger); font-weight: 700; }

.code-example { margin: 1.5rem 0; border-radius: var(--radius-md); overflow: hidden; border: 1px solid rgba(255,255,255,0.05); }
.code-header { background: #2A2D35; color: rgba(255,255,255,0.6); padding: 0.5rem 1rem; font-size: 0.8rem; font-family: var(--font-mono); display: flex; justify-content: space-between; align-items: center; }
.code-example pre { margin: 0; border-radius: 0; }

.comparison-table { overflow-x: auto; margin: 1.5rem 0; }
.comparison-table table { width: 100%; border-collapse: collapse; }
.comparison-table th, .comparison-table td { padding: 0.75rem 1rem; border: 1px solid var(--color-border); font-size: 0.9rem; }
.comparison-table th { background: var(--color-bg); font-weight: 700; }
.cell-good { background: #E6F5EE; color: var(--color-success); font-weight: 600; }
.cell-bad { background: #FCECED; color: var(--color-danger); font-weight: 600; }

.tier-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.tier-card { border-radius: var(--radius-md); overflow: hidden; border: 2px solid var(--color-border); }
.tier-header { padding: 0.6rem 1rem; font-weight: 700; font-size: 0.85rem; letter-spacing: 0.03em; }
.tier-body { padding: 1rem; font-size: 0.9rem; }
.tier-body p { margin-bottom: 0.5rem; }
.tier-approved .tier-header { background: var(--color-success); color: #FFF; }
.tier-restricted .tier-header { background: var(--color-warning); color: #FFF; }
.tier-prohibited .tier-header { background: var(--color-danger); color: #FFF; }

.responsibility-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.resp-card { background: var(--color-bg); border-radius: var(--radius-md); padding: 1.25rem; border: 1px solid var(--color-border); }
.resp-card h4 { margin-bottom: 0.4rem; }
.resp-card p { font-size: 0.875rem; color: var(--color-text-secondary); margin-bottom: 0; }

.workflow-steps { margin: 1.5rem 0; }
.workflow-step { display: flex; gap: 1.25rem; margin-bottom: 0; padding: 1.25rem 0; border-bottom: 1px solid var(--color-border); }
.workflow-step:last-child { border-bottom: none; }
.step-number { width: 40px; height: 40px; min-width: 40px; border-radius: 50%; background: var(--module-accent, var(--color-accent)); color: #FFF; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; }
.step-content h4 { margin-bottom: 0.3rem; }
.step-content p { font-size: 0.9rem; color: var(--color-text-secondary); margin-bottom: 0; }

.use-case-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; margin: 1.5rem 0; }
.use-case-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 1.5rem; }
.use-case-card.good { border-left: 4px solid var(--color-success); }
.use-case-icon { font-size: 1.5rem; margin-bottom: 0.5rem; }
.use-case-card h4 { margin-bottom: 0.4rem; }
.use-case-card p { font-size: 0.9rem; color: var(--color-text-secondary); }
.use-case-tip { font-size: 0.85rem; color: var(--color-muted); margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--color-border); }

.boundary-section { margin: 1.5rem 0; }
.boundary-card { margin-bottom: 1.5rem; padding: 1.5rem; border-radius: var(--radius-md); }
.boundary-card.danger { background: #FEF6F6; border: 2px solid #E6C3C5; }
.boundary-card h3 { margin-bottom: 0.75rem; }
.boundary-card h4 { margin-top: 1rem; }
.boundary-card p, .boundary-card li { font-size: 0.9rem; }

.innovation-flow { display: flex; align-items: stretch; gap: 0.5rem; margin: 1.5rem 0; flex-wrap: wrap; }
.flow-card { flex: 1; min-width: 220px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 1.25rem; }
.flow-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-muted); margin-bottom: 0.5rem; }
.flow-card.you { border-top: 3px solid var(--color-accent); }
.flow-card.handoff { border-top: 3px solid var(--color-warning); }
.flow-card.eng { border-top: 3px solid var(--color-success); }
.flow-card h4 { margin-bottom: 0.5rem; font-size: 1rem; }
.flow-card ul { font-size: 0.85rem; }
.flow-arrow { display: flex; align-items: center; color: var(--color-muted); font-size: 1.5rem; font-weight: 300; }

.example-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.example-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 1.25rem; font-size: 0.9rem; }
.example-badge { display: inline-block; font-size: 0.7rem; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 4px; margin-bottom: 0.6rem; }
.good-example { background: #E6F5EE; color: var(--color-success); }
.bad-example { background: #FCECED; color: var(--color-danger); }

.playbook-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.playbook-item { background: var(--color-bg); border-radius: var(--radius-md); padding: 1.25rem; border: 1px solid var(--color-border); }
.playbook-number { font-family: var(--font-display); font-size: 2rem; font-weight: 800; color: var(--module-accent, var(--color-accent)); opacity: 0.25; }
.playbook-item h4 { margin-bottom: 0.3rem; }
.playbook-item p { font-size: 0.85rem; color: var(--color-text-secondary); margin-bottom: 0; }

.quick-reference { margin: 2rem 0; }
.quick-reference table { width: 100%; }
.quick-reference th, .quick-reference td { padding: 0.6rem 0.85rem; border-bottom: 1px solid var(--color-border); font-size: 0.9rem; }
.quick-reference th { background: var(--color-bg); }

.section-nav-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 3rem; padding-top: 1.5rem; border-top: 2px solid var(--color-border); }

.video-container { margin-bottom: 2rem; }
.module-video { width: 100%; border-radius: var(--radius-md); background: #000; }
.section-image-container { margin-bottom: 2rem; }
.section-image { width: 100%; border-radius: var(--radius-md); }

/* ── Attestation ───────────────────────────────────── */
.attestation-section { margin-top: 0; }
.policy-document { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 2rem; max-height: 500px; overflow-y: auto; margin-bottom: 2rem; font-size: 0.9rem; line-height: 1.7; }
.policy-document h2 { font-size: 1.3rem; margin-bottom: 0.5rem; }
.policy-document h3 { font-size: 1.05rem; margin-top: 1.25rem; margin-bottom: 0.4rem; }
.policy-document ul { margin: 0.5rem 0 1rem 1.5rem; }
.attestation-form-wrapper { background: var(--color-bg); border: 2px solid var(--color-accent); border-radius: var(--radius-md); padding: 2rem; }
.attestation-form-wrapper h3 { margin-bottom: 0.5rem; }
.attestation-form-wrapper > p { color: var(--color-text-secondary); font-size: 0.9rem; margin-bottom: 1.5rem; }
.attestation-form .form-group { margin-bottom: 1rem; }
.attestation-confirmed { text-align: center; padding: 3rem 2rem; background: #E6F5EE; border-radius: var(--radius-md); border: 2px solid var(--color-success); }
.confirmed-icon { margin-bottom: 1rem; }
.attestation-confirmed h3 { color: var(--color-success); margin-bottom: 0.5rem; }
.attestation-confirmed p { color: var(--color-text-secondary); font-size: 0.9rem; }
.attestation-meta { font-size: 0.8rem !important; color: var(--color-muted) !important; margin-top: 0.5rem; }

/* ── Admin ─────────────────────────────────────────── */
.admin-page { max-width: 1200px; margin: 0 auto; padding: 2rem; }
.admin-header { margin-bottom: 2rem; }
.admin-header h1 { margin-bottom: 1rem; }
.admin-nav-pills { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.pill { padding: 0.4rem 1rem; border-radius: 99px; font-size: 0.85rem; font-weight: 500; color: var(--color-text-secondary); background: var(--color-surface); border: 1px solid var(--color-border); transition: all var(--transition); }
.pill:hover { border-color: var(--color-accent); color: var(--color-accent); }
.pill.active { background: var(--color-accent); color: #FFF; border-color: var(--color-accent); }
.admin-section { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1.5rem; }
.admin-section h2 { margin-bottom: 1rem; font-size: 1.25rem; }
.section-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.section-header-row h2 { margin-bottom: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 1.25rem; text-align: center; }
.stat-value { font-family: var(--font-display); font-size: 2.25rem; font-weight: 700; color: var(--color-accent); }
.stat-label { font-size: 0.8rem; color: var(--color-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.25rem; }
.admin-table-wrapper { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-muted); padding: 0.6rem 0.75rem; border-bottom: 2px solid var(--color-border); text-align: left; font-weight: 600; }
.admin-table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--color-border); font-size: 0.875rem; vertical-align: middle; }
.admin-table tbody tr:hover { background: var(--color-bg); }
.table-compact td { padding: 0.4rem 0.5rem; font-size: 0.8rem; }
.tag { display: inline-block; font-size: 0.7rem; font-weight: 600; padding: 0.15rem 0.5rem; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.04em; background: var(--color-border); }
.tag-local { background: #FFF3E6; color: var(--color-accent); }
.tag-pingone { background: #E6F5EE; color: var(--color-success); }
.tag-entra { background: #FFF5E6; color: var(--color-warning); }
.tag-admin { background: #EDE6FF; color: #5B21B6; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.dot-green { background: var(--color-success); }
.dot-red { background: var(--color-danger); }
.color-dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; margin-right: 0.4rem; }
.actions-cell { white-space: nowrap; display: flex; gap: 0.3rem; }
.empty-state { color: var(--color-muted); font-style: italic; padding: 2rem; text-align: center; }
.text-muted { color: var(--color-muted); }
.status-badge { font-size: 0.7rem; font-weight: 600; padding: 0.15rem 0.5rem; border-radius: 4px; }
.status-attested { background: #E6F5EE; color: var(--color-success); }
.status-complete { background: #FFF3E6; color: var(--color-accent); }
.status-progress { background: #FFF5E6; color: var(--color-warning); }
.status-none { color: var(--color-muted); }

.template-upload-form { text-align: center; }
.file-upload-zone { border: 2px dashed var(--color-border-strong); border-radius: var(--radius-md); padding: 2rem; text-align: center; transition: all var(--transition); margin-bottom: 1rem; cursor: pointer; }
.file-upload-zone:hover, .file-upload-zone.dragover { border-color: var(--color-accent); background: color-mix(in srgb, var(--color-accent) 4%, transparent); }
.upload-icon { margin-bottom: 0.75rem; }
.upload-hint { font-size: 0.8rem; color: var(--color-muted); margin-top: 0.3rem; }
.selected-file { margin-top: 0.75rem; font-weight: 600; color: var(--color-accent); }
.upload-result { margin-top: 0.75rem; font-size: 0.85rem; color: var(--color-success); }
.admin-form { max-width: 700px; }
.add-section-form { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--color-border); }
.add-section-form h3 { margin-bottom: 1rem; }
.editor-toolbar { display: flex; gap: 0.25rem; margin-bottom: 0.5rem; }
.toolbar-btn { font-family: var(--font-mono); font-size: 0.75rem; padding: 0.25rem 0.5rem; background: var(--color-border); border: none; border-radius: var(--radius-sm); cursor: pointer; }
.toolbar-btn:hover { background: var(--color-border-strong); }

/* ── Interactive: Tabs ─────────────────────────────── */
.interactive-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--color-border); margin-bottom: 1.25rem; }
.tab-btn { padding: 0.65rem 1.25rem; border: none; background: none; font-family: var(--font-body); font-size: 0.9rem; font-weight: 600; color: var(--color-muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all 0.2s; }
.tab-btn:hover { color: var(--color-text); }
.tab-btn.active { color: var(--module-accent, var(--color-accent)); border-bottom-color: var(--module-accent, var(--color-accent)); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ── Interactive: Expandable Sections ─────────────── */
.expand-section { border: 1px solid var(--color-border); border-radius: var(--radius-md); margin-bottom: 0.75rem; overflow: hidden; }
.expand-header { padding: 0.85rem 1.25rem; background: var(--color-bg); cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 0.95rem; transition: background 0.2s; user-select: none; }
.expand-header:hover { background: var(--color-border); }
.expand-arrow { transition: transform 0.3s; font-size: 0.8rem; color: var(--color-muted); }
.expand-section.open .expand-arrow { transform: rotate(180deg); }
.expand-body { padding: 0 1.25rem; max-height: 0; overflow: hidden; transition: all 0.35s ease; }
.expand-section.open .expand-body { padding: 1rem 1.25rem; max-height: 2000px; }

/* ── Interactive: Knowledge Check ─────────────────── */
.knowledge-check { background: color-mix(in srgb, var(--module-accent, var(--color-accent)) 6%, transparent); border: 1px solid color-mix(in srgb, var(--module-accent, var(--color-accent)) 20%, transparent); border-radius: var(--radius-md); padding: 1.25rem; margin: 1.5rem 0; }
.knowledge-check h4 { color: var(--module-accent, var(--color-accent)); margin-bottom: 0.5rem; }
.kc-reveal-btn { background: var(--module-accent, var(--color-accent)); color: #fff; border: none; padding: 0.4rem 1rem; border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 0.85rem; font-weight: 600; cursor: pointer; margin-top: 0.5rem; }
.kc-reveal-btn:hover { opacity: 0.9; }
.kc-answer { display: none; margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--color-border); font-size: 0.9rem; }
.kc-answer.revealed { display: block; animation: fadeIn 0.3s ease; }

/* ── Reading Time ─────────────────────────────────── */
.reading-time { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.8rem; color: var(--color-muted); margin-bottom: 1rem; }

/* ── Scenario Boxes ───────────────────────────────── */
.scenario-box { border: 2px solid var(--color-border); border-radius: var(--radius-md); margin: 1.25rem 0; overflow: hidden; }
.scenario-box-header { padding: 0.75rem 1.25rem; font-weight: 700; font-size: 0.85rem; letter-spacing: 0.03em; }
.scenario-box.scenario-good .scenario-box-header { background: #E6F5EE; color: var(--color-success); }
.scenario-box.scenario-bad .scenario-box-header { background: #FCECED; color: var(--color-danger); }
.scenario-box.scenario-neutral .scenario-box-header { background: #E8F1FF; color: var(--color-accent); }
.scenario-box-body { padding: 1rem 1.25rem; font-size: 0.9rem; line-height: 1.7; }
.scenario-box-body .scenario-dialogue { font-style: italic; color: var(--color-text-secondary); padding: 0.5rem 0 0.5rem 1rem; border-left: 3px solid var(--color-border); margin: 0.5rem 0; }

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 900px) {
    .module-viewer { flex-direction: column; }
    .module-sidebar { width: 100%; min-width: 100%; position: relative; top: auto; height: auto; max-height: 300px; }
    .module-content-area { padding: 1.5rem; }
    .section-hero { margin: -1.5rem -1.5rem 1.5rem -1.5rem; padding: 2rem 1.5rem; }
    .auth-wrapper { flex-direction: column; }
    .auth-visual { min-height: 30vh; }
    .auth-form-side { width: 100%; }
    .innovation-flow { flex-direction: column; }
    .flow-arrow { transform: rotate(90deg); justify-content: center; }
}
@media (max-width: 600px) {
    .module-grid { grid-template-columns: 1fr; }
    .dashboard { padding: 1.5rem 1rem; }
    .nav-inner { padding: 0 1rem; }
    .nav-user-name { display: none; }
}
