/* AREA PRIVATA ACADEMY — design system aligned with mrborriello.it & admin panel */
:root {
    --bg: #121212;
    --sidebar: #161616;
    --surface: #1C1C1C;
    --surface-2: #242424;
    --surface-3: #2E2E2E;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text: #F3F4F6;
    --text-muted: #A3A3A3;
    --text-dim: #7A7A7A;
    --accent: #E8350A;
    --color-accent: #E8350A;
    --accent-hover: #FF4317;
    --cyan: #2DD4BF;
    --cyan-soft: rgba(45, 212, 191, 0.14);
    --gold: #FFC107;
    --gold-soft: rgba(255, 193, 7, 0.14);
    --success: #22C55E;
    --success-soft: rgba(34, 197, 94, 0.14);
    --danger: #EF4444;
    --radius: 14px;
    --radius-sm: 10px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

[hidden] {
    display: none !important;
}

html, body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.55;
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input, textarea, select {
    font-family: inherit;
}

h1, h2, h3, h4, .mb-heading {
    font-family: 'Montserrat', 'Inter', sans-serif;
    letter-spacing: -0.015em;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    background: var(--accent);
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 0 0 8px 8px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 0.8rem;
    text-transform: uppercase;
    z-index: 9999;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
}

/* LOADING STATE */
.auth-loading {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.auth-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: mbSpin 0.8s linear infinite;
}

@keyframes mbSpin {
    to { transform: rotate(360deg); }
}

/* PRIVATE APP SHELL */
.app-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
}

.drawer-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(3px);
    z-index: 45;
}

.drawer-backdrop.open {
    display: block;
}

/* SIDEBAR */
.app-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 50;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 1.15rem 1.15rem 1rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-brand-link {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.sidebar-brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    object-fit: cover;
    border: 1px solid var(--border-strong);
    background: var(--surface-2);
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brand-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    color: #fff;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-sub {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent);
}

.sidebar-close-btn {
    display: none;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 6px;
    border-radius: 8px;
    cursor: pointer;
}

.sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1.1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-group-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
    padding: 0 0.65rem 0.35rem;
}

.nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    position: relative;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.045);
    color: var(--text);
}

.nav-item.active {
    background: rgba(232, 53, 10, 0.13);
    color: #fff;
    border-color: rgba(232, 53, 10, 0.34);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 3px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.88;
}

.nav-item.active svg {
    color: var(--accent);
    opacity: 1;
}

.nav-item--cyan svg {
    color: var(--cyan);
}

.nav-item--gold svg {
    color: var(--gold);
}

.nav-badge {
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 999px;
    line-height: 1.25;
}

.nav-badge--accent {
    background: var(--accent);
    color: #fff;
}

.nav-badge--cyan {
    background: var(--cyan-soft);
    color: var(--cyan);
}

.nav-badge--muted {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
}

/* SIDEBAR FOOTER */
.sidebar-footer {
    padding: 0.9rem 0.9rem 1rem;
    border-top: 1px solid var(--border);
    background: #141414;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(232, 53, 10, 0.18);
    border: 1px solid rgba(232, 53, 10, 0.4);
    color: #FF7857;
    font-weight: 800;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-meta {
    min-width: 0;
    flex: 1;
}

.user-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 0.72rem;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-admin-link {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    background: var(--success-soft);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #4ADE80;
    font-size: 0.78rem;
    font-weight: 700;
    transition: background 0.15s ease;
}

.btn-admin-link:hover {
    background: rgba(34, 197, 94, 0.22);
}

.account-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.btn-account-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.42rem 0.35rem;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-account-mini:hover {
    background: var(--surface-2);
    color: #fff;
}

.btn-account-mini--danger:hover {
    background: rgba(232, 53, 10, 0.14);
    border-color: rgba(232, 53, 10, 0.4);
    color: #FF7857;
}

/* WORKSPACE & TOPBAR */
.app-workspace {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

.mobile-header {
    display: none;
    height: 58px;
    padding: 0 1rem;
    border-bottom: 1px solid var(--border);
    background: rgba(22, 22, 22, 0.94);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 40;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mobile-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.mobile-menu-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.mobile-section-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 0.95rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-chat-btn {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.mobile-chat-dot {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--sidebar);
}

.app-topbar {
    background: rgba(18, 18, 18, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 0.95rem 2rem;
    position: sticky;
    top: 0;
    z-index: 35;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.topbar-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
}

.topbar-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 2px 0 0;
}

.btn-resume-top {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0.55rem 0.95rem;
    border-radius: 10px;
    background: var(--success);
    color: #052E16;
    border: none;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
    white-space: nowrap;
}

.btn-resume-top:hover {
    background: #16A34A;
    transform: translateY(-1px);
}

.app-main {
    flex: 1;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 1.75rem 2rem 2rem;
}

.view-section {
    display: none;
}

.view-section.active {
    display: block;
}

.stack-lg > * + * {
    margin-top: 1.5rem;
}

/* CARDS & BANNERS */
.card-base {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.notice-banner {
    background: #18221B;
    border: 1px solid rgba(34, 197, 94, 0.35);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.notice-banner-body {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.notice-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(34, 197, 94, 0.18);
    color: #4ADE80;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.notice-text {
    font-size: 0.88rem;
    color: #E5E7EB;
    line-height: 1.5;
}

.notice-text strong {
    color: #4ADE80;
}

.notice-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 4px;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
}

.notice-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.celebration-banner {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.14), rgba(28, 28, 28, 0.96));
    border: 1px solid rgba(34, 197, 94, 0.35);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.celebration-banner h3 {
    font-size: 1rem;
    font-weight: 800;
    color: #4ADE80;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.celebration-banner p {
    font-size: 0.86rem;
    color: #D4D4D8;
}

/* OVERVIEW HERO */
.hero-card {
    padding: 1.5rem;
    background: linear-gradient(135deg, #202020 0%, #171717 100%);
}

.hero-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.75rem;
}

.hero-progress-col {
    flex: 1;
    min-width: 0;
}

.eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.hero-greeting {
    font-size: 1.45rem;
    font-weight: 800;
    color: #fff;
    margin-top: 0.25rem;
    line-height: 1.25;
}

.progress-block {
    margin-top: 1.1rem;
}

.progress-labels {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 0.45rem;
}

.progress-labels span {
    color: #D4D4D8;
    font-weight: 600;
}

.progress-labels strong {
    color: #fff;
    font-weight: 800;
}

.progress-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #2A2A2A;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), #FF6B47);
    transition: width 0.35s ease;
}

.next-lesson-box {
    width: 290px;
    flex-shrink: 0;
    background: var(--surface-2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem 1.1rem;
}

.next-lesson-label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--success);
}

.next-lesson-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    margin-top: 0.3rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.7rem 1.1rem;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    border: none;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-block {
    width: 100%;
}

/* SECTION HEADERS */
.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.section-head h3 {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
}

.section-head p {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.section-link {
    background: transparent;
    border: none;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.section-link:hover {
    text-decoration: underline;
}

.section-link--cyan { color: var(--cyan); }
.section-link--accent { color: #FF7857; }

/* SOFTWARE CARDS */
.software-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.software-card {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.software-card--cyan {
    border-color: rgba(45, 212, 191, 0.3);
    background: linear-gradient(180deg, #162222 0%, #1A1A1A 100%);
}

.software-card--cyan:hover {
    border-color: rgba(45, 212, 191, 0.58);
}

.software-card--gold {
    border-color: rgba(255, 193, 7, 0.3);
    background: linear-gradient(180deg, #231E12 0%, #1A1A1A 100%);
}

.software-card--gold:hover {
    border-color: rgba(255, 193, 7, 0.58);
}

.software-top-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 0.65rem;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pill--cyan {
    background: var(--cyan-soft);
    color: var(--cyan);
    border: 1px solid rgba(45, 212, 191, 0.32);
}

.pill--gold {
    background: var(--gold-soft);
    color: #FFD54F;
    border: 1px solid rgba(255, 193, 7, 0.35);
}

.pill--success {
    background: var(--success-soft);
    color: #4ADE80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.pill--accent {
    background: rgba(232, 53, 10, 0.15);
    color: #FF7857;
    border: 1px solid rgba(232, 53, 10, 0.32);
}

.pill--muted {
    background: var(--surface-2);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.software-card h4 {
    font-size: 1.08rem;
    font-weight: 800;
    color: #fff;
}

.software-desc {
    font-size: 0.82rem;
    color: #C2C8D0;
    margin-top: 0.35rem;
    line-height: 1.5;
}

.software-preview-img {
    margin-top: 0.9rem;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(45, 212, 191, 0.25);
    background: #0F1316;
    aspect-ratio: 16 / 9;
}

.software-preview-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.trainer-mini-preview {
    margin-top: 0.9rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 193, 7, 0.25);
    background: #141619;
    padding: 0.85rem;
    aspect-ratio: 16 / 9;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.trainer-mini-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.72rem;
    font-weight: 700;
    color: #FFD54F;
}

.trainer-mini-badge {
    background: var(--gold);
    color: #141619;
    font-weight: 800;
    font-size: 0.68rem;
    padding: 2px 7px;
    border-radius: 5px;
}

.trainer-mini-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.trainer-mini-stat {
    background: #1E2228;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 0.6rem;
}

.trainer-mini-stat strong {
    display: block;
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
}

.trainer-mini-stat span {
    display: block;
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.trainer-mini-foot {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-cyan {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.72rem 1rem;
    border-radius: 10px;
    background: var(--cyan);
    color: #042F2E;
    border: none;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-cyan:hover {
    background: #5EEAD4;
}

.btn-gold {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.72rem 1rem;
    border-radius: 10px;
    background: var(--gold);
    color: #1A1608;
    border: none;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-gold:hover {
    background: #FFD54F;
}

/* MODULES GRID */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.module-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem 1.25rem;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.module-tile:hover {
    border-color: rgba(255, 255, 255, 0.22);
    background: #202020;
    transform: translateY(-2px);
}

.module-tile.is-completed {
    border-left: 4px solid var(--success);
}

.module-tile.is-locked {
    opacity: 0.65;
    cursor: not-allowed;
}

.module-tile.is-locked:hover {
    transform: none;
    background: var(--surface);
    border-color: var(--border);
}

.module-tile-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.module-tile-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.module-tile-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.35;
}

.module-tile-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.mini-track {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: #2A2A2A;
    overflow: hidden;
}

.mini-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--accent);
}

.module-tile.is-completed .mini-fill {
    background: var(--success);
}

/* LESSONS VIEW — SINGLE PLAYER */
.player-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 1.25rem;
    align-items: start;
}

.player-card {
    overflow: hidden;
}

.video-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.video-stage iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.player-body {
    padding: 1.25rem 1.35rem;
}

.player-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.player-crumb {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
}

.player-lesson-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    margin-top: 0.25rem;
    line-height: 1.3;
}

.btn-complete {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-complete:hover {
    background: var(--surface-3);
}

.btn-complete.done {
    background: var(--success);
    border-color: var(--success);
    color: #052E16;
}

.lesson-controls {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.lesson-nav-btns {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.55rem 0.9rem;
    border-radius: 9px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-secondary:hover:not(:disabled) {
    background: var(--surface-3);
}

.btn-secondary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-lesson-help {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-lesson-help span {
    color: #FF7857;
    text-decoration: underline;
}

.btn-lesson-help:hover {
    color: #fff;
}

/* PLAYLIST RIGHT COLUMN */
.playlist-card {
    overflow: hidden;
    position: sticky;
    top: 84px;
}

.playlist-head {
    padding: 0.9rem 1rem;
    background: #1F1F1F;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.playlist-head h3 {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #fff;
}

.playlist-head span {
    font-size: 0.74rem;
    color: var(--text-muted);
}

.playlist-scroll {
    max-height: calc(100vh - 170px);
    overflow-y: auto;
}

.playlist-module {
    border-bottom: 1px solid var(--border);
}

.playlist-module:last-child {
    border-bottom: none;
}

.playlist-mod-btn {
    width: 100%;
    padding: 0.85rem 1rem;
    background: transparent;
    border: none;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}

.playlist-mod-btn:hover {
    background: rgba(255, 255, 255, 0.03);
}

.playlist-mod-btn.locked {
    opacity: 0.6;
}

.playlist-mod-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
}

.playlist-mod-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.playlist-lessons {
    background: #161616;
    padding: 0.35rem 0.5rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.playlist-lesson {
    width: 100%;
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
    background: transparent;
    border: 1px solid transparent;
    color: #E5E7EB;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    cursor: pointer;
    font-size: 0.78rem;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.playlist-lesson:hover {
    background: rgba(255, 255, 255, 0.05);
}

.playlist-lesson.active {
    background: rgba(232, 53, 10, 0.15);
    border-color: rgba(232, 53, 10, 0.42);
    color: #fff;
    font-weight: 700;
}

.playlist-lesson.done {
    color: var(--text-muted);
}

.playlist-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid #52525B;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 800;
    flex-shrink: 0;
}

.playlist-lesson.active .playlist-dot {
    border-color: var(--accent);
}

.playlist-lesson.done .playlist-dot {
    background: var(--success);
    border-color: var(--success);
    color: #052E16;
}

.playlist-lesson-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* SOFTWARE DETAIL VIEW */
.software-detail-stack {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.software-detail-card {
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1.5rem;
    align-items: center;
}

.software-detail-card h2 {
    font-size: 1.45rem;
    font-weight: 800;
    color: #fff;
    margin-top: 0.75rem;
}

.software-detail-card p {
    font-size: 0.88rem;
    color: #C4CFD9;
    margin-top: 0.5rem;
    line-height: 1.6;
}

.feature-list {
    list-style: none;
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    font-size: 0.82rem;
    color: #D4D4D8;
}

.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.software-detail-cta {
    margin-top: 1.25rem;
    max-width: 300px;
}

.trainer-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.trainer-feature-tile {
    background: #1E2228;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.85rem;
}

.trainer-feature-tile strong {
    display: block;
    font-size: 0.8rem;
    color: #fff;
}

.trainer-feature-tile span {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 3px;
}

/* RESOURCES GRID */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.resource-card {
    padding: 1.15rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: border-color 0.15s ease;
}

.resource-card:hover {
    border-color: var(--border-strong);
}

.resource-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.resource-icon {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    background: rgba(232, 53, 10, 0.14);
    border: 1px solid rgba(232, 53, 10, 0.3);
    color: #FF7857;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.resource-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.resource-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.btn-resource-open {
    padding: 0.55rem 0.9rem;
    border-radius: 9px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: #fff;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-resource-open:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.empty-state {
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* GUEST / LIMITED ACCESS SHELL */
.guest-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

.guest-topbar {
    height: 64px;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--sidebar);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 40;
}

.guest-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.guest-brand img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border-strong);
    object-fit: cover;
}

.guest-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.guest-banner {
    background: linear-gradient(90deg, rgba(232, 53, 10, 0.15) 0%, #1C1C1C 55%, rgba(45, 212, 191, 0.1) 100%);
    border-bottom: 1px solid var(--border);
    padding: 1.15rem 1.5rem;
}

.guest-banner-inner {
    max-width: 1040px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.guest-banner h1 {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
}

.guest-banner p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.guest-status-warning {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #FDE68A;
    border-radius: 12px;
    padding: 0.9rem 1.15rem;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.guest-container {
    flex: 1;
    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
    padding: 1.75rem 1.5rem 2.5rem;
}

.guest-preview-card {
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.guest-preview-head {
    padding: 1rem 1.25rem;
    background: #202020;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.guest-preview-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.guest-video-wrap {
    width: 100%;
    max-width: 780px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.guest-locked-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1.25rem;
}

.guest-locked-card {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
}

/* DISCRETE LEGAL FOOTER */
.legal-footer {
    border-top: 1px solid var(--border);
    padding: 1.25rem 2rem;
    font-size: 0.76rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.legal-footer-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.legal-footer a {
    color: var(--text-muted);
    transition: color 0.15s ease;
}

.legal-footer a:hover {
    color: #fff;
}

/* MODALS */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(6px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.open {
    display: flex;
}

.modal-box {
    width: 100%;
    max-width: 520px;
    background: #181818;
    border: 1px solid var(--border-strong);
    border-top: 3px solid var(--accent);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.modal-box--gold {
    border-top-color: var(--gold);
    max-width: 460px;
}

.modal-head {
    padding: 1.1rem 1.35rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.modal-head h3 {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
}

.modal-head p {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.chat-history {
    padding: 1.15rem 1.35rem;
    background: #141414;
    overflow-y: auto;
    max-height: 260px;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.chat-msg {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-msg--user {
    align-items: flex-end;
}

.chat-msg--admin {
    align-items: flex-start;
}

.chat-bubble {
    max-width: 86%;
    padding: 0.65rem 0.9rem;
    border-radius: 14px;
    font-size: 0.82rem;
    line-height: 1.5;
    word-break: break-word;
}

.chat-msg--user .chat-bubble {
    background: rgba(232, 53, 10, 0.18);
    border: 1px solid rgba(232, 53, 10, 0.35);
    color: #fff;
    border-top-right-radius: 4px;
}

.chat-msg--admin .chat-bubble {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    border-top-left-radius: 4px;
}

.chat-sender {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: #4ADE80;
    margin-bottom: 2px;
}

.chat-meta {
    font-size: 0.68rem;
    color: var(--text-dim);
}

.modal-body {
    padding: 1.15rem 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.modal-textarea {
    width: 100%;
    min-height: 110px;
    padding: 0.85rem;
    border-radius: 10px;
    background: #222222;
    border: 1px solid var(--border-strong);
    color: #fff;
    font-size: 0.88rem;
    resize: vertical;
}

.modal-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.star-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.35rem 0;
}

.star-btn {
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #3F3F46;
    transition: transform 0.15s ease, color 0.15s ease;
}

.star-btn:hover {
    transform: scale(1.12);
}

.star-btn.active {
    color: var(--gold);
}

.modal-footnote {
    font-size: 0.74rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.modal-footnote a {
    color: #fff;
    text-decoration: underline;
}

/* CUSTOMUI MODAL (from style.css) */
.ui-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.ui-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.ui-modal-card {
    background: #1A1A1A;
    border: 1px solid #333;
    border-top: 4px solid var(--color-accent);
    padding: 2.25rem;
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    text-align: center;
    position: relative;
}

.ui-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.ui-modal-close:hover {
    color: var(--color-accent);
}

.ui-modal-overlay.active .ui-modal-card {
    transform: translateY(0);
}

.ui-modal-content p {
    color: #ccc;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.75rem;
}

.ui-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.ui-btn {
    padding: 12px 22px;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 0.82rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.ui-btn-primary {
    background: var(--color-accent);
    color: #fff;
}

.ui-btn-primary:hover {
    background: var(--accent-hover);
}

.ui-btn-secondary {
    background: #2a2a2a;
    color: #bbb;
    border: 1px solid #444;
}

.ui-btn-secondary:hover {
    background: #333;
    color: #fff;
}

/* RESPONSIVE */
@media (max-width: 1080px) {
    .player-layout {
        grid-template-columns: 1fr;
    }
    .playlist-card {
        position: static;
    }
    .playlist-scroll {
        max-height: 360px;
    }
}

@media (max-width: 960px) {
    .app-topbar {
        display: none;
    }
    .mobile-header {
        display: flex;
    }
    .app-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.75);
    }
    .app-sidebar.open {
        transform: translateX(0);
    }
    .sidebar-close-btn {
        display: inline-flex;
    }
    .hero-layout {
        flex-direction: column;
        align-items: stretch;
    }
    .next-lesson-box {
        width: 100%;
    }
    .software-detail-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-main {
        padding: 1.15rem 1rem 1.75rem;
    }
    .software-grid,
    .modules-grid,
    .resources-grid,
    .guest-locked-grid {
        grid-template-columns: 1fr;
    }
    .legal-footer {
        padding: 1.25rem 1rem;
    }
}

@media (max-width: 480px) {
    .ui-modal-card { padding: 1.5rem; }
    .ui-modal-actions { flex-direction: column-reverse; }
    .ui-btn { width: 100%; }
    .guest-topbar { padding: 0 1rem; }
    .guest-banner { padding: 1rem; }
    .guest-container { padding: 1.25rem 1rem 2rem; }
}
