/* --- CSS Variables & Theme --- */
:root {
    --primary: #252525;
    --primary-hover: #3a3a3a;
    --primary-light: #F5F5F5;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --bg-main: #F3F4F6;
    /* Light gray background */
    --bg-surface: #FFFFFF;
    /* Pure white surface */
    --bg-surface-hover: #F9FAFB;
    /* Slightly off-white for hover */
    --bg-surface2: #FFFFFF;
    --bg-surface-hover2: #F9FAFB;

    --text-primary: #111827;
    /* Near black text */
    --text-secondary: #4B5563;
    /* Medium gray */
    --text-muted: #9CA3AF;
    /* Light gray */

    --border-color: #E5E7EB;
    /* Subtle light borders */

    --radius-sm: 5px;
    --radius-md: 10px;
    --radius-lg: 20px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --transition: all 0.2s ease-in-out;
}

/* --- Dark Mode Variables --- */
[data-theme="dark"] {
    --primary: #D4D4D8;
    --primary-hover: #F4F4F5;
    --primary-light: #2E2E2E;
    --bg-main: #111111;
    --bg-surface: #1A1A1A;
    --bg-surface-hover: #2E2E2E;
    --bg-surface2: #131313;
    --bg-surface-hover2: #2E2E2E;
    --text-primary: #EDEDEF;
    --text-secondary: #8B95A8;
    --text-muted: #727272;
    --border-color: #2E2E2E;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
}

/* Dark mode: elements with hardcoded colors or needing text color flip
   (primary in dark mode is light gray — elements using it as bg need dark text) */
[data-theme="dark"] a {
    color: var(--text-primary);
}

[data-theme="dark"] a:hover {
    color: var(--primary-hover);
}

[data-theme="dark"] .btn-primary {
    color: #0F1015;
}

[data-theme="dark"] .nav-item.active {
    color: var(--text-primary);
}

[data-theme="dark"] .chat-user-item.active {
    color: var(--text-primary);
}

[data-theme="dark"] .phase-rule-badge {
    color: var(--text-primary);
}

[data-theme="dark"] .msg-sent {
    color: #0F1015;
}

[data-theme="dark"] .avatar {
    color: #0F1015;
}

[data-theme="dark"] .task-comment-indicator .comment-count {
    color: #0F1015;
}

[data-theme="dark"] .mentee-taskview-item.active {
    color: #0F1015;
}

[data-theme="dark"] .mentee-taskview-item.active .checkbox-custom {
    border-color: rgba(0, 0, 0, 0.35);
    color: rgba(0, 0, 0, 0.65);
}

[data-theme="dark"] .floating-toolbar {
    background: #22252F;
}

[data-theme="dark"] .floating-toolbar .toolbar-select option {
    background: #22252F;
    color: var(--text-primary);
}

[data-theme="dark"] .toast {
    background: #22252F;
    color: var(--text-primary);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
    box-shadow: 0 0 0 2px rgba(212, 212, 216, 0.25);
}

[data-theme="dark"] .video-progress-track {
    background: var(--border-color);
}

/* Theme toggle icon state */
.btn-theme-toggle .icon-sun {
    display: none;
}

.btn-theme-toggle .icon-moon {
    display: inline-flex;
}

[data-theme="dark"] .btn-theme-toggle .icon-sun {
    display: inline-flex;
}

[data-theme="dark"] .btn-theme-toggle .icon-moon {
    display: none;
}

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

body {
    font-family: 'DM Sans', sans-serif;
    font-weight: 300;
    background-color: var(--bg-main);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    height: 100vh;
    overflow: hidden;
}

/* Typography */
b,
strong {
    font-weight: 500;
}

h1,
h2,
h3,
h4 {
    color: var(--text-primary);
    font-weight: 600;
}

a {
    color: #000000;
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

/* --- Utility Classes --- */
.view {
    display: none;
    height: 100vh;
    width: 100vw;
}

.view.active {
    display: flex;
}

.mb-4 {
    margin-bottom: 1rem;
}

.hidden {
    display: none !important;
}

/* --- Buttons & Inputs --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
}

.btn-block {
    width: 100%;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.input-icon {
    position: relative;
}

.input-icon i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-icon input {
    padding-left: 2.75rem;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.625rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
    background-color: var(--bg-surface);
    color: var(--text-primary);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* --- Login View --- */
.login-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
}

.login-card {
    width: 100%;
    max-width: 480px;
    margin: auto;
    padding: 3rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    z-index: 10;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header .logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
}

.login-header .community-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 1.25rem;
}

/* login logo: wide and centered */
.login-header .community-brand img {
    width: 240px;
    max-width: 100%;
    height: auto;
    display: block;
}

/* login name without logo: large prominent text */
.login-header .community-brand span {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.login-hint {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0.75rem;
    background: var(--bg-main);
    border-radius: var(--radius-sm);
}


/* --- Dashboard Layout --- */
.sidebar {
    width: 260px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar .logo {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.community-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    overflow: hidden;
}

/* sidebar logo: scales proportionally, max 220px wide, max 60px tall, centered */
.community-brand img {
    max-width: 220px;
    max-height: 60px;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* sidebar name without logo: larger readable text */
.community-brand span {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow-y: auto;
}

.sidebar-nav-fixed {
    flex: 0 0 auto;
    padding: 1.5rem 1rem 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
}

.nav-item i {
    font-size: 1.25rem;
}

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

.nav-item.active {
    background: var(--primary-light);
    color: #000000;
}

.nav-item.locked {
    opacity: 0.6;
    background: transparent;
    cursor: not-allowed;
}

/* ── Phase Accordion ────────────────────────────────────────────────────────── */
.nav-phase-group {
    display: flex;
    flex-direction: column;
}

.nav-phase-caret {
    margin-left: auto;
    font-size: 0.85rem !important;
    flex-shrink: 0;
    transition: transform 0.2s ease;
    color: var(--text-secondary);
    padding: 4px;
    margin-right: -4px;
    border-radius: 4px;
    cursor: pointer;
}

.nav-phase-caret:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.nav-item.open .nav-phase-caret {
    transform: rotate(180deg);
}

.nav-phase-badge {
    margin-left: auto;
    margin-right: 4px;
}

.nav-phase-tasks {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 4px 0;
    overflow: hidden;
}

.nav-phase-tasks.open {
    display: flex;
}

/* Inside accordion: labels always visible, compact style */
.nav-phase-tasks .mentee-taskview-item {
    white-space: nowrap;
    overflow: hidden;
}

.nav-phase-tasks .mentee-taskview-item .task-label {
    opacity: 1 !important;
    transition: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Sidebar Community Nav ─────────────────────────────────────────────────── */
#sidebar-community-nav {
    border-top: 1px solid var(--border-color);
    margin-top: 0.5rem;
    padding-top: 0.75rem;
}

.sidebar-community-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.sidebar-community-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.sidebar-section-label {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem 0.25rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 0.35rem;
    cursor: default;
}

.sidebar-subsection-item {
    display: flex;
    align-items: center;
    padding: 0.35rem 0.75rem 0.35rem 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.sidebar-subsection-item:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.sidebar-subsection-item.active {
    background: var(--primary-light);
    color: #000;
}

[data-theme="dark"] .sidebar-subsection-item.active {
    color: var(--text-primary);
}

/* ── Sidebar drag handles ──────────────────────────────────────────────────── */
.sidebar-drag-handle {
    font-size: 0.9rem;
    opacity: 0;
    cursor: grab;
    flex-shrink: 0;
    margin-left: auto;
    margin-right: 0.25rem;
    order: 98;
    transition: opacity 0.15s;
}

.sidebar-section-group:hover .sidebar-drag-handle,
.sidebar-subsection-item:hover .sidebar-drag-handle,
.sidebar-section-clickable:hover .sidebar-drag-handle {
    opacity: 0.45;
}

/* ── Sidebar section header (clickable) ────────────────────────────────────── */
.sidebar-section-clickable {
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.sidebar-section-clickable:hover {
    background: var(--bg-surface-hover);
}

.sidebar-section-clickable.active {
    background: var(--primary-light);
    color: var(--text-primary);
}

.sidebar-section-label-text {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-sidebar-add-subsec {
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0;
    padding: 0 2px;
    display: flex;
    align-items: center;
    color: var(--text-muted);
    transition: opacity 0.15s;
    flex-shrink: 0;
}

.btn-sidebar-add-subsec i {
    font-size: 0.65rem;
}

.sidebar-section-clickable:hover .btn-sidebar-add-subsec {
    opacity: 0.7;
}

.btn-sidebar-add-subsec:hover {
    opacity: 1 !important;
    color: var(--primary);
}

/* ── Sidebar add section dropdown ──────────────────────────────────────────── */
.sidebar-add-section-wrapper {
    position: relative;
}

.sidebar-add-section-dropdown {
    position: fixed;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    min-width: 210px;
    padding: 4px 0;
}

.sidebar-add-opt {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.45rem 0.85rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.82rem;
    text-align: left;
    color: var(--text-primary);
    transition: background 0.1s;
}

.sidebar-add-opt:hover {
    background: var(--bg-surface-hover);
}

.sidebar-add-opt i {
    opacity: 0.6;
}

/* ── End Sidebar Community Nav ─────────────────────────────────────────────── */

/* ── Nav Group (collapsible, e.g. Configurações) ──────────────────────────── */
.nav-group {
    display: flex;
    flex-direction: column;
}

.nav-group-trigger {
    width: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    color: inherit;
}

.nav-group-arrow {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.nav-group-trigger[aria-expanded="true"] .nav-group-arrow {
    transform: rotate(180deg);
}

.nav-group-trigger.has-active-child {
    background: var(--primary-light);
    color: #000;
}

[data-theme="dark"] .nav-group-trigger.has-active-child {
    color: var(--text-primary);
}

.nav-group-children {
    display: none;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.15rem 0 0.15rem 0.75rem;
}

.nav-group-children.open {
    display: flex;
}

.nav-sub-item {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.82rem !important;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-sub-item:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.nav-sub-item.active {
    background: var(--primary-light);
    color: #000;
    font-weight: 600;
}

[data-theme="dark"] .nav-sub-item.active {
    color: var(--text-primary);
}

/* ── End Nav Group ─────────────────────────────────────────────────────────── */


/* ── Post Card ─────────────────────────────────────────────────────────────── */
.post-card {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    border: 1px solid #E5E7EB;
    border-radius: 15px;
    overflow: hidden;
    background: var(--bg-surface);
}

[data-theme="dark"] .post-card {
    border-color: var(--border-color);
}

.post-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem 0;
}

.post-card-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    overflow: hidden;
    user-select: none;
}

.post-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.post-card-author {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.post-card-date {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.post-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 1rem 1.5rem 0.5rem;
}

.post-card-content {
    padding: 0 1.5rem 1.25rem;
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.6;
}

.post-card-footer {
    border-top: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    gap: 0.25rem;
}

[data-theme="dark"] .post-card-footer {
    border-color: var(--border-color);
}

.post-card-action-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.post-card-action-btn:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.post-card-action-btn.liked {
    color: #E53E3E;
}

/* Heart icon toggle via CSS — no JS icon manipulation needed */
.btn-like-post .heart-fill {
    display: none;
}

.btn-like-post .heart-outline {
    display: block;
}

.btn-like-post.liked .heart-outline {
    display: none;
}

.btn-like-post.liked .heart-fill {
    display: block;
}

.post-card-comments {
    border-top: 1px solid #E5E7EB;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

[data-theme="dark"] .post-card-comments {
    border-color: var(--border-color);
}

.post-card-comment-form {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.post-card-comment-input {
    flex: 1;
    padding: 0.6rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.875rem;
    resize: none;
    font-family: inherit;
}

.post-card-comment-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* ── End Post Card ─────────────────────────────────────────────────────────── */

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.user-info .details {
    display: flex;
    flex-direction: column;
}

.user-info .name {
    font-size: 0.875rem;
    font-weight: 600;
}

.user-info .role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Super Admin / shared layout: content panel next to sidebar */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    min-width: 0;
}

.scrollable-area {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}


.topbar {
    height: 70px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.topbar h2 {
    font-size: 1.25rem;
}

/* ── Notifications dropdown ─────────────────────────────────────────────── */
.mentee-notif-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
    position: relative;
}

.mentee-notif-item:last-child {
    border-bottom: none;
}

.mentee-notif-item:hover {
    background: var(--bg-hover, rgba(0, 0, 0, 0.04));
}

.mentee-notif-item--read {
    opacity: 0.55;
}

.mentee-notif-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.mentee-notif-body {
    flex: 1;
    min-width: 0;
}

.mentee-notif-title {
    font-size: 0.8rem;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 0.2rem;
}

.mentee-notif-preview {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.2rem;
}

.mentee-notif-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.mentee-notif-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    margin-top: 4px;
}

.scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

/* --- Admin Views --- */
.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
}

/* Phase Cards */
.phase-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.phase-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: var(--bg-surface);
}

.phase-card-title h3 {
    margin-bottom: 0.25rem;
}

.phase-card-title p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.phase-rule-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--primary-light);
    color: #000000;
    font-size: 0.75rem;
    border-radius: 4px;
    margin-top: 0.5rem;
    font-weight: 500;
}

.task-list {
    padding: 1rem 1.5rem;
}

.task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    background: var(--bg-main);
}

.task-item:last-child {
    margin-bottom: 0;
}

/* Mentee Progress Cards */
.user-progress-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-progress-info h4 {
    margin-bottom: 0.5rem;
}

.user-progress-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.progress-bar-container {
    width: 200px;
}

/* --- Mentee Views --- */
.phase-container {
    max-width: 800px;
    margin: 0 auto;
}

/* Phase banner (full-bleed within scroll-area) */
.phase-banner-wrapper {
    margin: -2rem -2rem 0 -2rem;
}

.phase-banner {
    width: 100%;
    aspect-ratio: 6 / 1;
    object-fit: cover;
    display: block;
}

/* Inner container when banner is present — re-applies the max-width centering */
.phase-inner-container {
    max-width: 800px;
    margin: 0 auto;
}

/* Phase hero card overlapping the banner */
.phase-hero--with-banner {
    margin-top: -2.5rem;
    position: relative;
    z-index: 1;
}

.phase-hero {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.phase-hero h1 {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.phase-hero p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.progress-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.progress-track {
    height: 8px;
    background: var(--bg-main);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--success);
    width: 0%;
    transition: width 0.5s ease-in-out;
}

.mentee-task-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mentee-task-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.task-comment-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    color: var(--text-muted);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.task-comment-indicator .comment-count {
    background: var(--primary);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.mentee-task-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.mentee-task-item.completed {
    opacity: 0.8;
    background: var(--bg-main);
}

.mentee-task-item.completed .task-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

.checkbox-custom {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: var(--transition);
    flex-shrink: 0;
}

.mentee-task-item.completed .checkbox-custom {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.locked-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-color);
}

.locked-state i {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* --- Account Modal Tabs --- */
.account-modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    padding: 0 1.5rem;
    gap: 0;
    background: var(--bg-surface);
}

.account-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
}

.account-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.account-tab-pane {
    display: none;
}

.account-tab-pane.active {
    display: block;
}

.account-avatar-section {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.account-avatar-preview {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 1.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 3px solid var(--border-color);
}

.account-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.account-avatar-actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.btn-link-danger {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* --- Modals --- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 40;
    display: none;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 90%;
    max-width: 720px;
    height: calc(100vh - 100px);
    background: var(--bg-surface);
    border-radius: 0;
    box-shadow: var(--shadow-lg);
    z-index: 50;
    display: none;
    flex-direction: column;
    opacity: 0;
    transition: all 0.2s ease-in-out;
}

.modal.show {
    display: flex;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.modal-backdrop.show {
    display: block;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-body {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
}

.p-0 {
    padding: 0 !important;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
    position: sticky;
    bottom: -1.5rem;
    background: var(--bg-surface);
    padding-bottom: 1.5rem;
    margin-bottom: -1.5rem;
    z-index: 10;
}

.settings-group {
    background: var(--bg-main);
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-top: 1rem;
}

.settings-group h4 {
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--text-primary);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: translateY(100%);
    opacity: 0;
    animation: toast-in 0.3s forwards;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

@keyframes toast-in {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ── Mentee Inline Task View ─────────────────────────────────────────────── */
#view-mentee .scroll-area {
    background: var(--bg-surface);
}

#mentee-task-view {
    margin: -2rem;
}

.mentee-task-view-layout {
    display: flex;
    align-items: flex-start;
    min-height: 100vh;
    position: relative;
}

.mentee-task-view-main {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: center;
    padding: 2rem;
    margin-right: 84px;
}

.mentee-task-view-content {
    width: 100%;
    max-width: 720px;
}

.mentee-task-view-sidebar {
    width: 84px;
    flex-shrink: 0;
    background: var(--bg-surface);
    border-left: 1px solid var(--border-color);
    overflow: hidden;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 10;
    transition: width 0.25s ease;
    cursor: pointer;
    overflow-y: auto;
}

/* ── Task view: sidebar fixed (scroll happens inside the content column) ───── */
#view-mentee .scroll-area:has(#mentee-task-view.active) {
    overflow: hidden;
    padding: 0;
}

#view-mentee .scroll-area:has(#mentee-task-view.active) #mentee-task-view {
    margin: 0;
    height: 100%;
}

#view-mentee .scroll-area:has(#mentee-task-view.active) .mentee-task-view-layout {
    height: 100%;
    min-height: 0;
}

#view-mentee .scroll-area:has(#mentee-task-view.active) .mentee-task-view-main {
    overflow-y: auto;
    height: 100%;
}

#view-mentee .scroll-area:has(#mentee-task-view.active) .mentee-task-view-sidebar {
    position: absolute;
    height: 100%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

.mentee-task-view-sidebar:hover {
    width: min(252px, 35%);
}

/* Header: collapsed shows short label, expanded shows full label */
.mentee-task-view-sidebar-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 1.5rem 16px 20px;
    white-space: nowrap;
    overflow: hidden;
}

.mentee-task-view-sidebar-title .title-short {
    display: block;
}

.mentee-task-view-sidebar-title .title-full {
    display: none;
}

.mentee-task-view-sidebar:hover .mentee-task-view-sidebar-title .title-short {
    display: none;
}

.mentee-task-view-sidebar:hover .mentee-task-view-sidebar-title .title-full {
    display: block;
}

#mentee-task-view-tasklist {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 16px;
}

.mentee-taskview-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: background 0.15s;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
}

.mentee-taskview-item:hover {
    background: var(--bg-surface-hover);
}

.mentee-taskview-item.active {
    background: var(--primary);
    font-weight: 600;
    border-color: var(--primary);
    color: white;
}

.mentee-taskview-item.active .checkbox-custom {
    border-color: rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.8);
}

.mentee-taskview-item .checkbox-custom {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
    font-weight: 600;
}

.mentee-taskview-item.completed .checkbox-custom {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

/* Task label hidden when retracted, shown on hover */
.mentee-taskview-item .task-label {
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    transition: opacity 0.15s ease 0.1s;
}

.mentee-task-view-sidebar:hover .mentee-taskview-item .task-label {
    opacity: 1;
}


@media (max-width: 768px) {
    .mentee-task-view-layout {
        flex-direction: column;
    }

    .mentee-task-view-main {
        padding: 1.5rem 1rem;
    }

    .mentee-task-view-sidebar {
        width: 100%;
        position: static;
        border-right: none;
        border-left: none;
        border-top: none;
        border-bottom: 1px solid var(--border-color);
        height: auto !important; /* Override absolute height */
        box-shadow: none !important;
    }

    .mentee-task-view-sidebar:hover {
        width: 100%;
        box-shadow: none;
    }

    /* Transform Task List into a Horizontal Scrollable Chips Row on Mobile */
    .mentee-task-view-sidebar-title {
        padding: 1rem 1rem 0.5rem;
    }

    .mentee-task-view-sidebar-title .title-full {
        display: block !important; 
    }
    .mentee-task-view-sidebar-title .title-short {
        display: none !important;
    }

    #mentee-task-view-tasklist {
        flex-direction: row;
        overflow-x: auto;
        padding: 0 1rem 1rem;
        gap: 0.5rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Hide scrollbar for slick UI */
    }
    #mentee-task-view-tasklist::-webkit-scrollbar {
        display: none;
    }

    .mentee-taskview-item {
        padding: 0.5rem 1rem;
        border-radius: 999px; /* Pill shape */
        flex-shrink: 0;
        background: var(--bg-surface);
    }

    .mentee-taskview-item .task-label {
        opacity: 1 !important; /* Force text to show */
    }
    
    /* Fix Chat Layout */
    .chat-layout-admin {
        flex-direction: column !important;
        height: auto !important;
        border: none !important;
        gap: 0 !important;
    }
    .chat-sidebar {
        width: 100% !important;
        border-right: none !important;
        border-bottom: 1px solid var(--border-color) !important;
        max-height: 250px; /* Allow partial scrolling of thread list */
    }
    .chat-main {
        min-height: 500px;
    }
}

@keyframes spin-pulse {
    0% {
        transform: rotate(0deg);
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }

    100% {
        transform: rotate(360deg);
        opacity: 1;
    }
}

/* Custom Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    margin: 0;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--danger);
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked+.toggle-slider {
    background-color: var(--success);
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(20px);
}

/* --- Badges --- */
.badge {
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 0.15rem 0.4rem;
    border-radius: 12px;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
}

/* --- Chat System --- */
.msg-bubble {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    position: relative;
    word-wrap: break-word;
    font-size: 0.875rem;
}

.msg-sent {
    background: var(--primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.msg-received {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-color);
}

.msg-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
    gap: 1rem;
    opacity: 0.8;
}

.msg-task-link {
    display: inline-block;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: underline;
    opacity: 0.9;
}

.msg-task-link:hover {
    color: inherit;
    opacity: 1;
}

.chat-user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.chat-user-item:hover {
    background: var(--bg-surface-hover);
}

.chat-user-item.active {
    background: var(--primary-light);
    color: #000000;
}

.chat-user-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.chat-user-item-name {
    font-weight: 600;
    font-size: 0.875rem;
}

.chat-user-item-preview {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

/* Responsive */
/* Mobile Sidebar Backdrop (Hidden on Desktop) */
.mobile-sidebar-backdrop {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    /* Expose Mobile Interactions */
    #btn-mobile-menu, .btn-close-sidebar-mobile {
        display: flex !important;
    }

    .mobile-sidebar-backdrop {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0,0,0,0.4);
        backdrop-filter: blur(2px);
        z-index: 9998;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .mobile-sidebar-backdrop.show {
        opacity: 1;
        pointer-events: auto;
    }

    .view {
        flex-direction: column;
    }

    /* Premium Drawer Sidebar */
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 90vw;
        height: 100vh;
        z-index: 9999;
        border-right: 1px solid var(--border-color);
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 0 20px rgba(0,0,0,0.5);
    }
    
    .sidebar.open {
        left: 0;
    }

    .sidebar-nav {
        flex-direction: column !important; /* Overriding previous flex-row hack */
        overflow-x: hidden !important;
        overflow-y: auto !important;
        padding: 0;
    }

    .sidebar-footer {
        display: flex !important; /* Restore the user info and logout buttons */
    }

    .topbar {
        padding: 0 1rem;
        min-height: 60px;
    }

    .scroll-area {
        padding: 1rem;
    }

    .modal {
        width: 95vw;
        max-height: 85vh;
        margin: auto;
    }

    /* Mobile Logo (left-aligned and scalable) */
    .community-brand {
        justify-content: flex-start !important;
    }
    .community-brand img {
        margin: 0 !important;
        max-width: 100% !important;
        height: auto !important;
        object-fit: contain;
    }

    /* Mobile Breadcrumb Adjustments */
    .breadcrumb {
        flex-wrap: nowrap;
        overflow: hidden;
        min-width: 0;
    }
    #mentee-phase-title {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;
    }
    #mentee-task-subtitle {
        display: none !important; /* Hide specific task path to save space */
    }
}

/* --- Quill Content Fixes --- */
.modal-quill-content ul,
.modal-quill-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.modal-quill-content li {
    margin-bottom: 0.25rem;
}

.modal-quill-content p:last-child,
.modal-quill-content ul:last-child,
.modal-quill-content ol:last-child {
    margin-bottom: 0;
}

.modal-quill-content a {
    color: var(--primary);
    text-decoration: underline;
}

/* --- Task Editor (Notion-like) --- */
.modal-editor {
    max-width: 1100px !important;
}

.task-editor-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    height: 100%;
}

.task-editor-sidebar {
    width: 200px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    padding: 1rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow-y: auto;
}

.draggable-sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    cursor: grab;
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: background 0.2s;
}

.draggable-sidebar-item:hover {
    background: var(--bg-surface-hover);
}

.draggable-sidebar-item i {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

.task-editor-main {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    background: var(--bg-surface);
}

.editor-canvas {
    width: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 4rem;
}

.editor-empty-state {
    color: var(--text-muted);
    padding: 3rem 2rem;
    text-align: center;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    max-width: 720px;
    width: 100%;
    margin: 0;
    font-size: 0.95rem;
    background: transparent;
}

.editor-block-wrapper {
    position: relative;
    width: 100%;
    max-width: 720px;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.editor-drag-handle {
    position: absolute;
    left: -2rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: grab;
    opacity: 0;
    color: var(--text-muted);
    font-size: 1.25rem;
    transition: opacity 0.2s;
    user-select: none;
    line-height: 1;
    padding: 0.25rem;
    border-radius: 4px;
}

.editor-drag-handle:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.editor-block-wrapper:hover .editor-drag-handle {
    opacity: 1;
}

.editor-block-content {
    flex: 1;
    min-height: 1.5rem;
    outline: none;
    padding: 0.25rem 0;
    word-break: break-word;
    width: 100%;
}

.editor-block-content[contenteditable="true"]:empty:before {
    content: attr(data-placeholder);
    color: var(--text-muted);
    pointer-events: none;
    display: block;
}

/* Video Progress UI */
.video-progress-area {
    width: 100%;
    padding: 2rem;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.5rem;
}

.video-progress-text {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

.video-progress-subtext {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.video-progress-track {
    width: 100%;
    max-width: 400px;
    height: 6px;
    background: #E5E7EB;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.video-progress-fill {
    height: 100%;
    background: #10B981;
    /* Default emerald green */
    width: 0%;
    transition: width 0.2s ease;
}

/* Floating Toolbar */
.floating-toolbar {
    position: fixed;
    z-index: 3000;
    background: var(--text-primary);
    color: white;
    padding: 0.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: opacity 0.2s, transform 0.2s;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px) translateX(-50%);
}

.floating-toolbar.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) translateX(-50%);
}

.floating-toolbar button {
    background: transparent;
    border: none;
    color: white;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-toolbar button:hover,
.floating-toolbar .color-picker-label:hover {
    background: rgba(255, 255, 255, 0.1);
}

.floating-toolbar button.active {
    background: var(--primary);
    color: #fff;
}

.floating-toolbar .divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 0.25rem;
}

.floating-toolbar .color-picker-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    position: relative;
    color: white;
    transition: background 0.2s;
}

.floating-toolbar .color-picker-label input[type="color"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    cursor: pointer;
}

.floating-toolbar .toolbar-select {
    background: transparent;
    color: white;
    border: none;
    appearance: none;
    -webkit-appearance: none;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
}

.floating-toolbar .toolbar-select:hover {
    background: rgba(255, 255, 255, 0.1);
}

.floating-toolbar .toolbar-select option {
    background: var(--bg-surface);
    color: var(--text-primary);
}

/* Styles for specific blocks */
.block-divider {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 1rem 0;
    width: 100%;
}

.block-upload-area {
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    background: var(--bg-surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    cursor: pointer;
}

.block-upload-area:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.block-upload-area i {
    font-size: 2rem;
    color: var(--text-muted);
}

.block-media {
    max-width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: block;
}

.block-file {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    width: 100%;
}

.block-file i {
    font-size: 1.5rem;
    color: var(--primary);
}

.block-file:hover {
    border-color: var(--primary);
}

/* Drop Indicator */
.drop-indicator {
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
    margin: 0.25rem 0;
    display: none;
}

.drop-indicator.active {
    display: block;
}

/* --- Multi-Tenant Account Selector --- */
.tenant-card {
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.tenant-card:hover {
    border-color: var(--primary);
    background: var(--bg-surface-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.tenant-card h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.tenant-card .tenant-role {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.tenant-card .tenant-arrow {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: transform 0.2s ease, color 0.2s ease;
}

.tenant-card:hover .tenant-arrow {
    transform: translateY(-50%) translateX(4px);
    color: var(--primary);
}

/* ── Task comments redesign ────────────────────────────────────────────────── */
.task-comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.task-comments-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.task-comments-privacy {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    background: var(--bg-surface-hover);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0.25rem 0.65rem;
    white-space: nowrap;
}

.task-comments-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    min-height: 60px;
}

.task-comment {
    display: flex;
    gap: 0.875rem;
    align-items: flex-start;
    position: relative;
}

.task-comment-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    overflow: hidden;
    user-select: none;
}

.task-comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.task-comment-body {
    flex: 1;
    min-width: 0;
    position: relative;
}

.task-comment-meta {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
    flex-wrap: wrap;
}

.task-comment-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.task-comment-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.task-comment-badge {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--primary);
    color: #fff;
    opacity: 0.85;
    vertical-align: middle;
    line-height: 1.6;
}

/* Admin chat context pill */
.admin-chat-context-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg-app);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 3px 10px 3px 8px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-chat-context-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.admin-chat-context-pill.active {
    border-color: var(--primary);
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 8%, transparent);
}

/* Context dropdown items */
.admin-chat-context-dropdown-phase {
    padding: 0.5rem 0.75rem 0.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-chat-context-dropdown-task {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem 0.5rem 1.25rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.1s;
    border-radius: 4px;
    margin: 0 0.25rem;
    color: var(--text-primary);
}

.admin-chat-context-dropdown-task:hover {
    background: var(--bg-surface);
}

.admin-chat-context-dropdown-task.selected {
    color: var(--primary);
    font-weight: 600;
}

.admin-chat-context-dropdown-task.selected::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
}

/* Per-task group reply button */
.chat-group-reply-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.5rem 0 0.25rem 0;
    padding: 0.35rem 0.875rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    background: var(--primary);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: opacity 0.15s;
}

.chat-group-reply-btn:hover {
    opacity: 0.85;
}

/* Chat filter select */
.admin-chat-filter-select {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-app);
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
    max-width: 200px;
}

.admin-chat-filter-select:focus {
    border-color: var(--primary);
}

/* Reply quoted block — appears above the message text */
.chat-reply-block {
    display: flex;
    flex-direction: column;
    border-left: 3px solid var(--primary);
    border-radius: 0 6px 6px 0;
    background: color-mix(in srgb, var(--primary) 8%, transparent);
    padding: 0.35rem 0.65rem;
    margin-bottom: 0.4rem;
    overflow: hidden;
}

.chat-reply-block-sender {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.1rem;
}

.chat-reply-block-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Reply preview in the input area */
.chat-reply-preview {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-left: 3px solid var(--primary);
    border-radius: 0 6px 6px 0;
    background: color-mix(in srgb, var(--primary) 8%, transparent);
    padding: 0.35rem 0.5rem 0.35rem 0.65rem;
    margin-bottom: 0.5rem;
}

.chat-reply-preview-content {
    flex: 1;
    min-width: 0;
}

.chat-reply-preview-sender {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.1rem;
}

.chat-reply-preview-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-comment-text {
    font-size: 0.875rem;
    color: var(--text-primary);
    line-height: 1.55;
    word-break: break-word;
    white-space: pre-wrap;
}

.task-comment-file {
    margin-top: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-surface-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm, 6px);
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    text-decoration: none;
    color: var(--text-primary);
}

.task-comment-file:hover {
    background: var(--bg-surface);
}

/* Inline reply button — always visible, low opacity, on all messages */
.task-comment-reply-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0.2;
    transition: opacity 0.15s;
    margin-top: 2px;
    padding: 0 2px;
}

.task-comment:hover .task-comment-reply-btn {
    opacity: 1;
}

.task-comment-actions {
    display: none;
    gap: 0.25rem;
    position: absolute;
    right: 0;
    top: 0;
}

.task-comment:hover .task-comment-actions {
    display: flex;
}

.task-comment-actions .btn-icon {
    padding: 3px 6px;
    height: auto;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.task-comment-actions .btn-icon:hover {
    color: var(--text-primary);
}

.task-comment-actions .btn-del {
    color: var(--danger) !important;
}

/* Input area */
.task-comments-form {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.task-comments-input-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.35rem 0.5rem 0.35rem 0.25rem;
    transition: border-color 0.15s;
}

.task-comments-input-row:focus-within {
    border-color: var(--primary);
}

.task-comments-attach-btn {
    color: var(--text-muted);
    flex-shrink: 0;
}

.task-comments-input {
    flex: 1;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    padding: 0.3rem 0.25rem !important;
    font-size: 0.875rem;
    box-shadow: none !important;
}

.task-comments-send-btn {
    color: var(--primary);
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   FORM BLOCK — EDITOR (ADMIN)
   ═══════════════════════════════════════════════════════════════════ */
.form-builder-container {
    border: 1.5px solid var(--primary);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-surface);
}

.form-builder-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-main);
    border-bottom: 1px solid var(--border-color);
}

.form-builder-fields {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.form-builder-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.form-builder-empty i {
    font-size: 1.5rem;
}

.form-field-row {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface);
    transition: background 0.15s;
}

.form-field-row:last-child {
    border-bottom: none;
}

.form-field-row:hover {
    background: var(--bg-surface-hover);
}

.form-field-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.1rem;
}

.form-field-type-badge {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--primary);
    background: var(--primary-light);
    padding: 2px 7px;
    border-radius: 99px;
}

/* ═══════════════════════════════════════════════════════════════════
   FORM BLOCK — MENTEE VIEW
   ═══════════════════════════════════════════════════════════════════ */
.mentee-form-block {
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 1.25rem;
    background: var(--bg-surface);
}

.mentee-form-block-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-main);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.mentee-form-block-header i {
    color: var(--primary);
    font-size: 1.1rem;
}

.mentee-form-fields {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mentee-form-field {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.mentee-form-field:last-child {
    border-bottom: none;
}

.mentee-form-field--error .mentee-form-input,
.mentee-form-field--error .mentee-file-upload-area,
.mentee-form-field--error .mentee-yes-no-group,
.mentee-form-field--error .mentee-scale-group {
    border-color: var(--danger) !important;
    outline: 1px solid var(--danger);
}

.mentee-form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.mentee-form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-main);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.mentee-form-input:focus {
    outline: none;
    border-color: var(--primary);
}

.mentee-form-input[readonly] {
    opacity: 0.7;
    cursor: default;
}

.mentee-form-options {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.mentee-form-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
    color: var(--text-primary);
}

.mentee-form-option input {
    width: auto;
    margin: 0;
    cursor: pointer;
}

/* Scale */
.mentee-scale-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.25rem 0;
}

.mentee-scale-btn {
    min-width: 36px;
    height: 36px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-main);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.mentee-scale-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.mentee-scale-btn.active {
    background: var(--primary);
    color: var(--bg-surface);
    border-color: var(--primary);
}

.mentee-scale-btn:disabled {
    opacity: 0.55;
    cursor: default;
}

/* Yes / No */
.mentee-yes-no-group {
    display: flex;
    gap: 0.5rem;
}

.mentee-yes-no-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1.25rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-main);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.mentee-yes-no-btn:hover:not(:disabled) {
    border-color: var(--primary);
}

.mentee-yes-no-btn.active {
    background: var(--primary);
    color: var(--bg-surface);
    border-color: var(--primary);
}

.mentee-yes-no-btn:disabled {
    opacity: 0.55;
    cursor: default;
}

/* File upload zone */
.mentee-file-upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 1rem;
    border: 1.5px dashed var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-main);
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: border-color 0.15s, color 0.15s;
}

.mentee-file-upload-area:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.mentee-file-upload-area i {
    font-size: 1.4rem;
}

.mentee-file-preview {
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Form footer */
.mentee-form-footer {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-main);
}

.mentee-form-submitted-notice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--success);
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-main);
}

.mentee-form-submitted-notice i {
    font-size: 1.1rem;
}

/* ═══════════════════════════════════════════════════════════════════
   FORM RESPONSES MODAL (ADMIN)
   ═══════════════════════════════════════════════════════════════════ */
.form-response-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 1rem;
    background: var(--bg-surface);
}

.form-response-card-header {
    padding: 0.75rem 1rem;
    background: var(--bg-main);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.form-response-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0;
}

.form-response-field {
    padding: 0.75rem 1rem;
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.form-response-field:last-child {
    border-right: none;
}

.form-response-field-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.form-response-field-value {
    font-size: 0.875rem;
    color: var(--text-primary);
    word-break: break-word;
}

/* ═══════════════════════════════════════════════════════════════════
   FORM RESPONSE CARD — ADMIN CHAT
   ═══════════════════════════════════════════════════════════════════ */
.form-chat-response-card {
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-sm);
    background: var(--bg-main);
    margin: 0.75rem 0 1rem;
    overflow: hidden;
    font-size: 0.875rem;
}

.form-chat-response-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-surface);
}

.form-chat-response-header i {
    color: var(--primary);
    flex-shrink: 0;
}

.form-chat-response-date {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

.form-chat-fields {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.form-chat-field {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.82rem;
}

.form-chat-field:last-child {
    border-bottom: none;
}

.form-chat-field-label {
    font-weight: 500;
    color: var(--text-muted);
    min-width: 110px;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.form-chat-field-value {
    color: var(--text-primary);
    word-break: break-word;
}